diff --git a/ExampleProject/Config/DefaultEditor.ini b/ExampleProject/Config/DefaultEditor.ini new file mode 100644 index 000000000..6838df001 --- /dev/null +++ b/ExampleProject/Config/DefaultEditor.ini @@ -0,0 +1,5 @@ +[EditoronlyBP] +bAllowClassAndBlueprintPinMatching=true +bReplaceBlueprintWithClass=true +bDontLoadBlueprintOutsideEditor=true +bBlueprintIsNotBlueprintType=true diff --git a/ExampleProject/Config/DefaultEngine.ini b/ExampleProject/Config/DefaultEngine.ini new file mode 100644 index 000000000..f370446db --- /dev/null +++ b/ExampleProject/Config/DefaultEngine.ini @@ -0,0 +1,60 @@ +[URL] +[/Script/Engine.UserInterfaceSettings] +RenderFocusRule=NavigationOnly +DefaultCursor=None +TextEditBeamCursor=None +CrosshairsCursor=None +GrabHandCursor=None +GrabHandClosedCursor=None +SlashedCircleCursor=None +ApplicationScale=1.000000 +UIScaleRule=ShortestSide +CustomScalingRuleClass=None +UIScaleCurve=(EditorCurveData=(PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant,Keys=((Time=480.000000,Value=0.444000),(Time=720.000000,Value=0.666000),(Time=1080.000000,Value=1.000000),(Time=8640.000000,Value=8.000000))),ExternalCurve=None) + +[/Script/Engine.RendererSettings] +r.MobileHDR=True +r.MobileNumDynamicPointLights=4 +r.MobileDynamicPointLightsUseStaticBranch=True +r.AllowOcclusionQueries=True +r.MinScreenRadiusForLights=0.030000 +r.MinScreenRadiusForDepthPrepass=0.030000 +r.PrecomputedVisibilityWarning=False +r.TextureStreaming=True +Compat.UseDXT5NormalMaps=False +r.AllowStaticLighting=True +r.NormalMapsForStaticLighting=False +r.GenerateMeshDistanceFields=False +r.GenerateLandscapeGIData=True +r.TessellationAdaptivePixelsPerTriangle=48.000000 +r.SeparateTranslucency=True +r.TranslucentSortPolicy=0 +TranslucentSortAxis=(X=0.000000,Y=-1.000000,Z=0.000000) +r.CustomDepth=1 +r.DefaultFeature.Bloom=True +r.DefaultFeature.AmbientOcclusion=True +r.DefaultFeature.AmbientOcclusionStaticFraction=True +r.DefaultFeature.AutoExposure=True +r.DefaultFeature.MotionBlur=True +r.DefaultFeature.LensFlare=True +r.DefaultFeature.AntiAliasing=2 +r.EarlyZPass=3 +r.EarlyZPassMovable=False +r.DBuffer=False +r.ClearSceneMethod=1 +r.BasePassOutputsVelocity=False +r.WireframeCullThreshold=5.000000 +UIScaleRule=ShortestSide +UIScaleCurve=(EditorCurveData=(PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant,Keys=),ExternalCurve=None) + +[/Script/EngineSettings.GameMapsSettings] +GameDefaultMap=/Game/Maps/Test +EditorStartupMap=/Game/Maps/Test + +[/Script/HardwareTargeting.HardwareTargetingSettings] +TargetedHardwareClass=Desktop +AppliedTargetedHardwareClass=Desktop +DefaultGraphicsPerformance=Maximum +AppliedDefaultGraphicsPerformance=Maximum + + diff --git a/ExampleProject/Config/DefaultGame.ini b/ExampleProject/Config/DefaultGame.ini new file mode 100644 index 000000000..32843efbb --- /dev/null +++ b/ExampleProject/Config/DefaultGame.ini @@ -0,0 +1,2 @@ +[/Script/EngineSettings.GeneralProjectSettings] +ProjectID=F986E4664AE32897B5A743A39C984F69 diff --git a/ExampleProject/Content/Maps/Test.umap b/ExampleProject/Content/Maps/Test.umap new file mode 100644 index 000000000..a44645019 Binary files /dev/null and b/ExampleProject/Content/Maps/Test.umap differ diff --git a/ExampleProject/Content/PfTestOutput.uasset b/ExampleProject/Content/PfTestOutput.uasset new file mode 100644 index 000000000..a6b5834d1 Binary files /dev/null and b/ExampleProject/Content/PfTestOutput.uasset differ diff --git a/ExampleProject/Content/PfTestWidget.uasset b/ExampleProject/Content/PfTestWidget.uasset new file mode 100644 index 000000000..357092cc0 Binary files /dev/null and b/ExampleProject/Content/PfTestWidget.uasset differ diff --git a/ExampleProject/ExampleProject.uproject b/ExampleProject/ExampleProject.uproject new file mode 100644 index 000000000..d0318323b --- /dev/null +++ b/ExampleProject/ExampleProject.uproject @@ -0,0 +1,13 @@ +{ + "FileVersion": 3, + "EngineAssociation": "4.20", + "Category": "PlayFab", + "Description": "PlayFab Blueprint SDK Example Project for Unreal Engine 4.", + "Modules": [ + { + "Name": "ExampleProject", + "Type": "Runtime", + "LoadingPhase": "Default" + } + ] +} diff --git a/ExampleProject/Plugins/PlayFab/Content/pf_icon.uasset b/ExampleProject/Plugins/PlayFab/Content/pf_icon.uasset new file mode 100644 index 000000000..8d6aabc4f Binary files /dev/null and b/ExampleProject/Plugins/PlayFab/Content/pf_icon.uasset differ diff --git a/ExampleProject/Plugins/PlayFab/PlayFab.uplugin b/ExampleProject/Plugins/PlayFab/PlayFab.uplugin new file mode 100644 index 000000000..57a903a51 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/PlayFab.uplugin @@ -0,0 +1,34 @@ +{ + "FileVersion": 3, + "FriendlyName": "PlayFab Marketplace Plugin", + "Version": 0, + "EngineVersion": "4.20", + "VersionName": "1.1.180829", + "CreatedBy": "PlayFab and Phoenix Labs", + "CreatedByURL": "https://playfab.com/", + "DocsURL": "https://api.playfab.com/", + "SupportURL": "https://community.playfab.com/index.html", + "Category": "PlayFab", + "Description": "PlayFab Marketplace plugin for Unreal Engine 4.20 Current API version: 1.1.180829", + "MarketplaceURL": "com.epicgames.launcher://ue/marketplace/content/217fdf581b784571af03d3fb6580368f", + "Modules": [ + { + "Name": "PlayFabCpp", + "Type": "Runtime", + "LoadingPhase": "PreDefault", + "WhitelistPlatforms": [ "Win64", "Win32", "Mac", "IOS", "Android" ] + }, + { + "Name": "PlayFab", + "Type": "Runtime", + "LoadingPhase": "PreDefault", + "WhitelistPlatforms": [ "Win64", "Win32", "Mac", "IOS", "Android" ] + }, + { + "Name": "PlayFabCommon", + "Type": "Runtime", + "LoadingPhase": "PreDefault", + "WhitelistPlatforms": [ "Win64", "Win32", "Mac", "IOS", "Android" ] + } + ] +} diff --git a/ExampleProject/Plugins/PlayFab/Resources/Icon128.png b/ExampleProject/Plugins/PlayFab/Resources/Icon128.png new file mode 100644 index 000000000..3033ae0ed Binary files /dev/null and b/ExampleProject/Plugins/PlayFab/Resources/Icon128.png differ diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PfTestActor.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PfTestActor.h new file mode 100644 index 000000000..62fb9828e --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PfTestActor.h @@ -0,0 +1,330 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "GameFramework/Actor.h" + +#include "PlayFabClientModels.h" +#include "PlayFabClientApi.h" + +#include "PlayFabAuthenticationModels.h" +#include "PlayFabAuthenticationApi.h" +#include "PlayFabDataModels.h" +#include "PlayFabDataApi.h" + +#include "PlayFabServerModels.h" +#include "PlayFabServerApi.h" + +#include "PfTestActor.generated.h" + +UENUM(BlueprintType) +enum class PlayFabApiTestActiveState : uint8 +{ + PENDING UMETA(DisplayName = "PENDING"), // Not started + ACTIVE UMETA(DisplayName = "ACTIVE"), // Currently testing + READY UMETA(DisplayName = "READY"), // An answer is sent by the http thread, but the main thread hasn't finalized the test yet + COMPLETE UMETA(DisplayName = "COMPLETE"), // Test is finalized and recorded + ABORTED UMETA(DisplayName = "ABORTED"), // todo +}; + +UENUM(BlueprintType) +enum class PlayFabApiTestFinishState : uint8 +{ + PASSED UMETA(DisplayName = "PASSED"), + FAILED UMETA(DisplayName = "FAILED"), + SKIPPED UMETA(DisplayName = "SKIPPED"), + TIMEDOUT UMETA(DisplayName = "TIMEDOUT"), +}; + +UCLASS(Blueprintable, BlueprintType) +class UPfTestContext : public UObject +{ + GENERATED_BODY() +public: + DECLARE_DYNAMIC_DELEGATE_OneParam(FApiTestCase, UPfTestContext*, error); + + UPROPERTY() + FString testName; + UPROPERTY() + PlayFabApiTestActiveState activeState; + UPROPERTY() + PlayFabApiTestFinishState finishState; + UPROPERTY() + FString testResultMsg; + UPROPERTY() + FApiTestCase testFunc; + UPROPERTY() + FDateTime startTime; + UPROPERTY() + FDateTime endTime; + + UFUNCTION() + void Setup(FString name, FApiTestCase func) + { + testName = name; + activeState = PlayFabApiTestActiveState::PENDING; + finishState = PlayFabApiTestFinishState::TIMEDOUT; + testResultMsg = ""; + testFunc = func; + startTime = 0; + endTime = 0; + }; + + UFUNCTION() + FString GenerateTestSummary(FDateTime now) + { + FDateTime tempEndTime = (activeState == PlayFabApiTestActiveState::COMPLETE) ? endTime : now; + FDateTime tempStartTime = (startTime != 0) ? startTime : now; + + FString temp; + temp = FString::FromInt((tempEndTime - tempStartTime).GetTotalMilliseconds()); + while (temp.Len() < 12) + temp = " " + temp; + temp += " ms, "; + switch (finishState) + { + case PlayFabApiTestFinishState::PASSED: temp += "pass: "; break; + case PlayFabApiTestFinishState::FAILED: temp += "FAILED: "; break; + case PlayFabApiTestFinishState::SKIPPED: temp += "SKIPPED: "; break; + case PlayFabApiTestFinishState::TIMEDOUT: temp += "TIMED OUT: "; break; + } + temp += testName; + if (testResultMsg.Len() > 0) + { + temp += " - "; + temp += testResultMsg; + } + return temp; + } +}; + +UCLASS() +class APfTestActor : public AActor +{ + GENERATED_BODY() + +public: + ///////////////////// Actor stuff ///////////////////// + APfTestActor(); // Sets default values for this actor's properties + virtual void BeginPlay() override; // Called when the game starts or when spawned + virtual void Tick(float DeltaSeconds) override; // Called every frame + + ///////////////////// API-test stuff ///////////////////// + + /* The active test summary */ + UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = PfTestSummary) + FString _outputSummary; + // A bunch of constants: load these from testTitleData.json + UPROPERTY() + FString TEST_TITLE_DATA_LOC = "testTitleData.json"; + UPROPERTY() + FString userEmail; + UPROPERTY() + FString TEST_DATA_KEY = "testCounter"; + UPROPERTY() + FString TEST_STAT_NAME = "str"; + UPROPERTY() + FString playFabId; + UPROPERTY() + FString entityId; + UPROPERTY() + FString entityType; + UPROPERTY() + FDateTime testMessageTime; + UPROPERTY() + TArray testContexts; + int testMessageInt; + + UFUNCTION() + void InitializeTestSuite(); + UFUNCTION() + void AppendTest(const FString& testFuncName); + UFUNCTION() + bool TickTestSuite(); + UFUNCTION() + FString GenerateTestSummary(); + + UFUNCTION() + bool ClassSetup(); + // Start a test, and block until the threaded response arrives + UFUNCTION() + void StartTest(UPfTestContext* testContext); + UFUNCTION() + void TickTest(UPfTestContext* testContext); + // This should be called in the api-responses, which are threaded. This will allow TickTest to finalize the test + UFUNCTION() + void EndTest(UPfTestContext* testContext, PlayFabApiTestFinishState finishState, FString resultMsg); + + UFUNCTION() + void OnSharedError(FPlayFabError error, UObject* customData); + + /// + /// CLIENT API + /// Try to deliberately log in with an inappropriate password, + /// and verify that the error displays as expected. + /// + UFUNCTION() + void InvalidLogin(UPfTestContext* testContext); + UFUNCTION() + void InvalidLoginSuccess(FClientLoginResult result, UObject* customData); + UFUNCTION() + void InvalidLoginFail(FPlayFabError error, UObject* customData); + + /// + /// CLIENT API + /// Try to deliberately register a user with an invalid email and password + /// Verify that errorDetails are populated correctly. + /// + UFUNCTION() + void InvalidRegistration(UPfTestContext* testContext); + UFUNCTION() + void InvalidRegistrationSuccess(FClientRegisterPlayFabUserResult result, UObject* customData); + UFUNCTION() + void InvalidRegistrationFail(FPlayFabError error, UObject* customData); + + /// + /// CLIENT API + /// Test a sequence of calls that modifies saved data, + /// and verifies that the next sequential API call contains updated data. + /// Verify that the data is correctly modified on the next call. + /// Parameter types tested: string, Dictionary, DateTime + /// + UFUNCTION() + void LoginOrRegister(UPfTestContext* testContext); + UFUNCTION() + void OnLoginOrRegister(FClientLoginResult result, UObject* customData); + + /// + /// CLIENT API + /// Test that the login call sequence sends the AdvertisingId when set + /// + UFUNCTION() + void LoginWithAdvertisingId(UPfTestContext* testContext); + UFUNCTION() + void OnLoginWithAdvertisingId(FClientLoginResult result, UObject* customData); + + /// + /// CLIENT API + /// Test a sequence of calls that modifies saved data, + /// and verifies that the next sequential API call contains updated data. + /// Verify that the data is correctly modified on the next call. + /// Parameter types tested: string, Dictionary, DateTime + /// + UFUNCTION() + void UserDataApi(UPfTestContext* testContext); + UFUNCTION() + void OnUserDataApiGet1(FClientGetUserDataResult result, UObject* customData); + UFUNCTION() + void OnUserDataApiUpdate(FClientUpdateUserDataResult result, UObject* customData); + UFUNCTION() + void OnUserDataApiGet2(FClientGetUserDataResult result, UObject* customData); + bool TryExtractIntFromUserData(const UPlayFabJsonObject* jsonObj, const FString& key, int& outValue, FDateTime& outTime); + + /// + /// CLIENT API + /// Test a sequence of calls that modifies saved data, + /// and verifies that the next sequential API call contains updated data. + /// Verify that the data is saved correctly, and that specific types are tested + /// Parameter types tested: Dictionary + /// + UFUNCTION() + void PlayerStatisticsApi(UPfTestContext* testContext); + UFUNCTION() + void OnPlayerStatisticsApiGet1(FClientGetPlayerStatisticsResult result, UObject* customData); + UFUNCTION() + void OnPlayerStatisticsApiUpdate(FClientUpdatePlayerStatisticsResult result, UObject* customData); + UFUNCTION() + void OnPlayerStatisticsApiGet2(FClientGetPlayerStatisticsResult result, UObject* customData); + + /// + /// CLIENT API + /// Get or create the given test character for the given user + /// Parameter types tested: Contained-Classes, string + /// + UFUNCTION() + void UserCharacter(UPfTestContext* testContext); + UFUNCTION() + void OnUserCharacter(FClientListUsersCharactersResult result, UObject* customData); + + /// + /// CLIENT API + /// Test that leaderboard results can be requested + /// Parameter types tested: List of contained-classes + /// + UFUNCTION() + void LeaderBoard(UPfTestContext* testContext); + UFUNCTION() + void OnLeaderBoard(FClientGetLeaderboardResult result, UObject* customData); + + /// + /// CLIENT API + /// Test that AccountInfo can be requested + /// Parameter types tested: List of enum-as-strings converted to list of enums + /// + UFUNCTION() + void AccountInfo(UPfTestContext* testContext); + UFUNCTION() + void OnAccountInfo(FClientGetAccountInfoResult result, UObject* customData); + + /// + /// CLIENT API + /// Test that CloudScript can be properly set up and invoked + /// + UFUNCTION() + void CloudScript(UPfTestContext* testContext); + UFUNCTION() + void OnHelloWorldCloudScript(FClientExecuteCloudScriptResult result, UObject* customData); + + /// + /// CLIENT API + /// Test that CloudScript errors can be deciphered + /// + UFUNCTION() + void CloudScriptError(UPfTestContext* testContext); + UFUNCTION() + void OnCloudScriptError(FClientExecuteCloudScriptResult result, UObject* customData); + + /// + /// CLIENT API + /// Test that the client can publish custom PlayStream events + /// + UFUNCTION() + void WriteEvent(UPfTestContext* testContext); + UFUNCTION() + void OnWritePlayerEvent(FClientWriteEventResponse result, UObject* customData); + + /// + /// SERVER API + /// Test that server apis can be called successfully + /// Parameter types tested: none + /// + UFUNCTION() + void ServerTitleData(UPfTestContext* testContext); + UFUNCTION() + void OnServerTitleData(FServerGetTitleDataResult result, UObject* customData); + + /// + /// ENTITY API + /// Convert the ClientToken to an EntityToken + /// + UFUNCTION() + void GetEntityToken(UPfTestContext* testContext); + UFUNCTION() + void OnGetEntityToken(FAuthenticationGetEntityTokenResponse result, UObject* customData); + + /// + /// ENTITY API + /// Save and load an Entity object + /// + UFUNCTION() + void ObjectApi(UPfTestContext* testContext); + UFUNCTION() + void OnGetObjectApi1(FDataGetObjectsResponse result, UObject* customData); + UFUNCTION() + void OnSetObjectApi(FDataSetObjectsResponse result, UObject* customData); + UFUNCTION() + void OnGetObjectApi2(FDataGetObjectsResponse result, UObject* customData); +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAdminAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAdminAPI.h new file mode 100644 index 000000000..c6757fd73 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAdminAPI.h @@ -0,0 +1,1661 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Admin +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabAdminModels.h" +#include "PlayFabAdminAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabAdminRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabAdminAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabAdminRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Admin API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessBanUsers, FAdminBanUsersResult, result, UObject*, customData); + + /** Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* BanUsers(FAdminBanUsersRequest request, + FDelegateOnSuccessBanUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperBanUsers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteMasterPlayerAccount, FAdminDeleteMasterPlayerAccountResult, result, UObject*, customData); + + /** Removes a master player account entirely from all titles and deletes all associated data */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeleteMasterPlayerAccount(FAdminDeleteMasterPlayerAccountRequest request, + FDelegateOnSuccessDeleteMasterPlayerAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteMasterPlayerAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeletePlayer, FAdminDeletePlayerResult, result, UObject*, customData); + + /** Removes a user's player account from a title and deletes all associated data */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeletePlayer(FAdminDeletePlayerRequest request, + FDelegateOnSuccessDeletePlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeletePlayer(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteTitle, FAdminDeleteTitleResult, result, UObject*, customData); + + /** Permanently deletes a title and all associated configuration */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeleteTitle(FAdminDeleteTitleRequest request, + FDelegateOnSuccessDeleteTitle onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteTitle(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessExportMasterPlayerData, FAdminExportMasterPlayerDataResult, result, UObject*, customData); + + /** Exports all associated data of a master player account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ExportMasterPlayerData(FAdminExportMasterPlayerDataRequest request, + FDelegateOnSuccessExportMasterPlayerData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperExportMasterPlayerData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayedTitleList, FAdminGetPlayedTitleListResult, result, UObject*, customData); + + /** Get the list of titles that the player has played */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayedTitleList(FAdminGetPlayedTitleListRequest request, + FDelegateOnSuccessGetPlayedTitleList onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayedTitleList(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerIdFromAuthToken, FAdminGetPlayerIdFromAuthTokenResult, result, UObject*, customData); + + /** Gets a player's ID from an auth token. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerIdFromAuthToken(FAdminGetPlayerIdFromAuthTokenRequest request, + FDelegateOnSuccessGetPlayerIdFromAuthToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerIdFromAuthToken(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerProfile, FAdminGetPlayerProfileResult, result, UObject*, customData); + + /** Retrieves the player's profile */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerProfile(FAdminGetPlayerProfileRequest request, + FDelegateOnSuccessGetPlayerProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerProfile(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserAccountInfo, FAdminLookupUserAccountInfoResult, result, UObject*, customData); + + /** Retrieves the relevant details for a specified user, based upon a match against a supplied unique identifier */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserAccountInfo(FAdminLookupUserAccountInfoRequest request, + FDelegateOnSuccessGetUserAccountInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserAccountInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserBans, FAdminGetUserBansResult, result, UObject*, customData); + + /** Gets all bans for a user. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserBans(FAdminGetUserBansRequest request, + FDelegateOnSuccessGetUserBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserBans(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessResetPassword, FAdminResetPasswordResult, result, UObject*, customData); + + /** Reset a player's password for a given title. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ResetPassword(FAdminResetPasswordRequest request, + FDelegateOnSuccessResetPassword onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperResetPassword(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeAllBansForUser, FAdminRevokeAllBansForUserResult, result, UObject*, customData); + + /** Revoke all active bans for a user. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RevokeAllBansForUser(FAdminRevokeAllBansForUserRequest request, + FDelegateOnSuccessRevokeAllBansForUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeAllBansForUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeBans, FAdminRevokeBansResult, result, UObject*, customData); + + /** Revoke all active bans specified with BanId. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RevokeBans(FAdminRevokeBansRequest request, + FDelegateOnSuccessRevokeBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeBans(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSendAccountRecoveryEmail, FAdminSendAccountRecoveryEmailResult, result, UObject*, customData); + + /** + * Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to + * change the password.If an account recovery email template ID is provided, an email using the custom email template will + * be used. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SendAccountRecoveryEmail(FAdminSendAccountRecoveryEmailRequest request, + FDelegateOnSuccessSendAccountRecoveryEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSendAccountRecoveryEmail(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateBans, FAdminUpdateBansResult, result, UObject*, customData); + + /** Updates information of a list of existing bans specified with Ban Ids. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateBans(FAdminUpdateBansRequest request, + FDelegateOnSuccessUpdateBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateBans(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserTitleDisplayName, FAdminUpdateUserTitleDisplayNameResult, result, UObject*, customData); + + /** Updates the title specific display name for a user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserTitleDisplayName(FAdminUpdateUserTitleDisplayNameRequest request, + FDelegateOnSuccessUpdateUserTitleDisplayName onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserTitleDisplayName(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreatePlayerSharedSecret, FAdminCreatePlayerSharedSecretResult, result, UObject*, customData); + + /** + * Creates a new Player Shared Secret Key. It may take up to 5 minutes for this key to become generally available after + * this API returns. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* CreatePlayerSharedSecret(FAdminCreatePlayerSharedSecretRequest request, + FDelegateOnSuccessCreatePlayerSharedSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreatePlayerSharedSecret(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeletePlayerSharedSecret, FAdminDeletePlayerSharedSecretResult, result, UObject*, customData); + + /** + * Deletes an existing Player Shared Secret Key. It may take up to 5 minutes for this delete to be reflected after this API + * returns. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeletePlayerSharedSecret(FAdminDeletePlayerSharedSecretRequest request, + FDelegateOnSuccessDeletePlayerSharedSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeletePlayerSharedSecret(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerSharedSecrets, FAdminGetPlayerSharedSecretsResult, result, UObject*, customData); + + /** Returns all Player Shared Secret Keys including disabled and expired. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerSharedSecrets(FAdminGetPlayerSharedSecretsRequest request, + FDelegateOnSuccessGetPlayerSharedSecrets onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerSharedSecrets(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPolicy, FAdminGetPolicyResponse, result, UObject*, customData); + + /** Gets the requested policy. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPolicy(FAdminGetPolicyRequest request, + FDelegateOnSuccessGetPolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPolicy(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetPlayerSecret, FAdminSetPlayerSecretResult, result, UObject*, customData); + + /** Sets or resets the player's secret. Player secrets are used to sign API requests. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetPlayerSecret(FAdminSetPlayerSecretRequest request, + FDelegateOnSuccessSetPlayerSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetPlayerSecret(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdatePlayerSharedSecret, FAdminUpdatePlayerSharedSecretResult, result, UObject*, customData); + + /** + * Updates a existing Player Shared Secret Key. It may take up to 5 minutes for this update to become generally available + * after this API returns. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdatePlayerSharedSecret(FAdminUpdatePlayerSharedSecretRequest request, + FDelegateOnSuccessUpdatePlayerSharedSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdatePlayerSharedSecret(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdatePolicy, FAdminUpdatePolicyResponse, result, UObject*, customData); + + /** Changes a policy for a title */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdatePolicy(FAdminUpdatePolicyRequest request, + FDelegateOnSuccessUpdatePolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdatePolicy(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Characters + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessResetCharacterStatistics, FAdminResetCharacterStatisticsResult, result, UObject*, customData); + + /** Completely removes all statistics for the specified character, for the current game */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ResetCharacterStatistics(FAdminResetCharacterStatisticsRequest request, + FDelegateOnSuccessResetCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperResetCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Content + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteContent, FAdminBlankResult, result, UObject*, customData); + + /** Delete a content file from the title. When deleting a file that does not exist, it returns success. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeleteContent(FAdminDeleteContentRequest request, + FDelegateOnSuccessDeleteContent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteContent(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetContentList, FAdminGetContentListResult, result, UObject*, customData); + + /** List all contents of the title and get statistics such as size */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetContentList(FAdminGetContentListRequest request, + FDelegateOnSuccessGetContentList onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetContentList(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetContentUploadUrl, FAdminGetContentUploadUrlResult, result, UObject*, customData); + + /** + * Retrieves the pre-signed URL for uploading a content file. A subsequent HTTP PUT to the returned URL uploads the + * content. Also, please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN + * rates apply. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetContentUploadUrl(FAdminGetContentUploadUrlRequest request, + FDelegateOnSuccessGetContentUploadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetContentUploadUrl(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Custom Server Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddServerBuild, FAdminAddServerBuildResult, result, UObject*, customData); + + /** + * Adds the game server executable specified (previously uploaded - see GetServerBuildUploadUrl) to the set of those a + * client is permitted to request in a call to StartGame + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* AddServerBuild(FAdminAddServerBuildRequest request, + FDelegateOnSuccessAddServerBuild onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddServerBuild(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetServerBuildInfo, FAdminGetServerBuildInfoResult, result, UObject*, customData); + + /** Retrieves the build details for the specified game server executable */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetServerBuildInfo(FAdminGetServerBuildInfoRequest request, + FDelegateOnSuccessGetServerBuildInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetServerBuildInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetServerBuildUploadUrl, FAdminGetServerBuildUploadURLResult, result, UObject*, customData); + + /** + * Retrieves the pre-authorized URL for uploading a game server package containing a build (does not enable the build for + * use - see AddServerBuild) + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetServerBuildUploadUrl(FAdminGetServerBuildUploadURLRequest request, + FDelegateOnSuccessGetServerBuildUploadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetServerBuildUploadUrl(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListServerBuilds, FAdminListBuildsResult, result, UObject*, customData); + + /** Retrieves the build details for all game server executables which are currently defined for the title */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ListServerBuilds(FAdminListBuildsRequest request, + FDelegateOnSuccessListServerBuilds onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListServerBuilds(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessModifyServerBuild, FAdminModifyServerBuildResult, result, UObject*, customData); + + /** Updates the build details for the specified game server executable */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ModifyServerBuild(FAdminModifyServerBuildRequest request, + FDelegateOnSuccessModifyServerBuild onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperModifyServerBuild(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveServerBuild, FAdminRemoveServerBuildResult, result, UObject*, customData); + + /** + * Removes the game server executable specified from the set of those a client is permitted to request in a call to + * StartGame + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RemoveServerBuild(FAdminRemoveServerBuildRequest request, + FDelegateOnSuccessRemoveServerBuild onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveServerBuild(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetMatchmakerGameInfo, FAdminGetMatchmakerGameInfoResult, result, UObject*, customData); + + /** Retrieves the details for a specific completed session, including links to standard out and standard error logs */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetMatchmakerGameInfo(FAdminGetMatchmakerGameInfoRequest request, + FDelegateOnSuccessGetMatchmakerGameInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetMatchmakerGameInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetMatchmakerGameModes, FAdminGetMatchmakerGameModesResult, result, UObject*, customData); + + /** Retrieves the details of defined game modes for the specified game server executable */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetMatchmakerGameModes(FAdminGetMatchmakerGameModesRequest request, + FDelegateOnSuccessGetMatchmakerGameModes onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetMatchmakerGameModes(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessModifyMatchmakerGameModes, FAdminModifyMatchmakerGameModesResult, result, UObject*, customData); + + /** Updates the game server mode details for the specified game server executable */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ModifyMatchmakerGameModes(FAdminModifyMatchmakerGameModesRequest request, + FDelegateOnSuccessModifyMatchmakerGameModes onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperModifyMatchmakerGameModes(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Player Data Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreatePlayerStatisticDefinition, FAdminCreatePlayerStatisticDefinitionResult, result, UObject*, customData); + + /** + * Adds a new player statistic configuration to the title, optionally allowing the developer to specify a reset interval + * and an aggregation method. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* CreatePlayerStatisticDefinition(FAdminCreatePlayerStatisticDefinitionRequest request, + FDelegateOnSuccessCreatePlayerStatisticDefinition onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreatePlayerStatisticDefinition(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetDataReport, FAdminGetDataReportResult, result, UObject*, customData); + + /** Retrieves a download URL for the requested report */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetDataReport(FAdminGetDataReportRequest request, + FDelegateOnSuccessGetDataReport onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetDataReport(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerStatisticDefinitions, FAdminGetPlayerStatisticDefinitionsResult, result, UObject*, customData); + + /** + * Retrieves the configuration information for all player statistics defined in the title, regardless of whether they have + * a reset interval. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerStatisticDefinitions(FAdminGetPlayerStatisticDefinitionsRequest request, + FDelegateOnSuccessGetPlayerStatisticDefinitions onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerStatisticDefinitions(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerStatisticVersions, FAdminGetPlayerStatisticVersionsResult, result, UObject*, customData); + + /** Retrieves the information on the available versions of the specified statistic. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerStatisticVersions(FAdminGetPlayerStatisticVersionsRequest request, + FDelegateOnSuccessGetPlayerStatisticVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerStatisticVersions(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserData, FAdminGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserInternalData, FAdminGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserInternalData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherData, FAdminGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserPublisherData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherInternalData, FAdminGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserPublisherInternalData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherReadOnlyData, FAdminGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserPublisherReadOnlyData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserReadOnlyData, FAdminGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserReadOnlyData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessIncrementPlayerStatisticVersion, FAdminIncrementPlayerStatisticVersionResult, result, UObject*, customData); + + /** Resets the indicated statistic, removing all player entries for it and backing up the old values. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* IncrementPlayerStatisticVersion(FAdminIncrementPlayerStatisticVersionRequest request, + FDelegateOnSuccessIncrementPlayerStatisticVersion onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperIncrementPlayerStatisticVersion(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRefundPurchase, FAdminRefundPurchaseResponse, result, UObject*, customData); + + /** Attempts to process an order refund through the original real money payment provider. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RefundPurchase(FAdminRefundPurchaseRequest request, + FDelegateOnSuccessRefundPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRefundPurchase(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessResetUserStatistics, FAdminResetUserStatisticsResult, result, UObject*, customData); + + /** Completely removes all statistics for the specified user, for the current game */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ResetUserStatistics(FAdminResetUserStatisticsRequest request, + FDelegateOnSuccessResetUserStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperResetUserStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessResolvePurchaseDispute, FAdminResolvePurchaseDisputeResponse, result, UObject*, customData); + + /** Attempts to resolve a dispute with the original order's payment provider. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ResolvePurchaseDispute(FAdminResolvePurchaseDisputeRequest request, + FDelegateOnSuccessResolvePurchaseDispute onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperResolvePurchaseDispute(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdatePlayerStatisticDefinition, FAdminUpdatePlayerStatisticDefinitionResult, result, UObject*, customData); + + /** Updates a player statistic configuration for the title, optionally allowing the developer to specify a reset interval. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdatePlayerStatisticDefinition(FAdminUpdatePlayerStatisticDefinitionRequest request, + FDelegateOnSuccessUpdatePlayerStatisticDefinition onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdatePlayerStatisticDefinition(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserData, FAdminUpdateUserDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserInternalData, FAdminUpdateUserDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserInternalData(FAdminUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherData, FAdminUpdateUserDataResult, result, UObject*, customData); + + /** Updates the publisher-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserPublisherData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherInternalData, FAdminUpdateUserDataResult, result, UObject*, customData); + + /** Updates the publisher-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserPublisherInternalData(FAdminUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherReadOnlyData, FAdminUpdateUserDataResult, result, UObject*, customData); + + /** Updates the publisher-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserPublisherReadOnlyData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserReadOnlyData, FAdminUpdateUserDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserReadOnlyData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Player Item Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddUserVirtualCurrency, FAdminModifyUserVirtualCurrencyResult, result, UObject*, customData); + + /** Increments the specified virtual currency by the stated amount */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* AddUserVirtualCurrency(FAdminAddUserVirtualCurrencyRequest request, + FDelegateOnSuccessAddUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCheckLimitedEditionItemAvailability, FAdminCheckLimitedEditionItemAvailabilityResult, result, UObject*, customData); + + /** Checks the global count for the limited edition item. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* CheckLimitedEditionItemAvailability(FAdminCheckLimitedEditionItemAvailabilityRequest request, + FDelegateOnSuccessCheckLimitedEditionItemAvailability onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCheckLimitedEditionItemAvailability(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserInventory, FAdminGetUserInventoryResult, result, UObject*, customData); + + /** Retrieves the specified user's current inventory of virtual goods */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserInventory(FAdminGetUserInventoryRequest request, + FDelegateOnSuccessGetUserInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserInventory(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGrantItemsToUsers, FAdminGrantItemsToUsersResult, result, UObject*, customData); + + /** Adds the specified items to the specified user inventories */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GrantItemsToUsers(FAdminGrantItemsToUsersRequest request, + FDelegateOnSuccessGrantItemsToUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGrantItemsToUsers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessIncrementLimitedEditionItemAvailability, FAdminIncrementLimitedEditionItemAvailabilityResult, result, UObject*, customData); + + /** Increases the global count for the given scarce resource. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* IncrementLimitedEditionItemAvailability(FAdminIncrementLimitedEditionItemAvailabilityRequest request, + FDelegateOnSuccessIncrementLimitedEditionItemAvailability onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperIncrementLimitedEditionItemAvailability(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeInventoryItem, FAdminRevokeInventoryResult, result, UObject*, customData); + + /** Revokes access to an item in a user's inventory */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RevokeInventoryItem(FAdminRevokeInventoryItemRequest request, + FDelegateOnSuccessRevokeInventoryItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeInventoryItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeInventoryItems, FAdminRevokeInventoryItemsResult, result, UObject*, customData); + + /** Revokes access for up to 25 items across multiple users and characters. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RevokeInventoryItems(FAdminRevokeInventoryItemsRequest request, + FDelegateOnSuccessRevokeInventoryItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeInventoryItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSubtractUserVirtualCurrency, FAdminModifyUserVirtualCurrencyResult, result, UObject*, customData); + + /** Decrements the specified virtual currency by the stated amount */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SubtractUserVirtualCurrency(FAdminSubtractUserVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSubtractUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // PlayStream + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddPlayerTag, FAdminAddPlayerTagResult, result, UObject*, customData); + + /** Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* AddPlayerTag(FAdminAddPlayerTagRequest request, + FDelegateOnSuccessAddPlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddPlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetAllSegments, FAdminGetAllSegmentsResult, result, UObject*, customData); + + /** + * Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as + * GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetAllSegments(FAdminGetAllSegmentsRequest request, + FDelegateOnSuccessGetAllSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetAllSegments(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerSegments, FAdminGetPlayerSegmentsResult, result, UObject*, customData); + + /** List all segments that a player currently belongs to at this moment in time. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerSegments(FAdminGetPlayersSegmentsRequest request, + FDelegateOnSuccessGetPlayerSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerSegments(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayersInSegment, FAdminGetPlayersInSegmentResult, result, UObject*, customData); + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match + * the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span + * on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected + * in the results. AB Test segments are currently not supported by this operation. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayersInSegment(FAdminGetPlayersInSegmentRequest request, + FDelegateOnSuccessGetPlayersInSegment onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayersInSegment(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerTags, FAdminGetPlayerTagsResult, result, UObject*, customData); + + /** Get all tags with a given Namespace (optional) from a player profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerTags(FAdminGetPlayerTagsRequest request, + FDelegateOnSuccessGetPlayerTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerTags(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemovePlayerTag, FAdminRemovePlayerTagResult, result, UObject*, customData); + + /** Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RemovePlayerTag(FAdminRemovePlayerTagRequest request, + FDelegateOnSuccessRemovePlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemovePlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // ScheduledTask + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAbortTaskInstance, FAdminEmptyResponse, result, UObject*, customData); + + /** Abort an ongoing task instance. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* AbortTaskInstance(FAdminAbortTaskInstanceRequest request, + FDelegateOnSuccessAbortTaskInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAbortTaskInstance(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreateActionsOnPlayersInSegmentTask, FAdminCreateTaskResult, result, UObject*, customData); + + /** Create an ActionsOnPlayersInSegment task, which iterates through all players in a segment to execute action. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* CreateActionsOnPlayersInSegmentTask(FAdminCreateActionsOnPlayerSegmentTaskRequest request, + FDelegateOnSuccessCreateActionsOnPlayersInSegmentTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreateActionsOnPlayersInSegmentTask(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreateCloudScriptTask, FAdminCreateTaskResult, result, UObject*, customData); + + /** Create a CloudScript task, which can run a CloudScript on a schedule. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* CreateCloudScriptTask(FAdminCreateCloudScriptTaskRequest request, + FDelegateOnSuccessCreateCloudScriptTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreateCloudScriptTask(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteTask, FAdminEmptyResponse, result, UObject*, customData); + + /** Delete a task. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeleteTask(FAdminDeleteTaskRequest request, + FDelegateOnSuccessDeleteTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteTask(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetActionsOnPlayersInSegmentTaskInstance, FAdminGetActionsOnPlayersInSegmentTaskInstanceResult, result, UObject*, customData); + + /** Get information about a ActionsOnPlayersInSegment task instance. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetActionsOnPlayersInSegmentTaskInstance(FAdminGetTaskInstanceRequest request, + FDelegateOnSuccessGetActionsOnPlayersInSegmentTaskInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetActionsOnPlayersInSegmentTaskInstance(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCloudScriptTaskInstance, FAdminGetCloudScriptTaskInstanceResult, result, UObject*, customData); + + /** Get detail information about a CloudScript task instance. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetCloudScriptTaskInstance(FAdminGetTaskInstanceRequest request, + FDelegateOnSuccessGetCloudScriptTaskInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCloudScriptTaskInstance(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTaskInstances, FAdminGetTaskInstancesResult, result, UObject*, customData); + + /** Query for task instances by task, status, or time range. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetTaskInstances(FAdminGetTaskInstancesRequest request, + FDelegateOnSuccessGetTaskInstances onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTaskInstances(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTasks, FAdminGetTasksResult, result, UObject*, customData); + + /** Get definition information on a specified task or all tasks within a title. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetTasks(FAdminGetTasksRequest request, + FDelegateOnSuccessGetTasks onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTasks(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRunTask, FAdminRunTaskResult, result, UObject*, customData); + + /** Run a task immediately regardless of its schedule. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RunTask(FAdminRunTaskRequest request, + FDelegateOnSuccessRunTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRunTask(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateTask, FAdminEmptyResponse, result, UObject*, customData); + + /** Update an existing task. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateTask(FAdminUpdateTaskRequest request, + FDelegateOnSuccessUpdateTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateTask(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCloudScriptRevision, FAdminGetCloudScriptRevisionResult, result, UObject*, customData); + + /** Gets the contents and information of a specific Cloud Script revision. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetCloudScriptRevision(FAdminGetCloudScriptRevisionRequest request, + FDelegateOnSuccessGetCloudScriptRevision onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCloudScriptRevision(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCloudScriptVersions, FAdminGetCloudScriptVersionsResult, result, UObject*, customData); + + /** + * Lists all the current cloud script versions. For each version, information about the current published and latest + * revisions is also listed. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetCloudScriptVersions(FAdminGetCloudScriptVersionsRequest request, + FDelegateOnSuccessGetCloudScriptVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCloudScriptVersions(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetPublishedRevision, FAdminSetPublishedRevisionResult, result, UObject*, customData); + + /** Sets the currently published revision of a title Cloud Script */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetPublishedRevision(FAdminSetPublishedRevisionRequest request, + FDelegateOnSuccessSetPublishedRevision onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetPublishedRevision(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCloudScript, FAdminUpdateCloudScriptResult, result, UObject*, customData); + + /** + * Creates a new Cloud Script revision and uploads source code to it. Note that at this time, only one file should be + * submitted in the revision. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateCloudScript(FAdminUpdateCloudScriptRequest request, + FDelegateOnSuccessUpdateCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Shared Group Data + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetPublisherData, FAdminSetPublisherDataResult, result, UObject*, customData); + + /** Updates the key-value store of custom publisher settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetPublisherData(FAdminSetPublisherDataRequest request, + FDelegateOnSuccessSetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Title-Wide Data Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddNews, FAdminAddNewsResult, result, UObject*, customData); + + /** Adds a new news item to the title's news feed */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* AddNews(FAdminAddNewsRequest request, + FDelegateOnSuccessAddNews onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddNews(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddVirtualCurrencyTypes, FAdminBlankResult, result, UObject*, customData); + + /** + * Adds one or more virtual currencies to the set defined for the title. Virtual Currencies have a maximum value of + * 2,147,483,647 when granted to a player. Any value over that will be discarded. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* AddVirtualCurrencyTypes(FAdminAddVirtualCurrencyTypesRequest request, + FDelegateOnSuccessAddVirtualCurrencyTypes onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddVirtualCurrencyTypes(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteStore, FAdminDeleteStoreResult, result, UObject*, customData); + + /** Deletes an existing virtual item store */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeleteStore(FAdminDeleteStoreRequest request, + FDelegateOnSuccessDeleteStore onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteStore(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCatalogItems, FAdminGetCatalogItemsResult, result, UObject*, customData); + + /** Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetCatalogItems(FAdminGetCatalogItemsRequest request, + FDelegateOnSuccessGetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPublisherData, FAdminGetPublisherDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom publisher settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPublisherData(FAdminGetPublisherDataRequest request, + FDelegateOnSuccessGetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetRandomResultTables, FAdminGetRandomResultTablesResult, result, UObject*, customData); + + /** Retrieves the random drop table configuration for the title */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetRandomResultTables(FAdminGetRandomResultTablesRequest request, + FDelegateOnSuccessGetRandomResultTables onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetRandomResultTables(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetStoreItems, FAdminGetStoreItemsResult, result, UObject*, customData); + + /** Retrieves the set of items defined for the specified store, including all prices defined */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetStoreItems(FAdminGetStoreItemsRequest request, + FDelegateOnSuccessGetStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleData, FAdminGetTitleDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom title settings which can be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetTitleData(FAdminGetTitleDataRequest request, + FDelegateOnSuccessGetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleInternalData, FAdminGetTitleDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom title settings which cannot be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetTitleInternalData(FAdminGetTitleDataRequest request, + FDelegateOnSuccessGetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListVirtualCurrencyTypes, FAdminListVirtualCurrencyTypesResult, result, UObject*, customData); + + /** Retuns the list of all defined virtual currencies for the title */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ListVirtualCurrencyTypes(FAdminListVirtualCurrencyTypesRequest request, + FDelegateOnSuccessListVirtualCurrencyTypes onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListVirtualCurrencyTypes(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveVirtualCurrencyTypes, FAdminBlankResult, result, UObject*, customData); + + /** Removes one or more virtual currencies from the set defined for the title. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RemoveVirtualCurrencyTypes(FAdminRemoveVirtualCurrencyTypesRequest request, + FDelegateOnSuccessRemoveVirtualCurrencyTypes onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveVirtualCurrencyTypes(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetCatalogItems, FAdminUpdateCatalogItemsResult, result, UObject*, customData); + + /** Creates the catalog configuration of all virtual goods for the specified catalog version */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetCatalogItems(FAdminUpdateCatalogItemsRequest request, + FDelegateOnSuccessSetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetStoreItems, FAdminUpdateStoreItemsResult, result, UObject*, customData); + + /** Sets all the items in one virtual store */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetStoreItems(FAdminUpdateStoreItemsRequest request, + FDelegateOnSuccessSetStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetTitleData, FAdminSetTitleDataResult, result, UObject*, customData); + + /** Creates and updates the key-value store of custom title settings which can be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetTitleData(FAdminSetTitleDataRequest request, + FDelegateOnSuccessSetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetTitleInternalData, FAdminSetTitleDataResult, result, UObject*, customData); + + /** Updates the key-value store of custom title settings which cannot be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetTitleInternalData(FAdminSetTitleDataRequest request, + FDelegateOnSuccessSetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetupPushNotification, FAdminSetupPushNotificationResult, result, UObject*, customData); + + /** + * Sets the Amazon Resource Name (ARN) for iOS and Android push notifications. Documentation on the exact restrictions can + * be found at: http://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformApplication.html. Currently, Amazon device + * Messaging is not supported. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetupPushNotification(FAdminSetupPushNotificationRequest request, + FDelegateOnSuccessSetupPushNotification onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetupPushNotification(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCatalogItems, FAdminUpdateCatalogItemsResult, result, UObject*, customData); + + /** Updates the catalog configuration for virtual goods in the specified catalog version */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateCatalogItems(FAdminUpdateCatalogItemsRequest request, + FDelegateOnSuccessUpdateCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateRandomResultTables, FAdminUpdateRandomResultTablesResult, result, UObject*, customData); + + /** Updates the random drop table configuration for the title */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateRandomResultTables(FAdminUpdateRandomResultTablesRequest request, + FDelegateOnSuccessUpdateRandomResultTables onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateRandomResultTables(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateStoreItems, FAdminUpdateStoreItemsResult, result, UObject*, customData); + + /** Updates an existing virtual item store with new or modified items */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateStoreItems(FAdminUpdateStoreItemsRequest request, + FDelegateOnSuccessUpdateStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessBanUsers OnSuccessBanUsers; + FDelegateOnSuccessDeleteMasterPlayerAccount OnSuccessDeleteMasterPlayerAccount; + FDelegateOnSuccessDeletePlayer OnSuccessDeletePlayer; + FDelegateOnSuccessDeleteTitle OnSuccessDeleteTitle; + FDelegateOnSuccessExportMasterPlayerData OnSuccessExportMasterPlayerData; + FDelegateOnSuccessGetPlayedTitleList OnSuccessGetPlayedTitleList; + FDelegateOnSuccessGetPlayerIdFromAuthToken OnSuccessGetPlayerIdFromAuthToken; + FDelegateOnSuccessGetPlayerProfile OnSuccessGetPlayerProfile; + FDelegateOnSuccessGetUserAccountInfo OnSuccessGetUserAccountInfo; + FDelegateOnSuccessGetUserBans OnSuccessGetUserBans; + FDelegateOnSuccessResetPassword OnSuccessResetPassword; + FDelegateOnSuccessRevokeAllBansForUser OnSuccessRevokeAllBansForUser; + FDelegateOnSuccessRevokeBans OnSuccessRevokeBans; + FDelegateOnSuccessSendAccountRecoveryEmail OnSuccessSendAccountRecoveryEmail; + FDelegateOnSuccessUpdateBans OnSuccessUpdateBans; + FDelegateOnSuccessUpdateUserTitleDisplayName OnSuccessUpdateUserTitleDisplayName; + FDelegateOnSuccessCreatePlayerSharedSecret OnSuccessCreatePlayerSharedSecret; + FDelegateOnSuccessDeletePlayerSharedSecret OnSuccessDeletePlayerSharedSecret; + FDelegateOnSuccessGetPlayerSharedSecrets OnSuccessGetPlayerSharedSecrets; + FDelegateOnSuccessGetPolicy OnSuccessGetPolicy; + FDelegateOnSuccessSetPlayerSecret OnSuccessSetPlayerSecret; + FDelegateOnSuccessUpdatePlayerSharedSecret OnSuccessUpdatePlayerSharedSecret; + FDelegateOnSuccessUpdatePolicy OnSuccessUpdatePolicy; + FDelegateOnSuccessResetCharacterStatistics OnSuccessResetCharacterStatistics; + FDelegateOnSuccessDeleteContent OnSuccessDeleteContent; + FDelegateOnSuccessGetContentList OnSuccessGetContentList; + FDelegateOnSuccessGetContentUploadUrl OnSuccessGetContentUploadUrl; + FDelegateOnSuccessAddServerBuild OnSuccessAddServerBuild; + FDelegateOnSuccessGetServerBuildInfo OnSuccessGetServerBuildInfo; + FDelegateOnSuccessGetServerBuildUploadUrl OnSuccessGetServerBuildUploadUrl; + FDelegateOnSuccessListServerBuilds OnSuccessListServerBuilds; + FDelegateOnSuccessModifyServerBuild OnSuccessModifyServerBuild; + FDelegateOnSuccessRemoveServerBuild OnSuccessRemoveServerBuild; + FDelegateOnSuccessGetMatchmakerGameInfo OnSuccessGetMatchmakerGameInfo; + FDelegateOnSuccessGetMatchmakerGameModes OnSuccessGetMatchmakerGameModes; + FDelegateOnSuccessModifyMatchmakerGameModes OnSuccessModifyMatchmakerGameModes; + FDelegateOnSuccessCreatePlayerStatisticDefinition OnSuccessCreatePlayerStatisticDefinition; + FDelegateOnSuccessGetDataReport OnSuccessGetDataReport; + FDelegateOnSuccessGetPlayerStatisticDefinitions OnSuccessGetPlayerStatisticDefinitions; + FDelegateOnSuccessGetPlayerStatisticVersions OnSuccessGetPlayerStatisticVersions; + FDelegateOnSuccessGetUserData OnSuccessGetUserData; + FDelegateOnSuccessGetUserInternalData OnSuccessGetUserInternalData; + FDelegateOnSuccessGetUserPublisherData OnSuccessGetUserPublisherData; + FDelegateOnSuccessGetUserPublisherInternalData OnSuccessGetUserPublisherInternalData; + FDelegateOnSuccessGetUserPublisherReadOnlyData OnSuccessGetUserPublisherReadOnlyData; + FDelegateOnSuccessGetUserReadOnlyData OnSuccessGetUserReadOnlyData; + FDelegateOnSuccessIncrementPlayerStatisticVersion OnSuccessIncrementPlayerStatisticVersion; + FDelegateOnSuccessRefundPurchase OnSuccessRefundPurchase; + FDelegateOnSuccessResetUserStatistics OnSuccessResetUserStatistics; + FDelegateOnSuccessResolvePurchaseDispute OnSuccessResolvePurchaseDispute; + FDelegateOnSuccessUpdatePlayerStatisticDefinition OnSuccessUpdatePlayerStatisticDefinition; + FDelegateOnSuccessUpdateUserData OnSuccessUpdateUserData; + FDelegateOnSuccessUpdateUserInternalData OnSuccessUpdateUserInternalData; + FDelegateOnSuccessUpdateUserPublisherData OnSuccessUpdateUserPublisherData; + FDelegateOnSuccessUpdateUserPublisherInternalData OnSuccessUpdateUserPublisherInternalData; + FDelegateOnSuccessUpdateUserPublisherReadOnlyData OnSuccessUpdateUserPublisherReadOnlyData; + FDelegateOnSuccessUpdateUserReadOnlyData OnSuccessUpdateUserReadOnlyData; + FDelegateOnSuccessAddUserVirtualCurrency OnSuccessAddUserVirtualCurrency; + FDelegateOnSuccessCheckLimitedEditionItemAvailability OnSuccessCheckLimitedEditionItemAvailability; + FDelegateOnSuccessGetUserInventory OnSuccessGetUserInventory; + FDelegateOnSuccessGrantItemsToUsers OnSuccessGrantItemsToUsers; + FDelegateOnSuccessIncrementLimitedEditionItemAvailability OnSuccessIncrementLimitedEditionItemAvailability; + FDelegateOnSuccessRevokeInventoryItem OnSuccessRevokeInventoryItem; + FDelegateOnSuccessRevokeInventoryItems OnSuccessRevokeInventoryItems; + FDelegateOnSuccessSubtractUserVirtualCurrency OnSuccessSubtractUserVirtualCurrency; + FDelegateOnSuccessAddPlayerTag OnSuccessAddPlayerTag; + FDelegateOnSuccessGetAllSegments OnSuccessGetAllSegments; + FDelegateOnSuccessGetPlayerSegments OnSuccessGetPlayerSegments; + FDelegateOnSuccessGetPlayersInSegment OnSuccessGetPlayersInSegment; + FDelegateOnSuccessGetPlayerTags OnSuccessGetPlayerTags; + FDelegateOnSuccessRemovePlayerTag OnSuccessRemovePlayerTag; + FDelegateOnSuccessAbortTaskInstance OnSuccessAbortTaskInstance; + FDelegateOnSuccessCreateActionsOnPlayersInSegmentTask OnSuccessCreateActionsOnPlayersInSegmentTask; + FDelegateOnSuccessCreateCloudScriptTask OnSuccessCreateCloudScriptTask; + FDelegateOnSuccessDeleteTask OnSuccessDeleteTask; + FDelegateOnSuccessGetActionsOnPlayersInSegmentTaskInstance OnSuccessGetActionsOnPlayersInSegmentTaskInstance; + FDelegateOnSuccessGetCloudScriptTaskInstance OnSuccessGetCloudScriptTaskInstance; + FDelegateOnSuccessGetTaskInstances OnSuccessGetTaskInstances; + FDelegateOnSuccessGetTasks OnSuccessGetTasks; + FDelegateOnSuccessRunTask OnSuccessRunTask; + FDelegateOnSuccessUpdateTask OnSuccessUpdateTask; + FDelegateOnSuccessGetCloudScriptRevision OnSuccessGetCloudScriptRevision; + FDelegateOnSuccessGetCloudScriptVersions OnSuccessGetCloudScriptVersions; + FDelegateOnSuccessSetPublishedRevision OnSuccessSetPublishedRevision; + FDelegateOnSuccessUpdateCloudScript OnSuccessUpdateCloudScript; + FDelegateOnSuccessSetPublisherData OnSuccessSetPublisherData; + FDelegateOnSuccessAddNews OnSuccessAddNews; + FDelegateOnSuccessAddVirtualCurrencyTypes OnSuccessAddVirtualCurrencyTypes; + FDelegateOnSuccessDeleteStore OnSuccessDeleteStore; + FDelegateOnSuccessGetCatalogItems OnSuccessGetCatalogItems; + FDelegateOnSuccessGetPublisherData OnSuccessGetPublisherData; + FDelegateOnSuccessGetRandomResultTables OnSuccessGetRandomResultTables; + FDelegateOnSuccessGetStoreItems OnSuccessGetStoreItems; + FDelegateOnSuccessGetTitleData OnSuccessGetTitleData; + FDelegateOnSuccessGetTitleInternalData OnSuccessGetTitleInternalData; + FDelegateOnSuccessListVirtualCurrencyTypes OnSuccessListVirtualCurrencyTypes; + FDelegateOnSuccessRemoveVirtualCurrencyTypes OnSuccessRemoveVirtualCurrencyTypes; + FDelegateOnSuccessSetCatalogItems OnSuccessSetCatalogItems; + FDelegateOnSuccessSetStoreItems OnSuccessSetStoreItems; + FDelegateOnSuccessSetTitleData OnSuccessSetTitleData; + FDelegateOnSuccessSetTitleInternalData OnSuccessSetTitleInternalData; + FDelegateOnSuccessSetupPushNotification OnSuccessSetupPushNotification; + FDelegateOnSuccessUpdateCatalogItems OnSuccessUpdateCatalogItems; + FDelegateOnSuccessUpdateRandomResultTables OnSuccessUpdateRandomResultTables; + FDelegateOnSuccessUpdateStoreItems OnSuccessUpdateStoreItems; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAdminModelDecoder.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAdminModelDecoder.h new file mode 100644 index 000000000..c539b0768 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAdminModelDecoder.h @@ -0,0 +1,453 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Admin +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabAdminModels.h" +#include "PlayFabAdminModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabAdminModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Admin API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + + /** Decode the BanUsersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminBanUsersResult decodeBanUsersResultResponse(UPlayFabJsonObject* response); + + /** Decode the DeleteMasterPlayerAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminDeleteMasterPlayerAccountResult decodeDeleteMasterPlayerAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the DeletePlayerResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminDeletePlayerResult decodeDeletePlayerResultResponse(UPlayFabJsonObject* response); + + /** Decode the DeleteTitleResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminDeleteTitleResult decodeDeleteTitleResultResponse(UPlayFabJsonObject* response); + + /** Decode the ExportMasterPlayerDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminExportMasterPlayerDataResult decodeExportMasterPlayerDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayedTitleListResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminGetPlayedTitleListResult decodeGetPlayedTitleListResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerIdFromAuthTokenResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminGetPlayerIdFromAuthTokenResult decodeGetPlayerIdFromAuthTokenResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerProfileResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminGetPlayerProfileResult decodeGetPlayerProfileResultResponse(UPlayFabJsonObject* response); + + /** Decode the LookupUserAccountInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminLookupUserAccountInfoResult decodeLookupUserAccountInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserBansResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminGetUserBansResult decodeGetUserBansResultResponse(UPlayFabJsonObject* response); + + /** Decode the ResetPasswordResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminResetPasswordResult decodeResetPasswordResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeAllBansForUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminRevokeAllBansForUserResult decodeRevokeAllBansForUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeBansResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminRevokeBansResult decodeRevokeBansResultResponse(UPlayFabJsonObject* response); + + /** Decode the SendAccountRecoveryEmailResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminSendAccountRecoveryEmailResult decodeSendAccountRecoveryEmailResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateBansResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminUpdateBansResult decodeUpdateBansResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateUserTitleDisplayNameResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminUpdateUserTitleDisplayNameResult decodeUpdateUserTitleDisplayNameResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + + /** Decode the CreatePlayerSharedSecretResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminCreatePlayerSharedSecretResult decodeCreatePlayerSharedSecretResultResponse(UPlayFabJsonObject* response); + + /** Decode the DeletePlayerSharedSecretResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminDeletePlayerSharedSecretResult decodeDeletePlayerSharedSecretResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerSharedSecretsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminGetPlayerSharedSecretsResult decodeGetPlayerSharedSecretsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPolicyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminGetPolicyResponse decodeGetPolicyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the SetPlayerSecretResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminSetPlayerSecretResult decodeSetPlayerSecretResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdatePlayerSharedSecretResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminUpdatePlayerSharedSecretResult decodeUpdatePlayerSharedSecretResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdatePolicyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminUpdatePolicyResponse decodeUpdatePolicyResponseResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Characters + ////////////////////////////////////////////////////// + + /** Decode the ResetCharacterStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Characters Models") + static FAdminResetCharacterStatisticsResult decodeResetCharacterStatisticsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Content + ////////////////////////////////////////////////////// + + /** Decode the BlankResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content Models") + static FAdminBlankResult decodeBlankResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetContentListResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content Models") + static FAdminGetContentListResult decodeGetContentListResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetContentUploadUrlResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content Models") + static FAdminGetContentUploadUrlResult decodeGetContentUploadUrlResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Custom Server Management + ////////////////////////////////////////////////////// + + /** Decode the AddServerBuildResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management Models") + static FAdminAddServerBuildResult decodeAddServerBuildResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetServerBuildInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management Models") + static FAdminGetServerBuildInfoResult decodeGetServerBuildInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetServerBuildUploadURLResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management Models") + static FAdminGetServerBuildUploadURLResult decodeGetServerBuildUploadURLResultResponse(UPlayFabJsonObject* response); + + /** Decode the ListBuildsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management Models") + static FAdminListBuildsResult decodeListBuildsResultResponse(UPlayFabJsonObject* response); + + /** Decode the ModifyServerBuildResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management Models") + static FAdminModifyServerBuildResult decodeModifyServerBuildResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemoveServerBuildResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management Models") + static FAdminRemoveServerBuildResult decodeRemoveServerBuildResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + + /** Decode the GetMatchmakerGameInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking Models") + static FAdminGetMatchmakerGameInfoResult decodeGetMatchmakerGameInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetMatchmakerGameModesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking Models") + static FAdminGetMatchmakerGameModesResult decodeGetMatchmakerGameModesResultResponse(UPlayFabJsonObject* response); + + /** Decode the ModifyMatchmakerGameModesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking Models") + static FAdminModifyMatchmakerGameModesResult decodeModifyMatchmakerGameModesResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Player Data Management + ////////////////////////////////////////////////////// + + /** Decode the CreatePlayerStatisticDefinitionResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminCreatePlayerStatisticDefinitionResult decodeCreatePlayerStatisticDefinitionResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetDataReportResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminGetDataReportResult decodeGetDataReportResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerStatisticDefinitionsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminGetPlayerStatisticDefinitionsResult decodeGetPlayerStatisticDefinitionsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerStatisticVersionsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminGetPlayerStatisticVersionsResult decodeGetPlayerStatisticVersionsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminGetUserDataResult decodeGetUserDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the IncrementPlayerStatisticVersionResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminIncrementPlayerStatisticVersionResult decodeIncrementPlayerStatisticVersionResultResponse(UPlayFabJsonObject* response); + + /** Decode the RefundPurchaseResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminRefundPurchaseResponse decodeRefundPurchaseResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ResetUserStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminResetUserStatisticsResult decodeResetUserStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the ResolvePurchaseDisputeResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminResolvePurchaseDisputeResponse decodeResolvePurchaseDisputeResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UpdatePlayerStatisticDefinitionResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminUpdatePlayerStatisticDefinitionResult decodeUpdatePlayerStatisticDefinitionResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateUserDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminUpdateUserDataResult decodeUpdateUserDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Player Item Management + ////////////////////////////////////////////////////// + + /** Decode the ModifyUserVirtualCurrencyResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminModifyUserVirtualCurrencyResult decodeModifyUserVirtualCurrencyResultResponse(UPlayFabJsonObject* response); + + /** Decode the CheckLimitedEditionItemAvailabilityResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminCheckLimitedEditionItemAvailabilityResult decodeCheckLimitedEditionItemAvailabilityResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminGetUserInventoryResult decodeGetUserInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the GrantItemsToUsersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminGrantItemsToUsersResult decodeGrantItemsToUsersResultResponse(UPlayFabJsonObject* response); + + /** Decode the IncrementLimitedEditionItemAvailabilityResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminIncrementLimitedEditionItemAvailabilityResult decodeIncrementLimitedEditionItemAvailabilityResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminRevokeInventoryResult decodeRevokeInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeInventoryItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminRevokeInventoryItemsResult decodeRevokeInventoryItemsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // PlayStream + ////////////////////////////////////////////////////// + + /** Decode the AddPlayerTagResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream Models") + static FAdminAddPlayerTagResult decodeAddPlayerTagResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetAllSegmentsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream Models") + static FAdminGetAllSegmentsResult decodeGetAllSegmentsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerSegmentsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream Models") + static FAdminGetPlayerSegmentsResult decodeGetPlayerSegmentsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayersInSegmentResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream Models") + static FAdminGetPlayersInSegmentResult decodeGetPlayersInSegmentResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerTagsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream Models") + static FAdminGetPlayerTagsResult decodeGetPlayerTagsResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemovePlayerTagResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream Models") + static FAdminRemovePlayerTagResult decodeRemovePlayerTagResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // ScheduledTask + ////////////////////////////////////////////////////// + + /** Decode the EmptyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminEmptyResponse decodeEmptyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the CreateTaskResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminCreateTaskResult decodeCreateTaskResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetActionsOnPlayersInSegmentTaskInstanceResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminGetActionsOnPlayersInSegmentTaskInstanceResult decodeGetActionsOnPlayersInSegmentTaskInstanceResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCloudScriptTaskInstanceResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminGetCloudScriptTaskInstanceResult decodeGetCloudScriptTaskInstanceResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTaskInstancesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminGetTaskInstancesResult decodeGetTaskInstancesResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTasksResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminGetTasksResult decodeGetTasksResultResponse(UPlayFabJsonObject* response); + + /** Decode the RunTaskResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminRunTaskResult decodeRunTaskResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + + /** Decode the GetCloudScriptRevisionResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + static FAdminGetCloudScriptRevisionResult decodeGetCloudScriptRevisionResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCloudScriptVersionsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + static FAdminGetCloudScriptVersionsResult decodeGetCloudScriptVersionsResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetPublishedRevisionResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + static FAdminSetPublishedRevisionResult decodeSetPublishedRevisionResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateCloudScriptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + static FAdminUpdateCloudScriptResult decodeUpdateCloudScriptResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Shared Group Data + ////////////////////////////////////////////////////// + + /** Decode the SetPublisherDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Shared Group Data Models") + static FAdminSetPublisherDataResult decodeSetPublisherDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Title-Wide Data Management + ////////////////////////////////////////////////////// + + /** Decode the AddNewsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminAddNewsResult decodeAddNewsResultResponse(UPlayFabJsonObject* response); + + /** Decode the DeleteStoreResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminDeleteStoreResult decodeDeleteStoreResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCatalogItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminGetCatalogItemsResult decodeGetCatalogItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPublisherDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminGetPublisherDataResult decodeGetPublisherDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetRandomResultTablesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminGetRandomResultTablesResult decodeGetRandomResultTablesResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetStoreItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminGetStoreItemsResult decodeGetStoreItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTitleDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminGetTitleDataResult decodeGetTitleDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the ListVirtualCurrencyTypesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminListVirtualCurrencyTypesResult decodeListVirtualCurrencyTypesResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateCatalogItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminUpdateCatalogItemsResult decodeUpdateCatalogItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateStoreItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminUpdateStoreItemsResult decodeUpdateStoreItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetTitleDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminSetTitleDataResult decodeSetTitleDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetupPushNotificationResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminSetupPushNotificationResult decodeSetupPushNotificationResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateRandomResultTablesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminUpdateRandomResultTablesResult decodeUpdateRandomResultTablesResultResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAdminModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAdminModels.h new file mode 100644 index 000000000..8357404bf --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAdminModels.h @@ -0,0 +1,2380 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Admin +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabAdminModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Admin API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminBanUsersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** List of ban requests to be applied. Maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray Bans; +}; + +USTRUCT(BlueprintType) +struct FAdminBanUsersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were applied */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteMasterPlayerAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteMasterPlayerAccountResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * A notification email with this job receipt Id will be sent to the title notification email address when deletion is + * complete. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString JobReceiptId; + /** List of titles from which the player's data will be deleted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString TitleIds; +}; + +USTRUCT(BlueprintType) +struct FAdminDeletePlayerRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminDeletePlayerResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteTitleRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteTitleResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminExportMasterPlayerDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminExportMasterPlayerDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * An email with this job receipt Id containing the export download link will be sent to the title notification email + * address when the export is complete. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString JobReceiptId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayedTitleListRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayedTitleListResult +{ + GENERATED_USTRUCT_BODY() +public: + /** List of titles the player has played */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString TitleIds; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerIdFromAuthTokenRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The auth token of the player requesting the password reset. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString Token; + /** The type of auth token of the player requesting the password reset. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + EAuthTokenType TokenType; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerIdFromAuthTokenResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The player ID from the token passed in */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerProfileRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerProfileResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The profile of the player. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + UPlayFabJsonObject* PlayerProfile = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminLookupUserAccountInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** User email address attached to their account */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString Email; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; + /** Title specific username to match against existing user accounts */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString TitleDisplayName; + /** PlayFab username for the account (3-20 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FAdminLookupUserAccountInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** User info for the user matching the request */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + UPlayFabJsonObject* UserInfo = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetUserBansRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetUserBansResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information about the bans */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FAdminResetPasswordRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The new password for the player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString Password; + /** The token of the player requesting the password reset. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString Token; +}; + +USTRUCT(BlueprintType) +struct FAdminResetPasswordResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeAllBansForUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeAllBansForUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were revoked. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeBansRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Ids of the bans to be revoked. Maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString BanIds; +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeBansResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were revoked */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FAdminSendAccountRecoveryEmailRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** User email address attached to their account */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString Email; + /** The email template id of the account recovery email template to send. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString EmailTemplateId; +}; + +USTRUCT(BlueprintType) +struct FAdminSendAccountRecoveryEmailResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateBansRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** List of bans to be updated. Maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray Bans; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateBansResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were updated */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateUserTitleDisplayNameRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** New title display name for the user - must be between 3 and 25 characters */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString DisplayName; + /** PlayFab unique identifier of the user whose title specific display name is to be changed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateUserTitleDisplayNameResult +{ + GENERATED_USTRUCT_BODY() +public: + /** current title display name for the user (this will be the original display name if the rename attempt failed) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString DisplayName; +}; + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminCreatePlayerSharedSecretRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Friendly name for this key */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString FriendlyName; +}; + +USTRUCT(BlueprintType) +struct FAdminCreatePlayerSharedSecretResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The player shared secret to use when calling Client/GetTitlePublicKey */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString SecretKey; +}; + +USTRUCT(BlueprintType) +struct FAdminDeletePlayerSharedSecretRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The shared secret key to delete */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString SecretKey; +}; + +USTRUCT(BlueprintType) +struct FAdminDeletePlayerSharedSecretResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerSharedSecretsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerSharedSecretsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The player shared secret to use when calling Client/GetTitlePublicKey */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + TArray SharedSecrets; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPolicyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The name of the policy to read. Only supported name is 'ApiPolicy'. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString PolicyName; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPolicyResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The name of the policy read. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString PolicyName; + /** The statements in the requested policy. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + TArray Statements; +}; + +USTRUCT(BlueprintType) +struct FAdminSetPlayerSecretRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString PlayerSecret; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminSetPlayerSecretResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminUpdatePlayerSharedSecretRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Disable or Enable this key */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + bool Disabled = false; + /** Friendly name for this key */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString FriendlyName; + /** The shared secret key to update */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString SecretKey; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdatePlayerSharedSecretResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminUpdatePolicyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Whether to overwrite or append to the existing policy. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + bool OverwritePolicy = false; + /** The name of the policy being updated. Only supported name is 'ApiPolicy' */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString PolicyName; + /** The new statements to include in the policy. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + TArray Statements; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdatePolicyResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The name of the policy that was updated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString PolicyName; + /** The statements included in the new version of the policy. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + TArray Statements; +}; + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminResetCharacterStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Characters Models") + FString CharacterId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminResetCharacterStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminBlankResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteContentRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Key of the content item to be deleted */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + FString Key; +}; + +USTRUCT(BlueprintType) +struct FAdminGetContentListRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Limits the response to keys that begin with the specified prefix. You can use prefixes to list contents under a folder, + * or for a specified version, etc. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + FString Prefix; +}; + +USTRUCT(BlueprintType) +struct FAdminGetContentListResult +{ + GENERATED_USTRUCT_BODY() +public: + /** List of content items. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + TArray Contents; + /** Number of content items returned. We currently have a maximum of 1000 items limit. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + int32 ItemCount = 0; + /** The total size of listed contents in bytes. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + int32 TotalSize = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminGetContentUploadUrlRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * A standard MIME type describing the format of the contents. The same MIME type has to be set in the header when + * uploading the content. If not specified, the MIME type is 'binary/octet-stream' by default. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + FString ContentType; + /** Key of the content item to upload, usually formatted as a path, e.g. images/a.png */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + FString Key; +}; + +USTRUCT(BlueprintType) +struct FAdminGetContentUploadUrlResult +{ + GENERATED_USTRUCT_BODY() +public: + /** URL for uploading content via HTTP PUT method. The URL will expire in approximately one hour. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + FString URL; +}; + + +/////////////////////////////////////////////////////// +// Custom Server Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminAddServerBuildRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** server host regions in which this build should be running and available */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ActiveRegions; + /** unique identifier for the build executable */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; + /** appended to the end of the command line when starting game servers */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString CommandLineTemplate; + /** developer comment(s) for this build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Comment; + /** path to the game server executable. Defaults to gameserver.exe */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ExecutablePath; + /** maximum number of game server instances that can run on a single host machine */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MaxGamesPerHost = 0; + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MinFreeGameSlots = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminAddServerBuildResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of regions where this build can used, when it is active */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ActiveRegions; + /** unique identifier for this build executable */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; + /** appended to the end of the command line when starting game servers */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString CommandLineTemplate; + /** developer comment(s) for this build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Comment; + /** path to the game server executable. Defaults to gameserver.exe */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ExecutablePath; + /** maximum number of game server instances that can run on a single host machine */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MaxGamesPerHost = 0; + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MinFreeGameSlots = 0; + /** the current status of the build validation and processing steps */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + EGameBuildStatus Status; + /** time this build was last modified (or uploaded, if this build has never been modified) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Timestamp; + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString TitleId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetServerBuildInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique identifier of the previously uploaded build executable for which information is being requested */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; +}; + +/** Information about a particular server build */ +USTRUCT(BlueprintType) +struct FAdminGetServerBuildInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of regions where this build can used, when it is active */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ActiveRegions; + /** unique identifier for this build executable */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; + /** developer comment(s) for this build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Comment; + /** error message, if any, about this build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ErrorMessage; + /** maximum number of game server instances that can run on a single host machine */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MaxGamesPerHost = 0; + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MinFreeGameSlots = 0; + /** the current status of the build validation and processing steps */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + EGameBuildStatus Status; + /** time this build was last modified (or uploaded, if this build has never been modified) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Timestamp; + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString TitleId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetServerBuildUploadURLRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique identifier of the game server build to upload */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetServerBuildUploadURLResult +{ + GENERATED_USTRUCT_BODY() +public: + /** pre-authorized URL for uploading the game server build package */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString URL; +}; + +USTRUCT(BlueprintType) +struct FAdminListBuildsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminListBuildsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of uploaded game server builds */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + TArray Builds; +}; + +USTRUCT(BlueprintType) +struct FAdminModifyServerBuildRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** array of regions where this build can used, when it is active */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ActiveRegions; + /** unique identifier of the previously uploaded build executable to be updated */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; + /** appended to the end of the command line when starting game servers */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString CommandLineTemplate; + /** developer comment(s) for this build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Comment; + /** path to the game server executable. Defaults to gameserver.exe */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ExecutablePath; + /** maximum number of game server instances that can run on a single host machine */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MaxGamesPerHost = 0; + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MinFreeGameSlots = 0; + /** new timestamp */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Timestamp; +}; + +USTRUCT(BlueprintType) +struct FAdminModifyServerBuildResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of regions where this build can used, when it is active */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ActiveRegions; + /** unique identifier for this build executable */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; + /** appended to the end of the command line when starting game servers */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString CommandLineTemplate; + /** developer comment(s) for this build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Comment; + /** path to the game server executable. Defaults to gameserver.exe */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ExecutablePath; + /** maximum number of game server instances that can run on a single host machine */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MaxGamesPerHost = 0; + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MinFreeGameSlots = 0; + /** the current status of the build validation and processing steps */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + EGameBuildStatus Status; + /** time this build was last modified (or uploaded, if this build has never been modified) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Timestamp; + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString TitleId; +}; + +USTRUCT(BlueprintType) +struct FAdminRemoveServerBuildRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique identifier of the previously uploaded build executable to be removed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; +}; + +USTRUCT(BlueprintType) +struct FAdminRemoveServerBuildResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminGetMatchmakerGameInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique identifier of the lobby for which info is being requested */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString LobbyId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetMatchmakerGameInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** version identifier of the game server executable binary being run */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString BuildVersion; + /** time when Game Server Instance is currently scheduled to end */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString EndTime; + /** unique identifier of the lobby */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString LobbyId; + /** game mode for this Game Server Instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString Mode; + /** array of unique PlayFab identifiers for users currently connected to this Game Server Instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString Players; + /** region in which the Game Server Instance is running */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + ERegion Region; + /** IPV4 address of the game server instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString ServerAddress; + /** IPV4 address of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString ServerIPV4Address; + /** IPV6 address of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString ServerIPV6Address; + /** communication port for this Game Server Instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + int32 ServerPort = 0; + /** Public DNS name (if any) of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString ServerPublicDNSName; + /** time when the Game Server Instance was created */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString StartTime; + /** unique identifier of the Game Server Instance for this lobby */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString TitleId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetMatchmakerGameModesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** previously uploaded build version for which game modes are being requested */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString BuildVersion; +}; + +USTRUCT(BlueprintType) +struct FAdminGetMatchmakerGameModesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of game modes available for the specified build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + TArray GameModes; +}; + +USTRUCT(BlueprintType) +struct FAdminModifyMatchmakerGameModesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** previously uploaded build version for which game modes are being specified */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString BuildVersion; + /** array of game modes (Note: this will replace all game modes for the indicated build version) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + TArray GameModes; +}; + +USTRUCT(BlueprintType) +struct FAdminModifyMatchmakerGameModesResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminCreatePlayerStatisticDefinitionRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** the aggregation method to use in updating the statistic (defaults to last) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + EStatisticAggregationMethod AggregationMethod; + /** unique name of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString StatisticName; + /** interval at which the values of the statistic for all players are reset (resets begin at the next interval boundary) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + EStatisticResetIntervalOption VersionChangeInterval; +}; + +USTRUCT(BlueprintType) +struct FAdminCreatePlayerStatisticDefinitionResult +{ + GENERATED_USTRUCT_BODY() +public: + /** created statistic definition */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + UPlayFabJsonObject* Statistic = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetDataReportRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Reporting year (UTC) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + int32 Day = 0; + /** Reporting month (UTC) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + int32 Month = 0; + /** Report name */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString ReportName; + /** Reporting year (UTC) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + int32 Year = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminGetDataReportResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The URL where the requested report can be downloaded. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString DownloadUrl; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerStatisticDefinitionsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerStatisticDefinitionsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** the player statistic definitions for the title */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + TArray Statistics; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerStatisticVersionsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique name of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerStatisticVersionsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** version change history of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + TArray StatisticVersions; +}; + +USTRUCT(BlueprintType) +struct FAdminGetUserDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + int32 IfChangedFromDataVersion = 0; + /** Specific keys to search for in the custom user data. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString Keys; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetUserDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** User specific data for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + UPlayFabJsonObject* Data = nullptr; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + int32 DataVersion = 0; + /** PlayFab unique identifier of the user whose custom data is being returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminIncrementPlayerStatisticVersionRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique name of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FAdminIncrementPlayerStatisticVersionResult +{ + GENERATED_USTRUCT_BODY() +public: + /** version change history of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + UPlayFabJsonObject* StatisticVersion = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminRefundPurchaseRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique order ID for the purchase in question. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString OrderId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; + /** + * The Reason parameter should correspond with the payment providers reason field, if they require one such as Facebook. In + * the case of Facebook this must match one of their refund or dispute resolution enums (See: + * https://developers.facebook.com/docs/payments/implementation-guide/handling-disputes-refunds) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString Reason; +}; + +USTRUCT(BlueprintType) +struct FAdminRefundPurchaseResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The order's updated purchase status. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PurchaseStatus; +}; + +USTRUCT(BlueprintType) +struct FAdminResetUserStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminResetUserStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminResolvePurchaseDisputeRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique order ID for the purchase in question. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString OrderId; + /** + * Enum for the desired purchase result state after notifying the payment provider. Valid values are Revoke, Reinstate and + * Manual. Manual will cause no change to the order state. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + EResolutionOutcome Outcome; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; + /** + * The Reason parameter should correspond with the payment providers reason field, if they require one such as Facebook. In + * the case of Facebook this must match one of their refund or dispute resolution enums (See: + * https://developers.facebook.com/docs/payments/implementation-guide/handling-disputes-refunds) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString Reason; +}; + +USTRUCT(BlueprintType) +struct FAdminResolvePurchaseDisputeResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The order's updated purchase status. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PurchaseStatus; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdatePlayerStatisticDefinitionRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** the aggregation method to use in updating the statistic (defaults to last) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + EStatisticAggregationMethod AggregationMethod; + /** unique name of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString StatisticName; + /** + * interval at which the values of the statistic for all players are reset (changes are effective at the next occurance of + * the new interval boundary) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + EStatisticResetIntervalOption VersionChangeInterval; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdatePlayerStatisticDefinitionResult +{ + GENERATED_USTRUCT_BODY() +public: + /** updated statistic definition */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + UPlayFabJsonObject* Statistic = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateUserDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString KeysToRemove; + /** Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + EUserDataPermission Permission; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateUserDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + int32 DataVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateUserInternalDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString KeysToRemove; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; +}; + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminAddUserVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Amount to be added to the user balance of the specified virtual currency. Maximum VC balance is Int32 (2,147,483,647). + * Any increase over this value will be discarded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + int32 Amount = 0; + /** PlayFab unique identifier of the user whose virtual currency balance is to be increased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which is to be incremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FAdminModifyUserVirtualCurrencyResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Balance of the virtual currency after modification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + int32 Balance = 0; + /** + * Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase + * over this value will be discarded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + int32 BalanceChange = 0; + /** User currency was subtracted from. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which was modified. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FAdminCheckLimitedEditionItemAvailabilityRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Which catalog is being updated. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString CatalogVersion; + /** The item to check for. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString ItemId; +}; + +USTRUCT(BlueprintType) +struct FAdminCheckLimitedEditionItemAvailabilityResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The amount of the specified resource remaining. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + int32 Amount = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminGetUserInventoryRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetUserInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of inventory items belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + TArray Inventory; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString PlayFabId; + /** Array of virtual currency balance(s) belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; + /** Array of remaining times and timestamps for virtual currencies. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrencyRechargeTimes = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGrantItemsToUsersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version from which items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString CatalogVersion; + /** Array of items to grant and the users to whom the items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + TArray ItemGrants; +}; + +USTRUCT(BlueprintType) +struct FAdminGrantItemsToUsersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items granted to users. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + TArray ItemGrantResults; +}; + +USTRUCT(BlueprintType) +struct FAdminIncrementLimitedEditionItemAvailabilityRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Amount to increase availability by. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + int32 Amount = 0; + /** Which catalog is being updated. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString CatalogVersion; + /** The item which needs more availability. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString ItemId; +}; + +USTRUCT(BlueprintType) +struct FAdminIncrementLimitedEditionItemAvailabilityResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeInventoryItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString CharacterId; + /** Unique PlayFab assigned instance identifier of the item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString ItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeInventoryItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of player items to revoke, between 1 and 25 items. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + TArray Items; +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeInventoryItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Collection of any errors that occurred during processing. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + TArray Errors; +}; + +USTRUCT(BlueprintType) +struct FAdminSubtractUserVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Amount to be subtracted from the user balance of the specified virtual currency. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + int32 Amount = 0; + /** PlayFab unique identifier of the user whose virtual currency balance is to be decreased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which is to be decremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString VirtualCurrency; +}; + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminAddPlayerTagRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString PlayFabId; + /** Unique tag for player profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString TagName; +}; + +USTRUCT(BlueprintType) +struct FAdminAddPlayerTagResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetAllSegmentsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetAllSegmentsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of segments for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + TArray Segments; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerSegmentsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of segments the requested player currently belongs to. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + TArray Segments; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayersSegmentsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayersInSegmentRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Continuation token if retrieving subsequent pages of results. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString ContinuationToken; + /** Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + int32 MaxBatchSize = 0; + /** + * Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging + * results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + int32 SecondsToLive = 0; + /** Unique identifier for this segment. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString SegmentId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayersInSegmentResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString ContinuationToken; + /** Array of player profiles in this segment. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + TArray PlayerProfiles; + /** Count of profiles matching this segment. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + int32 ProfilesInSegment = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerTagsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional namespace to filter results by */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString Namespace; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerTagsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString PlayFabId; + /** Canonical tags (including namespace and tag's name) for the requested user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString Tags; +}; + +USTRUCT(BlueprintType) +struct FAdminRemovePlayerTagRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString PlayFabId; + /** Unique tag for player profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString TagName; +}; + +USTRUCT(BlueprintType) +struct FAdminRemovePlayerTagResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// ScheduledTask +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminAbortTaskInstanceRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** ID of a task instance that is being aborted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString TaskInstanceId; +}; + +USTRUCT(BlueprintType) +struct FAdminEmptyResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminCreateActionsOnPlayerSegmentTaskRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Description the task */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Description; + /** Whether the schedule is active. Inactive schedule will not trigger task execution. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + bool IsActive = false; + /** Name of the task. This is a unique identifier for tasks in the title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Name; + /** Task details related to segment and action */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Parameter = nullptr; + /** Cron expression for the run schedule of the task. The expression should be in UTC. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Schedule; +}; + +USTRUCT(BlueprintType) +struct FAdminCreateTaskResult +{ + GENERATED_USTRUCT_BODY() +public: + /** ID of the task */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString TaskId; +}; + +USTRUCT(BlueprintType) +struct FAdminCreateCloudScriptTaskRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Description the task */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Description; + /** Whether the schedule is active. Inactive schedule will not trigger task execution. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + bool IsActive = false; + /** Name of the task. This is a unique identifier for tasks in the title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Name; + /** Task details related to CloudScript */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Parameter = nullptr; + /** Cron expression for the run schedule of the task. The expression should be in UTC. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Schedule; +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteTaskRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Specify either the task ID or the name of task to be deleted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Identifier = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetActionsOnPlayersInSegmentTaskInstanceResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Parameter of this task instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Parameter = nullptr; + /** Status summary of the actions-on-players-in-segment task instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Summary = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTaskInstanceRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** ID of the requested task instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString TaskInstanceId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetCloudScriptTaskInstanceResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Parameter of this task instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Parameter = nullptr; + /** Status summary of the CloudScript task instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Summary = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTaskInstancesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional range-from filter for task instances' StartedAt timestamp. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString StartedAtRangeFrom; + /** Optional range-to filter for task instances' StartedAt timestamp. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString StartedAtRangeTo; + /** Optional filter for task instances that are of a specific status. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + ETaskInstanceStatus StatusFilter; + /** + * Name or ID of the task whose instances are being queried. If not specified, return all task instances that satisfy + * conditions set by other filters. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* TaskIdentifier = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTaskInstancesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Basic status summaries of the queried task instances. Empty If no task instances meets the filter criteria. To get + * detailed status summary, use Get*TaskInstance API according to task type (e.g. + * GetActionsOnPlayersInSegmentTaskInstance). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + TArray Summaries; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTasksRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Provide either the task ID or the task name to get a specific task. If not specified, return all defined tasks. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Identifier = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTasksResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Result tasks. Empty if there is no task found. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + TArray Tasks; +}; + +USTRUCT(BlueprintType) +struct FAdminRunTaskRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Provide either the task ID or the task name to run a task. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Identifier = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminRunTaskResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * ID of the task instance that is started. This can be used in Get*TaskInstance (e.g. GetCloudScriptTaskInstance) API call + * to retrieve status for the task instance. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString TaskInstanceId; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateTaskRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Description the task */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Description; + /** Specify either the task ID or the name of the task to be updated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Identifier = nullptr; + /** Whether the schedule is active. Inactive schedule will not trigger task execution. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + bool IsActive = false; + /** Name of the task. This is a unique identifier for tasks in the title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Name; + /** Parameter object specific to the task type. See each task type's create API documentation for details. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Parameter = nullptr; + /** Cron expression for the run schedule of the task. The expression should be in UTC. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Schedule; + /** Task type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + EScheduledTaskType Type; +}; + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminGetCloudScriptRevisionRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Revision number. If left null, defaults to the latest revision */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Revision = 0; + /** Version number. If left null, defaults to the latest version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminGetCloudScriptRevisionResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Time this revision was created */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + FString CreatedAt; + /** List of Cloud Script files in this revision. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + TArray Files; + /** True if this is the currently published revision */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + bool IsPublished = false; + /** Revision number. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Revision = 0; + /** Version number. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminGetCloudScriptVersionsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetCloudScriptVersionsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** List of versions */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + TArray Versions; +}; + +USTRUCT(BlueprintType) +struct FAdminSetPublishedRevisionRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Revision to make the current published revision */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Revision = 0; + /** Version number */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminSetPublishedRevisionResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateCloudScriptRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab user ID of the developer initiating the request. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + FString DeveloperPlayFabId; + /** List of Cloud Script files to upload to create the new revision. Must have at least one file. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + TArray Files; + /** Immediately publish the new revision */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + bool Publish = false; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateCloudScriptResult +{ + GENERATED_USTRUCT_BODY() +public: + /** New revision number created */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Revision = 0; + /** Cloud Script version updated */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Version = 0; +}; + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminSetPublisherDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Shared Group Data Models") + FString Key; + /** new value to set. Set to null to remove a value */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Shared Group Data Models") + FString Value; +}; + +USTRUCT(BlueprintType) +struct FAdminSetPublisherDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminAddNewsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Body text of the news */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Body; + /** Time this news was published. If not set, defaults to now. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Timestamp; + /** Title (headline) of the news item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Title; +}; + +USTRUCT(BlueprintType) +struct FAdminAddNewsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique id of the new news item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString NewsId; +}; + +USTRUCT(BlueprintType) +struct FAdminAddVirtualCurrencyTypesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * List of virtual currencies and their initial deposits (the amount a user is granted when signing in for the first time) + * to the title + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray VirtualCurrencies; +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteStoreRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** catalog version of the store to delete. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; + /** unqiue identifier for the store which is to be deleted */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteStoreResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetCatalogItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Which catalog is being requested. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; +}; + +USTRUCT(BlueprintType) +struct FAdminGetCatalogItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items which can be purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray Catalog; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPublisherDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** array of keys to get back data from the Publisher data blob, set by the admin tools */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Keys; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPublisherDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** a dictionary object of key / value pairs */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + UPlayFabJsonObject* Data; +}; + +USTRUCT(BlueprintType) +struct FAdminGetRandomResultTablesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** catalog version to fetch tables from. Use default catalog version if null */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; +}; + +USTRUCT(BlueprintType) +struct FAdminGetRandomResultTablesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of random result tables currently available */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + UPlayFabJsonObject* Tables = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetStoreItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** catalog version to store items from. Use default catalog version if null */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; + /** Unqiue identifier for the store which is being requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetStoreItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The base catalog that this store is a part of. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; + /** Additional data about the store. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + UPlayFabJsonObject* MarketingData = nullptr; + /** How the store was last updated (Admin or a third party). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + EPfSourceType Source; + /** Array of items which can be purchased from this store. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray Store; + /** The ID of this store. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTitleDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Specific keys to search for in the title data (leave null to get all keys) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Keys; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTitleDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** a dictionary object of key / value pairs */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + UPlayFabJsonObject* Data; +}; + +USTRUCT(BlueprintType) +struct FAdminListVirtualCurrencyTypesRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminListVirtualCurrencyTypesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** List of virtual currency names defined for this title */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray VirtualCurrencies; +}; + +USTRUCT(BlueprintType) +struct FAdminRemoveVirtualCurrencyTypesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** List of virtual currencies to delete */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray VirtualCurrencies; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateCatalogItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Array of catalog items to be submitted. Note that while CatalogItem has a parameter for CatalogVersion, it is not + * required and ignored in this call. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray Catalog; + /** Which catalog is being updated. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; + /** + * Should this catalog be set as the default catalog. Defaults to true. If there is currently no default catalog, this will + * always set it. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + bool SetAsDefaultCatalog = false; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateCatalogItemsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateStoreItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version of the store to update. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; + /** Additional data about the store */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + UPlayFabJsonObject* MarketingData = nullptr; + /** Array of store items - references to catalog items, with specific pricing - to be added */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray Store; + /** Unique identifier for the store which is to be updated */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateStoreItemsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminSetTitleDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Key; + /** new value to set. Set to null to remove a value */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Value; +}; + +USTRUCT(BlueprintType) +struct FAdminSetTitleDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminSetupPushNotificationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Credential is the Private Key for APNS/APNS_SANDBOX, and the API Key for GCM */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Credential; + /** for APNS, this is the PlatformPrincipal (SSL Certificate) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Key; + /** + * name of the application sending the message (application names must be made up of only uppercase and lowercase ASCII + * letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Name; + /** + * replace any existing ARN with the newly generated one. If this is set to false, an error will be returned if + * notifications have already setup for this platform. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + bool OverwriteOldARN = false; + /** + * supported notification platforms are Apple Push Notification Service (APNS and APNS_SANDBOX) for iOS and Google Cloud + * Messaging (GCM) for Android + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + EPushSetupPlatform Platform; +}; + +USTRUCT(BlueprintType) +struct FAdminSetupPushNotificationResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Amazon Resource Name for the created notification topic. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString ARN; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateRandomResultTablesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** which catalog is being updated. If null, update the current default catalog version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; + /** + * array of random result tables to make available (Note: specifying an existing TableId will result in overwriting that + * table, while any others will be added to the available set) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray Tables; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateRandomResultTablesResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationAPI.h new file mode 100644 index 000000000..5a306865b --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationAPI.h @@ -0,0 +1,107 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Authentication +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabAuthenticationModels.h" +#include "PlayFabAuthenticationAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabAuthenticationRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabAuthenticationAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabAuthenticationRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Authentication API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetEntityToken, FAuthenticationGetEntityTokenResponse, result, UObject*, customData); + + /** + * Method to exchange a legacy AuthenticationTicket or title SecretKey for an Entity Token or to refresh a still valid + * Entity Token. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Authentication | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAuthenticationAPI* GetEntityToken(FAuthenticationGetEntityTokenRequest request, + FDelegateOnSuccessGetEntityToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAuthenticationRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Authentication | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetEntityToken(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessGetEntityToken OnSuccessGetEntityToken; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationModelDecoder.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationModelDecoder.h new file mode 100644 index 000000000..af6f07bf1 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationModelDecoder.h @@ -0,0 +1,45 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Authentication +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabAuthenticationModels.h" +#include "PlayFabAuthenticationModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabAuthenticationModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Authentication API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + + /** Decode the GetEntityTokenResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Authentication | Authentication Models") + static FAuthenticationGetEntityTokenResponse decodeGetEntityTokenResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationModels.h new file mode 100644 index 000000000..d6128d629 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationModels.h @@ -0,0 +1,56 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Authentication +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabAuthenticationModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Authentication API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAuthenticationGetEntityTokenRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Authentication | Authentication Models") + UPlayFabJsonObject* Entity = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAuthenticationGetEntityTokenResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Authentication | Authentication Models") + UPlayFabJsonObject* Entity = nullptr; + /** The token used to set X-EntityToken for all entity based API calls. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Authentication | Authentication Models") + FString EntityToken; + /** The time the token will expire, if it is an expiring token, in UTC. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Authentication | Authentication Models") + FString TokenExpiration; +}; + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabBaseModel.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabBaseModel.h new file mode 100644 index 000000000..121d28551 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabBaseModel.h @@ -0,0 +1,60 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// PlayFab Base Model Header. This file holds the base ustruct for the playfab models. +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "PlayFabBaseModel.generated.h" + +class UPlayFabJsonObject; + +USTRUCT(BlueprintType) +struct FPlayFabError +{ + GENERATED_USTRUCT_BODY() + + /** Is there an error */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + bool hasError; + + /** Holds the error code recieved from playfab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + int32 ErrorCode; + + /** Holds the error name recieved from playfab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + FString ErrorName; + + /** Holds the error message recieved from playfab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + FString ErrorMessage; + + /** Holds the error details recieved from playfab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + FString ErrorDetails; + + // Decode the error if there is one + void decodeError(UPlayFabJsonObject* responseData); + +}; + +USTRUCT(BlueprintType) +struct FPlayFabBaseModel +{ + GENERATED_USTRUCT_BODY() + + /** Holds the error USTRUCT recieved from playfab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + FPlayFabError responseError; + + /** Holds the full JSON recieved from playfab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + UPlayFabJsonObject* responseData; + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabClientAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabClientAPI.h new file mode 100644 index 000000000..991c8dc5f --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabClientAPI.h @@ -0,0 +1,2409 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Client +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabClientModels.h" +#include "PlayFabClientAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabClientRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabClientAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabClientRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Client API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddGenericID, FClientAddGenericIDResult, result, UObject*, customData); + + /** + * Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab + * ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as + * authentication credentials, as the intent is that it is easily accessible by other players. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AddGenericID(FClientAddGenericIDRequest request, + FDelegateOnSuccessAddGenericID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddGenericID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddOrUpdateContactEmail, FClientAddOrUpdateContactEmailResult, result, UObject*, customData); + + /** Adds or updates a contact email to the player's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AddOrUpdateContactEmail(FClientAddOrUpdateContactEmailRequest request, + FDelegateOnSuccessAddOrUpdateContactEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddOrUpdateContactEmail(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddUsernamePassword, FClientAddUsernamePasswordResult, result, UObject*, customData); + + /** + * Adds playfab username/password auth to an existing account created via an anonymous auth method, e.g. automatic device + * ID login. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AddUsernamePassword(FClientAddUsernamePasswordRequest request, + FDelegateOnSuccessAddUsernamePassword onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddUsernamePassword(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetAccountInfo, FClientGetAccountInfoResult, result, UObject*, customData); + + /** Retrieves the user's PlayFab account details */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetAccountInfo(FClientGetAccountInfoRequest request, + FDelegateOnSuccessGetAccountInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetAccountInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerCombinedInfo, FClientGetPlayerCombinedInfoResult, result, UObject*, customData); + + /** Retrieves all of the user's different kinds of info. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerCombinedInfo(FClientGetPlayerCombinedInfoRequest request, + FDelegateOnSuccessGetPlayerCombinedInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerCombinedInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerProfile, FClientGetPlayerProfileResult, result, UObject*, customData); + + /** Retrieves the player's profile */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerProfile(FClientGetPlayerProfileRequest request, + FDelegateOnSuccessGetPlayerProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerProfile(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs, FClientGetPlayFabIDsFromFacebookIDsResult, result, UObject*, customData); + + /** Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromFacebookIDs(FClientGetPlayFabIDsFromFacebookIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromFacebookIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds, FClientGetPlayFabIDsFromFacebookInstantGamesIdsResult, result, UObject*, customData); + + /** Retrieves the unique PlayFab identifiers for the given set of Facebook Instant Game identifiers. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromFacebookInstantGamesIds(FClientGetPlayFabIDsFromFacebookInstantGamesIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromFacebookInstantGamesIds(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromGameCenterIDs, FClientGetPlayFabIDsFromGameCenterIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of Game Center identifiers (referenced in the Game Center + * Programming Guide as the Player Identifier). + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromGameCenterIDs(FClientGetPlayFabIDsFromGameCenterIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromGameCenterIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromGameCenterIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromGenericIDs, FClientGetPlayFabIDsFromGenericIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the + * service name plus the service-specific ID for the player, as specified by the title when the generic identifier was + * added to the player account. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromGenericIDs(FClientGetPlayFabIDsFromGenericIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromGenericIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromGenericIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromGoogleIDs, FClientGetPlayFabIDsFromGoogleIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of Google identifiers. The Google identifiers are the IDs for + * the user accounts, available as "id" in the Google+ People API calls. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromGoogleIDs(FClientGetPlayFabIDsFromGoogleIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromGoogleIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromGoogleIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromKongregateIDs, FClientGetPlayFabIDsFromKongregateIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of Kongregate identifiers. The Kongregate identifiers are the + * IDs for the user accounts, available as "user_id" from the Kongregate API methods(ex: + * http://developers.kongregate.com/docs/client/getUserId). + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromKongregateIDs(FClientGetPlayFabIDsFromKongregateIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromKongregateIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromKongregateIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds, FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsResult, result, UObject*, customData); + + /** Retrieves the unique PlayFab identifiers for the given set of Nintendo Switch identifiers. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromNintendoSwitchDeviceIds(FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromNintendoSwitchDeviceIds(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromSteamIDs, FClientGetPlayFabIDsFromSteamIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile + * IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromSteamIDs(FClientGetPlayFabIDsFromSteamIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromSteamIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromSteamIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromTwitchIDs, FClientGetPlayFabIDsFromTwitchIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of Twitch identifiers. The Twitch identifiers are the IDs for + * the user accounts, available as "_id" from the Twitch API methods (ex: + * https://github.com/justintv/Twitch-API/blob/master/v3_resources/users.md#get-usersuser). + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromTwitchIDs(FClientGetPlayFabIDsFromTwitchIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromTwitchIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromTwitchIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkAndroidDeviceID, FClientLinkAndroidDeviceIDResult, result, UObject*, customData); + + /** Links the Android device identifier to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkAndroidDeviceID(FClientLinkAndroidDeviceIDRequest request, + FDelegateOnSuccessLinkAndroidDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkAndroidDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkCustomID, FClientLinkCustomIDResult, result, UObject*, customData); + + /** Links the custom identifier, generated by the title, to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkCustomID(FClientLinkCustomIDRequest request, + FDelegateOnSuccessLinkCustomID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkCustomID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkFacebookAccount, FClientLinkFacebookAccountResult, result, UObject*, customData); + + /** Links the Facebook account associated with the provided Facebook access token to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkFacebookAccount(FClientLinkFacebookAccountRequest request, + FDelegateOnSuccessLinkFacebookAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkFacebookAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkFacebookInstantGamesId, FClientLinkFacebookInstantGamesIdResult, result, UObject*, customData); + + /** Links the Facebook Instant Games Id to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkFacebookInstantGamesId(FClientLinkFacebookInstantGamesIdRequest request, + FDelegateOnSuccessLinkFacebookInstantGamesId onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkFacebookInstantGamesId(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkGameCenterAccount, FClientLinkGameCenterAccountResult, result, UObject*, customData); + + /** Links the Game Center account associated with the provided Game Center ID to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkGameCenterAccount(FClientLinkGameCenterAccountRequest request, + FDelegateOnSuccessLinkGameCenterAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkGameCenterAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkGoogleAccount, FClientLinkGoogleAccountResult, result, UObject*, customData); + + /** Links the currently signed-in user account to their Google account, using their Google account credentials */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkGoogleAccount(FClientLinkGoogleAccountRequest request, + FDelegateOnSuccessLinkGoogleAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkGoogleAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkIOSDeviceID, FClientLinkIOSDeviceIDResult, result, UObject*, customData); + + /** Links the vendor-specific iOS device identifier to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkIOSDeviceID(FClientLinkIOSDeviceIDRequest request, + FDelegateOnSuccessLinkIOSDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkIOSDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkKongregate, FClientLinkKongregateAccountResult, result, UObject*, customData); + + /** Links the Kongregate identifier to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkKongregate(FClientLinkKongregateAccountRequest request, + FDelegateOnSuccessLinkKongregate onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkKongregate(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkNintendoSwitchDeviceId, FClientLinkNintendoSwitchDeviceIdResult, result, UObject*, customData); + + /** Links the NintendoSwitchDeviceId to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkNintendoSwitchDeviceId(FClientLinkNintendoSwitchDeviceIdRequest request, + FDelegateOnSuccessLinkNintendoSwitchDeviceId onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkNintendoSwitchDeviceId(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkSteamAccount, FClientLinkSteamAccountResult, result, UObject*, customData); + + /** Links the Steam account associated with the provided Steam authentication ticket to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkSteamAccount(FClientLinkSteamAccountRequest request, + FDelegateOnSuccessLinkSteamAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkSteamAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkTwitch, FClientLinkTwitchAccountResult, result, UObject*, customData); + + /** Links the Twitch account associated with the token to the user's PlayFab account. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkTwitch(FClientLinkTwitchAccountRequest request, + FDelegateOnSuccessLinkTwitch onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkTwitch(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkWindowsHello, FClientLinkWindowsHelloAccountResponse, result, UObject*, customData); + + /** Link Windows Hello authentication to the current PlayFab Account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkWindowsHello(FClientLinkWindowsHelloAccountRequest request, + FDelegateOnSuccessLinkWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkXboxAccount, FClientLinkXboxAccountResult, result, UObject*, customData); + + /** Links the Xbox Live account associated with the provided access code to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkXboxAccount(FClientLinkXboxAccountRequest request, + FDelegateOnSuccessLinkXboxAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkXboxAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveContactEmail, FClientRemoveContactEmailResult, result, UObject*, customData); + + /** Removes a contact email from the player's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RemoveContactEmail(FClientRemoveContactEmailRequest request, + FDelegateOnSuccessRemoveContactEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveContactEmail(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveGenericID, FClientRemoveGenericIDResult, result, UObject*, customData); + + /** Removes the specified generic service identifier from the player's PlayFab account. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RemoveGenericID(FClientRemoveGenericIDRequest request, + FDelegateOnSuccessRemoveGenericID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveGenericID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessReportPlayer, FClientReportPlayerClientResult, result, UObject*, customData); + + /** + * Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title + * can take action concerning potentially toxic players. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ReportPlayer(FClientReportPlayerClientRequest request, + FDelegateOnSuccessReportPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperReportPlayer(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSendAccountRecoveryEmail, FClientSendAccountRecoveryEmailResult, result, UObject*, customData); + + /** + * Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to + * change the password.If an account recovery email template ID is provided, an email using the custom email template will + * be used. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* SendAccountRecoveryEmail(FClientSendAccountRecoveryEmailRequest request, + FDelegateOnSuccessSendAccountRecoveryEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSendAccountRecoveryEmail(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkAndroidDeviceID, FClientUnlinkAndroidDeviceIDResult, result, UObject*, customData); + + /** Unlinks the related Android device identifier from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkAndroidDeviceID(FClientUnlinkAndroidDeviceIDRequest request, + FDelegateOnSuccessUnlinkAndroidDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkAndroidDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkCustomID, FClientUnlinkCustomIDResult, result, UObject*, customData); + + /** Unlinks the related custom identifier from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkCustomID(FClientUnlinkCustomIDRequest request, + FDelegateOnSuccessUnlinkCustomID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkCustomID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkFacebookAccount, FClientUnlinkFacebookAccountResult, result, UObject*, customData); + + /** Unlinks the related Facebook account from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkFacebookAccount(FClientUnlinkFacebookAccountRequest request, + FDelegateOnSuccessUnlinkFacebookAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkFacebookAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkFacebookInstantGamesId, FClientUnlinkFacebookInstantGamesIdResult, result, UObject*, customData); + + /** Unlinks the related Facebook Instant Game Ids from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkFacebookInstantGamesId(FClientUnlinkFacebookInstantGamesIdRequest request, + FDelegateOnSuccessUnlinkFacebookInstantGamesId onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkFacebookInstantGamesId(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkGameCenterAccount, FClientUnlinkGameCenterAccountResult, result, UObject*, customData); + + /** Unlinks the related Game Center account from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkGameCenterAccount(FClientUnlinkGameCenterAccountRequest request, + FDelegateOnSuccessUnlinkGameCenterAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkGameCenterAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkGoogleAccount, FClientUnlinkGoogleAccountResult, result, UObject*, customData); + + /** + * Unlinks the related Google account from the user's PlayFab account + * (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods). + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkGoogleAccount(FClientUnlinkGoogleAccountRequest request, + FDelegateOnSuccessUnlinkGoogleAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkGoogleAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkIOSDeviceID, FClientUnlinkIOSDeviceIDResult, result, UObject*, customData); + + /** Unlinks the related iOS device identifier from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkIOSDeviceID(FClientUnlinkIOSDeviceIDRequest request, + FDelegateOnSuccessUnlinkIOSDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkIOSDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkKongregate, FClientUnlinkKongregateAccountResult, result, UObject*, customData); + + /** Unlinks the related Kongregate identifier from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkKongregate(FClientUnlinkKongregateAccountRequest request, + FDelegateOnSuccessUnlinkKongregate onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkKongregate(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkNintendoSwitchDeviceId, FClientUnlinkNintendoSwitchDeviceIdResult, result, UObject*, customData); + + /** Unlinks the related NintendoSwitchDeviceId from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkNintendoSwitchDeviceId(FClientUnlinkNintendoSwitchDeviceIdRequest request, + FDelegateOnSuccessUnlinkNintendoSwitchDeviceId onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkNintendoSwitchDeviceId(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkSteamAccount, FClientUnlinkSteamAccountResult, result, UObject*, customData); + + /** Unlinks the related Steam account from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkSteamAccount(FClientUnlinkSteamAccountRequest request, + FDelegateOnSuccessUnlinkSteamAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkSteamAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkTwitch, FClientUnlinkTwitchAccountResult, result, UObject*, customData); + + /** Unlinks the related Twitch account from the user's PlayFab account. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkTwitch(FClientUnlinkTwitchAccountRequest request, + FDelegateOnSuccessUnlinkTwitch onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkTwitch(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkWindowsHello, FClientUnlinkWindowsHelloAccountResponse, result, UObject*, customData); + + /** Unlink Windows Hello authentication from the current PlayFab Account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkWindowsHello(FClientUnlinkWindowsHelloAccountRequest request, + FDelegateOnSuccessUnlinkWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkXboxAccount, FClientUnlinkXboxAccountResult, result, UObject*, customData); + + /** Unlinks the related Xbox Live account from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkXboxAccount(FClientUnlinkXboxAccountRequest request, + FDelegateOnSuccessUnlinkXboxAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkXboxAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateAvatarUrl, FClientEmptyResponse, result, UObject*, customData); + + /** Update the avatar URL of the player */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateAvatarUrl(FClientUpdateAvatarUrlRequest request, + FDelegateOnSuccessUpdateAvatarUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateAvatarUrl(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserTitleDisplayName, FClientUpdateUserTitleDisplayNameResult, result, UObject*, customData); + + /** Updates the title specific display name for the user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateUserTitleDisplayName(FClientUpdateUserTitleDisplayNameRequest request, + FDelegateOnSuccessUpdateUserTitleDisplayName onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserTitleDisplayName(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Advertising + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAttributeInstall, FClientAttributeInstallResult, result, UObject*, customData); + + /** Attributes an install for advertisment. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Advertising ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AttributeInstall(FClientAttributeInstallRequest request, + FDelegateOnSuccessAttributeInstall onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Advertising ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAttributeInstall(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Analytics + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessReportDeviceInfo, FClientEmptyResponse, result, UObject*, customData); + + /** + * Write a PlayStream event to describe the provided player device information. This API method is not designed to be + * called directly by developers. Each PlayFab client SDK will eventually report this information automatically. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ReportDeviceInfo(FClientDeviceInfoRequest request, + FDelegateOnSuccessReportDeviceInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperReportDeviceInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWriteCharacterEvent, FClientWriteEventResponse, result, UObject*, customData); + + /** Writes a character-based event into PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* WriteCharacterEvent(FClientWriteClientCharacterEventRequest request, + FDelegateOnSuccessWriteCharacterEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWriteCharacterEvent(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWritePlayerEvent, FClientWriteEventResponse, result, UObject*, customData); + + /** Writes a player-based event into PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* WritePlayerEvent(FClientWriteClientPlayerEventRequest request, + FDelegateOnSuccessWritePlayerEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWritePlayerEvent(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWriteTitleEvent, FClientWriteEventResponse, result, UObject*, customData); + + /** Writes a title-based event into PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* WriteTitleEvent(FClientWriteTitleEventRequest request, + FDelegateOnSuccessWriteTitleEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWriteTitleEvent(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPhotonAuthenticationToken, FClientGetPhotonAuthenticationTokenResult, result, UObject*, customData); + + /** + * Gets a Photon custom authentication token that can be used to securely join the player into a Photon room. See + * https://api.playfab.com/docs/using-photon-with-playfab/ for more details. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPhotonAuthenticationToken(FClientGetPhotonAuthenticationTokenRequest request, + FDelegateOnSuccessGetPhotonAuthenticationToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPhotonAuthenticationToken(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitlePublicKey, FClientGetTitlePublicKeyResult, result, UObject*, customData); + + /** Returns the title's base 64 encoded RSA CSP blob. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetTitlePublicKey(FClientGetTitlePublicKeyRequest request, + FDelegateOnSuccessGetTitlePublicKey onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitlePublicKey(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetWindowsHelloChallenge, FClientGetWindowsHelloChallengeResponse, result, UObject*, customData); + + /** Requests a challenge from the server to be signed by Windows Hello Passport service to authenticate. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetWindowsHelloChallenge(FClientGetWindowsHelloChallengeRequest request, + FDelegateOnSuccessGetWindowsHelloChallenge onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetWindowsHelloChallenge(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithAndroidDeviceID, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using the Android device identifier, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithAndroidDeviceID(FClientLoginWithAndroidDeviceIDRequest request, + FDelegateOnSuccessLoginWithAndroidDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithAndroidDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithCustomID, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using a custom unique identifier generated by the title, returning a session identifier that can + * subsequently be used for API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithCustomID(FClientLoginWithCustomIDRequest request, + FDelegateOnSuccessLoginWithCustomID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithCustomID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithEmailAddress, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls + * which require an authenticated user. Unlike most other login API calls, LoginWithEmailAddress does not permit the + * creation of new accounts via the CreateAccountFlag. Email addresses may be used to create accounts via + * RegisterPlayFabUser. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithEmailAddress(FClientLoginWithEmailAddressRequest request, + FDelegateOnSuccessLoginWithEmailAddress onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithEmailAddress(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithFacebook, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using a Facebook access token, returning a session identifier that can subsequently be used for API + * calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithFacebook(FClientLoginWithFacebookRequest request, + FDelegateOnSuccessLoginWithFacebook onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithFacebook(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithFacebookInstantGamesId, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using a Facebook Instant Games ID, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user. Requires Facebook Instant Games to be configured. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithFacebookInstantGamesId(FClientLoginWithFacebookInstantGamesIdRequest request, + FDelegateOnSuccessLoginWithFacebookInstantGamesId onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithFacebookInstantGamesId(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithGameCenter, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using an iOS Game Center player identifier, returning a session identifier that can subsequently be + * used for API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithGameCenter(FClientLoginWithGameCenterRequest request, + FDelegateOnSuccessLoginWithGameCenter onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithGameCenter(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithGoogleAccount, FClientLoginResult, result, UObject*, customData); + + /** Signs the user in using their Google account credentials */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithGoogleAccount(FClientLoginWithGoogleAccountRequest request, + FDelegateOnSuccessLoginWithGoogleAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithGoogleAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithIOSDeviceID, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using the vendor-specific iOS device identifier, returning a session identifier that can subsequently + * be used for API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithIOSDeviceID(FClientLoginWithIOSDeviceIDRequest request, + FDelegateOnSuccessLoginWithIOSDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithIOSDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithKongregate, FClientLoginResult, result, UObject*, customData); + + /** Signs the user in using a Kongregate player account. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithKongregate(FClientLoginWithKongregateRequest request, + FDelegateOnSuccessLoginWithKongregate onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithKongregate(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithNintendoSwitchDeviceId, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using a Nintendo Switch Device ID, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithNintendoSwitchDeviceId(FClientLoginWithNintendoSwitchDeviceIdRequest request, + FDelegateOnSuccessLoginWithNintendoSwitchDeviceId onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithNintendoSwitchDeviceId(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithPlayFab, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls + * which require an authenticated user. Unlike most other login API calls, LoginWithPlayFab does not permit the creation of + * new accounts via the CreateAccountFlag. Username/Password credentials may be used to create accounts via + * RegisterPlayFabUser, or added to existing accounts using AddUsernamePassword. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithPlayFab(FClientLoginWithPlayFabRequest request, + FDelegateOnSuccessLoginWithPlayFab onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithPlayFab(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithSteam, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using a Steam authentication ticket, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithSteam(FClientLoginWithSteamRequest request, + FDelegateOnSuccessLoginWithSteam onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithSteam(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithTwitch, FClientLoginResult, result, UObject*, customData); + + /** Signs the user in using a Twitch access token. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithTwitch(FClientLoginWithTwitchRequest request, + FDelegateOnSuccessLoginWithTwitch onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithTwitch(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithWindowsHello, FClientLoginResult, result, UObject*, customData); + + /** + * Completes the Windows Hello login flow by returning the signed value of the challange from GetWindowsHelloChallenge. + * Windows Hello has a 2 step client to server authentication scheme. Step one is to request from the server a challenge + * string. Step two is to request the user sign the string via Windows Hello and then send the signed value back to the + * server. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithWindowsHello(FClientLoginWithWindowsHelloRequest request, + FDelegateOnSuccessLoginWithWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithXbox, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls + * which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithXbox(FClientLoginWithXboxRequest request, + FDelegateOnSuccessLoginWithXbox onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithXbox(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRegisterPlayFabUser, FClientRegisterPlayFabUserResult, result, UObject*, customData); + + /** + * Registers a new Playfab user account, returning a session identifier that can subsequently be used for API calls which + * require an authenticated user. You must supply either a username or an email address. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RegisterPlayFabUser(FClientRegisterPlayFabUserRequest request, + FDelegateOnSuccessRegisterPlayFabUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRegisterPlayFabUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRegisterWithWindowsHello, FClientLoginResult, result, UObject*, customData); + + /** + * Registers a new PlayFab user account using Windows Hello authentication, returning a session ticket that can + * subsequently be used for API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RegisterWithWindowsHello(FClientRegisterWithWindowsHelloRequest request, + FDelegateOnSuccessRegisterWithWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRegisterWithWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetPlayerSecret, FClientSetPlayerSecretResult, result, UObject*, customData); + + /** + * Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's + * secret use the Admin or Server API method SetPlayerSecret. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* SetPlayerSecret(FClientSetPlayerSecretRequest request, + FDelegateOnSuccessSetPlayerSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetPlayerSecret(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Character Data + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterData, FClientGetCharacterDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the character which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCharacterData(FClientGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterReadOnlyData, FClientGetCharacterDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the character which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCharacterReadOnlyData(FClientGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCharacterData, FClientUpdateCharacterDataResult, result, UObject*, customData); + + /** Creates and updates the title-specific custom data for the user's character which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateCharacterData(FClientUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Characters + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetAllUsersCharacters, FClientListUsersCharactersResult, result, UObject*, customData); + + /** + * Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be + * evaluated with the parent PlayFabId to guarantee uniqueness. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetAllUsersCharacters(FClientListUsersCharactersRequest request, + FDelegateOnSuccessGetAllUsersCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetAllUsersCharacters(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterLeaderboard, FClientGetCharacterLeaderboardResult, result, UObject*, customData); + + /** Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCharacterLeaderboard(FClientGetCharacterLeaderboardRequest request, + FDelegateOnSuccessGetCharacterLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterStatistics, FClientGetCharacterStatisticsResult, result, UObject*, customData); + + /** Retrieves the details of all title-specific statistics for the user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCharacterStatistics(FClientGetCharacterStatisticsRequest request, + FDelegateOnSuccessGetCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboardAroundCharacter, FClientGetLeaderboardAroundCharacterResult, result, UObject*, customData); + + /** Retrieves a list of ranked characters for the given statistic, centered on the requested Character ID */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetLeaderboardAroundCharacter(FClientGetLeaderboardAroundCharacterRequest request, + FDelegateOnSuccessGetLeaderboardAroundCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboardAroundCharacter(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboardForUserCharacters, FClientGetLeaderboardForUsersCharactersResult, result, UObject*, customData); + + /** Retrieves a list of all of the user's characters for the given statistic. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetLeaderboardForUserCharacters(FClientGetLeaderboardForUsersCharactersRequest request, + FDelegateOnSuccessGetLeaderboardForUserCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboardForUserCharacters(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGrantCharacterToUser, FClientGrantCharacterToUserResult, result, UObject*, customData); + + /** + * Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated + * with the parent PlayFabId to guarantee uniqueness. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GrantCharacterToUser(FClientGrantCharacterToUserRequest request, + FDelegateOnSuccessGrantCharacterToUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGrantCharacterToUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCharacterStatistics, FClientUpdateCharacterStatisticsResult, result, UObject*, customData); + + /** + * Updates the values of the specified title-specific statistics for the specific character. By default, clients are not + * permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateCharacterStatistics(FClientUpdateCharacterStatisticsRequest request, + FDelegateOnSuccessUpdateCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Content + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetContentDownloadUrl, FClientGetContentDownloadUrlResult, result, UObject*, customData); + + /** + * This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned + * URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the + * content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, + * the query to retrieve the data will fail. See this post for more information: + * https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service. Also, + * please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Content ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetContentDownloadUrl(FClientGetContentDownloadUrlRequest request, + FDelegateOnSuccessGetContentDownloadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Content ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetContentDownloadUrl(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Friend List Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddFriend, FClientAddFriendResult, result, UObject*, customData); + + /** + * Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user. At + * least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AddFriend(FClientAddFriendRequest request, + FDelegateOnSuccessAddFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddFriend(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetFriendsList, FClientGetFriendsListResult, result, UObject*, customData); + + /** + * Retrieves the current friend list for the local user, constrained to users who have PlayFab accounts. Friends from + * linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetFriendsList(FClientGetFriendsListRequest request, + FDelegateOnSuccessGetFriendsList onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetFriendsList(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveFriend, FClientRemoveFriendResult, result, UObject*, customData); + + /** Removes a specified user from the friend list of the local user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RemoveFriend(FClientRemoveFriendRequest request, + FDelegateOnSuccessRemoveFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveFriend(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetFriendTags, FClientSetFriendTagsResult, result, UObject*, customData); + + /** Updates the tag list for a specified user in the friend list of the local user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* SetFriendTags(FClientSetFriendTagsRequest request, + FDelegateOnSuccessSetFriendTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetFriendTags(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCurrentGames, FClientCurrentGamesResult, result, UObject*, customData); + + /** Get details about all current running game servers matching the given parameters. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCurrentGames(FClientCurrentGamesRequest request, + FDelegateOnSuccessGetCurrentGames onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCurrentGames(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetGameServerRegions, FClientGameServerRegionsResult, result, UObject*, customData); + + /** Get details about the regions hosting game servers matching the given parameters. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetGameServerRegions(FClientGameServerRegionsRequest request, + FDelegateOnSuccessGetGameServerRegions onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetGameServerRegions(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessMatchmake, FClientMatchmakeResult, result, UObject*, customData); + + /** + * Attempts to locate a game session matching the given parameters. If the goal is to match the player into a specific + * active session, only the LobbyId is required. Otherwise, the BuildVersion, GameMode, and Region are all required + * parameters. Note that parameters specified in the search are required (they are not weighting factors). If a slot is + * found in a server instance matching the parameters, the slot will be assigned to that player, removing it from the + * availabe set. In that case, the information on the game session will be returned, otherwise the Status returned will be + * GameNotFound. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* Matchmake(FClientMatchmakeRequest request, + FDelegateOnSuccessMatchmake onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperMatchmake(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessStartGame, FClientStartGameResult, result, UObject*, customData); + + /** Start a new game server with a given configuration, add the current player and return the connection information. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* StartGame(FClientStartGameRequest request, + FDelegateOnSuccessStartGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperStartGame(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Platform Specific Methods + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAndroidDevicePushNotificationRegistration, FClientAndroidDevicePushNotificationRegistrationResult, result, UObject*, customData); + + /** Registers the Android device to receive push notifications */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AndroidDevicePushNotificationRegistration(FClientAndroidDevicePushNotificationRegistrationRequest request, + FDelegateOnSuccessAndroidDevicePushNotificationRegistration onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAndroidDevicePushNotificationRegistration(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessConsumeXboxEntitlements, FClientConsumeXboxEntitlementsResult, result, UObject*, customData); + + /** + * Grants the player's current entitlements from Xbox Live, consuming all availble items in Xbox and granting them to the + * player's PlayFab inventory. This call is idempotent and will not grant previously granted items to the player. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ConsumeXboxEntitlements(FClientConsumeXboxEntitlementsRequest request, + FDelegateOnSuccessConsumeXboxEntitlements onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperConsumeXboxEntitlements(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRegisterForIOSPushNotification, FClientRegisterForIOSPushNotificationResult, result, UObject*, customData); + + /** Registers the iOS device to receive push notifications */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RegisterForIOSPushNotification(FClientRegisterForIOSPushNotificationRequest request, + FDelegateOnSuccessRegisterForIOSPushNotification onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRegisterForIOSPushNotification(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRestoreIOSPurchases, FClientRestoreIOSPurchasesResult, result, UObject*, customData); + + /** Restores all in-app purchases based on the given restore receipt */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RestoreIOSPurchases(FClientRestoreIOSPurchasesRequest request, + FDelegateOnSuccessRestoreIOSPurchases onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRestoreIOSPurchases(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessValidateAmazonIAPReceipt, FClientValidateAmazonReceiptResult, result, UObject*, customData); + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the + * purchased catalog item + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ValidateAmazonIAPReceipt(FClientValidateAmazonReceiptRequest request, + FDelegateOnSuccessValidateAmazonIAPReceipt onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperValidateAmazonIAPReceipt(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessValidateGooglePlayPurchase, FClientValidateGooglePlayPurchaseResult, result, UObject*, customData); + + /** Validates a Google Play purchase and gives the corresponding item to the player. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ValidateGooglePlayPurchase(FClientValidateGooglePlayPurchaseRequest request, + FDelegateOnSuccessValidateGooglePlayPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperValidateGooglePlayPurchase(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessValidateIOSReceipt, FClientValidateIOSReceiptResult, result, UObject*, customData); + + /** + * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased + * catalog item + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ValidateIOSReceipt(FClientValidateIOSReceiptRequest request, + FDelegateOnSuccessValidateIOSReceipt onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperValidateIOSReceipt(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessValidateWindowsStoreReceipt, FClientValidateWindowsReceiptResult, result, UObject*, customData); + + /** + * Validates with Windows that the receipt for an Windows App Store in-app purchase is valid and that it matches the + * purchased catalog item + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ValidateWindowsStoreReceipt(FClientValidateWindowsReceiptRequest request, + FDelegateOnSuccessValidateWindowsStoreReceipt onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperValidateWindowsStoreReceipt(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Player Data Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetFriendLeaderboard, FClientGetLeaderboardResult, result, UObject*, customData); + + /** + * Retrieves a list of ranked friends of the current player for the given statistic, starting from the indicated point in + * the leaderboard + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetFriendLeaderboard(FClientGetFriendLeaderboardRequest request, + FDelegateOnSuccessGetFriendLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetFriendLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetFriendLeaderboardAroundPlayer, FClientGetFriendLeaderboardAroundPlayerResult, result, UObject*, customData); + + /** + * Retrieves a list of ranked friends of the current player for the given statistic, centered on the requested PlayFab + * user. If PlayFabId is empty or null will return currently logged in user. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetFriendLeaderboardAroundPlayer(FClientGetFriendLeaderboardAroundPlayerRequest request, + FDelegateOnSuccessGetFriendLeaderboardAroundPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetFriendLeaderboardAroundPlayer(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboard, FClientGetLeaderboardResult, result, UObject*, customData); + + /** Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetLeaderboard(FClientGetLeaderboardRequest request, + FDelegateOnSuccessGetLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboardAroundPlayer, FClientGetLeaderboardAroundPlayerResult, result, UObject*, customData); + + /** + * Retrieves a list of ranked users for the given statistic, centered on the requested player. If PlayFabId is empty or + * null will return currently logged in user. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetLeaderboardAroundPlayer(FClientGetLeaderboardAroundPlayerRequest request, + FDelegateOnSuccessGetLeaderboardAroundPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboardAroundPlayer(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerStatistics, FClientGetPlayerStatisticsResult, result, UObject*, customData); + + /** + * Retrieves the indicated statistics (current version and values for all statistics, if none are specified), for the local + * player. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerStatistics(FClientGetPlayerStatisticsRequest request, + FDelegateOnSuccessGetPlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerStatisticVersions, FClientGetPlayerStatisticVersionsResult, result, UObject*, customData); + + /** Retrieves the information on the available versions of the specified statistic. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerStatisticVersions(FClientGetPlayerStatisticVersionsRequest request, + FDelegateOnSuccessGetPlayerStatisticVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerStatisticVersions(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserData, FClientGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetUserData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherData, FClientGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetUserPublisherData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherReadOnlyData, FClientGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetUserPublisherReadOnlyData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserReadOnlyData, FClientGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetUserReadOnlyData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdatePlayerStatistics, FClientUpdatePlayerStatisticsResult, result, UObject*, customData); + + /** + * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to + * update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdatePlayerStatistics(FClientUpdatePlayerStatisticsRequest request, + FDelegateOnSuccessUpdatePlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdatePlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserData, FClientUpdateUserDataResult, result, UObject*, customData); + + /** Creates and updates the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateUserData(FClientUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherData, FClientUpdateUserDataResult, result, UObject*, customData); + + /** Creates and updates the publisher-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateUserPublisherData(FClientUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Player Item Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddUserVirtualCurrency, FClientModifyUserVirtualCurrencyResult, result, UObject*, customData); + + /** Increments the user's balance of the specified virtual currency by the stated amount */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AddUserVirtualCurrency(FClientAddUserVirtualCurrencyRequest request, + FDelegateOnSuccessAddUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessConfirmPurchase, FClientConfirmPurchaseResult, result, UObject*, customData); + + /** + * Confirms with the payment provider that the purchase was approved (if applicable) and adjusts inventory and virtual + * currency balances as appropriate + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ConfirmPurchase(FClientConfirmPurchaseRequest request, + FDelegateOnSuccessConfirmPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperConfirmPurchase(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessConsumeItem, FClientConsumeItemResult, result, UObject*, customData); + + /** Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ConsumeItem(FClientConsumeItemRequest request, + FDelegateOnSuccessConsumeItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperConsumeItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterInventory, FClientGetCharacterInventoryResult, result, UObject*, customData); + + /** Retrieves the specified character's current inventory of virtual goods */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCharacterInventory(FClientGetCharacterInventoryRequest request, + FDelegateOnSuccessGetCharacterInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterInventory(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPaymentToken, FClientGetPaymentTokenResult, result, UObject*, customData); + + /** + * For payments flows where the provider requires playfab (the fulfiller) to initiate the transaction, but the client + * completes the rest of the flow. In the Xsolla case, the token returned here will be passed to Xsolla by the client to + * create a cart. Poll GetPurchase using the returned OrderId once you've completed the payment. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPaymentToken(FClientGetPaymentTokenRequest request, + FDelegateOnSuccessGetPaymentToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPaymentToken(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPurchase, FClientGetPurchaseResult, result, UObject*, customData); + + /** + * Retrieves a purchase along with its current PlayFab status. Returns inventory items from the purchase that are still + * active. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPurchase(FClientGetPurchaseRequest request, + FDelegateOnSuccessGetPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPurchase(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserInventory, FClientGetUserInventoryResult, result, UObject*, customData); + + /** Retrieves the user's current inventory of virtual goods */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetUserInventory(FClientGetUserInventoryRequest request, + FDelegateOnSuccessGetUserInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserInventory(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessPayForPurchase, FClientPayForPurchaseResult, result, UObject*, customData); + + /** Selects a payment option for purchase order created via StartPurchase */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* PayForPurchase(FClientPayForPurchaseRequest request, + FDelegateOnSuccessPayForPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperPayForPurchase(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessPurchaseItem, FClientPurchaseItemResult, result, UObject*, customData); + + /** + * Buys a single item with virtual currency. You must specify both the virtual currency to use to purchase, as well as what + * the client believes the price to be. This lets the server fail the purchase if the price has changed. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* PurchaseItem(FClientPurchaseItemRequest request, + FDelegateOnSuccessPurchaseItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperPurchaseItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRedeemCoupon, FClientRedeemCouponResult, result, UObject*, customData); + + /** + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the + * Economy->Catalogs tab in the PlayFab Game Manager. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RedeemCoupon(FClientRedeemCouponRequest request, + FDelegateOnSuccessRedeemCoupon onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRedeemCoupon(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessStartPurchase, FClientStartPurchaseResult, result, UObject*, customData); + + /** Creates an order for a list of items from the title catalog */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* StartPurchase(FClientStartPurchaseRequest request, + FDelegateOnSuccessStartPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperStartPurchase(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSubtractUserVirtualCurrency, FClientModifyUserVirtualCurrencyResult, result, UObject*, customData); + + /** + * Decrements the user's balance of the specified virtual currency by the stated amount. It is possible to make a VC + * balance negative with this API. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* SubtractUserVirtualCurrency(FClientSubtractUserVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSubtractUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlockContainerInstance, FClientUnlockContainerItemResult, result, UObject*, customData); + + /** + * Opens the specified container, with the specified key (when required), and returns the contents of the opened container. + * If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, + * consistent with the operation of ConsumeItem. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlockContainerInstance(FClientUnlockContainerInstanceRequest request, + FDelegateOnSuccessUnlockContainerInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlockContainerInstance(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlockContainerItem, FClientUnlockContainerItemResult, result, UObject*, customData); + + /** + * Searches target inventory for an ItemInstance matching the given CatalogItemId, if necessary unlocks it using an + * appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are + * consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlockContainerItem(FClientUnlockContainerItemRequest request, + FDelegateOnSuccessUnlockContainerItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlockContainerItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // PlayStream + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerSegments, FClientGetPlayerSegmentsResult, result, UObject*, customData); + + /** List all segments that a player currently belongs to at this moment in time. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerSegments(FClientGetPlayerSegmentsRequest request, + FDelegateOnSuccessGetPlayerSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerSegments(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerTags, FClientGetPlayerTagsResult, result, UObject*, customData); + + /** Get all tags with a given Namespace (optional) from a player profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerTags(FClientGetPlayerTagsRequest request, + FDelegateOnSuccessGetPlayerTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerTags(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessExecuteCloudScript, FClientExecuteCloudScriptResult, result, UObject*, customData); + + /** Executes a CloudScript function, with the 'currentPlayerId' set to the PlayFab ID of the authenticated player. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ExecuteCloudScript(FClientExecuteCloudScriptRequest request, + FDelegateOnSuccessExecuteCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperExecuteCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Shared Group Data + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddSharedGroupMembers, FClientAddSharedGroupMembersResult, result, UObject*, customData); + + /** + * Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users + * in the group can add new members. Shared Groups are designed for sharing data between a very small number of players, + * please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AddSharedGroupMembers(FClientAddSharedGroupMembersRequest request, + FDelegateOnSuccessAddSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreateSharedGroup, FClientCreateSharedGroupResult, result, UObject*, customData); + + /** + * Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the + * group. Upon creation, the current user will be the only member of the group. Shared Groups are designed for sharing data + * between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* CreateSharedGroup(FClientCreateSharedGroupRequest request, + FDelegateOnSuccessCreateSharedGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreateSharedGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetSharedGroupData, FClientGetSharedGroupDataResult, result, UObject*, customData); + + /** + * Retrieves data stored in a shared group object, as well as the list of members in the group. Non-members of the group + * may use this to retrieve group data, including membership, but they will not receive data for keys marked as private. + * Shared Groups are designed for sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetSharedGroupData(FClientGetSharedGroupDataRequest request, + FDelegateOnSuccessGetSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveSharedGroupMembers, FClientRemoveSharedGroupMembersResult, result, UObject*, customData); + + /** + * Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the + * group can remove members. If as a result of the call, zero users remain with access, the group and its associated data + * will be deleted. Shared Groups are designed for sharing data between a very small number of players, please see our + * guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RemoveSharedGroupMembers(FClientRemoveSharedGroupMembersRequest request, + FDelegateOnSuccessRemoveSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateSharedGroupData, FClientUpdateSharedGroupDataResult, result, UObject*, customData); + + /** + * Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated + * or added in this call will be readable by users not in the group. By default, data permissions are set to Private. + * Regardless of the permission setting, only members of the group can update the data. Shared Groups are designed for + * sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateSharedGroupData(FClientUpdateSharedGroupDataRequest request, + FDelegateOnSuccessUpdateSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Title-Wide Data Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCatalogItems, FClientGetCatalogItemsResult, result, UObject*, customData); + + /** Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCatalogItems(FClientGetCatalogItemsRequest request, + FDelegateOnSuccessGetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPublisherData, FClientGetPublisherDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom publisher settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPublisherData(FClientGetPublisherDataRequest request, + FDelegateOnSuccessGetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetStoreItems, FClientGetStoreItemsResult, result, UObject*, customData); + + /** Retrieves the set of items defined for the specified store, including all prices defined */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetStoreItems(FClientGetStoreItemsRequest request, + FDelegateOnSuccessGetStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTime, FClientGetTimeResult, result, UObject*, customData); + + /** Retrieves the current server time */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetTime(FClientGetTimeRequest request, + FDelegateOnSuccessGetTime onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTime(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleData, FClientGetTitleDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom title settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetTitleData(FClientGetTitleDataRequest request, + FDelegateOnSuccessGetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleNews, FClientGetTitleNewsResult, result, UObject*, customData); + + /** Retrieves the title news feed, as configured in the developer portal */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetTitleNews(FClientGetTitleNewsRequest request, + FDelegateOnSuccessGetTitleNews onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleNews(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Trading + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAcceptTrade, FClientAcceptTradeResponse, result, UObject*, customData); + + /** + * Accepts an open trade (one that has not yet been accepted or cancelled), if the locally signed-in player is in the + * allowed player list for the trade, or it is open to all players. If the call is successful, the offered and accepted + * items will be swapped between the two players' inventories. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AcceptTrade(FClientAcceptTradeRequest request, + FDelegateOnSuccessAcceptTrade onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAcceptTrade(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCancelTrade, FClientCancelTradeResponse, result, UObject*, customData); + + /** + * Cancels an open trade (one that has not yet been accepted or cancelled). Note that only the player who created the trade + * can cancel it via this API call, to prevent griefing of the trade system (cancelling trades in order to prevent other + * players from accepting them, for trades that can be claimed by more than one player). + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* CancelTrade(FClientCancelTradeRequest request, + FDelegateOnSuccessCancelTrade onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCancelTrade(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerTrades, FClientGetPlayerTradesResponse, result, UObject*, customData); + + /** Gets all trades the player has either opened or accepted, optionally filtered by trade status. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerTrades(FClientGetPlayerTradesRequest request, + FDelegateOnSuccessGetPlayerTrades onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerTrades(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTradeStatus, FClientGetTradeStatusResponse, result, UObject*, customData); + + /** Gets the current status of an existing trade. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetTradeStatus(FClientGetTradeStatusRequest request, + FDelegateOnSuccessGetTradeStatus onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTradeStatus(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessOpenTrade, FClientOpenTradeResponse, result, UObject*, customData); + + /** Opens a new outstanding trade. Note that a given item instance may only be in one open trade at a time. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* OpenTrade(FClientOpenTradeRequest request, + FDelegateOnSuccessOpenTrade onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + void HelperOpenTrade(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessAddGenericID OnSuccessAddGenericID; + FDelegateOnSuccessAddOrUpdateContactEmail OnSuccessAddOrUpdateContactEmail; + FDelegateOnSuccessAddUsernamePassword OnSuccessAddUsernamePassword; + FDelegateOnSuccessGetAccountInfo OnSuccessGetAccountInfo; + FDelegateOnSuccessGetPlayerCombinedInfo OnSuccessGetPlayerCombinedInfo; + FDelegateOnSuccessGetPlayerProfile OnSuccessGetPlayerProfile; + FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs OnSuccessGetPlayFabIDsFromFacebookIDs; + FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds; + FDelegateOnSuccessGetPlayFabIDsFromGameCenterIDs OnSuccessGetPlayFabIDsFromGameCenterIDs; + FDelegateOnSuccessGetPlayFabIDsFromGenericIDs OnSuccessGetPlayFabIDsFromGenericIDs; + FDelegateOnSuccessGetPlayFabIDsFromGoogleIDs OnSuccessGetPlayFabIDsFromGoogleIDs; + FDelegateOnSuccessGetPlayFabIDsFromKongregateIDs OnSuccessGetPlayFabIDsFromKongregateIDs; + FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds; + FDelegateOnSuccessGetPlayFabIDsFromSteamIDs OnSuccessGetPlayFabIDsFromSteamIDs; + FDelegateOnSuccessGetPlayFabIDsFromTwitchIDs OnSuccessGetPlayFabIDsFromTwitchIDs; + FDelegateOnSuccessLinkAndroidDeviceID OnSuccessLinkAndroidDeviceID; + FDelegateOnSuccessLinkCustomID OnSuccessLinkCustomID; + FDelegateOnSuccessLinkFacebookAccount OnSuccessLinkFacebookAccount; + FDelegateOnSuccessLinkFacebookInstantGamesId OnSuccessLinkFacebookInstantGamesId; + FDelegateOnSuccessLinkGameCenterAccount OnSuccessLinkGameCenterAccount; + FDelegateOnSuccessLinkGoogleAccount OnSuccessLinkGoogleAccount; + FDelegateOnSuccessLinkIOSDeviceID OnSuccessLinkIOSDeviceID; + FDelegateOnSuccessLinkKongregate OnSuccessLinkKongregate; + FDelegateOnSuccessLinkNintendoSwitchDeviceId OnSuccessLinkNintendoSwitchDeviceId; + FDelegateOnSuccessLinkSteamAccount OnSuccessLinkSteamAccount; + FDelegateOnSuccessLinkTwitch OnSuccessLinkTwitch; + FDelegateOnSuccessLinkWindowsHello OnSuccessLinkWindowsHello; + FDelegateOnSuccessLinkXboxAccount OnSuccessLinkXboxAccount; + FDelegateOnSuccessRemoveContactEmail OnSuccessRemoveContactEmail; + FDelegateOnSuccessRemoveGenericID OnSuccessRemoveGenericID; + FDelegateOnSuccessReportPlayer OnSuccessReportPlayer; + FDelegateOnSuccessSendAccountRecoveryEmail OnSuccessSendAccountRecoveryEmail; + FDelegateOnSuccessUnlinkAndroidDeviceID OnSuccessUnlinkAndroidDeviceID; + FDelegateOnSuccessUnlinkCustomID OnSuccessUnlinkCustomID; + FDelegateOnSuccessUnlinkFacebookAccount OnSuccessUnlinkFacebookAccount; + FDelegateOnSuccessUnlinkFacebookInstantGamesId OnSuccessUnlinkFacebookInstantGamesId; + FDelegateOnSuccessUnlinkGameCenterAccount OnSuccessUnlinkGameCenterAccount; + FDelegateOnSuccessUnlinkGoogleAccount OnSuccessUnlinkGoogleAccount; + FDelegateOnSuccessUnlinkIOSDeviceID OnSuccessUnlinkIOSDeviceID; + FDelegateOnSuccessUnlinkKongregate OnSuccessUnlinkKongregate; + FDelegateOnSuccessUnlinkNintendoSwitchDeviceId OnSuccessUnlinkNintendoSwitchDeviceId; + FDelegateOnSuccessUnlinkSteamAccount OnSuccessUnlinkSteamAccount; + FDelegateOnSuccessUnlinkTwitch OnSuccessUnlinkTwitch; + FDelegateOnSuccessUnlinkWindowsHello OnSuccessUnlinkWindowsHello; + FDelegateOnSuccessUnlinkXboxAccount OnSuccessUnlinkXboxAccount; + FDelegateOnSuccessUpdateAvatarUrl OnSuccessUpdateAvatarUrl; + FDelegateOnSuccessUpdateUserTitleDisplayName OnSuccessUpdateUserTitleDisplayName; + FDelegateOnSuccessAttributeInstall OnSuccessAttributeInstall; + FDelegateOnSuccessReportDeviceInfo OnSuccessReportDeviceInfo; + FDelegateOnSuccessWriteCharacterEvent OnSuccessWriteCharacterEvent; + FDelegateOnSuccessWritePlayerEvent OnSuccessWritePlayerEvent; + FDelegateOnSuccessWriteTitleEvent OnSuccessWriteTitleEvent; + FDelegateOnSuccessGetPhotonAuthenticationToken OnSuccessGetPhotonAuthenticationToken; + FDelegateOnSuccessGetTitlePublicKey OnSuccessGetTitlePublicKey; + FDelegateOnSuccessGetWindowsHelloChallenge OnSuccessGetWindowsHelloChallenge; + FDelegateOnSuccessLoginWithAndroidDeviceID OnSuccessLoginWithAndroidDeviceID; + FDelegateOnSuccessLoginWithCustomID OnSuccessLoginWithCustomID; + FDelegateOnSuccessLoginWithEmailAddress OnSuccessLoginWithEmailAddress; + FDelegateOnSuccessLoginWithFacebook OnSuccessLoginWithFacebook; + FDelegateOnSuccessLoginWithFacebookInstantGamesId OnSuccessLoginWithFacebookInstantGamesId; + FDelegateOnSuccessLoginWithGameCenter OnSuccessLoginWithGameCenter; + FDelegateOnSuccessLoginWithGoogleAccount OnSuccessLoginWithGoogleAccount; + FDelegateOnSuccessLoginWithIOSDeviceID OnSuccessLoginWithIOSDeviceID; + FDelegateOnSuccessLoginWithKongregate OnSuccessLoginWithKongregate; + FDelegateOnSuccessLoginWithNintendoSwitchDeviceId OnSuccessLoginWithNintendoSwitchDeviceId; + FDelegateOnSuccessLoginWithPlayFab OnSuccessLoginWithPlayFab; + FDelegateOnSuccessLoginWithSteam OnSuccessLoginWithSteam; + FDelegateOnSuccessLoginWithTwitch OnSuccessLoginWithTwitch; + FDelegateOnSuccessLoginWithWindowsHello OnSuccessLoginWithWindowsHello; + FDelegateOnSuccessLoginWithXbox OnSuccessLoginWithXbox; + FDelegateOnSuccessRegisterPlayFabUser OnSuccessRegisterPlayFabUser; + FDelegateOnSuccessRegisterWithWindowsHello OnSuccessRegisterWithWindowsHello; + FDelegateOnSuccessSetPlayerSecret OnSuccessSetPlayerSecret; + FDelegateOnSuccessGetCharacterData OnSuccessGetCharacterData; + FDelegateOnSuccessGetCharacterReadOnlyData OnSuccessGetCharacterReadOnlyData; + FDelegateOnSuccessUpdateCharacterData OnSuccessUpdateCharacterData; + FDelegateOnSuccessGetAllUsersCharacters OnSuccessGetAllUsersCharacters; + FDelegateOnSuccessGetCharacterLeaderboard OnSuccessGetCharacterLeaderboard; + FDelegateOnSuccessGetCharacterStatistics OnSuccessGetCharacterStatistics; + FDelegateOnSuccessGetLeaderboardAroundCharacter OnSuccessGetLeaderboardAroundCharacter; + FDelegateOnSuccessGetLeaderboardForUserCharacters OnSuccessGetLeaderboardForUserCharacters; + FDelegateOnSuccessGrantCharacterToUser OnSuccessGrantCharacterToUser; + FDelegateOnSuccessUpdateCharacterStatistics OnSuccessUpdateCharacterStatistics; + FDelegateOnSuccessGetContentDownloadUrl OnSuccessGetContentDownloadUrl; + FDelegateOnSuccessAddFriend OnSuccessAddFriend; + FDelegateOnSuccessGetFriendsList OnSuccessGetFriendsList; + FDelegateOnSuccessRemoveFriend OnSuccessRemoveFriend; + FDelegateOnSuccessSetFriendTags OnSuccessSetFriendTags; + FDelegateOnSuccessGetCurrentGames OnSuccessGetCurrentGames; + FDelegateOnSuccessGetGameServerRegions OnSuccessGetGameServerRegions; + FDelegateOnSuccessMatchmake OnSuccessMatchmake; + FDelegateOnSuccessStartGame OnSuccessStartGame; + FDelegateOnSuccessAndroidDevicePushNotificationRegistration OnSuccessAndroidDevicePushNotificationRegistration; + FDelegateOnSuccessConsumeXboxEntitlements OnSuccessConsumeXboxEntitlements; + FDelegateOnSuccessRegisterForIOSPushNotification OnSuccessRegisterForIOSPushNotification; + FDelegateOnSuccessRestoreIOSPurchases OnSuccessRestoreIOSPurchases; + FDelegateOnSuccessValidateAmazonIAPReceipt OnSuccessValidateAmazonIAPReceipt; + FDelegateOnSuccessValidateGooglePlayPurchase OnSuccessValidateGooglePlayPurchase; + FDelegateOnSuccessValidateIOSReceipt OnSuccessValidateIOSReceipt; + FDelegateOnSuccessValidateWindowsStoreReceipt OnSuccessValidateWindowsStoreReceipt; + FDelegateOnSuccessGetFriendLeaderboard OnSuccessGetFriendLeaderboard; + FDelegateOnSuccessGetFriendLeaderboardAroundPlayer OnSuccessGetFriendLeaderboardAroundPlayer; + FDelegateOnSuccessGetLeaderboard OnSuccessGetLeaderboard; + FDelegateOnSuccessGetLeaderboardAroundPlayer OnSuccessGetLeaderboardAroundPlayer; + FDelegateOnSuccessGetPlayerStatistics OnSuccessGetPlayerStatistics; + FDelegateOnSuccessGetPlayerStatisticVersions OnSuccessGetPlayerStatisticVersions; + FDelegateOnSuccessGetUserData OnSuccessGetUserData; + FDelegateOnSuccessGetUserPublisherData OnSuccessGetUserPublisherData; + FDelegateOnSuccessGetUserPublisherReadOnlyData OnSuccessGetUserPublisherReadOnlyData; + FDelegateOnSuccessGetUserReadOnlyData OnSuccessGetUserReadOnlyData; + FDelegateOnSuccessUpdatePlayerStatistics OnSuccessUpdatePlayerStatistics; + FDelegateOnSuccessUpdateUserData OnSuccessUpdateUserData; + FDelegateOnSuccessUpdateUserPublisherData OnSuccessUpdateUserPublisherData; + FDelegateOnSuccessAddUserVirtualCurrency OnSuccessAddUserVirtualCurrency; + FDelegateOnSuccessConfirmPurchase OnSuccessConfirmPurchase; + FDelegateOnSuccessConsumeItem OnSuccessConsumeItem; + FDelegateOnSuccessGetCharacterInventory OnSuccessGetCharacterInventory; + FDelegateOnSuccessGetPaymentToken OnSuccessGetPaymentToken; + FDelegateOnSuccessGetPurchase OnSuccessGetPurchase; + FDelegateOnSuccessGetUserInventory OnSuccessGetUserInventory; + FDelegateOnSuccessPayForPurchase OnSuccessPayForPurchase; + FDelegateOnSuccessPurchaseItem OnSuccessPurchaseItem; + FDelegateOnSuccessRedeemCoupon OnSuccessRedeemCoupon; + FDelegateOnSuccessStartPurchase OnSuccessStartPurchase; + FDelegateOnSuccessSubtractUserVirtualCurrency OnSuccessSubtractUserVirtualCurrency; + FDelegateOnSuccessUnlockContainerInstance OnSuccessUnlockContainerInstance; + FDelegateOnSuccessUnlockContainerItem OnSuccessUnlockContainerItem; + FDelegateOnSuccessGetPlayerSegments OnSuccessGetPlayerSegments; + FDelegateOnSuccessGetPlayerTags OnSuccessGetPlayerTags; + FDelegateOnSuccessExecuteCloudScript OnSuccessExecuteCloudScript; + FDelegateOnSuccessAddSharedGroupMembers OnSuccessAddSharedGroupMembers; + FDelegateOnSuccessCreateSharedGroup OnSuccessCreateSharedGroup; + FDelegateOnSuccessGetSharedGroupData OnSuccessGetSharedGroupData; + FDelegateOnSuccessRemoveSharedGroupMembers OnSuccessRemoveSharedGroupMembers; + FDelegateOnSuccessUpdateSharedGroupData OnSuccessUpdateSharedGroupData; + FDelegateOnSuccessGetCatalogItems OnSuccessGetCatalogItems; + FDelegateOnSuccessGetPublisherData OnSuccessGetPublisherData; + FDelegateOnSuccessGetStoreItems OnSuccessGetStoreItems; + FDelegateOnSuccessGetTime OnSuccessGetTime; + FDelegateOnSuccessGetTitleData OnSuccessGetTitleData; + FDelegateOnSuccessGetTitleNews OnSuccessGetTitleNews; + FDelegateOnSuccessAcceptTrade OnSuccessAcceptTrade; + FDelegateOnSuccessCancelTrade OnSuccessCancelTrade; + FDelegateOnSuccessGetPlayerTrades OnSuccessGetPlayerTrades; + FDelegateOnSuccessGetTradeStatus OnSuccessGetTradeStatus; + FDelegateOnSuccessOpenTrade OnSuccessOpenTrade; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabClientModelDecoder.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabClientModelDecoder.h new file mode 100644 index 000000000..64c5771be --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabClientModelDecoder.h @@ -0,0 +1,617 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Client +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabClientModels.h" +#include "PlayFabClientModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabClientModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Client API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + + /** Decode the AddGenericIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientAddGenericIDResult decodeAddGenericIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the AddOrUpdateContactEmailResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientAddOrUpdateContactEmailResult decodeAddOrUpdateContactEmailResultResponse(UPlayFabJsonObject* response); + + /** Decode the AddUsernamePasswordResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientAddUsernamePasswordResult decodeAddUsernamePasswordResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetAccountInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetAccountInfoResult decodeGetAccountInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerCombinedInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayerCombinedInfoResult decodeGetPlayerCombinedInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerProfileResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayerProfileResult decodeGetPlayerProfileResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromFacebookIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromFacebookIDsResult decodeGetPlayFabIDsFromFacebookIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromFacebookInstantGamesIdsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromFacebookInstantGamesIdsResult decodeGetPlayFabIDsFromFacebookInstantGamesIdsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromGameCenterIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromGameCenterIDsResult decodeGetPlayFabIDsFromGameCenterIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromGenericIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromGenericIDsResult decodeGetPlayFabIDsFromGenericIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromGoogleIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromGoogleIDsResult decodeGetPlayFabIDsFromGoogleIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromKongregateIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromKongregateIDsResult decodeGetPlayFabIDsFromKongregateIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromNintendoSwitchDeviceIdsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsResult decodeGetPlayFabIDsFromNintendoSwitchDeviceIdsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromSteamIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromSteamIDsResult decodeGetPlayFabIDsFromSteamIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromTwitchIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromTwitchIDsResult decodeGetPlayFabIDsFromTwitchIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkAndroidDeviceIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkAndroidDeviceIDResult decodeLinkAndroidDeviceIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkCustomIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkCustomIDResult decodeLinkCustomIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkFacebookAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkFacebookAccountResult decodeLinkFacebookAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkFacebookInstantGamesIdResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkFacebookInstantGamesIdResult decodeLinkFacebookInstantGamesIdResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkGameCenterAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkGameCenterAccountResult decodeLinkGameCenterAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkGoogleAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkGoogleAccountResult decodeLinkGoogleAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkIOSDeviceIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkIOSDeviceIDResult decodeLinkIOSDeviceIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkKongregateAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkKongregateAccountResult decodeLinkKongregateAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkNintendoSwitchDeviceIdResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkNintendoSwitchDeviceIdResult decodeLinkNintendoSwitchDeviceIdResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkSteamAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkSteamAccountResult decodeLinkSteamAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkTwitchAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkTwitchAccountResult decodeLinkTwitchAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkWindowsHelloAccountResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkWindowsHelloAccountResponse decodeLinkWindowsHelloAccountResponseResponse(UPlayFabJsonObject* response); + + /** Decode the LinkXboxAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkXboxAccountResult decodeLinkXboxAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemoveContactEmailResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientRemoveContactEmailResult decodeRemoveContactEmailResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemoveGenericIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientRemoveGenericIDResult decodeRemoveGenericIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the ReportPlayerClientResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientReportPlayerClientResult decodeReportPlayerClientResultResponse(UPlayFabJsonObject* response); + + /** Decode the SendAccountRecoveryEmailResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientSendAccountRecoveryEmailResult decodeSendAccountRecoveryEmailResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkAndroidDeviceIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkAndroidDeviceIDResult decodeUnlinkAndroidDeviceIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkCustomIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkCustomIDResult decodeUnlinkCustomIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkFacebookAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkFacebookAccountResult decodeUnlinkFacebookAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkFacebookInstantGamesIdResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkFacebookInstantGamesIdResult decodeUnlinkFacebookInstantGamesIdResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkGameCenterAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkGameCenterAccountResult decodeUnlinkGameCenterAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkGoogleAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkGoogleAccountResult decodeUnlinkGoogleAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkIOSDeviceIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkIOSDeviceIDResult decodeUnlinkIOSDeviceIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkKongregateAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkKongregateAccountResult decodeUnlinkKongregateAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkNintendoSwitchDeviceIdResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkNintendoSwitchDeviceIdResult decodeUnlinkNintendoSwitchDeviceIdResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkSteamAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkSteamAccountResult decodeUnlinkSteamAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkTwitchAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkTwitchAccountResult decodeUnlinkTwitchAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkWindowsHelloAccountResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkWindowsHelloAccountResponse decodeUnlinkWindowsHelloAccountResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkXboxAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkXboxAccountResult decodeUnlinkXboxAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the EmptyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientEmptyResponse decodeEmptyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateUserTitleDisplayNameResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUpdateUserTitleDisplayNameResult decodeUpdateUserTitleDisplayNameResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Advertising + ////////////////////////////////////////////////////// + + /** Decode the AttributeInstallResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Advertising Models") + static FClientAttributeInstallResult decodeAttributeInstallResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Analytics + ////////////////////////////////////////////////////// + + /** Decode the WriteEventResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics Models") + static FClientWriteEventResponse decodeWriteEventResponseResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + + /** Decode the GetPhotonAuthenticationTokenResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") + static FClientGetPhotonAuthenticationTokenResult decodeGetPhotonAuthenticationTokenResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTitlePublicKeyResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") + static FClientGetTitlePublicKeyResult decodeGetTitlePublicKeyResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetWindowsHelloChallengeResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") + static FClientGetWindowsHelloChallengeResponse decodeGetWindowsHelloChallengeResponseResponse(UPlayFabJsonObject* response); + + /** Decode the LoginResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") + static FClientLoginResult decodeLoginResultResponse(UPlayFabJsonObject* response); + + /** Decode the RegisterPlayFabUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") + static FClientRegisterPlayFabUserResult decodeRegisterPlayFabUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetPlayerSecretResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") + static FClientSetPlayerSecretResult decodeSetPlayerSecretResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Character Data + ////////////////////////////////////////////////////// + + /** Decode the GetCharacterDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data Models") + static FClientGetCharacterDataResult decodeGetCharacterDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateCharacterDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data Models") + static FClientUpdateCharacterDataResult decodeUpdateCharacterDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Characters + ////////////////////////////////////////////////////// + + /** Decode the ListUsersCharactersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientListUsersCharactersResult decodeListUsersCharactersResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCharacterLeaderboardResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientGetCharacterLeaderboardResult decodeGetCharacterLeaderboardResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCharacterStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientGetCharacterStatisticsResult decodeGetCharacterStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardAroundCharacterResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientGetLeaderboardAroundCharacterResult decodeGetLeaderboardAroundCharacterResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardForUsersCharactersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientGetLeaderboardForUsersCharactersResult decodeGetLeaderboardForUsersCharactersResultResponse(UPlayFabJsonObject* response); + + /** Decode the GrantCharacterToUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientGrantCharacterToUserResult decodeGrantCharacterToUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateCharacterStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientUpdateCharacterStatisticsResult decodeUpdateCharacterStatisticsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Content + ////////////////////////////////////////////////////// + + /** Decode the GetContentDownloadUrlResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Content Models") + static FClientGetContentDownloadUrlResult decodeGetContentDownloadUrlResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Friend List Management + ////////////////////////////////////////////////////// + + /** Decode the AddFriendResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management Models") + static FClientAddFriendResult decodeAddFriendResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetFriendsListResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management Models") + static FClientGetFriendsListResult decodeGetFriendsListResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemoveFriendResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management Models") + static FClientRemoveFriendResult decodeRemoveFriendResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetFriendTagsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management Models") + static FClientSetFriendTagsResult decodeSetFriendTagsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + + /** Decode the CurrentGamesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking Models") + static FClientCurrentGamesResult decodeCurrentGamesResultResponse(UPlayFabJsonObject* response); + + /** Decode the GameServerRegionsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking Models") + static FClientGameServerRegionsResult decodeGameServerRegionsResultResponse(UPlayFabJsonObject* response); + + /** Decode the MatchmakeResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking Models") + static FClientMatchmakeResult decodeMatchmakeResultResponse(UPlayFabJsonObject* response); + + /** Decode the StartGameResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking Models") + static FClientStartGameResult decodeStartGameResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Platform Specific Methods + ////////////////////////////////////////////////////// + + /** Decode the AndroidDevicePushNotificationRegistrationResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientAndroidDevicePushNotificationRegistrationResult decodeAndroidDevicePushNotificationRegistrationResultResponse(UPlayFabJsonObject* response); + + /** Decode the ConsumeXboxEntitlementsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientConsumeXboxEntitlementsResult decodeConsumeXboxEntitlementsResultResponse(UPlayFabJsonObject* response); + + /** Decode the RegisterForIOSPushNotificationResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientRegisterForIOSPushNotificationResult decodeRegisterForIOSPushNotificationResultResponse(UPlayFabJsonObject* response); + + /** Decode the RestoreIOSPurchasesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientRestoreIOSPurchasesResult decodeRestoreIOSPurchasesResultResponse(UPlayFabJsonObject* response); + + /** Decode the ValidateAmazonReceiptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientValidateAmazonReceiptResult decodeValidateAmazonReceiptResultResponse(UPlayFabJsonObject* response); + + /** Decode the ValidateGooglePlayPurchaseResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientValidateGooglePlayPurchaseResult decodeValidateGooglePlayPurchaseResultResponse(UPlayFabJsonObject* response); + + /** Decode the ValidateIOSReceiptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientValidateIOSReceiptResult decodeValidateIOSReceiptResultResponse(UPlayFabJsonObject* response); + + /** Decode the ValidateWindowsReceiptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientValidateWindowsReceiptResult decodeValidateWindowsReceiptResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Player Data Management + ////////////////////////////////////////////////////// + + /** Decode the GetLeaderboardResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientGetLeaderboardResult decodeGetLeaderboardResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetFriendLeaderboardAroundPlayerResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientGetFriendLeaderboardAroundPlayerResult decodeGetFriendLeaderboardAroundPlayerResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardAroundPlayerResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientGetLeaderboardAroundPlayerResult decodeGetLeaderboardAroundPlayerResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientGetPlayerStatisticsResult decodeGetPlayerStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerStatisticVersionsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientGetPlayerStatisticVersionsResult decodeGetPlayerStatisticVersionsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientGetUserDataResult decodeGetUserDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdatePlayerStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientUpdatePlayerStatisticsResult decodeUpdatePlayerStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateUserDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientUpdateUserDataResult decodeUpdateUserDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Player Item Management + ////////////////////////////////////////////////////// + + /** Decode the ModifyUserVirtualCurrencyResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientModifyUserVirtualCurrencyResult decodeModifyUserVirtualCurrencyResultResponse(UPlayFabJsonObject* response); + + /** Decode the ConfirmPurchaseResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientConfirmPurchaseResult decodeConfirmPurchaseResultResponse(UPlayFabJsonObject* response); + + /** Decode the ConsumeItemResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientConsumeItemResult decodeConsumeItemResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCharacterInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientGetCharacterInventoryResult decodeGetCharacterInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPaymentTokenResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientGetPaymentTokenResult decodeGetPaymentTokenResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPurchaseResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientGetPurchaseResult decodeGetPurchaseResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientGetUserInventoryResult decodeGetUserInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the PayForPurchaseResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientPayForPurchaseResult decodePayForPurchaseResultResponse(UPlayFabJsonObject* response); + + /** Decode the PurchaseItemResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientPurchaseItemResult decodePurchaseItemResultResponse(UPlayFabJsonObject* response); + + /** Decode the RedeemCouponResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientRedeemCouponResult decodeRedeemCouponResultResponse(UPlayFabJsonObject* response); + + /** Decode the StartPurchaseResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientStartPurchaseResult decodeStartPurchaseResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlockContainerItemResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientUnlockContainerItemResult decodeUnlockContainerItemResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // PlayStream + ////////////////////////////////////////////////////// + + /** Decode the GetPlayerSegmentsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream Models") + static FClientGetPlayerSegmentsResult decodeGetPlayerSegmentsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerTagsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream Models") + static FClientGetPlayerTagsResult decodeGetPlayerTagsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + + /** Decode the ExecuteCloudScriptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Server-Side Cloud Script Models") + static FClientExecuteCloudScriptResult decodeExecuteCloudScriptResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Shared Group Data + ////////////////////////////////////////////////////// + + /** Decode the AddSharedGroupMembersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") + static FClientAddSharedGroupMembersResult decodeAddSharedGroupMembersResultResponse(UPlayFabJsonObject* response); + + /** Decode the CreateSharedGroupResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") + static FClientCreateSharedGroupResult decodeCreateSharedGroupResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetSharedGroupDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") + static FClientGetSharedGroupDataResult decodeGetSharedGroupDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemoveSharedGroupMembersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") + static FClientRemoveSharedGroupMembersResult decodeRemoveSharedGroupMembersResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateSharedGroupDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") + static FClientUpdateSharedGroupDataResult decodeUpdateSharedGroupDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Title-Wide Data Management + ////////////////////////////////////////////////////// + + /** Decode the GetCatalogItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") + static FClientGetCatalogItemsResult decodeGetCatalogItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPublisherDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") + static FClientGetPublisherDataResult decodeGetPublisherDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetStoreItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") + static FClientGetStoreItemsResult decodeGetStoreItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTimeResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") + static FClientGetTimeResult decodeGetTimeResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTitleDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") + static FClientGetTitleDataResult decodeGetTitleDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTitleNewsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") + static FClientGetTitleNewsResult decodeGetTitleNewsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Trading + ////////////////////////////////////////////////////// + + /** Decode the AcceptTradeResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") + static FClientAcceptTradeResponse decodeAcceptTradeResponseResponse(UPlayFabJsonObject* response); + + /** Decode the CancelTradeResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") + static FClientCancelTradeResponse decodeCancelTradeResponseResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerTradesResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") + static FClientGetPlayerTradesResponse decodeGetPlayerTradesResponseResponse(UPlayFabJsonObject* response); + + /** Decode the GetTradeStatusResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") + static FClientGetTradeStatusResponse decodeGetTradeStatusResponseResponse(UPlayFabJsonObject* response); + + /** Decode the OpenTradeResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") + static FClientOpenTradeResponse decodeOpenTradeResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabClientModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabClientModels.h new file mode 100644 index 000000000..ce42f3d99 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabClientModels.h @@ -0,0 +1,3752 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Client +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabClientModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Client API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAddGenericIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Generic service identifier to add to the player account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* GenericId = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientAddGenericIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientAddOrUpdateContactEmailRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The new contact email to associate with the player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString EmailAddress; +}; + +USTRUCT(BlueprintType) +struct FClientAddOrUpdateContactEmailResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientAddUsernamePasswordRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** User email address attached to their account */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Email; + /** Password for the PlayFab account (6-100 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Password; + /** PlayFab username for the account (3-20 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FClientAddUsernamePasswordResult +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab unique user name. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FClientGetAccountInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** User email address for the account to find (if no Username is specified). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Email; + /** + * Unique PlayFab identifier of the user whose info is being requested. Optional, defaults to the authenticated user if no + * other lookup identifier set. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString PlayFabId; + /** + * Title-specific username for the account to find (if no Email is set). Note that if the non-unique Title Display Names + * option is enabled for the title, attempts to look up users by Title Display Name will always return AccountNotFound. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString TitleDisplayName; + /** PlayFab Username for the account to find (if no PlayFabId is specified). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FClientGetAccountInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Account information for the local user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* AccountInfo = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerCombinedInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** PlayFabId of the user whose data will be returned. If not filled included, we return the data for the calling player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerCombinedInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Results for requested info. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* InfoResultPayload = nullptr; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerProfileRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerProfileResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The profile of the player. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* PlayerProfile = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromFacebookIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString FacebookIDs; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromFacebookIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Facebook identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromFacebookInstantGamesIdsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Facebook Instant Games identifiers for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString FacebookInstantGamesIds; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromFacebookInstantGamesIdsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Facebook Instant Games identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromGameCenterIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Game Center identifiers (the Player Identifier) for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString GameCenterIDs; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromGameCenterIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Game Center identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromGenericIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Array of unique generic service identifiers for which the title needs to get PlayFab identifiers. Currently limited to a + * maximum of 10 in a single request. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray GenericIDs; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromGenericIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of generic service identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromGoogleIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Google identifiers (Google+ user IDs) for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString GoogleIDs; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromGoogleIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Google identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromKongregateIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Kongregate identifiers (Kongregate's user_id) for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString KongregateIDs; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromKongregateIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Kongregate identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Nintendo Switch Device identifiers for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString NintendoSwitchDeviceIds; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Nintendo Switch Device identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromSteamIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString SteamStringIDs; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromSteamIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Steam identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromTwitchIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Twitch identifiers (Twitch's _id) for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString TwitchIds; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromTwitchIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Twitch identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientLinkAndroidDeviceIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Specific model of the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString AndroidDevice; + /** Android device identifier for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString AndroidDeviceId; + /** If another user is already linked to the device, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** Specific Operating System version for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString OS; +}; + +USTRUCT(BlueprintType) +struct FClientLinkAndroidDeviceIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkCustomIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom unique identifier for the user, generated by the title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString CustomId; + /** If another user is already linked to the custom ID, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; +}; + +USTRUCT(BlueprintType) +struct FClientLinkCustomIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkFacebookAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier from Facebook for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString AccessToken; + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; +}; + +USTRUCT(BlueprintType) +struct FClientLinkFacebookAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkFacebookInstantGamesIdRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Facebook Instant Games signature for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString FacebookInstantGamesSignature; + /** If another user is already linked to the Facebook Instant Games ID, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; +}; + +USTRUCT(BlueprintType) +struct FClientLinkFacebookInstantGamesIdResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkGameCenterAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** Game Center identifier for the player account to be linked. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString GameCenterId; +}; + +USTRUCT(BlueprintType) +struct FClientLinkGameCenterAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkGoogleAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** + * Server authentication code obtained on the client by calling getServerAuthCode() + * (https://developers.google.com/identity/sign-in/android/offline-access) from Google Play for the user. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString ServerAuthCode; +}; + +USTRUCT(BlueprintType) +struct FClientLinkGoogleAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkIOSDeviceIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Vendor-specific iOS identifier for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString DeviceId; + /** Specific model of the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString DeviceModel; + /** If another user is already linked to the device, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** Specific Operating System version for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString OS; +}; + +USTRUCT(BlueprintType) +struct FClientLinkIOSDeviceIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkKongregateAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Valid session auth ticket issued by Kongregate */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString AuthTicket; + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** Numeric user ID assigned by Kongregate */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString KongregateId; +}; + +USTRUCT(BlueprintType) +struct FClientLinkKongregateAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkNintendoSwitchDeviceIdRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If another user is already linked to the Nintendo Switch Device ID, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** Nintendo Switch unique identifier for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString NintendoSwitchDeviceId; +}; + +USTRUCT(BlueprintType) +struct FClientLinkNintendoSwitchDeviceIdResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkSteamAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** + * Authentication token for the user, returned as a byte array from Steam, and converted to a string (for example, the byte + * 0x08 should become "08"). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString SteamTicket; +}; + +USTRUCT(BlueprintType) +struct FClientLinkSteamAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkTwitchAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Valid token issued by Twitch */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString AccessToken; + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; +}; + +USTRUCT(BlueprintType) +struct FClientLinkTwitchAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkWindowsHelloAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Device name. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString DeviceName; + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** PublicKey generated by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString PublicKey; + /** Player's user named used by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString UserName; +}; + +USTRUCT(BlueprintType) +struct FClientLinkWindowsHelloAccountResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkXboxAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientLinkXboxAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientRemoveContactEmailRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientRemoveContactEmailResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientRemoveGenericIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Generic service identifier to be removed from the player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* GenericId = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientRemoveGenericIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientReportPlayerClientRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional additional comment by reporting player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Comment; + /** Unique PlayFab identifier of the reported player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString ReporteeId; +}; + +USTRUCT(BlueprintType) +struct FClientReportPlayerClientResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The number of remaining reports which may be filed today. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + int32 SubmissionsRemaining = 0; +}; + +USTRUCT(BlueprintType) +struct FClientSendAccountRecoveryEmailRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** User email address attached to their account */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Email; + /** The email template id of the account recovery email template to send. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString EmailTemplateId; +}; + +USTRUCT(BlueprintType) +struct FClientSendAccountRecoveryEmailResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkAndroidDeviceIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Android device identifier for the user's device. If not specified, the most recently signed in Android Device ID will be + * used. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString AndroidDeviceId; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkAndroidDeviceIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkCustomIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Custom unique identifier for the user, generated by the title. If not specified, the most recently signed in Custom ID + * will be used. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString CustomId; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkCustomIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkFacebookAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkFacebookAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkFacebookInstantGamesIdRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Facebook Instant Games identifier for the user. If not specified, the most recently signed in ID will be used. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString FacebookInstantGamesId; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkFacebookInstantGamesIdResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkGameCenterAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkGameCenterAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkGoogleAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkGoogleAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkIOSDeviceIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Vendor-specific iOS identifier for the user's device. If not specified, the most recently signed in iOS Device ID will + * be used. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString DeviceId; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkIOSDeviceIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkKongregateAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkKongregateAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkNintendoSwitchDeviceIdRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Nintendo Switch Device identifier for the user. If not specified, the most recently signed in device ID will be used. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString NintendoSwitchDeviceId; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkNintendoSwitchDeviceIdResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkSteamAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkSteamAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkTwitchAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkTwitchAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkWindowsHelloAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** SHA256 hash of the PublicKey generated by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString PublicKeyHint; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkWindowsHelloAccountResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkXboxAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkXboxAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientEmptyResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUpdateAvatarUrlRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** URL of the avatar image. If empty, it removes the existing avatar URL. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString ImageUrl; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateUserTitleDisplayNameRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** New title display name for the user - must be between 3 and 25 characters. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString DisplayName; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateUserTitleDisplayNameResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Current title display name for the user (this will be the original display name if the rename attempt failed). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString DisplayName; +}; + + +/////////////////////////////////////////////////////// +// Advertising +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAttributeInstallRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The adid for this device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Advertising Models") + FString Adid; + /** The IdentifierForAdvertisers for iOS Devices. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Advertising Models") + FString Idfa; +}; + +USTRUCT(BlueprintType) +struct FClientAttributeInstallResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Analytics +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientDeviceInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Information posted to the PlayStream Event. Currently arbitrary, and specific to the environment sending it. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + UPlayFabJsonObject* Info = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientWriteClientCharacterEventRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom event properties. Each property consists of a name (string) and a value (JSON object). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + UPlayFabJsonObject* Body = nullptr; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString CharacterId; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString EventName; + /** The time (in UTC) associated with this event. The value dafaults to the current time. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString Timestamp; +}; + +USTRUCT(BlueprintType) +struct FClientWriteEventResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to + * any particular format. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString EventId; +}; + +USTRUCT(BlueprintType) +struct FClientWriteClientPlayerEventRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom data properties associated with the event. Each property consists of a name (string) and a value (JSON object). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + UPlayFabJsonObject* Body = nullptr; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString EventName; + /** The time (in UTC) associated with this event. The value dafaults to the current time. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString Timestamp; +}; + +USTRUCT(BlueprintType) +struct FClientWriteTitleEventRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom event properties. Each property consists of a name (string) and a value (JSON object). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + UPlayFabJsonObject* Body = nullptr; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString EventName; + /** The time (in UTC) associated with this event. The value dafaults to the current time. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString Timestamp; +}; + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientGetPhotonAuthenticationTokenRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The Photon applicationId for the game you wish to log into. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PhotonApplicationId; +}; + +USTRUCT(BlueprintType) +struct FClientGetPhotonAuthenticationTokenResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The Photon authentication token for this game-session. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PhotonCustomAuthenticationToken; +}; + +USTRUCT(BlueprintType) +struct FClientGetTitlePublicKeyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The shared secret key for this title */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString TitleSharedSecret; +}; + +USTRUCT(BlueprintType) +struct FClientGetTitlePublicKeyResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Base64 encoded RSA CSP byte array blob containing the title's public RSA key */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString RSAPublicKey; +}; + +USTRUCT(BlueprintType) +struct FClientGetWindowsHelloChallengeRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** SHA256 hash of the PublicKey generated by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PublicKeyHint; +}; + +USTRUCT(BlueprintType) +struct FClientGetWindowsHelloChallengeResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Server generated challenge to be signed by the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Challenge; +}; + +USTRUCT(BlueprintType) +struct FClientLoginResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * If LoginTitlePlayerAccountEntity flag is set on the login request the title_player_account will also be logged in and + * returned. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* EntityToken = nullptr; + /** Results for requested info. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoResultPayload = nullptr; + /** The time of this user's previous login. If there was no previous login, then it's DateTime.MinValue */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString LastLoginTime; + /** True if the account was newly created on this login. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool NewlyCreated = false; + /** Player's unique PlayFabId. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayFabId; + /** Unique token authorizing the user and game at the server level, for the current session. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString SessionTicket; + /** Settings specific to this user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* SettingsForUser = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithAndroidDeviceIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Specific model of the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString AndroidDevice; + /** Android device identifier for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString AndroidDeviceId; + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Specific Operating System version for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString OS; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithCustomIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Custom unique identifier for the user, generated by the title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString CustomId; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithEmailAddressRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Email address for the account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Email; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Password for the PlayFab account (6-100 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Password; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithFacebookRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier from Facebook for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString AccessToken; + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithFacebookInstantGamesIdRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Facebook Instant Games signature for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString FacebookInstantGamesSignature; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithGameCenterRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Unique Game Center player id. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerId; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithGoogleAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; + /** + * OAuth 2.0 server authentication code obtained on the client by calling the getServerAuthCode() + * (https://developers.google.com/identity/sign-in/android/offline-access) Google client API. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString ServerAuthCode; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithIOSDeviceIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Vendor-specific iOS identifier for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString DeviceId; + /** Specific model of the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString DeviceModel; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Specific Operating System version for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString OS; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithKongregateRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Token issued by Kongregate's client API for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString AuthTicket; + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Numeric user ID assigned by Kongregate */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString KongregateId; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithNintendoSwitchDeviceIdRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Nintendo Switch unique identifier for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString NintendoSwitchDeviceId; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithPlayFabRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Password for the PlayFab account (6-100 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Password; + /** PlayFab username for the account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithSteamRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; + /** + * Authentication token for the user, returned as a byte array from Steam, and converted to a string (for example, the byte + * 0x08 should become "08"). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString SteamTicket; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithTwitchRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Token issued by Twitch's API for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString AccessToken; + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithWindowsHelloRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The signed response from the user for the Challenge. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString ChallengeSignature; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** SHA256 hash of the PublicKey generated by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PublicKeyHint; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithXboxRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; + /** Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientRegisterPlayFabUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** An optional parameter for setting the display name for this title (3-25 characters). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString DisplayName; + /** User email address attached to their account */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Email; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Password for the PlayFab account (6-100 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Password; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; + /** + * An optional parameter that specifies whether both the username and email parameters are required. If true, both + * parameters are required; if false, the user must supply either the username or email parameter. The default value is + * true. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool RequireBothUsernameAndEmail = false; + /** PlayFab username for the account (3-20 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FClientRegisterPlayFabUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * If LoginTitlePlayerAccountEntity flag is set on the login request the title_player_account will also be logged in and + * returned. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* EntityToken = nullptr; + /** PlayFab unique identifier for this newly created account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayFabId; + /** Unique token identifying the user and game at the server level, for the current session. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString SessionTicket; + /** Settings specific to this user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* SettingsForUser = nullptr; + /** PlayFab unique user name. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FClientRegisterWithWindowsHelloRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Device name. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString DeviceName; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; + /** PublicKey generated by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PublicKey; + /** Player's user name used by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString UserName; +}; + +USTRUCT(BlueprintType) +struct FClientSetPlayerSecretRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientSetPlayerSecretResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Character Data +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientGetCharacterDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + FString CharacterId; + /** + * The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + int32 IfChangedFromDataVersion = 0; + /** Specific keys to search for in the custom user data. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + FString Keys; + /** Unique PlayFab identifier of the user to load data for. Optional, defaults to yourself if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + FString CharacterId; + /** User specific data for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + UPlayFabJsonObject* Data = nullptr; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + int32 DataVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateCharacterDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + FString CharacterId; + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + FString KeysToRemove; + /** Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + EUserDataPermission Permission; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateCharacterDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + int32 DataVersion = 0; +}; + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientListUsersCharactersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientListUsersCharactersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list of characters. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + TArray Characters; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterLeaderboardRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional character type on which to filter the leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterType; + /** Maximum number of entries to retrieve. Default 10, maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + int32 MaxResultsCount = 0; + /** First entry in the leaderboard to be retrieved. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + int32 StartPosition = 0; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterLeaderboardResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered list of leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + TArray Leaderboard; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterId; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested character statistics. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + UPlayFabJsonObject* CharacterStatistics; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardAroundCharacterRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character on which to center the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterId; + /** Optional character type on which to filter the leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterType; + /** Maximum number of entries to retrieve. Default 10, maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + int32 MaxResultsCount = 0; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardAroundCharacterResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered list of leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + TArray Leaderboard; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardForUsersCharactersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + int32 MaxResultsCount = 0; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardForUsersCharactersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered list of leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + TArray Leaderboard; +}; + +USTRUCT(BlueprintType) +struct FClientGrantCharacterToUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version from which items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CatalogVersion; + /** Non-unique display name of the character being granted (1-20 characters in length). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterName; + /** + * Catalog item identifier of the item in the user's inventory that corresponds to the character in the catalog to be + * created. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString ItemId; +}; + +USTRUCT(BlueprintType) +struct FClientGrantCharacterToUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier tagged to this character. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterId; + /** Type of character that was created. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterType; + /** Indicates whether this character was created successfully. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + bool Result = false; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateCharacterStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterId; + /** Statistics to be updated with the provided values. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + UPlayFabJsonObject* CharacterStatistics; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateCharacterStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientGetContentDownloadUrlRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** HTTP method to fetch item - GET or HEAD. Use HEAD when only fetching metadata. Default is GET. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Content Models") + FString HttpMethod; + /** Key of the content item to fetch, usually formatted as a path, e.g. images/a.png */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Content Models") + FString Key; + /** + * True to download through CDN. CDN provides higher download bandwidth and lower latency. However, if you want the latest, + * non-cached version of the content during development, set this to false. Default is true. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Content Models") + bool ThruCDN = false; +}; + +USTRUCT(BlueprintType) +struct FClientGetContentDownloadUrlResult +{ + GENERATED_USTRUCT_BODY() +public: + /** URL for downloading content via HTTP GET or HEAD method. The URL will expire in approximately one hour. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Content Models") + FString URL; +}; + + +/////////////////////////////////////////////////////// +// Friend List Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAddFriendRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Email address of the user to attempt to add to the local user's friend list. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString FriendEmail; + /** PlayFab identifier of the user to attempt to add to the local user's friend list. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString FriendPlayFabId; + /** Title-specific display name of the user to attempt to add to the local user's friend list. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString FriendTitleDisplayName; + /** PlayFab username of the user to attempt to add to the local user's friend list. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString FriendUsername; +}; + +USTRUCT(BlueprintType) +struct FClientAddFriendResult +{ + GENERATED_USTRUCT_BODY() +public: + /** True if the friend request was processed successfully. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + bool Created = false; +}; + +USTRUCT(BlueprintType) +struct FClientGetFriendsListRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Indicates whether Facebook friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + bool IncludeFacebookFriends = false; + /** Indicates whether Steam service friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + bool IncludeSteamFriends = false; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientGetFriendsListResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of friends found. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + TArray Friends; +}; + +USTRUCT(BlueprintType) +struct FClientRemoveFriendRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab identifier of the friend account which is to be removed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString FriendPlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientRemoveFriendResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientSetFriendTagsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab identifier of the friend account to which the tag(s) should be applied. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString FriendPlayFabId; + /** Array of tags to set on the friend account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString Tags; +}; + +USTRUCT(BlueprintType) +struct FClientSetFriendTagsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientCurrentGamesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Build to match against. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString BuildVersion; + /** Game mode to look for. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString GameMode; + /** Region to check for Game Server Instances. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + ERegion Region; + /** Statistic name to find statistic-based matches. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString StatisticName; + /** Filter to include and/or exclude Game Server Instances associated with certain tags. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + UPlayFabJsonObject* TagFilter = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientCurrentGamesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** number of games running */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + int32 GameCount = 0; + /** array of games found */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + TArray Games; + /** total number of players across all servers */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + int32 PlayerCount = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGameServerRegionsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** version of game server for which stats are being requested */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString BuildVersion; +}; + +USTRUCT(BlueprintType) +struct FClientGameServerRegionsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of regions found matching the request parameters */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + TArray Regions; +}; + +USTRUCT(BlueprintType) +struct FClientMatchmakeRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Build version to match against. [Note: Required if LobbyId is not specified] */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString BuildVersion; + /** Character to use for stats based matching. Leave null to use account stats. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString CharacterId; + /** Game mode to match make against. [Note: Required if LobbyId is not specified] */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString GameMode; + /** Lobby identifier to match make against. This is used to select a specific Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString LobbyId; + /** Region to match make against. [Note: Required if LobbyId is not specified] */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + ERegion Region; + /** Start a game session if one with an open slot is not found. Defaults to true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + bool StartNewIfNoneFound = false; + /** Player statistic to use in finding a match. May be null for no stat-based matching. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString StatisticName; + /** Filter to include and/or exclude Game Server Instances associated with certain Tags */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + UPlayFabJsonObject* TagFilter = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientMatchmakeResult +{ + GENERATED_USTRUCT_BODY() +public: + /** timestamp for when the server will expire, if applicable */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString Expires; + /** unique lobby identifier of the server matched */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString LobbyID; + /** time in milliseconds the application is configured to wait on matchmaking results */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + int32 PollWaitTimeMS = 0; + /** IPV4 address of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerHostname; + /** IPV4 address of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerIPV4Address; + /** IPV6 address of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerIPV6Address; + /** port number to use for non-http communications with the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + int32 ServerPort = 0; + /** Public DNS name (if any) of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerPublicDNSName; + /** result of match making process */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + EMatchmakeStatus Status; + /** server authorization ticket (used by RedeemMatchmakerTicket to validate user insertion into the game) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString Ticket; +}; + +USTRUCT(BlueprintType) +struct FClientStartGameRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** version information for the build of the game server which is to be started */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString BuildVersion; + /** character to use for stats based matching. Leave null to use account stats */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString CharacterId; + /** custom command line argument when starting game server process */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString CustomCommandLineData; + /** the title-defined game mode this server is to be running (defaults to 0 if there is only one mode) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString GameMode; + /** the region to associate this server with for match filtering */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + ERegion Region; + /** player statistic for others to use in finding this game. May be null for no stat-based matching */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FClientStartGameResult +{ + GENERATED_USTRUCT_BODY() +public: + /** timestamp for when the server should expire, if applicable */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString Expires; + /** unique identifier for the lobby of the server started */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString LobbyID; + /** password required to log into the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString Password; + /** server IPV4 address */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerHostname; + /** server IPV4 address */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerIPV4Address; + /** server IPV6 address */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerIPV6Address; + /** port on the server to be used for communication */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + int32 ServerPort = 0; + /** server public DNS name */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerPublicDNSName; + /** unique identifier for the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString Ticket; +}; + + +/////////////////////////////////////////////////////// +// Platform Specific Methods +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAndroidDevicePushNotificationRegistrationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Message to display when confirming push notification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString ConfirmationMessage; + /** + * Registration ID provided by the Google Cloud Messaging service when the title registered to receive push notifications + * (see the GCM documentation, here: http://developer.android.com/google/gcm/client.html). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString DeviceToken; + /** If true, send a test push message immediately after sucessful registration. Defaults to false. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + bool SendPushNotificationConfirmation = false; +}; + +USTRUCT(BlueprintType) +struct FClientAndroidDevicePushNotificationRegistrationResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientConsumeXboxEntitlementsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version to use */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CatalogVersion; + /** Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientConsumeXboxEntitlementsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Details for the items purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + TArray Items; +}; + +USTRUCT(BlueprintType) +struct FClientRegisterForIOSPushNotificationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Message to display when confirming push notification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString ConfirmationMessage; + /** Unique token generated by the Apple Push Notification service when the title registered to receive push notifications. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString DeviceToken; + /** If true, send a test push message immediately after sucessful registration. Defaults to false. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + bool SendPushNotificationConfirmation = false; +}; + +USTRUCT(BlueprintType) +struct FClientRegisterForIOSPushNotificationResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientRestoreIOSPurchasesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Base64 encoded receipt data, passed back by the App Store as a result of a successful purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString ReceiptData; +}; + +USTRUCT(BlueprintType) +struct FClientRestoreIOSPurchasesResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientValidateAmazonReceiptRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version to use when granting receipt item. If null, defaults to primary catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CatalogVersion; + /** Currency used for the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CurrencyCode; + /** Amount of the stated currency paid for the object. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + int32 PurchasePrice = 0; + /** ReceiptId returned by the Amazon App Store in-app purchase API */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString ReceiptId; + /** AmazonId of the user making the purchase as returned by the Amazon App Store in-app purchase API */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString UserId; +}; + +USTRUCT(BlueprintType) +struct FClientValidateAmazonReceiptResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientValidateGooglePlayPurchaseRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Currency used for the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CurrencyCode; + /** Amount of the stated currency paid for the object. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + int32 PurchasePrice = 0; + /** Original JSON string returned by the Google Play IAB API. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString ReceiptJson; + /** Signature returned by the Google Play IAB API. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString Signature; +}; + +USTRUCT(BlueprintType) +struct FClientValidateGooglePlayPurchaseResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientValidateIOSReceiptRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Currency used for the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CurrencyCode; + /** Amount of the stated currency paid for the object. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + int32 PurchasePrice = 0; + /** Base64 encoded receipt data, passed back by the App Store as a result of a successful purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString ReceiptData; +}; + +USTRUCT(BlueprintType) +struct FClientValidateIOSReceiptResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientValidateWindowsReceiptRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version to use when granting receipt item. If null, defaults to primary catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CatalogVersion; + /** Currency used for the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CurrencyCode; + /** Amount of the stated currency paid for the object. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + int32 PurchasePrice = 0; + /** XML Receipt returned by the Windows App Store in-app purchase API */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString Receipt; +}; + +USTRUCT(BlueprintType) +struct FClientValidateWindowsReceiptResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientGetFriendLeaderboardRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Indicates whether Facebook friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool IncludeFacebookFriends = false; + /** Indicates whether Steam service friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool IncludeSteamFriends = false; + /** Maximum number of entries to retrieve. Default 10, maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 MaxResultsCount = 0; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Position in the leaderboard to start this listing (defaults to the first entry). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 StartPosition = 0; + /** Statistic used to rank friends for this leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; + /** Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered listing of users and their positions in the requested leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray Leaderboard; + /** The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString NextReset; + /** The version of the leaderboard returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetFriendLeaderboardAroundPlayerRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Indicates whether Facebook friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool IncludeFacebookFriends = false; + /** Indicates whether Steam service friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool IncludeSteamFriends = false; + /** Maximum number of entries to retrieve. Default 10, maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 MaxResultsCount = 0; + /** PlayFab unique identifier of the user to center the leaderboard around. If null will center on the logged in user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Statistic used to rank players for this leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; + /** Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientGetFriendLeaderboardAroundPlayerResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered listing of users and their positions in the requested leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray Leaderboard; + /** The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString NextReset; + /** The version of the leaderboard returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Maximum number of entries to retrieve. Default 10, maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 MaxResultsCount = 0; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Position in the leaderboard to start this listing (defaults to the first entry). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 StartPosition = 0; + /** Statistic used to rank players for this leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardAroundPlayerRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Maximum number of entries to retrieve. Default 10, maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 MaxResultsCount = 0; + /** PlayFab unique identifier of the user to center the leaderboard around. If null will center on the logged in user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Statistic used to rank players for this leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardAroundPlayerResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered listing of users and their positions in the requested leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray Leaderboard; + /** The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString NextReset; + /** The version of the leaderboard returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** statistics to return (current version will be returned for each) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString StatisticNames; + /** + * statistics to return, if StatisticNames is not set (only statistics which have a version matching that provided will be + * returned) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray StatisticNameVersions; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** User statistics for the requested user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray Statistics; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerStatisticVersionsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique name of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerStatisticVersionsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** version change history of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray StatisticVersions; +}; + +USTRUCT(BlueprintType) +struct FClientGetUserDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 IfChangedFromDataVersion = 0; + /** List of unique keys to load from. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString Keys; + /** + * Unique PlayFab identifier of the user to load data for. Optional, defaults to yourself if not set. When specified to a + * PlayFab id of another player, then this will only return public keys for that account. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientGetUserDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** User specific data for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + UPlayFabJsonObject* Data = nullptr; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 DataVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FClientUpdatePlayerStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Statistics to be updated with the provided values */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray Statistics; +}; + +USTRUCT(BlueprintType) +struct FClientUpdatePlayerStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUpdateUserDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString KeysToRemove; + /** + * Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. This is used + * for requests by one player for information about another player; those requests will only return Public keys. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + EUserDataPermission Permission; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateUserDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 DataVersion = 0; +}; + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAddUserVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Amount to be added to the user balance of the specified virtual currency. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 Amount = 0; + /** Name of the virtual currency which is to be incremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FClientModifyUserVirtualCurrencyResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Balance of the virtual currency after modification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 Balance = 0; + /** + * Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase + * over this value will be discarded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 BalanceChange = 0; + /** User currency was subtracted from. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which was modified. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FClientConfirmPurchaseRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Purchase order identifier returned from StartPurchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; +}; + +USTRUCT(BlueprintType) +struct FClientConfirmPurchaseResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray Items; + /** Purchase order identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; + /** Date and time of the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString PurchaseDate; +}; + +USTRUCT(BlueprintType) +struct FClientConsumeItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; + /** Number of uses to consume from the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 ConsumeCount = 0; + /** Unique instance identifier of the item to be consumed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ItemInstanceId; +}; + +USTRUCT(BlueprintType) +struct FClientConsumeItemResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique instance identifier of the item with uses consumed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ItemInstanceId; + /** Number of uses remaining on the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 RemainingUses = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterInventoryRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Used to limit results to only those from a specific catalog version. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the character for this inventory. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; + /** Array of inventory items belonging to the character. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray Inventory; + /** Array of virtual currency balance(s) belonging to the character. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; + /** Array of remaining times and timestamps for virtual currencies. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrencyRechargeTimes = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientGetPaymentTokenRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The name of service to provide the payment token. Allowed Values are: xsolla */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString TokenProvider; +}; + +USTRUCT(BlueprintType) +struct FClientGetPaymentTokenResult +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab's purchase order identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; + /** The token from provider. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ProviderToken; +}; + +USTRUCT(BlueprintType) +struct FClientGetPurchaseRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Purchase order identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; +}; + +USTRUCT(BlueprintType) +struct FClientGetPurchaseResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Purchase order identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; + /** Payment provider used for transaction (If not VC) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString PaymentProvider; + /** Date and time of the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString PurchaseDate; + /** Provider transaction ID (If not VC) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString TransactionId; + /** PlayFab transaction status */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString TransactionStatus; +}; + +USTRUCT(BlueprintType) +struct FClientGetUserInventoryRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientGetUserInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of inventory items belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray Inventory; + /** Array of virtual currency balance(s) belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; + /** Array of remaining times and timestamps for virtual currencies. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrencyRechargeTimes = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientPayForPurchaseRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Currency to use to fund the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString Currency; + /** Purchase order identifier returned from StartPurchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; + /** Payment provider to use to fund the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ProviderName; + /** Payment provider transaction identifier. Required for Facebook Payments. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ProviderTransactionId; +}; + +USTRUCT(BlueprintType) +struct FClientPayForPurchaseResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Local credit applied to the transaction (provider specific). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 CreditApplied = 0; + /** Purchase order identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; + /** Provider used for the transaction. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ProviderData; + /** A token generated by the provider to authenticate the request (provider-specific). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ProviderToken; + /** URL to the purchase provider page that details the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString PurchaseConfirmationPageURL; + /** Currency for the transaction, may be a virtual currency or real money. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString PurchaseCurrency; + /** Cost of the transaction. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 PurchasePrice = 0; + /** Status of the transaction. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + ETransactionStatus Status; + /** Virtual currencies granted by the transaction, if any. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VCAmount; + /** Current virtual currency balances for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FClientPurchaseItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version for the items to be purchased (defaults to most recent version. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; + /** Unique identifier of the item to purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ItemId; + /** Price the client expects to pay for the item (in case a new catalog or store was uploaded, with new prices). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 Price = 0; + /** Store to buy this item through. If not set, prices default to those in the catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString StoreId; + /** Virtual currency to use to purchase the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FClientPurchaseItemResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Details for the items purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray Items; +}; + +USTRUCT(BlueprintType) +struct FClientRedeemCouponRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version of the coupon. If null, uses the default catalog */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CatalogVersion; + /** Optional identifier for the Character that should receive the item. If null, item is added to the player */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; + /** Generated coupon code to redeem. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CouponCode; +}; + +USTRUCT(BlueprintType) +struct FClientRedeemCouponResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Items granted to the player as a result of redeeming the coupon. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray GrantedItems; +}; + +USTRUCT(BlueprintType) +struct FClientStartPurchaseRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version for the items to be purchased. Defaults to most recent catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CatalogVersion; + /** Array of items to purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray Items; + /** Store through which to purchase items. If not set, prices will be pulled from the catalog itself. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FClientStartPurchaseResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Cart items to be purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray Contents; + /** Purchase order identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; + /** Available methods by which the user can pay. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray PaymentOptions; + /** Current virtual currency totals for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrencyBalances; +}; + +USTRUCT(BlueprintType) +struct FClientSubtractUserVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Amount to be subtracted from the user balance of the specified virtual currency. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 Amount = 0; + /** Name of the virtual currency which is to be decremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FClientUnlockContainerInstanceRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Specifies the catalog version that should be used to determine container contents. If unspecified, uses catalog + * associated with the item instance. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; + /** ItemInstanceId of the container to unlock. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ContainerItemInstanceId; + /** + * ItemInstanceId of the key that will be consumed by unlocking this container. If the container requires a key, this + * parameter is required. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString KeyItemInstanceId; +}; + +USTRUCT(BlueprintType) +struct FClientUnlockContainerItemResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Items granted to the player as a result of unlocking the container. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray GrantedItems; + /** Unique instance identifier of the container unlocked. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString UnlockedItemInstanceId; + /** Unique instance identifier of the key used to unlock the container, if applicable. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString UnlockedWithItemInstanceId; + /** Virtual currency granted to the player as a result of unlocking the container. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FClientUnlockContainerItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Specifies the catalog version that should be used to determine container contents. If unspecified, uses default/primary + * catalog. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; + /** Catalog ItemId of the container type to unlock. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ContainerItemId; +}; + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientGetPlayerSegmentsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerSegmentsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of segments the requested player currently belongs to. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | PlayStream Models") + TArray Segments; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerTagsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional namespace to filter results by */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | PlayStream Models") + FString Namespace; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | PlayStream Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerTagsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | PlayStream Models") + FString PlayFabId; + /** Canonical tags (including namespace and tag's name) for the requested user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | PlayStream Models") + FString Tags; +}; + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientExecuteCloudScriptRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The name of the CloudScript function to execute */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + FString FunctionName; + /** Object that is passed in to the function as the first argument */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + UPlayFabJsonObject* FunctionParameter = nullptr; + /** + * Generate a 'player_executed_cloudscript' PlayStream event containing the results of the function execution and other + * contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + bool GeneratePlayStreamEvent = false; + /** + * Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' + * executes the current live, published revision, and 'Specific' executes the specified revision. The default value is + * 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + ECloudScriptRevisionOption RevisionSelection; + /** The specivic revision to execute, when RevisionSelection is set to 'Specific' */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 SpecificRevision = 0; +}; + +USTRUCT(BlueprintType) +struct FClientExecuteCloudScriptResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Number of PlayFab API requests issued by the CloudScript function */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 APIRequestsIssued = 0; + /** Information about the error, if any, that occurred during execution */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + UPlayFabJsonObject* Error = nullptr; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 ExecutionTimeSeconds = 0; + /** The name of the function that executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + FString FunctionName; + /** The object returned from the CloudScript function, if any */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + UPlayFabJsonObject* FunctionResult = nullptr; + /** + * Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + bool FunctionResultTooLarge = false; + /** Number of external HTTP requests issued by the CloudScript function */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 HttpRequestsIssued = 0; + /** + * Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + TArray Logs; + /** + * Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + bool LogsTooLarge = false; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 MemoryConsumedBytes = 0; + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 ProcessorTimeSeconds = 0; + /** The revision of the CloudScript that executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 Revision = 0; +}; + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAddSharedGroupMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** An array of unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString PlayFabIds; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FClientAddSharedGroupMembersResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientCreateSharedGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the shared group (a random identifier will be assigned, if one is not specified). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FClientCreateSharedGroupResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FClientGetSharedGroupDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If true, return the list of all members of the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + bool GetMembers = false; + /** + * Specific keys to retrieve from the shared group (if not specified, all keys will be returned, while an empty array + * indicates that no keys should be returned). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString Keys; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FClientGetSharedGroupDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Data for the requested keys. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + UPlayFabJsonObject* Data = nullptr; + /** List of PlayFabId identifiers for the members of this group, if requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString Members; +}; + +USTRUCT(BlueprintType) +struct FClientRemoveSharedGroupMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** An array of unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString PlayFabIds; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FClientRemoveSharedGroupMembersResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUpdateSharedGroupDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString KeysToRemove; + /** Permission to be applied to all user data keys in this request. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + EUserDataPermission Permission; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateSharedGroupDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientGetCatalogItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Which catalog is being requested. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString CatalogVersion; +}; + +USTRUCT(BlueprintType) +struct FClientGetCatalogItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items which can be purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + TArray Catalog; +}; + +USTRUCT(BlueprintType) +struct FClientGetPublisherDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** array of keys to get back data from the Publisher data blob, set by the admin tools */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString Keys; +}; + +USTRUCT(BlueprintType) +struct FClientGetPublisherDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** a dictionary object of key / value pairs */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + UPlayFabJsonObject* Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetStoreItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** catalog version to store items from. Use default catalog version if null */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString CatalogVersion; + /** Unqiue identifier for the store which is being requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FClientGetStoreItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The base catalog that this store is a part of. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString CatalogVersion; + /** Additional data about the store. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + UPlayFabJsonObject* MarketingData = nullptr; + /** How the store was last updated (Admin or a third party). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + EPfSourceType Source; + /** Array of items which can be purchased from this store. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + TArray Store; + /** The ID of this store. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FClientGetTimeRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientGetTimeResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Current server time when the request was received, in UTC */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString Time; +}; + +USTRUCT(BlueprintType) +struct FClientGetTitleDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Specific keys to search for in the title data (leave null to get all keys) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString Keys; +}; + +USTRUCT(BlueprintType) +struct FClientGetTitleDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** a dictionary object of key / value pairs */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + UPlayFabJsonObject* Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetTitleNewsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Limits the results to the last n entries. Defaults to 10 if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + int32 Count = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetTitleNewsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of news items. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + TArray News; +}; + + +/////////////////////////////////////////////////////// +// Trading +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAcceptTradeRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Items from the accepting player's inventory in exchange for the offered items in the trade. In the case of a gift, this + * will be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString AcceptedInventoryInstanceIds; + /** Player who opened the trade. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString OfferingPlayerId; + /** Trade identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString TradeId; +}; + +USTRUCT(BlueprintType) +struct FClientAcceptTradeResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Details about trade which was just accepted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + UPlayFabJsonObject* Trade = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientCancelTradeRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Trade identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString TradeId; +}; + +USTRUCT(BlueprintType) +struct FClientCancelTradeResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Details about trade which was just canceled. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + UPlayFabJsonObject* Trade = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerTradesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Returns only trades with the given status. If null, returns all trades. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + ETradeStatus StatusFilter; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerTradesResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** History of trades which this player has accepted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + TArray AcceptedTrades; + /** The trades for this player which are currently available to be accepted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + TArray OpenedTrades; +}; + +USTRUCT(BlueprintType) +struct FClientGetTradeStatusRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Player who opened trade. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString OfferingPlayerId; + /** Trade identifier as returned by OpenTradeOffer. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString TradeId; +}; + +USTRUCT(BlueprintType) +struct FClientGetTradeStatusResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Information about the requested trade. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + UPlayFabJsonObject* Trade = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientOpenTradeRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Players who are allowed to accept the trade. If null, the trade may be accepted by any player. If empty, the trade may + * not be accepted by any player. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString AllowedPlayerIds; + /** Player inventory items offered for trade. If not set, the trade is effectively a gift request */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString OfferedInventoryInstanceIds; + /** Catalog items accepted for the trade. If not set, the trade is effectively a gift. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString RequestedCatalogItemIds; +}; + +USTRUCT(BlueprintType) +struct FClientOpenTradeResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The information about the trade that was just opened. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + UPlayFabJsonObject* Trade = nullptr; +}; + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptAPI.h new file mode 100644 index 000000000..7ba1e4349 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptAPI.h @@ -0,0 +1,107 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: CloudScript +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabCloudScriptModels.h" +#include "PlayFabCloudScriptAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabCloudScriptRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabCloudScriptAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabCloudScriptRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab CloudScript API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessExecuteEntityCloudScript, FCloudScriptExecuteCloudScriptResult, result, UObject*, customData); + + /** + * Cloud Script is one of PlayFab's most versatile features. It allows client code to request execution of any kind of + * custom server-side functionality you can implement, and it can be used in conjunction with virtually anything. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | CloudScript | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabCloudScriptAPI* ExecuteEntityCloudScript(FCloudScriptExecuteEntityCloudScriptRequest request, + FDelegateOnSuccessExecuteEntityCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabCloudScriptRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | CloudScript | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperExecuteEntityCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessExecuteEntityCloudScript OnSuccessExecuteEntityCloudScript; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptModelDecoder.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptModelDecoder.h new file mode 100644 index 000000000..813dbee2d --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptModelDecoder.h @@ -0,0 +1,45 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: CloudScript +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabCloudScriptModels.h" +#include "PlayFabCloudScriptModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabCloudScriptModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab CloudScript API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + + /** Decode the ExecuteCloudScriptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + static FCloudScriptExecuteCloudScriptResult decodeExecuteCloudScriptResultResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptModels.h new file mode 100644 index 000000000..794687d78 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptModels.h @@ -0,0 +1,115 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: CloudScript +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabCloudScriptModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab CloudScript API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FCloudScriptExecuteCloudScriptResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Number of PlayFab API requests issued by the CloudScript function */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 APIRequestsIssued = 0; + /** Information about the error, if any, that occurred during execution */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + UPlayFabJsonObject* Error = nullptr; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 ExecutionTimeSeconds = 0; + /** The name of the function that executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + FString FunctionName; + /** The object returned from the CloudScript function, if any */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + UPlayFabJsonObject* FunctionResult = nullptr; + /** + * Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + bool FunctionResultTooLarge = false; + /** Number of external HTTP requests issued by the CloudScript function */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 HttpRequestsIssued = 0; + /** + * Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + TArray Logs; + /** + * Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + bool LogsTooLarge = false; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 MemoryConsumedBytes = 0; + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 ProcessorTimeSeconds = 0; + /** The revision of the CloudScript that executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 Revision = 0; +}; + +USTRUCT(BlueprintType) +struct FCloudScriptExecuteEntityCloudScriptRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + UPlayFabJsonObject* Entity = nullptr; + /** The name of the CloudScript function to execute */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + FString FunctionName; + /** Object that is passed in to the function as the first argument */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + UPlayFabJsonObject* FunctionParameter = nullptr; + /** + * Generate a 'entity_executed_cloudscript' PlayStream event containing the results of the function execution and other + * contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + bool GeneratePlayStreamEvent = false; + /** + * Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' + * executes the current live, published revision, and 'Specific' executes the specified revision. The default value is + * 'Specific', if the SpecificRevision parameter is specified, otherwise it is 'Live'. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + ECloudScriptRevisionOption RevisionSelection; + /** The specific revision to execute, when RevisionSelection is set to 'Specific' */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 SpecificRevision = 0; +}; + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabDataAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabDataAPI.h new file mode 100644 index 000000000..cdd178049 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabDataAPI.h @@ -0,0 +1,192 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Data +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabDataModels.h" +#include "PlayFabDataAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabDataRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabDataAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabDataRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Data API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // File + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAbortFileUploads, FDataAbortFileUploadsResponse, result, UObject*, customData); + + /** Abort pending file uploads to an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* AbortFileUploads(FDataAbortFileUploadsRequest request, + FDelegateOnSuccessAbortFileUploads onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAbortFileUploads(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteFiles, FDataDeleteFilesResponse, result, UObject*, customData); + + /** Delete files on an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* DeleteFiles(FDataDeleteFilesRequest request, + FDelegateOnSuccessDeleteFiles onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteFiles(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessFinalizeFileUploads, FDataFinalizeFileUploadsResponse, result, UObject*, customData); + + /** Finalize file uploads to an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* FinalizeFileUploads(FDataFinalizeFileUploadsRequest request, + FDelegateOnSuccessFinalizeFileUploads onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + void HelperFinalizeFileUploads(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetFiles, FDataGetFilesResponse, result, UObject*, customData); + + /** Retrieves file metadata from an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* GetFiles(FDataGetFilesRequest request, + FDelegateOnSuccessGetFiles onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetFiles(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessInitiateFileUploads, FDataInitiateFileUploadsResponse, result, UObject*, customData); + + /** Initiates file uploads to an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* InitiateFileUploads(FDataInitiateFileUploadsRequest request, + FDelegateOnSuccessInitiateFileUploads onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + void HelperInitiateFileUploads(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Object + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetObjects, FDataGetObjectsResponse, result, UObject*, customData); + + /** Retrieves objects from an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | Object ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* GetObjects(FDataGetObjectsRequest request, + FDelegateOnSuccessGetObjects onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | Object ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetObjects(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetObjects, FDataSetObjectsResponse, result, UObject*, customData); + + /** Sets objects on an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | Object ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* SetObjects(FDataSetObjectsRequest request, + FDelegateOnSuccessSetObjects onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | Object ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetObjects(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessAbortFileUploads OnSuccessAbortFileUploads; + FDelegateOnSuccessDeleteFiles OnSuccessDeleteFiles; + FDelegateOnSuccessFinalizeFileUploads OnSuccessFinalizeFileUploads; + FDelegateOnSuccessGetFiles OnSuccessGetFiles; + FDelegateOnSuccessInitiateFileUploads OnSuccessInitiateFileUploads; + FDelegateOnSuccessGetObjects OnSuccessGetObjects; + FDelegateOnSuccessSetObjects OnSuccessSetObjects; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabDataModelDecoder.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabDataModelDecoder.h new file mode 100644 index 000000000..670913120 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabDataModelDecoder.h @@ -0,0 +1,75 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Data +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabDataModels.h" +#include "PlayFabDataModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabDataModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Data API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // File + ////////////////////////////////////////////////////// + + /** Decode the AbortFileUploadsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File Models") + static FDataAbortFileUploadsResponse decodeAbortFileUploadsResponseResponse(UPlayFabJsonObject* response); + + /** Decode the DeleteFilesResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File Models") + static FDataDeleteFilesResponse decodeDeleteFilesResponseResponse(UPlayFabJsonObject* response); + + /** Decode the FinalizeFileUploadsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File Models") + static FDataFinalizeFileUploadsResponse decodeFinalizeFileUploadsResponseResponse(UPlayFabJsonObject* response); + + /** Decode the GetFilesResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File Models") + static FDataGetFilesResponse decodeGetFilesResponseResponse(UPlayFabJsonObject* response); + + /** Decode the InitiateFileUploadsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File Models") + static FDataInitiateFileUploadsResponse decodeInitiateFileUploadsResponseResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Object + ////////////////////////////////////////////////////// + + /** Decode the GetObjectsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | Object Models") + static FDataGetObjectsResponse decodeGetObjectsResponseResponse(UPlayFabJsonObject* response); + + /** Decode the SetObjectsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | Object Models") + static FDataSetObjectsResponse decodeSetObjectsResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabDataModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabDataModels.h new file mode 100644 index 000000000..1e3025b35 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabDataModels.h @@ -0,0 +1,254 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Data +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabDataModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Data API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// File +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FDataAbortFileUploadsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** Names of the files to have their pending uploads aborted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + FString FileNames; + /** + * The expected version of the profile, if set and doesn't match the current version of the profile the operation will not + * be performed. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataAbortFileUploadsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataDeleteFilesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** Names of the files to be deleted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + FString FileNames; + /** + * The expected version of the profile, if set and doesn't match the current version of the profile the operation will not + * be performed. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataDeleteFilesResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataFinalizeFileUploadsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** Names of the files to be finalized. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + FString FileNames; +}; + +USTRUCT(BlueprintType) +struct FDataFinalizeFileUploadsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** Collection of metadata for the entity's files */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Metadata = nullptr; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataGetFilesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; +}; + +USTRUCT(BlueprintType) +struct FDataGetFilesResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** Collection of metadata for the entity's files */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Metadata = nullptr; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataInitiateFileUploadsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** Names of the files to be set. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + FString FileNames; + /** + * The expected version of the profile, if set and doesn't match the current version of the profile the operation will not + * be performed. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataInitiateFileUploadsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; + /** Collection of file names and upload urls */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + TArray UploadDetails; +}; + + +/////////////////////////////////////////////////////// +// Object +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FDataGetObjectsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + UPlayFabJsonObject* Entity = nullptr; + /** + * Determines whether the object will be returned as an escaped JSON string or as a un-escaped JSON object. Default is JSON + * object. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + bool EscapeObject = false; +}; + +USTRUCT(BlueprintType) +struct FDataGetObjectsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + UPlayFabJsonObject* Entity = nullptr; + /** Requested objects that the calling entity has access to */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + UPlayFabJsonObject* Objects = nullptr; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataSetObjectsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + UPlayFabJsonObject* Entity = nullptr; + /** + * Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from + * GetProfile API, you can ensure that the object set will only be performed if the profile has not been updated by any + * other clients since the version you last loaded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + int32 ExpectedProfileVersion = 0; + /** Collection of objects to set on the profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + TArray Objects; +}; + +USTRUCT(BlueprintType) +struct FDataSetObjectsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** New version of the entity profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + int32 ProfileVersion = 0; + /** New version of the entity profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + TArray SetResults; +}; + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabEnums.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabEnums.h new file mode 100644 index 000000000..a468b1d0c --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabEnums.h @@ -0,0 +1,867 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" +#include +#include "PlayFabJsonObject.h" +#include "PlayFabEnums.generated.h" + +// PlayFab enums start with "pfenum_" in order to avoid code-name conflicts - For JSON, remove that prefix, and send only the expected portion (the display name is not fetchable when compiled) + static const FString prefix = TEXT("pfenum_"); + +template +static FORCEINLINE bool GetEnumValueFromString(const FString& enumTypeName, const FString& input, EnumType& output) +{ + UEnum* enumPtr = FindObject(ANY_PACKAGE, *enumTypeName, true); + if (!enumPtr) + { + output = EnumType(0); + return false; + } + + FString fullInput; + if (!input.StartsWith(*prefix)) + fullInput = prefix + input; + else + fullInput = input; +#if ENGINE_MINOR_VERSION < 16 + output = (EnumType)enumPtr->FindEnumIndex(FName(*fullInput)); +#else + output = (EnumType)enumPtr->GetIndexByName(FName(*fullInput)); +#endif + return true; +} + +template +static FORCEINLINE bool GetEnumValueToString(const FString& enumTypeName, const EnumType& input, FString& output) +{ + const UEnum* enumPtr = FindObject(ANY_PACKAGE, *enumTypeName, true); + if (!enumPtr) + { + output = FString("0"); + return false; + } + +#if ENGINE_MINOR_VERSION < 16 + output = enumPtr->GetEnumName((int32)input); +#else + output = enumPtr->GetNameStringByIndex((int32)input); +#endif + if (output.StartsWith(*prefix)) + output.RemoveAt(0, 7, false); + return true; +} + + +/** AuthTokenType */ + +UENUM(BlueprintType) +enum class EAuthTokenType : uint8 +{ + pfenum_Email UMETA(DisplayName = "Email"), +}; + +/** Conditionals */ + +UENUM(BlueprintType) +enum class EConditionals : uint8 +{ + pfenum_Any UMETA(DisplayName = "Any"), + pfenum_True UMETA(DisplayName = "True"), + pfenum_False UMETA(DisplayName = "False"), +}; + +/** ContinentCode */ + +UENUM(BlueprintType) +enum class EContinentCode : uint8 +{ + pfenum_AF UMETA(DisplayName = "AF"), + pfenum_AN UMETA(DisplayName = "AN"), + pfenum_AS UMETA(DisplayName = "AS"), + pfenum_EU UMETA(DisplayName = "EU"), + pfenum_NA UMETA(DisplayName = "NA"), + pfenum_OC UMETA(DisplayName = "OC"), + pfenum_SA UMETA(DisplayName = "SA"), +}; + +/** CountryCode */ + +UENUM(BlueprintType) +enum class ECountryCode : uint8 +{ + pfenum_AF UMETA(DisplayName = "AF"), + pfenum_AX UMETA(DisplayName = "AX"), + pfenum_AL UMETA(DisplayName = "AL"), + pfenum_DZ UMETA(DisplayName = "DZ"), + pfenum_AS UMETA(DisplayName = "AS"), + pfenum_AD UMETA(DisplayName = "AD"), + pfenum_AO UMETA(DisplayName = "AO"), + pfenum_AI UMETA(DisplayName = "AI"), + pfenum_AQ UMETA(DisplayName = "AQ"), + pfenum_AG UMETA(DisplayName = "AG"), + pfenum_AR UMETA(DisplayName = "AR"), + pfenum_AM UMETA(DisplayName = "AM"), + pfenum_AW UMETA(DisplayName = "AW"), + pfenum_AU UMETA(DisplayName = "AU"), + pfenum_AT UMETA(DisplayName = "AT"), + pfenum_AZ UMETA(DisplayName = "AZ"), + pfenum_BS UMETA(DisplayName = "BS"), + pfenum_BH UMETA(DisplayName = "BH"), + pfenum_BD UMETA(DisplayName = "BD"), + pfenum_BB UMETA(DisplayName = "BB"), + pfenum_BY UMETA(DisplayName = "BY"), + pfenum_BE UMETA(DisplayName = "BE"), + pfenum_BZ UMETA(DisplayName = "BZ"), + pfenum_BJ UMETA(DisplayName = "BJ"), + pfenum_BM UMETA(DisplayName = "BM"), + pfenum_BT UMETA(DisplayName = "BT"), + pfenum_BO UMETA(DisplayName = "BO"), + pfenum_BQ UMETA(DisplayName = "BQ"), + pfenum_BA UMETA(DisplayName = "BA"), + pfenum_BW UMETA(DisplayName = "BW"), + pfenum_BV UMETA(DisplayName = "BV"), + pfenum_BR UMETA(DisplayName = "BR"), + pfenum_IO UMETA(DisplayName = "IO"), + pfenum_BN UMETA(DisplayName = "BN"), + pfenum_BG UMETA(DisplayName = "BG"), + pfenum_BF UMETA(DisplayName = "BF"), + pfenum_BI UMETA(DisplayName = "BI"), + pfenum_KH UMETA(DisplayName = "KH"), + pfenum_CM UMETA(DisplayName = "CM"), + pfenum_CA UMETA(DisplayName = "CA"), + pfenum_CV UMETA(DisplayName = "CV"), + pfenum_KY UMETA(DisplayName = "KY"), + pfenum_CF UMETA(DisplayName = "CF"), + pfenum_TD UMETA(DisplayName = "TD"), + pfenum_CL UMETA(DisplayName = "CL"), + pfenum_CN UMETA(DisplayName = "CN"), + pfenum_CX UMETA(DisplayName = "CX"), + pfenum_CC UMETA(DisplayName = "CC"), + pfenum_CO UMETA(DisplayName = "CO"), + pfenum_KM UMETA(DisplayName = "KM"), + pfenum_CG UMETA(DisplayName = "CG"), + pfenum_CD UMETA(DisplayName = "CD"), + pfenum_CK UMETA(DisplayName = "CK"), + pfenum_CR UMETA(DisplayName = "CR"), + pfenum_CI UMETA(DisplayName = "CI"), + pfenum_HR UMETA(DisplayName = "HR"), + pfenum_CU UMETA(DisplayName = "CU"), + pfenum_CW UMETA(DisplayName = "CW"), + pfenum_CY UMETA(DisplayName = "CY"), + pfenum_CZ UMETA(DisplayName = "CZ"), + pfenum_DK UMETA(DisplayName = "DK"), + pfenum_DJ UMETA(DisplayName = "DJ"), + pfenum_DM UMETA(DisplayName = "DM"), + pfenum_DO UMETA(DisplayName = "DO"), + pfenum_EC UMETA(DisplayName = "EC"), + pfenum_EG UMETA(DisplayName = "EG"), + pfenum_SV UMETA(DisplayName = "SV"), + pfenum_GQ UMETA(DisplayName = "GQ"), + pfenum_ER UMETA(DisplayName = "ER"), + pfenum_EE UMETA(DisplayName = "EE"), + pfenum_ET UMETA(DisplayName = "ET"), + pfenum_FK UMETA(DisplayName = "FK"), + pfenum_FO UMETA(DisplayName = "FO"), + pfenum_FJ UMETA(DisplayName = "FJ"), + pfenum_FI UMETA(DisplayName = "FI"), + pfenum_FR UMETA(DisplayName = "FR"), + pfenum_GF UMETA(DisplayName = "GF"), + pfenum_PF UMETA(DisplayName = "PF"), + pfenum_TF UMETA(DisplayName = "TF"), + pfenum_GA UMETA(DisplayName = "GA"), + pfenum_GM UMETA(DisplayName = "GM"), + pfenum_GE UMETA(DisplayName = "GE"), + pfenum_DE UMETA(DisplayName = "DE"), + pfenum_GH UMETA(DisplayName = "GH"), + pfenum_GI UMETA(DisplayName = "GI"), + pfenum_GR UMETA(DisplayName = "GR"), + pfenum_GL UMETA(DisplayName = "GL"), + pfenum_GD UMETA(DisplayName = "GD"), + pfenum_GP UMETA(DisplayName = "GP"), + pfenum_GU UMETA(DisplayName = "GU"), + pfenum_GT UMETA(DisplayName = "GT"), + pfenum_GG UMETA(DisplayName = "GG"), + pfenum_GN UMETA(DisplayName = "GN"), + pfenum_GW UMETA(DisplayName = "GW"), + pfenum_GY UMETA(DisplayName = "GY"), + pfenum_HT UMETA(DisplayName = "HT"), + pfenum_HM UMETA(DisplayName = "HM"), + pfenum_VA UMETA(DisplayName = "VA"), + pfenum_HN UMETA(DisplayName = "HN"), + pfenum_HK UMETA(DisplayName = "HK"), + pfenum_HU UMETA(DisplayName = "HU"), + pfenum_IS UMETA(DisplayName = "IS"), + pfenum_IN UMETA(DisplayName = "IN"), + pfenum_ID UMETA(DisplayName = "ID"), + pfenum_IR UMETA(DisplayName = "IR"), + pfenum_IQ UMETA(DisplayName = "IQ"), + pfenum_IE UMETA(DisplayName = "IE"), + pfenum_IM UMETA(DisplayName = "IM"), + pfenum_IL UMETA(DisplayName = "IL"), + pfenum_IT UMETA(DisplayName = "IT"), + pfenum_JM UMETA(DisplayName = "JM"), + pfenum_JP UMETA(DisplayName = "JP"), + pfenum_JE UMETA(DisplayName = "JE"), + pfenum_JO UMETA(DisplayName = "JO"), + pfenum_KZ UMETA(DisplayName = "KZ"), + pfenum_KE UMETA(DisplayName = "KE"), + pfenum_KI UMETA(DisplayName = "KI"), + pfenum_KP UMETA(DisplayName = "KP"), + pfenum_KR UMETA(DisplayName = "KR"), + pfenum_KW UMETA(DisplayName = "KW"), + pfenum_KG UMETA(DisplayName = "KG"), + pfenum_LA UMETA(DisplayName = "LA"), + pfenum_LV UMETA(DisplayName = "LV"), + pfenum_LB UMETA(DisplayName = "LB"), + pfenum_LS UMETA(DisplayName = "LS"), + pfenum_LR UMETA(DisplayName = "LR"), + pfenum_LY UMETA(DisplayName = "LY"), + pfenum_LI UMETA(DisplayName = "LI"), + pfenum_LT UMETA(DisplayName = "LT"), + pfenum_LU UMETA(DisplayName = "LU"), + pfenum_MO UMETA(DisplayName = "MO"), + pfenum_MK UMETA(DisplayName = "MK"), + pfenum_MG UMETA(DisplayName = "MG"), + pfenum_MW UMETA(DisplayName = "MW"), + pfenum_MY UMETA(DisplayName = "MY"), + pfenum_MV UMETA(DisplayName = "MV"), + pfenum_ML UMETA(DisplayName = "ML"), + pfenum_MT UMETA(DisplayName = "MT"), + pfenum_MH UMETA(DisplayName = "MH"), + pfenum_MQ UMETA(DisplayName = "MQ"), + pfenum_MR UMETA(DisplayName = "MR"), + pfenum_MU UMETA(DisplayName = "MU"), + pfenum_YT UMETA(DisplayName = "YT"), + pfenum_MX UMETA(DisplayName = "MX"), + pfenum_FM UMETA(DisplayName = "FM"), + pfenum_MD UMETA(DisplayName = "MD"), + pfenum_MC UMETA(DisplayName = "MC"), + pfenum_MN UMETA(DisplayName = "MN"), + pfenum_ME UMETA(DisplayName = "ME"), + pfenum_MS UMETA(DisplayName = "MS"), + pfenum_MA UMETA(DisplayName = "MA"), + pfenum_MZ UMETA(DisplayName = "MZ"), + pfenum_MM UMETA(DisplayName = "MM"), + pfenum_NA UMETA(DisplayName = "NA"), + pfenum_NR UMETA(DisplayName = "NR"), + pfenum_NP UMETA(DisplayName = "NP"), + pfenum_NL UMETA(DisplayName = "NL"), + pfenum_NC UMETA(DisplayName = "NC"), + pfenum_NZ UMETA(DisplayName = "NZ"), + pfenum_NI UMETA(DisplayName = "NI"), + pfenum_NE UMETA(DisplayName = "NE"), + pfenum_NG UMETA(DisplayName = "NG"), + pfenum_NU UMETA(DisplayName = "NU"), + pfenum_NF UMETA(DisplayName = "NF"), + pfenum_MP UMETA(DisplayName = "MP"), + pfenum_NO UMETA(DisplayName = "NO"), + pfenum_OM UMETA(DisplayName = "OM"), + pfenum_PK UMETA(DisplayName = "PK"), + pfenum_PW UMETA(DisplayName = "PW"), + pfenum_PS UMETA(DisplayName = "PS"), + pfenum_PA UMETA(DisplayName = "PA"), + pfenum_PG UMETA(DisplayName = "PG"), + pfenum_PY UMETA(DisplayName = "PY"), + pfenum_PE UMETA(DisplayName = "PE"), + pfenum_PH UMETA(DisplayName = "PH"), + pfenum_PN UMETA(DisplayName = "PN"), + pfenum_PL UMETA(DisplayName = "PL"), + pfenum_PT UMETA(DisplayName = "PT"), + pfenum_PR UMETA(DisplayName = "PR"), + pfenum_QA UMETA(DisplayName = "QA"), + pfenum_RE UMETA(DisplayName = "RE"), + pfenum_RO UMETA(DisplayName = "RO"), + pfenum_RU UMETA(DisplayName = "RU"), + pfenum_RW UMETA(DisplayName = "RW"), + pfenum_BL UMETA(DisplayName = "BL"), + pfenum_SH UMETA(DisplayName = "SH"), + pfenum_KN UMETA(DisplayName = "KN"), + pfenum_LC UMETA(DisplayName = "LC"), + pfenum_MF UMETA(DisplayName = "MF"), + pfenum_PM UMETA(DisplayName = "PM"), + pfenum_VC UMETA(DisplayName = "VC"), + pfenum_WS UMETA(DisplayName = "WS"), + pfenum_SM UMETA(DisplayName = "SM"), + pfenum_ST UMETA(DisplayName = "ST"), + pfenum_SA UMETA(DisplayName = "SA"), + pfenum_SN UMETA(DisplayName = "SN"), + pfenum_RS UMETA(DisplayName = "RS"), + pfenum_SC UMETA(DisplayName = "SC"), + pfenum_SL UMETA(DisplayName = "SL"), + pfenum_SG UMETA(DisplayName = "SG"), + pfenum_SX UMETA(DisplayName = "SX"), + pfenum_SK UMETA(DisplayName = "SK"), + pfenum_SI UMETA(DisplayName = "SI"), + pfenum_SB UMETA(DisplayName = "SB"), + pfenum_SO UMETA(DisplayName = "SO"), + pfenum_ZA UMETA(DisplayName = "ZA"), + pfenum_GS UMETA(DisplayName = "GS"), + pfenum_SS UMETA(DisplayName = "SS"), + pfenum_ES UMETA(DisplayName = "ES"), + pfenum_LK UMETA(DisplayName = "LK"), + pfenum_SD UMETA(DisplayName = "SD"), + pfenum_SR UMETA(DisplayName = "SR"), + pfenum_SJ UMETA(DisplayName = "SJ"), + pfenum_SZ UMETA(DisplayName = "SZ"), + pfenum_SE UMETA(DisplayName = "SE"), + pfenum_CH UMETA(DisplayName = "CH"), + pfenum_SY UMETA(DisplayName = "SY"), + pfenum_TW UMETA(DisplayName = "TW"), + pfenum_TJ UMETA(DisplayName = "TJ"), + pfenum_TZ UMETA(DisplayName = "TZ"), + pfenum_TH UMETA(DisplayName = "TH"), + pfenum_TL UMETA(DisplayName = "TL"), + pfenum_TG UMETA(DisplayName = "TG"), + pfenum_TK UMETA(DisplayName = "TK"), + pfenum_TO UMETA(DisplayName = "TO"), + pfenum_TT UMETA(DisplayName = "TT"), + pfenum_TN UMETA(DisplayName = "TN"), + pfenum_TR UMETA(DisplayName = "TR"), + pfenum_TM UMETA(DisplayName = "TM"), + pfenum_TC UMETA(DisplayName = "TC"), + pfenum_TV UMETA(DisplayName = "TV"), + pfenum_UG UMETA(DisplayName = "UG"), + pfenum_UA UMETA(DisplayName = "UA"), + pfenum_AE UMETA(DisplayName = "AE"), + pfenum_GB UMETA(DisplayName = "GB"), + pfenum_US UMETA(DisplayName = "US"), + pfenum_UM UMETA(DisplayName = "UM"), + pfenum_UY UMETA(DisplayName = "UY"), + pfenum_UZ UMETA(DisplayName = "UZ"), + pfenum_VU UMETA(DisplayName = "VU"), + pfenum_VE UMETA(DisplayName = "VE"), + pfenum_VN UMETA(DisplayName = "VN"), + pfenum_VG UMETA(DisplayName = "VG"), + pfenum_VI UMETA(DisplayName = "VI"), + pfenum_WF UMETA(DisplayName = "WF"), + pfenum_EH UMETA(DisplayName = "EH"), + pfenum_YE UMETA(DisplayName = "YE"), + pfenum_ZM UMETA(DisplayName = "ZM"), + pfenum_ZW UMETA(DisplayName = "ZW"), +}; + +/** Currency */ + +UENUM(BlueprintType) +enum class ECurrency : uint8 +{ + pfenum_AED UMETA(DisplayName = "AED"), + pfenum_AFN UMETA(DisplayName = "AFN"), + pfenum_ALL UMETA(DisplayName = "ALL"), + pfenum_AMD UMETA(DisplayName = "AMD"), + pfenum_ANG UMETA(DisplayName = "ANG"), + pfenum_AOA UMETA(DisplayName = "AOA"), + pfenum_ARS UMETA(DisplayName = "ARS"), + pfenum_AUD UMETA(DisplayName = "AUD"), + pfenum_AWG UMETA(DisplayName = "AWG"), + pfenum_AZN UMETA(DisplayName = "AZN"), + pfenum_BAM UMETA(DisplayName = "BAM"), + pfenum_BBD UMETA(DisplayName = "BBD"), + pfenum_BDT UMETA(DisplayName = "BDT"), + pfenum_BGN UMETA(DisplayName = "BGN"), + pfenum_BHD UMETA(DisplayName = "BHD"), + pfenum_BIF UMETA(DisplayName = "BIF"), + pfenum_BMD UMETA(DisplayName = "BMD"), + pfenum_BND UMETA(DisplayName = "BND"), + pfenum_BOB UMETA(DisplayName = "BOB"), + pfenum_BRL UMETA(DisplayName = "BRL"), + pfenum_BSD UMETA(DisplayName = "BSD"), + pfenum_BTN UMETA(DisplayName = "BTN"), + pfenum_BWP UMETA(DisplayName = "BWP"), + pfenum_BYR UMETA(DisplayName = "BYR"), + pfenum_BZD UMETA(DisplayName = "BZD"), + pfenum_CAD UMETA(DisplayName = "CAD"), + pfenum_CDF UMETA(DisplayName = "CDF"), + pfenum_CHF UMETA(DisplayName = "CHF"), + pfenum_CLP UMETA(DisplayName = "CLP"), + pfenum_CNY UMETA(DisplayName = "CNY"), + pfenum_COP UMETA(DisplayName = "COP"), + pfenum_CRC UMETA(DisplayName = "CRC"), + pfenum_CUC UMETA(DisplayName = "CUC"), + pfenum_CUP UMETA(DisplayName = "CUP"), + pfenum_CVE UMETA(DisplayName = "CVE"), + pfenum_CZK UMETA(DisplayName = "CZK"), + pfenum_DJF UMETA(DisplayName = "DJF"), + pfenum_DKK UMETA(DisplayName = "DKK"), + pfenum_DOP UMETA(DisplayName = "DOP"), + pfenum_DZD UMETA(DisplayName = "DZD"), + pfenum_EGP UMETA(DisplayName = "EGP"), + pfenum_ERN UMETA(DisplayName = "ERN"), + pfenum_ETB UMETA(DisplayName = "ETB"), + pfenum_EUR UMETA(DisplayName = "EUR"), + pfenum_FJD UMETA(DisplayName = "FJD"), + pfenum_FKP UMETA(DisplayName = "FKP"), + pfenum_GBP UMETA(DisplayName = "GBP"), + pfenum_GEL UMETA(DisplayName = "GEL"), + pfenum_GGP UMETA(DisplayName = "GGP"), + pfenum_GHS UMETA(DisplayName = "GHS"), + pfenum_GIP UMETA(DisplayName = "GIP"), + pfenum_GMD UMETA(DisplayName = "GMD"), + pfenum_GNF UMETA(DisplayName = "GNF"), + pfenum_GTQ UMETA(DisplayName = "GTQ"), + pfenum_GYD UMETA(DisplayName = "GYD"), + pfenum_HKD UMETA(DisplayName = "HKD"), + pfenum_HNL UMETA(DisplayName = "HNL"), + pfenum_HRK UMETA(DisplayName = "HRK"), + pfenum_HTG UMETA(DisplayName = "HTG"), + pfenum_HUF UMETA(DisplayName = "HUF"), + pfenum_IDR UMETA(DisplayName = "IDR"), + pfenum_ILS UMETA(DisplayName = "ILS"), + pfenum_IMP UMETA(DisplayName = "IMP"), + pfenum_INR UMETA(DisplayName = "INR"), + pfenum_IQD UMETA(DisplayName = "IQD"), + pfenum_IRR UMETA(DisplayName = "IRR"), + pfenum_ISK UMETA(DisplayName = "ISK"), + pfenum_JEP UMETA(DisplayName = "JEP"), + pfenum_JMD UMETA(DisplayName = "JMD"), + pfenum_JOD UMETA(DisplayName = "JOD"), + pfenum_JPY UMETA(DisplayName = "JPY"), + pfenum_KES UMETA(DisplayName = "KES"), + pfenum_KGS UMETA(DisplayName = "KGS"), + pfenum_KHR UMETA(DisplayName = "KHR"), + pfenum_KMF UMETA(DisplayName = "KMF"), + pfenum_KPW UMETA(DisplayName = "KPW"), + pfenum_KRW UMETA(DisplayName = "KRW"), + pfenum_KWD UMETA(DisplayName = "KWD"), + pfenum_KYD UMETA(DisplayName = "KYD"), + pfenum_KZT UMETA(DisplayName = "KZT"), + pfenum_LAK UMETA(DisplayName = "LAK"), + pfenum_LBP UMETA(DisplayName = "LBP"), + pfenum_LKR UMETA(DisplayName = "LKR"), + pfenum_LRD UMETA(DisplayName = "LRD"), + pfenum_LSL UMETA(DisplayName = "LSL"), + pfenum_LYD UMETA(DisplayName = "LYD"), + pfenum_MAD UMETA(DisplayName = "MAD"), + pfenum_MDL UMETA(DisplayName = "MDL"), + pfenum_MGA UMETA(DisplayName = "MGA"), + pfenum_MKD UMETA(DisplayName = "MKD"), + pfenum_MMK UMETA(DisplayName = "MMK"), + pfenum_MNT UMETA(DisplayName = "MNT"), + pfenum_MOP UMETA(DisplayName = "MOP"), + pfenum_MRO UMETA(DisplayName = "MRO"), + pfenum_MUR UMETA(DisplayName = "MUR"), + pfenum_MVR UMETA(DisplayName = "MVR"), + pfenum_MWK UMETA(DisplayName = "MWK"), + pfenum_MXN UMETA(DisplayName = "MXN"), + pfenum_MYR UMETA(DisplayName = "MYR"), + pfenum_MZN UMETA(DisplayName = "MZN"), + pfenum_NAD UMETA(DisplayName = "NAD"), + pfenum_NGN UMETA(DisplayName = "NGN"), + pfenum_NIO UMETA(DisplayName = "NIO"), + pfenum_NOK UMETA(DisplayName = "NOK"), + pfenum_NPR UMETA(DisplayName = "NPR"), + pfenum_NZD UMETA(DisplayName = "NZD"), + pfenum_OMR UMETA(DisplayName = "OMR"), + pfenum_PAB UMETA(DisplayName = "PAB"), + pfenum_PEN UMETA(DisplayName = "PEN"), + pfenum_PGK UMETA(DisplayName = "PGK"), + pfenum_PHP UMETA(DisplayName = "PHP"), + pfenum_PKR UMETA(DisplayName = "PKR"), + pfenum_PLN UMETA(DisplayName = "PLN"), + pfenum_PYG UMETA(DisplayName = "PYG"), + pfenum_QAR UMETA(DisplayName = "QAR"), + pfenum_RON UMETA(DisplayName = "RON"), + pfenum_RSD UMETA(DisplayName = "RSD"), + pfenum_RUB UMETA(DisplayName = "RUB"), + pfenum_RWF UMETA(DisplayName = "RWF"), + pfenum_SAR UMETA(DisplayName = "SAR"), + pfenum_SBD UMETA(DisplayName = "SBD"), + pfenum_SCR UMETA(DisplayName = "SCR"), + pfenum_SDG UMETA(DisplayName = "SDG"), + pfenum_SEK UMETA(DisplayName = "SEK"), + pfenum_SGD UMETA(DisplayName = "SGD"), + pfenum_SHP UMETA(DisplayName = "SHP"), + pfenum_SLL UMETA(DisplayName = "SLL"), + pfenum_SOS UMETA(DisplayName = "SOS"), + pfenum_SPL UMETA(DisplayName = "SPL"), + pfenum_SRD UMETA(DisplayName = "SRD"), + pfenum_STD UMETA(DisplayName = "STD"), + pfenum_SVC UMETA(DisplayName = "SVC"), + pfenum_SYP UMETA(DisplayName = "SYP"), + pfenum_SZL UMETA(DisplayName = "SZL"), + pfenum_THB UMETA(DisplayName = "THB"), + pfenum_TJS UMETA(DisplayName = "TJS"), + pfenum_TMT UMETA(DisplayName = "TMT"), + pfenum_TND UMETA(DisplayName = "TND"), + pfenum_TOP UMETA(DisplayName = "TOP"), + pfenum_TRY UMETA(DisplayName = "TRY"), + pfenum_TTD UMETA(DisplayName = "TTD"), + pfenum_TVD UMETA(DisplayName = "TVD"), + pfenum_TWD UMETA(DisplayName = "TWD"), + pfenum_TZS UMETA(DisplayName = "TZS"), + pfenum_UAH UMETA(DisplayName = "UAH"), + pfenum_UGX UMETA(DisplayName = "UGX"), + pfenum_USD UMETA(DisplayName = "USD"), + pfenum_UYU UMETA(DisplayName = "UYU"), + pfenum_UZS UMETA(DisplayName = "UZS"), + pfenum_VEF UMETA(DisplayName = "VEF"), + pfenum_VND UMETA(DisplayName = "VND"), + pfenum_VUV UMETA(DisplayName = "VUV"), + pfenum_WST UMETA(DisplayName = "WST"), + pfenum_XAF UMETA(DisplayName = "XAF"), + pfenum_XCD UMETA(DisplayName = "XCD"), + pfenum_XDR UMETA(DisplayName = "XDR"), + pfenum_XOF UMETA(DisplayName = "XOF"), + pfenum_XPF UMETA(DisplayName = "XPF"), + pfenum_YER UMETA(DisplayName = "YER"), + pfenum_ZAR UMETA(DisplayName = "ZAR"), + pfenum_ZMW UMETA(DisplayName = "ZMW"), + pfenum_ZWD UMETA(DisplayName = "ZWD"), +}; + +/** EffectType */ + +UENUM(BlueprintType) +enum class EEffectType : uint8 +{ + pfenum_Allow UMETA(DisplayName = "Allow"), + pfenum_Deny UMETA(DisplayName = "Deny"), +}; + +/** EmailVerificationStatus */ + +UENUM(BlueprintType) +enum class EEmailVerificationStatus : uint8 +{ + pfenum_Unverified UMETA(DisplayName = "Unverified"), + pfenum_Pending UMETA(DisplayName = "Pending"), + pfenum_Confirmed UMETA(DisplayName = "Confirmed"), +}; + +/** GameBuildStatus */ + +UENUM(BlueprintType) +enum class EGameBuildStatus : uint8 +{ + pfenum_Available UMETA(DisplayName = "Available"), + pfenum_Validating UMETA(DisplayName = "Validating"), + pfenum_InvalidBuildPackage UMETA(DisplayName = "InvalidBuildPackage"), + pfenum_Processing UMETA(DisplayName = "Processing"), + pfenum_FailedToProcess UMETA(DisplayName = "FailedToProcess"), +}; + +/** LoginIdentityProvider */ + +UENUM(BlueprintType) +enum class ELoginIdentityProvider : uint8 +{ + pfenum_Unknown UMETA(DisplayName = "Unknown"), + pfenum_PlayFab UMETA(DisplayName = "PlayFab"), + pfenum_Custom UMETA(DisplayName = "Custom"), + pfenum_GameCenter UMETA(DisplayName = "GameCenter"), + pfenum_GooglePlay UMETA(DisplayName = "GooglePlay"), + pfenum_Steam UMETA(DisplayName = "Steam"), + pfenum_XBoxLive UMETA(DisplayName = "XBoxLive"), + pfenum_PSN UMETA(DisplayName = "PSN"), + pfenum_Kongregate UMETA(DisplayName = "Kongregate"), + pfenum_Facebook UMETA(DisplayName = "Facebook"), + pfenum_IOSDevice UMETA(DisplayName = "IOSDevice"), + pfenum_AndroidDevice UMETA(DisplayName = "AndroidDevice"), + pfenum_Twitch UMETA(DisplayName = "Twitch"), + pfenum_WindowsHello UMETA(DisplayName = "WindowsHello"), + pfenum_GameServer UMETA(DisplayName = "GameServer"), + pfenum_CustomServer UMETA(DisplayName = "CustomServer"), + pfenum_NintendoSwitch UMETA(DisplayName = "NintendoSwitch"), + pfenum_FacebookInstantGames UMETA(DisplayName = "FacebookInstantGames"), + pfenum_OpenIdConnect UMETA(DisplayName = "OpenIdConnect"), +}; + +/** PushNotificationPlatform */ + +UENUM(BlueprintType) +enum class EPushNotificationPlatform : uint8 +{ + pfenum_ApplePushNotificationService UMETA(DisplayName = "ApplePushNotificationService"), + pfenum_GoogleCloudMessaging UMETA(DisplayName = "GoogleCloudMessaging"), +}; + +/** PushSetupPlatform */ + +UENUM(BlueprintType) +enum class EPushSetupPlatform : uint8 +{ + pfenum_GCM UMETA(DisplayName = "GCM"), + pfenum_APNS UMETA(DisplayName = "APNS"), + pfenum_APNS_SANDBOX UMETA(DisplayName = "APNS_SANDBOX"), +}; + +/** Region */ + +UENUM(BlueprintType) +enum class ERegion : uint8 +{ + pfenum_USCentral UMETA(DisplayName = "USCentral"), + pfenum_USEast UMETA(DisplayName = "USEast"), + pfenum_EUWest UMETA(DisplayName = "EUWest"), + pfenum_Singapore UMETA(DisplayName = "Singapore"), + pfenum_Japan UMETA(DisplayName = "Japan"), + pfenum_Brazil UMETA(DisplayName = "Brazil"), + pfenum_Australia UMETA(DisplayName = "Australia"), +}; + +/** ResolutionOutcome */ + +UENUM(BlueprintType) +enum class EResolutionOutcome : uint8 +{ + pfenum_Revoke UMETA(DisplayName = "Revoke"), + pfenum_Reinstate UMETA(DisplayName = "Reinstate"), + pfenum_Manual UMETA(DisplayName = "Manual"), +}; + +/** ResultTableNodeType */ + +UENUM(BlueprintType) +enum class EResultTableNodeType : uint8 +{ + pfenum_ItemId UMETA(DisplayName = "ItemId"), + pfenum_TableId UMETA(DisplayName = "TableId"), +}; + +/** ScheduledTaskType */ + +UENUM(BlueprintType) +enum class EScheduledTaskType : uint8 +{ + pfenum_CloudScript UMETA(DisplayName = "CloudScript"), + pfenum_ActionsOnPlayerSegment UMETA(DisplayName = "ActionsOnPlayerSegment"), +}; + +/** SourceType */ + +UENUM(BlueprintType) +enum class EPfSourceType : uint8 +{ + pfenum_Admin UMETA(DisplayName = "Admin"), + pfenum_BackEnd UMETA(DisplayName = "BackEnd"), + pfenum_GameClient UMETA(DisplayName = "GameClient"), + pfenum_GameServer UMETA(DisplayName = "GameServer"), + pfenum_Partner UMETA(DisplayName = "Partner"), + pfenum_Custom UMETA(DisplayName = "Custom"), + pfenum_API UMETA(DisplayName = "API"), +}; + +/** StatisticAggregationMethod */ + +UENUM(BlueprintType) +enum class EStatisticAggregationMethod : uint8 +{ + pfenum_Last UMETA(DisplayName = "Last"), + pfenum_Min UMETA(DisplayName = "Min"), + pfenum_Max UMETA(DisplayName = "Max"), + pfenum_Sum UMETA(DisplayName = "Sum"), +}; + +/** StatisticResetIntervalOption */ + +UENUM(BlueprintType) +enum class EStatisticResetIntervalOption : uint8 +{ + pfenum_Never UMETA(DisplayName = "Never"), + pfenum_Hour UMETA(DisplayName = "Hour"), + pfenum_Day UMETA(DisplayName = "Day"), + pfenum_Week UMETA(DisplayName = "Week"), + pfenum_Month UMETA(DisplayName = "Month"), +}; + +/** StatisticVersionArchivalStatus */ + +UENUM(BlueprintType) +enum class EStatisticVersionArchivalStatus : uint8 +{ + pfenum_NotScheduled UMETA(DisplayName = "NotScheduled"), + pfenum_Scheduled UMETA(DisplayName = "Scheduled"), + pfenum_Queued UMETA(DisplayName = "Queued"), + pfenum_InProgress UMETA(DisplayName = "InProgress"), + pfenum_Complete UMETA(DisplayName = "Complete"), +}; + +/** StatisticVersionStatus */ + +UENUM(BlueprintType) +enum class EStatisticVersionStatus : uint8 +{ + pfenum_Active UMETA(DisplayName = "Active"), + pfenum_SnapshotPending UMETA(DisplayName = "SnapshotPending"), + pfenum_Snapshot UMETA(DisplayName = "Snapshot"), + pfenum_ArchivalPending UMETA(DisplayName = "ArchivalPending"), + pfenum_Archived UMETA(DisplayName = "Archived"), +}; + +/** SubscriptionProviderStatus */ + +UENUM(BlueprintType) +enum class ESubscriptionProviderStatus : uint8 +{ + pfenum_NoError UMETA(DisplayName = "NoError"), + pfenum_Cancelled UMETA(DisplayName = "Cancelled"), + pfenum_UnknownError UMETA(DisplayName = "UnknownError"), + pfenum_BillingError UMETA(DisplayName = "BillingError"), + pfenum_ProductUnavailable UMETA(DisplayName = "ProductUnavailable"), + pfenum_CustomerDidNotAcceptPriceChange UMETA(DisplayName = "CustomerDidNotAcceptPriceChange"), + pfenum_FreeTrial UMETA(DisplayName = "FreeTrial"), + pfenum_PaymentPending UMETA(DisplayName = "PaymentPending"), +}; + +/** TaskInstanceStatus */ + +UENUM(BlueprintType) +enum class ETaskInstanceStatus : uint8 +{ + pfenum_Succeeded UMETA(DisplayName = "Succeeded"), + pfenum_Starting UMETA(DisplayName = "Starting"), + pfenum_InProgress UMETA(DisplayName = "InProgress"), + pfenum_Failed UMETA(DisplayName = "Failed"), + pfenum_Aborted UMETA(DisplayName = "Aborted"), + pfenum_Pending UMETA(DisplayName = "Pending"), +}; + +/** TitleActivationStatus */ + +UENUM(BlueprintType) +enum class ETitleActivationStatus : uint8 +{ + pfenum_None UMETA(DisplayName = "None"), + pfenum_ActivatedTitleKey UMETA(DisplayName = "ActivatedTitleKey"), + pfenum_PendingSteam UMETA(DisplayName = "PendingSteam"), + pfenum_ActivatedSteam UMETA(DisplayName = "ActivatedSteam"), + pfenum_RevokedSteam UMETA(DisplayName = "RevokedSteam"), +}; + +/** UserDataPermission */ + +UENUM(BlueprintType) +enum class EUserDataPermission : uint8 +{ + pfenum_Private UMETA(DisplayName = "Private"), + pfenum_Public UMETA(DisplayName = "Public"), +}; + +/** UserOrigination */ + +UENUM(BlueprintType) +enum class EUserOrigination : uint8 +{ + pfenum_Organic UMETA(DisplayName = "Organic"), + pfenum_Steam UMETA(DisplayName = "Steam"), + pfenum_Google UMETA(DisplayName = "Google"), + pfenum_Amazon UMETA(DisplayName = "Amazon"), + pfenum_Facebook UMETA(DisplayName = "Facebook"), + pfenum_Kongregate UMETA(DisplayName = "Kongregate"), + pfenum_GamersFirst UMETA(DisplayName = "GamersFirst"), + pfenum_Unknown UMETA(DisplayName = "Unknown"), + pfenum_IOS UMETA(DisplayName = "IOS"), + pfenum_LoadTest UMETA(DisplayName = "LoadTest"), + pfenum_Android UMETA(DisplayName = "Android"), + pfenum_PSN UMETA(DisplayName = "PSN"), + pfenum_GameCenter UMETA(DisplayName = "GameCenter"), + pfenum_CustomId UMETA(DisplayName = "CustomId"), + pfenum_XboxLive UMETA(DisplayName = "XboxLive"), + pfenum_Parse UMETA(DisplayName = "Parse"), + pfenum_Twitch UMETA(DisplayName = "Twitch"), + pfenum_WindowsHello UMETA(DisplayName = "WindowsHello"), + pfenum_ServerCustomId UMETA(DisplayName = "ServerCustomId"), + pfenum_NintendoSwitchDeviceId UMETA(DisplayName = "NintendoSwitchDeviceId"), + pfenum_FacebookInstantGamesId UMETA(DisplayName = "FacebookInstantGamesId"), + pfenum_OpenIdConnect UMETA(DisplayName = "OpenIdConnect"), +}; + +/** CloudScriptRevisionOption */ + +UENUM(BlueprintType) +enum class ECloudScriptRevisionOption : uint8 +{ + pfenum_Live UMETA(DisplayName = "Live"), + pfenum_Latest UMETA(DisplayName = "Latest"), + pfenum_Specific UMETA(DisplayName = "Specific"), +}; + +/** GameInstanceState */ + +UENUM(BlueprintType) +enum class EGameInstanceState : uint8 +{ + pfenum_Open UMETA(DisplayName = "Open"), + pfenum_Closed UMETA(DisplayName = "Closed"), +}; + +/** MatchmakeStatus */ + +UENUM(BlueprintType) +enum class EMatchmakeStatus : uint8 +{ + pfenum_Complete UMETA(DisplayName = "Complete"), + pfenum_Waiting UMETA(DisplayName = "Waiting"), + pfenum_GameNotFound UMETA(DisplayName = "GameNotFound"), + pfenum_NoAvailableSlots UMETA(DisplayName = "NoAvailableSlots"), + pfenum_SessionClosed UMETA(DisplayName = "SessionClosed"), +}; + +/** TradeStatus */ + +UENUM(BlueprintType) +enum class ETradeStatus : uint8 +{ + pfenum_Invalid UMETA(DisplayName = "Invalid"), + pfenum_Opening UMETA(DisplayName = "Opening"), + pfenum_Open UMETA(DisplayName = "Open"), + pfenum_Accepting UMETA(DisplayName = "Accepting"), + pfenum_Accepted UMETA(DisplayName = "Accepted"), + pfenum_Filled UMETA(DisplayName = "Filled"), + pfenum_Cancelled UMETA(DisplayName = "Cancelled"), +}; + +/** TransactionStatus */ + +UENUM(BlueprintType) +enum class ETransactionStatus : uint8 +{ + pfenum_CreateCart UMETA(DisplayName = "CreateCart"), + pfenum_Init UMETA(DisplayName = "Init"), + pfenum_Approved UMETA(DisplayName = "Approved"), + pfenum_Succeeded UMETA(DisplayName = "Succeeded"), + pfenum_FailedByProvider UMETA(DisplayName = "FailedByProvider"), + pfenum_DisputePending UMETA(DisplayName = "DisputePending"), + pfenum_RefundPending UMETA(DisplayName = "RefundPending"), + pfenum_Refunded UMETA(DisplayName = "Refunded"), + pfenum_RefundFailed UMETA(DisplayName = "RefundFailed"), + pfenum_ChargedBack UMETA(DisplayName = "ChargedBack"), + pfenum_FailedByUber UMETA(DisplayName = "FailedByUber"), + pfenum_FailedByPlayFab UMETA(DisplayName = "FailedByPlayFab"), + pfenum_Revoked UMETA(DisplayName = "Revoked"), + pfenum_TradePending UMETA(DisplayName = "TradePending"), + pfenum_Traded UMETA(DisplayName = "Traded"), + pfenum_Upgraded UMETA(DisplayName = "Upgraded"), + pfenum_StackPending UMETA(DisplayName = "StackPending"), + pfenum_Stacked UMETA(DisplayName = "Stacked"), + pfenum_Other UMETA(DisplayName = "Other"), + pfenum_Failed UMETA(DisplayName = "Failed"), +}; + +/** PlayerConnectionState */ + +UENUM(BlueprintType) +enum class EPlayerConnectionState : uint8 +{ + pfenum_Unassigned UMETA(DisplayName = "Unassigned"), + pfenum_Connecting UMETA(DisplayName = "Connecting"), + pfenum_Participating UMETA(DisplayName = "Participating"), + pfenum_Participated UMETA(DisplayName = "Participated"), +}; + +/** OperationTypes */ + +UENUM(BlueprintType) +enum class EOperationTypes : uint8 +{ + pfenum_Created UMETA(DisplayName = "Created"), + pfenum_Updated UMETA(DisplayName = "Updated"), + pfenum_Deleted UMETA(DisplayName = "Deleted"), + pfenum_None UMETA(DisplayName = "None"), +}; + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabEventsAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabEventsAPI.h new file mode 100644 index 000000000..c3e5a9375 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabEventsAPI.h @@ -0,0 +1,104 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Events +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabEventsModels.h" +#include "PlayFabEventsAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabEventsRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabEventsAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabEventsRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Events API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // PlayStream Events + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWriteEvents, FEventsWriteEventsResponse, result, UObject*, customData); + + /** Write batches of entity based events to PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Events | PlayStream Events ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabEventsAPI* WriteEvents(FEventsWriteEventsRequest request, + FDelegateOnSuccessWriteEvents onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabEventsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Events | PlayStream Events ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWriteEvents(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessWriteEvents OnSuccessWriteEvents; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabEventsModelDecoder.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabEventsModelDecoder.h new file mode 100644 index 000000000..1ce385ff3 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabEventsModelDecoder.h @@ -0,0 +1,45 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Events +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabEventsModels.h" +#include "PlayFabEventsModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabEventsModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Events API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // PlayStream Events + ////////////////////////////////////////////////////// + + /** Decode the WriteEventsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Events | PlayStream Events Models") + static FEventsWriteEventsResponse decodeWriteEventsResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabEventsModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabEventsModels.h new file mode 100644 index 000000000..5d356cc10 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabEventsModels.h @@ -0,0 +1,53 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Events +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabEventsModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Events API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// PlayStream Events +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FEventsWriteEventsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Collection of events to write to PlayStream. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Events | PlayStream Events Models") + TArray Events; +}; + +USTRUCT(BlueprintType) +struct FEventsWriteEventsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The unique identifiers assigned by the server to the events, in the same order as the events in the request. Only + * returned if FlushToPlayStream option is true. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Events | PlayStream Events Models") + FString AssignedEventIds; +}; + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabGroupsAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabGroupsAPI.h new file mode 100644 index 000000000..14864e5f2 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabGroupsAPI.h @@ -0,0 +1,440 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Groups +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabGroupsModels.h" +#include "PlayFabGroupsAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabGroupsRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabGroupsAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabGroupsRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Groups API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Groups + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAcceptGroupApplication, FGroupsEmptyResponse, result, UObject*, customData); + + /** Accepts an outstanding invitation to to join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* AcceptGroupApplication(FGroupsAcceptGroupApplicationRequest request, + FDelegateOnSuccessAcceptGroupApplication onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAcceptGroupApplication(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAcceptGroupInvitation, FGroupsEmptyResponse, result, UObject*, customData); + + /** Accepts an invitation to join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* AcceptGroupInvitation(FGroupsAcceptGroupInvitationRequest request, + FDelegateOnSuccessAcceptGroupInvitation onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAcceptGroupInvitation(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddMembers, FGroupsEmptyResponse, result, UObject*, customData); + + /** Adds members to a group or role. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* AddMembers(FGroupsAddMembersRequest request, + FDelegateOnSuccessAddMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessApplyToGroup, FGroupsApplyToGroupResponse, result, UObject*, customData); + + /** Applies to join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ApplyToGroup(FGroupsApplyToGroupRequest request, + FDelegateOnSuccessApplyToGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperApplyToGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessBlockEntity, FGroupsEmptyResponse, result, UObject*, customData); + + /** Blocks a list of entities from joining a group. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* BlockEntity(FGroupsBlockEntityRequest request, + FDelegateOnSuccessBlockEntity onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperBlockEntity(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessChangeMemberRole, FGroupsEmptyResponse, result, UObject*, customData); + + /** Changes the role membership of a list of entities from one role to another. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ChangeMemberRole(FGroupsChangeMemberRoleRequest request, + FDelegateOnSuccessChangeMemberRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperChangeMemberRole(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreateGroup, FGroupsCreateGroupResponse, result, UObject*, customData); + + /** Creates a new group. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* CreateGroup(FGroupsCreateGroupRequest request, + FDelegateOnSuccessCreateGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreateGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreateRole, FGroupsCreateGroupRoleResponse, result, UObject*, customData); + + /** Creates a new group role. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* CreateRole(FGroupsCreateGroupRoleRequest request, + FDelegateOnSuccessCreateRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreateRole(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteGroup, FGroupsEmptyResponse, result, UObject*, customData); + + /** Deletes a group and all roles, invitations, join requests, and blocks associated with it. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* DeleteGroup(FGroupsDeleteGroupRequest request, + FDelegateOnSuccessDeleteGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteRole, FGroupsEmptyResponse, result, UObject*, customData); + + /** Deletes an existing role in a group. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* DeleteRole(FGroupsDeleteRoleRequest request, + FDelegateOnSuccessDeleteRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteRole(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetGroup, FGroupsGetGroupResponse, result, UObject*, customData); + + /** Gets information about a group and its roles */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* GetGroup(FGroupsGetGroupRequest request, + FDelegateOnSuccessGetGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessInviteToGroup, FGroupsInviteToGroupResponse, result, UObject*, customData); + + /** Invites a player to join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* InviteToGroup(FGroupsInviteToGroupRequest request, + FDelegateOnSuccessInviteToGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperInviteToGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessIsMember, FGroupsIsMemberResponse, result, UObject*, customData); + + /** Checks to see if an entity is a member of a group or role within the group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* IsMember(FGroupsIsMemberRequest request, + FDelegateOnSuccessIsMember onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperIsMember(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListGroupApplications, FGroupsListGroupApplicationsResponse, result, UObject*, customData); + + /** Lists all outstanding requests to join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ListGroupApplications(FGroupsListGroupApplicationsRequest request, + FDelegateOnSuccessListGroupApplications onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListGroupApplications(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListGroupBlocks, FGroupsListGroupBlocksResponse, result, UObject*, customData); + + /** Lists all entities blocked from joining a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ListGroupBlocks(FGroupsListGroupBlocksRequest request, + FDelegateOnSuccessListGroupBlocks onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListGroupBlocks(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListGroupInvitations, FGroupsListGroupInvitationsResponse, result, UObject*, customData); + + /** Lists all outstanding invitations for a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ListGroupInvitations(FGroupsListGroupInvitationsRequest request, + FDelegateOnSuccessListGroupInvitations onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListGroupInvitations(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListGroupMembers, FGroupsListGroupMembersResponse, result, UObject*, customData); + + /** Lists all members for a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ListGroupMembers(FGroupsListGroupMembersRequest request, + FDelegateOnSuccessListGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListMembership, FGroupsListMembershipResponse, result, UObject*, customData); + + /** Lists all groups and roles for an entity */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ListMembership(FGroupsListMembershipRequest request, + FDelegateOnSuccessListMembership onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListMembership(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListMembershipOpportunities, FGroupsListMembershipOpportunitiesResponse, result, UObject*, customData); + + /** Lists all outstanding invitations and group applications for an entity */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ListMembershipOpportunities(FGroupsListMembershipOpportunitiesRequest request, + FDelegateOnSuccessListMembershipOpportunities onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListMembershipOpportunities(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveGroupApplication, FGroupsEmptyResponse, result, UObject*, customData); + + /** Removes an application to join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* RemoveGroupApplication(FGroupsRemoveGroupApplicationRequest request, + FDelegateOnSuccessRemoveGroupApplication onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveGroupApplication(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveGroupInvitation, FGroupsEmptyResponse, result, UObject*, customData); + + /** Removes an invitation join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* RemoveGroupInvitation(FGroupsRemoveGroupInvitationRequest request, + FDelegateOnSuccessRemoveGroupInvitation onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveGroupInvitation(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveMembers, FGroupsEmptyResponse, result, UObject*, customData); + + /** Removes members from a group. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* RemoveMembers(FGroupsRemoveMembersRequest request, + FDelegateOnSuccessRemoveMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnblockEntity, FGroupsEmptyResponse, result, UObject*, customData); + + /** Unblocks a list of entities from joining a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* UnblockEntity(FGroupsUnblockEntityRequest request, + FDelegateOnSuccessUnblockEntity onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnblockEntity(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateGroup, FGroupsUpdateGroupResponse, result, UObject*, customData); + + /** Updates non-membership data about a group. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* UpdateGroup(FGroupsUpdateGroupRequest request, + FDelegateOnSuccessUpdateGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateRole, FGroupsUpdateGroupRoleResponse, result, UObject*, customData); + + /** Updates metadata about a role. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* UpdateRole(FGroupsUpdateGroupRoleRequest request, + FDelegateOnSuccessUpdateRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateRole(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessAcceptGroupApplication OnSuccessAcceptGroupApplication; + FDelegateOnSuccessAcceptGroupInvitation OnSuccessAcceptGroupInvitation; + FDelegateOnSuccessAddMembers OnSuccessAddMembers; + FDelegateOnSuccessApplyToGroup OnSuccessApplyToGroup; + FDelegateOnSuccessBlockEntity OnSuccessBlockEntity; + FDelegateOnSuccessChangeMemberRole OnSuccessChangeMemberRole; + FDelegateOnSuccessCreateGroup OnSuccessCreateGroup; + FDelegateOnSuccessCreateRole OnSuccessCreateRole; + FDelegateOnSuccessDeleteGroup OnSuccessDeleteGroup; + FDelegateOnSuccessDeleteRole OnSuccessDeleteRole; + FDelegateOnSuccessGetGroup OnSuccessGetGroup; + FDelegateOnSuccessInviteToGroup OnSuccessInviteToGroup; + FDelegateOnSuccessIsMember OnSuccessIsMember; + FDelegateOnSuccessListGroupApplications OnSuccessListGroupApplications; + FDelegateOnSuccessListGroupBlocks OnSuccessListGroupBlocks; + FDelegateOnSuccessListGroupInvitations OnSuccessListGroupInvitations; + FDelegateOnSuccessListGroupMembers OnSuccessListGroupMembers; + FDelegateOnSuccessListMembership OnSuccessListMembership; + FDelegateOnSuccessListMembershipOpportunities OnSuccessListMembershipOpportunities; + FDelegateOnSuccessRemoveGroupApplication OnSuccessRemoveGroupApplication; + FDelegateOnSuccessRemoveGroupInvitation OnSuccessRemoveGroupInvitation; + FDelegateOnSuccessRemoveMembers OnSuccessRemoveMembers; + FDelegateOnSuccessUnblockEntity OnSuccessUnblockEntity; + FDelegateOnSuccessUpdateGroup OnSuccessUpdateGroup; + FDelegateOnSuccessUpdateRole OnSuccessUpdateRole; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabGroupsModelDecoder.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabGroupsModelDecoder.h new file mode 100644 index 000000000..c42762b32 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabGroupsModelDecoder.h @@ -0,0 +1,101 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Groups +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabGroupsModels.h" +#include "PlayFabGroupsModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabGroupsModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Groups API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Groups + ////////////////////////////////////////////////////// + + /** Decode the EmptyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsEmptyResponse decodeEmptyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ApplyToGroupResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsApplyToGroupResponse decodeApplyToGroupResponseResponse(UPlayFabJsonObject* response); + + /** Decode the CreateGroupResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsCreateGroupResponse decodeCreateGroupResponseResponse(UPlayFabJsonObject* response); + + /** Decode the CreateGroupRoleResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsCreateGroupRoleResponse decodeCreateGroupRoleResponseResponse(UPlayFabJsonObject* response); + + /** Decode the GetGroupResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsGetGroupResponse decodeGetGroupResponseResponse(UPlayFabJsonObject* response); + + /** Decode the InviteToGroupResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsInviteToGroupResponse decodeInviteToGroupResponseResponse(UPlayFabJsonObject* response); + + /** Decode the IsMemberResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsIsMemberResponse decodeIsMemberResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ListGroupApplicationsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsListGroupApplicationsResponse decodeListGroupApplicationsResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ListGroupBlocksResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsListGroupBlocksResponse decodeListGroupBlocksResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ListGroupInvitationsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsListGroupInvitationsResponse decodeListGroupInvitationsResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ListGroupMembersResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsListGroupMembersResponse decodeListGroupMembersResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ListMembershipResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsListMembershipResponse decodeListMembershipResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ListMembershipOpportunitiesResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsListMembershipOpportunitiesResponse decodeListMembershipOpportunitiesResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateGroupResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsUpdateGroupResponse decodeUpdateGroupResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateGroupRoleResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsUpdateGroupRoleResponse decodeUpdateGroupRoleResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabGroupsModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabGroupsModels.h new file mode 100644 index 000000000..ade743bce --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabGroupsModels.h @@ -0,0 +1,632 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Groups +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabGroupsModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Groups API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Groups +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FGroupsAcceptGroupApplicationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Optional. Type of the entity to accept as. If specified, must be the same entity as the claimant or an entity that is a + * child of the claimant entity. Defaults to the claimant entity. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsEmptyResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FGroupsAcceptGroupInvitationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsAddMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** List of entities to add to the group. Only entities of type title_player_account and character may be added to groups. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Members; + /** + * Optional: The ID of the existing role to add the entities to. If this is not specified, the default member role for the + * group will be used. Role IDs must be between 1 and 64 characters long. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsApplyToGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional, default true. Automatically accept an outstanding invitation if one exists instead of creating an application */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + bool AutoAcceptOutstandingInvite = false; + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +/** Describes an application to join a group */ +USTRUCT(BlueprintType) +struct FGroupsApplyToGroupResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Type of entity that requested membership */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** When the application to join will expire and be deleted */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString Expires; + /** ID of the group that the entity requesting membership to */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsBlockEntityRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsChangeMemberRoleRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The ID of the role that the entities will become a member of. This must be an existing role. Role IDs must be between 1 + * and 64 characters long. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString DestinationRoleId; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** + * List of entities to move between roles in the group. All entities in this list must be members of the group and origin + * role. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Members; + /** The ID of the role that the entities currently are a member of. Role IDs must be between 1 and 64 characters long. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString OriginRoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsCreateGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The name of the group. This is unique at the title level by default. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString GroupName; +}; + +USTRUCT(BlueprintType) +struct FGroupsCreateGroupResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The ID of the administrator role for the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString AdminRoleId; + /** The server date and time the group was created. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString Created; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** The name of the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString GroupName; + /** The ID of the default member role for the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString MemberRoleId; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ProfileVersion = 0; + /** The list of roles and names that belong to the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Roles; +}; + +USTRUCT(BlueprintType) +struct FGroupsCreateGroupRoleRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** + * The ID of the role. This must be unique within the group and cannot be changed. Role IDs must be between 1 and 64 + * characters long. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; + /** + * The name of the role. This must be unique within the group and can be changed later. Role names must be between 1 and + * 100 characters long + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleName; +}; + +USTRUCT(BlueprintType) +struct FGroupsCreateGroupRoleResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The current version of the group profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ProfileVersion = 0; + /** ID for the role */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; + /** The name of the role */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleName; +}; + +USTRUCT(BlueprintType) +struct FGroupsDeleteGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** ID of the group or role to remove */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsDeleteRoleRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** The ID of the role to delete. Role IDs must be between 1 and 64 characters long. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsGetGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** The full name of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString GroupName; +}; + +USTRUCT(BlueprintType) +struct FGroupsGetGroupResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The ID of the administrator role for the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString AdminRoleId; + /** The server date and time the group was created. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString Created; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** The name of the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString GroupName; + /** The ID of the default member role for the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString MemberRoleId; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ProfileVersion = 0; + /** The list of roles and names that belong to the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Roles; +}; + +USTRUCT(BlueprintType) +struct FGroupsInviteToGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional, default true. Automatically accept an application if one exists instead of creating an invitation */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + bool AutoAcceptOutstandingApplication = false; + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** + * Optional. ID of an existing a role in the group to assign the user to. The group's default member role is used if this + * is not specified. Role IDs must be between 1 and 64 characters long. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; +}; + +/** Describes an invitation to a group. */ +USTRUCT(BlueprintType) +struct FGroupsInviteToGroupResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** When the invitation will expire and be deleted */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString Expires; + /** The group that the entity invited to */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** The entity that created the invitation */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* InvitedByEntity = nullptr; + /** The entity that is invited */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* InvitedEntity = nullptr; + /** ID of the role in the group to assign the user to. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsIsMemberRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** + * Optional: ID of the role to check membership of. Defaults to any role (that is, check to see if the entity is a member + * of the group in any capacity) if not specified. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsIsMemberResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** A value indicating whether or not the entity is a member. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + bool IsMember = false; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupApplicationsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupApplicationsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list of applications to the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Applications; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupBlocksRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupBlocksResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list blocked entities. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray BlockedEntities; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupInvitationsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupInvitationsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list of group invitations. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Invitations; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** ID of the group to list the members and roles for */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupMembersResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list of roles and member entity IDs. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Members; +}; + +USTRUCT(BlueprintType) +struct FGroupsListMembershipRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsListMembershipResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The list of groups */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Groups; +}; + +USTRUCT(BlueprintType) +struct FGroupsListMembershipOpportunitiesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsListMembershipOpportunitiesResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list of group applications. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Applications; + /** The requested list of group invitations. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Invitations; +}; + +USTRUCT(BlueprintType) +struct FGroupsRemoveGroupApplicationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsRemoveGroupInvitationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsRemoveMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** List of entities to remove */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Members; + /** The ID of the role to remove the entities from. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsUnblockEntityRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsUpdateGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional: the ID of an existing role to set as the new administrator role for the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString AdminRoleId; + /** + * Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from the + * GetGroup API, you can ensure that the group data update will only be performed if the group has not been updated by any + * other clients since the version you last loaded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ExpectedProfileVersion = 0; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** Optional: the new name of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString GroupName; + /** Optional: the ID of an existing role to set as the new member role for the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString MemberRoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsUpdateGroupResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional reason to explain why the operation was the result that it was. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString OperationReason; + /** New version of the group data. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ProfileVersion = 0; + /** Indicates which operation was completed, either Created, Updated, Deleted or None. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + EOperationTypes SetResult; +}; + +USTRUCT(BlueprintType) +struct FGroupsUpdateGroupRoleRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from the + * GetGroup API, you can ensure that the group data update will only be performed if the group has not been updated by any + * other clients since the version you last loaded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ExpectedProfileVersion = 0; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** ID of the role to update. Role IDs must be between 1 and 64 characters long. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; + /** The new name of the role */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleName; +}; + +USTRUCT(BlueprintType) +struct FGroupsUpdateGroupRoleResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional reason to explain why the operation was the result that it was. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString OperationReason; + /** New version of the role data. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ProfileVersion = 0; + /** Indicates which operation was completed, either Created, Updated, Deleted or None. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + EOperationTypes SetResult; +}; + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabJsonObject.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabJsonObject.h new file mode 100644 index 000000000..403cb9a8b --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabJsonObject.h @@ -0,0 +1,179 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// JSon Objects +// These are used as a wrapper for the internal json objects. +// Originally wriiten by Vladimir Alyamkin. +// Updated by Joshua Lyons to include null values +//////////////////////////////////////////////////////////// + +#pragma once + +#include "CoreMinimal.h" +#include "Json.h" +#include "PlayFabJsonObject.generated.h" + +class UPlayFabJsonValue; + +/** + * Blueprintable FJsonObject wrapper + */ +UCLASS(BlueprintType, Blueprintable) +class PLAYFAB_API UPlayFabJsonObject : public UObject +{ + GENERATED_UCLASS_BODY() + + /** Create new Json object */ + UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Object", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "PlayFab | Json") + static UPlayFabJsonObject* ConstructJsonObject(UObject* WorldContextObject); + + /** Reset all internal data */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void Reset(); + + /** Get the root Json object */ + TSharedPtr& GetRootObject(); + + /** Set the root Json object */ + void SetRootObject(TSharedPtr& JsonObject); + + + ////////////////////////////////////////////////////////////////////////// + // Serialization + + /** Serialize Json to string */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + FString EncodeJson() const; + + /** Construct Json object from string */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + bool DecodeJson(const FString& JsonString); + + + ////////////////////////////////////////////////////////////////////////// + // FJsonObject API + + /** Returns a list of field names that exist in the object */ + UFUNCTION(BlueprintPure, Category = "PlayFab | Json") + TArray GetFieldNames(); + + /** Checks to see if the FieldName exists in the object */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + bool HasField(const FString& FieldName) const; + + /** Remove field named FieldName */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void RemoveField(const FString& FieldName); + + /** Get the field named FieldName as a JsonValue */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + UPlayFabJsonValue* GetField(const FString& FieldName) const; + + /** Add a field named FieldName with a Value */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetField(const FString& FieldName, UPlayFabJsonValue* JsonValue); + + /** Add a field named FieldName with a null value */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetFieldNull(const FString& FieldName); + + /** Get the field named FieldName as a Json Array */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + TArray GetArrayField(const FString& FieldName); + + /** Set an ObjectField named FieldName and value of Json Array */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetArrayField(const FString& FieldName, const TArray& InArray); + + /** Adds all of the fields from one json object to this one */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void MergeJsonObject(UPlayFabJsonObject* InJsonObject, bool Overwrite); + + + ////////////////////////////////////////////////////////////////////////// + // FJsonObject API Helpers (easy to use with simple Json objects) + + /** Get the field named FieldName as a number. Ensures that the field is present and is of type Json number. + * Attn.!! float used instead of double to make the function blueprintable! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + float GetNumberField(const FString& FieldName) const; + + /** Add a field named FieldName with Number as value + * Attn.!! float used instead of double to make the function blueprintable! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetNumberField(const FString& FieldName, float Number); + + /** Get the field named FieldName as a string. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + FString GetStringField(const FString& FieldName) const; + + /** Add a field named FieldName with value of StringValue */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetStringField(const FString& FieldName, const FString& StringValue); + + /** Get the field named FieldName as a boolean. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + bool GetBoolField(const FString& FieldName) const; + + /** Set a boolean field named FieldName and value of InValue */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetBoolField(const FString& FieldName, bool InValue); + + /** Get the field named FieldName as a Json object. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + UPlayFabJsonObject* GetObjectField(const FString& FieldName) const; + + /** Set an ObjectField named FieldName and value of JsonObject */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetObjectField(const FString& FieldName, UPlayFabJsonObject* JsonObject); + + + ////////////////////////////////////////////////////////////////////////// + // Array fields helpers (uniform arrays) + + /** Get the field named FieldName as a Number Array. Use it only if you're sure that array is uniform! + * Attn.!! float used instead of double to make the function blueprintable! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + TArray GetNumberArrayField(const FString& FieldName); + + /** Set an ObjectField named FieldName and value of Number Array + * Attn.!! float used instead of double to make the function blueprintable! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetNumberArrayField(const FString& FieldName, const TArray& NumberArray); + + /** Get the field named FieldName as a String Array. Use it only if you're sure that array is uniform! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + TArray GetStringArrayField(const FString& FieldName); + + /** Set an ObjectField named FieldName and value of String Array */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetStringArrayField(const FString& FieldName, const TArray& StringArray); + + /** Get the field named FieldName as a Bool Array. Use it only if you're sure that array is uniform! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + TArray GetBoolArrayField(const FString& FieldName); + + /** Set an ObjectField named FieldName and value of Bool Array */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetBoolArrayField(const FString& FieldName, const TArray& BoolArray); + + /** Get the field named FieldName as an Object Array. Use it only if you're sure that array is uniform! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + TArray GetObjectArrayField(const FString& FieldName); + + /** Set an ObjectField named FieldName and value of Ob Array */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetObjectArrayField(const FString& FieldName, const TArray& ObjectArray); + + + ////////////////////////////////////////////////////////////////////////// + // Data + +private: + /** Internal JSON data */ + TSharedPtr JsonObj; + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabJsonValue.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabJsonValue.h new file mode 100644 index 000000000..6284ca074 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabJsonValue.h @@ -0,0 +1,129 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// JSonValue Objects +// These are used as a wrapper for the internal json values. +// Originally wriiten by Vladimir Alyamkin. +//////////////////////////////////////////////////////////// + +#pragma once + +#include "CoreMinimal.h" +#include "Json.h" +#include "PlayFabJsonValue.generated.h" + +class UPlayFabJsonObject; + +/** + * Represents all the types a Json Value can be. + */ +UENUM(BlueprintType) +namespace EPFJson +{ + enum Type + { + None, + Null, + String, + Number, + Boolean, + Array, + Object, + }; +} + +/** + * Blueprintable FJsonValue wrapper + */ +UCLASS(BlueprintType, Blueprintable) +class PLAYFAB_API UPlayFabJsonValue : public UObject +{ + GENERATED_UCLASS_BODY() + + /** Create new Json Number value + * Attn.!! float used instead of double to make the function blueprintable! */ + UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Number Value", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "PlayFab | Json") + static UPlayFabJsonValue* ConstructJsonValueNumber(UObject* WorldContextObject, float Number); + + /** Create new Json String value */ + UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json String Value", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "PlayFab | Json") + static UPlayFabJsonValue* ConstructJsonValueString(UObject* WorldContextObject, const FString& StringValue); + + /** Create new Json Bool value */ + UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Bool Value", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "PlayFab | Json") + static UPlayFabJsonValue* ConstructJsonValueBool(UObject* WorldContextObject, bool InValue); + + /** Create new Json Array value */ + UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Array Value", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "PlayFab | Json") + static UPlayFabJsonValue* ConstructJsonValueArray(UObject* WorldContextObject, const TArray& InArray); + + /** Create new Json Object value */ + UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Object Value", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "PlayFab | Json") + static UPlayFabJsonValue* ConstructJsonValueObject(UObject* WorldContextObject, UPlayFabJsonObject *JsonObject); + + /** Create new Json value from FJsonValue (to be used from PlayFabJsonObject) */ + static UPlayFabJsonValue* ConstructJsonValue(UObject* WorldContextObject, const TSharedPtr& InValue); + + /** Get the root Json value */ + TSharedPtr& GetRootValue(); + + /** Set the root Json value */ + void SetRootValue(TSharedPtr& JsonValue); + + + ////////////////////////////////////////////////////////////////////////// + // FJsonValue API + + /** Get type of Json value (Enum) */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + EPFJson::Type GetType() const; + + /** Get type of Json value (String) */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + FString GetTypeString() const; + + /** Returns true if this value is a 'null' */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + bool IsNull() const; + + /** Returns this value as a double, throwing an error if this is not an Json Number + * Attn.!! float used instead of double to make the function blueprintable! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + float AsNumber() const; + + /** Returns this value as a number, throwing an error if this is not an Json String */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + FString AsString() const; + + /** Returns this value as a boolean, throwing an error if this is not an Json Bool */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + bool AsBool() const; + + /** Returns this value as an array, throwing an error if this is not an Json Array */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + TArray AsArray() const; + + /** Returns this value as an object, throwing an error if this is not an Json Object */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + UPlayFabJsonObject* AsObject(); + + + ////////////////////////////////////////////////////////////////////////// + // Data + +private: + /** Internal JSON data */ + TSharedPtr JsonVal; + + + ////////////////////////////////////////////////////////////////////////// + // Helpers + +protected: + /** Simple error logger */ + void ErrorMessage(const FString& InType) const; + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationAPI.h new file mode 100644 index 000000000..95b86b4ff --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationAPI.h @@ -0,0 +1,104 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Localization +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabLocalizationModels.h" +#include "PlayFabLocalizationAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabLocalizationRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabLocalizationAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabLocalizationRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Localization API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Localization + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLanguageList, FLocalizationGetLanguageListResponse, result, UObject*, customData); + + /** Retrieves the list of allowed languages, only accessible by title entities */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Localization | Localization ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabLocalizationAPI* GetLanguageList(FLocalizationGetLanguageListRequest request, + FDelegateOnSuccessGetLanguageList onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabLocalizationRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Localization | Localization ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLanguageList(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessGetLanguageList OnSuccessGetLanguageList; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationModelDecoder.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationModelDecoder.h new file mode 100644 index 000000000..07bf12408 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationModelDecoder.h @@ -0,0 +1,45 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Localization +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabLocalizationModels.h" +#include "PlayFabLocalizationModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabLocalizationModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Localization API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Localization + ////////////////////////////////////////////////////// + + /** Decode the GetLanguageListResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Localization | Localization Models") + static FLocalizationGetLanguageListResponse decodeGetLanguageListResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationModels.h new file mode 100644 index 000000000..fa32d424e --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationModels.h @@ -0,0 +1,47 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Localization +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabLocalizationModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Localization API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Localization +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FLocalizationGetLanguageListRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FLocalizationGetLanguageListResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The list of Playfab-supported languages */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Localization | Localization Models") + FString LanguageList; +}; + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerAPI.h new file mode 100644 index 000000000..0164b9bb8 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerAPI.h @@ -0,0 +1,163 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Matchmaker +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabMatchmakerModels.h" +#include "PlayFabMatchmakerAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabMatchmakerRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabMatchmakerAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabMatchmakerRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Matchmaker API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAuthUser, FMatchmakerAuthUserResponse, result, UObject*, customData); + + /** Validates a user with the PlayFab service */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabMatchmakerAPI* AuthUser(FMatchmakerAuthUserRequest request, + FDelegateOnSuccessAuthUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabMatchmakerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAuthUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessPlayerJoined, FMatchmakerPlayerJoinedResponse, result, UObject*, customData); + + /** Informs the PlayFab game server hosting service that the indicated user has joined the Game Server Instance specified */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabMatchmakerAPI* PlayerJoined(FMatchmakerPlayerJoinedRequest request, + FDelegateOnSuccessPlayerJoined onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabMatchmakerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperPlayerJoined(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessPlayerLeft, FMatchmakerPlayerLeftResponse, result, UObject*, customData); + + /** Informs the PlayFab game server hosting service that the indicated user has left the Game Server Instance specified */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabMatchmakerAPI* PlayerLeft(FMatchmakerPlayerLeftRequest request, + FDelegateOnSuccessPlayerLeft onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabMatchmakerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperPlayerLeft(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessStartGame, FMatchmakerStartGameResponse, result, UObject*, customData); + + /** Instructs the PlayFab game server hosting service to instantiate a new Game Server Instance */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabMatchmakerAPI* StartGame(FMatchmakerStartGameRequest request, + FDelegateOnSuccessStartGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabMatchmakerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperStartGame(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUserInfo, FMatchmakerUserInfoResponse, result, UObject*, customData); + + /** + * Retrieves the relevant details for a specified user, which the external match-making service can then use to compute + * effective matches + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabMatchmakerAPI* UserInfo(FMatchmakerUserInfoRequest request, + FDelegateOnSuccessUserInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabMatchmakerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUserInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessAuthUser OnSuccessAuthUser; + FDelegateOnSuccessPlayerJoined OnSuccessPlayerJoined; + FDelegateOnSuccessPlayerLeft OnSuccessPlayerLeft; + FDelegateOnSuccessStartGame OnSuccessStartGame; + FDelegateOnSuccessUserInfo OnSuccessUserInfo; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerModelDecoder.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerModelDecoder.h new file mode 100644 index 000000000..f4df43e96 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerModelDecoder.h @@ -0,0 +1,61 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Matchmaker +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabMatchmakerModels.h" +#include "PlayFabMatchmakerModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabMatchmakerModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Matchmaker API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + + /** Decode the AuthUserResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking Models") + static FMatchmakerAuthUserResponse decodeAuthUserResponseResponse(UPlayFabJsonObject* response); + + /** Decode the PlayerJoinedResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking Models") + static FMatchmakerPlayerJoinedResponse decodePlayerJoinedResponseResponse(UPlayFabJsonObject* response); + + /** Decode the PlayerLeftResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking Models") + static FMatchmakerPlayerLeftResponse decodePlayerLeftResponseResponse(UPlayFabJsonObject* response); + + /** Decode the StartGameResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking Models") + static FMatchmakerStartGameResponse decodeStartGameResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UserInfoResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking Models") + static FMatchmakerUserInfoResponse decodeUserInfoResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerModels.h new file mode 100644 index 000000000..3db054cb5 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerModels.h @@ -0,0 +1,197 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Matchmaker +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabMatchmakerModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Matchmaker API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FMatchmakerAuthUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Session Ticket provided by the client. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString AuthorizationTicket; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerAuthUserResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Boolean indicating if the user has been authorized to use the external match-making service. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + bool Authorized = false; + /** PlayFab unique identifier of the account that has been authorized. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerPlayerJoinedRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Unique identifier of the Game Server Instance the user is joining. This must be a Game Server Instance started with the + * Matchmaker/StartGame API. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString LobbyId; + /** PlayFab unique identifier for the player joining. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerPlayerJoinedResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FMatchmakerPlayerLeftRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Unique identifier of the Game Server Instance the user is leaving. This must be a Game Server Instance started with the + * Matchmaker/StartGame API. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString LobbyId; + /** PlayFab unique identifier for the player leaving. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerPlayerLeftResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FMatchmakerStartGameRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the previously uploaded build executable which is to be started. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString Build; + /** Custom command line argument when starting game server process. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString CustomCommandLineData; + /** + * HTTP endpoint URL for receiving game status events, if using an external matchmaker. When the game ends, PlayFab will + * make a POST request to this URL with the X-SecretKey header set to the value of the game's secret and an + * application/json body of { "EventName": "game_ended", "GameID": "" }. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString ExternalMatchmakerEventEndpoint; + /** Game mode for this Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString GameMode; + /** Region with which to associate the server, for filtering. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + ERegion Region; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerStartGameResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the game/lobby in the new Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString GameID; + /** IPV4 address of the new Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString ServerHostname; + /** IPV4 address of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString ServerIPV4Address; + /** IPV6 address of the new Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString ServerIPV6Address; + /** Port number for communication with the Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + int32 ServerPort = 0; + /** Public DNS name (if any) of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString ServerPublicDNSName; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerUserInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Minimum catalog version for which data is requested (filters the results to only contain inventory items which have a + * catalog version of this or higher). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + int32 MinCatalogVersion = 0; + /** PlayFab unique identifier of the user whose information is being requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerUserInfoResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of inventory items in the user's current inventory. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + TArray Inventory; + /** Boolean indicating whether the user is a developer. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + bool IsDeveloper = false; + /** PlayFab unique identifier of the user whose information was requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString PlayFabId; + /** Steam unique identifier, if the user has an associated Steam account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString SteamId; + /** Title specific display name, if set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString TitleDisplayName; + /** PlayFab unique user name. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString Username; + /** Array of virtual currency balance(s) belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + UPlayFabJsonObject* VirtualCurrency; + /** Array of remaining times and timestamps for virtual currencies. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + UPlayFabJsonObject* VirtualCurrencyRechargeTimes = nullptr; +}; + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabProfilesAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabProfilesAPI.h new file mode 100644 index 000000000..4a7a22704 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabProfilesAPI.h @@ -0,0 +1,174 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Profiles +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabProfilesModels.h" +#include "PlayFabProfilesAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabProfilesRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabProfilesAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabProfilesRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Profiles API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetGlobalPolicy, FProfilesGetGlobalPolicyResponse, result, UObject*, customData); + + /** Gets the global title access policy */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabProfilesAPI* GetGlobalPolicy(FProfilesGetGlobalPolicyRequest request, + FDelegateOnSuccessGetGlobalPolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabProfilesRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetGlobalPolicy(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetProfile, FProfilesGetEntityProfileResponse, result, UObject*, customData); + + /** Retrieves the entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabProfilesAPI* GetProfile(FProfilesGetEntityProfileRequest request, + FDelegateOnSuccessGetProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabProfilesRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetProfile(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetProfiles, FProfilesGetEntityProfilesResponse, result, UObject*, customData); + + /** Retrieves the entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabProfilesAPI* GetProfiles(FProfilesGetEntityProfilesRequest request, + FDelegateOnSuccessGetProfiles onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabProfilesRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetProfiles(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetGlobalPolicy, FProfilesSetGlobalPolicyResponse, result, UObject*, customData); + + /** Sets the global title access policy */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabProfilesAPI* SetGlobalPolicy(FProfilesSetGlobalPolicyRequest request, + FDelegateOnSuccessSetGlobalPolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabProfilesRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetGlobalPolicy(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetProfileLanguage, FProfilesSetProfileLanguageResponse, result, UObject*, customData); + + /** Updates the entity's language */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabProfilesAPI* SetProfileLanguage(FProfilesSetProfileLanguageRequest request, + FDelegateOnSuccessSetProfileLanguage onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabProfilesRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetProfileLanguage(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetProfilePolicy, FProfilesSetEntityProfilePolicyResponse, result, UObject*, customData); + + /** Sets the profiles access policy */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabProfilesAPI* SetProfilePolicy(FProfilesSetEntityProfilePolicyRequest request, + FDelegateOnSuccessSetProfilePolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabProfilesRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetProfilePolicy(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessGetGlobalPolicy OnSuccessGetGlobalPolicy; + FDelegateOnSuccessGetProfile OnSuccessGetProfile; + FDelegateOnSuccessGetProfiles OnSuccessGetProfiles; + FDelegateOnSuccessSetGlobalPolicy OnSuccessSetGlobalPolicy; + FDelegateOnSuccessSetProfileLanguage OnSuccessSetProfileLanguage; + FDelegateOnSuccessSetProfilePolicy OnSuccessSetProfilePolicy; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabProfilesModelDecoder.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabProfilesModelDecoder.h new file mode 100644 index 000000000..b8ed1ec3f --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabProfilesModelDecoder.h @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Profiles +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabProfilesModels.h" +#include "PlayFabProfilesModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabProfilesModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Profiles API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + + /** Decode the GetGlobalPolicyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management Models") + static FProfilesGetGlobalPolicyResponse decodeGetGlobalPolicyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the GetEntityProfileResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management Models") + static FProfilesGetEntityProfileResponse decodeGetEntityProfileResponseResponse(UPlayFabJsonObject* response); + + /** Decode the GetEntityProfilesResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management Models") + static FProfilesGetEntityProfilesResponse decodeGetEntityProfilesResponseResponse(UPlayFabJsonObject* response); + + /** Decode the SetGlobalPolicyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management Models") + static FProfilesSetGlobalPolicyResponse decodeSetGlobalPolicyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the SetProfileLanguageResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management Models") + static FProfilesSetProfileLanguageResponse decodeSetProfileLanguageResponseResponse(UPlayFabJsonObject* response); + + /** Decode the SetEntityProfilePolicyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management Models") + static FProfilesSetEntityProfilePolicyResponse decodeSetEntityProfilePolicyResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabProfilesModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabProfilesModels.h new file mode 100644 index 000000000..14a6d616e --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabProfilesModels.h @@ -0,0 +1,171 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Profiles +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabProfilesModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Profiles API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FProfilesGetGlobalPolicyRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FProfilesGetGlobalPolicyResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The permissions that govern access to all entities under this title or namespace. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + TArray Permissions; +}; + +USTRUCT(BlueprintType) +struct FProfilesGetEntityProfileRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Determines whether the objects will be returned as an escaped JSON string or as a un-escaped JSON object. Default is + * JSON string. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + bool DataAsObject = false; + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + UPlayFabJsonObject* Entity = nullptr; +}; + +USTRUCT(BlueprintType) +struct FProfilesGetEntityProfileResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Entity profile */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + UPlayFabJsonObject* Profile = nullptr; +}; + +USTRUCT(BlueprintType) +struct FProfilesGetEntityProfilesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Determines whether the objects will be returned as an escaped JSON string or as a un-escaped JSON object. Default is + * JSON string. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + bool DataAsObject = false; + /** Entity keys of the profiles to load. Must be between 1 and 25 */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + TArray Entities; +}; + +USTRUCT(BlueprintType) +struct FProfilesGetEntityProfilesResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Entity profiles */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + TArray Profiles; +}; + +USTRUCT(BlueprintType) +struct FProfilesSetGlobalPolicyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The permissions that govern access to all entities under this title or namespace. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + TArray Permissions; +}; + +USTRUCT(BlueprintType) +struct FProfilesSetGlobalPolicyResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FProfilesSetProfileLanguageRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + UPlayFabJsonObject* Entity = nullptr; + /** The expected version of a profile to perform this update on */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + int32 ExpectedVersion = 0; + /** The language to set on the given entity. Deletes the profile's language if passed in a null string. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + FString Language; +}; + +USTRUCT(BlueprintType) +struct FProfilesSetProfileLanguageResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The type of operation that occured on the profile's language */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + EOperationTypes OperationResult; + /** The updated version of the profile after the language update */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + int32 VersionNumber = 0; +}; + +USTRUCT(BlueprintType) +struct FProfilesSetEntityProfilePolicyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + UPlayFabJsonObject* Entity = nullptr; + /** The statements to include in the access policy. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + TArray Statements; +}; + +USTRUCT(BlueprintType) +struct FProfilesSetEntityProfilePolicyResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The permissions that govern access to this entity profile and its properties. Only includes permissions set on this + * profile, not global statements from titles and namespaces. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + TArray Permissions; +}; + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabServerAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabServerAPI.h new file mode 100644 index 000000000..d8bd44f82 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabServerAPI.h @@ -0,0 +1,1828 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Server +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabServerModels.h" +#include "PlayFabServerAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabServerRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabServerAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabServerRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Server API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessBanUsers, FServerBanUsersResult, result, UObject*, customData); + + /** Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* BanUsers(FServerBanUsersRequest request, + FDelegateOnSuccessBanUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperBanUsers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerProfile, FServerGetPlayerProfileResult, result, UObject*, customData); + + /** Retrieves the player's profile */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayerProfile(FServerGetPlayerProfileRequest request, + FDelegateOnSuccessGetPlayerProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerProfile(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs, FServerGetPlayFabIDsFromFacebookIDsResult, result, UObject*, customData); + + /** Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayFabIDsFromFacebookIDs(FServerGetPlayFabIDsFromFacebookIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromFacebookIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds, FServerGetPlayFabIDsFromFacebookInstantGamesIdsResult, result, UObject*, customData); + + /** Retrieves the unique PlayFab identifiers for the given set of Facebook Instant Games identifiers. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayFabIDsFromFacebookInstantGamesIds(FServerGetPlayFabIDsFromFacebookInstantGamesIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromFacebookInstantGamesIds(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds, FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsResult, result, UObject*, customData); + + /** Retrieves the unique PlayFab identifiers for the given set of Nintendo Switch Device identifiers. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayFabIDsFromNintendoSwitchDeviceIds(FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromNintendoSwitchDeviceIds(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromSteamIDs, FServerGetPlayFabIDsFromSteamIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile + * IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayFabIDsFromSteamIDs(FServerGetPlayFabIDsFromSteamIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromSteamIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromSteamIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserAccountInfo, FServerGetUserAccountInfoResult, result, UObject*, customData); + + /** Retrieves the relevant details for a specified user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserAccountInfo(FServerGetUserAccountInfoRequest request, + FDelegateOnSuccessGetUserAccountInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserAccountInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserBans, FServerGetUserBansResult, result, UObject*, customData); + + /** Gets all bans for a user. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserBans(FServerGetUserBansRequest request, + FDelegateOnSuccessGetUserBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserBans(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeAllBansForUser, FServerRevokeAllBansForUserResult, result, UObject*, customData); + + /** Revoke all active bans for a user. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RevokeAllBansForUser(FServerRevokeAllBansForUserRequest request, + FDelegateOnSuccessRevokeAllBansForUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeAllBansForUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeBans, FServerRevokeBansResult, result, UObject*, customData); + + /** Revoke all active bans specified with BanId. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RevokeBans(FServerRevokeBansRequest request, + FDelegateOnSuccessRevokeBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeBans(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSendCustomAccountRecoveryEmail, FServerSendCustomAccountRecoveryEmailResult, result, UObject*, customData); + + /** + * Forces an email to be sent to the registered contact email address for the user's account based on an account recovery + * email template + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SendCustomAccountRecoveryEmail(FServerSendCustomAccountRecoveryEmailRequest request, + FDelegateOnSuccessSendCustomAccountRecoveryEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSendCustomAccountRecoveryEmail(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSendEmailFromTemplate, FServerSendEmailFromTemplateResult, result, UObject*, customData); + + /** Sends an email based on an email template to a player's contact email */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SendEmailFromTemplate(FServerSendEmailFromTemplateRequest request, + FDelegateOnSuccessSendEmailFromTemplate onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSendEmailFromTemplate(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSendPushNotification, FServerSendPushNotificationResult, result, UObject*, customData); + + /** + * Sends an iOS/Android Push Notification to a specific user, if that user's device has been configured for Push + * Notifications in PlayFab. If a user has linked both Android and iOS devices, both will be notified. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SendPushNotification(FServerSendPushNotificationRequest request, + FDelegateOnSuccessSendPushNotification onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSendPushNotification(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateAvatarUrl, FServerEmptyResponse, result, UObject*, customData); + + /** Update the avatar URL of the specified player */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateAvatarUrl(FServerUpdateAvatarUrlRequest request, + FDelegateOnSuccessUpdateAvatarUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateAvatarUrl(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateBans, FServerUpdateBansResult, result, UObject*, customData); + + /** Updates information of a list of existing bans specified with Ban Ids. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateBans(FServerUpdateBansRequest request, + FDelegateOnSuccessUpdateBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateBans(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Analytics + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWriteCharacterEvent, FServerWriteEventResponse, result, UObject*, customData); + + /** Writes a character-based event into PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* WriteCharacterEvent(FServerWriteServerCharacterEventRequest request, + FDelegateOnSuccessWriteCharacterEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWriteCharacterEvent(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWritePlayerEvent, FServerWriteEventResponse, result, UObject*, customData); + + /** Writes a player-based event into PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* WritePlayerEvent(FServerWriteServerPlayerEventRequest request, + FDelegateOnSuccessWritePlayerEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWritePlayerEvent(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWriteTitleEvent, FServerWriteEventResponse, result, UObject*, customData); + + /** Writes a title-based event into PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* WriteTitleEvent(FServerWriteTitleEventRequest request, + FDelegateOnSuccessWriteTitleEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWriteTitleEvent(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAuthenticateSessionTicket, FServerAuthenticateSessionTicketResult, result, UObject*, customData); + + /** Validated a client's session ticket, and if successful, returns details for that user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AuthenticateSessionTicket(FServerAuthenticateSessionTicketRequest request, + FDelegateOnSuccessAuthenticateSessionTicket onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAuthenticateSessionTicket(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetPlayerSecret, FServerSetPlayerSecretResult, result, UObject*, customData); + + /** + * Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's + * secret use the Admin or Server API method SetPlayerSecret. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetPlayerSecret(FServerSetPlayerSecretRequest request, + FDelegateOnSuccessSetPlayerSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetPlayerSecret(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Character Data + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterData, FServerGetCharacterDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCharacterData(FServerGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterInternalData, FServerGetCharacterDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user's character which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCharacterInternalData(FServerGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterReadOnlyData, FServerGetCharacterDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user's character which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCharacterReadOnlyData(FServerGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCharacterData, FServerUpdateCharacterDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user's character which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateCharacterData(FServerUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCharacterInternalData, FServerUpdateCharacterDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user's character which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateCharacterInternalData(FServerUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCharacterInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCharacterReadOnlyData, FServerUpdateCharacterDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user's character which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateCharacterReadOnlyData(FServerUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCharacterReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Characters + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteCharacterFromUser, FServerDeleteCharacterFromUserResult, result, UObject*, customData); + + /** Deletes the specific character ID from the specified user. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* DeleteCharacterFromUser(FServerDeleteCharacterFromUserRequest request, + FDelegateOnSuccessDeleteCharacterFromUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteCharacterFromUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetAllUsersCharacters, FServerListUsersCharactersResult, result, UObject*, customData); + + /** + * Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be + * evaluated with the parent PlayFabId to guarantee uniqueness. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetAllUsersCharacters(FServerListUsersCharactersRequest request, + FDelegateOnSuccessGetAllUsersCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetAllUsersCharacters(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterLeaderboard, FServerGetCharacterLeaderboardResult, result, UObject*, customData); + + /** Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCharacterLeaderboard(FServerGetCharacterLeaderboardRequest request, + FDelegateOnSuccessGetCharacterLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterStatistics, FServerGetCharacterStatisticsResult, result, UObject*, customData); + + /** Retrieves the details of all title-specific statistics for the specific character */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCharacterStatistics(FServerGetCharacterStatisticsRequest request, + FDelegateOnSuccessGetCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboardAroundCharacter, FServerGetLeaderboardAroundCharacterResult, result, UObject*, customData); + + /** Retrieves a list of ranked characters for the given statistic, centered on the requested user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetLeaderboardAroundCharacter(FServerGetLeaderboardAroundCharacterRequest request, + FDelegateOnSuccessGetLeaderboardAroundCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboardAroundCharacter(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboardForUserCharacters, FServerGetLeaderboardForUsersCharactersResult, result, UObject*, customData); + + /** Retrieves a list of all of the user's characters for the given statistic. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetLeaderboardForUserCharacters(FServerGetLeaderboardForUsersCharactersRequest request, + FDelegateOnSuccessGetLeaderboardForUserCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboardForUserCharacters(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGrantCharacterToUser, FServerGrantCharacterToUserResult, result, UObject*, customData); + + /** + * Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated + * with the parent PlayFabId to guarantee uniqueness. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GrantCharacterToUser(FServerGrantCharacterToUserRequest request, + FDelegateOnSuccessGrantCharacterToUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGrantCharacterToUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCharacterStatistics, FServerUpdateCharacterStatisticsResult, result, UObject*, customData); + + /** Updates the values of the specified title-specific statistics for the specific character */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateCharacterStatistics(FServerUpdateCharacterStatisticsRequest request, + FDelegateOnSuccessUpdateCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Content + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetContentDownloadUrl, FServerGetContentDownloadUrlResult, result, UObject*, customData); + + /** + * This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned + * URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the + * content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, + * the query to retrieve the data will fail. See this post for more information: + * https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service. Also, + * please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Content ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetContentDownloadUrl(FServerGetContentDownloadUrlRequest request, + FDelegateOnSuccessGetContentDownloadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Content ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetContentDownloadUrl(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Friend List Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddFriend, FServerEmptyResponse, result, UObject*, customData); + + /** + * Adds the Friend user to the friendlist of the user with PlayFabId. At least one of + * FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AddFriend(FServerAddFriendRequest request, + FDelegateOnSuccessAddFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddFriend(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetFriendsList, FServerGetFriendsListResult, result, UObject*, customData); + + /** + * Retrieves the current friends for the user with PlayFabId, constrained to users who have PlayFab accounts. Friends from + * linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetFriendsList(FServerGetFriendsListRequest request, + FDelegateOnSuccessGetFriendsList onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetFriendsList(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveFriend, FServerEmptyResponse, result, UObject*, customData); + + /** Removes the specified friend from the the user's friend list */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RemoveFriend(FServerRemoveFriendRequest request, + FDelegateOnSuccessRemoveFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveFriend(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetFriendTags, FServerEmptyResponse, result, UObject*, customData); + + /** Updates the tag list for a specified user in the friend list of another user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetFriendTags(FServerSetFriendTagsRequest request, + FDelegateOnSuccessSetFriendTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetFriendTags(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeregisterGame, FServerDeregisterGameResponse, result, UObject*, customData); + + /** Inform the matchmaker that a Game Server Instance is removed. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* DeregisterGame(FServerDeregisterGameRequest request, + FDelegateOnSuccessDeregisterGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeregisterGame(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessNotifyMatchmakerPlayerLeft, FServerNotifyMatchmakerPlayerLeftResult, result, UObject*, customData); + + /** Informs the PlayFab match-making service that the user specified has left the Game Server Instance */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* NotifyMatchmakerPlayerLeft(FServerNotifyMatchmakerPlayerLeftRequest request, + FDelegateOnSuccessNotifyMatchmakerPlayerLeft onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperNotifyMatchmakerPlayerLeft(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRedeemMatchmakerTicket, FServerRedeemMatchmakerTicketResult, result, UObject*, customData); + + /** Validates a Game Server session ticket and returns details about the user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RedeemMatchmakerTicket(FServerRedeemMatchmakerTicketRequest request, + FDelegateOnSuccessRedeemMatchmakerTicket onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRedeemMatchmakerTicket(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRefreshGameServerInstanceHeartbeat, FServerRefreshGameServerInstanceHeartbeatResult, result, UObject*, customData); + + /** Set the state of the indicated Game Server Instance. Also update the heartbeat for the instance. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RefreshGameServerInstanceHeartbeat(FServerRefreshGameServerInstanceHeartbeatRequest request, + FDelegateOnSuccessRefreshGameServerInstanceHeartbeat onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRefreshGameServerInstanceHeartbeat(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRegisterGame, FServerRegisterGameResponse, result, UObject*, customData); + + /** Inform the matchmaker that a new Game Server Instance is added. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RegisterGame(FServerRegisterGameRequest request, + FDelegateOnSuccessRegisterGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRegisterGame(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetGameServerInstanceData, FServerSetGameServerInstanceDataResult, result, UObject*, customData); + + /** Sets the custom data of the indicated Game Server Instance */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetGameServerInstanceData(FServerSetGameServerInstanceDataRequest request, + FDelegateOnSuccessSetGameServerInstanceData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetGameServerInstanceData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetGameServerInstanceState, FServerSetGameServerInstanceStateResult, result, UObject*, customData); + + /** Set the state of the indicated Game Server Instance. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetGameServerInstanceState(FServerSetGameServerInstanceStateRequest request, + FDelegateOnSuccessSetGameServerInstanceState onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetGameServerInstanceState(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetGameServerInstanceTags, FServerSetGameServerInstanceTagsResult, result, UObject*, customData); + + /** Set custom tags for the specified Game Server Instance */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetGameServerInstanceTags(FServerSetGameServerInstanceTagsRequest request, + FDelegateOnSuccessSetGameServerInstanceTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetGameServerInstanceTags(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Platform Specific Methods + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAwardSteamAchievement, FServerAwardSteamAchievementResult, result, UObject*, customData); + + /** Awards the specified users the specified Steam achievements */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AwardSteamAchievement(FServerAwardSteamAchievementRequest request, + FDelegateOnSuccessAwardSteamAchievement onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAwardSteamAchievement(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Player Data Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteUsers, FServerDeleteUsersResult, result, UObject*, customData); + + /** Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* DeleteUsers(FServerDeleteUsersRequest request, + FDelegateOnSuccessDeleteUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteUsers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetFriendLeaderboard, FServerGetLeaderboardResult, result, UObject*, customData); + + /** + * Retrieves a list of ranked friends of the given player for the given statistic, starting from the indicated point in the + * leaderboard + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetFriendLeaderboard(FServerGetFriendLeaderboardRequest request, + FDelegateOnSuccessGetFriendLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetFriendLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboard, FServerGetLeaderboardResult, result, UObject*, customData); + + /** Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetLeaderboard(FServerGetLeaderboardRequest request, + FDelegateOnSuccessGetLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboardAroundUser, FServerGetLeaderboardAroundUserResult, result, UObject*, customData); + + /** Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetLeaderboardAroundUser(FServerGetLeaderboardAroundUserRequest request, + FDelegateOnSuccessGetLeaderboardAroundUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboardAroundUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerCombinedInfo, FServerGetPlayerCombinedInfoResult, result, UObject*, customData); + + /** + * Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be + * returned. All parameters default to false. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayerCombinedInfo(FServerGetPlayerCombinedInfoRequest request, + FDelegateOnSuccessGetPlayerCombinedInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerCombinedInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerStatistics, FServerGetPlayerStatisticsResult, result, UObject*, customData); + + /** Retrieves the current version and values for the indicated statistics, for the local player. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayerStatistics(FServerGetPlayerStatisticsRequest request, + FDelegateOnSuccessGetPlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerStatisticVersions, FServerGetPlayerStatisticVersionsResult, result, UObject*, customData); + + /** Retrieves the information on the available versions of the specified statistic. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayerStatisticVersions(FServerGetPlayerStatisticVersionsRequest request, + FDelegateOnSuccessGetPlayerStatisticVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerStatisticVersions(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserData, FServerGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserInternalData, FServerGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserInternalData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherData, FServerGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserPublisherData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherInternalData, FServerGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserPublisherInternalData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherReadOnlyData, FServerGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserPublisherReadOnlyData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserReadOnlyData, FServerGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserReadOnlyData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdatePlayerStatistics, FServerUpdatePlayerStatisticsResult, result, UObject*, customData); + + /** Updates the values of the specified title-specific statistics for the user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdatePlayerStatistics(FServerUpdatePlayerStatisticsRequest request, + FDelegateOnSuccessUpdatePlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdatePlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserData, FServerUpdateUserDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserInternalData, FServerUpdateUserDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserInternalData(FServerUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherData, FServerUpdateUserDataResult, result, UObject*, customData); + + /** Updates the publisher-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserPublisherData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherInternalData, FServerUpdateUserDataResult, result, UObject*, customData); + + /** Updates the publisher-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserPublisherInternalData(FServerUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherReadOnlyData, FServerUpdateUserDataResult, result, UObject*, customData); + + /** Updates the publisher-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserPublisherReadOnlyData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserReadOnlyData, FServerUpdateUserDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserReadOnlyData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Player Item Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddCharacterVirtualCurrency, FServerModifyCharacterVirtualCurrencyResult, result, UObject*, customData); + + /** Increments the character's balance of the specified virtual currency by the stated amount */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AddCharacterVirtualCurrency(FServerAddCharacterVirtualCurrencyRequest request, + FDelegateOnSuccessAddCharacterVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddCharacterVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddUserVirtualCurrency, FServerModifyUserVirtualCurrencyResult, result, UObject*, customData); + + /** Increments the user's balance of the specified virtual currency by the stated amount */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AddUserVirtualCurrency(FServerAddUserVirtualCurrencyRequest request, + FDelegateOnSuccessAddUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessConsumeItem, FServerConsumeItemResult, result, UObject*, customData); + + /** Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* ConsumeItem(FServerConsumeItemRequest request, + FDelegateOnSuccessConsumeItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperConsumeItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessEvaluateRandomResultTable, FServerEvaluateRandomResultTableResult, result, UObject*, customData); + + /** + * Returns the result of an evaluation of a Random Result Table - the ItemId from the game Catalog which would have been + * added to the player inventory, if the Random Result Table were added via a Bundle or a call to UnlockContainer. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* EvaluateRandomResultTable(FServerEvaluateRandomResultTableRequest request, + FDelegateOnSuccessEvaluateRandomResultTable onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperEvaluateRandomResultTable(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterInventory, FServerGetCharacterInventoryResult, result, UObject*, customData); + + /** Retrieves the specified character's current inventory of virtual goods */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCharacterInventory(FServerGetCharacterInventoryRequest request, + FDelegateOnSuccessGetCharacterInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterInventory(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetRandomResultTables, FServerGetRandomResultTablesResult, result, UObject*, customData); + + /** + * Retrieves the configuration information for the specified random results tables for the title, including all ItemId + * values and weights + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetRandomResultTables(FServerGetRandomResultTablesRequest request, + FDelegateOnSuccessGetRandomResultTables onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetRandomResultTables(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserInventory, FServerGetUserInventoryResult, result, UObject*, customData); + + /** Retrieves the specified user's current inventory of virtual goods */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserInventory(FServerGetUserInventoryRequest request, + FDelegateOnSuccessGetUserInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserInventory(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGrantItemsToCharacter, FServerGrantItemsToCharacterResult, result, UObject*, customData); + + /** Adds the specified items to the specified character's inventory */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GrantItemsToCharacter(FServerGrantItemsToCharacterRequest request, + FDelegateOnSuccessGrantItemsToCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGrantItemsToCharacter(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGrantItemsToUser, FServerGrantItemsToUserResult, result, UObject*, customData); + + /** Adds the specified items to the specified user's inventory */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GrantItemsToUser(FServerGrantItemsToUserRequest request, + FDelegateOnSuccessGrantItemsToUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGrantItemsToUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGrantItemsToUsers, FServerGrantItemsToUsersResult, result, UObject*, customData); + + /** Adds the specified items to the specified user inventories */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GrantItemsToUsers(FServerGrantItemsToUsersRequest request, + FDelegateOnSuccessGrantItemsToUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGrantItemsToUsers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessModifyItemUses, FServerModifyItemUsesResult, result, UObject*, customData); + + /** Modifies the number of remaining uses of a player's inventory item */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* ModifyItemUses(FServerModifyItemUsesRequest request, + FDelegateOnSuccessModifyItemUses onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperModifyItemUses(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessMoveItemToCharacterFromCharacter, FServerMoveItemToCharacterFromCharacterResult, result, UObject*, customData); + + /** Moves an item from a character's inventory into another of the users's character's inventory. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* MoveItemToCharacterFromCharacter(FServerMoveItemToCharacterFromCharacterRequest request, + FDelegateOnSuccessMoveItemToCharacterFromCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperMoveItemToCharacterFromCharacter(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessMoveItemToCharacterFromUser, FServerMoveItemToCharacterFromUserResult, result, UObject*, customData); + + /** Moves an item from a user's inventory into their character's inventory. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* MoveItemToCharacterFromUser(FServerMoveItemToCharacterFromUserRequest request, + FDelegateOnSuccessMoveItemToCharacterFromUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperMoveItemToCharacterFromUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessMoveItemToUserFromCharacter, FServerMoveItemToUserFromCharacterResult, result, UObject*, customData); + + /** Moves an item from a character's inventory into the owning user's inventory. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* MoveItemToUserFromCharacter(FServerMoveItemToUserFromCharacterRequest request, + FDelegateOnSuccessMoveItemToUserFromCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperMoveItemToUserFromCharacter(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRedeemCoupon, FServerRedeemCouponResult, result, UObject*, customData); + + /** + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the + * Economy->Catalogs tab in the PlayFab Game Manager. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RedeemCoupon(FServerRedeemCouponRequest request, + FDelegateOnSuccessRedeemCoupon onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRedeemCoupon(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessReportPlayer, FServerReportPlayerServerResult, result, UObject*, customData); + + /** + * Submit a report about a player (due to bad bahavior, etc.) on behalf of another player, so that customer service + * representatives for the title can take action concerning potentially toxic players. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* ReportPlayer(FServerReportPlayerServerRequest request, + FDelegateOnSuccessReportPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperReportPlayer(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeInventoryItem, FServerRevokeInventoryResult, result, UObject*, customData); + + /** Revokes access to an item in a user's inventory */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RevokeInventoryItem(FServerRevokeInventoryItemRequest request, + FDelegateOnSuccessRevokeInventoryItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeInventoryItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeInventoryItems, FServerRevokeInventoryItemsResult, result, UObject*, customData); + + /** Revokes access for up to 25 items across multiple users and characters. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RevokeInventoryItems(FServerRevokeInventoryItemsRequest request, + FDelegateOnSuccessRevokeInventoryItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeInventoryItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSubtractCharacterVirtualCurrency, FServerModifyCharacterVirtualCurrencyResult, result, UObject*, customData); + + /** + * Decrements the character's balance of the specified virtual currency by the stated amount. It is possible to make a VC + * balance negative with this API. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SubtractCharacterVirtualCurrency(FServerSubtractCharacterVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractCharacterVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSubtractCharacterVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSubtractUserVirtualCurrency, FServerModifyUserVirtualCurrencyResult, result, UObject*, customData); + + /** + * Decrements the user's balance of the specified virtual currency by the stated amount. It is possible to make a VC + * balance negative with this API. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SubtractUserVirtualCurrency(FServerSubtractUserVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSubtractUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlockContainerInstance, FServerUnlockContainerItemResult, result, UObject*, customData); + + /** + * Opens a specific container (ContainerItemInstanceId), with a specific key (KeyItemInstanceId, when required), and + * returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > + * 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UnlockContainerInstance(FServerUnlockContainerInstanceRequest request, + FDelegateOnSuccessUnlockContainerInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlockContainerInstance(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlockContainerItem, FServerUnlockContainerItemResult, result, UObject*, customData); + + /** + * Searches Player or Character inventory for any ItemInstance matching the given CatalogItemId, if necessary unlocks it + * using any appropriate key, and returns the contents of the opened container. If the container (and key when relevant) + * are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of + * ConsumeItem. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UnlockContainerItem(FServerUnlockContainerItemRequest request, + FDelegateOnSuccessUnlockContainerItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlockContainerItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserInventoryItemCustomData, FServerEmptyResponse, result, UObject*, customData); + + /** Updates the key-value pair data tagged to the specified item, which is read-only from the client. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserInventoryItemCustomData(FServerUpdateUserInventoryItemDataRequest request, + FDelegateOnSuccessUpdateUserInventoryItemCustomData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserInventoryItemCustomData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // PlayStream + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddPlayerTag, FServerAddPlayerTagResult, result, UObject*, customData); + + /** Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AddPlayerTag(FServerAddPlayerTagRequest request, + FDelegateOnSuccessAddPlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddPlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetAllSegments, FServerGetAllSegmentsResult, result, UObject*, customData); + + /** + * Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as + * GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetAllSegments(FServerGetAllSegmentsRequest request, + FDelegateOnSuccessGetAllSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetAllSegments(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerSegments, FServerGetPlayerSegmentsResult, result, UObject*, customData); + + /** List all segments that a player currently belongs to at this moment in time. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayerSegments(FServerGetPlayersSegmentsRequest request, + FDelegateOnSuccessGetPlayerSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerSegments(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayersInSegment, FServerGetPlayersInSegmentResult, result, UObject*, customData); + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match + * the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span + * on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected + * in the results. AB Test segments are currently not supported by this operation. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayersInSegment(FServerGetPlayersInSegmentRequest request, + FDelegateOnSuccessGetPlayersInSegment onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayersInSegment(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerTags, FServerGetPlayerTagsResult, result, UObject*, customData); + + /** Get all tags with a given Namespace (optional) from a player profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayerTags(FServerGetPlayerTagsRequest request, + FDelegateOnSuccessGetPlayerTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerTags(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemovePlayerTag, FServerRemovePlayerTagResult, result, UObject*, customData); + + /** Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RemovePlayerTag(FServerRemovePlayerTagRequest request, + FDelegateOnSuccessRemovePlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemovePlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessExecuteCloudScript, FServerExecuteCloudScriptResult, result, UObject*, customData); + + /** Executes a CloudScript function, with the 'currentPlayerId' variable set to the specified PlayFabId parameter value. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* ExecuteCloudScript(FServerExecuteCloudScriptServerRequest request, + FDelegateOnSuccessExecuteCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperExecuteCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Shared Group Data + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddSharedGroupMembers, FServerAddSharedGroupMembersResult, result, UObject*, customData); + + /** + * Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users + * in the group (and the server) can add new members. Shared Groups are designed for sharing data between a very small + * number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AddSharedGroupMembers(FServerAddSharedGroupMembersRequest request, + FDelegateOnSuccessAddSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreateSharedGroup, FServerCreateSharedGroupResult, result, UObject*, customData); + + /** + * Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the + * group. When created by a server, the group will initially have no members. Shared Groups are designed for sharing data + * between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* CreateSharedGroup(FServerCreateSharedGroupRequest request, + FDelegateOnSuccessCreateSharedGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreateSharedGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteSharedGroup, FServerEmptyResponse, result, UObject*, customData); + + /** + * Deletes a shared group, freeing up the shared group ID to be reused for a new group. Shared Groups are designed for + * sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* DeleteSharedGroup(FServerDeleteSharedGroupRequest request, + FDelegateOnSuccessDeleteSharedGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteSharedGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetSharedGroupData, FServerGetSharedGroupDataResult, result, UObject*, customData); + + /** + * Retrieves data stored in a shared group object, as well as the list of members in the group. The server can access all + * public and private group data. Shared Groups are designed for sharing data between a very small number of players, + * please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetSharedGroupData(FServerGetSharedGroupDataRequest request, + FDelegateOnSuccessGetSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveSharedGroupMembers, FServerRemoveSharedGroupMembersResult, result, UObject*, customData); + + /** + * Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the + * group can remove members. If as a result of the call, zero users remain with access, the group and its associated data + * will be deleted. Shared Groups are designed for sharing data between a very small number of players, please see our + * guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RemoveSharedGroupMembers(FServerRemoveSharedGroupMembersRequest request, + FDelegateOnSuccessRemoveSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateSharedGroupData, FServerUpdateSharedGroupDataResult, result, UObject*, customData); + + /** + * Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated + * or added in this call will be readable by users not in the group. By default, data permissions are set to Private. + * Regardless of the permission setting, only members of the group (and the server) can update the data. Shared Groups are + * designed for sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateSharedGroupData(FServerUpdateSharedGroupDataRequest request, + FDelegateOnSuccessUpdateSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Title-Wide Data Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCatalogItems, FServerGetCatalogItemsResult, result, UObject*, customData); + + /** Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCatalogItems(FServerGetCatalogItemsRequest request, + FDelegateOnSuccessGetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPublisherData, FServerGetPublisherDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom publisher settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPublisherData(FServerGetPublisherDataRequest request, + FDelegateOnSuccessGetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTime, FServerGetTimeResult, result, UObject*, customData); + + /** Retrieves the current server time */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetTime(FServerGetTimeRequest request, + FDelegateOnSuccessGetTime onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTime(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleData, FServerGetTitleDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom title settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetTitleData(FServerGetTitleDataRequest request, + FDelegateOnSuccessGetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleInternalData, FServerGetTitleDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom internal title settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetTitleInternalData(FServerGetTitleDataRequest request, + FDelegateOnSuccessGetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleNews, FServerGetTitleNewsResult, result, UObject*, customData); + + /** Retrieves the title news feed, as configured in the developer portal */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetTitleNews(FServerGetTitleNewsRequest request, + FDelegateOnSuccessGetTitleNews onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleNews(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetPublisherData, FServerSetPublisherDataResult, result, UObject*, customData); + + /** Updates the key-value store of custom publisher settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetPublisherData(FServerSetPublisherDataRequest request, + FDelegateOnSuccessSetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetTitleData, FServerSetTitleDataResult, result, UObject*, customData); + + /** Updates the key-value store of custom title settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetTitleData(FServerSetTitleDataRequest request, + FDelegateOnSuccessSetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetTitleInternalData, FServerSetTitleDataResult, result, UObject*, customData); + + /** Updates the key-value store of custom title settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetTitleInternalData(FServerSetTitleDataRequest request, + FDelegateOnSuccessSetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessBanUsers OnSuccessBanUsers; + FDelegateOnSuccessGetPlayerProfile OnSuccessGetPlayerProfile; + FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs OnSuccessGetPlayFabIDsFromFacebookIDs; + FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds; + FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds; + FDelegateOnSuccessGetPlayFabIDsFromSteamIDs OnSuccessGetPlayFabIDsFromSteamIDs; + FDelegateOnSuccessGetUserAccountInfo OnSuccessGetUserAccountInfo; + FDelegateOnSuccessGetUserBans OnSuccessGetUserBans; + FDelegateOnSuccessRevokeAllBansForUser OnSuccessRevokeAllBansForUser; + FDelegateOnSuccessRevokeBans OnSuccessRevokeBans; + FDelegateOnSuccessSendCustomAccountRecoveryEmail OnSuccessSendCustomAccountRecoveryEmail; + FDelegateOnSuccessSendEmailFromTemplate OnSuccessSendEmailFromTemplate; + FDelegateOnSuccessSendPushNotification OnSuccessSendPushNotification; + FDelegateOnSuccessUpdateAvatarUrl OnSuccessUpdateAvatarUrl; + FDelegateOnSuccessUpdateBans OnSuccessUpdateBans; + FDelegateOnSuccessWriteCharacterEvent OnSuccessWriteCharacterEvent; + FDelegateOnSuccessWritePlayerEvent OnSuccessWritePlayerEvent; + FDelegateOnSuccessWriteTitleEvent OnSuccessWriteTitleEvent; + FDelegateOnSuccessAuthenticateSessionTicket OnSuccessAuthenticateSessionTicket; + FDelegateOnSuccessSetPlayerSecret OnSuccessSetPlayerSecret; + FDelegateOnSuccessGetCharacterData OnSuccessGetCharacterData; + FDelegateOnSuccessGetCharacterInternalData OnSuccessGetCharacterInternalData; + FDelegateOnSuccessGetCharacterReadOnlyData OnSuccessGetCharacterReadOnlyData; + FDelegateOnSuccessUpdateCharacterData OnSuccessUpdateCharacterData; + FDelegateOnSuccessUpdateCharacterInternalData OnSuccessUpdateCharacterInternalData; + FDelegateOnSuccessUpdateCharacterReadOnlyData OnSuccessUpdateCharacterReadOnlyData; + FDelegateOnSuccessDeleteCharacterFromUser OnSuccessDeleteCharacterFromUser; + FDelegateOnSuccessGetAllUsersCharacters OnSuccessGetAllUsersCharacters; + FDelegateOnSuccessGetCharacterLeaderboard OnSuccessGetCharacterLeaderboard; + FDelegateOnSuccessGetCharacterStatistics OnSuccessGetCharacterStatistics; + FDelegateOnSuccessGetLeaderboardAroundCharacter OnSuccessGetLeaderboardAroundCharacter; + FDelegateOnSuccessGetLeaderboardForUserCharacters OnSuccessGetLeaderboardForUserCharacters; + FDelegateOnSuccessGrantCharacterToUser OnSuccessGrantCharacterToUser; + FDelegateOnSuccessUpdateCharacterStatistics OnSuccessUpdateCharacterStatistics; + FDelegateOnSuccessGetContentDownloadUrl OnSuccessGetContentDownloadUrl; + FDelegateOnSuccessAddFriend OnSuccessAddFriend; + FDelegateOnSuccessGetFriendsList OnSuccessGetFriendsList; + FDelegateOnSuccessRemoveFriend OnSuccessRemoveFriend; + FDelegateOnSuccessSetFriendTags OnSuccessSetFriendTags; + FDelegateOnSuccessDeregisterGame OnSuccessDeregisterGame; + FDelegateOnSuccessNotifyMatchmakerPlayerLeft OnSuccessNotifyMatchmakerPlayerLeft; + FDelegateOnSuccessRedeemMatchmakerTicket OnSuccessRedeemMatchmakerTicket; + FDelegateOnSuccessRefreshGameServerInstanceHeartbeat OnSuccessRefreshGameServerInstanceHeartbeat; + FDelegateOnSuccessRegisterGame OnSuccessRegisterGame; + FDelegateOnSuccessSetGameServerInstanceData OnSuccessSetGameServerInstanceData; + FDelegateOnSuccessSetGameServerInstanceState OnSuccessSetGameServerInstanceState; + FDelegateOnSuccessSetGameServerInstanceTags OnSuccessSetGameServerInstanceTags; + FDelegateOnSuccessAwardSteamAchievement OnSuccessAwardSteamAchievement; + FDelegateOnSuccessDeleteUsers OnSuccessDeleteUsers; + FDelegateOnSuccessGetFriendLeaderboard OnSuccessGetFriendLeaderboard; + FDelegateOnSuccessGetLeaderboard OnSuccessGetLeaderboard; + FDelegateOnSuccessGetLeaderboardAroundUser OnSuccessGetLeaderboardAroundUser; + FDelegateOnSuccessGetPlayerCombinedInfo OnSuccessGetPlayerCombinedInfo; + FDelegateOnSuccessGetPlayerStatistics OnSuccessGetPlayerStatistics; + FDelegateOnSuccessGetPlayerStatisticVersions OnSuccessGetPlayerStatisticVersions; + FDelegateOnSuccessGetUserData OnSuccessGetUserData; + FDelegateOnSuccessGetUserInternalData OnSuccessGetUserInternalData; + FDelegateOnSuccessGetUserPublisherData OnSuccessGetUserPublisherData; + FDelegateOnSuccessGetUserPublisherInternalData OnSuccessGetUserPublisherInternalData; + FDelegateOnSuccessGetUserPublisherReadOnlyData OnSuccessGetUserPublisherReadOnlyData; + FDelegateOnSuccessGetUserReadOnlyData OnSuccessGetUserReadOnlyData; + FDelegateOnSuccessUpdatePlayerStatistics OnSuccessUpdatePlayerStatistics; + FDelegateOnSuccessUpdateUserData OnSuccessUpdateUserData; + FDelegateOnSuccessUpdateUserInternalData OnSuccessUpdateUserInternalData; + FDelegateOnSuccessUpdateUserPublisherData OnSuccessUpdateUserPublisherData; + FDelegateOnSuccessUpdateUserPublisherInternalData OnSuccessUpdateUserPublisherInternalData; + FDelegateOnSuccessUpdateUserPublisherReadOnlyData OnSuccessUpdateUserPublisherReadOnlyData; + FDelegateOnSuccessUpdateUserReadOnlyData OnSuccessUpdateUserReadOnlyData; + FDelegateOnSuccessAddCharacterVirtualCurrency OnSuccessAddCharacterVirtualCurrency; + FDelegateOnSuccessAddUserVirtualCurrency OnSuccessAddUserVirtualCurrency; + FDelegateOnSuccessConsumeItem OnSuccessConsumeItem; + FDelegateOnSuccessEvaluateRandomResultTable OnSuccessEvaluateRandomResultTable; + FDelegateOnSuccessGetCharacterInventory OnSuccessGetCharacterInventory; + FDelegateOnSuccessGetRandomResultTables OnSuccessGetRandomResultTables; + FDelegateOnSuccessGetUserInventory OnSuccessGetUserInventory; + FDelegateOnSuccessGrantItemsToCharacter OnSuccessGrantItemsToCharacter; + FDelegateOnSuccessGrantItemsToUser OnSuccessGrantItemsToUser; + FDelegateOnSuccessGrantItemsToUsers OnSuccessGrantItemsToUsers; + FDelegateOnSuccessModifyItemUses OnSuccessModifyItemUses; + FDelegateOnSuccessMoveItemToCharacterFromCharacter OnSuccessMoveItemToCharacterFromCharacter; + FDelegateOnSuccessMoveItemToCharacterFromUser OnSuccessMoveItemToCharacterFromUser; + FDelegateOnSuccessMoveItemToUserFromCharacter OnSuccessMoveItemToUserFromCharacter; + FDelegateOnSuccessRedeemCoupon OnSuccessRedeemCoupon; + FDelegateOnSuccessReportPlayer OnSuccessReportPlayer; + FDelegateOnSuccessRevokeInventoryItem OnSuccessRevokeInventoryItem; + FDelegateOnSuccessRevokeInventoryItems OnSuccessRevokeInventoryItems; + FDelegateOnSuccessSubtractCharacterVirtualCurrency OnSuccessSubtractCharacterVirtualCurrency; + FDelegateOnSuccessSubtractUserVirtualCurrency OnSuccessSubtractUserVirtualCurrency; + FDelegateOnSuccessUnlockContainerInstance OnSuccessUnlockContainerInstance; + FDelegateOnSuccessUnlockContainerItem OnSuccessUnlockContainerItem; + FDelegateOnSuccessUpdateUserInventoryItemCustomData OnSuccessUpdateUserInventoryItemCustomData; + FDelegateOnSuccessAddPlayerTag OnSuccessAddPlayerTag; + FDelegateOnSuccessGetAllSegments OnSuccessGetAllSegments; + FDelegateOnSuccessGetPlayerSegments OnSuccessGetPlayerSegments; + FDelegateOnSuccessGetPlayersInSegment OnSuccessGetPlayersInSegment; + FDelegateOnSuccessGetPlayerTags OnSuccessGetPlayerTags; + FDelegateOnSuccessRemovePlayerTag OnSuccessRemovePlayerTag; + FDelegateOnSuccessExecuteCloudScript OnSuccessExecuteCloudScript; + FDelegateOnSuccessAddSharedGroupMembers OnSuccessAddSharedGroupMembers; + FDelegateOnSuccessCreateSharedGroup OnSuccessCreateSharedGroup; + FDelegateOnSuccessDeleteSharedGroup OnSuccessDeleteSharedGroup; + FDelegateOnSuccessGetSharedGroupData OnSuccessGetSharedGroupData; + FDelegateOnSuccessRemoveSharedGroupMembers OnSuccessRemoveSharedGroupMembers; + FDelegateOnSuccessUpdateSharedGroupData OnSuccessUpdateSharedGroupData; + FDelegateOnSuccessGetCatalogItems OnSuccessGetCatalogItems; + FDelegateOnSuccessGetPublisherData OnSuccessGetPublisherData; + FDelegateOnSuccessGetTime OnSuccessGetTime; + FDelegateOnSuccessGetTitleData OnSuccessGetTitleData; + FDelegateOnSuccessGetTitleInternalData OnSuccessGetTitleInternalData; + FDelegateOnSuccessGetTitleNews OnSuccessGetTitleNews; + FDelegateOnSuccessSetPublisherData OnSuccessSetPublisherData; + FDelegateOnSuccessSetTitleData OnSuccessSetTitleData; + FDelegateOnSuccessSetTitleInternalData OnSuccessSetTitleInternalData; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabServerModelDecoder.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabServerModelDecoder.h new file mode 100644 index 000000000..14b2f3d1e --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabServerModelDecoder.h @@ -0,0 +1,469 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Server +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabServerModels.h" +#include "PlayFabServerModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabServerModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Server API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + + /** Decode the BanUsersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerBanUsersResult decodeBanUsersResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerProfileResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetPlayerProfileResult decodeGetPlayerProfileResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromFacebookIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetPlayFabIDsFromFacebookIDsResult decodeGetPlayFabIDsFromFacebookIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromFacebookInstantGamesIdsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetPlayFabIDsFromFacebookInstantGamesIdsResult decodeGetPlayFabIDsFromFacebookInstantGamesIdsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromNintendoSwitchDeviceIdsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsResult decodeGetPlayFabIDsFromNintendoSwitchDeviceIdsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromSteamIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetPlayFabIDsFromSteamIDsResult decodeGetPlayFabIDsFromSteamIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserAccountInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetUserAccountInfoResult decodeGetUserAccountInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserBansResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetUserBansResult decodeGetUserBansResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeAllBansForUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerRevokeAllBansForUserResult decodeRevokeAllBansForUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeBansResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerRevokeBansResult decodeRevokeBansResultResponse(UPlayFabJsonObject* response); + + /** Decode the SendCustomAccountRecoveryEmailResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerSendCustomAccountRecoveryEmailResult decodeSendCustomAccountRecoveryEmailResultResponse(UPlayFabJsonObject* response); + + /** Decode the SendEmailFromTemplateResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerSendEmailFromTemplateResult decodeSendEmailFromTemplateResultResponse(UPlayFabJsonObject* response); + + /** Decode the SendPushNotificationResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerSendPushNotificationResult decodeSendPushNotificationResultResponse(UPlayFabJsonObject* response); + + /** Decode the EmptyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerEmptyResponse decodeEmptyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateBansResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerUpdateBansResult decodeUpdateBansResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Analytics + ////////////////////////////////////////////////////// + + /** Decode the WriteEventResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics Models") + static FServerWriteEventResponse decodeWriteEventResponseResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + + /** Decode the AuthenticateSessionTicketResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Authentication Models") + static FServerAuthenticateSessionTicketResult decodeAuthenticateSessionTicketResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetPlayerSecretResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Authentication Models") + static FServerSetPlayerSecretResult decodeSetPlayerSecretResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Character Data + ////////////////////////////////////////////////////// + + /** Decode the GetCharacterDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data Models") + static FServerGetCharacterDataResult decodeGetCharacterDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateCharacterDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data Models") + static FServerUpdateCharacterDataResult decodeUpdateCharacterDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Characters + ////////////////////////////////////////////////////// + + /** Decode the DeleteCharacterFromUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerDeleteCharacterFromUserResult decodeDeleteCharacterFromUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the ListUsersCharactersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerListUsersCharactersResult decodeListUsersCharactersResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCharacterLeaderboardResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerGetCharacterLeaderboardResult decodeGetCharacterLeaderboardResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCharacterStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerGetCharacterStatisticsResult decodeGetCharacterStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardAroundCharacterResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerGetLeaderboardAroundCharacterResult decodeGetLeaderboardAroundCharacterResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardForUsersCharactersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerGetLeaderboardForUsersCharactersResult decodeGetLeaderboardForUsersCharactersResultResponse(UPlayFabJsonObject* response); + + /** Decode the GrantCharacterToUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerGrantCharacterToUserResult decodeGrantCharacterToUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateCharacterStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerUpdateCharacterStatisticsResult decodeUpdateCharacterStatisticsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Content + ////////////////////////////////////////////////////// + + /** Decode the GetContentDownloadUrlResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Content Models") + static FServerGetContentDownloadUrlResult decodeGetContentDownloadUrlResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Friend List Management + ////////////////////////////////////////////////////// + + /** Decode the GetFriendsListResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management Models") + static FServerGetFriendsListResult decodeGetFriendsListResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + + /** Decode the DeregisterGameResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerDeregisterGameResponse decodeDeregisterGameResponseResponse(UPlayFabJsonObject* response); + + /** Decode the NotifyMatchmakerPlayerLeftResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerNotifyMatchmakerPlayerLeftResult decodeNotifyMatchmakerPlayerLeftResultResponse(UPlayFabJsonObject* response); + + /** Decode the RedeemMatchmakerTicketResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerRedeemMatchmakerTicketResult decodeRedeemMatchmakerTicketResultResponse(UPlayFabJsonObject* response); + + /** Decode the RefreshGameServerInstanceHeartbeatResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerRefreshGameServerInstanceHeartbeatResult decodeRefreshGameServerInstanceHeartbeatResultResponse(UPlayFabJsonObject* response); + + /** Decode the RegisterGameResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerRegisterGameResponse decodeRegisterGameResponseResponse(UPlayFabJsonObject* response); + + /** Decode the SetGameServerInstanceDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerSetGameServerInstanceDataResult decodeSetGameServerInstanceDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetGameServerInstanceStateResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerSetGameServerInstanceStateResult decodeSetGameServerInstanceStateResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetGameServerInstanceTagsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerSetGameServerInstanceTagsResult decodeSetGameServerInstanceTagsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Platform Specific Methods + ////////////////////////////////////////////////////// + + /** Decode the AwardSteamAchievementResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Platform Specific Methods Models") + static FServerAwardSteamAchievementResult decodeAwardSteamAchievementResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Player Data Management + ////////////////////////////////////////////////////// + + /** Decode the DeleteUsersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerDeleteUsersResult decodeDeleteUsersResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerGetLeaderboardResult decodeGetLeaderboardResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardAroundUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerGetLeaderboardAroundUserResult decodeGetLeaderboardAroundUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerCombinedInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerGetPlayerCombinedInfoResult decodeGetPlayerCombinedInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerGetPlayerStatisticsResult decodeGetPlayerStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerStatisticVersionsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerGetPlayerStatisticVersionsResult decodeGetPlayerStatisticVersionsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerGetUserDataResult decodeGetUserDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdatePlayerStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerUpdatePlayerStatisticsResult decodeUpdatePlayerStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateUserDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerUpdateUserDataResult decodeUpdateUserDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Player Item Management + ////////////////////////////////////////////////////// + + /** Decode the ModifyCharacterVirtualCurrencyResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerModifyCharacterVirtualCurrencyResult decodeModifyCharacterVirtualCurrencyResultResponse(UPlayFabJsonObject* response); + + /** Decode the ModifyUserVirtualCurrencyResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerModifyUserVirtualCurrencyResult decodeModifyUserVirtualCurrencyResultResponse(UPlayFabJsonObject* response); + + /** Decode the ConsumeItemResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerConsumeItemResult decodeConsumeItemResultResponse(UPlayFabJsonObject* response); + + /** Decode the EvaluateRandomResultTableResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerEvaluateRandomResultTableResult decodeEvaluateRandomResultTableResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCharacterInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerGetCharacterInventoryResult decodeGetCharacterInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetRandomResultTablesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerGetRandomResultTablesResult decodeGetRandomResultTablesResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerGetUserInventoryResult decodeGetUserInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the GrantItemsToCharacterResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerGrantItemsToCharacterResult decodeGrantItemsToCharacterResultResponse(UPlayFabJsonObject* response); + + /** Decode the GrantItemsToUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerGrantItemsToUserResult decodeGrantItemsToUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the GrantItemsToUsersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerGrantItemsToUsersResult decodeGrantItemsToUsersResultResponse(UPlayFabJsonObject* response); + + /** Decode the ModifyItemUsesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerModifyItemUsesResult decodeModifyItemUsesResultResponse(UPlayFabJsonObject* response); + + /** Decode the MoveItemToCharacterFromCharacterResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerMoveItemToCharacterFromCharacterResult decodeMoveItemToCharacterFromCharacterResultResponse(UPlayFabJsonObject* response); + + /** Decode the MoveItemToCharacterFromUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerMoveItemToCharacterFromUserResult decodeMoveItemToCharacterFromUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the MoveItemToUserFromCharacterResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerMoveItemToUserFromCharacterResult decodeMoveItemToUserFromCharacterResultResponse(UPlayFabJsonObject* response); + + /** Decode the RedeemCouponResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerRedeemCouponResult decodeRedeemCouponResultResponse(UPlayFabJsonObject* response); + + /** Decode the ReportPlayerServerResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerReportPlayerServerResult decodeReportPlayerServerResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerRevokeInventoryResult decodeRevokeInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeInventoryItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerRevokeInventoryItemsResult decodeRevokeInventoryItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlockContainerItemResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerUnlockContainerItemResult decodeUnlockContainerItemResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // PlayStream + ////////////////////////////////////////////////////// + + /** Decode the AddPlayerTagResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream Models") + static FServerAddPlayerTagResult decodeAddPlayerTagResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetAllSegmentsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream Models") + static FServerGetAllSegmentsResult decodeGetAllSegmentsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerSegmentsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream Models") + static FServerGetPlayerSegmentsResult decodeGetPlayerSegmentsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayersInSegmentResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream Models") + static FServerGetPlayersInSegmentResult decodeGetPlayersInSegmentResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerTagsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream Models") + static FServerGetPlayerTagsResult decodeGetPlayerTagsResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemovePlayerTagResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream Models") + static FServerRemovePlayerTagResult decodeRemovePlayerTagResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + + /** Decode the ExecuteCloudScriptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Server-Side Cloud Script Models") + static FServerExecuteCloudScriptResult decodeExecuteCloudScriptResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Shared Group Data + ////////////////////////////////////////////////////// + + /** Decode the AddSharedGroupMembersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data Models") + static FServerAddSharedGroupMembersResult decodeAddSharedGroupMembersResultResponse(UPlayFabJsonObject* response); + + /** Decode the CreateSharedGroupResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data Models") + static FServerCreateSharedGroupResult decodeCreateSharedGroupResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetSharedGroupDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data Models") + static FServerGetSharedGroupDataResult decodeGetSharedGroupDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemoveSharedGroupMembersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data Models") + static FServerRemoveSharedGroupMembersResult decodeRemoveSharedGroupMembersResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateSharedGroupDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data Models") + static FServerUpdateSharedGroupDataResult decodeUpdateSharedGroupDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Title-Wide Data Management + ////////////////////////////////////////////////////// + + /** Decode the GetCatalogItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerGetCatalogItemsResult decodeGetCatalogItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPublisherDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerGetPublisherDataResult decodeGetPublisherDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTimeResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerGetTimeResult decodeGetTimeResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTitleDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerGetTitleDataResult decodeGetTitleDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTitleNewsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerGetTitleNewsResult decodeGetTitleNewsResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetPublisherDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerSetPublisherDataResult decodeSetPublisherDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetTitleDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerSetTitleDataResult decodeSetTitleDataResultResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabServerModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabServerModels.h new file mode 100644 index 000000000..9ee11d1cd --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabServerModels.h @@ -0,0 +1,2682 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Server +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabServerModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Server API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerBanUsersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** List of ban requests to be applied. Maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray Bans; +}; + +USTRUCT(BlueprintType) +struct FServerBanUsersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were applied */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerProfileRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerProfileResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The profile of the player. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + UPlayFabJsonObject* PlayerProfile = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromFacebookIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString FacebookIDs; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromFacebookIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Facebook identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromFacebookInstantGamesIdsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Facebook Instant Games identifiers for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString FacebookInstantGamesIds; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromFacebookInstantGamesIdsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Facebook Instant Games identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Nintendo Switch Device identifiers for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString NintendoSwitchDeviceIds; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Nintendo Switch Device identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromSteamIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString SteamStringIDs; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromSteamIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Steam identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserAccountInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserAccountInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Account details for the user whose information was requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + UPlayFabJsonObject* UserInfo = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserBansRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserBansResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information about the bans */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeAllBansForUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeAllBansForUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were revoked. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeBansRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Ids of the bans to be revoked. Maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString BanIds; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeBansResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were revoked */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FServerSendCustomAccountRecoveryEmailRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** User email address attached to their account */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString Email; + /** The email template id of the account recovery email template to send. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString EmailTemplateId; + /** The user's username requesting an account recovery. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FServerSendCustomAccountRecoveryEmailResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerSendEmailFromTemplateRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The email template id of the email template to send. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString EmailTemplateId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerSendEmailFromTemplateResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerSendPushNotificationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Allows you to provide precisely formatted json to target devices. This is an advanced feature, allowing you to deliver + * to custom plugin logic, fields, or functionality not natively supported by PlayFab. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray AdvancedPlatformDelivery; + /** Text of message to send. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString Message; + /** + * Defines all possible push attributes like message, title, icon, etc. Some parameters are device specific - please see + * the PushNotificationPackage documentation for details. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + UPlayFabJsonObject* Package = nullptr; + /** PlayFabId of the recipient of the push notification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString Recipient; + /** Subject of message to send (may not be displayed in all platforms) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString Subject; + /** Target Platforms that should receive the Message or Package. If omitted, we will send to all available platforms. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString TargetPlatforms; +}; + +USTRUCT(BlueprintType) +struct FServerSendPushNotificationResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerEmptyResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerUpdateAvatarUrlRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** URL of the avatar image. If empty, it removes the existing avatar URL. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString ImageUrl; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateBansRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** List of bans to be updated. Maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray Bans; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateBansResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were updated */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray BanData; +}; + + +/////////////////////////////////////////////////////// +// Analytics +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerWriteEventResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to + * any particular format. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString EventId; +}; + +USTRUCT(BlueprintType) +struct FServerWriteServerCharacterEventRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom event properties. Each property consists of a name (string) and a value (JSON object). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + UPlayFabJsonObject* Body = nullptr; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString CharacterId; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString EventName; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString PlayFabId; + /** The time (in UTC) associated with this event. The value dafaults to the current time. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString Timestamp; +}; + +USTRUCT(BlueprintType) +struct FServerWriteServerPlayerEventRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom data properties associated with the event. Each property consists of a name (string) and a value (JSON object). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + UPlayFabJsonObject* Body = nullptr; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString EventName; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString PlayFabId; + /** The time (in UTC) associated with this event. The value dafaults to the current time. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString Timestamp; +}; + +USTRUCT(BlueprintType) +struct FServerWriteTitleEventRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom event properties. Each property consists of a name (string) and a value (JSON object). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + UPlayFabJsonObject* Body = nullptr; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString EventName; + /** The time (in UTC) associated with this event. The value dafaults to the current time. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString Timestamp; +}; + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerAuthenticateSessionTicketRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Session ticket as issued by a PlayFab client login API. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Authentication Models") + FString SessionTicket; +}; + +USTRUCT(BlueprintType) +struct FServerAuthenticateSessionTicketResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Account info for the user whose session ticket was supplied. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Authentication Models") + UPlayFabJsonObject* UserInfo = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerSetPlayerSecretRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Authentication Models") + FString PlayerSecret; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Authentication Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerSetPlayerSecretResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Character Data +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerGetCharacterDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString CharacterId; + /** + * The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + int32 IfChangedFromDataVersion = 0; + /** Specific keys to search for in the custom user data. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString Keys; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString CharacterId; + /** User specific data for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + UPlayFabJsonObject* Data = nullptr; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + int32 DataVersion = 0; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateCharacterDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString CharacterId; + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString KeysToRemove; + /** Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + EUserDataPermission Permission; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateCharacterDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + int32 DataVersion = 0; +}; + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerDeleteCharacterFromUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; + /** + * If true, the character's inventory will be transferred up to the owning user; otherwise, this request will purge those + * items. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + bool SaveCharacterInventory = false; +}; + +USTRUCT(BlueprintType) +struct FServerDeleteCharacterFromUserResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerListUsersCharactersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerListUsersCharactersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list of characters. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + TArray Characters; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterLeaderboardRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional character type on which to filter the leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterType; + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + int32 MaxResultsCount = 0; + /** First entry in the leaderboard to be retrieved. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + int32 StartPosition = 0; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterLeaderboardResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered list of leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + TArray Leaderboard; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the character for the statistics. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterId; + /** Character statistics for the requested user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + UPlayFabJsonObject* CharacterStatistics; + /** PlayFab unique identifier of the user whose character statistics are being returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardAroundCharacterRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterId; + /** Optional character type on which to filter the leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterType; + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + int32 MaxResultsCount = 0; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardAroundCharacterResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered list of leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + TArray Leaderboard; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardForUsersCharactersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + int32 MaxResultsCount = 0; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardForUsersCharactersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered list of leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + TArray Leaderboard; +}; + +USTRUCT(BlueprintType) +struct FServerGrantCharacterToUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Non-unique display name of the character being granted (1-20 characters in length). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterName; + /** Type of the character being granted; statistics can be sliced based on this value. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterType; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGrantCharacterToUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier tagged to this character. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateCharacterStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterId; + /** Statistics to be updated with the provided values. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + UPlayFabJsonObject* CharacterStatistics; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateCharacterStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerGetContentDownloadUrlRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** HTTP method to fetch item - GET or HEAD. Use HEAD when only fetching metadata. Default is GET. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Content Models") + FString HttpMethod; + /** Key of the content item to fetch, usually formatted as a path, e.g. images/a.png */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Content Models") + FString Key; + /** + * True to download through CDN. CDN provides higher download bandwidth and lower latency. However, if you want the latest, + * non-cached version of the content during development, set this to false. Default is true. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Content Models") + bool ThruCDN = false; +}; + +USTRUCT(BlueprintType) +struct FServerGetContentDownloadUrlResult +{ + GENERATED_USTRUCT_BODY() +public: + /** URL for downloading content via HTTP GET or HEAD method. The URL will expire in approximately one hour. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Content Models") + FString URL; +}; + + +/////////////////////////////////////////////////////// +// Friend List Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerAddFriendRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Email address of the user being added. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString FriendEmail; + /** The PlayFab identifier of the user being added. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString FriendPlayFabId; + /** Title-specific display name of the user to being added. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString FriendTitleDisplayName; + /** The PlayFab username of the user being added */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString FriendUsername; + /** PlayFab identifier of the player to add a new friend. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetFriendsListRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Indicates whether Facebook friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + bool IncludeFacebookFriends = false; + /** Indicates whether Steam service friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + bool IncludeSteamFriends = false; + /** PlayFab identifier of the player whose friend list to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FServerGetFriendsListResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of friends found. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + TArray Friends; +}; + +USTRUCT(BlueprintType) +struct FServerRemoveFriendRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab identifier of the friend account which is to be removed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString FriendPlayFabId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerSetFriendTagsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab identifier of the friend account to which the tag(s) should be applied. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString FriendPlayFabId; + /** PlayFab identifier of the player whose friend is to be updated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString PlayFabId; + /** Array of tags to set on the friend account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString Tags; +}; + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerDeregisterGameRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the Game Server Instance that is being deregistered. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; +}; + +USTRUCT(BlueprintType) +struct FServerDeregisterGameResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerNotifyMatchmakerPlayerLeftRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the Game Instance the user is leaving. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerNotifyMatchmakerPlayerLeftResult +{ + GENERATED_USTRUCT_BODY() +public: + /** State of user leaving the Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + EPlayerConnectionState PlayerState; +}; + +USTRUCT(BlueprintType) +struct FServerRedeemMatchmakerTicketRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the Game Server Instance that is asking for validation of the authorization ticket. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; + /** Server authorization ticket passed back from a call to Matchmake or StartGame. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString Ticket; +}; + +USTRUCT(BlueprintType) +struct FServerRedeemMatchmakerTicketResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Error value if the ticket was not validated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString Error; + /** Boolean indicating whether the ticket was validated by the PlayFab service. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + bool TicketIsValid = false; + /** User account information for the user validated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + UPlayFabJsonObject* UserInfo = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerRefreshGameServerInstanceHeartbeatRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the Game Server Instance for which the heartbeat is updated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; +}; + +USTRUCT(BlueprintType) +struct FServerRefreshGameServerInstanceHeartbeatResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerRegisterGameRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the build running on the Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString Build; + /** + * Game Mode the Game Server instance is running. Note that this must be defined in the Game Modes tab in the PlayFab Game + * Manager, along with the Build ID (the same Game Mode can be defined for multiple Build IDs). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString GameMode; + /** Previous lobby id if re-registering an existing game. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; + /** + * Region in which the Game Server Instance is running. For matchmaking using non-AWS region names, set this to any AWS + * region and use Tags (below) to specify your custom region. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + ERegion Region; + /** IPV4 address of the Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString ServerHost; + /** IPV4 address of the game server instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString ServerIPV4Address; + /** IPV6 address (if any) of the game server instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString ServerIPV6Address; + /** Port number for communication with the Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString ServerPort; + /** Public DNS name (if any) of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString ServerPublicDNSName; + /** Tags for the Game Server Instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + UPlayFabJsonObject* Tags; +}; + +USTRUCT(BlueprintType) +struct FServerRegisterGameResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Unique identifier generated for the Game Server Instance that is registered. If LobbyId is specified in request and the + * game still exists in PlayFab, the LobbyId in request is returned. Otherwise a new lobby id will be returned. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; +}; + +USTRUCT(BlueprintType) +struct FServerSetGameServerInstanceDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom data to set for the specified game server instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString GameServerData; + /** Unique identifier of the Game Instance to be updated, in decimal format. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; +}; + +USTRUCT(BlueprintType) +struct FServerSetGameServerInstanceDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerSetGameServerInstanceStateRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the Game Instance to be updated, in decimal format. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; + /** State to set for the specified game server instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + EGameInstanceState State; +}; + +USTRUCT(BlueprintType) +struct FServerSetGameServerInstanceStateResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerSetGameServerInstanceTagsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the Game Server Instance to be updated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; + /** + * Tags to set for the specified Game Server Instance. Note that this is the complete list of tags to be associated with + * the Game Server Instance. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + UPlayFabJsonObject* Tags; +}; + +USTRUCT(BlueprintType) +struct FServerSetGameServerInstanceTagsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Platform Specific Methods +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerAwardSteamAchievementRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of achievements to grant and the users to whom they are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Platform Specific Methods Models") + TArray Achievements; +}; + +USTRUCT(BlueprintType) +struct FServerAwardSteamAchievementResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of achievements granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Platform Specific Methods Models") + TArray AchievementResults; +}; + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerDeleteUsersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** An array of unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabIds; +}; + +USTRUCT(BlueprintType) +struct FServerDeleteUsersResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerGetFriendLeaderboardRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Indicates whether Facebook friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + bool IncludeFacebookFriends = false; + /** Indicates whether Steam service friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + bool IncludeSteamFriends = false; + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 MaxResultsCount = 0; + /** The player whose friend leaderboard to get */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Position in the leaderboard to start this listing (defaults to the first entry). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 StartPosition = 0; + /** Statistic used to rank friends for this leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 Version = 0; + /** Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered listing of users and their positions in the requested leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + TArray Leaderboard; + /** The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString NextReset; + /** The version of the leaderboard returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 MaxResultsCount = 0; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** First entry in the leaderboard to be retrieved. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 StartPosition = 0; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardAroundUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 MaxResultsCount = 0; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardAroundUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered listing of users and their positions in the requested leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + TArray Leaderboard; + /** The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString NextReset; + /** The version of the leaderboard returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerCombinedInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** PlayFabId of the user whose data will be returned */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerCombinedInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Results for requested info. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* InfoResultPayload = nullptr; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** user for whom statistics are being requested */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; + /** statistics to return */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString StatisticNames; + /** + * statistics to return, if StatisticNames is not set (only statistics which have a version matching that provided will be + * returned) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + TArray StatisticNameVersions; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab unique identifier of the user whose statistics are being returned */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; + /** User statistics for the requested user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + TArray Statistics; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerStatisticVersionsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique name of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerStatisticVersionsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** version change history of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + TArray StatisticVersions; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 IfChangedFromDataVersion = 0; + /** Specific keys to search for in the custom user data. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString Keys; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** User specific data for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* Data = nullptr; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 DataVersion = 0; + /** PlayFab unique identifier of the user whose custom data is being returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdatePlayerStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Indicates whether the statistics provided should be set, regardless of the aggregation method set on the statistic. + * Default is false. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + bool ForceUpdate = false; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; + /** Statistics to be updated with the provided values */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + TArray Statistics; +}; + +USTRUCT(BlueprintType) +struct FServerUpdatePlayerStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerUpdateUserDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString KeysToRemove; + /** Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + EUserDataPermission Permission; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateUserDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 DataVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateUserInternalDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString KeysToRemove; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; +}; + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerAddCharacterVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Amount to be added to the character balance of the specified virtual currency. Maximum VC balance is Int32 + * (2,147,483,647). Any increase over this value will be discarded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 Amount = 0; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** PlayFab unique identifier of the user whose virtual currency balance is to be incremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which is to be incremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerModifyCharacterVirtualCurrencyResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Balance of the virtual currency after modification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 Balance = 0; + /** Name of the virtual currency which was modified. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerAddUserVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Amount to be added to the user balance of the specified virtual currency. Maximum VC balance is Int32 (2,147,483,647). + * Any increase over this value will be discarded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 Amount = 0; + /** PlayFab unique identifier of the user whose virtual currency balance is to be increased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which is to be incremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerModifyUserVirtualCurrencyResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Balance of the virtual currency after modification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 Balance = 0; + /** + * Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase + * over this value will be discarded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 BalanceChange = 0; + /** User currency was subtracted from. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which was modified. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerConsumeItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Number of uses to consume from the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 ConsumeCount = 0; + /** Unique instance identifier of the item to be consumed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerConsumeItemResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique instance identifier of the item with uses consumed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Number of uses remaining on the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 RemainingUses = 0; +}; + +USTRUCT(BlueprintType) +struct FServerEvaluateRandomResultTableRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Specifies the catalog version that should be used to evaluate the Random Result Table. If unspecified, uses + * default/primary catalog. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** The unique identifier of the Random Result Table to use. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString TableId; +}; + +USTRUCT(BlueprintType) +struct FServerEvaluateRandomResultTableResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the item returned from the Random Result Table evaluation, for the given catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ResultItemId; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterInventoryRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Used to limit results to only those from a specific catalog version. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the character for this inventory. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Array of inventory items belonging to the character. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray Inventory; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Array of virtual currency balance(s) belonging to the character. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; + /** Array of remaining times and timestamps for virtual currencies. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrencyRechargeTimes = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerGetRandomResultTablesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Specifies the catalog version that should be used to retrieve the Random Result Tables. If unspecified, uses + * default/primary catalog. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** The unique identifier of the Random Result Table to use. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString TableIDs; +}; + +USTRUCT(BlueprintType) +struct FServerGetRandomResultTablesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of random result tables currently available */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* Tables = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserInventoryRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of inventory items belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray Inventory; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Array of virtual currency balance(s) belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; + /** Array of remaining times and timestamps for virtual currencies. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrencyRechargeTimes = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerGrantItemsToCharacterRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** String detailing any additional information concerning this operation. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString Annotation; + /** Catalog version from which items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Array of itemIds to grant to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemIds; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGrantItemsToCharacterResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items granted to users. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray ItemGrantResults; +}; + +USTRUCT(BlueprintType) +struct FServerGrantItemsToUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** String detailing any additional information concerning this operation. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString Annotation; + /** Catalog version from which items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Array of itemIds to grant to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemIds; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGrantItemsToUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items granted to users. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray ItemGrantResults; +}; + +USTRUCT(BlueprintType) +struct FServerGrantItemsToUsersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version from which items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Array of items to grant and the users to whom the items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray ItemGrants; +}; + +USTRUCT(BlueprintType) +struct FServerGrantItemsToUsersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items granted to users. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray ItemGrantResults; +}; + +USTRUCT(BlueprintType) +struct FServerModifyItemUsesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique instance identifier of the item to be modified. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** PlayFab unique identifier of the user whose item is being modified. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Number of uses to add to the item. Can be negative to remove uses. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 UsesToAdd = 0; +}; + +USTRUCT(BlueprintType) +struct FServerModifyItemUsesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique instance identifier of the item with uses consumed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Number of uses remaining on the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 RemainingUses = 0; +}; + +USTRUCT(BlueprintType) +struct FServerMoveItemToCharacterFromCharacterRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the character that currently has the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString GivingCharacterId; + /** Unique PlayFab assigned instance identifier of the item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Unique identifier of the character that will be receiving the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ReceivingCharacterId; +}; + +USTRUCT(BlueprintType) +struct FServerMoveItemToCharacterFromCharacterResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerMoveItemToCharacterFromUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Unique PlayFab assigned instance identifier of the item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerMoveItemToCharacterFromUserResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerMoveItemToUserFromCharacterRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Unique PlayFab assigned instance identifier of the item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerMoveItemToUserFromCharacterResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerRedeemCouponRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version of the coupon. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Optional identifier for the Character that should receive the item. If null, item is added to the player */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Generated coupon code to redeem. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CouponCode; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerRedeemCouponResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Items granted to the player as a result of redeeming the coupon. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray GrantedItems; +}; + +USTRUCT(BlueprintType) +struct FServerReportPlayerServerRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional additional comment by reporting player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString Comment; + /** Unique PlayFab identifier of the reported player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ReporteeId; + /** PlayFabId of the reporting player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ReporterId; +}; + +USTRUCT(BlueprintType) +struct FServerReportPlayerServerResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The number of remaining reports which may be filed today by this reporting player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 SubmissionsRemaining = 0; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeInventoryItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Unique PlayFab assigned instance identifier of the item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerRevokeInventoryItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of player items to revoke, between 1 and 25 items. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray Items; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeInventoryItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Collection of any errors that occurred during processing. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray Errors; +}; + +USTRUCT(BlueprintType) +struct FServerSubtractCharacterVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Amount to be subtracted from the user balance of the specified virtual currency. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 Amount = 0; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which is to be decremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerSubtractUserVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Amount to be subtracted from the user balance of the specified virtual currency. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 Amount = 0; + /** PlayFab unique identifier of the user whose virtual currency balance is to be decreased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which is to be decremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerUnlockContainerInstanceRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Specifies the catalog version that should be used to determine container contents. If unspecified, uses catalog + * associated with the item instance. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** ItemInstanceId of the container to unlock. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ContainerItemInstanceId; + /** + * ItemInstanceId of the key that will be consumed by unlocking this container. If the container requires a key, this + * parameter is required. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString KeyItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUnlockContainerItemResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Items granted to the player as a result of unlocking the container. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray GrantedItems; + /** Unique instance identifier of the container unlocked. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString UnlockedItemInstanceId; + /** Unique instance identifier of the key used to unlock the container, if applicable. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString UnlockedWithItemInstanceId; + /** Virtual currency granted to the player as a result of unlocking the container. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerUnlockContainerItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Specifies the catalog version that should be used to determine container contents. If unspecified, uses default/primary + * catalog. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Catalog ItemId of the container type to unlock. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ContainerItemId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateUserInventoryItemDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* Data; + /** Unique PlayFab assigned instance identifier of the item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString KeysToRemove; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerAddPlayerTagRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString PlayFabId; + /** Unique tag for player profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString TagName; +}; + +USTRUCT(BlueprintType) +struct FServerAddPlayerTagResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerGetAllSegmentsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerGetAllSegmentsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of segments for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + TArray Segments; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerSegmentsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of segments the requested player currently belongs to. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + TArray Segments; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayersSegmentsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayersInSegmentRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Continuation token if retrieving subsequent pages of results. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString ContinuationToken; + /** Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + int32 MaxBatchSize = 0; + /** + * Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging + * results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + int32 SecondsToLive = 0; + /** Unique identifier for this segment. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString SegmentId; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayersInSegmentResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString ContinuationToken; + /** Array of player profiles in this segment. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + TArray PlayerProfiles; + /** Count of profiles matching this segment. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + int32 ProfilesInSegment = 0; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerTagsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional namespace to filter results by */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString Namespace; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerTagsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString PlayFabId; + /** Canonical tags (including namespace and tag's name) for the requested user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString Tags; +}; + +USTRUCT(BlueprintType) +struct FServerRemovePlayerTagRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString PlayFabId; + /** Unique tag for player profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString TagName; +}; + +USTRUCT(BlueprintType) +struct FServerRemovePlayerTagResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerExecuteCloudScriptResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Number of PlayFab API requests issued by the CloudScript function */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 APIRequestsIssued = 0; + /** Information about the error, if any, that occurred during execution */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + UPlayFabJsonObject* Error = nullptr; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 ExecutionTimeSeconds = 0; + /** The name of the function that executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + FString FunctionName; + /** The object returned from the CloudScript function, if any */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + UPlayFabJsonObject* FunctionResult = nullptr; + /** + * Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + bool FunctionResultTooLarge = false; + /** Number of external HTTP requests issued by the CloudScript function */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 HttpRequestsIssued = 0; + /** + * Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + TArray Logs; + /** + * Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + bool LogsTooLarge = false; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 MemoryConsumedBytes = 0; + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 ProcessorTimeSeconds = 0; + /** The revision of the CloudScript that executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 Revision = 0; +}; + +USTRUCT(BlueprintType) +struct FServerExecuteCloudScriptServerRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The name of the CloudScript function to execute */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + FString FunctionName; + /** Object that is passed in to the function as the first argument */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + UPlayFabJsonObject* FunctionParameter = nullptr; + /** + * Generate a 'player_executed_cloudscript' PlayStream event containing the results of the function execution and other + * contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + bool GeneratePlayStreamEvent = false; + /** The unique user identifier for the player on whose behalf the script is being run */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + FString PlayFabId; + /** + * Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' + * executes the current live, published revision, and 'Specific' executes the specified revision. The default value is + * 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + ECloudScriptRevisionOption RevisionSelection; + /** The specivic revision to execute, when RevisionSelection is set to 'Specific' */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 SpecificRevision = 0; +}; + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerAddSharedGroupMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** An array of unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString PlayFabIds; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerAddSharedGroupMembersResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerCreateSharedGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the shared group (a random identifier will be assigned, if one is not specified). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerCreateSharedGroupResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerDeleteSharedGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerGetSharedGroupDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If true, return the list of all members of the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + bool GetMembers = false; + /** + * Specific keys to retrieve from the shared group (if not specified, all keys will be returned, while an empty array + * indicates that no keys should be returned). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString Keys; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerGetSharedGroupDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Data for the requested keys. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + UPlayFabJsonObject* Data = nullptr; + /** List of PlayFabId identifiers for the members of this group, if requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString Members; +}; + +USTRUCT(BlueprintType) +struct FServerRemoveSharedGroupMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** An array of unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString PlayFabIds; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerRemoveSharedGroupMembersResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerUpdateSharedGroupDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString KeysToRemove; + /** Permission to be applied to all user data keys in this request. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + EUserDataPermission Permission; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateSharedGroupDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerGetCatalogItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Which catalog is being requested. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString CatalogVersion; +}; + +USTRUCT(BlueprintType) +struct FServerGetCatalogItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items which can be purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + TArray Catalog; +}; + +USTRUCT(BlueprintType) +struct FServerGetPublisherDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** array of keys to get back data from the Publisher data blob, set by the admin tools */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Keys; +}; + +USTRUCT(BlueprintType) +struct FServerGetPublisherDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** a dictionary object of key / value pairs */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + UPlayFabJsonObject* Data; +}; + +USTRUCT(BlueprintType) +struct FServerGetTimeRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerGetTimeResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Current server time when the request was received, in UTC */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Time; +}; + +USTRUCT(BlueprintType) +struct FServerGetTitleDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Specific keys to search for in the title data (leave null to get all keys) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Keys; +}; + +USTRUCT(BlueprintType) +struct FServerGetTitleDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** a dictionary object of key / value pairs */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + UPlayFabJsonObject* Data; +}; + +USTRUCT(BlueprintType) +struct FServerGetTitleNewsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Limits the results to the last n entries. Defaults to 10 if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + int32 Count = 0; +}; + +USTRUCT(BlueprintType) +struct FServerGetTitleNewsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of news items. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + TArray News; +}; + +USTRUCT(BlueprintType) +struct FServerSetPublisherDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Key; + /** new value to set. Set to null to remove a value */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Value; +}; + +USTRUCT(BlueprintType) +struct FServerSetPublisherDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerSetTitleDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Key; + /** new value to set. Set to null to remove a value */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Value; +}; + +USTRUCT(BlueprintType) +struct FServerSetTitleDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabUtilities.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabUtilities.h new file mode 100644 index 000000000..5b3482ae4 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Classes/PlayFabUtilities.h @@ -0,0 +1,36 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the utilities functions that supports the plugin. +// +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabUtilities.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabUtilities : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() +public: + /** Setup the PlayFab settings used throughout the plugin. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Settings") + static void setPlayFabSettings(FString GameTitleId, FString PlayFabSecretApiKey = "", FString PhotonRealtimeAppId = "", FString PhotonTurnbasedAppId = "", FString PhotonChatAppId = ""); + + /** Returns the error code text given the error code */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Errors") + static FString getErrorText(int32 code); + + /** Returns the requested photon application id. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Photon | Authentication") + static FString getPhotonAppId(bool Realtime = false, bool Chat = false, bool Turnbased = false); +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/PlayFab.Build.cs b/ExampleProject/Plugins/PlayFab/Source/PlayFab/PlayFab.Build.cs new file mode 100644 index 000000000..848635a69 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/PlayFab.Build.cs @@ -0,0 +1,33 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +using UnrealBuildTool; +using System.IO; + +namespace UnrealBuildTool.Rules +{ + public class PlayFab : ModuleRules + { + public PlayFab(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public")); + + PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private")); + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "CoreUObject", + "Engine", + "HTTP", + "Json", + "PlayFabCommon" + } + ); + } + } +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PfTestActor.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PfTestActor.cpp new file mode 100644 index 000000000..c53349b5e --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PfTestActor.cpp @@ -0,0 +1,855 @@ + +#include "PfTestActor.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +const int SUMMARY_INIT_BUFFER_SIZE = 10000; +const int TEST_TIMEOUT_SECONDS = 10; + +// Sets default values +APfTestActor::APfTestActor() +{ + // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. + PrimaryActorTick.bCanEverTick = true; +} + +// Called when the game starts or when spawned +void APfTestActor::BeginPlay() +{ + Super::BeginPlay(); + InitializeTestSuite(); +} + +// Called every frame +void APfTestActor::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); + TickTestSuite(); + _outputSummary = GenerateTestSummary(); +} + +/////////////////////////////////////// The actual testing framework /////////////////////////////////////// +void APfTestActor::InitializeTestSuite() +{ + bool setupSuccessful = ClassSetup(); + + // Reset testContexts if this has already been run (The results are kept for later viewing) + testContexts.Empty(); + + if (setupSuccessful) + { + + AppendTest("InvalidLogin"); + AppendTest("InvalidRegistration"); + AppendTest("LoginOrRegister"); + AppendTest("LoginWithAdvertisingId"); + AppendTest("UserDataApi"); + AppendTest("PlayerStatisticsApi"); + AppendTest("UserCharacter"); + AppendTest("LeaderBoard"); + AppendTest("AccountInfo"); + AppendTest("CloudScript"); + AppendTest("CloudScriptError"); + AppendTest("WriteEvent"); + + AppendTest("ServerTitleData"); + + AppendTest("GetEntityToken"); + AppendTest("ObjectApi"); + } +} + +void APfTestActor::AppendTest(const FString& testFuncName) +{ + UPfTestContext::FApiTestCase eachTestDelegate; + eachTestDelegate.BindUFunction(this, *testFuncName); + if (eachTestDelegate.IsBound()) + { + UPfTestContext* eachTestContext = NewObject(this); + eachTestContext->Setup(testFuncName, eachTestDelegate); + testContexts.Add(eachTestContext); + } + else + { + UE_LOG(LogTemp, Error, TEXT("%s: %s"), *testFuncName, TEXT("Critical Failure: Cannot bind test UFUNCTION.")); + } +} + +bool APfTestActor::TickTestSuite() +{ + if (IPlayFab::Get().GetPendingCallCount() > 0) + return false; // The active test won't advance until all outstanding calls return + + int unfinishedTests = 0; + UPfTestContext* nextTest = nullptr; + for (int i = 0; i < testContexts.Num(); i++) + { + auto eachState = testContexts[i]->activeState; + + if (eachState != PlayFabApiTestActiveState::COMPLETE && eachState != PlayFabApiTestActiveState::ABORTED) + unfinishedTests++; + + if (eachState == PlayFabApiTestActiveState::ACTIVE || eachState == PlayFabApiTestActiveState::READY) // Find the active test, and prioritize it + nextTest = testContexts[i]; + else if (eachState == PlayFabApiTestActiveState::PENDING && nextTest == nullptr) // Or find a test to start + nextTest = testContexts[i]; + } + + if (nextTest != nullptr && !nextTest->IsValidLowLevel()) + { + UE_LOG(LogTemp, Error, TEXT("%s"), TEXT("Critical Failure: Test context has become invalid.")); + return true; + } + + if (nextTest != nullptr && nextTest->activeState == PlayFabApiTestActiveState::PENDING) + StartTest(nextTest); + else if (nextTest != nullptr) + TickTest(nextTest); + + bool result = unfinishedTests == 0; // Return whether tests are complete + return result; +} + +FString APfTestActor::GenerateTestSummary() +{ + _outputSummary.Empty(SUMMARY_INIT_BUFFER_SIZE); // Set the capacity to handle everything we're about to put into it + + FDateTime now = FDateTime::UtcNow(); + int numPassed = 0; + int numFailed = 0; + for (int i = 0; i < testContexts.Num(); i++) + { + if (_outputSummary.Len() != 0) + _outputSummary += '\n'; + _outputSummary += testContexts[i]->GenerateTestSummary(now); + if (testContexts[i]->finishState == PlayFabApiTestFinishState::PASSED) numPassed++; + else if (testContexts[i]->finishState == PlayFabApiTestFinishState::FAILED) numFailed++; + } + + FString testCountLine = "\nTotal tests: "; + testCountLine += FString::FromInt(testContexts.Num()); + testCountLine += ", Passed: "; + testCountLine += FString::FromInt(numPassed); + testCountLine += ", Failed: "; + testCountLine += FString::FromInt(numFailed); + + _outputSummary += testCountLine; + return _outputSummary; +} + +bool APfTestActor::ClassSetup() +{ + // README: + // modify the TEST_TITLE_DATA_LOC to a location of a testTitleData.json file + // The format of this file is described in the sdk readme + // - OR - + // Comment the "return false;" below, and + // Fill in all the variables under: POPULATE THIS SECTION WITH REAL INFORMATION + + IPlayFab* playFabSettings = &(IPlayFab::Get()); + + playFabSettings->setAdvertisingIdType(TEXT("")); + playFabSettings->setAdvertisingIdValue(TEXT("")); + + // Prefer to load path from environment variable, if present +#if PLATFORM_WINDOWS + char* envPath = nullptr; + size_t envPathStrLen; + errno_t err = _dupenv_s(&envPath, &envPathStrLen, "PF_TEST_TITLE_DATA_JSON"); + if (err == 0 && envPath != nullptr) + TEST_TITLE_DATA_LOC = FString(ANSI_TO_TCHAR(envPath)); + free(envPath); // It's OK to call free with NULL +#endif + + FString titleDataJson; + if (FFileHelper::LoadFileToString(titleDataJson, *TEST_TITLE_DATA_LOC)) + { + TSharedPtr JsonObject; + TSharedRef< TJsonReader<> > Reader = TJsonReaderFactory<>::Create(titleDataJson); + FJsonSerializer::Deserialize(Reader, JsonObject); + playFabSettings->setGameTitleId(JsonObject->GetStringField(TEXT("titleId"))); + playFabSettings->setApiSecretKey(JsonObject->GetStringField(TEXT("developerSecretKey"))); + userEmail = JsonObject->GetStringField(TEXT("userEmail")); + } + else + { + // Add your real test data here and remove this return if you want to skip testTitleData + return false; + + // Populate this section with real information, if you're not using the testTitleData.json file (or are using a device) + playFabSettings->setGameTitleId(TEXT("")); // Without a titleId, your game will do terrible things (usually crash) + playFabSettings->setApiSecretKey(TEXT("")); // Non-client api calls will all crash without a secret key + userEmail = "yourEmail"; // This is the email for the user + } + + // Verify all the inputs won't cause crashes in the tests + return playFabSettings->getGameTitleId().Len() > 0 + && (userEmail.Len() > 0); +} + +// Start a test, and block until the threaded response arrives +void APfTestActor::StartTest(UPfTestContext* testContext) +{ + UE_LOG(LogTemp, Log, TEXT("Starting Test: %s"), *(testContext->testName)); + testContext->activeState = PlayFabApiTestActiveState::ACTIVE; + testContext->startTime = FDateTime::UtcNow(); + testContext->testFunc.Execute(testContext); + // Async tests can't resolve this tick, so just return +} + +void APfTestActor::TickTest(UPfTestContext* testContext) +{ + FDateTime now = FDateTime::UtcNow(); + if (testContext->activeState != PlayFabApiTestActiveState::READY // Not finished + && (now - testContext->startTime) < FTimespan::FromSeconds(TEST_TIMEOUT_SECONDS)) // Not timed out + return; + + testContext->endTime = now; + testContext->activeState = PlayFabApiTestActiveState::COMPLETE; +} + +// This should be called in the api-responses, which are threaded. This will allow TickTest to finalize the test +void APfTestActor::EndTest(UPfTestContext* testContext, PlayFabApiTestFinishState finishState, FString resultMsg) +{ + testContext->testResultMsg = resultMsg; + testContext->finishState = finishState; + testContext->activeState = PlayFabApiTestActiveState::READY; +} + +void APfTestActor::OnSharedError(FPlayFabError error, UObject* customData) +{ + UPfTestContext* testContext = dynamic_cast(customData); + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "Unexpected error: " + error.ErrorMessage + "\n" + error.ErrorDetails); +} + +/// +/// CLIENT API +/// Try to deliberately log in with an inappropriate password, +/// and verify that the error displays as expected. +/// +void APfTestActor::InvalidLogin(UPfTestContext* testContext) +{ + FClientLoginWithEmailAddressRequest request; + request.Email = userEmail; + request.Password = "INVALID"; + request.InfoRequestParameters = nullptr; + UPlayFabClientAPI::FDelegateOnSuccessLoginWithEmailAddress onSuccess; onSuccess.BindUFunction(this, "InvalidLoginSuccess"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "InvalidLoginFail"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::LoginWithEmailAddress(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::InvalidLoginSuccess(FClientLoginResult result, UObject* customData) +{ + UPfTestContext* testContext = dynamic_cast(customData); + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "Expected login to fail"); +} +void APfTestActor::InvalidLoginFail(FPlayFabError error, UObject* customData) +{ + UPfTestContext* testContext = dynamic_cast(customData); + if (error.ErrorMessage.Find("password") != -1) + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); + else + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "Password error message not found: " + error.ErrorMessage + "\n - " + error.ErrorDetails); +} + +/// +/// CLIENT API +/// Try to deliberately register a user with an invalid email and password +/// Verify that errorDetails are populated correctly. +/// +void APfTestActor::InvalidRegistration(UPfTestContext* testContext) +{ + FClientRegisterPlayFabUserRequest request; + request.Username = "x"; + request.Email = "x"; + request.Password = "x"; + UPlayFabClientAPI::FDelegateOnSuccessRegisterPlayFabUser onSuccess; onSuccess.BindUFunction(this, "InvalidRegistrationSuccess"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "InvalidRegistrationFail"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::RegisterPlayFabUser(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::InvalidRegistrationSuccess(FClientRegisterPlayFabUserResult result, UObject* customData) +{ + UPfTestContext* testContext = dynamic_cast(customData); + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "Expected registration to fail"); +} +void APfTestActor::InvalidRegistrationFail(FPlayFabError error, UObject* customData) +{ + bool foundEmailMsg, foundPasswordMsg; + FString expectedEmailMsg = "Email address is not valid."; + FString expectedPasswordMsg = "Password must be between"; + + foundEmailMsg = (error.ErrorDetails.Find(expectedEmailMsg) != -1); + foundPasswordMsg = (error.ErrorDetails.Find(expectedPasswordMsg) != -1); + + UPfTestContext* testContext = dynamic_cast(customData); + if (foundEmailMsg && foundPasswordMsg) + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); + else + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "All error details: " + error.ErrorDetails); +} + +/// +/// CLIENT API +/// Test a sequence of calls that modifies saved data, +/// and verifies that the next sequential API call contains updated data. +/// Verify that the data is correctly modified on the next call. +/// Parameter types tested: string, Dictionary, DateTime +/// +void APfTestActor::LoginOrRegister(UPfTestContext* testContext) +{ + IPlayFab* playFabSettings = &(IPlayFab::Get()); + + FClientLoginWithCustomIDRequest request; + request.CustomId = playFabSettings->getBuildIdentifier(); + request.CreateAccount = true; + request.InfoRequestParameters = nullptr; + UPlayFabClientAPI::FDelegateOnSuccessLoginWithCustomID onSuccess; onSuccess.BindUFunction(this, "OnLoginOrRegister"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::LoginWithCustomID(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::OnLoginOrRegister(FClientLoginResult result, UObject* customData) +{ + playFabId = result.PlayFabId; + UPfTestContext* testContext = dynamic_cast(customData); + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); +} + +/// +/// CLIENT API +/// Test that the login call sequence sends the AdvertisingId when set +/// +void APfTestActor::LoginWithAdvertisingId(UPfTestContext* testContext) +{ + IPlayFab* playFabSettings = &(IPlayFab::Get()); + playFabSettings->setAdvertisingIdType(playFabSettings->getAD_TYPE_ANDROID_ID()); + playFabSettings->setAdvertisingIdValue(TEXT("PlayFabTestId")); + + FClientLoginWithCustomIDRequest request; + request.CustomId = playFabSettings->getBuildIdentifier(); + request.CreateAccount = true; + request.InfoRequestParameters = nullptr; + UPlayFabClientAPI::FDelegateOnSuccessLoginWithCustomID onSuccess; onSuccess.BindUFunction(this, "OnLoginWithAdvertisingId"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::LoginWithCustomID(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::OnLoginWithAdvertisingId(FClientLoginResult result, UObject* customData) +{ + IPlayFab* playFabSettings = &(IPlayFab::Get()); + // TODO: Need to wait for the NEXT api call to complete, and then test playFabSettings->AdvertisingIdType (Oh right... need to actually change AdvertisingIdType too... + UPfTestContext* testContext = dynamic_cast(customData); + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); +} + +/// +/// CLIENT API +/// Test a sequence of calls that modifies saved data, +/// and verifies that the next sequential API call contains updated data. +/// Verify that the data is correctly modified on the next call. +/// Parameter types tested: string, Dictionary, DateTime +/// +void APfTestActor::UserDataApi(UPfTestContext* testContext) +{ + IPlayFab* playFabSettings = &(IPlayFab::Get()); + if (!playFabSettings->IsClientLoggedIn()) + { + EndTest(testContext, PlayFabApiTestFinishState::SKIPPED, "Earlier tests failed to log in"); + return; + } + + FClientGetUserDataRequest request; + request.IfChangedFromDataVersion = 0; + UPlayFabClientAPI::FDelegateOnSuccessGetUserData onSuccess; onSuccess.BindUFunction(this, "OnUserDataApiGet1"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::GetUserData(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::OnUserDataApiGet1(FClientGetUserDataResult result, UObject* customData) +{ + TryExtractIntFromUserData(result.Data, TEST_DATA_KEY, testMessageInt, testMessageTime); // We don't care about failure here, because it's legitimate if the data doesn't exist yet + testMessageInt = (testMessageInt + 1) % 100; + + FClientUpdateUserDataRequest updateRequest; + updateRequest.Data = NewObject(); // This will be GC'd almost immediately since there's no living UPROPERTY references to it (updateRequest doesn't count), but that's ok, because it only needs to survive until UPlayFabClientAPI::UpdateUserData returns + updateRequest.Data->SetStringField(TEST_DATA_KEY, FString::FromInt(testMessageInt)); + updateRequest.Permission = EUserDataPermission::pfenum_Public; + UPlayFabClientAPI::FDelegateOnSuccessUpdateUserData onSuccess; onSuccess.BindUFunction(this, "OnUserDataApiUpdate"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::UpdateUserData(updateRequest, onSuccess, onError, customData); + callObj->Activate(); +} +void APfTestActor::OnUserDataApiUpdate(FClientUpdateUserDataResult result, UObject* customData) +{ + FClientGetUserDataRequest request; + request.IfChangedFromDataVersion = 0; + UPlayFabClientAPI::FDelegateOnSuccessGetUserData onSuccess; onSuccess.BindUFunction(this, "OnUserDataApiGet2"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::GetUserData(request, onSuccess, onError, customData); + callObj->Activate(); +} +void APfTestActor::OnUserDataApiGet2(FClientGetUserDataResult result, UObject* customData) +{ + UPfTestContext* testContext = dynamic_cast(customData); + + FDateTime now = FDateTime::UtcNow(); + FDateTime minTime = now - FTimespan(0, 5, 0); + FDateTime maxTime = now + FTimespan(0, 5, 0); + + int actualDataValue; + bool exists = TryExtractIntFromUserData(result.Data, TEST_DATA_KEY, actualDataValue, testMessageTime); + if (!exists) + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "Expected data is not present."); + else if (testMessageInt != actualDataValue) + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "User data not updated as expected."); + else if (testMessageTime < minTime || maxTime < testMessageTime) + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "Timestamp out of range: " + minTime.ToString() + "!<" + testMessageTime.ToString() + "!<" + maxTime.ToString()); + else if (!(minTime <= testMessageTime && testMessageTime <= maxTime)) + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "DateTime not parsed correctly."); + else + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); +} +bool APfTestActor::TryExtractIntFromUserData(const UPlayFabJsonObject* jsonObj, const FString& key, int& outValue, FDateTime& outTime) +{ + outValue = 1; // The default if we fail + outTime = FDateTime::MinValue(); + + if (!jsonObj->HasField(key)) + { + return false; + } + auto dataElementObj = jsonObj->GetObjectField(key); + + if (!dataElementObj->HasField("Value")) + { + return false; + } + FString valueStr = dataElementObj->GetStringField("Value"); + + if (!dataElementObj->HasField("LastUpdated")) + { + return false; + } + FString dateStr = dataElementObj->GetStringField("LastUpdated"); + + outValue = FCString::Atoi(*valueStr); + FDateTime::ParseIso8601(*dateStr, outTime); + return true; +} + +/// +/// CLIENT API +/// Test a sequence of calls that modifies saved data, +/// and verifies that the next sequential API call contains updated data. +/// Verify that the data is saved correctly, and that specific types are tested +/// Parameter types tested: Dictionary +/// +void APfTestActor::PlayerStatisticsApi(UPfTestContext* testContext) +{ + IPlayFab* playFabSettings = &(IPlayFab::Get()); + if (!playFabSettings->IsClientLoggedIn()) + { + EndTest(testContext, PlayFabApiTestFinishState::SKIPPED, "Earlier tests failed to log in"); + return; + } + + FClientGetPlayerStatisticsRequest request; + UPlayFabClientAPI::FDelegateOnSuccessGetPlayerStatistics onSuccess; onSuccess.BindUFunction(this, "OnPlayerStatisticsApiGet1"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::GetPlayerStatistics(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::OnPlayerStatisticsApiGet1(FClientGetPlayerStatisticsResult result, UObject* customData) +{ + testMessageInt = 0; + for (int i = 0; i < result.Statistics.Num(); i++) + if (result.Statistics[i]->HasField(TEXT("StatisticName")) + && result.Statistics[i]->HasField(TEXT("Value")) + && result.Statistics[i]->GetStringField(TEXT("StatisticName")) == TEST_STAT_NAME) + testMessageInt = result.Statistics[i]->GetNumberField(TEXT("Value")); + testMessageInt = (testMessageInt + 1) % 100; + + FClientUpdatePlayerStatisticsRequest updateRequest; + updateRequest.Statistics.Add(NewObject()); + updateRequest.Statistics[0]->SetStringField(TEXT("StatisticName"), TEST_STAT_NAME); + updateRequest.Statistics[0]->SetNumberField(TEXT("Value"), testMessageInt); + UPlayFabClientAPI::FDelegateOnSuccessUpdatePlayerStatistics onSuccess; onSuccess.BindUFunction(this, "OnPlayerStatisticsApiUpdate"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::UpdatePlayerStatistics(updateRequest, onSuccess, onError, customData); + callObj->Activate(); +} +void APfTestActor::OnPlayerStatisticsApiUpdate(FClientUpdatePlayerStatisticsResult result, UObject* customData) +{ + FClientGetPlayerStatisticsRequest request; + UPlayFabClientAPI::FDelegateOnSuccessGetPlayerStatistics onSuccess; onSuccess.BindUFunction(this, "OnPlayerStatisticsApiGet2"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::GetPlayerStatistics(request, onSuccess, onError, customData); + callObj->Activate(); +} +void APfTestActor::OnPlayerStatisticsApiGet2(FClientGetPlayerStatisticsResult result, UObject* customData) +{ + int actualStatValue = -1000; + for (int i = 0; i < result.Statistics.Num(); i++) + if (result.Statistics[i]->HasField(TEXT("StatisticName")) + && result.Statistics[i]->HasField(TEXT("Value")) + && result.Statistics[i]->GetStringField(TEXT("StatisticName")) == TEST_STAT_NAME) + actualStatValue = result.Statistics[i]->GetNumberField(TEXT("Value")); + + UPfTestContext* testContext = dynamic_cast(customData); + if (testMessageInt != actualStatValue) + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "User statistic not updated as expected, E:" + FString::FromInt(testMessageInt) + " != A:" + FString::FromInt(actualStatValue)); + else + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); +} + +/// +/// CLIENT API +/// Get or create the given test character for the given user +/// Parameter types tested: Contained-Classes, string +/// +void APfTestActor::UserCharacter(UPfTestContext* testContext) +{ + IPlayFab* playFabSettings = &(IPlayFab::Get()); + if (!playFabSettings->IsClientLoggedIn()) + { + EndTest(testContext, PlayFabApiTestFinishState::SKIPPED, "Earlier tests failed to log in"); + return; + } + + FClientListUsersCharactersRequest request; + UPlayFabClientAPI::FDelegateOnSuccessGetAllUsersCharacters onSuccess; onSuccess.BindUFunction(this, "OnUserCharacter"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::GetAllUsersCharacters(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::OnUserCharacter(FClientListUsersCharactersResult result, UObject* customData) +{ + UPfTestContext* testContext = dynamic_cast(customData); + // Generally a character won't exist + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); +} + +/// +/// CLIENT API +/// Test that leaderboard results can be requested +/// Parameter types tested: List of contained-classes +/// +void APfTestActor::LeaderBoard(UPfTestContext* testContext) +{ + IPlayFab* playFabSettings = &(IPlayFab::Get()); + if (!playFabSettings->IsClientLoggedIn()) + { + EndTest(testContext, PlayFabApiTestFinishState::SKIPPED, "Earlier tests failed to log in"); + return; + } + + testMessageInt = 0; + FClientGetLeaderboardRequest clientRequest; + clientRequest.StartPosition = 0; + clientRequest.MaxResultsCount = 3; + clientRequest.StatisticName = TEST_STAT_NAME; + UPlayFabClientAPI::FDelegateOnSuccessGetLeaderboard onSuccess; onSuccess.BindUFunction(this, "OnLeaderBoard"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::GetLeaderboard(clientRequest, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::OnLeaderBoard(FClientGetLeaderboardResult result, UObject* customData) +{ + UPfTestContext* testContext = dynamic_cast(customData); + if (result.Leaderboard.Num() > 0) + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); + else + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "Leaderboard entry not found."); +} + +/// +/// CLIENT API +/// Test that AccountInfo can be requested +/// Parameter types tested: List of enum-as-strings converted to list of enums +/// +void APfTestActor::AccountInfo(UPfTestContext* testContext) +{ + IPlayFab* playFabSettings = &(IPlayFab::Get()); + if (!playFabSettings->IsClientLoggedIn()) + { + EndTest(testContext, PlayFabApiTestFinishState::SKIPPED, "Earlier tests failed to log in"); + return; + } + + FClientGetAccountInfoRequest request; + UPlayFabClientAPI::FDelegateOnSuccessGetAccountInfo onSuccess; onSuccess.BindUFunction(this, "OnAccountInfo"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::GetAccountInfo(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::OnAccountInfo(FClientGetAccountInfoResult result, UObject* customData) +{ + UPfTestContext* testContext = dynamic_cast(customData); + + if (!result.AccountInfo->HasField("TitleInfo")) + { + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "AccountInfo does not contain TitleInfo object"); + return; + } + auto titleInfoObj = result.AccountInfo->GetObjectField("TitleInfo"); + + + if (!titleInfoObj->HasField("Origination")) + { + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "titleInfoObj does not contain Origination"); + return; + } + EUserOrigination originationEnum; + FString originationStr = titleInfoObj->GetStringField("Origination"); + if (GetEnumValueFromString(TEXT("EUserOrigination"), originationStr, originationEnum)) + { + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); + } + else + { + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "Could not resolve input as an Origination Enum value: " + originationStr); + } +} + +/// +/// CLIENT API +/// Test that CloudScript can be properly set up and invoked +/// +void APfTestActor::CloudScript(UPfTestContext* testContext) +{ + IPlayFab* playFabSettings = &(IPlayFab::Get()); + if (!playFabSettings->IsClientLoggedIn()) + { + EndTest(testContext, PlayFabApiTestFinishState::SKIPPED, "Earlier tests failed to log in"); + return; + } + + FClientExecuteCloudScriptRequest request; + request.FunctionName = "helloWorld"; + request.FunctionParameter = nullptr; + request.RevisionSelection = ECloudScriptRevisionOption::pfenum_Live; + request.SpecificRevision = 0; + UPlayFabClientAPI::FDelegateOnSuccessExecuteCloudScript onSuccess; onSuccess.BindUFunction(this, "OnHelloWorldCloudScript"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::ExecuteCloudScript(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::OnHelloWorldCloudScript(FClientExecuteCloudScriptResult result, UObject* customData) +{ + UPfTestContext* testContext = dynamic_cast(customData); + + if (!result.FunctionResult->HasField("messageValue")) + { + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "FunctionResult did not contain messageValue"); + return; + } + FString message = result.FunctionResult->GetStringField("messageValue"); + + FString expected = TEXT("Hello " + playFabId + "!"); + if (message.Find(expected) == -1) + EndTest(testContext, PlayFabApiTestFinishState::FAILED, message); + else + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); +} + +/// +/// CLIENT API +/// Test that CloudScript errors can be deciphered +/// +void APfTestActor::CloudScriptError(UPfTestContext* testContext) +{ + IPlayFab* playFabSettings = &(IPlayFab::Get()); + if (!playFabSettings->IsClientLoggedIn()) + { + EndTest(testContext, PlayFabApiTestFinishState::SKIPPED, "Earlier tests failed to log in"); + return; + } + + FClientExecuteCloudScriptRequest request; + request.FunctionName = "throwError"; + request.FunctionParameter = nullptr; + request.RevisionSelection = ECloudScriptRevisionOption::pfenum_Live; + request.SpecificRevision = 0; + UPlayFabClientAPI::FDelegateOnSuccessExecuteCloudScript onSuccess; onSuccess.BindUFunction(this, "OnCloudScriptError"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::ExecuteCloudScript(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::OnCloudScriptError(FClientExecuteCloudScriptResult result, UObject* customData) +{ + UPfTestContext* testContext = dynamic_cast(customData); + + if (result.FunctionResult != nullptr) + { + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "FunctionResult should be null"); + return; + } + if (result.Error == nullptr) + { + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "Cloud Script error not found"); + return; + } + + if (result.Error->GetStringField(TEXT("Error")).Find("JavascriptException") == 0) + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); + else + EndTest(testContext, PlayFabApiTestFinishState::FAILED, "Can't find Cloud Script failure details."); +} + +/// +/// CLIENT API +/// Test that the client can publish custom PlayStream events +/// +void APfTestActor::WriteEvent(UPfTestContext* testContext) +{ + IPlayFab* playFabSettings = &(IPlayFab::Get()); + if (!playFabSettings->IsClientLoggedIn()) + { + EndTest(testContext, PlayFabApiTestFinishState::SKIPPED, "Earlier tests failed to log in"); + return; + } + + FClientWriteClientPlayerEventRequest request; + request.EventName = "ForumPostEvent"; + request.Body = NewObject(); + request.Body->SetStringField("Subject", "My First Post"); + request.Body->SetStringField("Body", "My awesome post."); + UPlayFabClientAPI::FDelegateOnSuccessWritePlayerEvent onSuccess; onSuccess.BindUFunction(this, "OnWritePlayerEvent"); + UPlayFabClientAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabClientAPI* callObj = UPlayFabClientAPI::WritePlayerEvent(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::OnWritePlayerEvent(FClientWriteEventResponse result, UObject* customData) +{ + UPfTestContext* testContext = dynamic_cast(customData); + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); +} + +/// +/// ENTITY API +/// Convert the ClientToken to an EntityToken +/// +void APfTestActor::GetEntityToken(UPfTestContext* testContext) +{ + IPlayFab* playFabSettings = &(IPlayFab::Get()); + if (!playFabSettings->IsClientLoggedIn()) + { + EndTest(testContext, PlayFabApiTestFinishState::SKIPPED, "Earlier tests failed to log in"); + return; + } + + FAuthenticationGetEntityTokenRequest request; + UPlayFabAuthenticationAPI::FDelegateOnSuccessGetEntityToken onSuccess; onSuccess.BindUFunction(this, "OnGetEntityToken"); + UPlayFabAuthenticationAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabAuthenticationAPI* callObj = UPlayFabAuthenticationAPI::GetEntityToken(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::OnGetEntityToken(FAuthenticationGetEntityTokenResponse result, UObject* customData) +{ + entityId = result.Entity->GetStringField("Id"); + entityType = result.Entity->GetStringField("Type"); + + UPfTestContext* testContext = dynamic_cast(customData); + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); +} + +/// +/// ENTITY API +/// Save and load an Entity object +/// +void APfTestActor::ObjectApi(UPfTestContext* testContext) +{ + IPlayFab* playFabSettings = &(IPlayFab::Get()); + if (!playFabSettings->IsClientLoggedIn()) + { + EndTest(testContext, PlayFabApiTestFinishState::SKIPPED, "Earlier tests failed to log in"); + return; + } + + FDataGetObjectsRequest request; + request.Entity = NewObject(); + request.Entity->SetStringField("Id", entityId); + request.Entity->SetStringField("Type", entityType); + request.EscapeObject = true; + + UPlayFabDataAPI::FDelegateOnSuccessGetObjects onSuccess; onSuccess.BindUFunction(this, "OnGetObjectApi1"); + UPlayFabDataAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabDataAPI* callObj = UPlayFabDataAPI::GetObjects(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::OnGetObjectApi1(FDataGetObjectsResponse result, UObject* customData) +{ + testMessageInt = 0; // Default if the data isn't present + if (result.Objects->HasField(TEST_DATA_KEY)) { + auto eachObjString = result.Objects->GetObjectField(TEST_DATA_KEY)->GetStringField("EscapedDataObject"); + testMessageInt = FCString::Atoi(*eachObjString); + } + testMessageInt = (testMessageInt + 1) % 100; // This test is about the Expected value changing - but not testing more complicated issues like bounds + + FDataSetObjectsRequest request; + request.Entity = NewObject(); + request.Entity->SetStringField("Id", entityId); + request.Entity->SetStringField("Type", entityType); + + auto saveObj = NewObject(); + saveObj->SetStringField(TEXT("ObjectName"), TEST_DATA_KEY); + saveObj->SetNumberField(TEXT("DataObject"), testMessageInt); + request.Objects.Add(saveObj); + + UPlayFabDataAPI::FDelegateOnSuccessSetObjects onSuccess; onSuccess.BindUFunction(this, "OnSetObjectApi"); + UPlayFabDataAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabDataAPI* callObj = UPlayFabDataAPI::SetObjects(request, onSuccess, onError, customData); + callObj->Activate(); +} +void APfTestActor::OnSetObjectApi(FDataSetObjectsResponse result, UObject* customData) +{ + FDataGetObjectsRequest request; + request.Entity = NewObject(); + request.Entity->SetStringField("Id", entityId); + request.Entity->SetStringField("Type", entityType); + request.EscapeObject = true; + + UPlayFabDataAPI::FDelegateOnSuccessGetObjects onSuccess; onSuccess.BindUFunction(this, "OnGetObjectApi2"); + UPlayFabDataAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabDataAPI* callObj = UPlayFabDataAPI::GetObjects(request, onSuccess, onError, customData); + callObj->Activate(); +} +void APfTestActor::OnGetObjectApi2(FDataGetObjectsResponse result, UObject* customData) +{ + UPfTestContext* testContext = dynamic_cast(customData); + + int actualValue = -1000; // Fail if the data isn't present + if (result.Objects->HasField(TEST_DATA_KEY)) { + auto eachObjString = result.Objects->GetObjectField(TEST_DATA_KEY)->GetStringField("EscapedDataObject"); + actualValue = FCString::Atoi(*eachObjString); + } + + // Verify output and end test + if (testMessageInt != actualValue) + EndTest(testContext, PlayFabApiTestFinishState::FAILED, FString::Printf(TEXT("Saved/Loaded Object Data did not match: %d != %d"), testMessageInt, actualValue)); + else + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); +} + +/// +/// SERVER API +/// Test that leaderboard results can be requested +/// Parameter types tested: List of contained-classes +/// +void APfTestActor::ServerTitleData(UPfTestContext* testContext) +{ + testMessageInt = 0; + FServerGetTitleDataRequest request; + UPlayFabServerAPI::FDelegateOnSuccessGetTitleData onSuccess; onSuccess.BindUFunction(this, "OnServerTitleData"); + UPlayFabServerAPI::FDelegateOnFailurePlayFabError onError; onError.BindUFunction(this, "OnSharedError"); + UPlayFabServerAPI* callObj = UPlayFabServerAPI::GetTitleData(request, onSuccess, onError, testContext); + callObj->Activate(); +} +void APfTestActor::OnServerTitleData(FServerGetTitleDataResult result, UObject* customData) +{ + UPfTestContext* testContext = dynamic_cast(customData); + // There is no guarantee about content in titleData, so as long as this request succeeds, test passes + EndTest(testContext, PlayFabApiTestFinishState::PASSED, ""); +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFab.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFab.cpp new file mode 100644 index 000000000..0719ce70e --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFab.cpp @@ -0,0 +1,60 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// This cpp file is the main cpp file for the plugin. We set up globals here. +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "PlayFabPrivate.h" +#include "PlayFabJsonValue.h" +#include "PlayFabJsonObject.h" + + +#include "PlayFabAdminAPI.h" +#include "PlayFabClientAPI.h" +#include "PlayFabMatchmakerAPI.h" +#include "PlayFabServerAPI.h" +#include "PlayFabAuthenticationAPI.h" +#include "PlayFabCloudScriptAPI.h" +#include "PlayFabDataAPI.h" +#include "PlayFabEventsAPI.h" +#include "PlayFabGroupsAPI.h" +#include "PlayFabLocalizationAPI.h" +#include "PlayFabProfilesAPI.h" + +class FPlayFab : public IPlayFab +{ + /** IModuleInterface implementation */ + virtual void StartupModule() override + { + //Force classes to be compiled on shipping build + UPlayFabJsonObject::StaticClass(); + UPlayFabJsonValue::StaticClass(); + + UPlayFabAdminAPI::StaticClass(); + UPlayFabClientAPI::StaticClass(); + UPlayFabMatchmakerAPI::StaticClass(); + UPlayFabServerAPI::StaticClass(); + UPlayFabAuthenticationAPI::StaticClass(); + UPlayFabCloudScriptAPI::StaticClass(); + UPlayFabDataAPI::StaticClass(); + UPlayFabEventsAPI::StaticClass(); + UPlayFabGroupsAPI::StaticClass(); + UPlayFabLocalizationAPI::StaticClass(); + UPlayFabProfilesAPI::StaticClass(); + } + + virtual void ShutdownModule() override + { + + } + +}; + +IMPLEMENT_MODULE(FPlayFab, PlayFab) + +DEFINE_LOG_CATEGORY(LogPlayFab); diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAdminAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAdminAPI.cpp new file mode 100644 index 000000000..cc549b214 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAdminAPI.cpp @@ -0,0 +1,5929 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Admin +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabAdminAPI.h" +#include "PlayFabAdminModels.h" +#include "PlayFabAdminModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabAdminAPI::UPlayFabAdminAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabAdminAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabAdminAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabAdminAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Admin API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// +/** Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::BanUsers(FAdminBanUsersRequest request, + FDelegateOnSuccessBanUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessBanUsers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperBanUsers); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/BanUsers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Bans.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Bans")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Bans"), request.Bans); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperBanUsers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessBanUsers.IsBound()) + { + FAdminBanUsersResult result = UPlayFabAdminModelDecoder::decodeBanUsersResultResponse(response.responseData); + OnSuccessBanUsers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes a master player account entirely from all titles and deletes all associated data */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeleteMasterPlayerAccount(FAdminDeleteMasterPlayerAccountRequest request, + FDelegateOnSuccessDeleteMasterPlayerAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteMasterPlayerAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeleteMasterPlayerAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeleteMasterPlayerAccount"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeleteMasterPlayerAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteMasterPlayerAccount.IsBound()) + { + FAdminDeleteMasterPlayerAccountResult result = UPlayFabAdminModelDecoder::decodeDeleteMasterPlayerAccountResultResponse(response.responseData); + OnSuccessDeleteMasterPlayerAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes a user's player account from a title and deletes all associated data */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeletePlayer(FAdminDeletePlayerRequest request, + FDelegateOnSuccessDeletePlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeletePlayer = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeletePlayer); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeletePlayer"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeletePlayer(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeletePlayer.IsBound()) + { + FAdminDeletePlayerResult result = UPlayFabAdminModelDecoder::decodeDeletePlayerResultResponse(response.responseData); + OnSuccessDeletePlayer.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Permanently deletes a title and all associated configuration */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeleteTitle(FAdminDeleteTitleRequest request, + FDelegateOnSuccessDeleteTitle onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteTitle = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeleteTitle); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeleteTitle"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeleteTitle(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteTitle.IsBound()) + { + FAdminDeleteTitleResult result = UPlayFabAdminModelDecoder::decodeDeleteTitleResultResponse(response.responseData); + OnSuccessDeleteTitle.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Exports all associated data of a master player account */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ExportMasterPlayerData(FAdminExportMasterPlayerDataRequest request, + FDelegateOnSuccessExportMasterPlayerData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessExportMasterPlayerData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperExportMasterPlayerData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ExportMasterPlayerData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperExportMasterPlayerData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessExportMasterPlayerData.IsBound()) + { + FAdminExportMasterPlayerDataResult result = UPlayFabAdminModelDecoder::decodeExportMasterPlayerDataResultResponse(response.responseData); + OnSuccessExportMasterPlayerData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get the list of titles that the player has played */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayedTitleList(FAdminGetPlayedTitleListRequest request, + FDelegateOnSuccessGetPlayedTitleList onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayedTitleList = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayedTitleList); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayedTitleList"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayedTitleList(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayedTitleList.IsBound()) + { + FAdminGetPlayedTitleListResult result = UPlayFabAdminModelDecoder::decodeGetPlayedTitleListResultResponse(response.responseData); + OnSuccessGetPlayedTitleList.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets a player's ID from an auth token. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerIdFromAuthToken(FAdminGetPlayerIdFromAuthTokenRequest request, + FDelegateOnSuccessGetPlayerIdFromAuthToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerIdFromAuthToken = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerIdFromAuthToken); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerIdFromAuthToken"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Token.IsEmpty() || request.Token == "") { + OutRestJsonObj->SetFieldNull(TEXT("Token")); + } else { + OutRestJsonObj->SetStringField(TEXT("Token"), request.Token); + } + FString temp_TokenType; + if (GetEnumValueToString(TEXT("EAuthTokenType"), request.TokenType, temp_TokenType)) + OutRestJsonObj->SetStringField(TEXT("TokenType"), temp_TokenType); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerIdFromAuthToken(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerIdFromAuthToken.IsBound()) + { + FAdminGetPlayerIdFromAuthTokenResult result = UPlayFabAdminModelDecoder::decodeGetPlayerIdFromAuthTokenResultResponse(response.responseData); + OnSuccessGetPlayerIdFromAuthToken.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the player's profile */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerProfile(FAdminGetPlayerProfileRequest request, + FDelegateOnSuccessGetPlayerProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerProfile = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerProfile); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerProfile"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerProfile(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerProfile.IsBound()) + { + FAdminGetPlayerProfileResult result = UPlayFabAdminModelDecoder::decodeGetPlayerProfileResultResponse(response.responseData); + OnSuccessGetPlayerProfile.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the relevant details for a specified user, based upon a match against a supplied unique identifier */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserAccountInfo(FAdminLookupUserAccountInfoRequest request, + FDelegateOnSuccessGetUserAccountInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserAccountInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserAccountInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserAccountInfo"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.TitleDisplayName.IsEmpty() || request.TitleDisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("TitleDisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("TitleDisplayName"), request.TitleDisplayName); + } + if (request.Username.IsEmpty() || request.Username == "") { + OutRestJsonObj->SetFieldNull(TEXT("Username")); + } else { + OutRestJsonObj->SetStringField(TEXT("Username"), request.Username); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserAccountInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserAccountInfo.IsBound()) + { + FAdminLookupUserAccountInfoResult result = UPlayFabAdminModelDecoder::decodeLookupUserAccountInfoResultResponse(response.responseData); + OnSuccessGetUserAccountInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets all bans for a user. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserBans(FAdminGetUserBansRequest request, + FDelegateOnSuccessGetUserBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserBans = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserBans); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserBans"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserBans(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserBans.IsBound()) + { + FAdminGetUserBansResult result = UPlayFabAdminModelDecoder::decodeGetUserBansResultResponse(response.responseData); + OnSuccessGetUserBans.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Reset a player's password for a given title. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ResetPassword(FAdminResetPasswordRequest request, + FDelegateOnSuccessResetPassword onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessResetPassword = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperResetPassword); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ResetPassword"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Password.IsEmpty() || request.Password == "") { + OutRestJsonObj->SetFieldNull(TEXT("Password")); + } else { + OutRestJsonObj->SetStringField(TEXT("Password"), request.Password); + } + if (request.Token.IsEmpty() || request.Token == "") { + OutRestJsonObj->SetFieldNull(TEXT("Token")); + } else { + OutRestJsonObj->SetStringField(TEXT("Token"), request.Token); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperResetPassword(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessResetPassword.IsBound()) + { + FAdminResetPasswordResult result = UPlayFabAdminModelDecoder::decodeResetPasswordResultResponse(response.responseData); + OnSuccessResetPassword.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revoke all active bans for a user. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RevokeAllBansForUser(FAdminRevokeAllBansForUserRequest request, + FDelegateOnSuccessRevokeAllBansForUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeAllBansForUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRevokeAllBansForUser); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RevokeAllBansForUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRevokeAllBansForUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeAllBansForUser.IsBound()) + { + FAdminRevokeAllBansForUserResult result = UPlayFabAdminModelDecoder::decodeRevokeAllBansForUserResultResponse(response.responseData); + OnSuccessRevokeAllBansForUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revoke all active bans specified with BanId. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RevokeBans(FAdminRevokeBansRequest request, + FDelegateOnSuccessRevokeBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeBans = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRevokeBans); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RevokeBans"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.BanIds.IsEmpty() || request.BanIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("BanIds")); + } else { + TArray BanIdsArray; + FString(request.BanIds).ParseIntoArray(BanIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("BanIds"), BanIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRevokeBans(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeBans.IsBound()) + { + FAdminRevokeBansResult result = UPlayFabAdminModelDecoder::decodeRevokeBansResultResponse(response.responseData); + OnSuccessRevokeBans.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to change the password.If an account recovery email template ID is provided, an email using the custom email template will be used. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SendAccountRecoveryEmail(FAdminSendAccountRecoveryEmailRequest request, + FDelegateOnSuccessSendAccountRecoveryEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSendAccountRecoveryEmail = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSendAccountRecoveryEmail); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SendAccountRecoveryEmail"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.EmailTemplateId.IsEmpty() || request.EmailTemplateId == "") { + OutRestJsonObj->SetFieldNull(TEXT("EmailTemplateId")); + } else { + OutRestJsonObj->SetStringField(TEXT("EmailTemplateId"), request.EmailTemplateId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSendAccountRecoveryEmail(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSendAccountRecoveryEmail.IsBound()) + { + FAdminSendAccountRecoveryEmailResult result = UPlayFabAdminModelDecoder::decodeSendAccountRecoveryEmailResultResponse(response.responseData); + OnSuccessSendAccountRecoveryEmail.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates information of a list of existing bans specified with Ban Ids. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateBans(FAdminUpdateBansRequest request, + FDelegateOnSuccessUpdateBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateBans = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateBans); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateBans"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Bans.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Bans")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Bans"), request.Bans); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateBans(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateBans.IsBound()) + { + FAdminUpdateBansResult result = UPlayFabAdminModelDecoder::decodeUpdateBansResultResponse(response.responseData); + OnSuccessUpdateBans.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title specific display name for a user */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserTitleDisplayName(FAdminUpdateUserTitleDisplayNameRequest request, + FDelegateOnSuccessUpdateUserTitleDisplayName onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserTitleDisplayName = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserTitleDisplayName); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserTitleDisplayName"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.DisplayName.IsEmpty() || request.DisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("DisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("DisplayName"), request.DisplayName); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserTitleDisplayName(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserTitleDisplayName.IsBound()) + { + FAdminUpdateUserTitleDisplayNameResult result = UPlayFabAdminModelDecoder::decodeUpdateUserTitleDisplayNameResultResponse(response.responseData); + OnSuccessUpdateUserTitleDisplayName.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// +/** Creates a new Player Shared Secret Key. It may take up to 5 minutes for this key to become generally available after this API returns. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::CreatePlayerSharedSecret(FAdminCreatePlayerSharedSecretRequest request, + FDelegateOnSuccessCreatePlayerSharedSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreatePlayerSharedSecret = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperCreatePlayerSharedSecret); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/CreatePlayerSharedSecret"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.FriendlyName.IsEmpty() || request.FriendlyName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendlyName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendlyName"), request.FriendlyName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperCreatePlayerSharedSecret(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreatePlayerSharedSecret.IsBound()) + { + FAdminCreatePlayerSharedSecretResult result = UPlayFabAdminModelDecoder::decodeCreatePlayerSharedSecretResultResponse(response.responseData); + OnSuccessCreatePlayerSharedSecret.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Deletes an existing Player Shared Secret Key. It may take up to 5 minutes for this delete to be reflected after this API returns. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeletePlayerSharedSecret(FAdminDeletePlayerSharedSecretRequest request, + FDelegateOnSuccessDeletePlayerSharedSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeletePlayerSharedSecret = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeletePlayerSharedSecret); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeletePlayerSharedSecret"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.SecretKey.IsEmpty() || request.SecretKey == "") { + OutRestJsonObj->SetFieldNull(TEXT("SecretKey")); + } else { + OutRestJsonObj->SetStringField(TEXT("SecretKey"), request.SecretKey); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeletePlayerSharedSecret(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeletePlayerSharedSecret.IsBound()) + { + FAdminDeletePlayerSharedSecretResult result = UPlayFabAdminModelDecoder::decodeDeletePlayerSharedSecretResultResponse(response.responseData); + OnSuccessDeletePlayerSharedSecret.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Returns all Player Shared Secret Keys including disabled and expired. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerSharedSecrets(FAdminGetPlayerSharedSecretsRequest request, + FDelegateOnSuccessGetPlayerSharedSecrets onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerSharedSecrets = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerSharedSecrets); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerSharedSecrets"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerSharedSecrets(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerSharedSecrets.IsBound()) + { + FAdminGetPlayerSharedSecretsResult result = UPlayFabAdminModelDecoder::decodeGetPlayerSharedSecretsResultResponse(response.responseData); + OnSuccessGetPlayerSharedSecrets.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets the requested policy. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPolicy(FAdminGetPolicyRequest request, + FDelegateOnSuccessGetPolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPolicy = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPolicy); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPolicy"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PolicyName.IsEmpty() || request.PolicyName == "") { + OutRestJsonObj->SetFieldNull(TEXT("PolicyName")); + } else { + OutRestJsonObj->SetStringField(TEXT("PolicyName"), request.PolicyName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPolicy(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPolicy.IsBound()) + { + FAdminGetPolicyResponse result = UPlayFabAdminModelDecoder::decodeGetPolicyResponseResponse(response.responseData); + OnSuccessGetPolicy.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets or resets the player's secret. Player secrets are used to sign API requests. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetPlayerSecret(FAdminSetPlayerSecretRequest request, + FDelegateOnSuccessSetPlayerSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetPlayerSecret = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetPlayerSecret); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetPlayerSecret"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetPlayerSecret(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetPlayerSecret.IsBound()) + { + FAdminSetPlayerSecretResult result = UPlayFabAdminModelDecoder::decodeSetPlayerSecretResultResponse(response.responseData); + OnSuccessSetPlayerSecret.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates a existing Player Shared Secret Key. It may take up to 5 minutes for this update to become generally available after this API returns. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdatePlayerSharedSecret(FAdminUpdatePlayerSharedSecretRequest request, + FDelegateOnSuccessUpdatePlayerSharedSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdatePlayerSharedSecret = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdatePlayerSharedSecret); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdatePlayerSharedSecret"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("Disabled"), request.Disabled); + if (request.FriendlyName.IsEmpty() || request.FriendlyName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendlyName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendlyName"), request.FriendlyName); + } + if (request.SecretKey.IsEmpty() || request.SecretKey == "") { + OutRestJsonObj->SetFieldNull(TEXT("SecretKey")); + } else { + OutRestJsonObj->SetStringField(TEXT("SecretKey"), request.SecretKey); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdatePlayerSharedSecret(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdatePlayerSharedSecret.IsBound()) + { + FAdminUpdatePlayerSharedSecretResult result = UPlayFabAdminModelDecoder::decodeUpdatePlayerSharedSecretResultResponse(response.responseData); + OnSuccessUpdatePlayerSharedSecret.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Changes a policy for a title */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdatePolicy(FAdminUpdatePolicyRequest request, + FDelegateOnSuccessUpdatePolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdatePolicy = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdatePolicy); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdatePolicy"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("OverwritePolicy"), request.OverwritePolicy); + if (request.PolicyName.IsEmpty() || request.PolicyName == "") { + OutRestJsonObj->SetFieldNull(TEXT("PolicyName")); + } else { + OutRestJsonObj->SetStringField(TEXT("PolicyName"), request.PolicyName); + } + if (request.Statements.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Statements")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Statements"), request.Statements); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdatePolicy(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdatePolicy.IsBound()) + { + FAdminUpdatePolicyResponse result = UPlayFabAdminModelDecoder::decodeUpdatePolicyResponseResponse(response.responseData); + OnSuccessUpdatePolicy.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// +/** Completely removes all statistics for the specified character, for the current game */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ResetCharacterStatistics(FAdminResetCharacterStatisticsRequest request, + FDelegateOnSuccessResetCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessResetCharacterStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperResetCharacterStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ResetCharacterStatistics"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperResetCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessResetCharacterStatistics.IsBound()) + { + FAdminResetCharacterStatisticsResult result = UPlayFabAdminModelDecoder::decodeResetCharacterStatisticsResultResponse(response.responseData); + OnSuccessResetCharacterStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// +/** Delete a content file from the title. When deleting a file that does not exist, it returns success. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeleteContent(FAdminDeleteContentRequest request, + FDelegateOnSuccessDeleteContent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteContent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeleteContent); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeleteContent"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeleteContent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteContent.IsBound()) + { + FAdminBlankResult result = UPlayFabAdminModelDecoder::decodeBlankResultResponse(response.responseData); + OnSuccessDeleteContent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** List all contents of the title and get statistics such as size */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetContentList(FAdminGetContentListRequest request, + FDelegateOnSuccessGetContentList onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetContentList = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetContentList); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetContentList"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Prefix.IsEmpty() || request.Prefix == "") { + OutRestJsonObj->SetFieldNull(TEXT("Prefix")); + } else { + OutRestJsonObj->SetStringField(TEXT("Prefix"), request.Prefix); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetContentList(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetContentList.IsBound()) + { + FAdminGetContentListResult result = UPlayFabAdminModelDecoder::decodeGetContentListResultResponse(response.responseData); + OnSuccessGetContentList.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the pre-signed URL for uploading a content file. A subsequent HTTP PUT to the returned URL uploads the content. Also, please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetContentUploadUrl(FAdminGetContentUploadUrlRequest request, + FDelegateOnSuccessGetContentUploadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetContentUploadUrl = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetContentUploadUrl); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetContentUploadUrl"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.ContentType.IsEmpty() || request.ContentType == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContentType")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContentType"), request.ContentType); + } + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetContentUploadUrl(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetContentUploadUrl.IsBound()) + { + FAdminGetContentUploadUrlResult result = UPlayFabAdminModelDecoder::decodeGetContentUploadUrlResultResponse(response.responseData); + OnSuccessGetContentUploadUrl.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Custom Server Management +////////////////////////////////////////////////////// +/** Adds the game server executable specified (previously uploaded - see GetServerBuildUploadUrl) to the set of those a client is permitted to request in a call to StartGame */ +UPlayFabAdminAPI* UPlayFabAdminAPI::AddServerBuild(FAdminAddServerBuildRequest request, + FDelegateOnSuccessAddServerBuild onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddServerBuild = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperAddServerBuild); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/AddServerBuild"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.ActiveRegions.IsEmpty() || request.ActiveRegions == "") { + OutRestJsonObj->SetFieldNull(TEXT("ActiveRegions")); + } else { + TArray ActiveRegionsArray; + FString(request.ActiveRegions).ParseIntoArray(ActiveRegionsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("ActiveRegions"), ActiveRegionsArray); + } + if (request.BuildId.IsEmpty() || request.BuildId == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildId")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildId"), request.BuildId); + } + if (request.CommandLineTemplate.IsEmpty() || request.CommandLineTemplate == "") { + OutRestJsonObj->SetFieldNull(TEXT("CommandLineTemplate")); + } else { + OutRestJsonObj->SetStringField(TEXT("CommandLineTemplate"), request.CommandLineTemplate); + } + if (request.Comment.IsEmpty() || request.Comment == "") { + OutRestJsonObj->SetFieldNull(TEXT("Comment")); + } else { + OutRestJsonObj->SetStringField(TEXT("Comment"), request.Comment); + } + if (request.ExecutablePath.IsEmpty() || request.ExecutablePath == "") { + OutRestJsonObj->SetFieldNull(TEXT("ExecutablePath")); + } else { + OutRestJsonObj->SetStringField(TEXT("ExecutablePath"), request.ExecutablePath); + } + OutRestJsonObj->SetNumberField(TEXT("MaxGamesPerHost"), request.MaxGamesPerHost); + OutRestJsonObj->SetNumberField(TEXT("MinFreeGameSlots"), request.MinFreeGameSlots); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperAddServerBuild(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddServerBuild.IsBound()) + { + FAdminAddServerBuildResult result = UPlayFabAdminModelDecoder::decodeAddServerBuildResultResponse(response.responseData); + OnSuccessAddServerBuild.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the build details for the specified game server executable */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetServerBuildInfo(FAdminGetServerBuildInfoRequest request, + FDelegateOnSuccessGetServerBuildInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetServerBuildInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetServerBuildInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetServerBuildInfo"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.BuildId.IsEmpty() || request.BuildId == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildId")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildId"), request.BuildId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetServerBuildInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetServerBuildInfo.IsBound()) + { + FAdminGetServerBuildInfoResult result = UPlayFabAdminModelDecoder::decodeGetServerBuildInfoResultResponse(response.responseData); + OnSuccessGetServerBuildInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the pre-authorized URL for uploading a game server package containing a build (does not enable the build for use - see AddServerBuild) */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetServerBuildUploadUrl(FAdminGetServerBuildUploadURLRequest request, + FDelegateOnSuccessGetServerBuildUploadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetServerBuildUploadUrl = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetServerBuildUploadUrl); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetServerBuildUploadUrl"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.BuildId.IsEmpty() || request.BuildId == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildId")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildId"), request.BuildId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetServerBuildUploadUrl(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetServerBuildUploadUrl.IsBound()) + { + FAdminGetServerBuildUploadURLResult result = UPlayFabAdminModelDecoder::decodeGetServerBuildUploadURLResultResponse(response.responseData); + OnSuccessGetServerBuildUploadUrl.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the build details for all game server executables which are currently defined for the title */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ListServerBuilds(FAdminListBuildsRequest request, + FDelegateOnSuccessListServerBuilds onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListServerBuilds = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperListServerBuilds); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ListServerBuilds"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperListServerBuilds(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListServerBuilds.IsBound()) + { + FAdminListBuildsResult result = UPlayFabAdminModelDecoder::decodeListBuildsResultResponse(response.responseData); + OnSuccessListServerBuilds.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the build details for the specified game server executable */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ModifyServerBuild(FAdminModifyServerBuildRequest request, + FDelegateOnSuccessModifyServerBuild onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessModifyServerBuild = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperModifyServerBuild); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ModifyServerBuild"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.ActiveRegions.IsEmpty() || request.ActiveRegions == "") { + OutRestJsonObj->SetFieldNull(TEXT("ActiveRegions")); + } else { + TArray ActiveRegionsArray; + FString(request.ActiveRegions).ParseIntoArray(ActiveRegionsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("ActiveRegions"), ActiveRegionsArray); + } + if (request.BuildId.IsEmpty() || request.BuildId == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildId")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildId"), request.BuildId); + } + if (request.CommandLineTemplate.IsEmpty() || request.CommandLineTemplate == "") { + OutRestJsonObj->SetFieldNull(TEXT("CommandLineTemplate")); + } else { + OutRestJsonObj->SetStringField(TEXT("CommandLineTemplate"), request.CommandLineTemplate); + } + if (request.Comment.IsEmpty() || request.Comment == "") { + OutRestJsonObj->SetFieldNull(TEXT("Comment")); + } else { + OutRestJsonObj->SetStringField(TEXT("Comment"), request.Comment); + } + if (request.ExecutablePath.IsEmpty() || request.ExecutablePath == "") { + OutRestJsonObj->SetFieldNull(TEXT("ExecutablePath")); + } else { + OutRestJsonObj->SetStringField(TEXT("ExecutablePath"), request.ExecutablePath); + } + OutRestJsonObj->SetNumberField(TEXT("MaxGamesPerHost"), request.MaxGamesPerHost); + OutRestJsonObj->SetNumberField(TEXT("MinFreeGameSlots"), request.MinFreeGameSlots); + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperModifyServerBuild(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessModifyServerBuild.IsBound()) + { + FAdminModifyServerBuildResult result = UPlayFabAdminModelDecoder::decodeModifyServerBuildResultResponse(response.responseData); + OnSuccessModifyServerBuild.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes the game server executable specified from the set of those a client is permitted to request in a call to StartGame */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RemoveServerBuild(FAdminRemoveServerBuildRequest request, + FDelegateOnSuccessRemoveServerBuild onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveServerBuild = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRemoveServerBuild); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RemoveServerBuild"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.BuildId.IsEmpty() || request.BuildId == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildId")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildId"), request.BuildId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRemoveServerBuild(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveServerBuild.IsBound()) + { + FAdminRemoveServerBuildResult result = UPlayFabAdminModelDecoder::decodeRemoveServerBuildResultResponse(response.responseData); + OnSuccessRemoveServerBuild.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// +/** Retrieves the details for a specific completed session, including links to standard out and standard error logs */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetMatchmakerGameInfo(FAdminGetMatchmakerGameInfoRequest request, + FDelegateOnSuccessGetMatchmakerGameInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetMatchmakerGameInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetMatchmakerGameInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetMatchmakerGameInfo"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetMatchmakerGameInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetMatchmakerGameInfo.IsBound()) + { + FAdminGetMatchmakerGameInfoResult result = UPlayFabAdminModelDecoder::decodeGetMatchmakerGameInfoResultResponse(response.responseData); + OnSuccessGetMatchmakerGameInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the details of defined game modes for the specified game server executable */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetMatchmakerGameModes(FAdminGetMatchmakerGameModesRequest request, + FDelegateOnSuccessGetMatchmakerGameModes onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetMatchmakerGameModes = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetMatchmakerGameModes); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetMatchmakerGameModes"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.BuildVersion.IsEmpty() || request.BuildVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildVersion"), request.BuildVersion); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetMatchmakerGameModes(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetMatchmakerGameModes.IsBound()) + { + FAdminGetMatchmakerGameModesResult result = UPlayFabAdminModelDecoder::decodeGetMatchmakerGameModesResultResponse(response.responseData); + OnSuccessGetMatchmakerGameModes.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the game server mode details for the specified game server executable */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ModifyMatchmakerGameModes(FAdminModifyMatchmakerGameModesRequest request, + FDelegateOnSuccessModifyMatchmakerGameModes onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessModifyMatchmakerGameModes = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperModifyMatchmakerGameModes); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ModifyMatchmakerGameModes"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.BuildVersion.IsEmpty() || request.BuildVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildVersion"), request.BuildVersion); + } + if (request.GameModes.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("GameModes")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("GameModes"), request.GameModes); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperModifyMatchmakerGameModes(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessModifyMatchmakerGameModes.IsBound()) + { + FAdminModifyMatchmakerGameModesResult result = UPlayFabAdminModelDecoder::decodeModifyMatchmakerGameModesResultResponse(response.responseData); + OnSuccessModifyMatchmakerGameModes.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// +/** Adds a new player statistic configuration to the title, optionally allowing the developer to specify a reset interval and an aggregation method. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::CreatePlayerStatisticDefinition(FAdminCreatePlayerStatisticDefinitionRequest request, + FDelegateOnSuccessCreatePlayerStatisticDefinition onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreatePlayerStatisticDefinition = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperCreatePlayerStatisticDefinition); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/CreatePlayerStatisticDefinition"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + FString temp_AggregationMethod; + if (GetEnumValueToString(TEXT("EStatisticAggregationMethod"), request.AggregationMethod, temp_AggregationMethod)) + OutRestJsonObj->SetStringField(TEXT("AggregationMethod"), temp_AggregationMethod); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + FString temp_VersionChangeInterval; + if (GetEnumValueToString(TEXT("EStatisticResetIntervalOption"), request.VersionChangeInterval, temp_VersionChangeInterval)) + OutRestJsonObj->SetStringField(TEXT("VersionChangeInterval"), temp_VersionChangeInterval); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperCreatePlayerStatisticDefinition(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreatePlayerStatisticDefinition.IsBound()) + { + FAdminCreatePlayerStatisticDefinitionResult result = UPlayFabAdminModelDecoder::decodeCreatePlayerStatisticDefinitionResultResponse(response.responseData); + OnSuccessCreatePlayerStatisticDefinition.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a download URL for the requested report */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetDataReport(FAdminGetDataReportRequest request, + FDelegateOnSuccessGetDataReport onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetDataReport = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetDataReport); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetDataReport"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Day"), request.Day); + OutRestJsonObj->SetNumberField(TEXT("Month"), request.Month); + if (request.ReportName.IsEmpty() || request.ReportName == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReportName")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReportName"), request.ReportName); + } + OutRestJsonObj->SetNumberField(TEXT("Year"), request.Year); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetDataReport(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetDataReport.IsBound()) + { + FAdminGetDataReportResult result = UPlayFabAdminModelDecoder::decodeGetDataReportResultResponse(response.responseData); + OnSuccessGetDataReport.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the configuration information for all player statistics defined in the title, regardless of whether they have a reset interval. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerStatisticDefinitions(FAdminGetPlayerStatisticDefinitionsRequest request, + FDelegateOnSuccessGetPlayerStatisticDefinitions onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerStatisticDefinitions = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerStatisticDefinitions); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerStatisticDefinitions"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerStatisticDefinitions(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerStatisticDefinitions.IsBound()) + { + FAdminGetPlayerStatisticDefinitionsResult result = UPlayFabAdminModelDecoder::decodeGetPlayerStatisticDefinitionsResultResponse(response.responseData); + OnSuccessGetPlayerStatisticDefinitions.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the information on the available versions of the specified statistic. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerStatisticVersions(FAdminGetPlayerStatisticVersionsRequest request, + FDelegateOnSuccessGetPlayerStatisticVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerStatisticVersions = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerStatisticVersions); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerStatisticVersions"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerStatisticVersions(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerStatisticVersions.IsBound()) + { + FAdminGetPlayerStatisticVersionsResult result = UPlayFabAdminModelDecoder::decodeGetPlayerStatisticVersionsResultResponse(response.responseData); + OnSuccessGetPlayerStatisticVersions.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserData.IsBound()) + { + FAdminGetUserDataResult result = UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which cannot be accessed by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserInternalData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserInternalData.IsBound()) + { + FAdminGetUserDataResult result = UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserPublisherData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherData.IsBound()) + { + FAdminGetUserDataResult result = UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which cannot be accessed by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserPublisherInternalData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserPublisherInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserPublisherInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherInternalData.IsBound()) + { + FAdminGetUserDataResult result = UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which can only be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserPublisherReadOnlyData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserPublisherReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserPublisherReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherReadOnlyData.IsBound()) + { + FAdminGetUserDataResult result = UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which can only be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserReadOnlyData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserReadOnlyData.IsBound()) + { + FAdminGetUserDataResult result = UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Resets the indicated statistic, removing all player entries for it and backing up the old values. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::IncrementPlayerStatisticVersion(FAdminIncrementPlayerStatisticVersionRequest request, + FDelegateOnSuccessIncrementPlayerStatisticVersion onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessIncrementPlayerStatisticVersion = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperIncrementPlayerStatisticVersion); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/IncrementPlayerStatisticVersion"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperIncrementPlayerStatisticVersion(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessIncrementPlayerStatisticVersion.IsBound()) + { + FAdminIncrementPlayerStatisticVersionResult result = UPlayFabAdminModelDecoder::decodeIncrementPlayerStatisticVersionResultResponse(response.responseData); + OnSuccessIncrementPlayerStatisticVersion.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Attempts to process an order refund through the original real money payment provider. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RefundPurchase(FAdminRefundPurchaseRequest request, + FDelegateOnSuccessRefundPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRefundPurchase = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRefundPurchase); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RefundPurchase"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.OrderId.IsEmpty() || request.OrderId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OrderId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OrderId"), request.OrderId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.Reason.IsEmpty() || request.Reason == "") { + OutRestJsonObj->SetFieldNull(TEXT("Reason")); + } else { + OutRestJsonObj->SetStringField(TEXT("Reason"), request.Reason); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRefundPurchase(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRefundPurchase.IsBound()) + { + FAdminRefundPurchaseResponse result = UPlayFabAdminModelDecoder::decodeRefundPurchaseResponseResponse(response.responseData); + OnSuccessRefundPurchase.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Completely removes all statistics for the specified user, for the current game */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ResetUserStatistics(FAdminResetUserStatisticsRequest request, + FDelegateOnSuccessResetUserStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessResetUserStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperResetUserStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ResetUserStatistics"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperResetUserStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessResetUserStatistics.IsBound()) + { + FAdminResetUserStatisticsResult result = UPlayFabAdminModelDecoder::decodeResetUserStatisticsResultResponse(response.responseData); + OnSuccessResetUserStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Attempts to resolve a dispute with the original order's payment provider. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ResolvePurchaseDispute(FAdminResolvePurchaseDisputeRequest request, + FDelegateOnSuccessResolvePurchaseDispute onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessResolvePurchaseDispute = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperResolvePurchaseDispute); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ResolvePurchaseDispute"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.OrderId.IsEmpty() || request.OrderId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OrderId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OrderId"), request.OrderId); + } + FString temp_Outcome; + if (GetEnumValueToString(TEXT("EResolutionOutcome"), request.Outcome, temp_Outcome)) + OutRestJsonObj->SetStringField(TEXT("Outcome"), temp_Outcome); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.Reason.IsEmpty() || request.Reason == "") { + OutRestJsonObj->SetFieldNull(TEXT("Reason")); + } else { + OutRestJsonObj->SetStringField(TEXT("Reason"), request.Reason); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperResolvePurchaseDispute(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessResolvePurchaseDispute.IsBound()) + { + FAdminResolvePurchaseDisputeResponse result = UPlayFabAdminModelDecoder::decodeResolvePurchaseDisputeResponseResponse(response.responseData); + OnSuccessResolvePurchaseDispute.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates a player statistic configuration for the title, optionally allowing the developer to specify a reset interval. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdatePlayerStatisticDefinition(FAdminUpdatePlayerStatisticDefinitionRequest request, + FDelegateOnSuccessUpdatePlayerStatisticDefinition onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdatePlayerStatisticDefinition = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdatePlayerStatisticDefinition); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdatePlayerStatisticDefinition"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + FString temp_AggregationMethod; + if (GetEnumValueToString(TEXT("EStatisticAggregationMethod"), request.AggregationMethod, temp_AggregationMethod)) + OutRestJsonObj->SetStringField(TEXT("AggregationMethod"), temp_AggregationMethod); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + FString temp_VersionChangeInterval; + if (GetEnumValueToString(TEXT("EStatisticResetIntervalOption"), request.VersionChangeInterval, temp_VersionChangeInterval)) + OutRestJsonObj->SetStringField(TEXT("VersionChangeInterval"), temp_VersionChangeInterval); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdatePlayerStatisticDefinition(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdatePlayerStatisticDefinition.IsBound()) + { + FAdminUpdatePlayerStatisticDefinitionResult result = UPlayFabAdminModelDecoder::decodeUpdatePlayerStatisticDefinitionResultResponse(response.responseData); + OnSuccessUpdatePlayerStatisticDefinition.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserData.IsBound()) + { + FAdminUpdateUserDataResult result = UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user which cannot be accessed by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserInternalData(FAdminUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserInternalData.IsBound()) + { + FAdminUpdateUserDataResult result = UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the publisher-specific custom data for the user which is readable and writable by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserPublisherData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherData.IsBound()) + { + FAdminUpdateUserDataResult result = UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the publisher-specific custom data for the user which cannot be accessed by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserPublisherInternalData(FAdminUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserPublisherInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserPublisherInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherInternalData.IsBound()) + { + FAdminUpdateUserDataResult result = UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the publisher-specific custom data for the user which can only be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserPublisherReadOnlyData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserPublisherReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserPublisherReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherReadOnlyData.IsBound()) + { + FAdminUpdateUserDataResult result = UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user which can only be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserReadOnlyData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserReadOnlyData.IsBound()) + { + FAdminUpdateUserDataResult result = UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// +/** Increments the specified virtual currency by the stated amount */ +UPlayFabAdminAPI* UPlayFabAdminAPI::AddUserVirtualCurrency(FAdminAddUserVirtualCurrencyRequest request, + FDelegateOnSuccessAddUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddUserVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperAddUserVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/AddUserVirtualCurrency"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperAddUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddUserVirtualCurrency.IsBound()) + { + FAdminModifyUserVirtualCurrencyResult result = UPlayFabAdminModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(response.responseData); + OnSuccessAddUserVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Checks the global count for the limited edition item. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::CheckLimitedEditionItemAvailability(FAdminCheckLimitedEditionItemAvailabilityRequest request, + FDelegateOnSuccessCheckLimitedEditionItemAvailability onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCheckLimitedEditionItemAvailability = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperCheckLimitedEditionItemAvailability); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/CheckLimitedEditionItemAvailability"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.ItemId.IsEmpty() || request.ItemId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemId"), request.ItemId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperCheckLimitedEditionItemAvailability(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCheckLimitedEditionItemAvailability.IsBound()) + { + FAdminCheckLimitedEditionItemAvailabilityResult result = UPlayFabAdminModelDecoder::decodeCheckLimitedEditionItemAvailabilityResultResponse(response.responseData); + OnSuccessCheckLimitedEditionItemAvailability.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the specified user's current inventory of virtual goods */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserInventory(FAdminGetUserInventoryRequest request, + FDelegateOnSuccessGetUserInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserInventory = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserInventory); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserInventory"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserInventory(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserInventory.IsBound()) + { + FAdminGetUserInventoryResult result = UPlayFabAdminModelDecoder::decodeGetUserInventoryResultResponse(response.responseData); + OnSuccessGetUserInventory.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds the specified items to the specified user inventories */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GrantItemsToUsers(FAdminGrantItemsToUsersRequest request, + FDelegateOnSuccessGrantItemsToUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGrantItemsToUsers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGrantItemsToUsers); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GrantItemsToUsers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.ItemGrants.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("ItemGrants")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("ItemGrants"), request.ItemGrants); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGrantItemsToUsers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGrantItemsToUsers.IsBound()) + { + FAdminGrantItemsToUsersResult result = UPlayFabAdminModelDecoder::decodeGrantItemsToUsersResultResponse(response.responseData); + OnSuccessGrantItemsToUsers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Increases the global count for the given scarce resource. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::IncrementLimitedEditionItemAvailability(FAdminIncrementLimitedEditionItemAvailabilityRequest request, + FDelegateOnSuccessIncrementLimitedEditionItemAvailability onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessIncrementLimitedEditionItemAvailability = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperIncrementLimitedEditionItemAvailability); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/IncrementLimitedEditionItemAvailability"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.ItemId.IsEmpty() || request.ItemId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemId"), request.ItemId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperIncrementLimitedEditionItemAvailability(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessIncrementLimitedEditionItemAvailability.IsBound()) + { + FAdminIncrementLimitedEditionItemAvailabilityResult result = UPlayFabAdminModelDecoder::decodeIncrementLimitedEditionItemAvailabilityResultResponse(response.responseData); + OnSuccessIncrementLimitedEditionItemAvailability.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revokes access to an item in a user's inventory */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RevokeInventoryItem(FAdminRevokeInventoryItemRequest request, + FDelegateOnSuccessRevokeInventoryItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeInventoryItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRevokeInventoryItem); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RevokeInventoryItem"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRevokeInventoryItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeInventoryItem.IsBound()) + { + FAdminRevokeInventoryResult result = UPlayFabAdminModelDecoder::decodeRevokeInventoryResultResponse(response.responseData); + OnSuccessRevokeInventoryItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revokes access for up to 25 items across multiple users and characters. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RevokeInventoryItems(FAdminRevokeInventoryItemsRequest request, + FDelegateOnSuccessRevokeInventoryItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeInventoryItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRevokeInventoryItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RevokeInventoryItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Items.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Items")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Items"), request.Items); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRevokeInventoryItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeInventoryItems.IsBound()) + { + FAdminRevokeInventoryItemsResult result = UPlayFabAdminModelDecoder::decodeRevokeInventoryItemsResultResponse(response.responseData); + OnSuccessRevokeInventoryItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Decrements the specified virtual currency by the stated amount */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SubtractUserVirtualCurrency(FAdminSubtractUserVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSubtractUserVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSubtractUserVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SubtractUserVirtualCurrency"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSubtractUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSubtractUserVirtualCurrency.IsBound()) + { + FAdminModifyUserVirtualCurrencyResult result = UPlayFabAdminModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(response.responseData); + OnSuccessSubtractUserVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// +/** Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::AddPlayerTag(FAdminAddPlayerTagRequest request, + FDelegateOnSuccessAddPlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddPlayerTag = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperAddPlayerTag); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/AddPlayerTag"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.TagName.IsEmpty() || request.TagName == "") { + OutRestJsonObj->SetFieldNull(TEXT("TagName")); + } else { + OutRestJsonObj->SetStringField(TEXT("TagName"), request.TagName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperAddPlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddPlayerTag.IsBound()) + { + FAdminAddPlayerTagResult result = UPlayFabAdminModelDecoder::decodeAddPlayerTagResultResponse(response.responseData); + OnSuccessAddPlayerTag.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetAllSegments(FAdminGetAllSegmentsRequest request, + FDelegateOnSuccessGetAllSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetAllSegments = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetAllSegments); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetAllSegments"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetAllSegments(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetAllSegments.IsBound()) + { + FAdminGetAllSegmentsResult result = UPlayFabAdminModelDecoder::decodeGetAllSegmentsResultResponse(response.responseData); + OnSuccessGetAllSegments.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** List all segments that a player currently belongs to at this moment in time. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerSegments(FAdminGetPlayersSegmentsRequest request, + FDelegateOnSuccessGetPlayerSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerSegments = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerSegments); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerSegments"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerSegments(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerSegments.IsBound()) + { + FAdminGetPlayerSegmentsResult result = UPlayFabAdminModelDecoder::decodeGetPlayerSegmentsResultResponse(response.responseData); + OnSuccessGetPlayerSegments.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayersInSegment(FAdminGetPlayersInSegmentRequest request, + FDelegateOnSuccessGetPlayersInSegment onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayersInSegment = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayersInSegment); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayersInSegment"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.ContinuationToken.IsEmpty() || request.ContinuationToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContinuationToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContinuationToken"), request.ContinuationToken); + } + OutRestJsonObj->SetNumberField(TEXT("MaxBatchSize"), request.MaxBatchSize); + OutRestJsonObj->SetNumberField(TEXT("SecondsToLive"), request.SecondsToLive); + if (request.SegmentId.IsEmpty() || request.SegmentId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SegmentId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SegmentId"), request.SegmentId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayersInSegment(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayersInSegment.IsBound()) + { + FAdminGetPlayersInSegmentResult result = UPlayFabAdminModelDecoder::decodeGetPlayersInSegmentResultResponse(response.responseData); + OnSuccessGetPlayersInSegment.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get all tags with a given Namespace (optional) from a player profile. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerTags(FAdminGetPlayerTagsRequest request, + FDelegateOnSuccessGetPlayerTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerTags = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerTags); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerTags"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Namespace.IsEmpty() || request.Namespace == "") { + OutRestJsonObj->SetFieldNull(TEXT("Namespace")); + } else { + OutRestJsonObj->SetStringField(TEXT("Namespace"), request.Namespace); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerTags(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerTags.IsBound()) + { + FAdminGetPlayerTagsResult result = UPlayFabAdminModelDecoder::decodeGetPlayerTagsResultResponse(response.responseData); + OnSuccessGetPlayerTags.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RemovePlayerTag(FAdminRemovePlayerTagRequest request, + FDelegateOnSuccessRemovePlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemovePlayerTag = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRemovePlayerTag); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RemovePlayerTag"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.TagName.IsEmpty() || request.TagName == "") { + OutRestJsonObj->SetFieldNull(TEXT("TagName")); + } else { + OutRestJsonObj->SetStringField(TEXT("TagName"), request.TagName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRemovePlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemovePlayerTag.IsBound()) + { + FAdminRemovePlayerTagResult result = UPlayFabAdminModelDecoder::decodeRemovePlayerTagResultResponse(response.responseData); + OnSuccessRemovePlayerTag.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// ScheduledTask +////////////////////////////////////////////////////// +/** Abort an ongoing task instance. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::AbortTaskInstance(FAdminAbortTaskInstanceRequest request, + FDelegateOnSuccessAbortTaskInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAbortTaskInstance = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperAbortTaskInstance); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/AbortTaskInstance"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.TaskInstanceId.IsEmpty() || request.TaskInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TaskInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TaskInstanceId"), request.TaskInstanceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperAbortTaskInstance(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAbortTaskInstance.IsBound()) + { + FAdminEmptyResponse result = UPlayFabAdminModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessAbortTaskInstance.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Create an ActionsOnPlayersInSegment task, which iterates through all players in a segment to execute action. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::CreateActionsOnPlayersInSegmentTask(FAdminCreateActionsOnPlayerSegmentTaskRequest request, + FDelegateOnSuccessCreateActionsOnPlayersInSegmentTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreateActionsOnPlayersInSegmentTask = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperCreateActionsOnPlayersInSegmentTask); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/CreateActionsOnPlayersInSegmentTask"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Description.IsEmpty() || request.Description == "") { + OutRestJsonObj->SetFieldNull(TEXT("Description")); + } else { + OutRestJsonObj->SetStringField(TEXT("Description"), request.Description); + } + OutRestJsonObj->SetBoolField(TEXT("IsActive"), request.IsActive); + if (request.Name.IsEmpty() || request.Name == "") { + OutRestJsonObj->SetFieldNull(TEXT("Name")); + } else { + OutRestJsonObj->SetStringField(TEXT("Name"), request.Name); + } + if (request.Parameter != nullptr) OutRestJsonObj->SetObjectField(TEXT("Parameter"), request.Parameter); + if (request.Schedule.IsEmpty() || request.Schedule == "") { + OutRestJsonObj->SetFieldNull(TEXT("Schedule")); + } else { + OutRestJsonObj->SetStringField(TEXT("Schedule"), request.Schedule); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperCreateActionsOnPlayersInSegmentTask(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreateActionsOnPlayersInSegmentTask.IsBound()) + { + FAdminCreateTaskResult result = UPlayFabAdminModelDecoder::decodeCreateTaskResultResponse(response.responseData); + OnSuccessCreateActionsOnPlayersInSegmentTask.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Create a CloudScript task, which can run a CloudScript on a schedule. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::CreateCloudScriptTask(FAdminCreateCloudScriptTaskRequest request, + FDelegateOnSuccessCreateCloudScriptTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreateCloudScriptTask = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperCreateCloudScriptTask); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/CreateCloudScriptTask"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Description.IsEmpty() || request.Description == "") { + OutRestJsonObj->SetFieldNull(TEXT("Description")); + } else { + OutRestJsonObj->SetStringField(TEXT("Description"), request.Description); + } + OutRestJsonObj->SetBoolField(TEXT("IsActive"), request.IsActive); + if (request.Name.IsEmpty() || request.Name == "") { + OutRestJsonObj->SetFieldNull(TEXT("Name")); + } else { + OutRestJsonObj->SetStringField(TEXT("Name"), request.Name); + } + if (request.Parameter != nullptr) OutRestJsonObj->SetObjectField(TEXT("Parameter"), request.Parameter); + if (request.Schedule.IsEmpty() || request.Schedule == "") { + OutRestJsonObj->SetFieldNull(TEXT("Schedule")); + } else { + OutRestJsonObj->SetStringField(TEXT("Schedule"), request.Schedule); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperCreateCloudScriptTask(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreateCloudScriptTask.IsBound()) + { + FAdminCreateTaskResult result = UPlayFabAdminModelDecoder::decodeCreateTaskResultResponse(response.responseData); + OnSuccessCreateCloudScriptTask.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Delete a task. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeleteTask(FAdminDeleteTaskRequest request, + FDelegateOnSuccessDeleteTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteTask = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeleteTask); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeleteTask"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Identifier != nullptr) OutRestJsonObj->SetObjectField(TEXT("Identifier"), request.Identifier); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeleteTask(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteTask.IsBound()) + { + FAdminEmptyResponse result = UPlayFabAdminModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessDeleteTask.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get information about a ActionsOnPlayersInSegment task instance. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetActionsOnPlayersInSegmentTaskInstance(FAdminGetTaskInstanceRequest request, + FDelegateOnSuccessGetActionsOnPlayersInSegmentTaskInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetActionsOnPlayersInSegmentTaskInstance = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetActionsOnPlayersInSegmentTaskInstance); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetActionsOnPlayersInSegmentTaskInstance"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.TaskInstanceId.IsEmpty() || request.TaskInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TaskInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TaskInstanceId"), request.TaskInstanceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetActionsOnPlayersInSegmentTaskInstance(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetActionsOnPlayersInSegmentTaskInstance.IsBound()) + { + FAdminGetActionsOnPlayersInSegmentTaskInstanceResult result = UPlayFabAdminModelDecoder::decodeGetActionsOnPlayersInSegmentTaskInstanceResultResponse(response.responseData); + OnSuccessGetActionsOnPlayersInSegmentTaskInstance.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get detail information about a CloudScript task instance. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetCloudScriptTaskInstance(FAdminGetTaskInstanceRequest request, + FDelegateOnSuccessGetCloudScriptTaskInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCloudScriptTaskInstance = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetCloudScriptTaskInstance); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetCloudScriptTaskInstance"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.TaskInstanceId.IsEmpty() || request.TaskInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TaskInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TaskInstanceId"), request.TaskInstanceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetCloudScriptTaskInstance(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCloudScriptTaskInstance.IsBound()) + { + FAdminGetCloudScriptTaskInstanceResult result = UPlayFabAdminModelDecoder::decodeGetCloudScriptTaskInstanceResultResponse(response.responseData); + OnSuccessGetCloudScriptTaskInstance.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Query for task instances by task, status, or time range. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetTaskInstances(FAdminGetTaskInstancesRequest request, + FDelegateOnSuccessGetTaskInstances onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTaskInstances = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetTaskInstances); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetTaskInstances"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.StartedAtRangeFrom.IsEmpty() || request.StartedAtRangeFrom == "") { + OutRestJsonObj->SetFieldNull(TEXT("StartedAtRangeFrom")); + } else { + OutRestJsonObj->SetStringField(TEXT("StartedAtRangeFrom"), request.StartedAtRangeFrom); + } + if (request.StartedAtRangeTo.IsEmpty() || request.StartedAtRangeTo == "") { + OutRestJsonObj->SetFieldNull(TEXT("StartedAtRangeTo")); + } else { + OutRestJsonObj->SetStringField(TEXT("StartedAtRangeTo"), request.StartedAtRangeTo); + } + FString temp_StatusFilter; + if (GetEnumValueToString(TEXT("ETaskInstanceStatus"), request.StatusFilter, temp_StatusFilter)) + OutRestJsonObj->SetStringField(TEXT("StatusFilter"), temp_StatusFilter); + if (request.TaskIdentifier != nullptr) OutRestJsonObj->SetObjectField(TEXT("TaskIdentifier"), request.TaskIdentifier); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetTaskInstances(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTaskInstances.IsBound()) + { + FAdminGetTaskInstancesResult result = UPlayFabAdminModelDecoder::decodeGetTaskInstancesResultResponse(response.responseData); + OnSuccessGetTaskInstances.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get definition information on a specified task or all tasks within a title. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetTasks(FAdminGetTasksRequest request, + FDelegateOnSuccessGetTasks onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTasks = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetTasks); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetTasks"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Identifier != nullptr) OutRestJsonObj->SetObjectField(TEXT("Identifier"), request.Identifier); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetTasks(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTasks.IsBound()) + { + FAdminGetTasksResult result = UPlayFabAdminModelDecoder::decodeGetTasksResultResponse(response.responseData); + OnSuccessGetTasks.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Run a task immediately regardless of its schedule. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RunTask(FAdminRunTaskRequest request, + FDelegateOnSuccessRunTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRunTask = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRunTask); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RunTask"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Identifier != nullptr) OutRestJsonObj->SetObjectField(TEXT("Identifier"), request.Identifier); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRunTask(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRunTask.IsBound()) + { + FAdminRunTaskResult result = UPlayFabAdminModelDecoder::decodeRunTaskResultResponse(response.responseData); + OnSuccessRunTask.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Update an existing task. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateTask(FAdminUpdateTaskRequest request, + FDelegateOnSuccessUpdateTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateTask = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateTask); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateTask"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Description.IsEmpty() || request.Description == "") { + OutRestJsonObj->SetFieldNull(TEXT("Description")); + } else { + OutRestJsonObj->SetStringField(TEXT("Description"), request.Description); + } + if (request.Identifier != nullptr) OutRestJsonObj->SetObjectField(TEXT("Identifier"), request.Identifier); + OutRestJsonObj->SetBoolField(TEXT("IsActive"), request.IsActive); + if (request.Name.IsEmpty() || request.Name == "") { + OutRestJsonObj->SetFieldNull(TEXT("Name")); + } else { + OutRestJsonObj->SetStringField(TEXT("Name"), request.Name); + } + if (request.Parameter != nullptr) OutRestJsonObj->SetObjectField(TEXT("Parameter"), request.Parameter); + if (request.Schedule.IsEmpty() || request.Schedule == "") { + OutRestJsonObj->SetFieldNull(TEXT("Schedule")); + } else { + OutRestJsonObj->SetStringField(TEXT("Schedule"), request.Schedule); + } + FString temp_Type; + if (GetEnumValueToString(TEXT("EScheduledTaskType"), request.Type, temp_Type)) + OutRestJsonObj->SetStringField(TEXT("Type"), temp_Type); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateTask(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateTask.IsBound()) + { + FAdminEmptyResponse result = UPlayFabAdminModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessUpdateTask.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// +/** Gets the contents and information of a specific Cloud Script revision. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetCloudScriptRevision(FAdminGetCloudScriptRevisionRequest request, + FDelegateOnSuccessGetCloudScriptRevision onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCloudScriptRevision = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetCloudScriptRevision); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetCloudScriptRevision"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Revision"), request.Revision); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetCloudScriptRevision(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCloudScriptRevision.IsBound()) + { + FAdminGetCloudScriptRevisionResult result = UPlayFabAdminModelDecoder::decodeGetCloudScriptRevisionResultResponse(response.responseData); + OnSuccessGetCloudScriptRevision.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all the current cloud script versions. For each version, information about the current published and latest revisions is also listed. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetCloudScriptVersions(FAdminGetCloudScriptVersionsRequest request, + FDelegateOnSuccessGetCloudScriptVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCloudScriptVersions = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetCloudScriptVersions); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetCloudScriptVersions"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetCloudScriptVersions(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCloudScriptVersions.IsBound()) + { + FAdminGetCloudScriptVersionsResult result = UPlayFabAdminModelDecoder::decodeGetCloudScriptVersionsResultResponse(response.responseData); + OnSuccessGetCloudScriptVersions.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the currently published revision of a title Cloud Script */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetPublishedRevision(FAdminSetPublishedRevisionRequest request, + FDelegateOnSuccessSetPublishedRevision onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetPublishedRevision = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetPublishedRevision); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetPublishedRevision"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Revision"), request.Revision); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetPublishedRevision(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetPublishedRevision.IsBound()) + { + FAdminSetPublishedRevisionResult result = UPlayFabAdminModelDecoder::decodeSetPublishedRevisionResultResponse(response.responseData); + OnSuccessSetPublishedRevision.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates a new Cloud Script revision and uploads source code to it. Note that at this time, only one file should be submitted in the revision. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateCloudScript(FAdminUpdateCloudScriptRequest request, + FDelegateOnSuccessUpdateCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCloudScript = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateCloudScript); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateCloudScript"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.DeveloperPlayFabId.IsEmpty() || request.DeveloperPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeveloperPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeveloperPlayFabId"), request.DeveloperPlayFabId); + } + if (request.Files.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Files")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Files"), request.Files); + } + OutRestJsonObj->SetBoolField(TEXT("Publish"), request.Publish); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCloudScript.IsBound()) + { + FAdminUpdateCloudScriptResult result = UPlayFabAdminModelDecoder::decodeUpdateCloudScriptResultResponse(response.responseData); + OnSuccessUpdateCloudScript.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// +/** Updates the key-value store of custom publisher settings */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetPublisherData(FAdminSetPublisherDataRequest request, + FDelegateOnSuccessSetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Value.IsEmpty() || request.Value == "") { + OutRestJsonObj->SetFieldNull(TEXT("Value")); + } else { + OutRestJsonObj->SetStringField(TEXT("Value"), request.Value); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetPublisherData.IsBound()) + { + FAdminSetPublisherDataResult result = UPlayFabAdminModelDecoder::decodeSetPublisherDataResultResponse(response.responseData); + OnSuccessSetPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// +/** Adds a new news item to the title's news feed */ +UPlayFabAdminAPI* UPlayFabAdminAPI::AddNews(FAdminAddNewsRequest request, + FDelegateOnSuccessAddNews onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddNews = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperAddNews); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/AddNews"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Body.IsEmpty() || request.Body == "") { + OutRestJsonObj->SetFieldNull(TEXT("Body")); + } else { + OutRestJsonObj->SetStringField(TEXT("Body"), request.Body); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + if (request.Title.IsEmpty() || request.Title == "") { + OutRestJsonObj->SetFieldNull(TEXT("Title")); + } else { + OutRestJsonObj->SetStringField(TEXT("Title"), request.Title); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperAddNews(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddNews.IsBound()) + { + FAdminAddNewsResult result = UPlayFabAdminModelDecoder::decodeAddNewsResultResponse(response.responseData); + OnSuccessAddNews.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds one or more virtual currencies to the set defined for the title. Virtual Currencies have a maximum value of 2,147,483,647 when granted to a player. Any value over that will be discarded. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::AddVirtualCurrencyTypes(FAdminAddVirtualCurrencyTypesRequest request, + FDelegateOnSuccessAddVirtualCurrencyTypes onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddVirtualCurrencyTypes = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperAddVirtualCurrencyTypes); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/AddVirtualCurrencyTypes"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.VirtualCurrencies.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrencies")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("VirtualCurrencies"), request.VirtualCurrencies); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperAddVirtualCurrencyTypes(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddVirtualCurrencyTypes.IsBound()) + { + FAdminBlankResult result = UPlayFabAdminModelDecoder::decodeBlankResultResponse(response.responseData); + OnSuccessAddVirtualCurrencyTypes.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Deletes an existing virtual item store */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeleteStore(FAdminDeleteStoreRequest request, + FDelegateOnSuccessDeleteStore onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteStore = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeleteStore); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeleteStore"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeleteStore(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteStore.IsBound()) + { + FAdminDeleteStoreResult result = UPlayFabAdminModelDecoder::decodeDeleteStoreResultResponse(response.responseData); + OnSuccessDeleteStore.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetCatalogItems(FAdminGetCatalogItemsRequest request, + FDelegateOnSuccessGetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCatalogItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetCatalogItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetCatalogItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCatalogItems.IsBound()) + { + FAdminGetCatalogItemsResult result = UPlayFabAdminModelDecoder::decodeGetCatalogItemsResultResponse(response.responseData); + OnSuccessGetCatalogItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom publisher settings */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPublisherData(FAdminGetPublisherDataRequest request, + FDelegateOnSuccessGetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPublisherData.IsBound()) + { + FAdminGetPublisherDataResult result = UPlayFabAdminModelDecoder::decodeGetPublisherDataResultResponse(response.responseData); + OnSuccessGetPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the random drop table configuration for the title */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetRandomResultTables(FAdminGetRandomResultTablesRequest request, + FDelegateOnSuccessGetRandomResultTables onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetRandomResultTables = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetRandomResultTables); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetRandomResultTables"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetRandomResultTables(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetRandomResultTables.IsBound()) + { + FAdminGetRandomResultTablesResult result = UPlayFabAdminModelDecoder::decodeGetRandomResultTablesResultResponse(response.responseData); + OnSuccessGetRandomResultTables.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the set of items defined for the specified store, including all prices defined */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetStoreItems(FAdminGetStoreItemsRequest request, + FDelegateOnSuccessGetStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetStoreItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetStoreItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetStoreItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetStoreItems.IsBound()) + { + FAdminGetStoreItemsResult result = UPlayFabAdminModelDecoder::decodeGetStoreItemsResultResponse(response.responseData); + OnSuccessGetStoreItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom title settings which can be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetTitleData(FAdminGetTitleDataRequest request, + FDelegateOnSuccessGetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetTitleData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetTitleData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleData.IsBound()) + { + FAdminGetTitleDataResult result = UPlayFabAdminModelDecoder::decodeGetTitleDataResultResponse(response.responseData); + OnSuccessGetTitleData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom title settings which cannot be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetTitleInternalData(FAdminGetTitleDataRequest request, + FDelegateOnSuccessGetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetTitleInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetTitleInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleInternalData.IsBound()) + { + FAdminGetTitleDataResult result = UPlayFabAdminModelDecoder::decodeGetTitleDataResultResponse(response.responseData); + OnSuccessGetTitleInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retuns the list of all defined virtual currencies for the title */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ListVirtualCurrencyTypes(FAdminListVirtualCurrencyTypesRequest request, + FDelegateOnSuccessListVirtualCurrencyTypes onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListVirtualCurrencyTypes = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperListVirtualCurrencyTypes); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ListVirtualCurrencyTypes"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperListVirtualCurrencyTypes(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListVirtualCurrencyTypes.IsBound()) + { + FAdminListVirtualCurrencyTypesResult result = UPlayFabAdminModelDecoder::decodeListVirtualCurrencyTypesResultResponse(response.responseData); + OnSuccessListVirtualCurrencyTypes.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes one or more virtual currencies from the set defined for the title. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RemoveVirtualCurrencyTypes(FAdminRemoveVirtualCurrencyTypesRequest request, + FDelegateOnSuccessRemoveVirtualCurrencyTypes onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveVirtualCurrencyTypes = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRemoveVirtualCurrencyTypes); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RemoveVirtualCurrencyTypes"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.VirtualCurrencies.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrencies")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("VirtualCurrencies"), request.VirtualCurrencies); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRemoveVirtualCurrencyTypes(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveVirtualCurrencyTypes.IsBound()) + { + FAdminBlankResult result = UPlayFabAdminModelDecoder::decodeBlankResultResponse(response.responseData); + OnSuccessRemoveVirtualCurrencyTypes.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates the catalog configuration of all virtual goods for the specified catalog version */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetCatalogItems(FAdminUpdateCatalogItemsRequest request, + FDelegateOnSuccessSetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetCatalogItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetCatalogItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetCatalogItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Catalog.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Catalog")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Catalog"), request.Catalog); + } + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + OutRestJsonObj->SetBoolField(TEXT("SetAsDefaultCatalog"), request.SetAsDefaultCatalog); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetCatalogItems.IsBound()) + { + FAdminUpdateCatalogItemsResult result = UPlayFabAdminModelDecoder::decodeUpdateCatalogItemsResultResponse(response.responseData); + OnSuccessSetCatalogItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets all the items in one virtual store */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetStoreItems(FAdminUpdateStoreItemsRequest request, + FDelegateOnSuccessSetStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetStoreItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetStoreItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetStoreItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.MarketingData != nullptr) OutRestJsonObj->SetObjectField(TEXT("MarketingData"), request.MarketingData); + if (request.Store.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Store")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Store"), request.Store); + } + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetStoreItems.IsBound()) + { + FAdminUpdateStoreItemsResult result = UPlayFabAdminModelDecoder::decodeUpdateStoreItemsResultResponse(response.responseData); + OnSuccessSetStoreItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates and updates the key-value store of custom title settings which can be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetTitleData(FAdminSetTitleDataRequest request, + FDelegateOnSuccessSetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetTitleData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetTitleData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetTitleData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Value.IsEmpty() || request.Value == "") { + OutRestJsonObj->SetFieldNull(TEXT("Value")); + } else { + OutRestJsonObj->SetStringField(TEXT("Value"), request.Value); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetTitleData.IsBound()) + { + FAdminSetTitleDataResult result = UPlayFabAdminModelDecoder::decodeSetTitleDataResultResponse(response.responseData); + OnSuccessSetTitleData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the key-value store of custom title settings which cannot be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetTitleInternalData(FAdminSetTitleDataRequest request, + FDelegateOnSuccessSetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetTitleInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetTitleInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetTitleInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Value.IsEmpty() || request.Value == "") { + OutRestJsonObj->SetFieldNull(TEXT("Value")); + } else { + OutRestJsonObj->SetStringField(TEXT("Value"), request.Value); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetTitleInternalData.IsBound()) + { + FAdminSetTitleDataResult result = UPlayFabAdminModelDecoder::decodeSetTitleDataResultResponse(response.responseData); + OnSuccessSetTitleInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the Amazon Resource Name (ARN) for iOS and Android push notifications. Documentation on the exact restrictions can be found at: http://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformApplication.html. Currently, Amazon device Messaging is not supported. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetupPushNotification(FAdminSetupPushNotificationRequest request, + FDelegateOnSuccessSetupPushNotification onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetupPushNotification = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetupPushNotification); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetupPushNotification"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Credential.IsEmpty() || request.Credential == "") { + OutRestJsonObj->SetFieldNull(TEXT("Credential")); + } else { + OutRestJsonObj->SetStringField(TEXT("Credential"), request.Credential); + } + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Name.IsEmpty() || request.Name == "") { + OutRestJsonObj->SetFieldNull(TEXT("Name")); + } else { + OutRestJsonObj->SetStringField(TEXT("Name"), request.Name); + } + OutRestJsonObj->SetBoolField(TEXT("OverwriteOldARN"), request.OverwriteOldARN); + FString temp_Platform; + if (GetEnumValueToString(TEXT("EPushSetupPlatform"), request.Platform, temp_Platform)) + OutRestJsonObj->SetStringField(TEXT("Platform"), temp_Platform); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetupPushNotification(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetupPushNotification.IsBound()) + { + FAdminSetupPushNotificationResult result = UPlayFabAdminModelDecoder::decodeSetupPushNotificationResultResponse(response.responseData); + OnSuccessSetupPushNotification.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the catalog configuration for virtual goods in the specified catalog version */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateCatalogItems(FAdminUpdateCatalogItemsRequest request, + FDelegateOnSuccessUpdateCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCatalogItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateCatalogItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateCatalogItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Catalog.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Catalog")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Catalog"), request.Catalog); + } + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + OutRestJsonObj->SetBoolField(TEXT("SetAsDefaultCatalog"), request.SetAsDefaultCatalog); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCatalogItems.IsBound()) + { + FAdminUpdateCatalogItemsResult result = UPlayFabAdminModelDecoder::decodeUpdateCatalogItemsResultResponse(response.responseData); + OnSuccessUpdateCatalogItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the random drop table configuration for the title */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateRandomResultTables(FAdminUpdateRandomResultTablesRequest request, + FDelegateOnSuccessUpdateRandomResultTables onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateRandomResultTables = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateRandomResultTables); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateRandomResultTables"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.Tables.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Tables")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Tables"), request.Tables); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateRandomResultTables(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateRandomResultTables.IsBound()) + { + FAdminUpdateRandomResultTablesResult result = UPlayFabAdminModelDecoder::decodeUpdateRandomResultTablesResultResponse(response.responseData); + OnSuccessUpdateRandomResultTables.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates an existing virtual item store with new or modified items */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateStoreItems(FAdminUpdateStoreItemsRequest request, + FDelegateOnSuccessUpdateStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateStoreItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateStoreItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateStoreItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.MarketingData != nullptr) OutRestJsonObj->SetObjectField(TEXT("MarketingData"), request.MarketingData); + if (request.Store.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Store")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Store"), request.Store); + } + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateStoreItems.IsBound()) + { + FAdminUpdateStoreItemsResult result = UPlayFabAdminModelDecoder::decodeUpdateStoreItemsResultResponse(response.responseData); + OnSuccessUpdateStoreItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabAdminAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabAdminAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabAdminAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAdminModelDecoder.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAdminModelDecoder.cpp new file mode 100644 index 000000000..78afd9e4b --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAdminModelDecoder.cpp @@ -0,0 +1,1048 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Admin +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabAdminModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Admin API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +FAdminBanUsersResult UPlayFabAdminModelDecoder::decodeBanUsersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminBanUsersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FAdminDeleteMasterPlayerAccountResult UPlayFabAdminModelDecoder::decodeDeleteMasterPlayerAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminDeleteMasterPlayerAccountResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.JobReceiptId = !(dataObj->HasField("JobReceiptId")) ? TEXT("") : dataObj->GetStringField("JobReceiptId"); + tempStruct.TitleIds = !(dataObj->HasField("TitleIds")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("TitleIds"), TEXT(",")); + + return tempStruct; +} + +FAdminDeletePlayerResult UPlayFabAdminModelDecoder::decodeDeletePlayerResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminDeletePlayerResult tempStruct; + + + return tempStruct; +} + +FAdminDeleteTitleResult UPlayFabAdminModelDecoder::decodeDeleteTitleResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminDeleteTitleResult tempStruct; + + + return tempStruct; +} + +FAdminExportMasterPlayerDataResult UPlayFabAdminModelDecoder::decodeExportMasterPlayerDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminExportMasterPlayerDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.JobReceiptId = !(dataObj->HasField("JobReceiptId")) ? TEXT("") : dataObj->GetStringField("JobReceiptId"); + + return tempStruct; +} + +FAdminGetPlayedTitleListResult UPlayFabAdminModelDecoder::decodeGetPlayedTitleListResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayedTitleListResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.TitleIds = !(dataObj->HasField("TitleIds")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("TitleIds"), TEXT(",")); + + return tempStruct; +} + +FAdminGetPlayerIdFromAuthTokenResult UPlayFabAdminModelDecoder::decodeGetPlayerIdFromAuthTokenResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerIdFromAuthTokenResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FAdminGetPlayerProfileResult UPlayFabAdminModelDecoder::decodeGetPlayerProfileResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerProfileResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayerProfile = !(dataObj->HasField("PlayerProfile")) ? nullptr : dataObj->GetObjectField("PlayerProfile"); + + return tempStruct; +} + +FAdminLookupUserAccountInfoResult UPlayFabAdminModelDecoder::decodeLookupUserAccountInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminLookupUserAccountInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.UserInfo = !(dataObj->HasField("UserInfo")) ? nullptr : dataObj->GetObjectField("UserInfo"); + + return tempStruct; +} + +FAdminGetUserBansResult UPlayFabAdminModelDecoder::decodeGetUserBansResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetUserBansResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FAdminResetPasswordResult UPlayFabAdminModelDecoder::decodeResetPasswordResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminResetPasswordResult tempStruct; + + + return tempStruct; +} + +FAdminRevokeAllBansForUserResult UPlayFabAdminModelDecoder::decodeRevokeAllBansForUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRevokeAllBansForUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FAdminRevokeBansResult UPlayFabAdminModelDecoder::decodeRevokeBansResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRevokeBansResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FAdminSendAccountRecoveryEmailResult UPlayFabAdminModelDecoder::decodeSendAccountRecoveryEmailResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminSendAccountRecoveryEmailResult tempStruct; + + + return tempStruct; +} + +FAdminUpdateBansResult UPlayFabAdminModelDecoder::decodeUpdateBansResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateBansResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FAdminUpdateUserTitleDisplayNameResult UPlayFabAdminModelDecoder::decodeUpdateUserTitleDisplayNameResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateUserTitleDisplayNameResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DisplayName = !(dataObj->HasField("DisplayName")) ? TEXT("") : dataObj->GetStringField("DisplayName"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +FAdminCreatePlayerSharedSecretResult UPlayFabAdminModelDecoder::decodeCreatePlayerSharedSecretResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminCreatePlayerSharedSecretResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.SecretKey = !(dataObj->HasField("SecretKey")) ? TEXT("") : dataObj->GetStringField("SecretKey"); + + return tempStruct; +} + +FAdminDeletePlayerSharedSecretResult UPlayFabAdminModelDecoder::decodeDeletePlayerSharedSecretResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminDeletePlayerSharedSecretResult tempStruct; + + + return tempStruct; +} + +FAdminGetPlayerSharedSecretsResult UPlayFabAdminModelDecoder::decodeGetPlayerSharedSecretsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerSharedSecretsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.SharedSecrets = !(dataObj->HasField("SharedSecrets")) ? TArray() : dataObj->GetObjectArrayField("SharedSecrets"); + + return tempStruct; +} + +FAdminGetPolicyResponse UPlayFabAdminModelDecoder::decodeGetPolicyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPolicyResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PolicyName = !(dataObj->HasField("PolicyName")) ? TEXT("") : dataObj->GetStringField("PolicyName"); + tempStruct.Statements = !(dataObj->HasField("Statements")) ? TArray() : dataObj->GetObjectArrayField("Statements"); + + return tempStruct; +} + +FAdminSetPlayerSecretResult UPlayFabAdminModelDecoder::decodeSetPlayerSecretResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminSetPlayerSecretResult tempStruct; + + + return tempStruct; +} + +FAdminUpdatePlayerSharedSecretResult UPlayFabAdminModelDecoder::decodeUpdatePlayerSharedSecretResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdatePlayerSharedSecretResult tempStruct; + + + return tempStruct; +} + +FAdminUpdatePolicyResponse UPlayFabAdminModelDecoder::decodeUpdatePolicyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdatePolicyResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PolicyName = !(dataObj->HasField("PolicyName")) ? TEXT("") : dataObj->GetStringField("PolicyName"); + tempStruct.Statements = !(dataObj->HasField("Statements")) ? TArray() : dataObj->GetObjectArrayField("Statements"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// + +FAdminResetCharacterStatisticsResult UPlayFabAdminModelDecoder::decodeResetCharacterStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminResetCharacterStatisticsResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// + +FAdminBlankResult UPlayFabAdminModelDecoder::decodeBlankResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminBlankResult tempStruct; + + + return tempStruct; +} + +FAdminGetContentListResult UPlayFabAdminModelDecoder::decodeGetContentListResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetContentListResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Contents = !(dataObj->HasField("Contents")) ? TArray() : dataObj->GetObjectArrayField("Contents"); + tempStruct.ItemCount = !(dataObj->HasField("ItemCount")) ? 0 : int(dataObj->GetNumberField("ItemCount")); + tempStruct.TotalSize = !(dataObj->HasField("TotalSize")) ? 0 : int(dataObj->GetNumberField("TotalSize")); + + return tempStruct; +} + +FAdminGetContentUploadUrlResult UPlayFabAdminModelDecoder::decodeGetContentUploadUrlResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetContentUploadUrlResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.URL = !(dataObj->HasField("URL")) ? TEXT("") : dataObj->GetStringField("URL"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Custom Server Management +////////////////////////////////////////////////////// + +FAdminAddServerBuildResult UPlayFabAdminModelDecoder::decodeAddServerBuildResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminAddServerBuildResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ActiveRegions = !(dataObj->HasField("ActiveRegions")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("ActiveRegions"), TEXT(",")); + tempStruct.BuildId = !(dataObj->HasField("BuildId")) ? TEXT("") : dataObj->GetStringField("BuildId"); + tempStruct.CommandLineTemplate = !(dataObj->HasField("CommandLineTemplate")) ? TEXT("") : dataObj->GetStringField("CommandLineTemplate"); + tempStruct.Comment = !(dataObj->HasField("Comment")) ? TEXT("") : dataObj->GetStringField("Comment"); + tempStruct.ExecutablePath = !(dataObj->HasField("ExecutablePath")) ? TEXT("") : dataObj->GetStringField("ExecutablePath"); + tempStruct.MaxGamesPerHost = !(dataObj->HasField("MaxGamesPerHost")) ? 0 : int(dataObj->GetNumberField("MaxGamesPerHost")); + tempStruct.MinFreeGameSlots = !(dataObj->HasField("MinFreeGameSlots")) ? 0 : int(dataObj->GetNumberField("MinFreeGameSlots")); + GetEnumValueFromString(TEXT("EGameBuildStatus"), dataObj->GetStringField("Status"), tempStruct.Status); + tempStruct.Timestamp = !(dataObj->HasField("Timestamp")) ? TEXT("") : dataObj->GetStringField("Timestamp"); + tempStruct.TitleId = !(dataObj->HasField("TitleId")) ? TEXT("") : dataObj->GetStringField("TitleId"); + + return tempStruct; +} + +FAdminGetServerBuildInfoResult UPlayFabAdminModelDecoder::decodeGetServerBuildInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetServerBuildInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ActiveRegions = !(dataObj->HasField("ActiveRegions")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("ActiveRegions"), TEXT(",")); + tempStruct.BuildId = !(dataObj->HasField("BuildId")) ? TEXT("") : dataObj->GetStringField("BuildId"); + tempStruct.Comment = !(dataObj->HasField("Comment")) ? TEXT("") : dataObj->GetStringField("Comment"); + tempStruct.ErrorMessage = !(dataObj->HasField("ErrorMessage")) ? TEXT("") : dataObj->GetStringField("ErrorMessage"); + tempStruct.MaxGamesPerHost = !(dataObj->HasField("MaxGamesPerHost")) ? 0 : int(dataObj->GetNumberField("MaxGamesPerHost")); + tempStruct.MinFreeGameSlots = !(dataObj->HasField("MinFreeGameSlots")) ? 0 : int(dataObj->GetNumberField("MinFreeGameSlots")); + GetEnumValueFromString(TEXT("EGameBuildStatus"), dataObj->GetStringField("Status"), tempStruct.Status); + tempStruct.Timestamp = !(dataObj->HasField("Timestamp")) ? TEXT("") : dataObj->GetStringField("Timestamp"); + tempStruct.TitleId = !(dataObj->HasField("TitleId")) ? TEXT("") : dataObj->GetStringField("TitleId"); + + return tempStruct; +} + +FAdminGetServerBuildUploadURLResult UPlayFabAdminModelDecoder::decodeGetServerBuildUploadURLResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetServerBuildUploadURLResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.URL = !(dataObj->HasField("URL")) ? TEXT("") : dataObj->GetStringField("URL"); + + return tempStruct; +} + +FAdminListBuildsResult UPlayFabAdminModelDecoder::decodeListBuildsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminListBuildsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Builds = !(dataObj->HasField("Builds")) ? TArray() : dataObj->GetObjectArrayField("Builds"); + + return tempStruct; +} + +FAdminModifyServerBuildResult UPlayFabAdminModelDecoder::decodeModifyServerBuildResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminModifyServerBuildResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ActiveRegions = !(dataObj->HasField("ActiveRegions")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("ActiveRegions"), TEXT(",")); + tempStruct.BuildId = !(dataObj->HasField("BuildId")) ? TEXT("") : dataObj->GetStringField("BuildId"); + tempStruct.CommandLineTemplate = !(dataObj->HasField("CommandLineTemplate")) ? TEXT("") : dataObj->GetStringField("CommandLineTemplate"); + tempStruct.Comment = !(dataObj->HasField("Comment")) ? TEXT("") : dataObj->GetStringField("Comment"); + tempStruct.ExecutablePath = !(dataObj->HasField("ExecutablePath")) ? TEXT("") : dataObj->GetStringField("ExecutablePath"); + tempStruct.MaxGamesPerHost = !(dataObj->HasField("MaxGamesPerHost")) ? 0 : int(dataObj->GetNumberField("MaxGamesPerHost")); + tempStruct.MinFreeGameSlots = !(dataObj->HasField("MinFreeGameSlots")) ? 0 : int(dataObj->GetNumberField("MinFreeGameSlots")); + GetEnumValueFromString(TEXT("EGameBuildStatus"), dataObj->GetStringField("Status"), tempStruct.Status); + tempStruct.Timestamp = !(dataObj->HasField("Timestamp")) ? TEXT("") : dataObj->GetStringField("Timestamp"); + tempStruct.TitleId = !(dataObj->HasField("TitleId")) ? TEXT("") : dataObj->GetStringField("TitleId"); + + return tempStruct; +} + +FAdminRemoveServerBuildResult UPlayFabAdminModelDecoder::decodeRemoveServerBuildResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRemoveServerBuildResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +FAdminGetMatchmakerGameInfoResult UPlayFabAdminModelDecoder::decodeGetMatchmakerGameInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetMatchmakerGameInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BuildVersion = !(dataObj->HasField("BuildVersion")) ? TEXT("") : dataObj->GetStringField("BuildVersion"); + tempStruct.EndTime = !(dataObj->HasField("EndTime")) ? TEXT("") : dataObj->GetStringField("EndTime"); + tempStruct.LobbyId = !(dataObj->HasField("LobbyId")) ? TEXT("") : dataObj->GetStringField("LobbyId"); + tempStruct.Mode = !(dataObj->HasField("Mode")) ? TEXT("") : dataObj->GetStringField("Mode"); + tempStruct.Players = !(dataObj->HasField("Players")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("Players"), TEXT(",")); + GetEnumValueFromString(TEXT("ERegion"), dataObj->GetStringField("Region"), tempStruct.Region); + tempStruct.ServerAddress = !(dataObj->HasField("ServerAddress")) ? TEXT("") : dataObj->GetStringField("ServerAddress"); + tempStruct.ServerIPV4Address = !(dataObj->HasField("ServerIPV4Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV4Address"); + tempStruct.ServerIPV6Address = !(dataObj->HasField("ServerIPV6Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV6Address"); + tempStruct.ServerPort = !(dataObj->HasField("ServerPort")) ? 0 : int(dataObj->GetNumberField("ServerPort")); + tempStruct.ServerPublicDNSName = !(dataObj->HasField("ServerPublicDNSName")) ? TEXT("") : dataObj->GetStringField("ServerPublicDNSName"); + tempStruct.StartTime = !(dataObj->HasField("StartTime")) ? TEXT("") : dataObj->GetStringField("StartTime"); + tempStruct.TitleId = !(dataObj->HasField("TitleId")) ? TEXT("") : dataObj->GetStringField("TitleId"); + + return tempStruct; +} + +FAdminGetMatchmakerGameModesResult UPlayFabAdminModelDecoder::decodeGetMatchmakerGameModesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetMatchmakerGameModesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GameModes = !(dataObj->HasField("GameModes")) ? TArray() : dataObj->GetObjectArrayField("GameModes"); + + return tempStruct; +} + +FAdminModifyMatchmakerGameModesResult UPlayFabAdminModelDecoder::decodeModifyMatchmakerGameModesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminModifyMatchmakerGameModesResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// + +FAdminCreatePlayerStatisticDefinitionResult UPlayFabAdminModelDecoder::decodeCreatePlayerStatisticDefinitionResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminCreatePlayerStatisticDefinitionResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Statistic = !(dataObj->HasField("Statistic")) ? nullptr : dataObj->GetObjectField("Statistic"); + + return tempStruct; +} + +FAdminGetDataReportResult UPlayFabAdminModelDecoder::decodeGetDataReportResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetDataReportResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DownloadUrl = !(dataObj->HasField("DownloadUrl")) ? TEXT("") : dataObj->GetStringField("DownloadUrl"); + + return tempStruct; +} + +FAdminGetPlayerStatisticDefinitionsResult UPlayFabAdminModelDecoder::decodeGetPlayerStatisticDefinitionsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerStatisticDefinitionsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Statistics = !(dataObj->HasField("Statistics")) ? TArray() : dataObj->GetObjectArrayField("Statistics"); + + return tempStruct; +} + +FAdminGetPlayerStatisticVersionsResult UPlayFabAdminModelDecoder::decodeGetPlayerStatisticVersionsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerStatisticVersionsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.StatisticVersions = !(dataObj->HasField("StatisticVersions")) ? TArray() : dataObj->GetObjectArrayField("StatisticVersions"); + + return tempStruct; +} + +FAdminGetUserDataResult UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetUserDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FAdminIncrementPlayerStatisticVersionResult UPlayFabAdminModelDecoder::decodeIncrementPlayerStatisticVersionResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminIncrementPlayerStatisticVersionResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.StatisticVersion = !(dataObj->HasField("StatisticVersion")) ? nullptr : dataObj->GetObjectField("StatisticVersion"); + + return tempStruct; +} + +FAdminRefundPurchaseResponse UPlayFabAdminModelDecoder::decodeRefundPurchaseResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRefundPurchaseResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PurchaseStatus = !(dataObj->HasField("PurchaseStatus")) ? TEXT("") : dataObj->GetStringField("PurchaseStatus"); + + return tempStruct; +} + +FAdminResetUserStatisticsResult UPlayFabAdminModelDecoder::decodeResetUserStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminResetUserStatisticsResult tempStruct; + + + return tempStruct; +} + +FAdminResolvePurchaseDisputeResponse UPlayFabAdminModelDecoder::decodeResolvePurchaseDisputeResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminResolvePurchaseDisputeResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PurchaseStatus = !(dataObj->HasField("PurchaseStatus")) ? TEXT("") : dataObj->GetStringField("PurchaseStatus"); + + return tempStruct; +} + +FAdminUpdatePlayerStatisticDefinitionResult UPlayFabAdminModelDecoder::decodeUpdatePlayerStatisticDefinitionResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdatePlayerStatisticDefinitionResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Statistic = !(dataObj->HasField("Statistic")) ? nullptr : dataObj->GetObjectField("Statistic"); + + return tempStruct; +} + +FAdminUpdateUserDataResult UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateUserDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// + +FAdminModifyUserVirtualCurrencyResult UPlayFabAdminModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminModifyUserVirtualCurrencyResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Balance = !(dataObj->HasField("Balance")) ? 0 : int(dataObj->GetNumberField("Balance")); + tempStruct.BalanceChange = !(dataObj->HasField("BalanceChange")) ? 0 : int(dataObj->GetNumberField("BalanceChange")); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? TEXT("") : dataObj->GetStringField("VirtualCurrency"); + + return tempStruct; +} + +FAdminCheckLimitedEditionItemAvailabilityResult UPlayFabAdminModelDecoder::decodeCheckLimitedEditionItemAvailabilityResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminCheckLimitedEditionItemAvailabilityResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Amount = !(dataObj->HasField("Amount")) ? 0 : int(dataObj->GetNumberField("Amount")); + + return tempStruct; +} + +FAdminGetUserInventoryResult UPlayFabAdminModelDecoder::decodeGetUserInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetUserInventoryResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Inventory = !(dataObj->HasField("Inventory")) ? TArray() : dataObj->GetObjectArrayField("Inventory"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + tempStruct.VirtualCurrencyRechargeTimes = !(dataObj->HasField("VirtualCurrencyRechargeTimes")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyRechargeTimes"); + + return tempStruct; +} + +FAdminGrantItemsToUsersResult UPlayFabAdminModelDecoder::decodeGrantItemsToUsersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGrantItemsToUsersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemGrantResults = !(dataObj->HasField("ItemGrantResults")) ? TArray() : dataObj->GetObjectArrayField("ItemGrantResults"); + + return tempStruct; +} + +FAdminIncrementLimitedEditionItemAvailabilityResult UPlayFabAdminModelDecoder::decodeIncrementLimitedEditionItemAvailabilityResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminIncrementLimitedEditionItemAvailabilityResult tempStruct; + + + return tempStruct; +} + +FAdminRevokeInventoryResult UPlayFabAdminModelDecoder::decodeRevokeInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRevokeInventoryResult tempStruct; + + + return tempStruct; +} + +FAdminRevokeInventoryItemsResult UPlayFabAdminModelDecoder::decodeRevokeInventoryItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRevokeInventoryItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Errors = !(dataObj->HasField("Errors")) ? TArray() : dataObj->GetObjectArrayField("Errors"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// + +FAdminAddPlayerTagResult UPlayFabAdminModelDecoder::decodeAddPlayerTagResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminAddPlayerTagResult tempStruct; + + + return tempStruct; +} + +FAdminGetAllSegmentsResult UPlayFabAdminModelDecoder::decodeGetAllSegmentsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetAllSegmentsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Segments = !(dataObj->HasField("Segments")) ? TArray() : dataObj->GetObjectArrayField("Segments"); + + return tempStruct; +} + +FAdminGetPlayerSegmentsResult UPlayFabAdminModelDecoder::decodeGetPlayerSegmentsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerSegmentsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Segments = !(dataObj->HasField("Segments")) ? TArray() : dataObj->GetObjectArrayField("Segments"); + + return tempStruct; +} + +FAdminGetPlayersInSegmentResult UPlayFabAdminModelDecoder::decodeGetPlayersInSegmentResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayersInSegmentResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ContinuationToken = !(dataObj->HasField("ContinuationToken")) ? TEXT("") : dataObj->GetStringField("ContinuationToken"); + tempStruct.PlayerProfiles = !(dataObj->HasField("PlayerProfiles")) ? TArray() : dataObj->GetObjectArrayField("PlayerProfiles"); + tempStruct.ProfilesInSegment = !(dataObj->HasField("ProfilesInSegment")) ? 0 : int(dataObj->GetNumberField("ProfilesInSegment")); + + return tempStruct; +} + +FAdminGetPlayerTagsResult UPlayFabAdminModelDecoder::decodeGetPlayerTagsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerTagsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.Tags = !(dataObj->HasField("Tags")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("Tags"), TEXT(",")); + + return tempStruct; +} + +FAdminRemovePlayerTagResult UPlayFabAdminModelDecoder::decodeRemovePlayerTagResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRemovePlayerTagResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// ScheduledTask +////////////////////////////////////////////////////// + +FAdminEmptyResponse UPlayFabAdminModelDecoder::decodeEmptyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminEmptyResponse tempStruct; + + + return tempStruct; +} + +FAdminCreateTaskResult UPlayFabAdminModelDecoder::decodeCreateTaskResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminCreateTaskResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.TaskId = !(dataObj->HasField("TaskId")) ? TEXT("") : dataObj->GetStringField("TaskId"); + + return tempStruct; +} + +FAdminGetActionsOnPlayersInSegmentTaskInstanceResult UPlayFabAdminModelDecoder::decodeGetActionsOnPlayersInSegmentTaskInstanceResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetActionsOnPlayersInSegmentTaskInstanceResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Parameter = !(dataObj->HasField("Parameter")) ? nullptr : dataObj->GetObjectField("Parameter"); + tempStruct.Summary = !(dataObj->HasField("Summary")) ? nullptr : dataObj->GetObjectField("Summary"); + + return tempStruct; +} + +FAdminGetCloudScriptTaskInstanceResult UPlayFabAdminModelDecoder::decodeGetCloudScriptTaskInstanceResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetCloudScriptTaskInstanceResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Parameter = !(dataObj->HasField("Parameter")) ? nullptr : dataObj->GetObjectField("Parameter"); + tempStruct.Summary = !(dataObj->HasField("Summary")) ? nullptr : dataObj->GetObjectField("Summary"); + + return tempStruct; +} + +FAdminGetTaskInstancesResult UPlayFabAdminModelDecoder::decodeGetTaskInstancesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetTaskInstancesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Summaries = !(dataObj->HasField("Summaries")) ? TArray() : dataObj->GetObjectArrayField("Summaries"); + + return tempStruct; +} + +FAdminGetTasksResult UPlayFabAdminModelDecoder::decodeGetTasksResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetTasksResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Tasks = !(dataObj->HasField("Tasks")) ? TArray() : dataObj->GetObjectArrayField("Tasks"); + + return tempStruct; +} + +FAdminRunTaskResult UPlayFabAdminModelDecoder::decodeRunTaskResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRunTaskResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.TaskInstanceId = !(dataObj->HasField("TaskInstanceId")) ? TEXT("") : dataObj->GetStringField("TaskInstanceId"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +FAdminGetCloudScriptRevisionResult UPlayFabAdminModelDecoder::decodeGetCloudScriptRevisionResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetCloudScriptRevisionResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CreatedAt = !(dataObj->HasField("CreatedAt")) ? TEXT("") : dataObj->GetStringField("CreatedAt"); + tempStruct.Files = !(dataObj->HasField("Files")) ? TArray() : dataObj->GetObjectArrayField("Files"); + tempStruct.IsPublished = !(dataObj->HasField("IsPublished")) ? false : dataObj->GetBoolField("IsPublished"); + tempStruct.Revision = !(dataObj->HasField("Revision")) ? 0 : int(dataObj->GetNumberField("Revision")); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + +FAdminGetCloudScriptVersionsResult UPlayFabAdminModelDecoder::decodeGetCloudScriptVersionsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetCloudScriptVersionsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Versions = !(dataObj->HasField("Versions")) ? TArray() : dataObj->GetObjectArrayField("Versions"); + + return tempStruct; +} + +FAdminSetPublishedRevisionResult UPlayFabAdminModelDecoder::decodeSetPublishedRevisionResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminSetPublishedRevisionResult tempStruct; + + + return tempStruct; +} + +FAdminUpdateCloudScriptResult UPlayFabAdminModelDecoder::decodeUpdateCloudScriptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateCloudScriptResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Revision = !(dataObj->HasField("Revision")) ? 0 : int(dataObj->GetNumberField("Revision")); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// + +FAdminSetPublisherDataResult UPlayFabAdminModelDecoder::decodeSetPublisherDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminSetPublisherDataResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// + +FAdminAddNewsResult UPlayFabAdminModelDecoder::decodeAddNewsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminAddNewsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.NewsId = !(dataObj->HasField("NewsId")) ? TEXT("") : dataObj->GetStringField("NewsId"); + + return tempStruct; +} + +FAdminDeleteStoreResult UPlayFabAdminModelDecoder::decodeDeleteStoreResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminDeleteStoreResult tempStruct; + + + return tempStruct; +} + +FAdminGetCatalogItemsResult UPlayFabAdminModelDecoder::decodeGetCatalogItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetCatalogItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Catalog = !(dataObj->HasField("Catalog")) ? TArray() : dataObj->GetObjectArrayField("Catalog"); + + return tempStruct; +} + +FAdminGetPublisherDataResult UPlayFabAdminModelDecoder::decodeGetPublisherDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPublisherDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + + return tempStruct; +} + +FAdminGetRandomResultTablesResult UPlayFabAdminModelDecoder::decodeGetRandomResultTablesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetRandomResultTablesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Tables = !(dataObj->HasField("Tables")) ? nullptr : dataObj->GetObjectField("Tables"); + + return tempStruct; +} + +FAdminGetStoreItemsResult UPlayFabAdminModelDecoder::decodeGetStoreItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetStoreItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CatalogVersion = !(dataObj->HasField("CatalogVersion")) ? TEXT("") : dataObj->GetStringField("CatalogVersion"); + tempStruct.MarketingData = !(dataObj->HasField("MarketingData")) ? nullptr : dataObj->GetObjectField("MarketingData"); + GetEnumValueFromString(TEXT("EPfSourceType"), dataObj->GetStringField("Source"), tempStruct.Source); + tempStruct.Store = !(dataObj->HasField("Store")) ? TArray() : dataObj->GetObjectArrayField("Store"); + tempStruct.StoreId = !(dataObj->HasField("StoreId")) ? TEXT("") : dataObj->GetStringField("StoreId"); + + return tempStruct; +} + +FAdminGetTitleDataResult UPlayFabAdminModelDecoder::decodeGetTitleDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetTitleDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + + return tempStruct; +} + +FAdminListVirtualCurrencyTypesResult UPlayFabAdminModelDecoder::decodeListVirtualCurrencyTypesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminListVirtualCurrencyTypesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.VirtualCurrencies = !(dataObj->HasField("VirtualCurrencies")) ? TArray() : dataObj->GetObjectArrayField("VirtualCurrencies"); + + return tempStruct; +} + +FAdminUpdateCatalogItemsResult UPlayFabAdminModelDecoder::decodeUpdateCatalogItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateCatalogItemsResult tempStruct; + + + return tempStruct; +} + +FAdminUpdateStoreItemsResult UPlayFabAdminModelDecoder::decodeUpdateStoreItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateStoreItemsResult tempStruct; + + + return tempStruct; +} + +FAdminSetTitleDataResult UPlayFabAdminModelDecoder::decodeSetTitleDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminSetTitleDataResult tempStruct; + + + return tempStruct; +} + +FAdminSetupPushNotificationResult UPlayFabAdminModelDecoder::decodeSetupPushNotificationResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminSetupPushNotificationResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ARN = !(dataObj->HasField("ARN")) ? TEXT("") : dataObj->GetStringField("ARN"); + + return tempStruct; +} + +FAdminUpdateRandomResultTablesResult UPlayFabAdminModelDecoder::decodeUpdateRandomResultTablesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateRandomResultTablesResult tempStruct; + + + return tempStruct; +} + + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAdminModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAdminModels.cpp new file mode 100644 index 000000000..d54935ec1 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAdminModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Admin +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabAdminModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationAPI.cpp new file mode 100644 index 000000000..4b4ddf7e0 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationAPI.cpp @@ -0,0 +1,239 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Authentication +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabAuthenticationAPI.h" +#include "PlayFabAuthenticationModels.h" +#include "PlayFabAuthenticationModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabAuthenticationAPI::UPlayFabAuthenticationAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabAuthenticationAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabAuthenticationAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabAuthenticationAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Authentication API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// +/** Method to exchange a legacy AuthenticationTicket or title SecretKey for an Entity Token or to refresh a still valid Entity Token. */ +UPlayFabAuthenticationAPI* UPlayFabAuthenticationAPI::GetEntityToken(FAuthenticationGetEntityTokenRequest request, + FDelegateOnSuccessGetEntityToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAuthenticationAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetEntityToken = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAuthenticationAPI::HelperGetEntityToken); + + // Setup the request + manager->PlayFabRequestURL = "/Authentication/GetEntityToken"; + manager->useEntityToken = true; + manager->useSecretKey = true; + manager->useSessionTicket = true; + manager->returnsEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAuthenticationRequestCompleted +void UPlayFabAuthenticationAPI::HelperGetEntityToken(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetEntityToken.IsBound()) + { + FAuthenticationGetEntityTokenResponse result = UPlayFabAuthenticationModelDecoder::decodeGetEntityTokenResponseResponse(response.responseData); + OnSuccessGetEntityToken.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabAuthenticationAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabAuthenticationAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabAuthenticationAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabAuthenticationAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationModelDecoder.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationModelDecoder.cpp new file mode 100644 index 000000000..ba7cbb466 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationModelDecoder.cpp @@ -0,0 +1,37 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Authentication +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabAuthenticationModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Authentication API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +FAuthenticationGetEntityTokenResponse UPlayFabAuthenticationModelDecoder::decodeGetEntityTokenResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAuthenticationGetEntityTokenResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.EntityToken = !(dataObj->HasField("EntityToken")) ? TEXT("") : dataObj->GetStringField("EntityToken"); + tempStruct.TokenExpiration = !(dataObj->HasField("TokenExpiration")) ? TEXT("") : dataObj->GetStringField("TokenExpiration"); + + return tempStruct; +} + + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationModels.cpp new file mode 100644 index 000000000..1558efcc5 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Authentication +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabAuthenticationModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabBaseModel.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabBaseModel.cpp new file mode 100644 index 000000000..fe048f739 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabBaseModel.cpp @@ -0,0 +1,49 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// This files holds the code for the play fab base model. +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabBaseModel.h" +#include "PlayFabPrivate.h" + +const int ERROR_DETAILS_INIT_BUFFER_SIZE = 10000; + +void FPlayFabError::decodeError(UPlayFabJsonObject* responseData) +{ + // Check if we have an error + if (!responseData->HasField("code") || int(responseData->GetNumberField("code")) != 200) // We have an error + { + hasError = true; + ErrorCode = int(responseData->GetNumberField("errorCode")); + ErrorName = responseData->GetStringField("error"); + ErrorMessage = responseData->GetStringField("errorMessage"); + if (responseData->HasField("errorDetails")) + { + ErrorDetails.Empty(ERROR_DETAILS_INIT_BUFFER_SIZE); + auto detailsObj = responseData->GetObjectField("errorDetails"); + int count = 0; + for (auto detailParamPair = detailsObj->GetRootObject()->Values.CreateConstIterator(); detailParamPair; ++detailParamPair) + { + auto errorArray = detailParamPair->Value->AsArray(); + for (auto paramMsg = errorArray.CreateConstIterator(); paramMsg; ++paramMsg) + { + if (count != 0) + ErrorDetails += "\n"; + ErrorDetails += detailParamPair->Key; + ErrorDetails += ": "; + ErrorDetails += paramMsg->Get()->AsString(); + count++; + } + } + } + else + { + ErrorDetails.Empty(0); + } + } + else { hasError = false; } +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabClientAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabClientAPI.cpp new file mode 100644 index 000000000..d4d42c62a --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabClientAPI.cpp @@ -0,0 +1,8443 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Client +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabClientAPI.h" +#include "PlayFabClientModels.h" +#include "PlayFabClientModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabClientAPI::UPlayFabClientAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabClientAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabClientAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabClientAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Client API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// +/** Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as authentication credentials, as the intent is that it is easily accessible by other players. */ +UPlayFabClientAPI* UPlayFabClientAPI::AddGenericID(FClientAddGenericIDRequest request, + FDelegateOnSuccessAddGenericID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddGenericID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAddGenericID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AddGenericID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.GenericId != nullptr) OutRestJsonObj->SetObjectField(TEXT("GenericId"), request.GenericId); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAddGenericID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddGenericID.IsBound()) + { + FClientAddGenericIDResult result = UPlayFabClientModelDecoder::decodeAddGenericIDResultResponse(response.responseData); + OnSuccessAddGenericID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds or updates a contact email to the player's profile. */ +UPlayFabClientAPI* UPlayFabClientAPI::AddOrUpdateContactEmail(FClientAddOrUpdateContactEmailRequest request, + FDelegateOnSuccessAddOrUpdateContactEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddOrUpdateContactEmail = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAddOrUpdateContactEmail); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AddOrUpdateContactEmail"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.EmailAddress.IsEmpty() || request.EmailAddress == "") { + OutRestJsonObj->SetFieldNull(TEXT("EmailAddress")); + } else { + OutRestJsonObj->SetStringField(TEXT("EmailAddress"), request.EmailAddress); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAddOrUpdateContactEmail(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddOrUpdateContactEmail.IsBound()) + { + FClientAddOrUpdateContactEmailResult result = UPlayFabClientModelDecoder::decodeAddOrUpdateContactEmailResultResponse(response.responseData); + OnSuccessAddOrUpdateContactEmail.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds playfab username/password auth to an existing account created via an anonymous auth method, e.g. automatic device ID login. */ +UPlayFabClientAPI* UPlayFabClientAPI::AddUsernamePassword(FClientAddUsernamePasswordRequest request, + FDelegateOnSuccessAddUsernamePassword onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddUsernamePassword = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAddUsernamePassword); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AddUsernamePassword"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.Password.IsEmpty() || request.Password == "") { + OutRestJsonObj->SetFieldNull(TEXT("Password")); + } else { + OutRestJsonObj->SetStringField(TEXT("Password"), request.Password); + } + if (request.Username.IsEmpty() || request.Username == "") { + OutRestJsonObj->SetFieldNull(TEXT("Username")); + } else { + OutRestJsonObj->SetStringField(TEXT("Username"), request.Username); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAddUsernamePassword(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddUsernamePassword.IsBound()) + { + FClientAddUsernamePasswordResult result = UPlayFabClientModelDecoder::decodeAddUsernamePasswordResultResponse(response.responseData); + OnSuccessAddUsernamePassword.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the user's PlayFab account details */ +UPlayFabClientAPI* UPlayFabClientAPI::GetAccountInfo(FClientGetAccountInfoRequest request, + FDelegateOnSuccessGetAccountInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetAccountInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetAccountInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetAccountInfo"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.TitleDisplayName.IsEmpty() || request.TitleDisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("TitleDisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("TitleDisplayName"), request.TitleDisplayName); + } + if (request.Username.IsEmpty() || request.Username == "") { + OutRestJsonObj->SetFieldNull(TEXT("Username")); + } else { + OutRestJsonObj->SetStringField(TEXT("Username"), request.Username); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetAccountInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetAccountInfo.IsBound()) + { + FClientGetAccountInfoResult result = UPlayFabClientModelDecoder::decodeGetAccountInfoResultResponse(response.responseData); + OnSuccessGetAccountInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves all of the user's different kinds of info. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerCombinedInfo(FClientGetPlayerCombinedInfoRequest request, + FDelegateOnSuccessGetPlayerCombinedInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerCombinedInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerCombinedInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerCombinedInfo"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerCombinedInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerCombinedInfo.IsBound()) + { + FClientGetPlayerCombinedInfoResult result = UPlayFabClientModelDecoder::decodeGetPlayerCombinedInfoResultResponse(response.responseData); + OnSuccessGetPlayerCombinedInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the player's profile */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerProfile(FClientGetPlayerProfileRequest request, + FDelegateOnSuccessGetPlayerProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerProfile = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerProfile); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerProfile"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerProfile(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerProfile.IsBound()) + { + FClientGetPlayerProfileResult result = UPlayFabClientModelDecoder::decodeGetPlayerProfileResultResponse(response.responseData); + OnSuccessGetPlayerProfile.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromFacebookIDs(FClientGetPlayFabIDsFromFacebookIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromFacebookIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromFacebookIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromFacebookIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.FacebookIDs.IsEmpty() || request.FacebookIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookIDs")); + } else { + TArray FacebookIDsArray; + FString(request.FacebookIDs).ParseIntoArray(FacebookIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FacebookIDs"), FacebookIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromFacebookIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromFacebookIDs.IsBound()) + { + FClientGetPlayFabIDsFromFacebookIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromFacebookIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromFacebookIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Facebook Instant Game identifiers. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromFacebookInstantGamesIds(FClientGetPlayFabIDsFromFacebookInstantGamesIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromFacebookInstantGamesIds); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromFacebookInstantGamesIds"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.FacebookInstantGamesIds.IsEmpty() || request.FacebookInstantGamesIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookInstantGamesIds")); + } else { + TArray FacebookInstantGamesIdsArray; + FString(request.FacebookInstantGamesIds).ParseIntoArray(FacebookInstantGamesIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FacebookInstantGamesIds"), FacebookInstantGamesIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromFacebookInstantGamesIds(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds.IsBound()) + { + FClientGetPlayFabIDsFromFacebookInstantGamesIdsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromFacebookInstantGamesIdsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Game Center identifiers (referenced in the Game Center Programming Guide as the Player Identifier). */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromGameCenterIDs(FClientGetPlayFabIDsFromGameCenterIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromGameCenterIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromGameCenterIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromGameCenterIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromGameCenterIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.GameCenterIDs.IsEmpty() || request.GameCenterIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameCenterIDs")); + } else { + TArray GameCenterIDsArray; + FString(request.GameCenterIDs).ParseIntoArray(GameCenterIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("GameCenterIDs"), GameCenterIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromGameCenterIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromGameCenterIDs.IsBound()) + { + FClientGetPlayFabIDsFromGameCenterIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromGameCenterIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromGameCenterIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the service name plus the service-specific ID for the player, as specified by the title when the generic identifier was added to the player account. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromGenericIDs(FClientGetPlayFabIDsFromGenericIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromGenericIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromGenericIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromGenericIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromGenericIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.GenericIDs.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("GenericIDs")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("GenericIDs"), request.GenericIDs); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromGenericIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromGenericIDs.IsBound()) + { + FClientGetPlayFabIDsFromGenericIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromGenericIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromGenericIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Google identifiers. The Google identifiers are the IDs for the user accounts, available as "id" in the Google+ People API calls. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromGoogleIDs(FClientGetPlayFabIDsFromGoogleIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromGoogleIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromGoogleIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromGoogleIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromGoogleIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.GoogleIDs.IsEmpty() || request.GoogleIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("GoogleIDs")); + } else { + TArray GoogleIDsArray; + FString(request.GoogleIDs).ParseIntoArray(GoogleIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("GoogleIDs"), GoogleIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromGoogleIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromGoogleIDs.IsBound()) + { + FClientGetPlayFabIDsFromGoogleIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromGoogleIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromGoogleIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Kongregate identifiers. The Kongregate identifiers are the IDs for the user accounts, available as "user_id" from the Kongregate API methods(ex: http://developers.kongregate.com/docs/client/getUserId). */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromKongregateIDs(FClientGetPlayFabIDsFromKongregateIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromKongregateIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromKongregateIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromKongregateIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromKongregateIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.KongregateIDs.IsEmpty() || request.KongregateIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("KongregateIDs")); + } else { + TArray KongregateIDsArray; + FString(request.KongregateIDs).ParseIntoArray(KongregateIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KongregateIDs"), KongregateIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromKongregateIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromKongregateIDs.IsBound()) + { + FClientGetPlayFabIDsFromKongregateIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromKongregateIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromKongregateIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Nintendo Switch identifiers. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromNintendoSwitchDeviceIds(FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromNintendoSwitchDeviceIds); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromNintendoSwitchDeviceIds"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.NintendoSwitchDeviceIds.IsEmpty() || request.NintendoSwitchDeviceIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("NintendoSwitchDeviceIds")); + } else { + TArray NintendoSwitchDeviceIdsArray; + FString(request.NintendoSwitchDeviceIds).ParseIntoArray(NintendoSwitchDeviceIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("NintendoSwitchDeviceIds"), NintendoSwitchDeviceIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromNintendoSwitchDeviceIds(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds.IsBound()) + { + FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromNintendoSwitchDeviceIdsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromSteamIDs(FClientGetPlayFabIDsFromSteamIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromSteamIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromSteamIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromSteamIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromSteamIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.SteamStringIDs.IsEmpty() || request.SteamStringIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("SteamStringIDs")); + } else { + TArray SteamStringIDsArray; + FString(request.SteamStringIDs).ParseIntoArray(SteamStringIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("SteamStringIDs"), SteamStringIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromSteamIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromSteamIDs.IsBound()) + { + FClientGetPlayFabIDsFromSteamIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromSteamIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromSteamIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Twitch identifiers. The Twitch identifiers are the IDs for the user accounts, available as "_id" from the Twitch API methods (ex: https://github.com/justintv/Twitch-API/blob/master/v3_resources/users.md#get-usersuser). */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromTwitchIDs(FClientGetPlayFabIDsFromTwitchIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromTwitchIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromTwitchIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromTwitchIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromTwitchIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.TwitchIds.IsEmpty() || request.TwitchIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("TwitchIds")); + } else { + TArray TwitchIdsArray; + FString(request.TwitchIds).ParseIntoArray(TwitchIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("TwitchIds"), TwitchIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromTwitchIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromTwitchIDs.IsBound()) + { + FClientGetPlayFabIDsFromTwitchIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromTwitchIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromTwitchIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Android device identifier to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkAndroidDeviceID(FClientLinkAndroidDeviceIDRequest request, + FDelegateOnSuccessLinkAndroidDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkAndroidDeviceID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkAndroidDeviceID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkAndroidDeviceID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.AndroidDevice.IsEmpty() || request.AndroidDevice == "") { + OutRestJsonObj->SetFieldNull(TEXT("AndroidDevice")); + } else { + OutRestJsonObj->SetStringField(TEXT("AndroidDevice"), request.AndroidDevice); + } + if (request.AndroidDeviceId.IsEmpty() || request.AndroidDeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("AndroidDeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("AndroidDeviceId"), request.AndroidDeviceId); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.OS.IsEmpty() || request.OS == "") { + OutRestJsonObj->SetFieldNull(TEXT("OS")); + } else { + OutRestJsonObj->SetStringField(TEXT("OS"), request.OS); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkAndroidDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkAndroidDeviceID.IsBound()) + { + FClientLinkAndroidDeviceIDResult result = UPlayFabClientModelDecoder::decodeLinkAndroidDeviceIDResultResponse(response.responseData); + OnSuccessLinkAndroidDeviceID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the custom identifier, generated by the title, to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkCustomID(FClientLinkCustomIDRequest request, + FDelegateOnSuccessLinkCustomID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkCustomID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkCustomID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkCustomID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CustomId.IsEmpty() || request.CustomId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CustomId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CustomId"), request.CustomId); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkCustomID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkCustomID.IsBound()) + { + FClientLinkCustomIDResult result = UPlayFabClientModelDecoder::decodeLinkCustomIDResultResponse(response.responseData); + OnSuccessLinkCustomID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Facebook account associated with the provided Facebook access token to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkFacebookAccount(FClientLinkFacebookAccountRequest request, + FDelegateOnSuccessLinkFacebookAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkFacebookAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkFacebookAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkFacebookAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.AccessToken.IsEmpty() || request.AccessToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("AccessToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("AccessToken"), request.AccessToken); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkFacebookAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkFacebookAccount.IsBound()) + { + FClientLinkFacebookAccountResult result = UPlayFabClientModelDecoder::decodeLinkFacebookAccountResultResponse(response.responseData); + OnSuccessLinkFacebookAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Facebook Instant Games Id to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkFacebookInstantGamesId(FClientLinkFacebookInstantGamesIdRequest request, + FDelegateOnSuccessLinkFacebookInstantGamesId onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkFacebookInstantGamesId = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkFacebookInstantGamesId); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkFacebookInstantGamesId"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.FacebookInstantGamesSignature.IsEmpty() || request.FacebookInstantGamesSignature == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookInstantGamesSignature")); + } else { + OutRestJsonObj->SetStringField(TEXT("FacebookInstantGamesSignature"), request.FacebookInstantGamesSignature); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkFacebookInstantGamesId(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkFacebookInstantGamesId.IsBound()) + { + FClientLinkFacebookInstantGamesIdResult result = UPlayFabClientModelDecoder::decodeLinkFacebookInstantGamesIdResultResponse(response.responseData); + OnSuccessLinkFacebookInstantGamesId.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Game Center account associated with the provided Game Center ID to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkGameCenterAccount(FClientLinkGameCenterAccountRequest request, + FDelegateOnSuccessLinkGameCenterAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkGameCenterAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkGameCenterAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkGameCenterAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.GameCenterId.IsEmpty() || request.GameCenterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameCenterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameCenterId"), request.GameCenterId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkGameCenterAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkGameCenterAccount.IsBound()) + { + FClientLinkGameCenterAccountResult result = UPlayFabClientModelDecoder::decodeLinkGameCenterAccountResultResponse(response.responseData); + OnSuccessLinkGameCenterAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the currently signed-in user account to their Google account, using their Google account credentials */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkGoogleAccount(FClientLinkGoogleAccountRequest request, + FDelegateOnSuccessLinkGoogleAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkGoogleAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkGoogleAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkGoogleAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.ServerAuthCode.IsEmpty() || request.ServerAuthCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerAuthCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerAuthCode"), request.ServerAuthCode); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkGoogleAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkGoogleAccount.IsBound()) + { + FClientLinkGoogleAccountResult result = UPlayFabClientModelDecoder::decodeLinkGoogleAccountResultResponse(response.responseData); + OnSuccessLinkGoogleAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the vendor-specific iOS device identifier to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkIOSDeviceID(FClientLinkIOSDeviceIDRequest request, + FDelegateOnSuccessLinkIOSDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkIOSDeviceID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkIOSDeviceID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkIOSDeviceID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.DeviceId.IsEmpty() || request.DeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceId"), request.DeviceId); + } + if (request.DeviceModel.IsEmpty() || request.DeviceModel == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceModel")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceModel"), request.DeviceModel); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.OS.IsEmpty() || request.OS == "") { + OutRestJsonObj->SetFieldNull(TEXT("OS")); + } else { + OutRestJsonObj->SetStringField(TEXT("OS"), request.OS); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkIOSDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkIOSDeviceID.IsBound()) + { + FClientLinkIOSDeviceIDResult result = UPlayFabClientModelDecoder::decodeLinkIOSDeviceIDResultResponse(response.responseData); + OnSuccessLinkIOSDeviceID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Kongregate identifier to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkKongregate(FClientLinkKongregateAccountRequest request, + FDelegateOnSuccessLinkKongregate onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkKongregate = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkKongregate); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkKongregate"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.AuthTicket.IsEmpty() || request.AuthTicket == "") { + OutRestJsonObj->SetFieldNull(TEXT("AuthTicket")); + } else { + OutRestJsonObj->SetStringField(TEXT("AuthTicket"), request.AuthTicket); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.KongregateId.IsEmpty() || request.KongregateId == "") { + OutRestJsonObj->SetFieldNull(TEXT("KongregateId")); + } else { + OutRestJsonObj->SetStringField(TEXT("KongregateId"), request.KongregateId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkKongregate(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkKongregate.IsBound()) + { + FClientLinkKongregateAccountResult result = UPlayFabClientModelDecoder::decodeLinkKongregateAccountResultResponse(response.responseData); + OnSuccessLinkKongregate.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the NintendoSwitchDeviceId to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkNintendoSwitchDeviceId(FClientLinkNintendoSwitchDeviceIdRequest request, + FDelegateOnSuccessLinkNintendoSwitchDeviceId onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkNintendoSwitchDeviceId = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkNintendoSwitchDeviceId); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkNintendoSwitchDeviceId"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.NintendoSwitchDeviceId.IsEmpty() || request.NintendoSwitchDeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("NintendoSwitchDeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("NintendoSwitchDeviceId"), request.NintendoSwitchDeviceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkNintendoSwitchDeviceId(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkNintendoSwitchDeviceId.IsBound()) + { + FClientLinkNintendoSwitchDeviceIdResult result = UPlayFabClientModelDecoder::decodeLinkNintendoSwitchDeviceIdResultResponse(response.responseData); + OnSuccessLinkNintendoSwitchDeviceId.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Steam account associated with the provided Steam authentication ticket to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkSteamAccount(FClientLinkSteamAccountRequest request, + FDelegateOnSuccessLinkSteamAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkSteamAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkSteamAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkSteamAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.SteamTicket.IsEmpty() || request.SteamTicket == "") { + OutRestJsonObj->SetFieldNull(TEXT("SteamTicket")); + } else { + OutRestJsonObj->SetStringField(TEXT("SteamTicket"), request.SteamTicket); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkSteamAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkSteamAccount.IsBound()) + { + FClientLinkSteamAccountResult result = UPlayFabClientModelDecoder::decodeLinkSteamAccountResultResponse(response.responseData); + OnSuccessLinkSteamAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Twitch account associated with the token to the user's PlayFab account. */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkTwitch(FClientLinkTwitchAccountRequest request, + FDelegateOnSuccessLinkTwitch onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkTwitch = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkTwitch); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkTwitch"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.AccessToken.IsEmpty() || request.AccessToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("AccessToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("AccessToken"), request.AccessToken); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkTwitch(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkTwitch.IsBound()) + { + FClientLinkTwitchAccountResult result = UPlayFabClientModelDecoder::decodeLinkTwitchAccountResultResponse(response.responseData); + OnSuccessLinkTwitch.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Link Windows Hello authentication to the current PlayFab Account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkWindowsHello(FClientLinkWindowsHelloAccountRequest request, + FDelegateOnSuccessLinkWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkWindowsHello = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkWindowsHello); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkWindowsHello"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.DeviceName.IsEmpty() || request.DeviceName == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceName")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceName"), request.DeviceName); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.PublicKey.IsEmpty() || request.PublicKey == "") { + OutRestJsonObj->SetFieldNull(TEXT("PublicKey")); + } else { + OutRestJsonObj->SetStringField(TEXT("PublicKey"), request.PublicKey); + } + if (request.UserName.IsEmpty() || request.UserName == "") { + OutRestJsonObj->SetFieldNull(TEXT("UserName")); + } else { + OutRestJsonObj->SetStringField(TEXT("UserName"), request.UserName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkWindowsHello.IsBound()) + { + FClientLinkWindowsHelloAccountResponse result = UPlayFabClientModelDecoder::decodeLinkWindowsHelloAccountResponseResponse(response.responseData); + OnSuccessLinkWindowsHello.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Xbox Live account associated with the provided access code to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkXboxAccount(FClientLinkXboxAccountRequest request, + FDelegateOnSuccessLinkXboxAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkXboxAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkXboxAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkXboxAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkXboxAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkXboxAccount.IsBound()) + { + FClientLinkXboxAccountResult result = UPlayFabClientModelDecoder::decodeLinkXboxAccountResultResponse(response.responseData); + OnSuccessLinkXboxAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes a contact email from the player's profile. */ +UPlayFabClientAPI* UPlayFabClientAPI::RemoveContactEmail(FClientRemoveContactEmailRequest request, + FDelegateOnSuccessRemoveContactEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveContactEmail = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRemoveContactEmail); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RemoveContactEmail"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRemoveContactEmail(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveContactEmail.IsBound()) + { + FClientRemoveContactEmailResult result = UPlayFabClientModelDecoder::decodeRemoveContactEmailResultResponse(response.responseData); + OnSuccessRemoveContactEmail.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes the specified generic service identifier from the player's PlayFab account. */ +UPlayFabClientAPI* UPlayFabClientAPI::RemoveGenericID(FClientRemoveGenericIDRequest request, + FDelegateOnSuccessRemoveGenericID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveGenericID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRemoveGenericID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RemoveGenericID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.GenericId != nullptr) OutRestJsonObj->SetObjectField(TEXT("GenericId"), request.GenericId); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRemoveGenericID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveGenericID.IsBound()) + { + FClientRemoveGenericIDResult result = UPlayFabClientModelDecoder::decodeRemoveGenericIDResultResponse(response.responseData); + OnSuccessRemoveGenericID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title can take action concerning potentially toxic players. */ +UPlayFabClientAPI* UPlayFabClientAPI::ReportPlayer(FClientReportPlayerClientRequest request, + FDelegateOnSuccessReportPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessReportPlayer = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperReportPlayer); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ReportPlayer"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Comment.IsEmpty() || request.Comment == "") { + OutRestJsonObj->SetFieldNull(TEXT("Comment")); + } else { + OutRestJsonObj->SetStringField(TEXT("Comment"), request.Comment); + } + if (request.ReporteeId.IsEmpty() || request.ReporteeId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReporteeId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReporteeId"), request.ReporteeId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperReportPlayer(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessReportPlayer.IsBound()) + { + FClientReportPlayerClientResult result = UPlayFabClientModelDecoder::decodeReportPlayerClientResultResponse(response.responseData); + OnSuccessReportPlayer.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to change the password.If an account recovery email template ID is provided, an email using the custom email template will be used. */ +UPlayFabClientAPI* UPlayFabClientAPI::SendAccountRecoveryEmail(FClientSendAccountRecoveryEmailRequest request, + FDelegateOnSuccessSendAccountRecoveryEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSendAccountRecoveryEmail = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperSendAccountRecoveryEmail); + + // Setup the request + manager->PlayFabRequestURL = "/Client/SendAccountRecoveryEmail"; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.EmailTemplateId.IsEmpty() || request.EmailTemplateId == "") { + OutRestJsonObj->SetFieldNull(TEXT("EmailTemplateId")); + } else { + OutRestJsonObj->SetStringField(TEXT("EmailTemplateId"), request.EmailTemplateId); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperSendAccountRecoveryEmail(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSendAccountRecoveryEmail.IsBound()) + { + FClientSendAccountRecoveryEmailResult result = UPlayFabClientModelDecoder::decodeSendAccountRecoveryEmailResultResponse(response.responseData); + OnSuccessSendAccountRecoveryEmail.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Android device identifier from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkAndroidDeviceID(FClientUnlinkAndroidDeviceIDRequest request, + FDelegateOnSuccessUnlinkAndroidDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkAndroidDeviceID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkAndroidDeviceID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkAndroidDeviceID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.AndroidDeviceId.IsEmpty() || request.AndroidDeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("AndroidDeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("AndroidDeviceId"), request.AndroidDeviceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkAndroidDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkAndroidDeviceID.IsBound()) + { + FClientUnlinkAndroidDeviceIDResult result = UPlayFabClientModelDecoder::decodeUnlinkAndroidDeviceIDResultResponse(response.responseData); + OnSuccessUnlinkAndroidDeviceID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related custom identifier from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkCustomID(FClientUnlinkCustomIDRequest request, + FDelegateOnSuccessUnlinkCustomID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkCustomID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkCustomID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkCustomID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CustomId.IsEmpty() || request.CustomId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CustomId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CustomId"), request.CustomId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkCustomID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkCustomID.IsBound()) + { + FClientUnlinkCustomIDResult result = UPlayFabClientModelDecoder::decodeUnlinkCustomIDResultResponse(response.responseData); + OnSuccessUnlinkCustomID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Facebook account from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkFacebookAccount(FClientUnlinkFacebookAccountRequest request, + FDelegateOnSuccessUnlinkFacebookAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkFacebookAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkFacebookAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkFacebookAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkFacebookAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkFacebookAccount.IsBound()) + { + FClientUnlinkFacebookAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkFacebookAccountResultResponse(response.responseData); + OnSuccessUnlinkFacebookAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Facebook Instant Game Ids from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkFacebookInstantGamesId(FClientUnlinkFacebookInstantGamesIdRequest request, + FDelegateOnSuccessUnlinkFacebookInstantGamesId onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkFacebookInstantGamesId = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkFacebookInstantGamesId); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkFacebookInstantGamesId"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.FacebookInstantGamesId.IsEmpty() || request.FacebookInstantGamesId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookInstantGamesId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FacebookInstantGamesId"), request.FacebookInstantGamesId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkFacebookInstantGamesId(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkFacebookInstantGamesId.IsBound()) + { + FClientUnlinkFacebookInstantGamesIdResult result = UPlayFabClientModelDecoder::decodeUnlinkFacebookInstantGamesIdResultResponse(response.responseData); + OnSuccessUnlinkFacebookInstantGamesId.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Game Center account from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkGameCenterAccount(FClientUnlinkGameCenterAccountRequest request, + FDelegateOnSuccessUnlinkGameCenterAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkGameCenterAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkGameCenterAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkGameCenterAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkGameCenterAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkGameCenterAccount.IsBound()) + { + FClientUnlinkGameCenterAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkGameCenterAccountResultResponse(response.responseData); + OnSuccessUnlinkGameCenterAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Google account from the user's PlayFab account (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods). */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkGoogleAccount(FClientUnlinkGoogleAccountRequest request, + FDelegateOnSuccessUnlinkGoogleAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkGoogleAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkGoogleAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkGoogleAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkGoogleAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkGoogleAccount.IsBound()) + { + FClientUnlinkGoogleAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkGoogleAccountResultResponse(response.responseData); + OnSuccessUnlinkGoogleAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related iOS device identifier from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkIOSDeviceID(FClientUnlinkIOSDeviceIDRequest request, + FDelegateOnSuccessUnlinkIOSDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkIOSDeviceID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkIOSDeviceID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkIOSDeviceID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.DeviceId.IsEmpty() || request.DeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceId"), request.DeviceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkIOSDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkIOSDeviceID.IsBound()) + { + FClientUnlinkIOSDeviceIDResult result = UPlayFabClientModelDecoder::decodeUnlinkIOSDeviceIDResultResponse(response.responseData); + OnSuccessUnlinkIOSDeviceID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Kongregate identifier from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkKongregate(FClientUnlinkKongregateAccountRequest request, + FDelegateOnSuccessUnlinkKongregate onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkKongregate = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkKongregate); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkKongregate"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkKongregate(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkKongregate.IsBound()) + { + FClientUnlinkKongregateAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkKongregateAccountResultResponse(response.responseData); + OnSuccessUnlinkKongregate.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related NintendoSwitchDeviceId from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkNintendoSwitchDeviceId(FClientUnlinkNintendoSwitchDeviceIdRequest request, + FDelegateOnSuccessUnlinkNintendoSwitchDeviceId onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkNintendoSwitchDeviceId = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkNintendoSwitchDeviceId); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkNintendoSwitchDeviceId"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.NintendoSwitchDeviceId.IsEmpty() || request.NintendoSwitchDeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("NintendoSwitchDeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("NintendoSwitchDeviceId"), request.NintendoSwitchDeviceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkNintendoSwitchDeviceId(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkNintendoSwitchDeviceId.IsBound()) + { + FClientUnlinkNintendoSwitchDeviceIdResult result = UPlayFabClientModelDecoder::decodeUnlinkNintendoSwitchDeviceIdResultResponse(response.responseData); + OnSuccessUnlinkNintendoSwitchDeviceId.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Steam account from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkSteamAccount(FClientUnlinkSteamAccountRequest request, + FDelegateOnSuccessUnlinkSteamAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkSteamAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkSteamAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkSteamAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkSteamAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkSteamAccount.IsBound()) + { + FClientUnlinkSteamAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkSteamAccountResultResponse(response.responseData); + OnSuccessUnlinkSteamAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Twitch account from the user's PlayFab account. */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkTwitch(FClientUnlinkTwitchAccountRequest request, + FDelegateOnSuccessUnlinkTwitch onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkTwitch = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkTwitch); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkTwitch"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkTwitch(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkTwitch.IsBound()) + { + FClientUnlinkTwitchAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkTwitchAccountResultResponse(response.responseData); + OnSuccessUnlinkTwitch.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlink Windows Hello authentication from the current PlayFab Account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkWindowsHello(FClientUnlinkWindowsHelloAccountRequest request, + FDelegateOnSuccessUnlinkWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkWindowsHello = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkWindowsHello); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkWindowsHello"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.PublicKeyHint.IsEmpty() || request.PublicKeyHint == "") { + OutRestJsonObj->SetFieldNull(TEXT("PublicKeyHint")); + } else { + OutRestJsonObj->SetStringField(TEXT("PublicKeyHint"), request.PublicKeyHint); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkWindowsHello.IsBound()) + { + FClientUnlinkWindowsHelloAccountResponse result = UPlayFabClientModelDecoder::decodeUnlinkWindowsHelloAccountResponseResponse(response.responseData); + OnSuccessUnlinkWindowsHello.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Xbox Live account from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkXboxAccount(FClientUnlinkXboxAccountRequest request, + FDelegateOnSuccessUnlinkXboxAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkXboxAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkXboxAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkXboxAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkXboxAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkXboxAccount.IsBound()) + { + FClientUnlinkXboxAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkXboxAccountResultResponse(response.responseData); + OnSuccessUnlinkXboxAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Update the avatar URL of the player */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateAvatarUrl(FClientUpdateAvatarUrlRequest request, + FDelegateOnSuccessUpdateAvatarUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateAvatarUrl = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateAvatarUrl); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateAvatarUrl"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.ImageUrl.IsEmpty() || request.ImageUrl == "") { + OutRestJsonObj->SetFieldNull(TEXT("ImageUrl")); + } else { + OutRestJsonObj->SetStringField(TEXT("ImageUrl"), request.ImageUrl); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateAvatarUrl(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateAvatarUrl.IsBound()) + { + FClientEmptyResponse result = UPlayFabClientModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessUpdateAvatarUrl.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title specific display name for the user */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateUserTitleDisplayName(FClientUpdateUserTitleDisplayNameRequest request, + FDelegateOnSuccessUpdateUserTitleDisplayName onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserTitleDisplayName = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateUserTitleDisplayName); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateUserTitleDisplayName"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.DisplayName.IsEmpty() || request.DisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("DisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("DisplayName"), request.DisplayName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateUserTitleDisplayName(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserTitleDisplayName.IsBound()) + { + FClientUpdateUserTitleDisplayNameResult result = UPlayFabClientModelDecoder::decodeUpdateUserTitleDisplayNameResultResponse(response.responseData); + OnSuccessUpdateUserTitleDisplayName.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Advertising +////////////////////////////////////////////////////// +/** Attributes an install for advertisment. */ +UPlayFabClientAPI* UPlayFabClientAPI::AttributeInstall(FClientAttributeInstallRequest request, + FDelegateOnSuccessAttributeInstall onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAttributeInstall = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAttributeInstall); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AttributeInstall"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Adid.IsEmpty() || request.Adid == "") { + OutRestJsonObj->SetFieldNull(TEXT("Adid")); + } else { + OutRestJsonObj->SetStringField(TEXT("Adid"), request.Adid); + } + if (request.Idfa.IsEmpty() || request.Idfa == "") { + OutRestJsonObj->SetFieldNull(TEXT("Idfa")); + } else { + OutRestJsonObj->SetStringField(TEXT("Idfa"), request.Idfa); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAttributeInstall(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAttributeInstall.IsBound()) + { + FClientAttributeInstallResult result = UPlayFabClientModelDecoder::decodeAttributeInstallResultResponse(response.responseData); + OnSuccessAttributeInstall.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Analytics +////////////////////////////////////////////////////// +/** Write a PlayStream event to describe the provided player device information. This API method is not designed to be called directly by developers. Each PlayFab client SDK will eventually report this information automatically. */ +UPlayFabClientAPI* UPlayFabClientAPI::ReportDeviceInfo(FClientDeviceInfoRequest request, + FDelegateOnSuccessReportDeviceInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessReportDeviceInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperReportDeviceInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ReportDeviceInfo"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Info != nullptr) OutRestJsonObj->SetObjectField(TEXT("Info"), request.Info); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperReportDeviceInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessReportDeviceInfo.IsBound()) + { + FClientEmptyResponse result = UPlayFabClientModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessReportDeviceInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Writes a character-based event into PlayStream. */ +UPlayFabClientAPI* UPlayFabClientAPI::WriteCharacterEvent(FClientWriteClientCharacterEventRequest request, + FDelegateOnSuccessWriteCharacterEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWriteCharacterEvent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperWriteCharacterEvent); + + // Setup the request + manager->PlayFabRequestURL = "/Client/WriteCharacterEvent"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Body != nullptr) OutRestJsonObj->SetObjectField(TEXT("Body"), request.Body); + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.EventName.IsEmpty() || request.EventName == "") { + OutRestJsonObj->SetFieldNull(TEXT("EventName")); + } else { + OutRestJsonObj->SetStringField(TEXT("EventName"), request.EventName); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperWriteCharacterEvent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWriteCharacterEvent.IsBound()) + { + FClientWriteEventResponse result = UPlayFabClientModelDecoder::decodeWriteEventResponseResponse(response.responseData); + OnSuccessWriteCharacterEvent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Writes a player-based event into PlayStream. */ +UPlayFabClientAPI* UPlayFabClientAPI::WritePlayerEvent(FClientWriteClientPlayerEventRequest request, + FDelegateOnSuccessWritePlayerEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWritePlayerEvent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperWritePlayerEvent); + + // Setup the request + manager->PlayFabRequestURL = "/Client/WritePlayerEvent"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Body != nullptr) OutRestJsonObj->SetObjectField(TEXT("Body"), request.Body); + if (request.EventName.IsEmpty() || request.EventName == "") { + OutRestJsonObj->SetFieldNull(TEXT("EventName")); + } else { + OutRestJsonObj->SetStringField(TEXT("EventName"), request.EventName); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperWritePlayerEvent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWritePlayerEvent.IsBound()) + { + FClientWriteEventResponse result = UPlayFabClientModelDecoder::decodeWriteEventResponseResponse(response.responseData); + OnSuccessWritePlayerEvent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Writes a title-based event into PlayStream. */ +UPlayFabClientAPI* UPlayFabClientAPI::WriteTitleEvent(FClientWriteTitleEventRequest request, + FDelegateOnSuccessWriteTitleEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWriteTitleEvent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperWriteTitleEvent); + + // Setup the request + manager->PlayFabRequestURL = "/Client/WriteTitleEvent"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Body != nullptr) OutRestJsonObj->SetObjectField(TEXT("Body"), request.Body); + if (request.EventName.IsEmpty() || request.EventName == "") { + OutRestJsonObj->SetFieldNull(TEXT("EventName")); + } else { + OutRestJsonObj->SetStringField(TEXT("EventName"), request.EventName); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperWriteTitleEvent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWriteTitleEvent.IsBound()) + { + FClientWriteEventResponse result = UPlayFabClientModelDecoder::decodeWriteEventResponseResponse(response.responseData); + OnSuccessWriteTitleEvent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// +/** Gets a Photon custom authentication token that can be used to securely join the player into a Photon room. See https://api.playfab.com/docs/using-photon-with-playfab/ for more details. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPhotonAuthenticationToken(FClientGetPhotonAuthenticationTokenRequest request, + FDelegateOnSuccessGetPhotonAuthenticationToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPhotonAuthenticationToken = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPhotonAuthenticationToken); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPhotonAuthenticationToken"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.PhotonApplicationId.IsEmpty() || request.PhotonApplicationId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PhotonApplicationId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PhotonApplicationId"), request.PhotonApplicationId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPhotonAuthenticationToken(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPhotonAuthenticationToken.IsBound()) + { + FClientGetPhotonAuthenticationTokenResult result = UPlayFabClientModelDecoder::decodeGetPhotonAuthenticationTokenResultResponse(response.responseData); + OnSuccessGetPhotonAuthenticationToken.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Returns the title's base 64 encoded RSA CSP blob. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetTitlePublicKey(FClientGetTitlePublicKeyRequest request, + FDelegateOnSuccessGetTitlePublicKey onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitlePublicKey = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetTitlePublicKey); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetTitlePublicKey"; + + // Serialize all the request properties to json + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + if (request.TitleSharedSecret.IsEmpty() || request.TitleSharedSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("TitleSharedSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("TitleSharedSecret"), request.TitleSharedSecret); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetTitlePublicKey(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitlePublicKey.IsBound()) + { + FClientGetTitlePublicKeyResult result = UPlayFabClientModelDecoder::decodeGetTitlePublicKeyResultResponse(response.responseData); + OnSuccessGetTitlePublicKey.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Requests a challenge from the server to be signed by Windows Hello Passport service to authenticate. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetWindowsHelloChallenge(FClientGetWindowsHelloChallengeRequest request, + FDelegateOnSuccessGetWindowsHelloChallenge onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetWindowsHelloChallenge = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetWindowsHelloChallenge); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetWindowsHelloChallenge"; + + // Serialize all the request properties to json + if (request.PublicKeyHint.IsEmpty() || request.PublicKeyHint == "") { + OutRestJsonObj->SetFieldNull(TEXT("PublicKeyHint")); + } else { + OutRestJsonObj->SetStringField(TEXT("PublicKeyHint"), request.PublicKeyHint); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetWindowsHelloChallenge(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetWindowsHelloChallenge.IsBound()) + { + FClientGetWindowsHelloChallengeResponse result = UPlayFabClientModelDecoder::decodeGetWindowsHelloChallengeResponseResponse(response.responseData); + OnSuccessGetWindowsHelloChallenge.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using the Android device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithAndroidDeviceID(FClientLoginWithAndroidDeviceIDRequest request, + FDelegateOnSuccessLoginWithAndroidDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithAndroidDeviceID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithAndroidDeviceID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithAndroidDeviceID"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.AndroidDevice.IsEmpty() || request.AndroidDevice == "") { + OutRestJsonObj->SetFieldNull(TEXT("AndroidDevice")); + } else { + OutRestJsonObj->SetStringField(TEXT("AndroidDevice"), request.AndroidDevice); + } + if (request.AndroidDeviceId.IsEmpty() || request.AndroidDeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("AndroidDeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("AndroidDeviceId"), request.AndroidDeviceId); + } + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.OS.IsEmpty() || request.OS == "") { + OutRestJsonObj->SetFieldNull(TEXT("OS")); + } else { + OutRestJsonObj->SetStringField(TEXT("OS"), request.OS); + } + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithAndroidDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithAndroidDeviceID.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithAndroidDeviceID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a custom unique identifier generated by the title, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithCustomID(FClientLoginWithCustomIDRequest request, + FDelegateOnSuccessLoginWithCustomID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithCustomID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithCustomID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithCustomID"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.CustomId.IsEmpty() || request.CustomId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CustomId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CustomId"), request.CustomId); + } + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithCustomID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithCustomID.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithCustomID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. Unlike most other login API calls, LoginWithEmailAddress does not permit the creation of new accounts via the CreateAccountFlag. Email addresses may be used to create accounts via RegisterPlayFabUser. */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithEmailAddress(FClientLoginWithEmailAddressRequest request, + FDelegateOnSuccessLoginWithEmailAddress onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithEmailAddress = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithEmailAddress); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithEmailAddress"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.Password.IsEmpty() || request.Password == "") { + OutRestJsonObj->SetFieldNull(TEXT("Password")); + } else { + OutRestJsonObj->SetStringField(TEXT("Password"), request.Password); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithEmailAddress(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithEmailAddress.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithEmailAddress.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Facebook access token, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithFacebook(FClientLoginWithFacebookRequest request, + FDelegateOnSuccessLoginWithFacebook onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithFacebook = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithFacebook); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithFacebook"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.AccessToken.IsEmpty() || request.AccessToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("AccessToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("AccessToken"), request.AccessToken); + } + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithFacebook(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithFacebook.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithFacebook.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Facebook Instant Games ID, returning a session identifier that can subsequently be used for API calls which require an authenticated user. Requires Facebook Instant Games to be configured. */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithFacebookInstantGamesId(FClientLoginWithFacebookInstantGamesIdRequest request, + FDelegateOnSuccessLoginWithFacebookInstantGamesId onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithFacebookInstantGamesId = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithFacebookInstantGamesId); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithFacebookInstantGamesId"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.FacebookInstantGamesSignature.IsEmpty() || request.FacebookInstantGamesSignature == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookInstantGamesSignature")); + } else { + OutRestJsonObj->SetStringField(TEXT("FacebookInstantGamesSignature"), request.FacebookInstantGamesSignature); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithFacebookInstantGamesId(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithFacebookInstantGamesId.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithFacebookInstantGamesId.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using an iOS Game Center player identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithGameCenter(FClientLoginWithGameCenterRequest request, + FDelegateOnSuccessLoginWithGameCenter onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithGameCenter = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithGameCenter); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithGameCenter"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerId.IsEmpty() || request.PlayerId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerId"), request.PlayerId); + } + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithGameCenter(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithGameCenter.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithGameCenter.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using their Google account credentials */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithGoogleAccount(FClientLoginWithGoogleAccountRequest request, + FDelegateOnSuccessLoginWithGoogleAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithGoogleAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithGoogleAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithGoogleAccount"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + if (request.ServerAuthCode.IsEmpty() || request.ServerAuthCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerAuthCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerAuthCode"), request.ServerAuthCode); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithGoogleAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithGoogleAccount.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithGoogleAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using the vendor-specific iOS device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithIOSDeviceID(FClientLoginWithIOSDeviceIDRequest request, + FDelegateOnSuccessLoginWithIOSDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithIOSDeviceID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithIOSDeviceID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithIOSDeviceID"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.DeviceId.IsEmpty() || request.DeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceId"), request.DeviceId); + } + if (request.DeviceModel.IsEmpty() || request.DeviceModel == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceModel")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceModel"), request.DeviceModel); + } + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.OS.IsEmpty() || request.OS == "") { + OutRestJsonObj->SetFieldNull(TEXT("OS")); + } else { + OutRestJsonObj->SetStringField(TEXT("OS"), request.OS); + } + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithIOSDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithIOSDeviceID.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithIOSDeviceID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Kongregate player account. */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithKongregate(FClientLoginWithKongregateRequest request, + FDelegateOnSuccessLoginWithKongregate onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithKongregate = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithKongregate); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithKongregate"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.AuthTicket.IsEmpty() || request.AuthTicket == "") { + OutRestJsonObj->SetFieldNull(TEXT("AuthTicket")); + } else { + OutRestJsonObj->SetStringField(TEXT("AuthTicket"), request.AuthTicket); + } + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + if (request.KongregateId.IsEmpty() || request.KongregateId == "") { + OutRestJsonObj->SetFieldNull(TEXT("KongregateId")); + } else { + OutRestJsonObj->SetStringField(TEXT("KongregateId"), request.KongregateId); + } + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithKongregate(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithKongregate.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithKongregate.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Nintendo Switch Device ID, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithNintendoSwitchDeviceId(FClientLoginWithNintendoSwitchDeviceIdRequest request, + FDelegateOnSuccessLoginWithNintendoSwitchDeviceId onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithNintendoSwitchDeviceId = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithNintendoSwitchDeviceId); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithNintendoSwitchDeviceId"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.NintendoSwitchDeviceId.IsEmpty() || request.NintendoSwitchDeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("NintendoSwitchDeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("NintendoSwitchDeviceId"), request.NintendoSwitchDeviceId); + } + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithNintendoSwitchDeviceId(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithNintendoSwitchDeviceId.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithNintendoSwitchDeviceId.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. Unlike most other login API calls, LoginWithPlayFab does not permit the creation of new accounts via the CreateAccountFlag. Username/Password credentials may be used to create accounts via RegisterPlayFabUser, or added to existing accounts using AddUsernamePassword. */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithPlayFab(FClientLoginWithPlayFabRequest request, + FDelegateOnSuccessLoginWithPlayFab onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithPlayFab = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithPlayFab); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithPlayFab"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.Password.IsEmpty() || request.Password == "") { + OutRestJsonObj->SetFieldNull(TEXT("Password")); + } else { + OutRestJsonObj->SetStringField(TEXT("Password"), request.Password); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + if (request.Username.IsEmpty() || request.Username == "") { + OutRestJsonObj->SetFieldNull(TEXT("Username")); + } else { + OutRestJsonObj->SetStringField(TEXT("Username"), request.Username); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithPlayFab(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithPlayFab.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithPlayFab.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Steam authentication ticket, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithSteam(FClientLoginWithSteamRequest request, + FDelegateOnSuccessLoginWithSteam onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithSteam = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithSteam); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithSteam"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + if (request.SteamTicket.IsEmpty() || request.SteamTicket == "") { + OutRestJsonObj->SetFieldNull(TEXT("SteamTicket")); + } else { + OutRestJsonObj->SetStringField(TEXT("SteamTicket"), request.SteamTicket); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithSteam(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithSteam.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithSteam.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Twitch access token. */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithTwitch(FClientLoginWithTwitchRequest request, + FDelegateOnSuccessLoginWithTwitch onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithTwitch = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithTwitch); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithTwitch"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.AccessToken.IsEmpty() || request.AccessToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("AccessToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("AccessToken"), request.AccessToken); + } + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithTwitch(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithTwitch.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithTwitch.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Completes the Windows Hello login flow by returning the signed value of the challange from GetWindowsHelloChallenge. Windows Hello has a 2 step client to server authentication scheme. Step one is to request from the server a challenge string. Step two is to request the user sign the string via Windows Hello and then send the signed value back to the server. */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithWindowsHello(FClientLoginWithWindowsHelloRequest request, + FDelegateOnSuccessLoginWithWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithWindowsHello = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithWindowsHello); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithWindowsHello"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.ChallengeSignature.IsEmpty() || request.ChallengeSignature == "") { + OutRestJsonObj->SetFieldNull(TEXT("ChallengeSignature")); + } else { + OutRestJsonObj->SetStringField(TEXT("ChallengeSignature"), request.ChallengeSignature); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PublicKeyHint.IsEmpty() || request.PublicKeyHint == "") { + OutRestJsonObj->SetFieldNull(TEXT("PublicKeyHint")); + } else { + OutRestJsonObj->SetStringField(TEXT("PublicKeyHint"), request.PublicKeyHint); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithWindowsHello.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithWindowsHello.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithXbox(FClientLoginWithXboxRequest request, + FDelegateOnSuccessLoginWithXbox onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithXbox = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithXbox); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithXbox"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithXbox(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithXbox.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithXbox.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Registers a new Playfab user account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. You must supply either a username or an email address. */ +UPlayFabClientAPI* UPlayFabClientAPI::RegisterPlayFabUser(FClientRegisterPlayFabUserRequest request, + FDelegateOnSuccessRegisterPlayFabUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRegisterPlayFabUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRegisterPlayFabUser); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RegisterPlayFabUser"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.DisplayName.IsEmpty() || request.DisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("DisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("DisplayName"), request.DisplayName); + } + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.Password.IsEmpty() || request.Password == "") { + OutRestJsonObj->SetFieldNull(TEXT("Password")); + } else { + OutRestJsonObj->SetStringField(TEXT("Password"), request.Password); + } + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetBoolField(TEXT("RequireBothUsernameAndEmail"), request.RequireBothUsernameAndEmail); + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + if (request.Username.IsEmpty() || request.Username == "") { + OutRestJsonObj->SetFieldNull(TEXT("Username")); + } else { + OutRestJsonObj->SetStringField(TEXT("Username"), request.Username); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRegisterPlayFabUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRegisterPlayFabUser.IsBound()) + { + FClientRegisterPlayFabUserResult result = UPlayFabClientModelDecoder::decodeRegisterPlayFabUserResultResponse(response.responseData); + OnSuccessRegisterPlayFabUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Registers a new PlayFab user account using Windows Hello authentication, returning a session ticket that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::RegisterWithWindowsHello(FClientRegisterWithWindowsHelloRequest request, + FDelegateOnSuccessRegisterWithWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRegisterWithWindowsHello = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRegisterWithWindowsHello); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RegisterWithWindowsHello"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.DeviceName.IsEmpty() || request.DeviceName == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceName")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceName"), request.DeviceName); + } + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + if (request.PublicKey.IsEmpty() || request.PublicKey == "") { + OutRestJsonObj->SetFieldNull(TEXT("PublicKey")); + } else { + OutRestJsonObj->SetStringField(TEXT("PublicKey"), request.PublicKey); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + if (request.UserName.IsEmpty() || request.UserName == "") { + OutRestJsonObj->SetFieldNull(TEXT("UserName")); + } else { + OutRestJsonObj->SetStringField(TEXT("UserName"), request.UserName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRegisterWithWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRegisterWithWindowsHello.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessRegisterWithWindowsHello.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's secret use the Admin or Server API method SetPlayerSecret. */ +UPlayFabClientAPI* UPlayFabClientAPI::SetPlayerSecret(FClientSetPlayerSecretRequest request, + FDelegateOnSuccessSetPlayerSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetPlayerSecret = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperSetPlayerSecret); + + // Setup the request + manager->PlayFabRequestURL = "/Client/SetPlayerSecret"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperSetPlayerSecret(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetPlayerSecret.IsBound()) + { + FClientSetPlayerSecretResult result = UPlayFabClientModelDecoder::decodeSetPlayerSecretResultResponse(response.responseData); + OnSuccessSetPlayerSecret.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Character Data +////////////////////////////////////////////////////// +/** Retrieves the title-specific custom data for the character which is readable and writable by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCharacterData(FClientGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCharacterData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCharacterData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterData.IsBound()) + { + FClientGetCharacterDataResult result = UPlayFabClientModelDecoder::decodeGetCharacterDataResultResponse(response.responseData); + OnSuccessGetCharacterData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the character which can only be read by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCharacterReadOnlyData(FClientGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCharacterReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCharacterReadOnlyData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCharacterReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterReadOnlyData.IsBound()) + { + FClientGetCharacterDataResult result = UPlayFabClientModelDecoder::decodeGetCharacterDataResultResponse(response.responseData); + OnSuccessGetCharacterReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates and updates the title-specific custom data for the user's character which is readable and writable by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateCharacterData(FClientUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCharacterData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateCharacterData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateCharacterData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCharacterData.IsBound()) + { + FClientUpdateCharacterDataResult result = UPlayFabClientModelDecoder::decodeUpdateCharacterDataResultResponse(response.responseData); + OnSuccessUpdateCharacterData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// +/** Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetAllUsersCharacters(FClientListUsersCharactersRequest request, + FDelegateOnSuccessGetAllUsersCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetAllUsersCharacters = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetAllUsersCharacters); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetAllUsersCharacters"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetAllUsersCharacters(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetAllUsersCharacters.IsBound()) + { + FClientListUsersCharactersResult result = UPlayFabClientModelDecoder::decodeListUsersCharactersResultResponse(response.responseData); + OnSuccessGetAllUsersCharacters.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCharacterLeaderboard(FClientGetCharacterLeaderboardRequest request, + FDelegateOnSuccessGetCharacterLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterLeaderboard = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCharacterLeaderboard); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCharacterLeaderboard"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterType.IsEmpty() || request.CharacterType == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterType")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterType"), request.CharacterType); + } + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + OutRestJsonObj->SetNumberField(TEXT("StartPosition"), request.StartPosition); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCharacterLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterLeaderboard.IsBound()) + { + FClientGetCharacterLeaderboardResult result = UPlayFabClientModelDecoder::decodeGetCharacterLeaderboardResultResponse(response.responseData); + OnSuccessGetCharacterLeaderboard.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the details of all title-specific statistics for the user */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCharacterStatistics(FClientGetCharacterStatisticsRequest request, + FDelegateOnSuccessGetCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCharacterStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCharacterStatistics"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterStatistics.IsBound()) + { + FClientGetCharacterStatisticsResult result = UPlayFabClientModelDecoder::decodeGetCharacterStatisticsResultResponse(response.responseData); + OnSuccessGetCharacterStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked characters for the given statistic, centered on the requested Character ID */ +UPlayFabClientAPI* UPlayFabClientAPI::GetLeaderboardAroundCharacter(FClientGetLeaderboardAroundCharacterRequest request, + FDelegateOnSuccessGetLeaderboardAroundCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboardAroundCharacter = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetLeaderboardAroundCharacter); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetLeaderboardAroundCharacter"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CharacterType.IsEmpty() || request.CharacterType == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterType")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterType"), request.CharacterType); + } + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetLeaderboardAroundCharacter(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboardAroundCharacter.IsBound()) + { + FClientGetLeaderboardAroundCharacterResult result = UPlayFabClientModelDecoder::decodeGetLeaderboardAroundCharacterResultResponse(response.responseData); + OnSuccessGetLeaderboardAroundCharacter.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of all of the user's characters for the given statistic. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetLeaderboardForUserCharacters(FClientGetLeaderboardForUsersCharactersRequest request, + FDelegateOnSuccessGetLeaderboardForUserCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboardForUserCharacters = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetLeaderboardForUserCharacters); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetLeaderboardForUserCharacters"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetLeaderboardForUserCharacters(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboardForUserCharacters.IsBound()) + { + FClientGetLeaderboardForUsersCharactersResult result = UPlayFabClientModelDecoder::decodeGetLeaderboardForUsersCharactersResultResponse(response.responseData); + OnSuccessGetLeaderboardForUserCharacters.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness. */ +UPlayFabClientAPI* UPlayFabClientAPI::GrantCharacterToUser(FClientGrantCharacterToUserRequest request, + FDelegateOnSuccessGrantCharacterToUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGrantCharacterToUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGrantCharacterToUser); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GrantCharacterToUser"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterName.IsEmpty() || request.CharacterName == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterName")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterName"), request.CharacterName); + } + if (request.ItemId.IsEmpty() || request.ItemId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemId"), request.ItemId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGrantCharacterToUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGrantCharacterToUser.IsBound()) + { + FClientGrantCharacterToUserResult result = UPlayFabClientModelDecoder::decodeGrantCharacterToUserResultResponse(response.responseData); + OnSuccessGrantCharacterToUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the values of the specified title-specific statistics for the specific character. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateCharacterStatistics(FClientUpdateCharacterStatisticsRequest request, + FDelegateOnSuccessUpdateCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCharacterStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateCharacterStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateCharacterStatistics"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CharacterStatistics != nullptr) OutRestJsonObj->SetObjectField(TEXT("CharacterStatistics"), request.CharacterStatistics); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCharacterStatistics.IsBound()) + { + FClientUpdateCharacterStatisticsResult result = UPlayFabClientModelDecoder::decodeUpdateCharacterStatisticsResultResponse(response.responseData); + OnSuccessUpdateCharacterStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// +/** This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service. Also, please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetContentDownloadUrl(FClientGetContentDownloadUrlRequest request, + FDelegateOnSuccessGetContentDownloadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetContentDownloadUrl = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetContentDownloadUrl); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetContentDownloadUrl"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.HttpMethod.IsEmpty() || request.HttpMethod == "") { + OutRestJsonObj->SetFieldNull(TEXT("HttpMethod")); + } else { + OutRestJsonObj->SetStringField(TEXT("HttpMethod"), request.HttpMethod); + } + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + OutRestJsonObj->SetBoolField(TEXT("ThruCDN"), request.ThruCDN); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetContentDownloadUrl(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetContentDownloadUrl.IsBound()) + { + FClientGetContentDownloadUrlResult result = UPlayFabClientModelDecoder::decodeGetContentDownloadUrlResultResponse(response.responseData); + OnSuccessGetContentDownloadUrl.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Friend List Management +////////////////////////////////////////////////////// +/** Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user. At least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. */ +UPlayFabClientAPI* UPlayFabClientAPI::AddFriend(FClientAddFriendRequest request, + FDelegateOnSuccessAddFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddFriend = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAddFriend); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AddFriend"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.FriendEmail.IsEmpty() || request.FriendEmail == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendEmail")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendEmail"), request.FriendEmail); + } + if (request.FriendPlayFabId.IsEmpty() || request.FriendPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendPlayFabId"), request.FriendPlayFabId); + } + if (request.FriendTitleDisplayName.IsEmpty() || request.FriendTitleDisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendTitleDisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendTitleDisplayName"), request.FriendTitleDisplayName); + } + if (request.FriendUsername.IsEmpty() || request.FriendUsername == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendUsername")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendUsername"), request.FriendUsername); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAddFriend(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddFriend.IsBound()) + { + FClientAddFriendResult result = UPlayFabClientModelDecoder::decodeAddFriendResultResponse(response.responseData); + OnSuccessAddFriend.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the current friend list for the local user, constrained to users who have PlayFab accounts. Friends from linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetFriendsList(FClientGetFriendsListRequest request, + FDelegateOnSuccessGetFriendsList onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetFriendsList = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetFriendsList); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetFriendsList"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("IncludeFacebookFriends"), request.IncludeFacebookFriends); + OutRestJsonObj->SetBoolField(TEXT("IncludeSteamFriends"), request.IncludeSteamFriends); + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetFriendsList(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetFriendsList.IsBound()) + { + FClientGetFriendsListResult result = UPlayFabClientModelDecoder::decodeGetFriendsListResultResponse(response.responseData); + OnSuccessGetFriendsList.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes a specified user from the friend list of the local user */ +UPlayFabClientAPI* UPlayFabClientAPI::RemoveFriend(FClientRemoveFriendRequest request, + FDelegateOnSuccessRemoveFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveFriend = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRemoveFriend); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RemoveFriend"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.FriendPlayFabId.IsEmpty() || request.FriendPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendPlayFabId"), request.FriendPlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRemoveFriend(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveFriend.IsBound()) + { + FClientRemoveFriendResult result = UPlayFabClientModelDecoder::decodeRemoveFriendResultResponse(response.responseData); + OnSuccessRemoveFriend.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the tag list for a specified user in the friend list of the local user */ +UPlayFabClientAPI* UPlayFabClientAPI::SetFriendTags(FClientSetFriendTagsRequest request, + FDelegateOnSuccessSetFriendTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetFriendTags = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperSetFriendTags); + + // Setup the request + manager->PlayFabRequestURL = "/Client/SetFriendTags"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.FriendPlayFabId.IsEmpty() || request.FriendPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendPlayFabId"), request.FriendPlayFabId); + } + // Check to see if string is empty + if (request.Tags.IsEmpty() || request.Tags == "") { + OutRestJsonObj->SetFieldNull(TEXT("Tags")); + } else { + TArray TagsArray; + FString(request.Tags).ParseIntoArray(TagsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Tags"), TagsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperSetFriendTags(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetFriendTags.IsBound()) + { + FClientSetFriendTagsResult result = UPlayFabClientModelDecoder::decodeSetFriendTagsResultResponse(response.responseData); + OnSuccessSetFriendTags.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// +/** Get details about all current running game servers matching the given parameters. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCurrentGames(FClientCurrentGamesRequest request, + FDelegateOnSuccessGetCurrentGames onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCurrentGames = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCurrentGames); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCurrentGames"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.BuildVersion.IsEmpty() || request.BuildVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildVersion"), request.BuildVersion); + } + if (request.GameMode.IsEmpty() || request.GameMode == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameMode")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameMode"), request.GameMode); + } + FString temp_Region; + if (GetEnumValueToString(TEXT("ERegion"), request.Region, temp_Region)) + OutRestJsonObj->SetStringField(TEXT("Region"), temp_Region); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + if (request.TagFilter != nullptr) OutRestJsonObj->SetObjectField(TEXT("TagFilter"), request.TagFilter); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCurrentGames(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCurrentGames.IsBound()) + { + FClientCurrentGamesResult result = UPlayFabClientModelDecoder::decodeCurrentGamesResultResponse(response.responseData); + OnSuccessGetCurrentGames.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get details about the regions hosting game servers matching the given parameters. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetGameServerRegions(FClientGameServerRegionsRequest request, + FDelegateOnSuccessGetGameServerRegions onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetGameServerRegions = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetGameServerRegions); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetGameServerRegions"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.BuildVersion.IsEmpty() || request.BuildVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildVersion"), request.BuildVersion); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetGameServerRegions(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetGameServerRegions.IsBound()) + { + FClientGameServerRegionsResult result = UPlayFabClientModelDecoder::decodeGameServerRegionsResultResponse(response.responseData); + OnSuccessGetGameServerRegions.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Attempts to locate a game session matching the given parameters. If the goal is to match the player into a specific active session, only the LobbyId is required. Otherwise, the BuildVersion, GameMode, and Region are all required parameters. Note that parameters specified in the search are required (they are not weighting factors). If a slot is found in a server instance matching the parameters, the slot will be assigned to that player, removing it from the availabe set. In that case, the information on the game session will be returned, otherwise the Status returned will be GameNotFound. */ +UPlayFabClientAPI* UPlayFabClientAPI::Matchmake(FClientMatchmakeRequest request, + FDelegateOnSuccessMatchmake onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessMatchmake = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperMatchmake); + + // Setup the request + manager->PlayFabRequestURL = "/Client/Matchmake"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.BuildVersion.IsEmpty() || request.BuildVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildVersion"), request.BuildVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.GameMode.IsEmpty() || request.GameMode == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameMode")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameMode"), request.GameMode); + } + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + FString temp_Region; + if (GetEnumValueToString(TEXT("ERegion"), request.Region, temp_Region)) + OutRestJsonObj->SetStringField(TEXT("Region"), temp_Region); + OutRestJsonObj->SetBoolField(TEXT("StartNewIfNoneFound"), request.StartNewIfNoneFound); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + if (request.TagFilter != nullptr) OutRestJsonObj->SetObjectField(TEXT("TagFilter"), request.TagFilter); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperMatchmake(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessMatchmake.IsBound()) + { + FClientMatchmakeResult result = UPlayFabClientModelDecoder::decodeMatchmakeResultResponse(response.responseData); + OnSuccessMatchmake.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Start a new game server with a given configuration, add the current player and return the connection information. */ +UPlayFabClientAPI* UPlayFabClientAPI::StartGame(FClientStartGameRequest request, + FDelegateOnSuccessStartGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessStartGame = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperStartGame); + + // Setup the request + manager->PlayFabRequestURL = "/Client/StartGame"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.BuildVersion.IsEmpty() || request.BuildVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildVersion"), request.BuildVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CustomCommandLineData.IsEmpty() || request.CustomCommandLineData == "") { + OutRestJsonObj->SetFieldNull(TEXT("CustomCommandLineData")); + } else { + OutRestJsonObj->SetStringField(TEXT("CustomCommandLineData"), request.CustomCommandLineData); + } + if (request.GameMode.IsEmpty() || request.GameMode == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameMode")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameMode"), request.GameMode); + } + FString temp_Region; + if (GetEnumValueToString(TEXT("ERegion"), request.Region, temp_Region)) + OutRestJsonObj->SetStringField(TEXT("Region"), temp_Region); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperStartGame(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessStartGame.IsBound()) + { + FClientStartGameResult result = UPlayFabClientModelDecoder::decodeStartGameResultResponse(response.responseData); + OnSuccessStartGame.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Platform Specific Methods +////////////////////////////////////////////////////// +/** Registers the Android device to receive push notifications */ +UPlayFabClientAPI* UPlayFabClientAPI::AndroidDevicePushNotificationRegistration(FClientAndroidDevicePushNotificationRegistrationRequest request, + FDelegateOnSuccessAndroidDevicePushNotificationRegistration onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAndroidDevicePushNotificationRegistration = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAndroidDevicePushNotificationRegistration); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AndroidDevicePushNotificationRegistration"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.ConfirmationMessage.IsEmpty() || request.ConfirmationMessage == "") { + OutRestJsonObj->SetFieldNull(TEXT("ConfirmationMessage")); + } else { + OutRestJsonObj->SetStringField(TEXT("ConfirmationMessage"), request.ConfirmationMessage); + } + if (request.DeviceToken.IsEmpty() || request.DeviceToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceToken"), request.DeviceToken); + } + OutRestJsonObj->SetBoolField(TEXT("SendPushNotificationConfirmation"), request.SendPushNotificationConfirmation); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAndroidDevicePushNotificationRegistration(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAndroidDevicePushNotificationRegistration.IsBound()) + { + FClientAndroidDevicePushNotificationRegistrationResult result = UPlayFabClientModelDecoder::decodeAndroidDevicePushNotificationRegistrationResultResponse(response.responseData); + OnSuccessAndroidDevicePushNotificationRegistration.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Grants the player's current entitlements from Xbox Live, consuming all availble items in Xbox and granting them to the player's PlayFab inventory. This call is idempotent and will not grant previously granted items to the player. */ +UPlayFabClientAPI* UPlayFabClientAPI::ConsumeXboxEntitlements(FClientConsumeXboxEntitlementsRequest request, + FDelegateOnSuccessConsumeXboxEntitlements onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessConsumeXboxEntitlements = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperConsumeXboxEntitlements); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ConsumeXboxEntitlements"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperConsumeXboxEntitlements(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessConsumeXboxEntitlements.IsBound()) + { + FClientConsumeXboxEntitlementsResult result = UPlayFabClientModelDecoder::decodeConsumeXboxEntitlementsResultResponse(response.responseData); + OnSuccessConsumeXboxEntitlements.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Registers the iOS device to receive push notifications */ +UPlayFabClientAPI* UPlayFabClientAPI::RegisterForIOSPushNotification(FClientRegisterForIOSPushNotificationRequest request, + FDelegateOnSuccessRegisterForIOSPushNotification onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRegisterForIOSPushNotification = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRegisterForIOSPushNotification); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RegisterForIOSPushNotification"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.ConfirmationMessage.IsEmpty() || request.ConfirmationMessage == "") { + OutRestJsonObj->SetFieldNull(TEXT("ConfirmationMessage")); + } else { + OutRestJsonObj->SetStringField(TEXT("ConfirmationMessage"), request.ConfirmationMessage); + } + if (request.DeviceToken.IsEmpty() || request.DeviceToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceToken"), request.DeviceToken); + } + OutRestJsonObj->SetBoolField(TEXT("SendPushNotificationConfirmation"), request.SendPushNotificationConfirmation); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRegisterForIOSPushNotification(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRegisterForIOSPushNotification.IsBound()) + { + FClientRegisterForIOSPushNotificationResult result = UPlayFabClientModelDecoder::decodeRegisterForIOSPushNotificationResultResponse(response.responseData); + OnSuccessRegisterForIOSPushNotification.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Restores all in-app purchases based on the given restore receipt */ +UPlayFabClientAPI* UPlayFabClientAPI::RestoreIOSPurchases(FClientRestoreIOSPurchasesRequest request, + FDelegateOnSuccessRestoreIOSPurchases onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRestoreIOSPurchases = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRestoreIOSPurchases); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RestoreIOSPurchases"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.ReceiptData.IsEmpty() || request.ReceiptData == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReceiptData")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReceiptData"), request.ReceiptData); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRestoreIOSPurchases(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRestoreIOSPurchases.IsBound()) + { + FClientRestoreIOSPurchasesResult result = UPlayFabClientModelDecoder::decodeRestoreIOSPurchasesResultResponse(response.responseData); + OnSuccessRestoreIOSPurchases.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item */ +UPlayFabClientAPI* UPlayFabClientAPI::ValidateAmazonIAPReceipt(FClientValidateAmazonReceiptRequest request, + FDelegateOnSuccessValidateAmazonIAPReceipt onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessValidateAmazonIAPReceipt = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperValidateAmazonIAPReceipt); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ValidateAmazonIAPReceipt"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CurrencyCode.IsEmpty() || request.CurrencyCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("CurrencyCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("CurrencyCode"), request.CurrencyCode); + } + OutRestJsonObj->SetNumberField(TEXT("PurchasePrice"), request.PurchasePrice); + if (request.ReceiptId.IsEmpty() || request.ReceiptId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReceiptId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReceiptId"), request.ReceiptId); + } + if (request.UserId.IsEmpty() || request.UserId == "") { + OutRestJsonObj->SetFieldNull(TEXT("UserId")); + } else { + OutRestJsonObj->SetStringField(TEXT("UserId"), request.UserId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperValidateAmazonIAPReceipt(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessValidateAmazonIAPReceipt.IsBound()) + { + FClientValidateAmazonReceiptResult result = UPlayFabClientModelDecoder::decodeValidateAmazonReceiptResultResponse(response.responseData); + OnSuccessValidateAmazonIAPReceipt.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Validates a Google Play purchase and gives the corresponding item to the player. */ +UPlayFabClientAPI* UPlayFabClientAPI::ValidateGooglePlayPurchase(FClientValidateGooglePlayPurchaseRequest request, + FDelegateOnSuccessValidateGooglePlayPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessValidateGooglePlayPurchase = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperValidateGooglePlayPurchase); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ValidateGooglePlayPurchase"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CurrencyCode.IsEmpty() || request.CurrencyCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("CurrencyCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("CurrencyCode"), request.CurrencyCode); + } + OutRestJsonObj->SetNumberField(TEXT("PurchasePrice"), request.PurchasePrice); + if (request.ReceiptJson.IsEmpty() || request.ReceiptJson == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReceiptJson")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReceiptJson"), request.ReceiptJson); + } + if (request.Signature.IsEmpty() || request.Signature == "") { + OutRestJsonObj->SetFieldNull(TEXT("Signature")); + } else { + OutRestJsonObj->SetStringField(TEXT("Signature"), request.Signature); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperValidateGooglePlayPurchase(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessValidateGooglePlayPurchase.IsBound()) + { + FClientValidateGooglePlayPurchaseResult result = UPlayFabClientModelDecoder::decodeValidateGooglePlayPurchaseResultResponse(response.responseData); + OnSuccessValidateGooglePlayPurchase.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item */ +UPlayFabClientAPI* UPlayFabClientAPI::ValidateIOSReceipt(FClientValidateIOSReceiptRequest request, + FDelegateOnSuccessValidateIOSReceipt onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessValidateIOSReceipt = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperValidateIOSReceipt); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ValidateIOSReceipt"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CurrencyCode.IsEmpty() || request.CurrencyCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("CurrencyCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("CurrencyCode"), request.CurrencyCode); + } + OutRestJsonObj->SetNumberField(TEXT("PurchasePrice"), request.PurchasePrice); + if (request.ReceiptData.IsEmpty() || request.ReceiptData == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReceiptData")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReceiptData"), request.ReceiptData); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperValidateIOSReceipt(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessValidateIOSReceipt.IsBound()) + { + FClientValidateIOSReceiptResult result = UPlayFabClientModelDecoder::decodeValidateIOSReceiptResultResponse(response.responseData); + OnSuccessValidateIOSReceipt.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Validates with Windows that the receipt for an Windows App Store in-app purchase is valid and that it matches the purchased catalog item */ +UPlayFabClientAPI* UPlayFabClientAPI::ValidateWindowsStoreReceipt(FClientValidateWindowsReceiptRequest request, + FDelegateOnSuccessValidateWindowsStoreReceipt onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessValidateWindowsStoreReceipt = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperValidateWindowsStoreReceipt); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ValidateWindowsStoreReceipt"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CurrencyCode.IsEmpty() || request.CurrencyCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("CurrencyCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("CurrencyCode"), request.CurrencyCode); + } + OutRestJsonObj->SetNumberField(TEXT("PurchasePrice"), request.PurchasePrice); + if (request.Receipt.IsEmpty() || request.Receipt == "") { + OutRestJsonObj->SetFieldNull(TEXT("Receipt")); + } else { + OutRestJsonObj->SetStringField(TEXT("Receipt"), request.Receipt); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperValidateWindowsStoreReceipt(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessValidateWindowsStoreReceipt.IsBound()) + { + FClientValidateWindowsReceiptResult result = UPlayFabClientModelDecoder::decodeValidateWindowsReceiptResultResponse(response.responseData); + OnSuccessValidateWindowsStoreReceipt.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// +/** Retrieves a list of ranked friends of the current player for the given statistic, starting from the indicated point in the leaderboard */ +UPlayFabClientAPI* UPlayFabClientAPI::GetFriendLeaderboard(FClientGetFriendLeaderboardRequest request, + FDelegateOnSuccessGetFriendLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetFriendLeaderboard = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetFriendLeaderboard); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetFriendLeaderboard"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("IncludeFacebookFriends"), request.IncludeFacebookFriends); + OutRestJsonObj->SetBoolField(TEXT("IncludeSteamFriends"), request.IncludeSteamFriends); + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + OutRestJsonObj->SetNumberField(TEXT("StartPosition"), request.StartPosition); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetFriendLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetFriendLeaderboard.IsBound()) + { + FClientGetLeaderboardResult result = UPlayFabClientModelDecoder::decodeGetLeaderboardResultResponse(response.responseData); + OnSuccessGetFriendLeaderboard.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked friends of the current player for the given statistic, centered on the requested PlayFab user. If PlayFabId is empty or null will return currently logged in user. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetFriendLeaderboardAroundPlayer(FClientGetFriendLeaderboardAroundPlayerRequest request, + FDelegateOnSuccessGetFriendLeaderboardAroundPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetFriendLeaderboardAroundPlayer = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetFriendLeaderboardAroundPlayer); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetFriendLeaderboardAroundPlayer"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("IncludeFacebookFriends"), request.IncludeFacebookFriends); + OutRestJsonObj->SetBoolField(TEXT("IncludeSteamFriends"), request.IncludeSteamFriends); + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetFriendLeaderboardAroundPlayer(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetFriendLeaderboardAroundPlayer.IsBound()) + { + FClientGetFriendLeaderboardAroundPlayerResult result = UPlayFabClientModelDecoder::decodeGetFriendLeaderboardAroundPlayerResultResponse(response.responseData); + OnSuccessGetFriendLeaderboardAroundPlayer.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard */ +UPlayFabClientAPI* UPlayFabClientAPI::GetLeaderboard(FClientGetLeaderboardRequest request, + FDelegateOnSuccessGetLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboard = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetLeaderboard); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetLeaderboard"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + OutRestJsonObj->SetNumberField(TEXT("StartPosition"), request.StartPosition); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboard.IsBound()) + { + FClientGetLeaderboardResult result = UPlayFabClientModelDecoder::decodeGetLeaderboardResultResponse(response.responseData); + OnSuccessGetLeaderboard.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked users for the given statistic, centered on the requested player. If PlayFabId is empty or null will return currently logged in user. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetLeaderboardAroundPlayer(FClientGetLeaderboardAroundPlayerRequest request, + FDelegateOnSuccessGetLeaderboardAroundPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboardAroundPlayer = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetLeaderboardAroundPlayer); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetLeaderboardAroundPlayer"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetLeaderboardAroundPlayer(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboardAroundPlayer.IsBound()) + { + FClientGetLeaderboardAroundPlayerResult result = UPlayFabClientModelDecoder::decodeGetLeaderboardAroundPlayerResultResponse(response.responseData); + OnSuccessGetLeaderboardAroundPlayer.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the indicated statistics (current version and values for all statistics, if none are specified), for the local player. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerStatistics(FClientGetPlayerStatisticsRequest request, + FDelegateOnSuccessGetPlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerStatistics"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.StatisticNames.IsEmpty() || request.StatisticNames == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticNames")); + } else { + TArray StatisticNamesArray; + FString(request.StatisticNames).ParseIntoArray(StatisticNamesArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("StatisticNames"), StatisticNamesArray); + } + if (request.StatisticNameVersions.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("StatisticNameVersions")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("StatisticNameVersions"), request.StatisticNameVersions); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerStatistics.IsBound()) + { + FClientGetPlayerStatisticsResult result = UPlayFabClientModelDecoder::decodeGetPlayerStatisticsResultResponse(response.responseData); + OnSuccessGetPlayerStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the information on the available versions of the specified statistic. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerStatisticVersions(FClientGetPlayerStatisticVersionsRequest request, + FDelegateOnSuccessGetPlayerStatisticVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerStatisticVersions = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerStatisticVersions); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerStatisticVersions"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerStatisticVersions(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerStatisticVersions.IsBound()) + { + FClientGetPlayerStatisticVersionsResult result = UPlayFabClientModelDecoder::decodeGetPlayerStatisticVersionsResultResponse(response.responseData); + OnSuccessGetPlayerStatisticVersions.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::GetUserData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetUserData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetUserData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetUserData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserData.IsBound()) + { + FClientGetUserDataResult result = UPlayFabClientModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::GetUserPublisherData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetUserPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetUserPublisherData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherData.IsBound()) + { + FClientGetUserDataResult result = UPlayFabClientModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which can only be read by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::GetUserPublisherReadOnlyData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetUserPublisherReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetUserPublisherReadOnlyData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherReadOnlyData.IsBound()) + { + FClientGetUserDataResult result = UPlayFabClientModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which can only be read by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::GetUserReadOnlyData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetUserReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetUserReadOnlyData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserReadOnlyData.IsBound()) + { + FClientGetUserDataResult result = UPlayFabClientModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdatePlayerStatistics(FClientUpdatePlayerStatisticsRequest request, + FDelegateOnSuccessUpdatePlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdatePlayerStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdatePlayerStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdatePlayerStatistics"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Statistics.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Statistics")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Statistics"), request.Statistics); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdatePlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdatePlayerStatistics.IsBound()) + { + FClientUpdatePlayerStatisticsResult result = UPlayFabClientModelDecoder::decodeUpdatePlayerStatisticsResultResponse(response.responseData); + OnSuccessUpdatePlayerStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates and updates the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateUserData(FClientUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateUserData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateUserData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateUserData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserData.IsBound()) + { + FClientUpdateUserDataResult result = UPlayFabClientModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates and updates the publisher-specific custom data for the user which is readable and writable by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateUserPublisherData(FClientUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateUserPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateUserPublisherData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherData.IsBound()) + { + FClientUpdateUserDataResult result = UPlayFabClientModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// +/** Increments the user's balance of the specified virtual currency by the stated amount */ +UPlayFabClientAPI* UPlayFabClientAPI::AddUserVirtualCurrency(FClientAddUserVirtualCurrencyRequest request, + FDelegateOnSuccessAddUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddUserVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAddUserVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AddUserVirtualCurrency"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAddUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddUserVirtualCurrency.IsBound()) + { + FClientModifyUserVirtualCurrencyResult result = UPlayFabClientModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(response.responseData); + OnSuccessAddUserVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Confirms with the payment provider that the purchase was approved (if applicable) and adjusts inventory and virtual currency balances as appropriate */ +UPlayFabClientAPI* UPlayFabClientAPI::ConfirmPurchase(FClientConfirmPurchaseRequest request, + FDelegateOnSuccessConfirmPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessConfirmPurchase = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperConfirmPurchase); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ConfirmPurchase"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.OrderId.IsEmpty() || request.OrderId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OrderId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OrderId"), request.OrderId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperConfirmPurchase(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessConfirmPurchase.IsBound()) + { + FClientConfirmPurchaseResult result = UPlayFabClientModelDecoder::decodeConfirmPurchaseResultResponse(response.responseData); + OnSuccessConfirmPurchase.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. */ +UPlayFabClientAPI* UPlayFabClientAPI::ConsumeItem(FClientConsumeItemRequest request, + FDelegateOnSuccessConsumeItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessConsumeItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperConsumeItem); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ConsumeItem"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("ConsumeCount"), request.ConsumeCount); + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperConsumeItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessConsumeItem.IsBound()) + { + FClientConsumeItemResult result = UPlayFabClientModelDecoder::decodeConsumeItemResultResponse(response.responseData); + OnSuccessConsumeItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the specified character's current inventory of virtual goods */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCharacterInventory(FClientGetCharacterInventoryRequest request, + FDelegateOnSuccessGetCharacterInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterInventory = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCharacterInventory); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCharacterInventory"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCharacterInventory(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterInventory.IsBound()) + { + FClientGetCharacterInventoryResult result = UPlayFabClientModelDecoder::decodeGetCharacterInventoryResultResponse(response.responseData); + OnSuccessGetCharacterInventory.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** For payments flows where the provider requires playfab (the fulfiller) to initiate the transaction, but the client completes the rest of the flow. In the Xsolla case, the token returned here will be passed to Xsolla by the client to create a cart. Poll GetPurchase using the returned OrderId once you've completed the payment. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPaymentToken(FClientGetPaymentTokenRequest request, + FDelegateOnSuccessGetPaymentToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPaymentToken = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPaymentToken); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPaymentToken"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.TokenProvider.IsEmpty() || request.TokenProvider == "") { + OutRestJsonObj->SetFieldNull(TEXT("TokenProvider")); + } else { + OutRestJsonObj->SetStringField(TEXT("TokenProvider"), request.TokenProvider); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPaymentToken(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPaymentToken.IsBound()) + { + FClientGetPaymentTokenResult result = UPlayFabClientModelDecoder::decodeGetPaymentTokenResultResponse(response.responseData); + OnSuccessGetPaymentToken.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a purchase along with its current PlayFab status. Returns inventory items from the purchase that are still active. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPurchase(FClientGetPurchaseRequest request, + FDelegateOnSuccessGetPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPurchase = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPurchase); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPurchase"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.OrderId.IsEmpty() || request.OrderId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OrderId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OrderId"), request.OrderId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPurchase(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPurchase.IsBound()) + { + FClientGetPurchaseResult result = UPlayFabClientModelDecoder::decodeGetPurchaseResultResponse(response.responseData); + OnSuccessGetPurchase.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the user's current inventory of virtual goods */ +UPlayFabClientAPI* UPlayFabClientAPI::GetUserInventory(FClientGetUserInventoryRequest request, + FDelegateOnSuccessGetUserInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserInventory = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetUserInventory); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetUserInventory"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetUserInventory(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserInventory.IsBound()) + { + FClientGetUserInventoryResult result = UPlayFabClientModelDecoder::decodeGetUserInventoryResultResponse(response.responseData); + OnSuccessGetUserInventory.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Selects a payment option for purchase order created via StartPurchase */ +UPlayFabClientAPI* UPlayFabClientAPI::PayForPurchase(FClientPayForPurchaseRequest request, + FDelegateOnSuccessPayForPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessPayForPurchase = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperPayForPurchase); + + // Setup the request + manager->PlayFabRequestURL = "/Client/PayForPurchase"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Currency.IsEmpty() || request.Currency == "") { + OutRestJsonObj->SetFieldNull(TEXT("Currency")); + } else { + OutRestJsonObj->SetStringField(TEXT("Currency"), request.Currency); + } + if (request.OrderId.IsEmpty() || request.OrderId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OrderId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OrderId"), request.OrderId); + } + if (request.ProviderName.IsEmpty() || request.ProviderName == "") { + OutRestJsonObj->SetFieldNull(TEXT("ProviderName")); + } else { + OutRestJsonObj->SetStringField(TEXT("ProviderName"), request.ProviderName); + } + if (request.ProviderTransactionId.IsEmpty() || request.ProviderTransactionId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ProviderTransactionId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ProviderTransactionId"), request.ProviderTransactionId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperPayForPurchase(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessPayForPurchase.IsBound()) + { + FClientPayForPurchaseResult result = UPlayFabClientModelDecoder::decodePayForPurchaseResultResponse(response.responseData); + OnSuccessPayForPurchase.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Buys a single item with virtual currency. You must specify both the virtual currency to use to purchase, as well as what the client believes the price to be. This lets the server fail the purchase if the price has changed. */ +UPlayFabClientAPI* UPlayFabClientAPI::PurchaseItem(FClientPurchaseItemRequest request, + FDelegateOnSuccessPurchaseItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessPurchaseItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperPurchaseItem); + + // Setup the request + manager->PlayFabRequestURL = "/Client/PurchaseItem"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ItemId.IsEmpty() || request.ItemId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemId"), request.ItemId); + } + OutRestJsonObj->SetNumberField(TEXT("Price"), request.Price); + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperPurchaseItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessPurchaseItem.IsBound()) + { + FClientPurchaseItemResult result = UPlayFabClientModelDecoder::decodePurchaseItemResultResponse(response.responseData); + OnSuccessPurchaseItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ +UPlayFabClientAPI* UPlayFabClientAPI::RedeemCoupon(FClientRedeemCouponRequest request, + FDelegateOnSuccessRedeemCoupon onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRedeemCoupon = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRedeemCoupon); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RedeemCoupon"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CouponCode.IsEmpty() || request.CouponCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("CouponCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("CouponCode"), request.CouponCode); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRedeemCoupon(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRedeemCoupon.IsBound()) + { + FClientRedeemCouponResult result = UPlayFabClientModelDecoder::decodeRedeemCouponResultResponse(response.responseData); + OnSuccessRedeemCoupon.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates an order for a list of items from the title catalog */ +UPlayFabClientAPI* UPlayFabClientAPI::StartPurchase(FClientStartPurchaseRequest request, + FDelegateOnSuccessStartPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessStartPurchase = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperStartPurchase); + + // Setup the request + manager->PlayFabRequestURL = "/Client/StartPurchase"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.Items.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Items")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Items"), request.Items); + } + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperStartPurchase(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessStartPurchase.IsBound()) + { + FClientStartPurchaseResult result = UPlayFabClientModelDecoder::decodeStartPurchaseResultResponse(response.responseData); + OnSuccessStartPurchase.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Decrements the user's balance of the specified virtual currency by the stated amount. It is possible to make a VC balance negative with this API. */ +UPlayFabClientAPI* UPlayFabClientAPI::SubtractUserVirtualCurrency(FClientSubtractUserVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSubtractUserVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperSubtractUserVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Client/SubtractUserVirtualCurrency"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperSubtractUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSubtractUserVirtualCurrency.IsBound()) + { + FClientModifyUserVirtualCurrencyResult result = UPlayFabClientModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(response.responseData); + OnSuccessSubtractUserVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Opens the specified container, with the specified key (when required), and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlockContainerInstance(FClientUnlockContainerInstanceRequest request, + FDelegateOnSuccessUnlockContainerInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlockContainerInstance = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlockContainerInstance); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlockContainerInstance"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ContainerItemInstanceId.IsEmpty() || request.ContainerItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContainerItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContainerItemInstanceId"), request.ContainerItemInstanceId); + } + if (request.KeyItemInstanceId.IsEmpty() || request.KeyItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeyItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("KeyItemInstanceId"), request.KeyItemInstanceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlockContainerInstance(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlockContainerInstance.IsBound()) + { + FClientUnlockContainerItemResult result = UPlayFabClientModelDecoder::decodeUnlockContainerItemResultResponse(response.responseData); + OnSuccessUnlockContainerInstance.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Searches target inventory for an ItemInstance matching the given CatalogItemId, if necessary unlocks it using an appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlockContainerItem(FClientUnlockContainerItemRequest request, + FDelegateOnSuccessUnlockContainerItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlockContainerItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlockContainerItem); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlockContainerItem"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ContainerItemId.IsEmpty() || request.ContainerItemId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContainerItemId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContainerItemId"), request.ContainerItemId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlockContainerItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlockContainerItem.IsBound()) + { + FClientUnlockContainerItemResult result = UPlayFabClientModelDecoder::decodeUnlockContainerItemResultResponse(response.responseData); + OnSuccessUnlockContainerItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// +/** List all segments that a player currently belongs to at this moment in time. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerSegments(FClientGetPlayerSegmentsRequest request, + FDelegateOnSuccessGetPlayerSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerSegments = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerSegments); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerSegments"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerSegments(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerSegments.IsBound()) + { + FClientGetPlayerSegmentsResult result = UPlayFabClientModelDecoder::decodeGetPlayerSegmentsResultResponse(response.responseData); + OnSuccessGetPlayerSegments.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get all tags with a given Namespace (optional) from a player profile. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerTags(FClientGetPlayerTagsRequest request, + FDelegateOnSuccessGetPlayerTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerTags = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerTags); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerTags"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Namespace.IsEmpty() || request.Namespace == "") { + OutRestJsonObj->SetFieldNull(TEXT("Namespace")); + } else { + OutRestJsonObj->SetStringField(TEXT("Namespace"), request.Namespace); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerTags(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerTags.IsBound()) + { + FClientGetPlayerTagsResult result = UPlayFabClientModelDecoder::decodeGetPlayerTagsResultResponse(response.responseData); + OnSuccessGetPlayerTags.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// +/** Executes a CloudScript function, with the 'currentPlayerId' set to the PlayFab ID of the authenticated player. */ +UPlayFabClientAPI* UPlayFabClientAPI::ExecuteCloudScript(FClientExecuteCloudScriptRequest request, + FDelegateOnSuccessExecuteCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessExecuteCloudScript = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperExecuteCloudScript); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ExecuteCloudScript"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.FunctionName.IsEmpty() || request.FunctionName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FunctionName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FunctionName"), request.FunctionName); + } + if (request.FunctionParameter != nullptr) OutRestJsonObj->SetObjectField(TEXT("FunctionParameter"), request.FunctionParameter); + OutRestJsonObj->SetBoolField(TEXT("GeneratePlayStreamEvent"), request.GeneratePlayStreamEvent); + FString temp_RevisionSelection; + if (GetEnumValueToString(TEXT("ECloudScriptRevisionOption"), request.RevisionSelection, temp_RevisionSelection)) + OutRestJsonObj->SetStringField(TEXT("RevisionSelection"), temp_RevisionSelection); + OutRestJsonObj->SetNumberField(TEXT("SpecificRevision"), request.SpecificRevision); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperExecuteCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessExecuteCloudScript.IsBound()) + { + FClientExecuteCloudScriptResult result = UPlayFabClientModelDecoder::decodeExecuteCloudScriptResultResponse(response.responseData); + OnSuccessExecuteCloudScript.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// +/** Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users in the group can add new members. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabClientAPI* UPlayFabClientAPI::AddSharedGroupMembers(FClientAddSharedGroupMembersRequest request, + FDelegateOnSuccessAddSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddSharedGroupMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAddSharedGroupMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AddSharedGroupMembers"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.PlayFabIds.IsEmpty() || request.PlayFabIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabIds")); + } else { + TArray PlayFabIdsArray; + FString(request.PlayFabIds).ParseIntoArray(PlayFabIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("PlayFabIds"), PlayFabIdsArray); + } + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAddSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddSharedGroupMembers.IsBound()) + { + FClientAddSharedGroupMembersResult result = UPlayFabClientModelDecoder::decodeAddSharedGroupMembersResultResponse(response.responseData); + OnSuccessAddSharedGroupMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the group. Upon creation, the current user will be the only member of the group. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabClientAPI* UPlayFabClientAPI::CreateSharedGroup(FClientCreateSharedGroupRequest request, + FDelegateOnSuccessCreateSharedGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreateSharedGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperCreateSharedGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Client/CreateSharedGroup"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperCreateSharedGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreateSharedGroup.IsBound()) + { + FClientCreateSharedGroupResult result = UPlayFabClientModelDecoder::decodeCreateSharedGroupResultResponse(response.responseData); + OnSuccessCreateSharedGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves data stored in a shared group object, as well as the list of members in the group. Non-members of the group may use this to retrieve group data, including membership, but they will not receive data for keys marked as private. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabClientAPI* UPlayFabClientAPI::GetSharedGroupData(FClientGetSharedGroupDataRequest request, + FDelegateOnSuccessGetSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetSharedGroupData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetSharedGroupData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetSharedGroupData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("GetMembers"), request.GetMembers); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetSharedGroupData.IsBound()) + { + FClientGetSharedGroupDataResult result = UPlayFabClientModelDecoder::decodeGetSharedGroupDataResultResponse(response.responseData); + OnSuccessGetSharedGroupData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the group can remove members. If as a result of the call, zero users remain with access, the group and its associated data will be deleted. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabClientAPI* UPlayFabClientAPI::RemoveSharedGroupMembers(FClientRemoveSharedGroupMembersRequest request, + FDelegateOnSuccessRemoveSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveSharedGroupMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRemoveSharedGroupMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RemoveSharedGroupMembers"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.PlayFabIds.IsEmpty() || request.PlayFabIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabIds")); + } else { + TArray PlayFabIdsArray; + FString(request.PlayFabIds).ParseIntoArray(PlayFabIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("PlayFabIds"), PlayFabIdsArray); + } + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRemoveSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveSharedGroupMembers.IsBound()) + { + FClientRemoveSharedGroupMembersResult result = UPlayFabClientModelDecoder::decodeRemoveSharedGroupMembersResultResponse(response.responseData); + OnSuccessRemoveSharedGroupMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated or added in this call will be readable by users not in the group. By default, data permissions are set to Private. Regardless of the permission setting, only members of the group can update the data. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateSharedGroupData(FClientUpdateSharedGroupDataRequest request, + FDelegateOnSuccessUpdateSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateSharedGroupData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateSharedGroupData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateSharedGroupData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateSharedGroupData.IsBound()) + { + FClientUpdateSharedGroupDataResult result = UPlayFabClientModelDecoder::decodeUpdateSharedGroupDataResultResponse(response.responseData); + OnSuccessUpdateSharedGroupData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// +/** Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCatalogItems(FClientGetCatalogItemsRequest request, + FDelegateOnSuccessGetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCatalogItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCatalogItems); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCatalogItems"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCatalogItems.IsBound()) + { + FClientGetCatalogItemsResult result = UPlayFabClientModelDecoder::decodeGetCatalogItemsResultResponse(response.responseData); + OnSuccessGetCatalogItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom publisher settings */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPublisherData(FClientGetPublisherDataRequest request, + FDelegateOnSuccessGetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPublisherData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPublisherData.IsBound()) + { + FClientGetPublisherDataResult result = UPlayFabClientModelDecoder::decodeGetPublisherDataResultResponse(response.responseData); + OnSuccessGetPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the set of items defined for the specified store, including all prices defined */ +UPlayFabClientAPI* UPlayFabClientAPI::GetStoreItems(FClientGetStoreItemsRequest request, + FDelegateOnSuccessGetStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetStoreItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetStoreItems); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetStoreItems"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetStoreItems.IsBound()) + { + FClientGetStoreItemsResult result = UPlayFabClientModelDecoder::decodeGetStoreItemsResultResponse(response.responseData); + OnSuccessGetStoreItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the current server time */ +UPlayFabClientAPI* UPlayFabClientAPI::GetTime(FClientGetTimeRequest request, + FDelegateOnSuccessGetTime onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTime = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetTime); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetTime"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetTime(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTime.IsBound()) + { + FClientGetTimeResult result = UPlayFabClientModelDecoder::decodeGetTimeResultResponse(response.responseData); + OnSuccessGetTime.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom title settings */ +UPlayFabClientAPI* UPlayFabClientAPI::GetTitleData(FClientGetTitleDataRequest request, + FDelegateOnSuccessGetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetTitleData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetTitleData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleData.IsBound()) + { + FClientGetTitleDataResult result = UPlayFabClientModelDecoder::decodeGetTitleDataResultResponse(response.responseData); + OnSuccessGetTitleData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title news feed, as configured in the developer portal */ +UPlayFabClientAPI* UPlayFabClientAPI::GetTitleNews(FClientGetTitleNewsRequest request, + FDelegateOnSuccessGetTitleNews onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleNews = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetTitleNews); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetTitleNews"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Count"), request.Count); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetTitleNews(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleNews.IsBound()) + { + FClientGetTitleNewsResult result = UPlayFabClientModelDecoder::decodeGetTitleNewsResultResponse(response.responseData); + OnSuccessGetTitleNews.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Trading +////////////////////////////////////////////////////// +/** Accepts an open trade (one that has not yet been accepted or cancelled), if the locally signed-in player is in the allowed player list for the trade, or it is open to all players. If the call is successful, the offered and accepted items will be swapped between the two players' inventories. */ +UPlayFabClientAPI* UPlayFabClientAPI::AcceptTrade(FClientAcceptTradeRequest request, + FDelegateOnSuccessAcceptTrade onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAcceptTrade = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAcceptTrade); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AcceptTrade"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.AcceptedInventoryInstanceIds.IsEmpty() || request.AcceptedInventoryInstanceIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("AcceptedInventoryInstanceIds")); + } else { + TArray AcceptedInventoryInstanceIdsArray; + FString(request.AcceptedInventoryInstanceIds).ParseIntoArray(AcceptedInventoryInstanceIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("AcceptedInventoryInstanceIds"), AcceptedInventoryInstanceIdsArray); + } + if (request.OfferingPlayerId.IsEmpty() || request.OfferingPlayerId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OfferingPlayerId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OfferingPlayerId"), request.OfferingPlayerId); + } + if (request.TradeId.IsEmpty() || request.TradeId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TradeId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TradeId"), request.TradeId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAcceptTrade(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAcceptTrade.IsBound()) + { + FClientAcceptTradeResponse result = UPlayFabClientModelDecoder::decodeAcceptTradeResponseResponse(response.responseData); + OnSuccessAcceptTrade.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Cancels an open trade (one that has not yet been accepted or cancelled). Note that only the player who created the trade can cancel it via this API call, to prevent griefing of the trade system (cancelling trades in order to prevent other players from accepting them, for trades that can be claimed by more than one player). */ +UPlayFabClientAPI* UPlayFabClientAPI::CancelTrade(FClientCancelTradeRequest request, + FDelegateOnSuccessCancelTrade onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCancelTrade = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperCancelTrade); + + // Setup the request + manager->PlayFabRequestURL = "/Client/CancelTrade"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.TradeId.IsEmpty() || request.TradeId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TradeId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TradeId"), request.TradeId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperCancelTrade(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCancelTrade.IsBound()) + { + FClientCancelTradeResponse result = UPlayFabClientModelDecoder::decodeCancelTradeResponseResponse(response.responseData); + OnSuccessCancelTrade.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets all trades the player has either opened or accepted, optionally filtered by trade status. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerTrades(FClientGetPlayerTradesRequest request, + FDelegateOnSuccessGetPlayerTrades onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerTrades = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerTrades); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerTrades"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + FString temp_StatusFilter; + if (GetEnumValueToString(TEXT("ETradeStatus"), request.StatusFilter, temp_StatusFilter)) + OutRestJsonObj->SetStringField(TEXT("StatusFilter"), temp_StatusFilter); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerTrades(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerTrades.IsBound()) + { + FClientGetPlayerTradesResponse result = UPlayFabClientModelDecoder::decodeGetPlayerTradesResponseResponse(response.responseData); + OnSuccessGetPlayerTrades.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets the current status of an existing trade. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetTradeStatus(FClientGetTradeStatusRequest request, + FDelegateOnSuccessGetTradeStatus onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTradeStatus = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetTradeStatus); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetTradeStatus"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.OfferingPlayerId.IsEmpty() || request.OfferingPlayerId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OfferingPlayerId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OfferingPlayerId"), request.OfferingPlayerId); + } + if (request.TradeId.IsEmpty() || request.TradeId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TradeId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TradeId"), request.TradeId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetTradeStatus(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTradeStatus.IsBound()) + { + FClientGetTradeStatusResponse result = UPlayFabClientModelDecoder::decodeGetTradeStatusResponseResponse(response.responseData); + OnSuccessGetTradeStatus.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Opens a new outstanding trade. Note that a given item instance may only be in one open trade at a time. */ +UPlayFabClientAPI* UPlayFabClientAPI::OpenTrade(FClientOpenTradeRequest request, + FDelegateOnSuccessOpenTrade onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessOpenTrade = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperOpenTrade); + + // Setup the request + manager->PlayFabRequestURL = "/Client/OpenTrade"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.AllowedPlayerIds.IsEmpty() || request.AllowedPlayerIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("AllowedPlayerIds")); + } else { + TArray AllowedPlayerIdsArray; + FString(request.AllowedPlayerIds).ParseIntoArray(AllowedPlayerIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("AllowedPlayerIds"), AllowedPlayerIdsArray); + } + // Check to see if string is empty + if (request.OfferedInventoryInstanceIds.IsEmpty() || request.OfferedInventoryInstanceIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("OfferedInventoryInstanceIds")); + } else { + TArray OfferedInventoryInstanceIdsArray; + FString(request.OfferedInventoryInstanceIds).ParseIntoArray(OfferedInventoryInstanceIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("OfferedInventoryInstanceIds"), OfferedInventoryInstanceIdsArray); + } + // Check to see if string is empty + if (request.RequestedCatalogItemIds.IsEmpty() || request.RequestedCatalogItemIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("RequestedCatalogItemIds")); + } else { + TArray RequestedCatalogItemIdsArray; + FString(request.RequestedCatalogItemIds).ParseIntoArray(RequestedCatalogItemIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("RequestedCatalogItemIds"), RequestedCatalogItemIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperOpenTrade(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessOpenTrade.IsBound()) + { + FClientOpenTradeResponse result = UPlayFabClientModelDecoder::decodeOpenTradeResponseResponse(response.responseData); + OnSuccessOpenTrade.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabClientAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsSessionTicket && !myResponse.responseError.hasError) + { + // Auth Tokens + auto response = myResponse.responseData->GetObjectField("data"); + pfSettings->setSessionTicket(response->GetStringField("SessionTicket")); + if (response->HasField("EntityToken")) + pfSettings->setEntityToken(response->GetObjectField("EntityToken")->GetStringField("EntityToken")); + + // IDFA Attribution when relevant + bool needsAttribution = myResponse.responseData->GetObjectField("data")->GetBoolField("SessionTicket"); + if (needsAttribution && !pfSettings->getDisableAdvertising() && !pfSettings->getAdvertisingIdType().IsEmpty() && !pfSettings->getAdvertisingIdValue().IsEmpty()) + { + FClientAttributeInstallRequest request; + bool makeAttrCall = true; + if (pfSettings->getAdvertisingIdType() == pfSettings->getAD_TYPE_IDFA()) + request.Idfa = pfSettings->getAdvertisingIdValue(); + else if (pfSettings->getAdvertisingIdType() == pfSettings->getAD_TYPE_ANDROID_ID()) + request.Adid = pfSettings->getAdvertisingIdValue(); + else + makeAttrCall = false; + if (makeAttrCall) + { + FDelegateOnSuccessAttributeInstall onSuccess; + FDelegateOnFailurePlayFabError onFailure; + UPlayFabClientAPI* callObj = AttributeInstall(request, onSuccess, onFailure, mCustomData); + callObj->Activate(); + } + } + } + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabClientAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabClientAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabClientModelDecoder.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabClientModelDecoder.cpp new file mode 100644 index 000000000..0ad0989d6 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabClientModelDecoder.cpp @@ -0,0 +1,1434 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Client +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabClientModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Client API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +FClientAddGenericIDResult UPlayFabClientModelDecoder::decodeAddGenericIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAddGenericIDResult tempStruct; + + + return tempStruct; +} + +FClientAddOrUpdateContactEmailResult UPlayFabClientModelDecoder::decodeAddOrUpdateContactEmailResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAddOrUpdateContactEmailResult tempStruct; + + + return tempStruct; +} + +FClientAddUsernamePasswordResult UPlayFabClientModelDecoder::decodeAddUsernamePasswordResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAddUsernamePasswordResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Username = !(dataObj->HasField("Username")) ? TEXT("") : dataObj->GetStringField("Username"); + + return tempStruct; +} + +FClientGetAccountInfoResult UPlayFabClientModelDecoder::decodeGetAccountInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetAccountInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.AccountInfo = !(dataObj->HasField("AccountInfo")) ? nullptr : dataObj->GetObjectField("AccountInfo"); + + return tempStruct; +} + +FClientGetPlayerCombinedInfoResult UPlayFabClientModelDecoder::decodeGetPlayerCombinedInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerCombinedInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.InfoResultPayload = !(dataObj->HasField("InfoResultPayload")) ? nullptr : dataObj->GetObjectField("InfoResultPayload"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FClientGetPlayerProfileResult UPlayFabClientModelDecoder::decodeGetPlayerProfileResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerProfileResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayerProfile = !(dataObj->HasField("PlayerProfile")) ? nullptr : dataObj->GetObjectField("PlayerProfile"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromFacebookIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromFacebookIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromFacebookIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromFacebookInstantGamesIdsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromFacebookInstantGamesIdsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromFacebookInstantGamesIdsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromGameCenterIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromGameCenterIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromGameCenterIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromGenericIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromGenericIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromGenericIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromGoogleIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromGoogleIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromGoogleIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromKongregateIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromKongregateIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromKongregateIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromNintendoSwitchDeviceIdsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromSteamIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromSteamIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromSteamIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromTwitchIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromTwitchIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromTwitchIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientLinkAndroidDeviceIDResult UPlayFabClientModelDecoder::decodeLinkAndroidDeviceIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkAndroidDeviceIDResult tempStruct; + + + return tempStruct; +} + +FClientLinkCustomIDResult UPlayFabClientModelDecoder::decodeLinkCustomIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkCustomIDResult tempStruct; + + + return tempStruct; +} + +FClientLinkFacebookAccountResult UPlayFabClientModelDecoder::decodeLinkFacebookAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkFacebookAccountResult tempStruct; + + + return tempStruct; +} + +FClientLinkFacebookInstantGamesIdResult UPlayFabClientModelDecoder::decodeLinkFacebookInstantGamesIdResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkFacebookInstantGamesIdResult tempStruct; + + + return tempStruct; +} + +FClientLinkGameCenterAccountResult UPlayFabClientModelDecoder::decodeLinkGameCenterAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkGameCenterAccountResult tempStruct; + + + return tempStruct; +} + +FClientLinkGoogleAccountResult UPlayFabClientModelDecoder::decodeLinkGoogleAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkGoogleAccountResult tempStruct; + + + return tempStruct; +} + +FClientLinkIOSDeviceIDResult UPlayFabClientModelDecoder::decodeLinkIOSDeviceIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkIOSDeviceIDResult tempStruct; + + + return tempStruct; +} + +FClientLinkKongregateAccountResult UPlayFabClientModelDecoder::decodeLinkKongregateAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkKongregateAccountResult tempStruct; + + + return tempStruct; +} + +FClientLinkNintendoSwitchDeviceIdResult UPlayFabClientModelDecoder::decodeLinkNintendoSwitchDeviceIdResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkNintendoSwitchDeviceIdResult tempStruct; + + + return tempStruct; +} + +FClientLinkSteamAccountResult UPlayFabClientModelDecoder::decodeLinkSteamAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkSteamAccountResult tempStruct; + + + return tempStruct; +} + +FClientLinkTwitchAccountResult UPlayFabClientModelDecoder::decodeLinkTwitchAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkTwitchAccountResult tempStruct; + + + return tempStruct; +} + +FClientLinkWindowsHelloAccountResponse UPlayFabClientModelDecoder::decodeLinkWindowsHelloAccountResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkWindowsHelloAccountResponse tempStruct; + + + return tempStruct; +} + +FClientLinkXboxAccountResult UPlayFabClientModelDecoder::decodeLinkXboxAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkXboxAccountResult tempStruct; + + + return tempStruct; +} + +FClientRemoveContactEmailResult UPlayFabClientModelDecoder::decodeRemoveContactEmailResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRemoveContactEmailResult tempStruct; + + + return tempStruct; +} + +FClientRemoveGenericIDResult UPlayFabClientModelDecoder::decodeRemoveGenericIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRemoveGenericIDResult tempStruct; + + + return tempStruct; +} + +FClientReportPlayerClientResult UPlayFabClientModelDecoder::decodeReportPlayerClientResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientReportPlayerClientResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.SubmissionsRemaining = !(dataObj->HasField("SubmissionsRemaining")) ? 0 : int(dataObj->GetNumberField("SubmissionsRemaining")); + + return tempStruct; +} + +FClientSendAccountRecoveryEmailResult UPlayFabClientModelDecoder::decodeSendAccountRecoveryEmailResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientSendAccountRecoveryEmailResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkAndroidDeviceIDResult UPlayFabClientModelDecoder::decodeUnlinkAndroidDeviceIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkAndroidDeviceIDResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkCustomIDResult UPlayFabClientModelDecoder::decodeUnlinkCustomIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkCustomIDResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkFacebookAccountResult UPlayFabClientModelDecoder::decodeUnlinkFacebookAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkFacebookAccountResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkFacebookInstantGamesIdResult UPlayFabClientModelDecoder::decodeUnlinkFacebookInstantGamesIdResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkFacebookInstantGamesIdResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkGameCenterAccountResult UPlayFabClientModelDecoder::decodeUnlinkGameCenterAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkGameCenterAccountResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkGoogleAccountResult UPlayFabClientModelDecoder::decodeUnlinkGoogleAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkGoogleAccountResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkIOSDeviceIDResult UPlayFabClientModelDecoder::decodeUnlinkIOSDeviceIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkIOSDeviceIDResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkKongregateAccountResult UPlayFabClientModelDecoder::decodeUnlinkKongregateAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkKongregateAccountResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkNintendoSwitchDeviceIdResult UPlayFabClientModelDecoder::decodeUnlinkNintendoSwitchDeviceIdResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkNintendoSwitchDeviceIdResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkSteamAccountResult UPlayFabClientModelDecoder::decodeUnlinkSteamAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkSteamAccountResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkTwitchAccountResult UPlayFabClientModelDecoder::decodeUnlinkTwitchAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkTwitchAccountResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkWindowsHelloAccountResponse UPlayFabClientModelDecoder::decodeUnlinkWindowsHelloAccountResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkWindowsHelloAccountResponse tempStruct; + + + return tempStruct; +} + +FClientUnlinkXboxAccountResult UPlayFabClientModelDecoder::decodeUnlinkXboxAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkXboxAccountResult tempStruct; + + + return tempStruct; +} + +FClientEmptyResponse UPlayFabClientModelDecoder::decodeEmptyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientEmptyResponse tempStruct; + + + return tempStruct; +} + +FClientUpdateUserTitleDisplayNameResult UPlayFabClientModelDecoder::decodeUpdateUserTitleDisplayNameResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUpdateUserTitleDisplayNameResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DisplayName = !(dataObj->HasField("DisplayName")) ? TEXT("") : dataObj->GetStringField("DisplayName"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Advertising +////////////////////////////////////////////////////// + +FClientAttributeInstallResult UPlayFabClientModelDecoder::decodeAttributeInstallResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAttributeInstallResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Analytics +////////////////////////////////////////////////////// + +FClientWriteEventResponse UPlayFabClientModelDecoder::decodeWriteEventResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientWriteEventResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.EventId = !(dataObj->HasField("EventId")) ? TEXT("") : dataObj->GetStringField("EventId"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +FClientGetPhotonAuthenticationTokenResult UPlayFabClientModelDecoder::decodeGetPhotonAuthenticationTokenResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPhotonAuthenticationTokenResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PhotonCustomAuthenticationToken = !(dataObj->HasField("PhotonCustomAuthenticationToken")) ? TEXT("") : dataObj->GetStringField("PhotonCustomAuthenticationToken"); + + return tempStruct; +} + +FClientGetTitlePublicKeyResult UPlayFabClientModelDecoder::decodeGetTitlePublicKeyResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetTitlePublicKeyResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.RSAPublicKey = !(dataObj->HasField("RSAPublicKey")) ? TEXT("") : dataObj->GetStringField("RSAPublicKey"); + + return tempStruct; +} + +FClientGetWindowsHelloChallengeResponse UPlayFabClientModelDecoder::decodeGetWindowsHelloChallengeResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetWindowsHelloChallengeResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Challenge = !(dataObj->HasField("Challenge")) ? TEXT("") : dataObj->GetStringField("Challenge"); + + return tempStruct; +} + +FClientLoginResult UPlayFabClientModelDecoder::decodeLoginResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLoginResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.EntityToken = !(dataObj->HasField("EntityToken")) ? nullptr : dataObj->GetObjectField("EntityToken"); + tempStruct.InfoResultPayload = !(dataObj->HasField("InfoResultPayload")) ? nullptr : dataObj->GetObjectField("InfoResultPayload"); + tempStruct.LastLoginTime = !(dataObj->HasField("LastLoginTime")) ? TEXT("") : dataObj->GetStringField("LastLoginTime"); + tempStruct.NewlyCreated = !(dataObj->HasField("NewlyCreated")) ? false : dataObj->GetBoolField("NewlyCreated"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.SessionTicket = !(dataObj->HasField("SessionTicket")) ? TEXT("") : dataObj->GetStringField("SessionTicket"); + tempStruct.SettingsForUser = !(dataObj->HasField("SettingsForUser")) ? nullptr : dataObj->GetObjectField("SettingsForUser"); + + return tempStruct; +} + +FClientRegisterPlayFabUserResult UPlayFabClientModelDecoder::decodeRegisterPlayFabUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRegisterPlayFabUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.EntityToken = !(dataObj->HasField("EntityToken")) ? nullptr : dataObj->GetObjectField("EntityToken"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.SessionTicket = !(dataObj->HasField("SessionTicket")) ? TEXT("") : dataObj->GetStringField("SessionTicket"); + tempStruct.SettingsForUser = !(dataObj->HasField("SettingsForUser")) ? nullptr : dataObj->GetObjectField("SettingsForUser"); + tempStruct.Username = !(dataObj->HasField("Username")) ? TEXT("") : dataObj->GetStringField("Username"); + + return tempStruct; +} + +FClientSetPlayerSecretResult UPlayFabClientModelDecoder::decodeSetPlayerSecretResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientSetPlayerSecretResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Character Data +////////////////////////////////////////////////////// + +FClientGetCharacterDataResult UPlayFabClientModelDecoder::decodeGetCharacterDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetCharacterDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + +FClientUpdateCharacterDataResult UPlayFabClientModelDecoder::decodeUpdateCharacterDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUpdateCharacterDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// + +FClientListUsersCharactersResult UPlayFabClientModelDecoder::decodeListUsersCharactersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientListUsersCharactersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Characters = !(dataObj->HasField("Characters")) ? TArray() : dataObj->GetObjectArrayField("Characters"); + + return tempStruct; +} + +FClientGetCharacterLeaderboardResult UPlayFabClientModelDecoder::decodeGetCharacterLeaderboardResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetCharacterLeaderboardResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + + return tempStruct; +} + +FClientGetCharacterStatisticsResult UPlayFabClientModelDecoder::decodeGetCharacterStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetCharacterStatisticsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterStatistics = !(dataObj->HasField("CharacterStatistics")) ? nullptr : dataObj->GetObjectField("CharacterStatistics"); + + return tempStruct; +} + +FClientGetLeaderboardAroundCharacterResult UPlayFabClientModelDecoder::decodeGetLeaderboardAroundCharacterResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetLeaderboardAroundCharacterResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + + return tempStruct; +} + +FClientGetLeaderboardForUsersCharactersResult UPlayFabClientModelDecoder::decodeGetLeaderboardForUsersCharactersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetLeaderboardForUsersCharactersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + + return tempStruct; +} + +FClientGrantCharacterToUserResult UPlayFabClientModelDecoder::decodeGrantCharacterToUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGrantCharacterToUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + tempStruct.CharacterType = !(dataObj->HasField("CharacterType")) ? TEXT("") : dataObj->GetStringField("CharacterType"); + tempStruct.Result = !(dataObj->HasField("Result")) ? false : dataObj->GetBoolField("Result"); + + return tempStruct; +} + +FClientUpdateCharacterStatisticsResult UPlayFabClientModelDecoder::decodeUpdateCharacterStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUpdateCharacterStatisticsResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// + +FClientGetContentDownloadUrlResult UPlayFabClientModelDecoder::decodeGetContentDownloadUrlResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetContentDownloadUrlResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.URL = !(dataObj->HasField("URL")) ? TEXT("") : dataObj->GetStringField("URL"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Friend List Management +////////////////////////////////////////////////////// + +FClientAddFriendResult UPlayFabClientModelDecoder::decodeAddFriendResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAddFriendResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Created = !(dataObj->HasField("Created")) ? false : dataObj->GetBoolField("Created"); + + return tempStruct; +} + +FClientGetFriendsListResult UPlayFabClientModelDecoder::decodeGetFriendsListResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetFriendsListResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Friends = !(dataObj->HasField("Friends")) ? TArray() : dataObj->GetObjectArrayField("Friends"); + + return tempStruct; +} + +FClientRemoveFriendResult UPlayFabClientModelDecoder::decodeRemoveFriendResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRemoveFriendResult tempStruct; + + + return tempStruct; +} + +FClientSetFriendTagsResult UPlayFabClientModelDecoder::decodeSetFriendTagsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientSetFriendTagsResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +FClientCurrentGamesResult UPlayFabClientModelDecoder::decodeCurrentGamesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientCurrentGamesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GameCount = !(dataObj->HasField("GameCount")) ? 0 : int(dataObj->GetNumberField("GameCount")); + tempStruct.Games = !(dataObj->HasField("Games")) ? TArray() : dataObj->GetObjectArrayField("Games"); + tempStruct.PlayerCount = !(dataObj->HasField("PlayerCount")) ? 0 : int(dataObj->GetNumberField("PlayerCount")); + + return tempStruct; +} + +FClientGameServerRegionsResult UPlayFabClientModelDecoder::decodeGameServerRegionsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGameServerRegionsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Regions = !(dataObj->HasField("Regions")) ? TArray() : dataObj->GetObjectArrayField("Regions"); + + return tempStruct; +} + +FClientMatchmakeResult UPlayFabClientModelDecoder::decodeMatchmakeResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientMatchmakeResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Expires = !(dataObj->HasField("Expires")) ? TEXT("") : dataObj->GetStringField("Expires"); + tempStruct.LobbyID = !(dataObj->HasField("LobbyID")) ? TEXT("") : dataObj->GetStringField("LobbyID"); + tempStruct.PollWaitTimeMS = !(dataObj->HasField("PollWaitTimeMS")) ? 0 : int(dataObj->GetNumberField("PollWaitTimeMS")); + tempStruct.ServerHostname = !(dataObj->HasField("ServerHostname")) ? TEXT("") : dataObj->GetStringField("ServerHostname"); + tempStruct.ServerIPV4Address = !(dataObj->HasField("ServerIPV4Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV4Address"); + tempStruct.ServerIPV6Address = !(dataObj->HasField("ServerIPV6Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV6Address"); + tempStruct.ServerPort = !(dataObj->HasField("ServerPort")) ? 0 : int(dataObj->GetNumberField("ServerPort")); + tempStruct.ServerPublicDNSName = !(dataObj->HasField("ServerPublicDNSName")) ? TEXT("") : dataObj->GetStringField("ServerPublicDNSName"); + GetEnumValueFromString(TEXT("EMatchmakeStatus"), dataObj->GetStringField("Status"), tempStruct.Status); + tempStruct.Ticket = !(dataObj->HasField("Ticket")) ? TEXT("") : dataObj->GetStringField("Ticket"); + + return tempStruct; +} + +FClientStartGameResult UPlayFabClientModelDecoder::decodeStartGameResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientStartGameResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Expires = !(dataObj->HasField("Expires")) ? TEXT("") : dataObj->GetStringField("Expires"); + tempStruct.LobbyID = !(dataObj->HasField("LobbyID")) ? TEXT("") : dataObj->GetStringField("LobbyID"); + tempStruct.Password = !(dataObj->HasField("Password")) ? TEXT("") : dataObj->GetStringField("Password"); + tempStruct.ServerHostname = !(dataObj->HasField("ServerHostname")) ? TEXT("") : dataObj->GetStringField("ServerHostname"); + tempStruct.ServerIPV4Address = !(dataObj->HasField("ServerIPV4Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV4Address"); + tempStruct.ServerIPV6Address = !(dataObj->HasField("ServerIPV6Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV6Address"); + tempStruct.ServerPort = !(dataObj->HasField("ServerPort")) ? 0 : int(dataObj->GetNumberField("ServerPort")); + tempStruct.ServerPublicDNSName = !(dataObj->HasField("ServerPublicDNSName")) ? TEXT("") : dataObj->GetStringField("ServerPublicDNSName"); + tempStruct.Ticket = !(dataObj->HasField("Ticket")) ? TEXT("") : dataObj->GetStringField("Ticket"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Platform Specific Methods +////////////////////////////////////////////////////// + +FClientAndroidDevicePushNotificationRegistrationResult UPlayFabClientModelDecoder::decodeAndroidDevicePushNotificationRegistrationResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAndroidDevicePushNotificationRegistrationResult tempStruct; + + + return tempStruct; +} + +FClientConsumeXboxEntitlementsResult UPlayFabClientModelDecoder::decodeConsumeXboxEntitlementsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientConsumeXboxEntitlementsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Items = !(dataObj->HasField("Items")) ? TArray() : dataObj->GetObjectArrayField("Items"); + + return tempStruct; +} + +FClientRegisterForIOSPushNotificationResult UPlayFabClientModelDecoder::decodeRegisterForIOSPushNotificationResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRegisterForIOSPushNotificationResult tempStruct; + + + return tempStruct; +} + +FClientRestoreIOSPurchasesResult UPlayFabClientModelDecoder::decodeRestoreIOSPurchasesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRestoreIOSPurchasesResult tempStruct; + + + return tempStruct; +} + +FClientValidateAmazonReceiptResult UPlayFabClientModelDecoder::decodeValidateAmazonReceiptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientValidateAmazonReceiptResult tempStruct; + + + return tempStruct; +} + +FClientValidateGooglePlayPurchaseResult UPlayFabClientModelDecoder::decodeValidateGooglePlayPurchaseResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientValidateGooglePlayPurchaseResult tempStruct; + + + return tempStruct; +} + +FClientValidateIOSReceiptResult UPlayFabClientModelDecoder::decodeValidateIOSReceiptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientValidateIOSReceiptResult tempStruct; + + + return tempStruct; +} + +FClientValidateWindowsReceiptResult UPlayFabClientModelDecoder::decodeValidateWindowsReceiptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientValidateWindowsReceiptResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// + +FClientGetLeaderboardResult UPlayFabClientModelDecoder::decodeGetLeaderboardResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetLeaderboardResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + tempStruct.NextReset = !(dataObj->HasField("NextReset")) ? TEXT("") : dataObj->GetStringField("NextReset"); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + +FClientGetFriendLeaderboardAroundPlayerResult UPlayFabClientModelDecoder::decodeGetFriendLeaderboardAroundPlayerResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetFriendLeaderboardAroundPlayerResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + tempStruct.NextReset = !(dataObj->HasField("NextReset")) ? TEXT("") : dataObj->GetStringField("NextReset"); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + +FClientGetLeaderboardAroundPlayerResult UPlayFabClientModelDecoder::decodeGetLeaderboardAroundPlayerResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetLeaderboardAroundPlayerResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + tempStruct.NextReset = !(dataObj->HasField("NextReset")) ? TEXT("") : dataObj->GetStringField("NextReset"); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + +FClientGetPlayerStatisticsResult UPlayFabClientModelDecoder::decodeGetPlayerStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerStatisticsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Statistics = !(dataObj->HasField("Statistics")) ? TArray() : dataObj->GetObjectArrayField("Statistics"); + + return tempStruct; +} + +FClientGetPlayerStatisticVersionsResult UPlayFabClientModelDecoder::decodeGetPlayerStatisticVersionsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerStatisticVersionsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.StatisticVersions = !(dataObj->HasField("StatisticVersions")) ? TArray() : dataObj->GetObjectArrayField("StatisticVersions"); + + return tempStruct; +} + +FClientGetUserDataResult UPlayFabClientModelDecoder::decodeGetUserDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetUserDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + +FClientUpdatePlayerStatisticsResult UPlayFabClientModelDecoder::decodeUpdatePlayerStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUpdatePlayerStatisticsResult tempStruct; + + + return tempStruct; +} + +FClientUpdateUserDataResult UPlayFabClientModelDecoder::decodeUpdateUserDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUpdateUserDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// + +FClientModifyUserVirtualCurrencyResult UPlayFabClientModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientModifyUserVirtualCurrencyResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Balance = !(dataObj->HasField("Balance")) ? 0 : int(dataObj->GetNumberField("Balance")); + tempStruct.BalanceChange = !(dataObj->HasField("BalanceChange")) ? 0 : int(dataObj->GetNumberField("BalanceChange")); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? TEXT("") : dataObj->GetStringField("VirtualCurrency"); + + return tempStruct; +} + +FClientConfirmPurchaseResult UPlayFabClientModelDecoder::decodeConfirmPurchaseResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientConfirmPurchaseResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Items = !(dataObj->HasField("Items")) ? TArray() : dataObj->GetObjectArrayField("Items"); + tempStruct.OrderId = !(dataObj->HasField("OrderId")) ? TEXT("") : dataObj->GetStringField("OrderId"); + tempStruct.PurchaseDate = !(dataObj->HasField("PurchaseDate")) ? TEXT("") : dataObj->GetStringField("PurchaseDate"); + + return tempStruct; +} + +FClientConsumeItemResult UPlayFabClientModelDecoder::decodeConsumeItemResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientConsumeItemResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemInstanceId = !(dataObj->HasField("ItemInstanceId")) ? TEXT("") : dataObj->GetStringField("ItemInstanceId"); + tempStruct.RemainingUses = !(dataObj->HasField("RemainingUses")) ? 0 : int(dataObj->GetNumberField("RemainingUses")); + + return tempStruct; +} + +FClientGetCharacterInventoryResult UPlayFabClientModelDecoder::decodeGetCharacterInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetCharacterInventoryResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + tempStruct.Inventory = !(dataObj->HasField("Inventory")) ? TArray() : dataObj->GetObjectArrayField("Inventory"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + tempStruct.VirtualCurrencyRechargeTimes = !(dataObj->HasField("VirtualCurrencyRechargeTimes")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyRechargeTimes"); + + return tempStruct; +} + +FClientGetPaymentTokenResult UPlayFabClientModelDecoder::decodeGetPaymentTokenResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPaymentTokenResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.OrderId = !(dataObj->HasField("OrderId")) ? TEXT("") : dataObj->GetStringField("OrderId"); + tempStruct.ProviderToken = !(dataObj->HasField("ProviderToken")) ? TEXT("") : dataObj->GetStringField("ProviderToken"); + + return tempStruct; +} + +FClientGetPurchaseResult UPlayFabClientModelDecoder::decodeGetPurchaseResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPurchaseResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.OrderId = !(dataObj->HasField("OrderId")) ? TEXT("") : dataObj->GetStringField("OrderId"); + tempStruct.PaymentProvider = !(dataObj->HasField("PaymentProvider")) ? TEXT("") : dataObj->GetStringField("PaymentProvider"); + tempStruct.PurchaseDate = !(dataObj->HasField("PurchaseDate")) ? TEXT("") : dataObj->GetStringField("PurchaseDate"); + tempStruct.TransactionId = !(dataObj->HasField("TransactionId")) ? TEXT("") : dataObj->GetStringField("TransactionId"); + tempStruct.TransactionStatus = !(dataObj->HasField("TransactionStatus")) ? TEXT("") : dataObj->GetStringField("TransactionStatus"); + + return tempStruct; +} + +FClientGetUserInventoryResult UPlayFabClientModelDecoder::decodeGetUserInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetUserInventoryResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Inventory = !(dataObj->HasField("Inventory")) ? TArray() : dataObj->GetObjectArrayField("Inventory"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + tempStruct.VirtualCurrencyRechargeTimes = !(dataObj->HasField("VirtualCurrencyRechargeTimes")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyRechargeTimes"); + + return tempStruct; +} + +FClientPayForPurchaseResult UPlayFabClientModelDecoder::decodePayForPurchaseResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientPayForPurchaseResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CreditApplied = !(dataObj->HasField("CreditApplied")) ? 0 : int(dataObj->GetNumberField("CreditApplied")); + tempStruct.OrderId = !(dataObj->HasField("OrderId")) ? TEXT("") : dataObj->GetStringField("OrderId"); + tempStruct.ProviderData = !(dataObj->HasField("ProviderData")) ? TEXT("") : dataObj->GetStringField("ProviderData"); + tempStruct.ProviderToken = !(dataObj->HasField("ProviderToken")) ? TEXT("") : dataObj->GetStringField("ProviderToken"); + tempStruct.PurchaseConfirmationPageURL = !(dataObj->HasField("PurchaseConfirmationPageURL")) ? TEXT("") : dataObj->GetStringField("PurchaseConfirmationPageURL"); + tempStruct.PurchaseCurrency = !(dataObj->HasField("PurchaseCurrency")) ? TEXT("") : dataObj->GetStringField("PurchaseCurrency"); + tempStruct.PurchasePrice = !(dataObj->HasField("PurchasePrice")) ? 0 : int(dataObj->GetNumberField("PurchasePrice")); + GetEnumValueFromString(TEXT("ETransactionStatus"), dataObj->GetStringField("Status"), tempStruct.Status); + tempStruct.VCAmount = !(dataObj->HasField("VCAmount")) ? nullptr : dataObj->GetObjectField("VCAmount"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + + return tempStruct; +} + +FClientPurchaseItemResult UPlayFabClientModelDecoder::decodePurchaseItemResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientPurchaseItemResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Items = !(dataObj->HasField("Items")) ? TArray() : dataObj->GetObjectArrayField("Items"); + + return tempStruct; +} + +FClientRedeemCouponResult UPlayFabClientModelDecoder::decodeRedeemCouponResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRedeemCouponResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GrantedItems = !(dataObj->HasField("GrantedItems")) ? TArray() : dataObj->GetObjectArrayField("GrantedItems"); + + return tempStruct; +} + +FClientStartPurchaseResult UPlayFabClientModelDecoder::decodeStartPurchaseResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientStartPurchaseResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Contents = !(dataObj->HasField("Contents")) ? TArray() : dataObj->GetObjectArrayField("Contents"); + tempStruct.OrderId = !(dataObj->HasField("OrderId")) ? TEXT("") : dataObj->GetStringField("OrderId"); + tempStruct.PaymentOptions = !(dataObj->HasField("PaymentOptions")) ? TArray() : dataObj->GetObjectArrayField("PaymentOptions"); + tempStruct.VirtualCurrencyBalances = !(dataObj->HasField("VirtualCurrencyBalances")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyBalances"); + + return tempStruct; +} + +FClientUnlockContainerItemResult UPlayFabClientModelDecoder::decodeUnlockContainerItemResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlockContainerItemResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GrantedItems = !(dataObj->HasField("GrantedItems")) ? TArray() : dataObj->GetObjectArrayField("GrantedItems"); + tempStruct.UnlockedItemInstanceId = !(dataObj->HasField("UnlockedItemInstanceId")) ? TEXT("") : dataObj->GetStringField("UnlockedItemInstanceId"); + tempStruct.UnlockedWithItemInstanceId = !(dataObj->HasField("UnlockedWithItemInstanceId")) ? TEXT("") : dataObj->GetStringField("UnlockedWithItemInstanceId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// + +FClientGetPlayerSegmentsResult UPlayFabClientModelDecoder::decodeGetPlayerSegmentsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerSegmentsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Segments = !(dataObj->HasField("Segments")) ? TArray() : dataObj->GetObjectArrayField("Segments"); + + return tempStruct; +} + +FClientGetPlayerTagsResult UPlayFabClientModelDecoder::decodeGetPlayerTagsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerTagsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.Tags = !(dataObj->HasField("Tags")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("Tags"), TEXT(",")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +FClientExecuteCloudScriptResult UPlayFabClientModelDecoder::decodeExecuteCloudScriptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientExecuteCloudScriptResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.APIRequestsIssued = !(dataObj->HasField("APIRequestsIssued")) ? 0 : int(dataObj->GetNumberField("APIRequestsIssued")); + tempStruct.Error = !(dataObj->HasField("Error")) ? nullptr : dataObj->GetObjectField("Error"); + tempStruct.ExecutionTimeSeconds = !(dataObj->HasField("ExecutionTimeSeconds")) ? 0 : int(dataObj->GetNumberField("ExecutionTimeSeconds")); + tempStruct.FunctionName = !(dataObj->HasField("FunctionName")) ? TEXT("") : dataObj->GetStringField("FunctionName"); + tempStruct.FunctionResult = !(dataObj->HasField("FunctionResult")) ? nullptr : dataObj->GetObjectField("FunctionResult"); + tempStruct.FunctionResultTooLarge = !(dataObj->HasField("FunctionResultTooLarge")) ? false : dataObj->GetBoolField("FunctionResultTooLarge"); + tempStruct.HttpRequestsIssued = !(dataObj->HasField("HttpRequestsIssued")) ? 0 : int(dataObj->GetNumberField("HttpRequestsIssued")); + tempStruct.Logs = !(dataObj->HasField("Logs")) ? TArray() : dataObj->GetObjectArrayField("Logs"); + tempStruct.LogsTooLarge = !(dataObj->HasField("LogsTooLarge")) ? false : dataObj->GetBoolField("LogsTooLarge"); + tempStruct.MemoryConsumedBytes = !(dataObj->HasField("MemoryConsumedBytes")) ? 0 : int(dataObj->GetNumberField("MemoryConsumedBytes")); + tempStruct.ProcessorTimeSeconds = !(dataObj->HasField("ProcessorTimeSeconds")) ? 0 : int(dataObj->GetNumberField("ProcessorTimeSeconds")); + tempStruct.Revision = !(dataObj->HasField("Revision")) ? 0 : int(dataObj->GetNumberField("Revision")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// + +FClientAddSharedGroupMembersResult UPlayFabClientModelDecoder::decodeAddSharedGroupMembersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAddSharedGroupMembersResult tempStruct; + + + return tempStruct; +} + +FClientCreateSharedGroupResult UPlayFabClientModelDecoder::decodeCreateSharedGroupResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientCreateSharedGroupResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.SharedGroupId = !(dataObj->HasField("SharedGroupId")) ? TEXT("") : dataObj->GetStringField("SharedGroupId"); + + return tempStruct; +} + +FClientGetSharedGroupDataResult UPlayFabClientModelDecoder::decodeGetSharedGroupDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetSharedGroupDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.Members = !(dataObj->HasField("Members")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("Members"), TEXT(",")); + + return tempStruct; +} + +FClientRemoveSharedGroupMembersResult UPlayFabClientModelDecoder::decodeRemoveSharedGroupMembersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRemoveSharedGroupMembersResult tempStruct; + + + return tempStruct; +} + +FClientUpdateSharedGroupDataResult UPlayFabClientModelDecoder::decodeUpdateSharedGroupDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUpdateSharedGroupDataResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// + +FClientGetCatalogItemsResult UPlayFabClientModelDecoder::decodeGetCatalogItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetCatalogItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Catalog = !(dataObj->HasField("Catalog")) ? TArray() : dataObj->GetObjectArrayField("Catalog"); + + return tempStruct; +} + +FClientGetPublisherDataResult UPlayFabClientModelDecoder::decodeGetPublisherDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPublisherDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + + return tempStruct; +} + +FClientGetStoreItemsResult UPlayFabClientModelDecoder::decodeGetStoreItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetStoreItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CatalogVersion = !(dataObj->HasField("CatalogVersion")) ? TEXT("") : dataObj->GetStringField("CatalogVersion"); + tempStruct.MarketingData = !(dataObj->HasField("MarketingData")) ? nullptr : dataObj->GetObjectField("MarketingData"); + GetEnumValueFromString(TEXT("EPfSourceType"), dataObj->GetStringField("Source"), tempStruct.Source); + tempStruct.Store = !(dataObj->HasField("Store")) ? TArray() : dataObj->GetObjectArrayField("Store"); + tempStruct.StoreId = !(dataObj->HasField("StoreId")) ? TEXT("") : dataObj->GetStringField("StoreId"); + + return tempStruct; +} + +FClientGetTimeResult UPlayFabClientModelDecoder::decodeGetTimeResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetTimeResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Time = !(dataObj->HasField("Time")) ? TEXT("") : dataObj->GetStringField("Time"); + + return tempStruct; +} + +FClientGetTitleDataResult UPlayFabClientModelDecoder::decodeGetTitleDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetTitleDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + + return tempStruct; +} + +FClientGetTitleNewsResult UPlayFabClientModelDecoder::decodeGetTitleNewsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetTitleNewsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.News = !(dataObj->HasField("News")) ? TArray() : dataObj->GetObjectArrayField("News"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Trading +////////////////////////////////////////////////////// + +FClientAcceptTradeResponse UPlayFabClientModelDecoder::decodeAcceptTradeResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAcceptTradeResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Trade = !(dataObj->HasField("Trade")) ? nullptr : dataObj->GetObjectField("Trade"); + + return tempStruct; +} + +FClientCancelTradeResponse UPlayFabClientModelDecoder::decodeCancelTradeResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientCancelTradeResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Trade = !(dataObj->HasField("Trade")) ? nullptr : dataObj->GetObjectField("Trade"); + + return tempStruct; +} + +FClientGetPlayerTradesResponse UPlayFabClientModelDecoder::decodeGetPlayerTradesResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerTradesResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.AcceptedTrades = !(dataObj->HasField("AcceptedTrades")) ? TArray() : dataObj->GetObjectArrayField("AcceptedTrades"); + tempStruct.OpenedTrades = !(dataObj->HasField("OpenedTrades")) ? TArray() : dataObj->GetObjectArrayField("OpenedTrades"); + + return tempStruct; +} + +FClientGetTradeStatusResponse UPlayFabClientModelDecoder::decodeGetTradeStatusResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetTradeStatusResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Trade = !(dataObj->HasField("Trade")) ? nullptr : dataObj->GetObjectField("Trade"); + + return tempStruct; +} + +FClientOpenTradeResponse UPlayFabClientModelDecoder::decodeOpenTradeResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientOpenTradeResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Trade = !(dataObj->HasField("Trade")) ? nullptr : dataObj->GetObjectField("Trade"); + + return tempStruct; +} + + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabClientModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabClientModels.cpp new file mode 100644 index 000000000..18f32c944 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabClientModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Client +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabClientModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptAPI.cpp new file mode 100644 index 000000000..1dec889be --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptAPI.cpp @@ -0,0 +1,247 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: CloudScript +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabCloudScriptAPI.h" +#include "PlayFabCloudScriptModels.h" +#include "PlayFabCloudScriptModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabCloudScriptAPI::UPlayFabCloudScriptAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabCloudScriptAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabCloudScriptAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabCloudScriptAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab CloudScript API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// +/** Cloud Script is one of PlayFab's most versatile features. It allows client code to request execution of any kind of custom server-side functionality you can implement, and it can be used in conjunction with virtually anything. */ +UPlayFabCloudScriptAPI* UPlayFabCloudScriptAPI::ExecuteEntityCloudScript(FCloudScriptExecuteEntityCloudScriptRequest request, + FDelegateOnSuccessExecuteEntityCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabCloudScriptAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessExecuteEntityCloudScript = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabCloudScriptAPI::HelperExecuteEntityCloudScript); + + // Setup the request + manager->PlayFabRequestURL = "/CloudScript/ExecuteEntityCloudScript"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.FunctionName.IsEmpty() || request.FunctionName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FunctionName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FunctionName"), request.FunctionName); + } + if (request.FunctionParameter != nullptr) OutRestJsonObj->SetObjectField(TEXT("FunctionParameter"), request.FunctionParameter); + OutRestJsonObj->SetBoolField(TEXT("GeneratePlayStreamEvent"), request.GeneratePlayStreamEvent); + FString temp_RevisionSelection; + if (GetEnumValueToString(TEXT("ECloudScriptRevisionOption"), request.RevisionSelection, temp_RevisionSelection)) + OutRestJsonObj->SetStringField(TEXT("RevisionSelection"), temp_RevisionSelection); + OutRestJsonObj->SetNumberField(TEXT("SpecificRevision"), request.SpecificRevision); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabCloudScriptRequestCompleted +void UPlayFabCloudScriptAPI::HelperExecuteEntityCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessExecuteEntityCloudScript.IsBound()) + { + FCloudScriptExecuteCloudScriptResult result = UPlayFabCloudScriptModelDecoder::decodeExecuteCloudScriptResultResponse(response.responseData); + OnSuccessExecuteEntityCloudScript.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabCloudScriptAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabCloudScriptAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabCloudScriptAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabCloudScriptAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptModelDecoder.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptModelDecoder.cpp new file mode 100644 index 000000000..c97fe86d6 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptModelDecoder.cpp @@ -0,0 +1,46 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: CloudScript +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabCloudScriptModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab CloudScript API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +FCloudScriptExecuteCloudScriptResult UPlayFabCloudScriptModelDecoder::decodeExecuteCloudScriptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FCloudScriptExecuteCloudScriptResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.APIRequestsIssued = !(dataObj->HasField("APIRequestsIssued")) ? 0 : int(dataObj->GetNumberField("APIRequestsIssued")); + tempStruct.Error = !(dataObj->HasField("Error")) ? nullptr : dataObj->GetObjectField("Error"); + tempStruct.ExecutionTimeSeconds = !(dataObj->HasField("ExecutionTimeSeconds")) ? 0 : int(dataObj->GetNumberField("ExecutionTimeSeconds")); + tempStruct.FunctionName = !(dataObj->HasField("FunctionName")) ? TEXT("") : dataObj->GetStringField("FunctionName"); + tempStruct.FunctionResult = !(dataObj->HasField("FunctionResult")) ? nullptr : dataObj->GetObjectField("FunctionResult"); + tempStruct.FunctionResultTooLarge = !(dataObj->HasField("FunctionResultTooLarge")) ? false : dataObj->GetBoolField("FunctionResultTooLarge"); + tempStruct.HttpRequestsIssued = !(dataObj->HasField("HttpRequestsIssued")) ? 0 : int(dataObj->GetNumberField("HttpRequestsIssued")); + tempStruct.Logs = !(dataObj->HasField("Logs")) ? TArray() : dataObj->GetObjectArrayField("Logs"); + tempStruct.LogsTooLarge = !(dataObj->HasField("LogsTooLarge")) ? false : dataObj->GetBoolField("LogsTooLarge"); + tempStruct.MemoryConsumedBytes = !(dataObj->HasField("MemoryConsumedBytes")) ? 0 : int(dataObj->GetNumberField("MemoryConsumedBytes")); + tempStruct.ProcessorTimeSeconds = !(dataObj->HasField("ProcessorTimeSeconds")) ? 0 : int(dataObj->GetNumberField("ProcessorTimeSeconds")); + tempStruct.Revision = !(dataObj->HasField("Revision")) ? 0 : int(dataObj->GetNumberField("Revision")); + + return tempStruct; +} + + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptModels.cpp new file mode 100644 index 000000000..34034c003 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: CloudScript +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabCloudScriptModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabDataAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabDataAPI.cpp new file mode 100644 index 000000000..16310fd05 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabDataAPI.cpp @@ -0,0 +1,558 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Data +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabDataAPI.h" +#include "PlayFabDataModels.h" +#include "PlayFabDataModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabDataAPI::UPlayFabDataAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabDataAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabDataAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabDataAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Data API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// File +////////////////////////////////////////////////////// +/** Abort pending file uploads to an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::AbortFileUploads(FDataAbortFileUploadsRequest request, + FDelegateOnSuccessAbortFileUploads onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAbortFileUploads = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperAbortFileUploads); + + // Setup the request + manager->PlayFabRequestURL = "/File/AbortFileUploads"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + // Check to see if string is empty + if (request.FileNames.IsEmpty() || request.FileNames == "") { + OutRestJsonObj->SetFieldNull(TEXT("FileNames")); + } else { + TArray FileNamesArray; + FString(request.FileNames).ParseIntoArray(FileNamesArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FileNames"), FileNamesArray); + } + OutRestJsonObj->SetNumberField(TEXT("ProfileVersion"), request.ProfileVersion); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperAbortFileUploads(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAbortFileUploads.IsBound()) + { + FDataAbortFileUploadsResponse result = UPlayFabDataModelDecoder::decodeAbortFileUploadsResponseResponse(response.responseData); + OnSuccessAbortFileUploads.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Delete files on an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::DeleteFiles(FDataDeleteFilesRequest request, + FDelegateOnSuccessDeleteFiles onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteFiles = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperDeleteFiles); + + // Setup the request + manager->PlayFabRequestURL = "/File/DeleteFiles"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + // Check to see if string is empty + if (request.FileNames.IsEmpty() || request.FileNames == "") { + OutRestJsonObj->SetFieldNull(TEXT("FileNames")); + } else { + TArray FileNamesArray; + FString(request.FileNames).ParseIntoArray(FileNamesArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FileNames"), FileNamesArray); + } + OutRestJsonObj->SetNumberField(TEXT("ProfileVersion"), request.ProfileVersion); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperDeleteFiles(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteFiles.IsBound()) + { + FDataDeleteFilesResponse result = UPlayFabDataModelDecoder::decodeDeleteFilesResponseResponse(response.responseData); + OnSuccessDeleteFiles.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Finalize file uploads to an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::FinalizeFileUploads(FDataFinalizeFileUploadsRequest request, + FDelegateOnSuccessFinalizeFileUploads onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessFinalizeFileUploads = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperFinalizeFileUploads); + + // Setup the request + manager->PlayFabRequestURL = "/File/FinalizeFileUploads"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + // Check to see if string is empty + if (request.FileNames.IsEmpty() || request.FileNames == "") { + OutRestJsonObj->SetFieldNull(TEXT("FileNames")); + } else { + TArray FileNamesArray; + FString(request.FileNames).ParseIntoArray(FileNamesArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FileNames"), FileNamesArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperFinalizeFileUploads(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessFinalizeFileUploads.IsBound()) + { + FDataFinalizeFileUploadsResponse result = UPlayFabDataModelDecoder::decodeFinalizeFileUploadsResponseResponse(response.responseData); + OnSuccessFinalizeFileUploads.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves file metadata from an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::GetFiles(FDataGetFilesRequest request, + FDelegateOnSuccessGetFiles onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetFiles = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperGetFiles); + + // Setup the request + manager->PlayFabRequestURL = "/File/GetFiles"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperGetFiles(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetFiles.IsBound()) + { + FDataGetFilesResponse result = UPlayFabDataModelDecoder::decodeGetFilesResponseResponse(response.responseData); + OnSuccessGetFiles.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Initiates file uploads to an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::InitiateFileUploads(FDataInitiateFileUploadsRequest request, + FDelegateOnSuccessInitiateFileUploads onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessInitiateFileUploads = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperInitiateFileUploads); + + // Setup the request + manager->PlayFabRequestURL = "/File/InitiateFileUploads"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + // Check to see if string is empty + if (request.FileNames.IsEmpty() || request.FileNames == "") { + OutRestJsonObj->SetFieldNull(TEXT("FileNames")); + } else { + TArray FileNamesArray; + FString(request.FileNames).ParseIntoArray(FileNamesArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FileNames"), FileNamesArray); + } + OutRestJsonObj->SetNumberField(TEXT("ProfileVersion"), request.ProfileVersion); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperInitiateFileUploads(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessInitiateFileUploads.IsBound()) + { + FDataInitiateFileUploadsResponse result = UPlayFabDataModelDecoder::decodeInitiateFileUploadsResponseResponse(response.responseData); + OnSuccessInitiateFileUploads.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Object +////////////////////////////////////////////////////// +/** Retrieves objects from an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::GetObjects(FDataGetObjectsRequest request, + FDelegateOnSuccessGetObjects onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetObjects = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperGetObjects); + + // Setup the request + manager->PlayFabRequestURL = "/Object/GetObjects"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + OutRestJsonObj->SetBoolField(TEXT("EscapeObject"), request.EscapeObject); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperGetObjects(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetObjects.IsBound()) + { + FDataGetObjectsResponse result = UPlayFabDataModelDecoder::decodeGetObjectsResponseResponse(response.responseData); + OnSuccessGetObjects.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets objects on an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::SetObjects(FDataSetObjectsRequest request, + FDelegateOnSuccessSetObjects onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetObjects = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperSetObjects); + + // Setup the request + manager->PlayFabRequestURL = "/Object/SetObjects"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + OutRestJsonObj->SetNumberField(TEXT("ExpectedProfileVersion"), request.ExpectedProfileVersion); + if (request.Objects.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Objects")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Objects"), request.Objects); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperSetObjects(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetObjects.IsBound()) + { + FDataSetObjectsResponse result = UPlayFabDataModelDecoder::decodeSetObjectsResponseResponse(response.responseData); + OnSuccessSetObjects.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabDataAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabDataAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabDataAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabDataModelDecoder.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabDataModelDecoder.cpp new file mode 100644 index 000000000..3d698daee --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabDataModelDecoder.cpp @@ -0,0 +1,118 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Data +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabDataModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Data API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// File +////////////////////////////////////////////////////// + +FDataAbortFileUploadsResponse UPlayFabDataModelDecoder::decodeAbortFileUploadsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataAbortFileUploadsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + + return tempStruct; +} + +FDataDeleteFilesResponse UPlayFabDataModelDecoder::decodeDeleteFilesResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataDeleteFilesResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + + return tempStruct; +} + +FDataFinalizeFileUploadsResponse UPlayFabDataModelDecoder::decodeFinalizeFileUploadsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataFinalizeFileUploadsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.Metadata = !(dataObj->HasField("Metadata")) ? nullptr : dataObj->GetObjectField("Metadata"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + + return tempStruct; +} + +FDataGetFilesResponse UPlayFabDataModelDecoder::decodeGetFilesResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataGetFilesResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.Metadata = !(dataObj->HasField("Metadata")) ? nullptr : dataObj->GetObjectField("Metadata"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + + return tempStruct; +} + +FDataInitiateFileUploadsResponse UPlayFabDataModelDecoder::decodeInitiateFileUploadsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataInitiateFileUploadsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + tempStruct.UploadDetails = !(dataObj->HasField("UploadDetails")) ? TArray() : dataObj->GetObjectArrayField("UploadDetails"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Object +////////////////////////////////////////////////////// + +FDataGetObjectsResponse UPlayFabDataModelDecoder::decodeGetObjectsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataGetObjectsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.Objects = !(dataObj->HasField("Objects")) ? nullptr : dataObj->GetObjectField("Objects"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + + return tempStruct; +} + +FDataSetObjectsResponse UPlayFabDataModelDecoder::decodeSetObjectsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataSetObjectsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + tempStruct.SetResults = !(dataObj->HasField("SetResults")) ? TArray() : dataObj->GetObjectArrayField("SetResults"); + + return tempStruct; +} + + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabDataModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabDataModels.cpp new file mode 100644 index 000000000..ac6a72388 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabDataModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Data +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabDataModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabEventsAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabEventsAPI.cpp new file mode 100644 index 000000000..f6d950a0a --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabEventsAPI.cpp @@ -0,0 +1,240 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Events +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabEventsAPI.h" +#include "PlayFabEventsModels.h" +#include "PlayFabEventsModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabEventsAPI::UPlayFabEventsAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabEventsAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabEventsAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabEventsAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Events API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// PlayStream Events +////////////////////////////////////////////////////// +/** Write batches of entity based events to PlayStream. */ +UPlayFabEventsAPI* UPlayFabEventsAPI::WriteEvents(FEventsWriteEventsRequest request, + FDelegateOnSuccessWriteEvents onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabEventsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWriteEvents = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabEventsAPI::HelperWriteEvents); + + // Setup the request + manager->PlayFabRequestURL = "/Event/WriteEvents"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Events.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Events")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Events"), request.Events); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabEventsRequestCompleted +void UPlayFabEventsAPI::HelperWriteEvents(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWriteEvents.IsBound()) + { + FEventsWriteEventsResponse result = UPlayFabEventsModelDecoder::decodeWriteEventsResponseResponse(response.responseData); + OnSuccessWriteEvents.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabEventsAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabEventsAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabEventsAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabEventsAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabEventsModelDecoder.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabEventsModelDecoder.cpp new file mode 100644 index 000000000..02bdf7f21 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabEventsModelDecoder.cpp @@ -0,0 +1,35 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Events +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabEventsModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Events API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// PlayStream Events +////////////////////////////////////////////////////// + +FEventsWriteEventsResponse UPlayFabEventsModelDecoder::decodeWriteEventsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FEventsWriteEventsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.AssignedEventIds = !(dataObj->HasField("AssignedEventIds")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("AssignedEventIds"), TEXT(",")); + + return tempStruct; +} + + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabEventsModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabEventsModels.cpp new file mode 100644 index 000000000..bdc11df91 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabEventsModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Events +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabEventsModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabGroupsAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabGroupsAPI.cpp new file mode 100644 index 000000000..49086353a --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabGroupsAPI.cpp @@ -0,0 +1,1448 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Groups +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabGroupsAPI.h" +#include "PlayFabGroupsModels.h" +#include "PlayFabGroupsModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabGroupsAPI::UPlayFabGroupsAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabGroupsAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabGroupsAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabGroupsAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Groups API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Groups +////////////////////////////////////////////////////// +/** Accepts an outstanding invitation to to join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::AcceptGroupApplication(FGroupsAcceptGroupApplicationRequest request, + FDelegateOnSuccessAcceptGroupApplication onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAcceptGroupApplication = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperAcceptGroupApplication); + + // Setup the request + manager->PlayFabRequestURL = "/Group/AcceptGroupApplication"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperAcceptGroupApplication(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAcceptGroupApplication.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessAcceptGroupApplication.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Accepts an invitation to join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::AcceptGroupInvitation(FGroupsAcceptGroupInvitationRequest request, + FDelegateOnSuccessAcceptGroupInvitation onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAcceptGroupInvitation = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperAcceptGroupInvitation); + + // Setup the request + manager->PlayFabRequestURL = "/Group/AcceptGroupInvitation"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperAcceptGroupInvitation(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAcceptGroupInvitation.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessAcceptGroupInvitation.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds members to a group or role. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::AddMembers(FGroupsAddMembersRequest request, + FDelegateOnSuccessAddMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperAddMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Group/AddMembers"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.Members.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Members")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Members"), request.Members); + } + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperAddMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddMembers.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessAddMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Applies to join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ApplyToGroup(FGroupsApplyToGroupRequest request, + FDelegateOnSuccessApplyToGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessApplyToGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperApplyToGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ApplyToGroup"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("AutoAcceptOutstandingInvite"), request.AutoAcceptOutstandingInvite); + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperApplyToGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessApplyToGroup.IsBound()) + { + FGroupsApplyToGroupResponse result = UPlayFabGroupsModelDecoder::decodeApplyToGroupResponseResponse(response.responseData); + OnSuccessApplyToGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Blocks a list of entities from joining a group. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::BlockEntity(FGroupsBlockEntityRequest request, + FDelegateOnSuccessBlockEntity onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessBlockEntity = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperBlockEntity); + + // Setup the request + manager->PlayFabRequestURL = "/Group/BlockEntity"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperBlockEntity(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessBlockEntity.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessBlockEntity.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Changes the role membership of a list of entities from one role to another. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ChangeMemberRole(FGroupsChangeMemberRoleRequest request, + FDelegateOnSuccessChangeMemberRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessChangeMemberRole = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperChangeMemberRole); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ChangeMemberRole"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.DestinationRoleId.IsEmpty() || request.DestinationRoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("DestinationRoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("DestinationRoleId"), request.DestinationRoleId); + } + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.Members.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Members")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Members"), request.Members); + } + if (request.OriginRoleId.IsEmpty() || request.OriginRoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OriginRoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OriginRoleId"), request.OriginRoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperChangeMemberRole(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessChangeMemberRole.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessChangeMemberRole.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates a new group. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::CreateGroup(FGroupsCreateGroupRequest request, + FDelegateOnSuccessCreateGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreateGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperCreateGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Group/CreateGroup"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.GroupName.IsEmpty() || request.GroupName == "") { + OutRestJsonObj->SetFieldNull(TEXT("GroupName")); + } else { + OutRestJsonObj->SetStringField(TEXT("GroupName"), request.GroupName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperCreateGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreateGroup.IsBound()) + { + FGroupsCreateGroupResponse result = UPlayFabGroupsModelDecoder::decodeCreateGroupResponseResponse(response.responseData); + OnSuccessCreateGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates a new group role. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::CreateRole(FGroupsCreateGroupRoleRequest request, + FDelegateOnSuccessCreateRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreateRole = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperCreateRole); + + // Setup the request + manager->PlayFabRequestURL = "/Group/CreateRole"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + if (request.RoleName.IsEmpty() || request.RoleName == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleName")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleName"), request.RoleName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperCreateRole(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreateRole.IsBound()) + { + FGroupsCreateGroupRoleResponse result = UPlayFabGroupsModelDecoder::decodeCreateGroupRoleResponseResponse(response.responseData); + OnSuccessCreateRole.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Deletes a group and all roles, invitations, join requests, and blocks associated with it. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::DeleteGroup(FGroupsDeleteGroupRequest request, + FDelegateOnSuccessDeleteGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperDeleteGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Group/DeleteGroup"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperDeleteGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteGroup.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessDeleteGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Deletes an existing role in a group. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::DeleteRole(FGroupsDeleteRoleRequest request, + FDelegateOnSuccessDeleteRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteRole = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperDeleteRole); + + // Setup the request + manager->PlayFabRequestURL = "/Group/DeleteRole"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperDeleteRole(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteRole.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessDeleteRole.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets information about a group and its roles */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::GetGroup(FGroupsGetGroupRequest request, + FDelegateOnSuccessGetGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperGetGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Group/GetGroup"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.GroupName.IsEmpty() || request.GroupName == "") { + OutRestJsonObj->SetFieldNull(TEXT("GroupName")); + } else { + OutRestJsonObj->SetStringField(TEXT("GroupName"), request.GroupName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperGetGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetGroup.IsBound()) + { + FGroupsGetGroupResponse result = UPlayFabGroupsModelDecoder::decodeGetGroupResponseResponse(response.responseData); + OnSuccessGetGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Invites a player to join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::InviteToGroup(FGroupsInviteToGroupRequest request, + FDelegateOnSuccessInviteToGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessInviteToGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperInviteToGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Group/InviteToGroup"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("AutoAcceptOutstandingApplication"), request.AutoAcceptOutstandingApplication); + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperInviteToGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessInviteToGroup.IsBound()) + { + FGroupsInviteToGroupResponse result = UPlayFabGroupsModelDecoder::decodeInviteToGroupResponseResponse(response.responseData); + OnSuccessInviteToGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Checks to see if an entity is a member of a group or role within the group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::IsMember(FGroupsIsMemberRequest request, + FDelegateOnSuccessIsMember onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessIsMember = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperIsMember); + + // Setup the request + manager->PlayFabRequestURL = "/Group/IsMember"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperIsMember(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessIsMember.IsBound()) + { + FGroupsIsMemberResponse result = UPlayFabGroupsModelDecoder::decodeIsMemberResponseResponse(response.responseData); + OnSuccessIsMember.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all outstanding requests to join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ListGroupApplications(FGroupsListGroupApplicationsRequest request, + FDelegateOnSuccessListGroupApplications onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListGroupApplications = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperListGroupApplications); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ListGroupApplications"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperListGroupApplications(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListGroupApplications.IsBound()) + { + FGroupsListGroupApplicationsResponse result = UPlayFabGroupsModelDecoder::decodeListGroupApplicationsResponseResponse(response.responseData); + OnSuccessListGroupApplications.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all entities blocked from joining a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ListGroupBlocks(FGroupsListGroupBlocksRequest request, + FDelegateOnSuccessListGroupBlocks onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListGroupBlocks = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperListGroupBlocks); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ListGroupBlocks"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperListGroupBlocks(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListGroupBlocks.IsBound()) + { + FGroupsListGroupBlocksResponse result = UPlayFabGroupsModelDecoder::decodeListGroupBlocksResponseResponse(response.responseData); + OnSuccessListGroupBlocks.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all outstanding invitations for a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ListGroupInvitations(FGroupsListGroupInvitationsRequest request, + FDelegateOnSuccessListGroupInvitations onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListGroupInvitations = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperListGroupInvitations); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ListGroupInvitations"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperListGroupInvitations(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListGroupInvitations.IsBound()) + { + FGroupsListGroupInvitationsResponse result = UPlayFabGroupsModelDecoder::decodeListGroupInvitationsResponseResponse(response.responseData); + OnSuccessListGroupInvitations.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all members for a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ListGroupMembers(FGroupsListGroupMembersRequest request, + FDelegateOnSuccessListGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListGroupMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperListGroupMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ListGroupMembers"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperListGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListGroupMembers.IsBound()) + { + FGroupsListGroupMembersResponse result = UPlayFabGroupsModelDecoder::decodeListGroupMembersResponseResponse(response.responseData); + OnSuccessListGroupMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all groups and roles for an entity */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ListMembership(FGroupsListMembershipRequest request, + FDelegateOnSuccessListMembership onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListMembership = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperListMembership); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ListMembership"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperListMembership(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListMembership.IsBound()) + { + FGroupsListMembershipResponse result = UPlayFabGroupsModelDecoder::decodeListMembershipResponseResponse(response.responseData); + OnSuccessListMembership.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all outstanding invitations and group applications for an entity */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ListMembershipOpportunities(FGroupsListMembershipOpportunitiesRequest request, + FDelegateOnSuccessListMembershipOpportunities onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListMembershipOpportunities = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperListMembershipOpportunities); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ListMembershipOpportunities"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperListMembershipOpportunities(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListMembershipOpportunities.IsBound()) + { + FGroupsListMembershipOpportunitiesResponse result = UPlayFabGroupsModelDecoder::decodeListMembershipOpportunitiesResponseResponse(response.responseData); + OnSuccessListMembershipOpportunities.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes an application to join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::RemoveGroupApplication(FGroupsRemoveGroupApplicationRequest request, + FDelegateOnSuccessRemoveGroupApplication onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveGroupApplication = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperRemoveGroupApplication); + + // Setup the request + manager->PlayFabRequestURL = "/Group/RemoveGroupApplication"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperRemoveGroupApplication(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveGroupApplication.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessRemoveGroupApplication.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes an invitation join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::RemoveGroupInvitation(FGroupsRemoveGroupInvitationRequest request, + FDelegateOnSuccessRemoveGroupInvitation onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveGroupInvitation = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperRemoveGroupInvitation); + + // Setup the request + manager->PlayFabRequestURL = "/Group/RemoveGroupInvitation"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperRemoveGroupInvitation(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveGroupInvitation.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessRemoveGroupInvitation.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes members from a group. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::RemoveMembers(FGroupsRemoveMembersRequest request, + FDelegateOnSuccessRemoveMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperRemoveMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Group/RemoveMembers"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.Members.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Members")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Members"), request.Members); + } + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperRemoveMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveMembers.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessRemoveMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unblocks a list of entities from joining a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::UnblockEntity(FGroupsUnblockEntityRequest request, + FDelegateOnSuccessUnblockEntity onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnblockEntity = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperUnblockEntity); + + // Setup the request + manager->PlayFabRequestURL = "/Group/UnblockEntity"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperUnblockEntity(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnblockEntity.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessUnblockEntity.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates non-membership data about a group. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::UpdateGroup(FGroupsUpdateGroupRequest request, + FDelegateOnSuccessUpdateGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperUpdateGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Group/UpdateGroup"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.AdminRoleId.IsEmpty() || request.AdminRoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("AdminRoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("AdminRoleId"), request.AdminRoleId); + } + OutRestJsonObj->SetNumberField(TEXT("ExpectedProfileVersion"), request.ExpectedProfileVersion); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.GroupName.IsEmpty() || request.GroupName == "") { + OutRestJsonObj->SetFieldNull(TEXT("GroupName")); + } else { + OutRestJsonObj->SetStringField(TEXT("GroupName"), request.GroupName); + } + if (request.MemberRoleId.IsEmpty() || request.MemberRoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("MemberRoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("MemberRoleId"), request.MemberRoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperUpdateGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateGroup.IsBound()) + { + FGroupsUpdateGroupResponse result = UPlayFabGroupsModelDecoder::decodeUpdateGroupResponseResponse(response.responseData); + OnSuccessUpdateGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates metadata about a role. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::UpdateRole(FGroupsUpdateGroupRoleRequest request, + FDelegateOnSuccessUpdateRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateRole = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperUpdateRole); + + // Setup the request + manager->PlayFabRequestURL = "/Group/UpdateRole"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("ExpectedProfileVersion"), request.ExpectedProfileVersion); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + if (request.RoleName.IsEmpty() || request.RoleName == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleName")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleName"), request.RoleName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperUpdateRole(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateRole.IsBound()) + { + FGroupsUpdateGroupRoleResponse result = UPlayFabGroupsModelDecoder::decodeUpdateGroupRoleResponseResponse(response.responseData); + OnSuccessUpdateRole.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabGroupsAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabGroupsAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabGroupsAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabGroupsModelDecoder.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabGroupsModelDecoder.cpp new file mode 100644 index 000000000..eb297ea64 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabGroupsModelDecoder.cpp @@ -0,0 +1,212 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Groups +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabGroupsModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Groups API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Groups +////////////////////////////////////////////////////// + +FGroupsEmptyResponse UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsEmptyResponse tempStruct; + + + return tempStruct; +} + +FGroupsApplyToGroupResponse UPlayFabGroupsModelDecoder::decodeApplyToGroupResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsApplyToGroupResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.Expires = !(dataObj->HasField("Expires")) ? TEXT("") : dataObj->GetStringField("Expires"); + tempStruct.Group = !(dataObj->HasField("Group")) ? nullptr : dataObj->GetObjectField("Group"); + + return tempStruct; +} + +FGroupsCreateGroupResponse UPlayFabGroupsModelDecoder::decodeCreateGroupResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsCreateGroupResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.AdminRoleId = !(dataObj->HasField("AdminRoleId")) ? TEXT("") : dataObj->GetStringField("AdminRoleId"); + tempStruct.Created = !(dataObj->HasField("Created")) ? TEXT("") : dataObj->GetStringField("Created"); + tempStruct.Group = !(dataObj->HasField("Group")) ? nullptr : dataObj->GetObjectField("Group"); + tempStruct.GroupName = !(dataObj->HasField("GroupName")) ? TEXT("") : dataObj->GetStringField("GroupName"); + tempStruct.MemberRoleId = !(dataObj->HasField("MemberRoleId")) ? TEXT("") : dataObj->GetStringField("MemberRoleId"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + tempStruct.Roles = !(dataObj->HasField("Roles")) ? nullptr : dataObj->GetObjectField("Roles"); + + return tempStruct; +} + +FGroupsCreateGroupRoleResponse UPlayFabGroupsModelDecoder::decodeCreateGroupRoleResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsCreateGroupRoleResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + tempStruct.RoleId = !(dataObj->HasField("RoleId")) ? TEXT("") : dataObj->GetStringField("RoleId"); + tempStruct.RoleName = !(dataObj->HasField("RoleName")) ? TEXT("") : dataObj->GetStringField("RoleName"); + + return tempStruct; +} + +FGroupsGetGroupResponse UPlayFabGroupsModelDecoder::decodeGetGroupResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsGetGroupResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.AdminRoleId = !(dataObj->HasField("AdminRoleId")) ? TEXT("") : dataObj->GetStringField("AdminRoleId"); + tempStruct.Created = !(dataObj->HasField("Created")) ? TEXT("") : dataObj->GetStringField("Created"); + tempStruct.Group = !(dataObj->HasField("Group")) ? nullptr : dataObj->GetObjectField("Group"); + tempStruct.GroupName = !(dataObj->HasField("GroupName")) ? TEXT("") : dataObj->GetStringField("GroupName"); + tempStruct.MemberRoleId = !(dataObj->HasField("MemberRoleId")) ? TEXT("") : dataObj->GetStringField("MemberRoleId"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + tempStruct.Roles = !(dataObj->HasField("Roles")) ? nullptr : dataObj->GetObjectField("Roles"); + + return tempStruct; +} + +FGroupsInviteToGroupResponse UPlayFabGroupsModelDecoder::decodeInviteToGroupResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsInviteToGroupResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Expires = !(dataObj->HasField("Expires")) ? TEXT("") : dataObj->GetStringField("Expires"); + tempStruct.Group = !(dataObj->HasField("Group")) ? nullptr : dataObj->GetObjectField("Group"); + tempStruct.InvitedByEntity = !(dataObj->HasField("InvitedByEntity")) ? nullptr : dataObj->GetObjectField("InvitedByEntity"); + tempStruct.InvitedEntity = !(dataObj->HasField("InvitedEntity")) ? nullptr : dataObj->GetObjectField("InvitedEntity"); + tempStruct.RoleId = !(dataObj->HasField("RoleId")) ? TEXT("") : dataObj->GetStringField("RoleId"); + + return tempStruct; +} + +FGroupsIsMemberResponse UPlayFabGroupsModelDecoder::decodeIsMemberResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsIsMemberResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.IsMember = !(dataObj->HasField("IsMember")) ? false : dataObj->GetBoolField("IsMember"); + + return tempStruct; +} + +FGroupsListGroupApplicationsResponse UPlayFabGroupsModelDecoder::decodeListGroupApplicationsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsListGroupApplicationsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Applications = !(dataObj->HasField("Applications")) ? TArray() : dataObj->GetObjectArrayField("Applications"); + + return tempStruct; +} + +FGroupsListGroupBlocksResponse UPlayFabGroupsModelDecoder::decodeListGroupBlocksResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsListGroupBlocksResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BlockedEntities = !(dataObj->HasField("BlockedEntities")) ? TArray() : dataObj->GetObjectArrayField("BlockedEntities"); + + return tempStruct; +} + +FGroupsListGroupInvitationsResponse UPlayFabGroupsModelDecoder::decodeListGroupInvitationsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsListGroupInvitationsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Invitations = !(dataObj->HasField("Invitations")) ? TArray() : dataObj->GetObjectArrayField("Invitations"); + + return tempStruct; +} + +FGroupsListGroupMembersResponse UPlayFabGroupsModelDecoder::decodeListGroupMembersResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsListGroupMembersResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Members = !(dataObj->HasField("Members")) ? TArray() : dataObj->GetObjectArrayField("Members"); + + return tempStruct; +} + +FGroupsListMembershipResponse UPlayFabGroupsModelDecoder::decodeListMembershipResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsListMembershipResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Groups = !(dataObj->HasField("Groups")) ? TArray() : dataObj->GetObjectArrayField("Groups"); + + return tempStruct; +} + +FGroupsListMembershipOpportunitiesResponse UPlayFabGroupsModelDecoder::decodeListMembershipOpportunitiesResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsListMembershipOpportunitiesResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Applications = !(dataObj->HasField("Applications")) ? TArray() : dataObj->GetObjectArrayField("Applications"); + tempStruct.Invitations = !(dataObj->HasField("Invitations")) ? TArray() : dataObj->GetObjectArrayField("Invitations"); + + return tempStruct; +} + +FGroupsUpdateGroupResponse UPlayFabGroupsModelDecoder::decodeUpdateGroupResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsUpdateGroupResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.OperationReason = !(dataObj->HasField("OperationReason")) ? TEXT("") : dataObj->GetStringField("OperationReason"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + GetEnumValueFromString(TEXT("EOperationTypes"), dataObj->GetStringField("SetResult"), tempStruct.SetResult); + + return tempStruct; +} + +FGroupsUpdateGroupRoleResponse UPlayFabGroupsModelDecoder::decodeUpdateGroupRoleResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsUpdateGroupRoleResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.OperationReason = !(dataObj->HasField("OperationReason")) ? TEXT("") : dataObj->GetStringField("OperationReason"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + GetEnumValueFromString(TEXT("EOperationTypes"), dataObj->GetStringField("SetResult"), tempStruct.SetResult); + + return tempStruct; +} + + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabGroupsModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabGroupsModels.cpp new file mode 100644 index 000000000..d99c0b6a4 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabGroupsModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Groups +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabGroupsModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabJsonObject.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabJsonObject.cpp new file mode 100644 index 000000000..46db52485 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabJsonObject.cpp @@ -0,0 +1,481 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// JSon Objects +// These are used as a wrapper for the internal json objects. +// Originally wriiten by Vladimir Alyamkin. +// Updated by Joshua Lyons to include null values +//////////////////////////////////////////////////////////// + +#include "PlayFabJsonObject.h" +#include "PlayFabJsonValue.h" +#include "PlayFabPrivate.h" + +typedef TJsonWriterFactory< TCHAR, TCondensedJsonPrintPolicy > FCondensedJsonStringWriterFactory; +typedef TJsonWriter< TCHAR, TCondensedJsonPrintPolicy > FCondensedJsonStringWriter; + +UPlayFabJsonObject::UPlayFabJsonObject(const class FObjectInitializer& PCIP) + : Super(PCIP) +{ + Reset(); +} + +UPlayFabJsonObject* UPlayFabJsonObject::ConstructJsonObject(UObject* WorldContextObject) +{ + return NewObject(); +} + +void UPlayFabJsonObject::Reset() +{ + if (JsonObj.IsValid()) + { + JsonObj.Reset(); + } + + JsonObj = MakeShareable(new FJsonObject()); +} + +TSharedPtr& UPlayFabJsonObject::GetRootObject() +{ + return JsonObj; +} + +void UPlayFabJsonObject::SetRootObject(TSharedPtr& JsonObject) +{ + JsonObj = JsonObject; +} + + +////////////////////////////////////////////////////////////////////////// +// Serialization + +FString UPlayFabJsonObject::EncodeJson() const +{ + if (!JsonObj.IsValid()) + { + return TEXT(""); + } + + FString OutputString; + TSharedRef< FCondensedJsonStringWriter > Writer = FCondensedJsonStringWriterFactory::Create(&OutputString); + FJsonSerializer::Serialize(JsonObj.ToSharedRef(), Writer); + + return OutputString; +} + +bool UPlayFabJsonObject::DecodeJson(const FString& JsonString) +{ + TSharedRef< TJsonReader<> > Reader = TJsonReaderFactory<>::Create(*JsonString); + if (FJsonSerializer::Deserialize(Reader, JsonObj) && JsonObj.IsValid()) + { + return true; + } + + // If we've failed to deserialize the string, we should clear our internal data + Reset(); + + UE_LOG(LogPlayFab, Error, TEXT("Json decoding failed for: %s"), *JsonString); + + return false; +} + + +////////////////////////////////////////////////////////////////////////// +// FJsonObject API + +TArray UPlayFabJsonObject::GetFieldNames() +{ + TArray Result; + + if (!JsonObj.IsValid()) + { + return Result; + } + + JsonObj->Values.GetKeys(Result); + + return Result; +} + +bool UPlayFabJsonObject::HasField(const FString& FieldName) const +{ + if (!JsonObj.IsValid()) + { + return false; + } + + return JsonObj->HasField(FieldName); +} + +void UPlayFabJsonObject::RemoveField(const FString& FieldName) +{ + if (!JsonObj.IsValid()) + { + return; + } + + JsonObj->RemoveField(FieldName); +} + +UPlayFabJsonValue* UPlayFabJsonObject::GetField(const FString& FieldName) const +{ + if (!JsonObj.IsValid()) + { + return nullptr; + } + + TSharedPtr NewVal = JsonObj->TryGetField(FieldName); + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +void UPlayFabJsonObject::SetField(const FString& FieldName, UPlayFabJsonValue* JsonValue) +{ + if (!JsonObj.IsValid()) + { + return; + } + + JsonObj->SetField(FieldName, JsonValue->GetRootValue()); +} + +void UPlayFabJsonObject::SetFieldNull(const FString& FieldName) +{ + if (!JsonObj.IsValid()) + { + return; + } + + TSharedPtr myNull = MakeShareable(new FJsonValueNull()); + + JsonObj->SetField(FieldName, myNull); +} + +////////////////////////////////////////////////////////////////////////// +// FJsonObject API Helpers (easy to use with simple Json objects) + +float UPlayFabJsonObject::GetNumberField(const FString& FieldName) const +{ + if (!JsonObj.IsValid()) + { + return 0.0f; + } + + return JsonObj->GetNumberField(FieldName); +} + +void UPlayFabJsonObject::SetNumberField(const FString& FieldName, float Number) +{ + if (!JsonObj.IsValid()) + { + return; + } + + JsonObj->SetNumberField(FieldName, Number); +} + +FString UPlayFabJsonObject::GetStringField(const FString& FieldName) const +{ + if (!JsonObj.IsValid()) + { + return TEXT(""); + } + + return JsonObj->GetStringField(FieldName); +} + +void UPlayFabJsonObject::SetStringField(const FString& FieldName, const FString& StringValue) +{ + if (!JsonObj.IsValid()) + { + return; + } + + JsonObj->SetStringField(FieldName, StringValue); +} + +bool UPlayFabJsonObject::GetBoolField(const FString& FieldName) const +{ + if (!JsonObj.IsValid()) + { + return false; + } + + return JsonObj->GetBoolField(FieldName); +} + +void UPlayFabJsonObject::SetBoolField(const FString& FieldName, bool InValue) +{ + if (!JsonObj.IsValid()) + { + return; + } + + JsonObj->SetBoolField(FieldName, InValue); +} + +TArray UPlayFabJsonObject::GetArrayField(const FString& FieldName) +{ + TArray OutArray; + if (!JsonObj.IsValid()) + { + return OutArray; + } + + TArray< TSharedPtr > ValArray = JsonObj->GetArrayField(FieldName); + for (auto Value : ValArray) + { + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(Value); + + OutArray.Add(NewValue); + } + + return OutArray; +} + +void UPlayFabJsonObject::SetArrayField(const FString& FieldName, const TArray& InArray) +{ + if (!JsonObj.IsValid()) + { + return; + } + + TArray< TSharedPtr > ValArray; + + // Process input array and COPY original values + for (auto InVal : InArray) + { + TSharedPtr JsonVal = InVal->GetRootValue(); + + switch (InVal->GetType()) + { + case EPFJson::None: + break; + + case EPFJson::Null: + ValArray.Add(MakeShareable(new FJsonValueNull())); + break; + + case EPFJson::String: + ValArray.Add(MakeShareable(new FJsonValueString(JsonVal->AsString()))); + break; + + case EPFJson::Number: + ValArray.Add(MakeShareable(new FJsonValueNumber(JsonVal->AsNumber()))); + break; + + case EPFJson::Boolean: + ValArray.Add(MakeShareable(new FJsonValueBoolean(JsonVal->AsBool()))); + break; + + case EPFJson::Array: + ValArray.Add(MakeShareable(new FJsonValueArray(JsonVal->AsArray()))); + break; + + case EPFJson::Object: + ValArray.Add(MakeShareable(new FJsonValueObject(JsonVal->AsObject()))); + break; + + default: + break; + } + } + + JsonObj->SetArrayField(FieldName, ValArray); +} + +void UPlayFabJsonObject::MergeJsonObject(UPlayFabJsonObject* InJsonObject, bool Overwrite) +{ + TArray Keys = InJsonObject->GetFieldNames(); + + for (auto Key : Keys) + { + if (Overwrite == false && HasField(Key)) + { + continue; + } + + SetField(Key, InJsonObject->GetField(Key)); + } +} + +UPlayFabJsonObject* UPlayFabJsonObject::GetObjectField(const FString& FieldName) const +{ + if (!JsonObj.IsValid()) + { + return nullptr; + } + + TSharedPtr JsonObjField = JsonObj->GetObjectField(FieldName); + + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + OutRestJsonObj->SetRootObject(JsonObjField); + + return OutRestJsonObj; +} + +void UPlayFabJsonObject::SetObjectField(const FString& FieldName, UPlayFabJsonObject* JsonObject) +{ + if (!JsonObj.IsValid()) + { + return; + } + + JsonObj->SetObjectField(FieldName, JsonObject->GetRootObject()); +} + + +////////////////////////////////////////////////////////////////////////// +// Array fields helpers (uniform arrays) + +TArray UPlayFabJsonObject::GetNumberArrayField(const FString& FieldName) +{ + TArray NumberArray; + + if (!JsonObj.IsValid()) + { + return NumberArray; + } + + TArray > JsonArrayValues = JsonObj->GetArrayField(FieldName); + for (TArray >::TConstIterator It(JsonArrayValues); It; ++It) + { + NumberArray.Add((*It)->AsNumber()); + } + + return NumberArray; +} + +void UPlayFabJsonObject::SetNumberArrayField(const FString& FieldName, const TArray& NumberArray) +{ + if (!JsonObj.IsValid()) + { + return; + } + + TArray< TSharedPtr > EntriesArray; + + for (auto Number : NumberArray) + { + EntriesArray.Add(MakeShareable(new FJsonValueNumber(Number))); + } + + JsonObj->SetArrayField(FieldName, EntriesArray); +} + +TArray UPlayFabJsonObject::GetStringArrayField(const FString& FieldName) +{ + TArray StringArray; + + if (!JsonObj.IsValid()) + { + return StringArray; + } + + TArray > JsonArrayValues = JsonObj->GetArrayField(FieldName); + for (TArray >::TConstIterator It(JsonArrayValues); It; ++It) + { + StringArray.Add((*It)->AsString()); + } + + return StringArray; +} + +void UPlayFabJsonObject::SetStringArrayField(const FString& FieldName, const TArray& StringArray) +{ + if (!JsonObj.IsValid()) + { + return; + } + + TArray< TSharedPtr > EntriesArray; + + for (auto String : StringArray) + { + EntriesArray.Add(MakeShareable(new FJsonValueString(String))); + } + + JsonObj->SetArrayField(FieldName, EntriesArray); +} + +TArray UPlayFabJsonObject::GetBoolArrayField(const FString& FieldName) +{ + TArray BoolArray; + + if (!JsonObj.IsValid()) + { + return BoolArray; + } + + TArray > JsonArrayValues = JsonObj->GetArrayField(FieldName); + for (TArray >::TConstIterator It(JsonArrayValues); It; ++It) + { + BoolArray.Add((*It)->AsBool()); + } + + return BoolArray; +} + +void UPlayFabJsonObject::SetBoolArrayField(const FString& FieldName, const TArray& BoolArray) +{ + if (!JsonObj.IsValid()) + { + return; + } + + TArray< TSharedPtr > EntriesArray; + + for (auto Boolean : BoolArray) + { + EntriesArray.Add(MakeShareable(new FJsonValueBoolean(Boolean))); + } + + JsonObj->SetArrayField(FieldName, EntriesArray); +} + +TArray UPlayFabJsonObject::GetObjectArrayField(const FString& FieldName) +{ + TArray OutArray; + + if (!JsonObj.IsValid()) + { + return OutArray; + } + + TArray< TSharedPtr > ValArray = JsonObj->GetArrayField(FieldName); + for (auto Value : ValArray) + { + TSharedPtr NewObj = Value->AsObject(); + + UPlayFabJsonObject* NewJson = NewObject(); + NewJson->SetRootObject(NewObj); + + OutArray.Add(NewJson); + } + + return OutArray; +} + +void UPlayFabJsonObject::SetObjectArrayField(const FString& FieldName, const TArray& ObjectArray) +{ + if (!JsonObj.IsValid()) + { + return; + } + + TArray< TSharedPtr > EntriesArray; + + for (auto Value : ObjectArray) + { + EntriesArray.Add(MakeShareable(new FJsonValueObject(Value->GetRootObject()))); + } + + JsonObj->SetArrayField(FieldName, EntriesArray); +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabJsonValue.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabJsonValue.cpp new file mode 100644 index 000000000..dc5ca91e4 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabJsonValue.cpp @@ -0,0 +1,263 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// JSon Values +// These are used as a wrapper for the internal json values. +// Originally wriiten by Vladimir Alyamkin. +//////////////////////////////////////////////////////////// + +#include "PlayFabJsonValue.h" +#include "PlayFabJsonObject.h" +#include "PlayFabPrivate.h" +#include "CoreMinimal.h" + + +UPlayFabJsonValue::UPlayFabJsonValue(const class FObjectInitializer& PCIP) + : Super(PCIP) +{ + +} + +UPlayFabJsonValue* UPlayFabJsonValue::ConstructJsonValueNumber(UObject* WorldContextObject, float Number) +{ + TSharedPtr NewVal = MakeShareable(new FJsonValueNumber(Number)); + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +UPlayFabJsonValue* UPlayFabJsonValue::ConstructJsonValueString(UObject* WorldContextObject, const FString& StringValue) +{ + TSharedPtr NewVal = MakeShareable(new FJsonValueString(StringValue)); + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +UPlayFabJsonValue* UPlayFabJsonValue::ConstructJsonValueBool(UObject* WorldContextObject, bool InValue) +{ + TSharedPtr NewVal = MakeShareable(new FJsonValueBoolean(InValue)); + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +UPlayFabJsonValue* UPlayFabJsonValue::ConstructJsonValueArray(UObject* WorldContextObject, const TArray& InArray) +{ + // Prepare data array to create new value + TArray< TSharedPtr > ValueArray; + for (auto InVal : InArray) + { + ValueArray.Add(InVal->GetRootValue()); + } + + TSharedPtr NewVal = MakeShareable(new FJsonValueArray(ValueArray)); + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +UPlayFabJsonValue* UPlayFabJsonValue::ConstructJsonValueObject(UObject* WorldContextObject, UPlayFabJsonObject *JsonObject) +{ + TSharedPtr NewVal = MakeShareable(new FJsonValueObject(JsonObject->GetRootObject())); + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +UPlayFabJsonValue* ConstructJsonValue(UObject* WorldContextObject, const TSharedPtr& InValue) +{ + TSharedPtr NewVal = InValue; + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +TSharedPtr& UPlayFabJsonValue::GetRootValue() +{ + return JsonVal; +} + +void UPlayFabJsonValue::SetRootValue(TSharedPtr& JsonValue) +{ + JsonVal = JsonValue; +} + + +////////////////////////////////////////////////////////////////////////// +// FJsonValue API + +EPFJson::Type UPlayFabJsonValue::GetType() const +{ + if (!JsonVal.IsValid()) + { + return EPFJson::None; + } + + switch (JsonVal->Type) + { + case EJson::None: + return EPFJson::None; + + case EJson::Null: + return EPFJson::Null; + + case EJson::String: + return EPFJson::String; + + case EJson::Number: + return EPFJson::Number; + + case EJson::Boolean: + return EPFJson::Boolean; + + case EJson::Array: + return EPFJson::Array; + + case EJson::Object: + return EPFJson::Object; + + default: + return EPFJson::None; + } +} + +FString UPlayFabJsonValue::GetTypeString() const +{ + if (!JsonVal.IsValid()) + { + return "None"; + } + + switch (JsonVal->Type) + { + case EJson::None: + return TEXT("None"); + + case EJson::Null: + return TEXT("Null"); + + case EJson::String: + return TEXT("String"); + + case EJson::Number: + return TEXT("Number"); + + case EJson::Boolean: + return TEXT("Boolean"); + + case EJson::Array: + return TEXT("Array"); + + case EJson::Object: + return TEXT("Object"); + + default: + return TEXT("None"); + } +} + +bool UPlayFabJsonValue::IsNull() const +{ + if (!JsonVal.IsValid()) + { + return true; + } + + return JsonVal->IsNull(); +} + +float UPlayFabJsonValue::AsNumber() const +{ + if (!JsonVal.IsValid()) + { + ErrorMessage(TEXT("Number")); + return 0.f; + } + + return JsonVal->AsNumber(); +} + +FString UPlayFabJsonValue::AsString() const +{ + if (!JsonVal.IsValid()) + { + ErrorMessage(TEXT("String")); + return FString(); + } + + return JsonVal->AsString(); +} + +bool UPlayFabJsonValue::AsBool() const +{ + if (!JsonVal.IsValid()) + { + ErrorMessage(TEXT("Boolean")); + return false; + } + + return JsonVal->AsBool(); +} + +TArray UPlayFabJsonValue::AsArray() const +{ + TArray OutArray; + + if (!JsonVal.IsValid()) + { + ErrorMessage(TEXT("Array")); + return OutArray; + } + + TArray< TSharedPtr > ValArray = JsonVal->AsArray(); + for (auto Value : ValArray) + { + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(Value); + + OutArray.Add(NewValue); + } + + return OutArray; +} + +UPlayFabJsonObject* UPlayFabJsonValue::AsObject() +{ + if (!JsonVal.IsValid()) + { + ErrorMessage(TEXT("Object")); + return nullptr; + } + + TSharedPtr NewObj = JsonVal->AsObject(); + + UPlayFabJsonObject* JsonObj = NewObject(); + JsonObj->SetRootObject(NewObj); + + return JsonObj; +} + + +////////////////////////////////////////////////////////////////////////// +// Helpers + +void UPlayFabJsonValue::ErrorMessage(const FString& InType) const +{ + UE_LOG(LogPlayFab, Error, TEXT("Json Value of type '%s' used as a '%s'."), *GetTypeString(), *InType); +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabLocalizationAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabLocalizationAPI.cpp new file mode 100644 index 000000000..0c3584d27 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabLocalizationAPI.cpp @@ -0,0 +1,235 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Localization +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabLocalizationAPI.h" +#include "PlayFabLocalizationModels.h" +#include "PlayFabLocalizationModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabLocalizationAPI::UPlayFabLocalizationAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabLocalizationAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabLocalizationAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabLocalizationAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Localization API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Localization +////////////////////////////////////////////////////// +/** Retrieves the list of allowed languages, only accessible by title entities */ +UPlayFabLocalizationAPI* UPlayFabLocalizationAPI::GetLanguageList(FLocalizationGetLanguageListRequest request, + FDelegateOnSuccessGetLanguageList onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabLocalizationAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLanguageList = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabLocalizationAPI::HelperGetLanguageList); + + // Setup the request + manager->PlayFabRequestURL = "/Locale/GetLanguageList"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabLocalizationRequestCompleted +void UPlayFabLocalizationAPI::HelperGetLanguageList(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLanguageList.IsBound()) + { + FLocalizationGetLanguageListResponse result = UPlayFabLocalizationModelDecoder::decodeGetLanguageListResponseResponse(response.responseData); + OnSuccessGetLanguageList.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabLocalizationAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabLocalizationAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabLocalizationAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabLocalizationAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabLocalizationModelDecoder.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabLocalizationModelDecoder.cpp new file mode 100644 index 000000000..dfbda3496 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabLocalizationModelDecoder.cpp @@ -0,0 +1,35 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Localization +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabLocalizationModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Localization API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Localization +////////////////////////////////////////////////////// + +FLocalizationGetLanguageListResponse UPlayFabLocalizationModelDecoder::decodeGetLanguageListResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FLocalizationGetLanguageListResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.LanguageList = !(dataObj->HasField("LanguageList")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("LanguageList"), TEXT(",")); + + return tempStruct; +} + + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabLocalizationModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabLocalizationModels.cpp new file mode 100644 index 000000000..29aaa81a1 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabLocalizationModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Localization +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabLocalizationModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerAPI.cpp new file mode 100644 index 000000000..61d598732 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerAPI.cpp @@ -0,0 +1,469 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Matchmaker +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabMatchmakerAPI.h" +#include "PlayFabMatchmakerModels.h" +#include "PlayFabMatchmakerModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabMatchmakerAPI::UPlayFabMatchmakerAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabMatchmakerAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabMatchmakerAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabMatchmakerAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Matchmaker API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// +/** Validates a user with the PlayFab service */ +UPlayFabMatchmakerAPI* UPlayFabMatchmakerAPI::AuthUser(FMatchmakerAuthUserRequest request, + FDelegateOnSuccessAuthUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabMatchmakerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAuthUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabMatchmakerAPI::HelperAuthUser); + + // Setup the request + manager->PlayFabRequestURL = "/Matchmaker/AuthUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.AuthorizationTicket.IsEmpty() || request.AuthorizationTicket == "") { + OutRestJsonObj->SetFieldNull(TEXT("AuthorizationTicket")); + } else { + OutRestJsonObj->SetStringField(TEXT("AuthorizationTicket"), request.AuthorizationTicket); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabMatchmakerRequestCompleted +void UPlayFabMatchmakerAPI::HelperAuthUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAuthUser.IsBound()) + { + FMatchmakerAuthUserResponse result = UPlayFabMatchmakerModelDecoder::decodeAuthUserResponseResponse(response.responseData); + OnSuccessAuthUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Informs the PlayFab game server hosting service that the indicated user has joined the Game Server Instance specified */ +UPlayFabMatchmakerAPI* UPlayFabMatchmakerAPI::PlayerJoined(FMatchmakerPlayerJoinedRequest request, + FDelegateOnSuccessPlayerJoined onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabMatchmakerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessPlayerJoined = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabMatchmakerAPI::HelperPlayerJoined); + + // Setup the request + manager->PlayFabRequestURL = "/Matchmaker/PlayerJoined"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabMatchmakerRequestCompleted +void UPlayFabMatchmakerAPI::HelperPlayerJoined(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessPlayerJoined.IsBound()) + { + FMatchmakerPlayerJoinedResponse result = UPlayFabMatchmakerModelDecoder::decodePlayerJoinedResponseResponse(response.responseData); + OnSuccessPlayerJoined.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Informs the PlayFab game server hosting service that the indicated user has left the Game Server Instance specified */ +UPlayFabMatchmakerAPI* UPlayFabMatchmakerAPI::PlayerLeft(FMatchmakerPlayerLeftRequest request, + FDelegateOnSuccessPlayerLeft onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabMatchmakerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessPlayerLeft = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabMatchmakerAPI::HelperPlayerLeft); + + // Setup the request + manager->PlayFabRequestURL = "/Matchmaker/PlayerLeft"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabMatchmakerRequestCompleted +void UPlayFabMatchmakerAPI::HelperPlayerLeft(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessPlayerLeft.IsBound()) + { + FMatchmakerPlayerLeftResponse result = UPlayFabMatchmakerModelDecoder::decodePlayerLeftResponseResponse(response.responseData); + OnSuccessPlayerLeft.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Instructs the PlayFab game server hosting service to instantiate a new Game Server Instance */ +UPlayFabMatchmakerAPI* UPlayFabMatchmakerAPI::StartGame(FMatchmakerStartGameRequest request, + FDelegateOnSuccessStartGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabMatchmakerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessStartGame = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabMatchmakerAPI::HelperStartGame); + + // Setup the request + manager->PlayFabRequestURL = "/Matchmaker/StartGame"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Build.IsEmpty() || request.Build == "") { + OutRestJsonObj->SetFieldNull(TEXT("Build")); + } else { + OutRestJsonObj->SetStringField(TEXT("Build"), request.Build); + } + if (request.CustomCommandLineData.IsEmpty() || request.CustomCommandLineData == "") { + OutRestJsonObj->SetFieldNull(TEXT("CustomCommandLineData")); + } else { + OutRestJsonObj->SetStringField(TEXT("CustomCommandLineData"), request.CustomCommandLineData); + } + if (request.ExternalMatchmakerEventEndpoint.IsEmpty() || request.ExternalMatchmakerEventEndpoint == "") { + OutRestJsonObj->SetFieldNull(TEXT("ExternalMatchmakerEventEndpoint")); + } else { + OutRestJsonObj->SetStringField(TEXT("ExternalMatchmakerEventEndpoint"), request.ExternalMatchmakerEventEndpoint); + } + if (request.GameMode.IsEmpty() || request.GameMode == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameMode")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameMode"), request.GameMode); + } + FString temp_Region; + if (GetEnumValueToString(TEXT("ERegion"), request.Region, temp_Region)) + OutRestJsonObj->SetStringField(TEXT("Region"), temp_Region); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabMatchmakerRequestCompleted +void UPlayFabMatchmakerAPI::HelperStartGame(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessStartGame.IsBound()) + { + FMatchmakerStartGameResponse result = UPlayFabMatchmakerModelDecoder::decodeStartGameResponseResponse(response.responseData); + OnSuccessStartGame.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the relevant details for a specified user, which the external match-making service can then use to compute effective matches */ +UPlayFabMatchmakerAPI* UPlayFabMatchmakerAPI::UserInfo(FMatchmakerUserInfoRequest request, + FDelegateOnSuccessUserInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabMatchmakerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUserInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabMatchmakerAPI::HelperUserInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Matchmaker/UserInfo"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MinCatalogVersion"), request.MinCatalogVersion); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabMatchmakerRequestCompleted +void UPlayFabMatchmakerAPI::HelperUserInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUserInfo.IsBound()) + { + FMatchmakerUserInfoResponse result = UPlayFabMatchmakerModelDecoder::decodeUserInfoResponseResponse(response.responseData); + OnSuccessUserInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabMatchmakerAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabMatchmakerAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabMatchmakerAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabMatchmakerAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerModelDecoder.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerModelDecoder.cpp new file mode 100644 index 000000000..5aa8d21f3 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerModelDecoder.cpp @@ -0,0 +1,88 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Matchmaker +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabMatchmakerModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Matchmaker API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +FMatchmakerAuthUserResponse UPlayFabMatchmakerModelDecoder::decodeAuthUserResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FMatchmakerAuthUserResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Authorized = !(dataObj->HasField("Authorized")) ? false : dataObj->GetBoolField("Authorized"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FMatchmakerPlayerJoinedResponse UPlayFabMatchmakerModelDecoder::decodePlayerJoinedResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FMatchmakerPlayerJoinedResponse tempStruct; + + + return tempStruct; +} + +FMatchmakerPlayerLeftResponse UPlayFabMatchmakerModelDecoder::decodePlayerLeftResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FMatchmakerPlayerLeftResponse tempStruct; + + + return tempStruct; +} + +FMatchmakerStartGameResponse UPlayFabMatchmakerModelDecoder::decodeStartGameResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FMatchmakerStartGameResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GameID = !(dataObj->HasField("GameID")) ? TEXT("") : dataObj->GetStringField("GameID"); + tempStruct.ServerHostname = !(dataObj->HasField("ServerHostname")) ? TEXT("") : dataObj->GetStringField("ServerHostname"); + tempStruct.ServerIPV4Address = !(dataObj->HasField("ServerIPV4Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV4Address"); + tempStruct.ServerIPV6Address = !(dataObj->HasField("ServerIPV6Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV6Address"); + tempStruct.ServerPort = !(dataObj->HasField("ServerPort")) ? 0 : int(dataObj->GetNumberField("ServerPort")); + tempStruct.ServerPublicDNSName = !(dataObj->HasField("ServerPublicDNSName")) ? TEXT("") : dataObj->GetStringField("ServerPublicDNSName"); + + return tempStruct; +} + +FMatchmakerUserInfoResponse UPlayFabMatchmakerModelDecoder::decodeUserInfoResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FMatchmakerUserInfoResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Inventory = !(dataObj->HasField("Inventory")) ? TArray() : dataObj->GetObjectArrayField("Inventory"); + tempStruct.IsDeveloper = !(dataObj->HasField("IsDeveloper")) ? false : dataObj->GetBoolField("IsDeveloper"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.SteamId = !(dataObj->HasField("SteamId")) ? TEXT("") : dataObj->GetStringField("SteamId"); + tempStruct.TitleDisplayName = !(dataObj->HasField("TitleDisplayName")) ? TEXT("") : dataObj->GetStringField("TitleDisplayName"); + tempStruct.Username = !(dataObj->HasField("Username")) ? TEXT("") : dataObj->GetStringField("Username"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + tempStruct.VirtualCurrencyRechargeTimes = !(dataObj->HasField("VirtualCurrencyRechargeTimes")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyRechargeTimes"); + + return tempStruct; +} + + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerModels.cpp new file mode 100644 index 000000000..3f3928000 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Matchmaker +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabMatchmakerModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabPrivate.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabPrivate.h new file mode 100644 index 000000000..7730fed0b --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabPrivate.h @@ -0,0 +1,23 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////// +// PlayFab Main Header File +//////////////////////////////////////////////////////////// + +#pragma once + +#include "CoreUObject.h" +#include "Engine.h" + +#include "Delegates/Delegate.h" +#include "Http.h" +#include "Containers/Map.h" +#include "Json.h" + +#include "Modules/ModuleManager.h" + +DECLARE_LOG_CATEGORY_EXTERN(LogPlayFab, Log, All); + +#include "IPlayFab.h" \ No newline at end of file diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabProfilesAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabProfilesAPI.cpp new file mode 100644 index 000000000..4d25c3da7 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabProfilesAPI.cpp @@ -0,0 +1,486 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Profiles +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabProfilesAPI.h" +#include "PlayFabProfilesModels.h" +#include "PlayFabProfilesModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabProfilesAPI::UPlayFabProfilesAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabProfilesAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabProfilesAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabProfilesAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Profiles API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// +/** Gets the global title access policy */ +UPlayFabProfilesAPI* UPlayFabProfilesAPI::GetGlobalPolicy(FProfilesGetGlobalPolicyRequest request, + FDelegateOnSuccessGetGlobalPolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabProfilesAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetGlobalPolicy = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabProfilesAPI::HelperGetGlobalPolicy); + + // Setup the request + manager->PlayFabRequestURL = "/Profile/GetGlobalPolicy"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabProfilesRequestCompleted +void UPlayFabProfilesAPI::HelperGetGlobalPolicy(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetGlobalPolicy.IsBound()) + { + FProfilesGetGlobalPolicyResponse result = UPlayFabProfilesModelDecoder::decodeGetGlobalPolicyResponseResponse(response.responseData); + OnSuccessGetGlobalPolicy.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the entity's profile. */ +UPlayFabProfilesAPI* UPlayFabProfilesAPI::GetProfile(FProfilesGetEntityProfileRequest request, + FDelegateOnSuccessGetProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabProfilesAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetProfile = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabProfilesAPI::HelperGetProfile); + + // Setup the request + manager->PlayFabRequestURL = "/Profile/GetProfile"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("DataAsObject"), request.DataAsObject); + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabProfilesRequestCompleted +void UPlayFabProfilesAPI::HelperGetProfile(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetProfile.IsBound()) + { + FProfilesGetEntityProfileResponse result = UPlayFabProfilesModelDecoder::decodeGetEntityProfileResponseResponse(response.responseData); + OnSuccessGetProfile.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the entity's profile. */ +UPlayFabProfilesAPI* UPlayFabProfilesAPI::GetProfiles(FProfilesGetEntityProfilesRequest request, + FDelegateOnSuccessGetProfiles onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabProfilesAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetProfiles = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabProfilesAPI::HelperGetProfiles); + + // Setup the request + manager->PlayFabRequestURL = "/Profile/GetProfiles"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("DataAsObject"), request.DataAsObject); + if (request.Entities.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Entities")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Entities"), request.Entities); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabProfilesRequestCompleted +void UPlayFabProfilesAPI::HelperGetProfiles(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetProfiles.IsBound()) + { + FProfilesGetEntityProfilesResponse result = UPlayFabProfilesModelDecoder::decodeGetEntityProfilesResponseResponse(response.responseData); + OnSuccessGetProfiles.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the global title access policy */ +UPlayFabProfilesAPI* UPlayFabProfilesAPI::SetGlobalPolicy(FProfilesSetGlobalPolicyRequest request, + FDelegateOnSuccessSetGlobalPolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabProfilesAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetGlobalPolicy = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabProfilesAPI::HelperSetGlobalPolicy); + + // Setup the request + manager->PlayFabRequestURL = "/Profile/SetGlobalPolicy"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Permissions.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Permissions")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Permissions"), request.Permissions); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabProfilesRequestCompleted +void UPlayFabProfilesAPI::HelperSetGlobalPolicy(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetGlobalPolicy.IsBound()) + { + FProfilesSetGlobalPolicyResponse result = UPlayFabProfilesModelDecoder::decodeSetGlobalPolicyResponseResponse(response.responseData); + OnSuccessSetGlobalPolicy.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the entity's language */ +UPlayFabProfilesAPI* UPlayFabProfilesAPI::SetProfileLanguage(FProfilesSetProfileLanguageRequest request, + FDelegateOnSuccessSetProfileLanguage onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabProfilesAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetProfileLanguage = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabProfilesAPI::HelperSetProfileLanguage); + + // Setup the request + manager->PlayFabRequestURL = "/Profile/SetProfileLanguage"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + OutRestJsonObj->SetNumberField(TEXT("ExpectedVersion"), request.ExpectedVersion); + if (request.Language.IsEmpty() || request.Language == "") { + OutRestJsonObj->SetFieldNull(TEXT("Language")); + } else { + OutRestJsonObj->SetStringField(TEXT("Language"), request.Language); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabProfilesRequestCompleted +void UPlayFabProfilesAPI::HelperSetProfileLanguage(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetProfileLanguage.IsBound()) + { + FProfilesSetProfileLanguageResponse result = UPlayFabProfilesModelDecoder::decodeSetProfileLanguageResponseResponse(response.responseData); + OnSuccessSetProfileLanguage.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the profiles access policy */ +UPlayFabProfilesAPI* UPlayFabProfilesAPI::SetProfilePolicy(FProfilesSetEntityProfilePolicyRequest request, + FDelegateOnSuccessSetProfilePolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabProfilesAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetProfilePolicy = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabProfilesAPI::HelperSetProfilePolicy); + + // Setup the request + manager->PlayFabRequestURL = "/Profile/SetProfilePolicy"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Statements.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Statements")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Statements"), request.Statements); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabProfilesRequestCompleted +void UPlayFabProfilesAPI::HelperSetProfilePolicy(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetProfilePolicy.IsBound()) + { + FProfilesSetEntityProfilePolicyResponse result = UPlayFabProfilesModelDecoder::decodeSetEntityProfilePolicyResponseResponse(response.responseData); + OnSuccessSetProfilePolicy.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabProfilesAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabProfilesAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabProfilesAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabProfilesModelDecoder.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabProfilesModelDecoder.cpp new file mode 100644 index 000000000..1d852471d --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabProfilesModelDecoder.cpp @@ -0,0 +1,89 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Profiles +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabProfilesModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Profiles API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +FProfilesGetGlobalPolicyResponse UPlayFabProfilesModelDecoder::decodeGetGlobalPolicyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FProfilesGetGlobalPolicyResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Permissions = !(dataObj->HasField("Permissions")) ? TArray() : dataObj->GetObjectArrayField("Permissions"); + + return tempStruct; +} + +FProfilesGetEntityProfileResponse UPlayFabProfilesModelDecoder::decodeGetEntityProfileResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FProfilesGetEntityProfileResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Profile = !(dataObj->HasField("Profile")) ? nullptr : dataObj->GetObjectField("Profile"); + + return tempStruct; +} + +FProfilesGetEntityProfilesResponse UPlayFabProfilesModelDecoder::decodeGetEntityProfilesResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FProfilesGetEntityProfilesResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Profiles = !(dataObj->HasField("Profiles")) ? TArray() : dataObj->GetObjectArrayField("Profiles"); + + return tempStruct; +} + +FProfilesSetGlobalPolicyResponse UPlayFabProfilesModelDecoder::decodeSetGlobalPolicyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FProfilesSetGlobalPolicyResponse tempStruct; + + + return tempStruct; +} + +FProfilesSetProfileLanguageResponse UPlayFabProfilesModelDecoder::decodeSetProfileLanguageResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FProfilesSetProfileLanguageResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + GetEnumValueFromString(TEXT("EOperationTypes"), dataObj->GetStringField("OperationResult"), tempStruct.OperationResult); + tempStruct.VersionNumber = !(dataObj->HasField("VersionNumber")) ? 0 : int(dataObj->GetNumberField("VersionNumber")); + + return tempStruct; +} + +FProfilesSetEntityProfilePolicyResponse UPlayFabProfilesModelDecoder::decodeSetEntityProfilePolicyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FProfilesSetEntityProfilePolicyResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Permissions = !(dataObj->HasField("Permissions")) ? TArray() : dataObj->GetObjectArrayField("Permissions"); + + return tempStruct; +} + + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabProfilesModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabProfilesModels.cpp new file mode 100644 index 000000000..7a5e2ad43 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabProfilesModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Profiles +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabProfilesModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabServerAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabServerAPI.cpp new file mode 100644 index 000000000..2efc24861 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabServerAPI.cpp @@ -0,0 +1,6752 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Server +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabServerAPI.h" +#include "PlayFabServerModels.h" +#include "PlayFabServerModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabServerAPI::UPlayFabServerAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabServerAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabServerAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabServerAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Server API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// +/** Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. */ +UPlayFabServerAPI* UPlayFabServerAPI::BanUsers(FServerBanUsersRequest request, + FDelegateOnSuccessBanUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessBanUsers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperBanUsers); + + // Setup the request + manager->PlayFabRequestURL = "/Server/BanUsers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Bans.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Bans")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Bans"), request.Bans); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperBanUsers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessBanUsers.IsBound()) + { + FServerBanUsersResult result = UPlayFabServerModelDecoder::decodeBanUsersResultResponse(response.responseData); + OnSuccessBanUsers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the player's profile */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayerProfile(FServerGetPlayerProfileRequest request, + FDelegateOnSuccessGetPlayerProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerProfile = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayerProfile); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayerProfile"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayerProfile(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerProfile.IsBound()) + { + FServerGetPlayerProfileResult result = UPlayFabServerModelDecoder::decodeGetPlayerProfileResultResponse(response.responseData); + OnSuccessGetPlayerProfile.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayFabIDsFromFacebookIDs(FServerGetPlayFabIDsFromFacebookIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromFacebookIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayFabIDsFromFacebookIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayFabIDsFromFacebookIDs"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.FacebookIDs.IsEmpty() || request.FacebookIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookIDs")); + } else { + TArray FacebookIDsArray; + FString(request.FacebookIDs).ParseIntoArray(FacebookIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FacebookIDs"), FacebookIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayFabIDsFromFacebookIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromFacebookIDs.IsBound()) + { + FServerGetPlayFabIDsFromFacebookIDsResult result = UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromFacebookIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromFacebookIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Facebook Instant Games identifiers. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayFabIDsFromFacebookInstantGamesIds(FServerGetPlayFabIDsFromFacebookInstantGamesIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayFabIDsFromFacebookInstantGamesIds); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayFabIDsFromFacebookInstantGamesIds"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.FacebookInstantGamesIds.IsEmpty() || request.FacebookInstantGamesIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookInstantGamesIds")); + } else { + TArray FacebookInstantGamesIdsArray; + FString(request.FacebookInstantGamesIds).ParseIntoArray(FacebookInstantGamesIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FacebookInstantGamesIds"), FacebookInstantGamesIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayFabIDsFromFacebookInstantGamesIds(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds.IsBound()) + { + FServerGetPlayFabIDsFromFacebookInstantGamesIdsResult result = UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromFacebookInstantGamesIdsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Nintendo Switch Device identifiers. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayFabIDsFromNintendoSwitchDeviceIds(FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayFabIDsFromNintendoSwitchDeviceIds); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayFabIDsFromNintendoSwitchDeviceIds"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.NintendoSwitchDeviceIds.IsEmpty() || request.NintendoSwitchDeviceIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("NintendoSwitchDeviceIds")); + } else { + TArray NintendoSwitchDeviceIdsArray; + FString(request.NintendoSwitchDeviceIds).ParseIntoArray(NintendoSwitchDeviceIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("NintendoSwitchDeviceIds"), NintendoSwitchDeviceIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayFabIDsFromNintendoSwitchDeviceIds(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds.IsBound()) + { + FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsResult result = UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromNintendoSwitchDeviceIdsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayFabIDsFromSteamIDs(FServerGetPlayFabIDsFromSteamIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromSteamIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromSteamIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayFabIDsFromSteamIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayFabIDsFromSteamIDs"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.SteamStringIDs.IsEmpty() || request.SteamStringIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("SteamStringIDs")); + } else { + TArray SteamStringIDsArray; + FString(request.SteamStringIDs).ParseIntoArray(SteamStringIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("SteamStringIDs"), SteamStringIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayFabIDsFromSteamIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromSteamIDs.IsBound()) + { + FServerGetPlayFabIDsFromSteamIDsResult result = UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromSteamIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromSteamIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the relevant details for a specified user */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserAccountInfo(FServerGetUserAccountInfoRequest request, + FDelegateOnSuccessGetUserAccountInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserAccountInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserAccountInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserAccountInfo"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserAccountInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserAccountInfo.IsBound()) + { + FServerGetUserAccountInfoResult result = UPlayFabServerModelDecoder::decodeGetUserAccountInfoResultResponse(response.responseData); + OnSuccessGetUserAccountInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets all bans for a user. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserBans(FServerGetUserBansRequest request, + FDelegateOnSuccessGetUserBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserBans = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserBans); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserBans"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserBans(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserBans.IsBound()) + { + FServerGetUserBansResult result = UPlayFabServerModelDecoder::decodeGetUserBansResultResponse(response.responseData); + OnSuccessGetUserBans.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revoke all active bans for a user. */ +UPlayFabServerAPI* UPlayFabServerAPI::RevokeAllBansForUser(FServerRevokeAllBansForUserRequest request, + FDelegateOnSuccessRevokeAllBansForUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeAllBansForUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRevokeAllBansForUser); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RevokeAllBansForUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRevokeAllBansForUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeAllBansForUser.IsBound()) + { + FServerRevokeAllBansForUserResult result = UPlayFabServerModelDecoder::decodeRevokeAllBansForUserResultResponse(response.responseData); + OnSuccessRevokeAllBansForUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revoke all active bans specified with BanId. */ +UPlayFabServerAPI* UPlayFabServerAPI::RevokeBans(FServerRevokeBansRequest request, + FDelegateOnSuccessRevokeBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeBans = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRevokeBans); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RevokeBans"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.BanIds.IsEmpty() || request.BanIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("BanIds")); + } else { + TArray BanIdsArray; + FString(request.BanIds).ParseIntoArray(BanIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("BanIds"), BanIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRevokeBans(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeBans.IsBound()) + { + FServerRevokeBansResult result = UPlayFabServerModelDecoder::decodeRevokeBansResultResponse(response.responseData); + OnSuccessRevokeBans.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Forces an email to be sent to the registered contact email address for the user's account based on an account recovery email template */ +UPlayFabServerAPI* UPlayFabServerAPI::SendCustomAccountRecoveryEmail(FServerSendCustomAccountRecoveryEmailRequest request, + FDelegateOnSuccessSendCustomAccountRecoveryEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSendCustomAccountRecoveryEmail = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSendCustomAccountRecoveryEmail); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SendCustomAccountRecoveryEmail"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.EmailTemplateId.IsEmpty() || request.EmailTemplateId == "") { + OutRestJsonObj->SetFieldNull(TEXT("EmailTemplateId")); + } else { + OutRestJsonObj->SetStringField(TEXT("EmailTemplateId"), request.EmailTemplateId); + } + if (request.Username.IsEmpty() || request.Username == "") { + OutRestJsonObj->SetFieldNull(TEXT("Username")); + } else { + OutRestJsonObj->SetStringField(TEXT("Username"), request.Username); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSendCustomAccountRecoveryEmail(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSendCustomAccountRecoveryEmail.IsBound()) + { + FServerSendCustomAccountRecoveryEmailResult result = UPlayFabServerModelDecoder::decodeSendCustomAccountRecoveryEmailResultResponse(response.responseData); + OnSuccessSendCustomAccountRecoveryEmail.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sends an email based on an email template to a player's contact email */ +UPlayFabServerAPI* UPlayFabServerAPI::SendEmailFromTemplate(FServerSendEmailFromTemplateRequest request, + FDelegateOnSuccessSendEmailFromTemplate onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSendEmailFromTemplate = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSendEmailFromTemplate); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SendEmailFromTemplate"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.EmailTemplateId.IsEmpty() || request.EmailTemplateId == "") { + OutRestJsonObj->SetFieldNull(TEXT("EmailTemplateId")); + } else { + OutRestJsonObj->SetStringField(TEXT("EmailTemplateId"), request.EmailTemplateId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSendEmailFromTemplate(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSendEmailFromTemplate.IsBound()) + { + FServerSendEmailFromTemplateResult result = UPlayFabServerModelDecoder::decodeSendEmailFromTemplateResultResponse(response.responseData); + OnSuccessSendEmailFromTemplate.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sends an iOS/Android Push Notification to a specific user, if that user's device has been configured for Push Notifications in PlayFab. If a user has linked both Android and iOS devices, both will be notified. */ +UPlayFabServerAPI* UPlayFabServerAPI::SendPushNotification(FServerSendPushNotificationRequest request, + FDelegateOnSuccessSendPushNotification onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSendPushNotification = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSendPushNotification); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SendPushNotification"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.AdvancedPlatformDelivery.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("AdvancedPlatformDelivery")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("AdvancedPlatformDelivery"), request.AdvancedPlatformDelivery); + } + if (request.Message.IsEmpty() || request.Message == "") { + OutRestJsonObj->SetFieldNull(TEXT("Message")); + } else { + OutRestJsonObj->SetStringField(TEXT("Message"), request.Message); + } + if (request.Package != nullptr) OutRestJsonObj->SetObjectField(TEXT("Package"), request.Package); + if (request.Recipient.IsEmpty() || request.Recipient == "") { + OutRestJsonObj->SetFieldNull(TEXT("Recipient")); + } else { + OutRestJsonObj->SetStringField(TEXT("Recipient"), request.Recipient); + } + if (request.Subject.IsEmpty() || request.Subject == "") { + OutRestJsonObj->SetFieldNull(TEXT("Subject")); + } else { + OutRestJsonObj->SetStringField(TEXT("Subject"), request.Subject); + } + // Check to see if string is empty + if (request.TargetPlatforms.IsEmpty() || request.TargetPlatforms == "") { + OutRestJsonObj->SetFieldNull(TEXT("TargetPlatforms")); + } else { + TArray TargetPlatformsArray; + FString(request.TargetPlatforms).ParseIntoArray(TargetPlatformsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("TargetPlatforms"), TargetPlatformsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSendPushNotification(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSendPushNotification.IsBound()) + { + FServerSendPushNotificationResult result = UPlayFabServerModelDecoder::decodeSendPushNotificationResultResponse(response.responseData); + OnSuccessSendPushNotification.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Update the avatar URL of the specified player */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateAvatarUrl(FServerUpdateAvatarUrlRequest request, + FDelegateOnSuccessUpdateAvatarUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateAvatarUrl = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateAvatarUrl); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateAvatarUrl"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.ImageUrl.IsEmpty() || request.ImageUrl == "") { + OutRestJsonObj->SetFieldNull(TEXT("ImageUrl")); + } else { + OutRestJsonObj->SetStringField(TEXT("ImageUrl"), request.ImageUrl); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateAvatarUrl(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateAvatarUrl.IsBound()) + { + FServerEmptyResponse result = UPlayFabServerModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessUpdateAvatarUrl.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates information of a list of existing bans specified with Ban Ids. */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateBans(FServerUpdateBansRequest request, + FDelegateOnSuccessUpdateBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateBans = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateBans); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateBans"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Bans.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Bans")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Bans"), request.Bans); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateBans(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateBans.IsBound()) + { + FServerUpdateBansResult result = UPlayFabServerModelDecoder::decodeUpdateBansResultResponse(response.responseData); + OnSuccessUpdateBans.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Analytics +////////////////////////////////////////////////////// +/** Writes a character-based event into PlayStream. */ +UPlayFabServerAPI* UPlayFabServerAPI::WriteCharacterEvent(FServerWriteServerCharacterEventRequest request, + FDelegateOnSuccessWriteCharacterEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWriteCharacterEvent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperWriteCharacterEvent); + + // Setup the request + manager->PlayFabRequestURL = "/Server/WriteCharacterEvent"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Body != nullptr) OutRestJsonObj->SetObjectField(TEXT("Body"), request.Body); + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.EventName.IsEmpty() || request.EventName == "") { + OutRestJsonObj->SetFieldNull(TEXT("EventName")); + } else { + OutRestJsonObj->SetStringField(TEXT("EventName"), request.EventName); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperWriteCharacterEvent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWriteCharacterEvent.IsBound()) + { + FServerWriteEventResponse result = UPlayFabServerModelDecoder::decodeWriteEventResponseResponse(response.responseData); + OnSuccessWriteCharacterEvent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Writes a player-based event into PlayStream. */ +UPlayFabServerAPI* UPlayFabServerAPI::WritePlayerEvent(FServerWriteServerPlayerEventRequest request, + FDelegateOnSuccessWritePlayerEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWritePlayerEvent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperWritePlayerEvent); + + // Setup the request + manager->PlayFabRequestURL = "/Server/WritePlayerEvent"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Body != nullptr) OutRestJsonObj->SetObjectField(TEXT("Body"), request.Body); + if (request.EventName.IsEmpty() || request.EventName == "") { + OutRestJsonObj->SetFieldNull(TEXT("EventName")); + } else { + OutRestJsonObj->SetStringField(TEXT("EventName"), request.EventName); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperWritePlayerEvent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWritePlayerEvent.IsBound()) + { + FServerWriteEventResponse result = UPlayFabServerModelDecoder::decodeWriteEventResponseResponse(response.responseData); + OnSuccessWritePlayerEvent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Writes a title-based event into PlayStream. */ +UPlayFabServerAPI* UPlayFabServerAPI::WriteTitleEvent(FServerWriteTitleEventRequest request, + FDelegateOnSuccessWriteTitleEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWriteTitleEvent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperWriteTitleEvent); + + // Setup the request + manager->PlayFabRequestURL = "/Server/WriteTitleEvent"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Body != nullptr) OutRestJsonObj->SetObjectField(TEXT("Body"), request.Body); + if (request.EventName.IsEmpty() || request.EventName == "") { + OutRestJsonObj->SetFieldNull(TEXT("EventName")); + } else { + OutRestJsonObj->SetStringField(TEXT("EventName"), request.EventName); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperWriteTitleEvent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWriteTitleEvent.IsBound()) + { + FServerWriteEventResponse result = UPlayFabServerModelDecoder::decodeWriteEventResponseResponse(response.responseData); + OnSuccessWriteTitleEvent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// +/** Validated a client's session ticket, and if successful, returns details for that user */ +UPlayFabServerAPI* UPlayFabServerAPI::AuthenticateSessionTicket(FServerAuthenticateSessionTicketRequest request, + FDelegateOnSuccessAuthenticateSessionTicket onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAuthenticateSessionTicket = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAuthenticateSessionTicket); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AuthenticateSessionTicket"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.SessionTicket.IsEmpty() || request.SessionTicket == "") { + OutRestJsonObj->SetFieldNull(TEXT("SessionTicket")); + } else { + OutRestJsonObj->SetStringField(TEXT("SessionTicket"), request.SessionTicket); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAuthenticateSessionTicket(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAuthenticateSessionTicket.IsBound()) + { + FServerAuthenticateSessionTicketResult result = UPlayFabServerModelDecoder::decodeAuthenticateSessionTicketResultResponse(response.responseData); + OnSuccessAuthenticateSessionTicket.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's secret use the Admin or Server API method SetPlayerSecret. */ +UPlayFabServerAPI* UPlayFabServerAPI::SetPlayerSecret(FServerSetPlayerSecretRequest request, + FDelegateOnSuccessSetPlayerSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetPlayerSecret = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetPlayerSecret); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetPlayerSecret"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetPlayerSecret(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetPlayerSecret.IsBound()) + { + FServerSetPlayerSecretResult result = UPlayFabServerModelDecoder::decodeSetPlayerSecretResultResponse(response.responseData); + OnSuccessSetPlayerSecret.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Character Data +////////////////////////////////////////////////////// +/** Retrieves the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCharacterData(FServerGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCharacterData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCharacterData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterData.IsBound()) + { + FServerGetCharacterDataResult result = UPlayFabServerModelDecoder::decodeGetCharacterDataResultResponse(response.responseData); + OnSuccessGetCharacterData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user's character which cannot be accessed by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCharacterInternalData(FServerGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCharacterInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCharacterInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCharacterInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterInternalData.IsBound()) + { + FServerGetCharacterDataResult result = UPlayFabServerModelDecoder::decodeGetCharacterDataResultResponse(response.responseData); + OnSuccessGetCharacterInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user's character which can only be read by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCharacterReadOnlyData(FServerGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCharacterReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCharacterReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCharacterReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterReadOnlyData.IsBound()) + { + FServerGetCharacterDataResult result = UPlayFabServerModelDecoder::decodeGetCharacterDataResultResponse(response.responseData); + OnSuccessGetCharacterReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user's character which is readable and writable by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateCharacterData(FServerUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCharacterData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateCharacterData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateCharacterData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCharacterData.IsBound()) + { + FServerUpdateCharacterDataResult result = UPlayFabServerModelDecoder::decodeUpdateCharacterDataResultResponse(response.responseData); + OnSuccessUpdateCharacterData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user's character which cannot be accessed by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateCharacterInternalData(FServerUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCharacterInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateCharacterInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateCharacterInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateCharacterInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCharacterInternalData.IsBound()) + { + FServerUpdateCharacterDataResult result = UPlayFabServerModelDecoder::decodeUpdateCharacterDataResultResponse(response.responseData); + OnSuccessUpdateCharacterInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user's character which can only be read by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateCharacterReadOnlyData(FServerUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCharacterReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateCharacterReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateCharacterReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateCharacterReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCharacterReadOnlyData.IsBound()) + { + FServerUpdateCharacterDataResult result = UPlayFabServerModelDecoder::decodeUpdateCharacterDataResultResponse(response.responseData); + OnSuccessUpdateCharacterReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// +/** Deletes the specific character ID from the specified user. */ +UPlayFabServerAPI* UPlayFabServerAPI::DeleteCharacterFromUser(FServerDeleteCharacterFromUserRequest request, + FDelegateOnSuccessDeleteCharacterFromUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteCharacterFromUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperDeleteCharacterFromUser); + + // Setup the request + manager->PlayFabRequestURL = "/Server/DeleteCharacterFromUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + OutRestJsonObj->SetBoolField(TEXT("SaveCharacterInventory"), request.SaveCharacterInventory); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperDeleteCharacterFromUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteCharacterFromUser.IsBound()) + { + FServerDeleteCharacterFromUserResult result = UPlayFabServerModelDecoder::decodeDeleteCharacterFromUserResultResponse(response.responseData); + OnSuccessDeleteCharacterFromUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetAllUsersCharacters(FServerListUsersCharactersRequest request, + FDelegateOnSuccessGetAllUsersCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetAllUsersCharacters = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetAllUsersCharacters); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetAllUsersCharacters"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetAllUsersCharacters(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetAllUsersCharacters.IsBound()) + { + FServerListUsersCharactersResult result = UPlayFabServerModelDecoder::decodeListUsersCharactersResultResponse(response.responseData); + OnSuccessGetAllUsersCharacters.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCharacterLeaderboard(FServerGetCharacterLeaderboardRequest request, + FDelegateOnSuccessGetCharacterLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterLeaderboard = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCharacterLeaderboard); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCharacterLeaderboard"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterType.IsEmpty() || request.CharacterType == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterType")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterType"), request.CharacterType); + } + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + OutRestJsonObj->SetNumberField(TEXT("StartPosition"), request.StartPosition); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCharacterLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterLeaderboard.IsBound()) + { + FServerGetCharacterLeaderboardResult result = UPlayFabServerModelDecoder::decodeGetCharacterLeaderboardResultResponse(response.responseData); + OnSuccessGetCharacterLeaderboard.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the details of all title-specific statistics for the specific character */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCharacterStatistics(FServerGetCharacterStatisticsRequest request, + FDelegateOnSuccessGetCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCharacterStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCharacterStatistics"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterStatistics.IsBound()) + { + FServerGetCharacterStatisticsResult result = UPlayFabServerModelDecoder::decodeGetCharacterStatisticsResultResponse(response.responseData); + OnSuccessGetCharacterStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked characters for the given statistic, centered on the requested user */ +UPlayFabServerAPI* UPlayFabServerAPI::GetLeaderboardAroundCharacter(FServerGetLeaderboardAroundCharacterRequest request, + FDelegateOnSuccessGetLeaderboardAroundCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboardAroundCharacter = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetLeaderboardAroundCharacter); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetLeaderboardAroundCharacter"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CharacterType.IsEmpty() || request.CharacterType == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterType")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterType"), request.CharacterType); + } + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetLeaderboardAroundCharacter(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboardAroundCharacter.IsBound()) + { + FServerGetLeaderboardAroundCharacterResult result = UPlayFabServerModelDecoder::decodeGetLeaderboardAroundCharacterResultResponse(response.responseData); + OnSuccessGetLeaderboardAroundCharacter.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of all of the user's characters for the given statistic. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetLeaderboardForUserCharacters(FServerGetLeaderboardForUsersCharactersRequest request, + FDelegateOnSuccessGetLeaderboardForUserCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboardForUserCharacters = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetLeaderboardForUserCharacters); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetLeaderboardForUserCharacters"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetLeaderboardForUserCharacters(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboardForUserCharacters.IsBound()) + { + FServerGetLeaderboardForUsersCharactersResult result = UPlayFabServerModelDecoder::decodeGetLeaderboardForUsersCharactersResultResponse(response.responseData); + OnSuccessGetLeaderboardForUserCharacters.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness. */ +UPlayFabServerAPI* UPlayFabServerAPI::GrantCharacterToUser(FServerGrantCharacterToUserRequest request, + FDelegateOnSuccessGrantCharacterToUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGrantCharacterToUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGrantCharacterToUser); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GrantCharacterToUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterName.IsEmpty() || request.CharacterName == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterName")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterName"), request.CharacterName); + } + if (request.CharacterType.IsEmpty() || request.CharacterType == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterType")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterType"), request.CharacterType); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGrantCharacterToUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGrantCharacterToUser.IsBound()) + { + FServerGrantCharacterToUserResult result = UPlayFabServerModelDecoder::decodeGrantCharacterToUserResultResponse(response.responseData); + OnSuccessGrantCharacterToUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the values of the specified title-specific statistics for the specific character */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateCharacterStatistics(FServerUpdateCharacterStatisticsRequest request, + FDelegateOnSuccessUpdateCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCharacterStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateCharacterStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateCharacterStatistics"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CharacterStatistics != nullptr) OutRestJsonObj->SetObjectField(TEXT("CharacterStatistics"), request.CharacterStatistics); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCharacterStatistics.IsBound()) + { + FServerUpdateCharacterStatisticsResult result = UPlayFabServerModelDecoder::decodeUpdateCharacterStatisticsResultResponse(response.responseData); + OnSuccessUpdateCharacterStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// +/** This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service. Also, please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetContentDownloadUrl(FServerGetContentDownloadUrlRequest request, + FDelegateOnSuccessGetContentDownloadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetContentDownloadUrl = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetContentDownloadUrl); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetContentDownloadUrl"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.HttpMethod.IsEmpty() || request.HttpMethod == "") { + OutRestJsonObj->SetFieldNull(TEXT("HttpMethod")); + } else { + OutRestJsonObj->SetStringField(TEXT("HttpMethod"), request.HttpMethod); + } + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + OutRestJsonObj->SetBoolField(TEXT("ThruCDN"), request.ThruCDN); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetContentDownloadUrl(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetContentDownloadUrl.IsBound()) + { + FServerGetContentDownloadUrlResult result = UPlayFabServerModelDecoder::decodeGetContentDownloadUrlResultResponse(response.responseData); + OnSuccessGetContentDownloadUrl.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Friend List Management +////////////////////////////////////////////////////// +/** Adds the Friend user to the friendlist of the user with PlayFabId. At least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. */ +UPlayFabServerAPI* UPlayFabServerAPI::AddFriend(FServerAddFriendRequest request, + FDelegateOnSuccessAddFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddFriend = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAddFriend); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AddFriend"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.FriendEmail.IsEmpty() || request.FriendEmail == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendEmail")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendEmail"), request.FriendEmail); + } + if (request.FriendPlayFabId.IsEmpty() || request.FriendPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendPlayFabId"), request.FriendPlayFabId); + } + if (request.FriendTitleDisplayName.IsEmpty() || request.FriendTitleDisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendTitleDisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendTitleDisplayName"), request.FriendTitleDisplayName); + } + if (request.FriendUsername.IsEmpty() || request.FriendUsername == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendUsername")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendUsername"), request.FriendUsername); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAddFriend(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddFriend.IsBound()) + { + FServerEmptyResponse result = UPlayFabServerModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessAddFriend.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the current friends for the user with PlayFabId, constrained to users who have PlayFab accounts. Friends from linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetFriendsList(FServerGetFriendsListRequest request, + FDelegateOnSuccessGetFriendsList onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetFriendsList = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetFriendsList); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetFriendsList"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("IncludeFacebookFriends"), request.IncludeFacebookFriends); + OutRestJsonObj->SetBoolField(TEXT("IncludeSteamFriends"), request.IncludeSteamFriends); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetFriendsList(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetFriendsList.IsBound()) + { + FServerGetFriendsListResult result = UPlayFabServerModelDecoder::decodeGetFriendsListResultResponse(response.responseData); + OnSuccessGetFriendsList.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes the specified friend from the the user's friend list */ +UPlayFabServerAPI* UPlayFabServerAPI::RemoveFriend(FServerRemoveFriendRequest request, + FDelegateOnSuccessRemoveFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveFriend = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRemoveFriend); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RemoveFriend"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.FriendPlayFabId.IsEmpty() || request.FriendPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendPlayFabId"), request.FriendPlayFabId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRemoveFriend(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveFriend.IsBound()) + { + FServerEmptyResponse result = UPlayFabServerModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessRemoveFriend.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the tag list for a specified user in the friend list of another user */ +UPlayFabServerAPI* UPlayFabServerAPI::SetFriendTags(FServerSetFriendTagsRequest request, + FDelegateOnSuccessSetFriendTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetFriendTags = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetFriendTags); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetFriendTags"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.FriendPlayFabId.IsEmpty() || request.FriendPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendPlayFabId"), request.FriendPlayFabId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + // Check to see if string is empty + if (request.Tags.IsEmpty() || request.Tags == "") { + OutRestJsonObj->SetFieldNull(TEXT("Tags")); + } else { + TArray TagsArray; + FString(request.Tags).ParseIntoArray(TagsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Tags"), TagsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetFriendTags(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetFriendTags.IsBound()) + { + FServerEmptyResponse result = UPlayFabServerModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessSetFriendTags.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// +/** Inform the matchmaker that a Game Server Instance is removed. */ +UPlayFabServerAPI* UPlayFabServerAPI::DeregisterGame(FServerDeregisterGameRequest request, + FDelegateOnSuccessDeregisterGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeregisterGame = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperDeregisterGame); + + // Setup the request + manager->PlayFabRequestURL = "/Server/DeregisterGame"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperDeregisterGame(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeregisterGame.IsBound()) + { + FServerDeregisterGameResponse result = UPlayFabServerModelDecoder::decodeDeregisterGameResponseResponse(response.responseData); + OnSuccessDeregisterGame.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Informs the PlayFab match-making service that the user specified has left the Game Server Instance */ +UPlayFabServerAPI* UPlayFabServerAPI::NotifyMatchmakerPlayerLeft(FServerNotifyMatchmakerPlayerLeftRequest request, + FDelegateOnSuccessNotifyMatchmakerPlayerLeft onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessNotifyMatchmakerPlayerLeft = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperNotifyMatchmakerPlayerLeft); + + // Setup the request + manager->PlayFabRequestURL = "/Server/NotifyMatchmakerPlayerLeft"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperNotifyMatchmakerPlayerLeft(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessNotifyMatchmakerPlayerLeft.IsBound()) + { + FServerNotifyMatchmakerPlayerLeftResult result = UPlayFabServerModelDecoder::decodeNotifyMatchmakerPlayerLeftResultResponse(response.responseData); + OnSuccessNotifyMatchmakerPlayerLeft.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Validates a Game Server session ticket and returns details about the user */ +UPlayFabServerAPI* UPlayFabServerAPI::RedeemMatchmakerTicket(FServerRedeemMatchmakerTicketRequest request, + FDelegateOnSuccessRedeemMatchmakerTicket onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRedeemMatchmakerTicket = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRedeemMatchmakerTicket); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RedeemMatchmakerTicket"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + if (request.Ticket.IsEmpty() || request.Ticket == "") { + OutRestJsonObj->SetFieldNull(TEXT("Ticket")); + } else { + OutRestJsonObj->SetStringField(TEXT("Ticket"), request.Ticket); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRedeemMatchmakerTicket(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRedeemMatchmakerTicket.IsBound()) + { + FServerRedeemMatchmakerTicketResult result = UPlayFabServerModelDecoder::decodeRedeemMatchmakerTicketResultResponse(response.responseData); + OnSuccessRedeemMatchmakerTicket.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Set the state of the indicated Game Server Instance. Also update the heartbeat for the instance. */ +UPlayFabServerAPI* UPlayFabServerAPI::RefreshGameServerInstanceHeartbeat(FServerRefreshGameServerInstanceHeartbeatRequest request, + FDelegateOnSuccessRefreshGameServerInstanceHeartbeat onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRefreshGameServerInstanceHeartbeat = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRefreshGameServerInstanceHeartbeat); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RefreshGameServerInstanceHeartbeat"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRefreshGameServerInstanceHeartbeat(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRefreshGameServerInstanceHeartbeat.IsBound()) + { + FServerRefreshGameServerInstanceHeartbeatResult result = UPlayFabServerModelDecoder::decodeRefreshGameServerInstanceHeartbeatResultResponse(response.responseData); + OnSuccessRefreshGameServerInstanceHeartbeat.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Inform the matchmaker that a new Game Server Instance is added. */ +UPlayFabServerAPI* UPlayFabServerAPI::RegisterGame(FServerRegisterGameRequest request, + FDelegateOnSuccessRegisterGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRegisterGame = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRegisterGame); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RegisterGame"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Build.IsEmpty() || request.Build == "") { + OutRestJsonObj->SetFieldNull(TEXT("Build")); + } else { + OutRestJsonObj->SetStringField(TEXT("Build"), request.Build); + } + if (request.GameMode.IsEmpty() || request.GameMode == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameMode")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameMode"), request.GameMode); + } + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + FString temp_Region; + if (GetEnumValueToString(TEXT("ERegion"), request.Region, temp_Region)) + OutRestJsonObj->SetStringField(TEXT("Region"), temp_Region); + if (request.ServerHost.IsEmpty() || request.ServerHost == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerHost")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerHost"), request.ServerHost); + } + if (request.ServerIPV4Address.IsEmpty() || request.ServerIPV4Address == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerIPV4Address")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerIPV4Address"), request.ServerIPV4Address); + } + if (request.ServerIPV6Address.IsEmpty() || request.ServerIPV6Address == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerIPV6Address")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerIPV6Address"), request.ServerIPV6Address); + } + if (request.ServerPort.IsEmpty() || request.ServerPort == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerPort")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerPort"), request.ServerPort); + } + if (request.ServerPublicDNSName.IsEmpty() || request.ServerPublicDNSName == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerPublicDNSName")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerPublicDNSName"), request.ServerPublicDNSName); + } + if (request.Tags != nullptr) OutRestJsonObj->SetObjectField(TEXT("Tags"), request.Tags); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRegisterGame(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRegisterGame.IsBound()) + { + FServerRegisterGameResponse result = UPlayFabServerModelDecoder::decodeRegisterGameResponseResponse(response.responseData); + OnSuccessRegisterGame.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the custom data of the indicated Game Server Instance */ +UPlayFabServerAPI* UPlayFabServerAPI::SetGameServerInstanceData(FServerSetGameServerInstanceDataRequest request, + FDelegateOnSuccessSetGameServerInstanceData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetGameServerInstanceData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetGameServerInstanceData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetGameServerInstanceData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.GameServerData.IsEmpty() || request.GameServerData == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameServerData")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameServerData"), request.GameServerData); + } + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetGameServerInstanceData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetGameServerInstanceData.IsBound()) + { + FServerSetGameServerInstanceDataResult result = UPlayFabServerModelDecoder::decodeSetGameServerInstanceDataResultResponse(response.responseData); + OnSuccessSetGameServerInstanceData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Set the state of the indicated Game Server Instance. */ +UPlayFabServerAPI* UPlayFabServerAPI::SetGameServerInstanceState(FServerSetGameServerInstanceStateRequest request, + FDelegateOnSuccessSetGameServerInstanceState onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetGameServerInstanceState = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetGameServerInstanceState); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetGameServerInstanceState"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + FString temp_State; + if (GetEnumValueToString(TEXT("EGameInstanceState"), request.State, temp_State)) + OutRestJsonObj->SetStringField(TEXT("State"), temp_State); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetGameServerInstanceState(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetGameServerInstanceState.IsBound()) + { + FServerSetGameServerInstanceStateResult result = UPlayFabServerModelDecoder::decodeSetGameServerInstanceStateResultResponse(response.responseData); + OnSuccessSetGameServerInstanceState.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Set custom tags for the specified Game Server Instance */ +UPlayFabServerAPI* UPlayFabServerAPI::SetGameServerInstanceTags(FServerSetGameServerInstanceTagsRequest request, + FDelegateOnSuccessSetGameServerInstanceTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetGameServerInstanceTags = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetGameServerInstanceTags); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetGameServerInstanceTags"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + if (request.Tags != nullptr) OutRestJsonObj->SetObjectField(TEXT("Tags"), request.Tags); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetGameServerInstanceTags(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetGameServerInstanceTags.IsBound()) + { + FServerSetGameServerInstanceTagsResult result = UPlayFabServerModelDecoder::decodeSetGameServerInstanceTagsResultResponse(response.responseData); + OnSuccessSetGameServerInstanceTags.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Platform Specific Methods +////////////////////////////////////////////////////// +/** Awards the specified users the specified Steam achievements */ +UPlayFabServerAPI* UPlayFabServerAPI::AwardSteamAchievement(FServerAwardSteamAchievementRequest request, + FDelegateOnSuccessAwardSteamAchievement onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAwardSteamAchievement = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAwardSteamAchievement); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AwardSteamAchievement"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Achievements.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Achievements")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Achievements"), request.Achievements); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAwardSteamAchievement(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAwardSteamAchievement.IsBound()) + { + FServerAwardSteamAchievementResult result = UPlayFabServerModelDecoder::decodeAwardSteamAchievementResultResponse(response.responseData); + OnSuccessAwardSteamAchievement.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// +/** Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. */ +UPlayFabServerAPI* UPlayFabServerAPI::DeleteUsers(FServerDeleteUsersRequest request, + FDelegateOnSuccessDeleteUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteUsers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperDeleteUsers); + + // Setup the request + manager->PlayFabRequestURL = "/Server/DeleteUsers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.PlayFabIds.IsEmpty() || request.PlayFabIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabIds")); + } else { + TArray PlayFabIdsArray; + FString(request.PlayFabIds).ParseIntoArray(PlayFabIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("PlayFabIds"), PlayFabIdsArray); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperDeleteUsers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteUsers.IsBound()) + { + FServerDeleteUsersResult result = UPlayFabServerModelDecoder::decodeDeleteUsersResultResponse(response.responseData); + OnSuccessDeleteUsers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked friends of the given player for the given statistic, starting from the indicated point in the leaderboard */ +UPlayFabServerAPI* UPlayFabServerAPI::GetFriendLeaderboard(FServerGetFriendLeaderboardRequest request, + FDelegateOnSuccessGetFriendLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetFriendLeaderboard = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetFriendLeaderboard); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetFriendLeaderboard"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("IncludeFacebookFriends"), request.IncludeFacebookFriends); + OutRestJsonObj->SetBoolField(TEXT("IncludeSteamFriends"), request.IncludeSteamFriends); + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + OutRestJsonObj->SetNumberField(TEXT("StartPosition"), request.StartPosition); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetFriendLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetFriendLeaderboard.IsBound()) + { + FServerGetLeaderboardResult result = UPlayFabServerModelDecoder::decodeGetLeaderboardResultResponse(response.responseData); + OnSuccessGetFriendLeaderboard.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard */ +UPlayFabServerAPI* UPlayFabServerAPI::GetLeaderboard(FServerGetLeaderboardRequest request, + FDelegateOnSuccessGetLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboard = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetLeaderboard); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetLeaderboard"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + OutRestJsonObj->SetNumberField(TEXT("StartPosition"), request.StartPosition); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboard.IsBound()) + { + FServerGetLeaderboardResult result = UPlayFabServerModelDecoder::decodeGetLeaderboardResultResponse(response.responseData); + OnSuccessGetLeaderboard.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user */ +UPlayFabServerAPI* UPlayFabServerAPI::GetLeaderboardAroundUser(FServerGetLeaderboardAroundUserRequest request, + FDelegateOnSuccessGetLeaderboardAroundUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboardAroundUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetLeaderboardAroundUser); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetLeaderboardAroundUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetLeaderboardAroundUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboardAroundUser.IsBound()) + { + FServerGetLeaderboardAroundUserResult result = UPlayFabServerModelDecoder::decodeGetLeaderboardAroundUserResultResponse(response.responseData); + OnSuccessGetLeaderboardAroundUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be returned. All parameters default to false. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayerCombinedInfo(FServerGetPlayerCombinedInfoRequest request, + FDelegateOnSuccessGetPlayerCombinedInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerCombinedInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayerCombinedInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayerCombinedInfo"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayerCombinedInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerCombinedInfo.IsBound()) + { + FServerGetPlayerCombinedInfoResult result = UPlayFabServerModelDecoder::decodeGetPlayerCombinedInfoResultResponse(response.responseData); + OnSuccessGetPlayerCombinedInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the current version and values for the indicated statistics, for the local player. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayerStatistics(FServerGetPlayerStatisticsRequest request, + FDelegateOnSuccessGetPlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayerStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayerStatistics"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + // Check to see if string is empty + if (request.StatisticNames.IsEmpty() || request.StatisticNames == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticNames")); + } else { + TArray StatisticNamesArray; + FString(request.StatisticNames).ParseIntoArray(StatisticNamesArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("StatisticNames"), StatisticNamesArray); + } + if (request.StatisticNameVersions.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("StatisticNameVersions")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("StatisticNameVersions"), request.StatisticNameVersions); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerStatistics.IsBound()) + { + FServerGetPlayerStatisticsResult result = UPlayFabServerModelDecoder::decodeGetPlayerStatisticsResultResponse(response.responseData); + OnSuccessGetPlayerStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the information on the available versions of the specified statistic. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayerStatisticVersions(FServerGetPlayerStatisticVersionsRequest request, + FDelegateOnSuccessGetPlayerStatisticVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerStatisticVersions = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayerStatisticVersions); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayerStatisticVersions"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayerStatisticVersions(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerStatisticVersions.IsBound()) + { + FServerGetPlayerStatisticVersionsResult result = UPlayFabServerModelDecoder::decodeGetPlayerStatisticVersionsResultResponse(response.responseData); + OnSuccessGetPlayerStatisticVersions.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserData.IsBound()) + { + FServerGetUserDataResult result = UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which cannot be accessed by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserInternalData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserInternalData.IsBound()) + { + FServerGetUserDataResult result = UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserPublisherData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherData.IsBound()) + { + FServerGetUserDataResult result = UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which cannot be accessed by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserPublisherInternalData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserPublisherInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserPublisherInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherInternalData.IsBound()) + { + FServerGetUserDataResult result = UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which can only be read by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserPublisherReadOnlyData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserPublisherReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserPublisherReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherReadOnlyData.IsBound()) + { + FServerGetUserDataResult result = UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which can only be read by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserReadOnlyData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserReadOnlyData.IsBound()) + { + FServerGetUserDataResult result = UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the values of the specified title-specific statistics for the user */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdatePlayerStatistics(FServerUpdatePlayerStatisticsRequest request, + FDelegateOnSuccessUpdatePlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdatePlayerStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdatePlayerStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdatePlayerStatistics"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("ForceUpdate"), request.ForceUpdate); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.Statistics.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Statistics")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Statistics"), request.Statistics); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdatePlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdatePlayerStatistics.IsBound()) + { + FServerUpdatePlayerStatisticsResult result = UPlayFabServerModelDecoder::decodeUpdatePlayerStatisticsResultResponse(response.responseData); + OnSuccessUpdatePlayerStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserData.IsBound()) + { + FServerUpdateUserDataResult result = UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user which cannot be accessed by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserInternalData(FServerUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserInternalData.IsBound()) + { + FServerUpdateUserDataResult result = UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the publisher-specific custom data for the user which is readable and writable by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserPublisherData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherData.IsBound()) + { + FServerUpdateUserDataResult result = UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the publisher-specific custom data for the user which cannot be accessed by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserPublisherInternalData(FServerUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserPublisherInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserPublisherInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherInternalData.IsBound()) + { + FServerUpdateUserDataResult result = UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the publisher-specific custom data for the user which can only be read by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserPublisherReadOnlyData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserPublisherReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserPublisherReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherReadOnlyData.IsBound()) + { + FServerUpdateUserDataResult result = UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user which can only be read by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserReadOnlyData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserReadOnlyData.IsBound()) + { + FServerUpdateUserDataResult result = UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// +/** Increments the character's balance of the specified virtual currency by the stated amount */ +UPlayFabServerAPI* UPlayFabServerAPI::AddCharacterVirtualCurrency(FServerAddCharacterVirtualCurrencyRequest request, + FDelegateOnSuccessAddCharacterVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddCharacterVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAddCharacterVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AddCharacterVirtualCurrency"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAddCharacterVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddCharacterVirtualCurrency.IsBound()) + { + FServerModifyCharacterVirtualCurrencyResult result = UPlayFabServerModelDecoder::decodeModifyCharacterVirtualCurrencyResultResponse(response.responseData); + OnSuccessAddCharacterVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Increments the user's balance of the specified virtual currency by the stated amount */ +UPlayFabServerAPI* UPlayFabServerAPI::AddUserVirtualCurrency(FServerAddUserVirtualCurrencyRequest request, + FDelegateOnSuccessAddUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddUserVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAddUserVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AddUserVirtualCurrency"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAddUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddUserVirtualCurrency.IsBound()) + { + FServerModifyUserVirtualCurrencyResult result = UPlayFabServerModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(response.responseData); + OnSuccessAddUserVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. */ +UPlayFabServerAPI* UPlayFabServerAPI::ConsumeItem(FServerConsumeItemRequest request, + FDelegateOnSuccessConsumeItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessConsumeItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperConsumeItem); + + // Setup the request + manager->PlayFabRequestURL = "/Server/ConsumeItem"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("ConsumeCount"), request.ConsumeCount); + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperConsumeItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessConsumeItem.IsBound()) + { + FServerConsumeItemResult result = UPlayFabServerModelDecoder::decodeConsumeItemResultResponse(response.responseData); + OnSuccessConsumeItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Returns the result of an evaluation of a Random Result Table - the ItemId from the game Catalog which would have been added to the player inventory, if the Random Result Table were added via a Bundle or a call to UnlockContainer. */ +UPlayFabServerAPI* UPlayFabServerAPI::EvaluateRandomResultTable(FServerEvaluateRandomResultTableRequest request, + FDelegateOnSuccessEvaluateRandomResultTable onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessEvaluateRandomResultTable = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperEvaluateRandomResultTable); + + // Setup the request + manager->PlayFabRequestURL = "/Server/EvaluateRandomResultTable"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.TableId.IsEmpty() || request.TableId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TableId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TableId"), request.TableId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperEvaluateRandomResultTable(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessEvaluateRandomResultTable.IsBound()) + { + FServerEvaluateRandomResultTableResult result = UPlayFabServerModelDecoder::decodeEvaluateRandomResultTableResultResponse(response.responseData); + OnSuccessEvaluateRandomResultTable.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the specified character's current inventory of virtual goods */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCharacterInventory(FServerGetCharacterInventoryRequest request, + FDelegateOnSuccessGetCharacterInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterInventory = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCharacterInventory); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCharacterInventory"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCharacterInventory(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterInventory.IsBound()) + { + FServerGetCharacterInventoryResult result = UPlayFabServerModelDecoder::decodeGetCharacterInventoryResultResponse(response.responseData); + OnSuccessGetCharacterInventory.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the configuration information for the specified random results tables for the title, including all ItemId values and weights */ +UPlayFabServerAPI* UPlayFabServerAPI::GetRandomResultTables(FServerGetRandomResultTablesRequest request, + FDelegateOnSuccessGetRandomResultTables onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetRandomResultTables = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetRandomResultTables); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetRandomResultTables"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + // Check to see if string is empty + if (request.TableIDs.IsEmpty() || request.TableIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("TableIDs")); + } else { + TArray TableIDsArray; + FString(request.TableIDs).ParseIntoArray(TableIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("TableIDs"), TableIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetRandomResultTables(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetRandomResultTables.IsBound()) + { + FServerGetRandomResultTablesResult result = UPlayFabServerModelDecoder::decodeGetRandomResultTablesResultResponse(response.responseData); + OnSuccessGetRandomResultTables.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the specified user's current inventory of virtual goods */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserInventory(FServerGetUserInventoryRequest request, + FDelegateOnSuccessGetUserInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserInventory = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserInventory); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserInventory"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserInventory(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserInventory.IsBound()) + { + FServerGetUserInventoryResult result = UPlayFabServerModelDecoder::decodeGetUserInventoryResultResponse(response.responseData); + OnSuccessGetUserInventory.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds the specified items to the specified character's inventory */ +UPlayFabServerAPI* UPlayFabServerAPI::GrantItemsToCharacter(FServerGrantItemsToCharacterRequest request, + FDelegateOnSuccessGrantItemsToCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGrantItemsToCharacter = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGrantItemsToCharacter); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GrantItemsToCharacter"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Annotation.IsEmpty() || request.Annotation == "") { + OutRestJsonObj->SetFieldNull(TEXT("Annotation")); + } else { + OutRestJsonObj->SetStringField(TEXT("Annotation"), request.Annotation); + } + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + // Check to see if string is empty + if (request.ItemIds.IsEmpty() || request.ItemIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemIds")); + } else { + TArray ItemIdsArray; + FString(request.ItemIds).ParseIntoArray(ItemIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("ItemIds"), ItemIdsArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGrantItemsToCharacter(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGrantItemsToCharacter.IsBound()) + { + FServerGrantItemsToCharacterResult result = UPlayFabServerModelDecoder::decodeGrantItemsToCharacterResultResponse(response.responseData); + OnSuccessGrantItemsToCharacter.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds the specified items to the specified user's inventory */ +UPlayFabServerAPI* UPlayFabServerAPI::GrantItemsToUser(FServerGrantItemsToUserRequest request, + FDelegateOnSuccessGrantItemsToUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGrantItemsToUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGrantItemsToUser); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GrantItemsToUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Annotation.IsEmpty() || request.Annotation == "") { + OutRestJsonObj->SetFieldNull(TEXT("Annotation")); + } else { + OutRestJsonObj->SetStringField(TEXT("Annotation"), request.Annotation); + } + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + // Check to see if string is empty + if (request.ItemIds.IsEmpty() || request.ItemIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemIds")); + } else { + TArray ItemIdsArray; + FString(request.ItemIds).ParseIntoArray(ItemIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("ItemIds"), ItemIdsArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGrantItemsToUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGrantItemsToUser.IsBound()) + { + FServerGrantItemsToUserResult result = UPlayFabServerModelDecoder::decodeGrantItemsToUserResultResponse(response.responseData); + OnSuccessGrantItemsToUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds the specified items to the specified user inventories */ +UPlayFabServerAPI* UPlayFabServerAPI::GrantItemsToUsers(FServerGrantItemsToUsersRequest request, + FDelegateOnSuccessGrantItemsToUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGrantItemsToUsers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGrantItemsToUsers); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GrantItemsToUsers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.ItemGrants.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("ItemGrants")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("ItemGrants"), request.ItemGrants); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGrantItemsToUsers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGrantItemsToUsers.IsBound()) + { + FServerGrantItemsToUsersResult result = UPlayFabServerModelDecoder::decodeGrantItemsToUsersResultResponse(response.responseData); + OnSuccessGrantItemsToUsers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Modifies the number of remaining uses of a player's inventory item */ +UPlayFabServerAPI* UPlayFabServerAPI::ModifyItemUses(FServerModifyItemUsesRequest request, + FDelegateOnSuccessModifyItemUses onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessModifyItemUses = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperModifyItemUses); + + // Setup the request + manager->PlayFabRequestURL = "/Server/ModifyItemUses"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + OutRestJsonObj->SetNumberField(TEXT("UsesToAdd"), request.UsesToAdd); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperModifyItemUses(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessModifyItemUses.IsBound()) + { + FServerModifyItemUsesResult result = UPlayFabServerModelDecoder::decodeModifyItemUsesResultResponse(response.responseData); + OnSuccessModifyItemUses.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Moves an item from a character's inventory into another of the users's character's inventory. */ +UPlayFabServerAPI* UPlayFabServerAPI::MoveItemToCharacterFromCharacter(FServerMoveItemToCharacterFromCharacterRequest request, + FDelegateOnSuccessMoveItemToCharacterFromCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessMoveItemToCharacterFromCharacter = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperMoveItemToCharacterFromCharacter); + + // Setup the request + manager->PlayFabRequestURL = "/Server/MoveItemToCharacterFromCharacter"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.GivingCharacterId.IsEmpty() || request.GivingCharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("GivingCharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("GivingCharacterId"), request.GivingCharacterId); + } + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ReceivingCharacterId.IsEmpty() || request.ReceivingCharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReceivingCharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReceivingCharacterId"), request.ReceivingCharacterId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperMoveItemToCharacterFromCharacter(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessMoveItemToCharacterFromCharacter.IsBound()) + { + FServerMoveItemToCharacterFromCharacterResult result = UPlayFabServerModelDecoder::decodeMoveItemToCharacterFromCharacterResultResponse(response.responseData); + OnSuccessMoveItemToCharacterFromCharacter.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Moves an item from a user's inventory into their character's inventory. */ +UPlayFabServerAPI* UPlayFabServerAPI::MoveItemToCharacterFromUser(FServerMoveItemToCharacterFromUserRequest request, + FDelegateOnSuccessMoveItemToCharacterFromUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessMoveItemToCharacterFromUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperMoveItemToCharacterFromUser); + + // Setup the request + manager->PlayFabRequestURL = "/Server/MoveItemToCharacterFromUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperMoveItemToCharacterFromUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessMoveItemToCharacterFromUser.IsBound()) + { + FServerMoveItemToCharacterFromUserResult result = UPlayFabServerModelDecoder::decodeMoveItemToCharacterFromUserResultResponse(response.responseData); + OnSuccessMoveItemToCharacterFromUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Moves an item from a character's inventory into the owning user's inventory. */ +UPlayFabServerAPI* UPlayFabServerAPI::MoveItemToUserFromCharacter(FServerMoveItemToUserFromCharacterRequest request, + FDelegateOnSuccessMoveItemToUserFromCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessMoveItemToUserFromCharacter = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperMoveItemToUserFromCharacter); + + // Setup the request + manager->PlayFabRequestURL = "/Server/MoveItemToUserFromCharacter"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperMoveItemToUserFromCharacter(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessMoveItemToUserFromCharacter.IsBound()) + { + FServerMoveItemToUserFromCharacterResult result = UPlayFabServerModelDecoder::decodeMoveItemToUserFromCharacterResultResponse(response.responseData); + OnSuccessMoveItemToUserFromCharacter.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ +UPlayFabServerAPI* UPlayFabServerAPI::RedeemCoupon(FServerRedeemCouponRequest request, + FDelegateOnSuccessRedeemCoupon onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRedeemCoupon = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRedeemCoupon); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RedeemCoupon"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CouponCode.IsEmpty() || request.CouponCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("CouponCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("CouponCode"), request.CouponCode); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRedeemCoupon(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRedeemCoupon.IsBound()) + { + FServerRedeemCouponResult result = UPlayFabServerModelDecoder::decodeRedeemCouponResultResponse(response.responseData); + OnSuccessRedeemCoupon.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Submit a report about a player (due to bad bahavior, etc.) on behalf of another player, so that customer service representatives for the title can take action concerning potentially toxic players. */ +UPlayFabServerAPI* UPlayFabServerAPI::ReportPlayer(FServerReportPlayerServerRequest request, + FDelegateOnSuccessReportPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessReportPlayer = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperReportPlayer); + + // Setup the request + manager->PlayFabRequestURL = "/Server/ReportPlayer"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Comment.IsEmpty() || request.Comment == "") { + OutRestJsonObj->SetFieldNull(TEXT("Comment")); + } else { + OutRestJsonObj->SetStringField(TEXT("Comment"), request.Comment); + } + if (request.ReporteeId.IsEmpty() || request.ReporteeId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReporteeId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReporteeId"), request.ReporteeId); + } + if (request.ReporterId.IsEmpty() || request.ReporterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReporterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReporterId"), request.ReporterId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperReportPlayer(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessReportPlayer.IsBound()) + { + FServerReportPlayerServerResult result = UPlayFabServerModelDecoder::decodeReportPlayerServerResultResponse(response.responseData); + OnSuccessReportPlayer.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revokes access to an item in a user's inventory */ +UPlayFabServerAPI* UPlayFabServerAPI::RevokeInventoryItem(FServerRevokeInventoryItemRequest request, + FDelegateOnSuccessRevokeInventoryItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeInventoryItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRevokeInventoryItem); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RevokeInventoryItem"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRevokeInventoryItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeInventoryItem.IsBound()) + { + FServerRevokeInventoryResult result = UPlayFabServerModelDecoder::decodeRevokeInventoryResultResponse(response.responseData); + OnSuccessRevokeInventoryItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revokes access for up to 25 items across multiple users and characters. */ +UPlayFabServerAPI* UPlayFabServerAPI::RevokeInventoryItems(FServerRevokeInventoryItemsRequest request, + FDelegateOnSuccessRevokeInventoryItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeInventoryItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRevokeInventoryItems); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RevokeInventoryItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Items.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Items")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Items"), request.Items); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRevokeInventoryItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeInventoryItems.IsBound()) + { + FServerRevokeInventoryItemsResult result = UPlayFabServerModelDecoder::decodeRevokeInventoryItemsResultResponse(response.responseData); + OnSuccessRevokeInventoryItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Decrements the character's balance of the specified virtual currency by the stated amount. It is possible to make a VC balance negative with this API. */ +UPlayFabServerAPI* UPlayFabServerAPI::SubtractCharacterVirtualCurrency(FServerSubtractCharacterVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractCharacterVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSubtractCharacterVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSubtractCharacterVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SubtractCharacterVirtualCurrency"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSubtractCharacterVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSubtractCharacterVirtualCurrency.IsBound()) + { + FServerModifyCharacterVirtualCurrencyResult result = UPlayFabServerModelDecoder::decodeModifyCharacterVirtualCurrencyResultResponse(response.responseData); + OnSuccessSubtractCharacterVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Decrements the user's balance of the specified virtual currency by the stated amount. It is possible to make a VC balance negative with this API. */ +UPlayFabServerAPI* UPlayFabServerAPI::SubtractUserVirtualCurrency(FServerSubtractUserVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSubtractUserVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSubtractUserVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SubtractUserVirtualCurrency"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSubtractUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSubtractUserVirtualCurrency.IsBound()) + { + FServerModifyUserVirtualCurrencyResult result = UPlayFabServerModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(response.responseData); + OnSuccessSubtractUserVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Opens a specific container (ContainerItemInstanceId), with a specific key (KeyItemInstanceId, when required), and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. */ +UPlayFabServerAPI* UPlayFabServerAPI::UnlockContainerInstance(FServerUnlockContainerInstanceRequest request, + FDelegateOnSuccessUnlockContainerInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlockContainerInstance = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUnlockContainerInstance); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UnlockContainerInstance"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ContainerItemInstanceId.IsEmpty() || request.ContainerItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContainerItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContainerItemInstanceId"), request.ContainerItemInstanceId); + } + if (request.KeyItemInstanceId.IsEmpty() || request.KeyItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeyItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("KeyItemInstanceId"), request.KeyItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUnlockContainerInstance(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlockContainerInstance.IsBound()) + { + FServerUnlockContainerItemResult result = UPlayFabServerModelDecoder::decodeUnlockContainerItemResultResponse(response.responseData); + OnSuccessUnlockContainerInstance.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Searches Player or Character inventory for any ItemInstance matching the given CatalogItemId, if necessary unlocks it using any appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. */ +UPlayFabServerAPI* UPlayFabServerAPI::UnlockContainerItem(FServerUnlockContainerItemRequest request, + FDelegateOnSuccessUnlockContainerItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlockContainerItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUnlockContainerItem); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UnlockContainerItem"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ContainerItemId.IsEmpty() || request.ContainerItemId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContainerItemId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContainerItemId"), request.ContainerItemId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUnlockContainerItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlockContainerItem.IsBound()) + { + FServerUnlockContainerItemResult result = UPlayFabServerModelDecoder::decodeUnlockContainerItemResultResponse(response.responseData); + OnSuccessUnlockContainerItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the key-value pair data tagged to the specified item, which is read-only from the client. */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserInventoryItemCustomData(FServerUpdateUserInventoryItemDataRequest request, + FDelegateOnSuccessUpdateUserInventoryItemCustomData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserInventoryItemCustomData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserInventoryItemCustomData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserInventoryItemCustomData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserInventoryItemCustomData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserInventoryItemCustomData.IsBound()) + { + FServerEmptyResponse result = UPlayFabServerModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessUpdateUserInventoryItemCustomData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// +/** Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. */ +UPlayFabServerAPI* UPlayFabServerAPI::AddPlayerTag(FServerAddPlayerTagRequest request, + FDelegateOnSuccessAddPlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddPlayerTag = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAddPlayerTag); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AddPlayerTag"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.TagName.IsEmpty() || request.TagName == "") { + OutRestJsonObj->SetFieldNull(TEXT("TagName")); + } else { + OutRestJsonObj->SetStringField(TEXT("TagName"), request.TagName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAddPlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddPlayerTag.IsBound()) + { + FServerAddPlayerTagResult result = UPlayFabServerModelDecoder::decodeAddPlayerTagResultResponse(response.responseData); + OnSuccessAddPlayerTag.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetAllSegments(FServerGetAllSegmentsRequest request, + FDelegateOnSuccessGetAllSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetAllSegments = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetAllSegments); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetAllSegments"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetAllSegments(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetAllSegments.IsBound()) + { + FServerGetAllSegmentsResult result = UPlayFabServerModelDecoder::decodeGetAllSegmentsResultResponse(response.responseData); + OnSuccessGetAllSegments.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** List all segments that a player currently belongs to at this moment in time. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayerSegments(FServerGetPlayersSegmentsRequest request, + FDelegateOnSuccessGetPlayerSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerSegments = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayerSegments); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayerSegments"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayerSegments(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerSegments.IsBound()) + { + FServerGetPlayerSegmentsResult result = UPlayFabServerModelDecoder::decodeGetPlayerSegmentsResultResponse(response.responseData); + OnSuccessGetPlayerSegments.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayersInSegment(FServerGetPlayersInSegmentRequest request, + FDelegateOnSuccessGetPlayersInSegment onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayersInSegment = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayersInSegment); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayersInSegment"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.ContinuationToken.IsEmpty() || request.ContinuationToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContinuationToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContinuationToken"), request.ContinuationToken); + } + OutRestJsonObj->SetNumberField(TEXT("MaxBatchSize"), request.MaxBatchSize); + OutRestJsonObj->SetNumberField(TEXT("SecondsToLive"), request.SecondsToLive); + if (request.SegmentId.IsEmpty() || request.SegmentId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SegmentId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SegmentId"), request.SegmentId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayersInSegment(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayersInSegment.IsBound()) + { + FServerGetPlayersInSegmentResult result = UPlayFabServerModelDecoder::decodeGetPlayersInSegmentResultResponse(response.responseData); + OnSuccessGetPlayersInSegment.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get all tags with a given Namespace (optional) from a player profile. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayerTags(FServerGetPlayerTagsRequest request, + FDelegateOnSuccessGetPlayerTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerTags = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayerTags); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayerTags"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Namespace.IsEmpty() || request.Namespace == "") { + OutRestJsonObj->SetFieldNull(TEXT("Namespace")); + } else { + OutRestJsonObj->SetStringField(TEXT("Namespace"), request.Namespace); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayerTags(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerTags.IsBound()) + { + FServerGetPlayerTagsResult result = UPlayFabServerModelDecoder::decodeGetPlayerTagsResultResponse(response.responseData); + OnSuccessGetPlayerTags.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. */ +UPlayFabServerAPI* UPlayFabServerAPI::RemovePlayerTag(FServerRemovePlayerTagRequest request, + FDelegateOnSuccessRemovePlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemovePlayerTag = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRemovePlayerTag); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RemovePlayerTag"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.TagName.IsEmpty() || request.TagName == "") { + OutRestJsonObj->SetFieldNull(TEXT("TagName")); + } else { + OutRestJsonObj->SetStringField(TEXT("TagName"), request.TagName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRemovePlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemovePlayerTag.IsBound()) + { + FServerRemovePlayerTagResult result = UPlayFabServerModelDecoder::decodeRemovePlayerTagResultResponse(response.responseData); + OnSuccessRemovePlayerTag.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// +/** Executes a CloudScript function, with the 'currentPlayerId' variable set to the specified PlayFabId parameter value. */ +UPlayFabServerAPI* UPlayFabServerAPI::ExecuteCloudScript(FServerExecuteCloudScriptServerRequest request, + FDelegateOnSuccessExecuteCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessExecuteCloudScript = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperExecuteCloudScript); + + // Setup the request + manager->PlayFabRequestURL = "/Server/ExecuteCloudScript"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.FunctionName.IsEmpty() || request.FunctionName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FunctionName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FunctionName"), request.FunctionName); + } + if (request.FunctionParameter != nullptr) OutRestJsonObj->SetObjectField(TEXT("FunctionParameter"), request.FunctionParameter); + OutRestJsonObj->SetBoolField(TEXT("GeneratePlayStreamEvent"), request.GeneratePlayStreamEvent); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + FString temp_RevisionSelection; + if (GetEnumValueToString(TEXT("ECloudScriptRevisionOption"), request.RevisionSelection, temp_RevisionSelection)) + OutRestJsonObj->SetStringField(TEXT("RevisionSelection"), temp_RevisionSelection); + OutRestJsonObj->SetNumberField(TEXT("SpecificRevision"), request.SpecificRevision); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperExecuteCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessExecuteCloudScript.IsBound()) + { + FServerExecuteCloudScriptResult result = UPlayFabServerModelDecoder::decodeExecuteCloudScriptResultResponse(response.responseData); + OnSuccessExecuteCloudScript.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// +/** Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users in the group (and the server) can add new members. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabServerAPI* UPlayFabServerAPI::AddSharedGroupMembers(FServerAddSharedGroupMembersRequest request, + FDelegateOnSuccessAddSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddSharedGroupMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAddSharedGroupMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AddSharedGroupMembers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.PlayFabIds.IsEmpty() || request.PlayFabIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabIds")); + } else { + TArray PlayFabIdsArray; + FString(request.PlayFabIds).ParseIntoArray(PlayFabIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("PlayFabIds"), PlayFabIdsArray); + } + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAddSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddSharedGroupMembers.IsBound()) + { + FServerAddSharedGroupMembersResult result = UPlayFabServerModelDecoder::decodeAddSharedGroupMembersResultResponse(response.responseData); + OnSuccessAddSharedGroupMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the group. When created by a server, the group will initially have no members. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabServerAPI* UPlayFabServerAPI::CreateSharedGroup(FServerCreateSharedGroupRequest request, + FDelegateOnSuccessCreateSharedGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreateSharedGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperCreateSharedGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Server/CreateSharedGroup"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperCreateSharedGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreateSharedGroup.IsBound()) + { + FServerCreateSharedGroupResult result = UPlayFabServerModelDecoder::decodeCreateSharedGroupResultResponse(response.responseData); + OnSuccessCreateSharedGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Deletes a shared group, freeing up the shared group ID to be reused for a new group. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabServerAPI* UPlayFabServerAPI::DeleteSharedGroup(FServerDeleteSharedGroupRequest request, + FDelegateOnSuccessDeleteSharedGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteSharedGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperDeleteSharedGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Server/DeleteSharedGroup"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperDeleteSharedGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteSharedGroup.IsBound()) + { + FServerEmptyResponse result = UPlayFabServerModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessDeleteSharedGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves data stored in a shared group object, as well as the list of members in the group. The server can access all public and private group data. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabServerAPI* UPlayFabServerAPI::GetSharedGroupData(FServerGetSharedGroupDataRequest request, + FDelegateOnSuccessGetSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetSharedGroupData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetSharedGroupData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetSharedGroupData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("GetMembers"), request.GetMembers); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetSharedGroupData.IsBound()) + { + FServerGetSharedGroupDataResult result = UPlayFabServerModelDecoder::decodeGetSharedGroupDataResultResponse(response.responseData); + OnSuccessGetSharedGroupData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the group can remove members. If as a result of the call, zero users remain with access, the group and its associated data will be deleted. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabServerAPI* UPlayFabServerAPI::RemoveSharedGroupMembers(FServerRemoveSharedGroupMembersRequest request, + FDelegateOnSuccessRemoveSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveSharedGroupMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRemoveSharedGroupMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RemoveSharedGroupMembers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.PlayFabIds.IsEmpty() || request.PlayFabIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabIds")); + } else { + TArray PlayFabIdsArray; + FString(request.PlayFabIds).ParseIntoArray(PlayFabIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("PlayFabIds"), PlayFabIdsArray); + } + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRemoveSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveSharedGroupMembers.IsBound()) + { + FServerRemoveSharedGroupMembersResult result = UPlayFabServerModelDecoder::decodeRemoveSharedGroupMembersResultResponse(response.responseData); + OnSuccessRemoveSharedGroupMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated or added in this call will be readable by users not in the group. By default, data permissions are set to Private. Regardless of the permission setting, only members of the group (and the server) can update the data. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateSharedGroupData(FServerUpdateSharedGroupDataRequest request, + FDelegateOnSuccessUpdateSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateSharedGroupData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateSharedGroupData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateSharedGroupData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateSharedGroupData.IsBound()) + { + FServerUpdateSharedGroupDataResult result = UPlayFabServerModelDecoder::decodeUpdateSharedGroupDataResultResponse(response.responseData); + OnSuccessUpdateSharedGroupData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// +/** Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCatalogItems(FServerGetCatalogItemsRequest request, + FDelegateOnSuccessGetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCatalogItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCatalogItems); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCatalogItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCatalogItems.IsBound()) + { + FServerGetCatalogItemsResult result = UPlayFabServerModelDecoder::decodeGetCatalogItemsResultResponse(response.responseData); + OnSuccessGetCatalogItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom publisher settings */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPublisherData(FServerGetPublisherDataRequest request, + FDelegateOnSuccessGetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPublisherData.IsBound()) + { + FServerGetPublisherDataResult result = UPlayFabServerModelDecoder::decodeGetPublisherDataResultResponse(response.responseData); + OnSuccessGetPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the current server time */ +UPlayFabServerAPI* UPlayFabServerAPI::GetTime(FServerGetTimeRequest request, + FDelegateOnSuccessGetTime onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTime = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetTime); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetTime"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetTime(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTime.IsBound()) + { + FServerGetTimeResult result = UPlayFabServerModelDecoder::decodeGetTimeResultResponse(response.responseData); + OnSuccessGetTime.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom title settings */ +UPlayFabServerAPI* UPlayFabServerAPI::GetTitleData(FServerGetTitleDataRequest request, + FDelegateOnSuccessGetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetTitleData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetTitleData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleData.IsBound()) + { + FServerGetTitleDataResult result = UPlayFabServerModelDecoder::decodeGetTitleDataResultResponse(response.responseData); + OnSuccessGetTitleData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom internal title settings */ +UPlayFabServerAPI* UPlayFabServerAPI::GetTitleInternalData(FServerGetTitleDataRequest request, + FDelegateOnSuccessGetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetTitleInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetTitleInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleInternalData.IsBound()) + { + FServerGetTitleDataResult result = UPlayFabServerModelDecoder::decodeGetTitleDataResultResponse(response.responseData); + OnSuccessGetTitleInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title news feed, as configured in the developer portal */ +UPlayFabServerAPI* UPlayFabServerAPI::GetTitleNews(FServerGetTitleNewsRequest request, + FDelegateOnSuccessGetTitleNews onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleNews = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetTitleNews); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetTitleNews"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Count"), request.Count); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetTitleNews(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleNews.IsBound()) + { + FServerGetTitleNewsResult result = UPlayFabServerModelDecoder::decodeGetTitleNewsResultResponse(response.responseData); + OnSuccessGetTitleNews.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the key-value store of custom publisher settings */ +UPlayFabServerAPI* UPlayFabServerAPI::SetPublisherData(FServerSetPublisherDataRequest request, + FDelegateOnSuccessSetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Value.IsEmpty() || request.Value == "") { + OutRestJsonObj->SetFieldNull(TEXT("Value")); + } else { + OutRestJsonObj->SetStringField(TEXT("Value"), request.Value); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetPublisherData.IsBound()) + { + FServerSetPublisherDataResult result = UPlayFabServerModelDecoder::decodeSetPublisherDataResultResponse(response.responseData); + OnSuccessSetPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the key-value store of custom title settings */ +UPlayFabServerAPI* UPlayFabServerAPI::SetTitleData(FServerSetTitleDataRequest request, + FDelegateOnSuccessSetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetTitleData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetTitleData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetTitleData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Value.IsEmpty() || request.Value == "") { + OutRestJsonObj->SetFieldNull(TEXT("Value")); + } else { + OutRestJsonObj->SetStringField(TEXT("Value"), request.Value); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetTitleData.IsBound()) + { + FServerSetTitleDataResult result = UPlayFabServerModelDecoder::decodeSetTitleDataResultResponse(response.responseData); + OnSuccessSetTitleData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the key-value store of custom title settings */ +UPlayFabServerAPI* UPlayFabServerAPI::SetTitleInternalData(FServerSetTitleDataRequest request, + FDelegateOnSuccessSetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetTitleInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetTitleInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetTitleInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Value.IsEmpty() || request.Value == "") { + OutRestJsonObj->SetFieldNull(TEXT("Value")); + } else { + OutRestJsonObj->SetStringField(TEXT("Value"), request.Value); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetTitleInternalData.IsBound()) + { + FServerSetTitleDataResult result = UPlayFabServerModelDecoder::decodeSetTitleDataResultResponse(response.responseData); + OnSuccessSetTitleInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabServerAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabServerAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabServerAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabServerModelDecoder.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabServerModelDecoder.cpp new file mode 100644 index 000000000..dc82b0251 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabServerModelDecoder.cpp @@ -0,0 +1,1050 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Server +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabServerModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Server API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +FServerBanUsersResult UPlayFabServerModelDecoder::decodeBanUsersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerBanUsersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FServerGetPlayerProfileResult UPlayFabServerModelDecoder::decodeGetPlayerProfileResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayerProfileResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayerProfile = !(dataObj->HasField("PlayerProfile")) ? nullptr : dataObj->GetObjectField("PlayerProfile"); + + return tempStruct; +} + +FServerGetPlayFabIDsFromFacebookIDsResult UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromFacebookIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayFabIDsFromFacebookIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FServerGetPlayFabIDsFromFacebookInstantGamesIdsResult UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromFacebookInstantGamesIdsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayFabIDsFromFacebookInstantGamesIdsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsResult UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromNintendoSwitchDeviceIdsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FServerGetPlayFabIDsFromSteamIDsResult UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromSteamIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayFabIDsFromSteamIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FServerGetUserAccountInfoResult UPlayFabServerModelDecoder::decodeGetUserAccountInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetUserAccountInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.UserInfo = !(dataObj->HasField("UserInfo")) ? nullptr : dataObj->GetObjectField("UserInfo"); + + return tempStruct; +} + +FServerGetUserBansResult UPlayFabServerModelDecoder::decodeGetUserBansResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetUserBansResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FServerRevokeAllBansForUserResult UPlayFabServerModelDecoder::decodeRevokeAllBansForUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRevokeAllBansForUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FServerRevokeBansResult UPlayFabServerModelDecoder::decodeRevokeBansResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRevokeBansResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FServerSendCustomAccountRecoveryEmailResult UPlayFabServerModelDecoder::decodeSendCustomAccountRecoveryEmailResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSendCustomAccountRecoveryEmailResult tempStruct; + + + return tempStruct; +} + +FServerSendEmailFromTemplateResult UPlayFabServerModelDecoder::decodeSendEmailFromTemplateResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSendEmailFromTemplateResult tempStruct; + + + return tempStruct; +} + +FServerSendPushNotificationResult UPlayFabServerModelDecoder::decodeSendPushNotificationResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSendPushNotificationResult tempStruct; + + + return tempStruct; +} + +FServerEmptyResponse UPlayFabServerModelDecoder::decodeEmptyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerEmptyResponse tempStruct; + + + return tempStruct; +} + +FServerUpdateBansResult UPlayFabServerModelDecoder::decodeUpdateBansResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUpdateBansResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Analytics +////////////////////////////////////////////////////// + +FServerWriteEventResponse UPlayFabServerModelDecoder::decodeWriteEventResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerWriteEventResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.EventId = !(dataObj->HasField("EventId")) ? TEXT("") : dataObj->GetStringField("EventId"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +FServerAuthenticateSessionTicketResult UPlayFabServerModelDecoder::decodeAuthenticateSessionTicketResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerAuthenticateSessionTicketResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.UserInfo = !(dataObj->HasField("UserInfo")) ? nullptr : dataObj->GetObjectField("UserInfo"); + + return tempStruct; +} + +FServerSetPlayerSecretResult UPlayFabServerModelDecoder::decodeSetPlayerSecretResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSetPlayerSecretResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Character Data +////////////////////////////////////////////////////// + +FServerGetCharacterDataResult UPlayFabServerModelDecoder::decodeGetCharacterDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetCharacterDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FServerUpdateCharacterDataResult UPlayFabServerModelDecoder::decodeUpdateCharacterDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUpdateCharacterDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// + +FServerDeleteCharacterFromUserResult UPlayFabServerModelDecoder::decodeDeleteCharacterFromUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerDeleteCharacterFromUserResult tempStruct; + + + return tempStruct; +} + +FServerListUsersCharactersResult UPlayFabServerModelDecoder::decodeListUsersCharactersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerListUsersCharactersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Characters = !(dataObj->HasField("Characters")) ? TArray() : dataObj->GetObjectArrayField("Characters"); + + return tempStruct; +} + +FServerGetCharacterLeaderboardResult UPlayFabServerModelDecoder::decodeGetCharacterLeaderboardResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetCharacterLeaderboardResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + + return tempStruct; +} + +FServerGetCharacterStatisticsResult UPlayFabServerModelDecoder::decodeGetCharacterStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetCharacterStatisticsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + tempStruct.CharacterStatistics = !(dataObj->HasField("CharacterStatistics")) ? nullptr : dataObj->GetObjectField("CharacterStatistics"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FServerGetLeaderboardAroundCharacterResult UPlayFabServerModelDecoder::decodeGetLeaderboardAroundCharacterResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetLeaderboardAroundCharacterResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + + return tempStruct; +} + +FServerGetLeaderboardForUsersCharactersResult UPlayFabServerModelDecoder::decodeGetLeaderboardForUsersCharactersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetLeaderboardForUsersCharactersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + + return tempStruct; +} + +FServerGrantCharacterToUserResult UPlayFabServerModelDecoder::decodeGrantCharacterToUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGrantCharacterToUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + + return tempStruct; +} + +FServerUpdateCharacterStatisticsResult UPlayFabServerModelDecoder::decodeUpdateCharacterStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUpdateCharacterStatisticsResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// + +FServerGetContentDownloadUrlResult UPlayFabServerModelDecoder::decodeGetContentDownloadUrlResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetContentDownloadUrlResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.URL = !(dataObj->HasField("URL")) ? TEXT("") : dataObj->GetStringField("URL"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Friend List Management +////////////////////////////////////////////////////// + +FServerGetFriendsListResult UPlayFabServerModelDecoder::decodeGetFriendsListResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetFriendsListResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Friends = !(dataObj->HasField("Friends")) ? TArray() : dataObj->GetObjectArrayField("Friends"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +FServerDeregisterGameResponse UPlayFabServerModelDecoder::decodeDeregisterGameResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerDeregisterGameResponse tempStruct; + + + return tempStruct; +} + +FServerNotifyMatchmakerPlayerLeftResult UPlayFabServerModelDecoder::decodeNotifyMatchmakerPlayerLeftResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerNotifyMatchmakerPlayerLeftResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + GetEnumValueFromString(TEXT("EPlayerConnectionState"), dataObj->GetStringField("PlayerState"), tempStruct.PlayerState); + + return tempStruct; +} + +FServerRedeemMatchmakerTicketResult UPlayFabServerModelDecoder::decodeRedeemMatchmakerTicketResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRedeemMatchmakerTicketResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Error = !(dataObj->HasField("Error")) ? TEXT("") : dataObj->GetStringField("Error"); + tempStruct.TicketIsValid = !(dataObj->HasField("TicketIsValid")) ? false : dataObj->GetBoolField("TicketIsValid"); + tempStruct.UserInfo = !(dataObj->HasField("UserInfo")) ? nullptr : dataObj->GetObjectField("UserInfo"); + + return tempStruct; +} + +FServerRefreshGameServerInstanceHeartbeatResult UPlayFabServerModelDecoder::decodeRefreshGameServerInstanceHeartbeatResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRefreshGameServerInstanceHeartbeatResult tempStruct; + + + return tempStruct; +} + +FServerRegisterGameResponse UPlayFabServerModelDecoder::decodeRegisterGameResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRegisterGameResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.LobbyId = !(dataObj->HasField("LobbyId")) ? TEXT("") : dataObj->GetStringField("LobbyId"); + + return tempStruct; +} + +FServerSetGameServerInstanceDataResult UPlayFabServerModelDecoder::decodeSetGameServerInstanceDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSetGameServerInstanceDataResult tempStruct; + + + return tempStruct; +} + +FServerSetGameServerInstanceStateResult UPlayFabServerModelDecoder::decodeSetGameServerInstanceStateResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSetGameServerInstanceStateResult tempStruct; + + + return tempStruct; +} + +FServerSetGameServerInstanceTagsResult UPlayFabServerModelDecoder::decodeSetGameServerInstanceTagsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSetGameServerInstanceTagsResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Platform Specific Methods +////////////////////////////////////////////////////// + +FServerAwardSteamAchievementResult UPlayFabServerModelDecoder::decodeAwardSteamAchievementResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerAwardSteamAchievementResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.AchievementResults = !(dataObj->HasField("AchievementResults")) ? TArray() : dataObj->GetObjectArrayField("AchievementResults"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// + +FServerDeleteUsersResult UPlayFabServerModelDecoder::decodeDeleteUsersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerDeleteUsersResult tempStruct; + + + return tempStruct; +} + +FServerGetLeaderboardResult UPlayFabServerModelDecoder::decodeGetLeaderboardResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetLeaderboardResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + tempStruct.NextReset = !(dataObj->HasField("NextReset")) ? TEXT("") : dataObj->GetStringField("NextReset"); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + +FServerGetLeaderboardAroundUserResult UPlayFabServerModelDecoder::decodeGetLeaderboardAroundUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetLeaderboardAroundUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + tempStruct.NextReset = !(dataObj->HasField("NextReset")) ? TEXT("") : dataObj->GetStringField("NextReset"); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + +FServerGetPlayerCombinedInfoResult UPlayFabServerModelDecoder::decodeGetPlayerCombinedInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayerCombinedInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.InfoResultPayload = !(dataObj->HasField("InfoResultPayload")) ? nullptr : dataObj->GetObjectField("InfoResultPayload"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FServerGetPlayerStatisticsResult UPlayFabServerModelDecoder::decodeGetPlayerStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayerStatisticsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.Statistics = !(dataObj->HasField("Statistics")) ? TArray() : dataObj->GetObjectArrayField("Statistics"); + + return tempStruct; +} + +FServerGetPlayerStatisticVersionsResult UPlayFabServerModelDecoder::decodeGetPlayerStatisticVersionsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayerStatisticVersionsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.StatisticVersions = !(dataObj->HasField("StatisticVersions")) ? TArray() : dataObj->GetObjectArrayField("StatisticVersions"); + + return tempStruct; +} + +FServerGetUserDataResult UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetUserDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FServerUpdatePlayerStatisticsResult UPlayFabServerModelDecoder::decodeUpdatePlayerStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUpdatePlayerStatisticsResult tempStruct; + + + return tempStruct; +} + +FServerUpdateUserDataResult UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUpdateUserDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// + +FServerModifyCharacterVirtualCurrencyResult UPlayFabServerModelDecoder::decodeModifyCharacterVirtualCurrencyResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerModifyCharacterVirtualCurrencyResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Balance = !(dataObj->HasField("Balance")) ? 0 : int(dataObj->GetNumberField("Balance")); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? TEXT("") : dataObj->GetStringField("VirtualCurrency"); + + return tempStruct; +} + +FServerModifyUserVirtualCurrencyResult UPlayFabServerModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerModifyUserVirtualCurrencyResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Balance = !(dataObj->HasField("Balance")) ? 0 : int(dataObj->GetNumberField("Balance")); + tempStruct.BalanceChange = !(dataObj->HasField("BalanceChange")) ? 0 : int(dataObj->GetNumberField("BalanceChange")); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? TEXT("") : dataObj->GetStringField("VirtualCurrency"); + + return tempStruct; +} + +FServerConsumeItemResult UPlayFabServerModelDecoder::decodeConsumeItemResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerConsumeItemResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemInstanceId = !(dataObj->HasField("ItemInstanceId")) ? TEXT("") : dataObj->GetStringField("ItemInstanceId"); + tempStruct.RemainingUses = !(dataObj->HasField("RemainingUses")) ? 0 : int(dataObj->GetNumberField("RemainingUses")); + + return tempStruct; +} + +FServerEvaluateRandomResultTableResult UPlayFabServerModelDecoder::decodeEvaluateRandomResultTableResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerEvaluateRandomResultTableResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ResultItemId = !(dataObj->HasField("ResultItemId")) ? TEXT("") : dataObj->GetStringField("ResultItemId"); + + return tempStruct; +} + +FServerGetCharacterInventoryResult UPlayFabServerModelDecoder::decodeGetCharacterInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetCharacterInventoryResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + tempStruct.Inventory = !(dataObj->HasField("Inventory")) ? TArray() : dataObj->GetObjectArrayField("Inventory"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + tempStruct.VirtualCurrencyRechargeTimes = !(dataObj->HasField("VirtualCurrencyRechargeTimes")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyRechargeTimes"); + + return tempStruct; +} + +FServerGetRandomResultTablesResult UPlayFabServerModelDecoder::decodeGetRandomResultTablesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetRandomResultTablesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Tables = !(dataObj->HasField("Tables")) ? nullptr : dataObj->GetObjectField("Tables"); + + return tempStruct; +} + +FServerGetUserInventoryResult UPlayFabServerModelDecoder::decodeGetUserInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetUserInventoryResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Inventory = !(dataObj->HasField("Inventory")) ? TArray() : dataObj->GetObjectArrayField("Inventory"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + tempStruct.VirtualCurrencyRechargeTimes = !(dataObj->HasField("VirtualCurrencyRechargeTimes")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyRechargeTimes"); + + return tempStruct; +} + +FServerGrantItemsToCharacterResult UPlayFabServerModelDecoder::decodeGrantItemsToCharacterResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGrantItemsToCharacterResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemGrantResults = !(dataObj->HasField("ItemGrantResults")) ? TArray() : dataObj->GetObjectArrayField("ItemGrantResults"); + + return tempStruct; +} + +FServerGrantItemsToUserResult UPlayFabServerModelDecoder::decodeGrantItemsToUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGrantItemsToUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemGrantResults = !(dataObj->HasField("ItemGrantResults")) ? TArray() : dataObj->GetObjectArrayField("ItemGrantResults"); + + return tempStruct; +} + +FServerGrantItemsToUsersResult UPlayFabServerModelDecoder::decodeGrantItemsToUsersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGrantItemsToUsersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemGrantResults = !(dataObj->HasField("ItemGrantResults")) ? TArray() : dataObj->GetObjectArrayField("ItemGrantResults"); + + return tempStruct; +} + +FServerModifyItemUsesResult UPlayFabServerModelDecoder::decodeModifyItemUsesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerModifyItemUsesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemInstanceId = !(dataObj->HasField("ItemInstanceId")) ? TEXT("") : dataObj->GetStringField("ItemInstanceId"); + tempStruct.RemainingUses = !(dataObj->HasField("RemainingUses")) ? 0 : int(dataObj->GetNumberField("RemainingUses")); + + return tempStruct; +} + +FServerMoveItemToCharacterFromCharacterResult UPlayFabServerModelDecoder::decodeMoveItemToCharacterFromCharacterResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerMoveItemToCharacterFromCharacterResult tempStruct; + + + return tempStruct; +} + +FServerMoveItemToCharacterFromUserResult UPlayFabServerModelDecoder::decodeMoveItemToCharacterFromUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerMoveItemToCharacterFromUserResult tempStruct; + + + return tempStruct; +} + +FServerMoveItemToUserFromCharacterResult UPlayFabServerModelDecoder::decodeMoveItemToUserFromCharacterResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerMoveItemToUserFromCharacterResult tempStruct; + + + return tempStruct; +} + +FServerRedeemCouponResult UPlayFabServerModelDecoder::decodeRedeemCouponResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRedeemCouponResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GrantedItems = !(dataObj->HasField("GrantedItems")) ? TArray() : dataObj->GetObjectArrayField("GrantedItems"); + + return tempStruct; +} + +FServerReportPlayerServerResult UPlayFabServerModelDecoder::decodeReportPlayerServerResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerReportPlayerServerResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.SubmissionsRemaining = !(dataObj->HasField("SubmissionsRemaining")) ? 0 : int(dataObj->GetNumberField("SubmissionsRemaining")); + + return tempStruct; +} + +FServerRevokeInventoryResult UPlayFabServerModelDecoder::decodeRevokeInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRevokeInventoryResult tempStruct; + + + return tempStruct; +} + +FServerRevokeInventoryItemsResult UPlayFabServerModelDecoder::decodeRevokeInventoryItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRevokeInventoryItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Errors = !(dataObj->HasField("Errors")) ? TArray() : dataObj->GetObjectArrayField("Errors"); + + return tempStruct; +} + +FServerUnlockContainerItemResult UPlayFabServerModelDecoder::decodeUnlockContainerItemResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUnlockContainerItemResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GrantedItems = !(dataObj->HasField("GrantedItems")) ? TArray() : dataObj->GetObjectArrayField("GrantedItems"); + tempStruct.UnlockedItemInstanceId = !(dataObj->HasField("UnlockedItemInstanceId")) ? TEXT("") : dataObj->GetStringField("UnlockedItemInstanceId"); + tempStruct.UnlockedWithItemInstanceId = !(dataObj->HasField("UnlockedWithItemInstanceId")) ? TEXT("") : dataObj->GetStringField("UnlockedWithItemInstanceId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// + +FServerAddPlayerTagResult UPlayFabServerModelDecoder::decodeAddPlayerTagResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerAddPlayerTagResult tempStruct; + + + return tempStruct; +} + +FServerGetAllSegmentsResult UPlayFabServerModelDecoder::decodeGetAllSegmentsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetAllSegmentsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Segments = !(dataObj->HasField("Segments")) ? TArray() : dataObj->GetObjectArrayField("Segments"); + + return tempStruct; +} + +FServerGetPlayerSegmentsResult UPlayFabServerModelDecoder::decodeGetPlayerSegmentsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayerSegmentsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Segments = !(dataObj->HasField("Segments")) ? TArray() : dataObj->GetObjectArrayField("Segments"); + + return tempStruct; +} + +FServerGetPlayersInSegmentResult UPlayFabServerModelDecoder::decodeGetPlayersInSegmentResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayersInSegmentResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ContinuationToken = !(dataObj->HasField("ContinuationToken")) ? TEXT("") : dataObj->GetStringField("ContinuationToken"); + tempStruct.PlayerProfiles = !(dataObj->HasField("PlayerProfiles")) ? TArray() : dataObj->GetObjectArrayField("PlayerProfiles"); + tempStruct.ProfilesInSegment = !(dataObj->HasField("ProfilesInSegment")) ? 0 : int(dataObj->GetNumberField("ProfilesInSegment")); + + return tempStruct; +} + +FServerGetPlayerTagsResult UPlayFabServerModelDecoder::decodeGetPlayerTagsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayerTagsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.Tags = !(dataObj->HasField("Tags")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("Tags"), TEXT(",")); + + return tempStruct; +} + +FServerRemovePlayerTagResult UPlayFabServerModelDecoder::decodeRemovePlayerTagResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRemovePlayerTagResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +FServerExecuteCloudScriptResult UPlayFabServerModelDecoder::decodeExecuteCloudScriptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerExecuteCloudScriptResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.APIRequestsIssued = !(dataObj->HasField("APIRequestsIssued")) ? 0 : int(dataObj->GetNumberField("APIRequestsIssued")); + tempStruct.Error = !(dataObj->HasField("Error")) ? nullptr : dataObj->GetObjectField("Error"); + tempStruct.ExecutionTimeSeconds = !(dataObj->HasField("ExecutionTimeSeconds")) ? 0 : int(dataObj->GetNumberField("ExecutionTimeSeconds")); + tempStruct.FunctionName = !(dataObj->HasField("FunctionName")) ? TEXT("") : dataObj->GetStringField("FunctionName"); + tempStruct.FunctionResult = !(dataObj->HasField("FunctionResult")) ? nullptr : dataObj->GetObjectField("FunctionResult"); + tempStruct.FunctionResultTooLarge = !(dataObj->HasField("FunctionResultTooLarge")) ? false : dataObj->GetBoolField("FunctionResultTooLarge"); + tempStruct.HttpRequestsIssued = !(dataObj->HasField("HttpRequestsIssued")) ? 0 : int(dataObj->GetNumberField("HttpRequestsIssued")); + tempStruct.Logs = !(dataObj->HasField("Logs")) ? TArray() : dataObj->GetObjectArrayField("Logs"); + tempStruct.LogsTooLarge = !(dataObj->HasField("LogsTooLarge")) ? false : dataObj->GetBoolField("LogsTooLarge"); + tempStruct.MemoryConsumedBytes = !(dataObj->HasField("MemoryConsumedBytes")) ? 0 : int(dataObj->GetNumberField("MemoryConsumedBytes")); + tempStruct.ProcessorTimeSeconds = !(dataObj->HasField("ProcessorTimeSeconds")) ? 0 : int(dataObj->GetNumberField("ProcessorTimeSeconds")); + tempStruct.Revision = !(dataObj->HasField("Revision")) ? 0 : int(dataObj->GetNumberField("Revision")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// + +FServerAddSharedGroupMembersResult UPlayFabServerModelDecoder::decodeAddSharedGroupMembersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerAddSharedGroupMembersResult tempStruct; + + + return tempStruct; +} + +FServerCreateSharedGroupResult UPlayFabServerModelDecoder::decodeCreateSharedGroupResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerCreateSharedGroupResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.SharedGroupId = !(dataObj->HasField("SharedGroupId")) ? TEXT("") : dataObj->GetStringField("SharedGroupId"); + + return tempStruct; +} + +FServerGetSharedGroupDataResult UPlayFabServerModelDecoder::decodeGetSharedGroupDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetSharedGroupDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.Members = !(dataObj->HasField("Members")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("Members"), TEXT(",")); + + return tempStruct; +} + +FServerRemoveSharedGroupMembersResult UPlayFabServerModelDecoder::decodeRemoveSharedGroupMembersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRemoveSharedGroupMembersResult tempStruct; + + + return tempStruct; +} + +FServerUpdateSharedGroupDataResult UPlayFabServerModelDecoder::decodeUpdateSharedGroupDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUpdateSharedGroupDataResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// + +FServerGetCatalogItemsResult UPlayFabServerModelDecoder::decodeGetCatalogItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetCatalogItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Catalog = !(dataObj->HasField("Catalog")) ? TArray() : dataObj->GetObjectArrayField("Catalog"); + + return tempStruct; +} + +FServerGetPublisherDataResult UPlayFabServerModelDecoder::decodeGetPublisherDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPublisherDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + + return tempStruct; +} + +FServerGetTimeResult UPlayFabServerModelDecoder::decodeGetTimeResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetTimeResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Time = !(dataObj->HasField("Time")) ? TEXT("") : dataObj->GetStringField("Time"); + + return tempStruct; +} + +FServerGetTitleDataResult UPlayFabServerModelDecoder::decodeGetTitleDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetTitleDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + + return tempStruct; +} + +FServerGetTitleNewsResult UPlayFabServerModelDecoder::decodeGetTitleNewsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetTitleNewsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.News = !(dataObj->HasField("News")) ? TArray() : dataObj->GetObjectArrayField("News"); + + return tempStruct; +} + +FServerSetPublisherDataResult UPlayFabServerModelDecoder::decodeSetPublisherDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSetPublisherDataResult tempStruct; + + + return tempStruct; +} + +FServerSetTitleDataResult UPlayFabServerModelDecoder::decodeSetTitleDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSetTitleDataResult tempStruct; + + + return tempStruct; +} + + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabServerModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabServerModels.cpp new file mode 100644 index 000000000..a9dbb6648 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabServerModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Server +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabServerModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabUtilities.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabUtilities.cpp new file mode 100644 index 000000000..40766534a --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Private/PlayFabUtilities.cpp @@ -0,0 +1,469 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// This cpp file contains the utilities functions that supports the plugin.. +// +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabUtilities.h" +#include "IPlayFab.h" +#include "PlayFabPrivate.h" + +void UPlayFabUtilities::setPlayFabSettings(FString GameTitleId, FString PlayFabSecretApiKey, FString PhotonRealtimeAppId, FString PhotonTurnbasedAppId, FString PhotonChatAppId) +{ + // Set the settings + IPlayFab::Get().setGameTitleId(GameTitleId); + IPlayFab::Get().setApiSecretKey(PlayFabSecretApiKey); + IPlayFab::Get().setPhotonRealtimeAppId(PhotonRealtimeAppId); + IPlayFab::Get().setPhotonTurnbasedAppId(PhotonTurnbasedAppId); + IPlayFab::Get().setPhotonChatAppId(PhotonChatAppId); +} + +FString UPlayFabUtilities::getPhotonAppId(bool Realtime, bool Chat, bool Turnbased) +{ + if (Realtime) { return IPlayFab::Get().getPhotonRealtimeAppId(); } + else if (Chat) { return IPlayFab::Get().getPhotonChatAppId(); } + else if (Turnbased) { return IPlayFab::Get().getPhotonTurnbasedAppId(); } + else { return ""; } +} + +FString UPlayFabUtilities::getErrorText(int32 code) +{ + // Variable to hold the return text + FString returnText = ""; + + // Switch on the code + switch (code) + { + case 0: returnText = "Success"; break; + case 500: returnText = "UnkownError"; break; + case 1000: returnText = "InvalidParams"; break; + case 1001: returnText = "AccountNotFound"; break; + case 1002: returnText = "AccountBanned"; break; + case 1003: returnText = "InvalidUsernameOrPassword"; break; + case 1004: returnText = "InvalidTitleId"; break; + case 1005: returnText = "InvalidEmailAddress"; break; + case 1006: returnText = "EmailAddressNotAvailable"; break; + case 1007: returnText = "InvalidUsername"; break; + case 1008: returnText = "InvalidPassword"; break; + case 1009: returnText = "UsernameNotAvailable"; break; + case 1010: returnText = "InvalidSteamTicket"; break; + case 1011: returnText = "AccountAlreadyLinked"; break; + case 1012: returnText = "LinkedAccountAlreadyClaimed"; break; + case 1013: returnText = "InvalidFacebookToken"; break; + case 1014: returnText = "AccountNotLinked"; break; + case 1015: returnText = "FailedByPaymentProvider"; break; + case 1016: returnText = "CouponCodeNotFound"; break; + case 1017: returnText = "InvalidContainerItem"; break; + case 1018: returnText = "ContainerNotOwned"; break; + case 1019: returnText = "KeyNotOwned"; break; + case 1020: returnText = "InvalidItemIdInTable"; break; + case 1021: returnText = "InvalidReceipt"; break; + case 1022: returnText = "ReceiptAlreadyUsed"; break; + case 1023: returnText = "ReceiptCancelled"; break; + case 1024: returnText = "GameNotFound"; break; + case 1025: returnText = "GameModeNotFound"; break; + case 1026: returnText = "InvalidGoogleToken"; break; + case 1027: returnText = "UserIsNotPartOfDeveloper"; break; + case 1028: returnText = "InvalidTitleForDeveloper"; break; + case 1029: returnText = "TitleNameConflicts"; break; + case 1030: returnText = "UserisNotValid"; break; + case 1031: returnText = "ValueAlreadyExists"; break; + case 1032: returnText = "BuildNotFound"; break; + case 1033: returnText = "PlayerNotInGame"; break; + case 1034: returnText = "InvalidTicket"; break; + case 1035: returnText = "InvalidDeveloper"; break; + case 1036: returnText = "InvalidOrderInfo"; break; + case 1037: returnText = "RegistrationIncomplete"; break; + case 1038: returnText = "InvalidPlatform"; break; + case 1039: returnText = "UnknownError"; break; + case 1040: returnText = "SteamApplicationNotOwned"; break; + case 1041: returnText = "WrongSteamAccount"; break; + case 1042: returnText = "TitleNotActivated"; break; + case 1043: returnText = "RegistrationSessionNotFound"; break; + case 1044: returnText = "NoSuchMod"; break; + case 1045: returnText = "FileNotFound"; break; + case 1046: returnText = "DuplicateEmail"; break; + case 1047: returnText = "ItemNotFound"; break; + case 1048: returnText = "ItemNotOwned"; break; + case 1049: returnText = "ItemNotRecycleable"; break; + case 1050: returnText = "ItemNotAffordable"; break; + case 1051: returnText = "InvalidVirtualCurrency"; break; + case 1052: returnText = "WrongVirtualCurrency"; break; + case 1053: returnText = "WrongPrice"; break; + case 1054: returnText = "NonPositiveValue"; break; + case 1055: returnText = "InvalidRegion"; break; + case 1056: returnText = "RegionAtCapacity"; break; + case 1057: returnText = "ServerFailedToStart"; break; + case 1058: returnText = "NameNotAvailable"; break; + case 1059: returnText = "InsufficientFunds"; break; + case 1060: returnText = "InvalidDeviceID"; break; + case 1061: returnText = "InvalidPushNotificationToken"; break; + case 1062: returnText = "NoRemainingUses"; break; + case 1063: returnText = "InvalidPaymentProvider"; break; + case 1064: returnText = "PurchaseInitializationFailure"; break; + case 1065: returnText = "DuplicateUsername"; break; + case 1066: returnText = "InvalidBuyerInfo"; break; + case 1067: returnText = "NoGameModeParamsSet"; break; + case 1068: returnText = "BodyTooLarge"; break; + case 1069: returnText = "ReservedWordInBody"; break; + case 1070: returnText = "InvalidTypeInBody"; break; + case 1071: returnText = "InvalidRequest"; break; + case 1072: returnText = "ReservedEventName"; break; + case 1073: returnText = "InvalidUserStatistics"; break; + case 1074: returnText = "NotAuthenticated"; break; + case 1075: returnText = "StreamAlreadyExists"; break; + case 1076: returnText = "ErrorCreatingStream"; break; + case 1077: returnText = "StreamNotFound"; break; + case 1078: returnText = "InvalidAccount"; break; + case 1080: returnText = "PurchaseDoesNotExist"; break; + case 1081: returnText = "InvalidPurchaseTransactionStatus"; break; + case 1082: returnText = "APINotEnabledForGameClientAccess"; break; + case 1083: returnText = "NoPushNotificationARNForTitle"; break; + case 1084: returnText = "BuildAlreadyExists"; break; + case 1085: returnText = "BuildPackageDoesNotExist"; break; + case 1087: returnText = "CustomAnalyticsEventsNotEnabledForTitle"; break; + case 1088: returnText = "InvalidSharedGroupId"; break; + case 1089: returnText = "NotAuthorized"; break; + case 1090: returnText = "MissingTitleGoogleProperties"; break; + case 1091: returnText = "InvalidItemProperties"; break; + case 1092: returnText = "InvalidPSNAuthCode"; break; + case 1093: returnText = "InvalidItemId"; break; + case 1094: returnText = "PushNotEnabledForAccount"; break; + case 1095: returnText = "PushServiceError"; break; + case 1096: returnText = "ReceiptDoesNotContainInAppItems"; break; + case 1097: returnText = "ReceiptContainsMultipleInAppItems"; break; + case 1098: returnText = "InvalidBundleID"; break; + case 1099: returnText = "JavascriptException"; break; + case 1100: returnText = "InvalidSessionTicket"; break; + case 1101: returnText = "UnableToConnectToDatabase"; break; + case 1110: returnText = "InternalServerError"; break; + case 1111: returnText = "InvalidReportDate"; break; + case 1112: returnText = "ReportNotAvailable"; break; + case 1113: returnText = "DatabaseThroughputExceeded"; break; + case 1115: returnText = "InvalidGameTicket"; break; + case 1116: returnText = "ExpiredGameTicket"; break; + case 1117: returnText = "GameTicketDoesNotMatchLobby"; break; + case 1118: returnText = "LinkedDeviceAlreadyClaimed"; break; + case 1119: returnText = "DeviceAlreadyLinked"; break; + case 1120: returnText = "DeviceNotLinked"; break; + case 1121: returnText = "PartialFailure"; break; + case 1122: returnText = "PublisherNotSet"; break; + case 1123: returnText = "ServiceUnavailable"; break; + case 1124: returnText = "VersionNotFound"; break; + case 1125: returnText = "RevisionNotFound"; break; + case 1126: returnText = "InvalidPublisherId"; break; + case 1127: returnText = "DownstreamServiceUnavailable"; break; + case 1128: returnText = "APINotIncludedInTitleUsageTier"; break; + case 1129: returnText = "DAULimitExceeded"; break; + case 1130: returnText = "APIRequestLimitExceeded"; break; + case 1131: returnText = "InvalidAPIEndpoint"; break; + case 1132: returnText = "BuildNotAvailable"; break; + case 1133: returnText = "ConcurrentEditError"; break; + case 1134: returnText = "ContentNotFound"; break; + case 1135: returnText = "CharacterNotFound"; break; + case 1136: returnText = "CloudScriptNotFound"; break; + case 1137: returnText = "ContentQuotaExceeded"; break; + case 1138: returnText = "InvalidCharacterStatistics"; break; + case 1139: returnText = "PhotonNotEnabledForTitle"; break; + case 1140: returnText = "PhotonApplicationNotFound"; break; + case 1141: returnText = "PhotonApplicationNotAssociatedWithTitle"; break; + case 1142: returnText = "InvalidEmailOrPassword"; break; + case 1143: returnText = "FacebookAPIError"; break; + case 1144: returnText = "InvalidContentType"; break; + case 1145: returnText = "KeyLengthExceeded"; break; + case 1146: returnText = "DataLengthExceeded"; break; + case 1147: returnText = "TooManyKeys"; break; + case 1148: returnText = "FreeTierCannotHaveVirtualCurrency"; break; + case 1149: returnText = "MissingAmazonSharedKey"; break; + case 1150: returnText = "AmazonValidationError"; break; + case 1151: returnText = "InvalidPSNIssuerId"; break; + case 1152: returnText = "PSNInaccessible"; break; + case 1153: returnText = "ExpiredAuthToken"; break; + case 1154: returnText = "FailedToGetEntitlements"; break; + case 1155: returnText = "FailedToConsumeEntitlement"; break; + case 1156: returnText = "TradeAcceptingUserNotAllowed"; break; + case 1157: returnText = "TradeInventoryItemIsAssignedToCharacter"; break; + case 1158: returnText = "TradeInventoryItemIsBundle"; break; + case 1159: returnText = "TradeStatusNotValidForCancelling"; break; + case 1160: returnText = "TradeStatusNotValidForAccepting"; break; + case 1161: returnText = "TradeDoesNotExist"; break; + case 1162: returnText = "TradeCancelled"; break; + case 1163: returnText = "TradeAlreadyFilled"; break; + case 1164: returnText = "TradeWaitForStatusTimeout"; break; + case 1165: returnText = "TradeInventoryItemExpired"; break; + case 1166: returnText = "TradeMissingOfferedAndAcceptedItems"; break; + case 1167: returnText = "TradeAcceptedItemIsBundle"; break; + case 1168: returnText = "TradeAcceptedItemIsStackable"; break; + case 1169: returnText = "TradeInventoryItemInvalidStatus"; break; + case 1170: returnText = "TradeAcceptedCatalogItemInvalid"; break; + case 1171: returnText = "TradeAllowedUsersInvalid"; break; + case 1172: returnText = "TradeInventoryItemDoesNotExist"; break; + case 1173: returnText = "TradeInventoryItemIsConsumed"; break; + case 1174: returnText = "TradeInventoryItemIsStackable"; break; + case 1175: returnText = "TradeAcceptedItemsMismatch"; break; + case 1176: returnText = "InvalidKongregateToken"; break; + case 1177: returnText = "FeatureNotConfiguredForTitle"; break; + case 1178: returnText = "NoMatchingCatalogItemForReceipt"; break; + case 1179: returnText = "InvalidCurrencyCode"; break; + case 1180: returnText = "NoRealMoneyPriceForCatalogItem"; break; + case 1181: returnText = "TradeInventoryItemIsNotTradable"; break; + case 1182: returnText = "TradeAcceptedCatalogItemIsNotTradable"; break; + case 1183: returnText = "UsersAlreadyFriends"; break; + case 1184: returnText = "LinkedIdentifierAlreadyClaimed"; break; + case 1185: returnText = "CustomIdNotLinked"; break; + case 1186: returnText = "TotalDataSizeExceeded"; break; + case 1187: returnText = "DeleteKeyConflict"; break; + case 1188: returnText = "InvalidXboxLiveToken"; break; + case 1189: returnText = "ExpiredXboxLiveToken"; break; + case 1190: returnText = "ResettableStatisticVersionRequired"; break; + case 1191: returnText = "NotAuthorizedByTitle"; break; + case 1192: returnText = "NoPartnerEnabled"; break; + case 1193: returnText = "InvalidPartnerResponse"; break; + case 1194: returnText = "APINotEnabledForGameServerAccess"; break; + case 1195: returnText = "StatisticNotFound"; break; + case 1196: returnText = "StatisticNameConflict"; break; + case 1197: returnText = "StatisticVersionClosedForWrites"; break; + case 1198: returnText = "StatisticVersionInvalid"; break; + case 1199: returnText = "APIClientRequestRateLimitExceeded"; break; + case 1200: returnText = "InvalidJSONContent"; break; + case 1201: returnText = "InvalidDropTable"; break; + case 1202: returnText = "StatisticVersionAlreadyIncrementedForScheduledInterval"; break; + case 1203: returnText = "StatisticCountLimitExceeded"; break; + case 1204: returnText = "StatisticVersionIncrementRateExceeded"; break; + case 1205: returnText = "ContainerKeyInvalid"; break; + case 1206: returnText = "CloudScriptExecutionTimeLimitExceeded"; break; + case 1207: returnText = "NoWritePermissionsForEvent"; break; + case 1208: returnText = "CloudScriptFunctionArgumentSizeExceeded"; break; + case 1209: returnText = "CloudScriptAPIRequestCountExceeded"; break; + case 1210: returnText = "CloudScriptAPIRequestError"; break; + case 1211: returnText = "CloudScriptHTTPRequestError"; break; + case 1212: returnText = "InsufficientGuildRole"; break; + case 1213: returnText = "GuildNotFound"; break; + case 1214: returnText = "OverLimit"; break; + case 1215: returnText = "EventNotFound"; break; + case 1216: returnText = "InvalidEventField"; break; + case 1217: returnText = "InvalidEventName"; break; + case 1218: returnText = "CatalogNotConfigured"; break; + case 1219: returnText = "OperationNotSupportedForPlatform"; break; + case 1220: returnText = "SegmentNotFound"; break; + case 1221: returnText = "StoreNotFound"; break; + case 1222: returnText = "InvalidStatisticName"; break; + case 1223: returnText = "TitleNotQualifiedForLimit"; break; + case 1224: returnText = "InvalidServiceLimitLevel"; break; + case 1225: returnText = "ServiceLimitLevelInTransition"; break; + case 1226: returnText = "CouponAlreadyRedeemed"; break; + case 1227: returnText = "GameServerBuildSizeLimitExceeded"; break; + case 1228: returnText = "GameServerBuildCountLimitExceeded"; break; + case 1229: returnText = "VirtualCurrencyCountLimitExceeded"; break; + case 1230: returnText = "VirtualCurrencyCodeExists"; break; + case 1231: returnText = "TitleNewsItemCountLimitExceeded"; break; + case 1232: returnText = "InvalidTwitchToken"; break; + case 1233: returnText = "TwitchResponseError"; break; + case 1234: returnText = "ProfaneDisplayName"; break; + case 1235: returnText = "UserAlreadyAdded"; break; + case 1236: returnText = "InvalidVirtualCurrencyCode"; break; + case 1237: returnText = "VirtualCurrencyCannotBeDeleted"; break; + case 1238: returnText = "IdentifierAlreadyClaimed"; break; + case 1239: returnText = "IdentifierNotLinked"; break; + case 1240: returnText = "InvalidContinuationToken"; break; + case 1241: returnText = "ExpiredContinuationToken"; break; + case 1242: returnText = "InvalidSegment"; break; + case 1243: returnText = "InvalidSessionId"; break; + case 1244: returnText = "SessionLogNotFound"; break; + case 1245: returnText = "InvalidSearchTerm"; break; + case 1246: returnText = "TwoFactorAuthenticationTokenRequired"; break; + case 1247: returnText = "GameServerHostCountLimitExceeded"; break; + case 1248: returnText = "PlayerTagCountLimitExceeded"; break; + case 1249: returnText = "RequestAlreadyRunning"; break; + case 1250: returnText = "ActionGroupNotFound"; break; + case 1251: returnText = "MaximumSegmentBulkActionJobsRunning"; break; + case 1252: returnText = "NoActionsOnPlayersInSegmentJob"; break; + case 1253: returnText = "DuplicateStatisticName"; break; + case 1254: returnText = "ScheduledTaskNameConflict"; break; + case 1255: returnText = "ScheduledTaskCreateConflict"; break; + case 1256: returnText = "InvalidScheduledTaskName"; break; + case 1257: returnText = "InvalidTaskSchedule"; break; + case 1258: returnText = "SteamNotEnabledForTitle"; break; + case 1259: returnText = "LimitNotAnUpgradeOption"; break; + case 1260: returnText = "NoSecretKeyEnabledForCloudScript"; break; + case 1261: returnText = "TaskNotFound"; break; + case 1262: returnText = "TaskInstanceNotFound"; break; + case 1263: returnText = "InvalidIdentityProviderId"; break; + case 1264: returnText = "MisconfiguredIdentityProvider"; break; + case 1265: returnText = "InvalidScheduledTaskType"; break; + case 1266: returnText = "BillingInformationRequired"; break; + case 1267: returnText = "LimitedEditionItemUnavailable"; break; + case 1268: returnText = "InvalidAdPlacementAndReward"; break; + case 1269: returnText = "AllAdPlacementViewsAlreadyConsumed"; break; + case 1270: returnText = "GoogleOAuthNotConfiguredForTitle"; break; + case 1271: returnText = "GoogleOAuthError"; break; + case 1272: returnText = "UserNotFriend"; break; + case 1273: returnText = "InvalidSignature"; break; + case 1274: returnText = "InvalidPublicKey"; break; + case 1275: returnText = "GoogleOAuthNoIdTokenIncludedInResponse"; break; + case 1276: returnText = "StatisticUpdateInProgress"; break; + case 1277: returnText = "LeaderboardVersionNotAvailable"; break; + case 1279: returnText = "StatisticAlreadyHasPrizeTable"; break; + case 1280: returnText = "PrizeTableHasOverlappingRanks"; break; + case 1281: returnText = "PrizeTableHasMissingRanks"; break; + case 1282: returnText = "PrizeTableRankStartsAtZero"; break; + case 1283: returnText = "InvalidStatistic"; break; + case 1284: returnText = "ExpressionParseFailure"; break; + case 1285: returnText = "ExpressionInvokeFailure"; break; + case 1286: returnText = "ExpressionTooLong"; break; + case 1287: returnText = "DataUpdateRateExceeded"; break; + case 1288: returnText = "RestrictedEmailDomain"; break; + case 1289: returnText = "EncryptionKeyDisabled"; break; + case 1290: returnText = "EncryptionKeyMissing"; break; + case 1291: returnText = "EncryptionKeyBroken"; break; + case 1292: returnText = "NoSharedSecretKeyConfigured"; break; + case 1293: returnText = "SecretKeyNotFound"; break; + case 1294: returnText = "PlayerSecretAlreadyConfigured"; break; + case 1295: returnText = "APIRequestsDisabledForTitle"; break; + case 1296: returnText = "InvalidSharedSecretKey"; break; + case 1297: returnText = "PrizeTableHasNoRanks"; break; + case 1298: returnText = "ProfileDoesNotExist"; break; + case 1299: returnText = "ContentS3OriginBucketNotConfigured"; break; + case 1300: returnText = "InvalidEnvironmentForReceipt"; break; + case 1301: returnText = "EncryptedRequestNotAllowed"; break; + case 1302: returnText = "SignedRequestNotAllowed"; break; + case 1303: returnText = "RequestViewConstraintParamsNotAllowed"; break; + case 1304: returnText = "BadPartnerConfiguration"; break; + case 1305: returnText = "XboxBPCertificateFailure"; break; + case 1306: returnText = "XboxXASSExchangeFailure"; break; + case 1307: returnText = "InvalidEntityId"; break; + case 1308: returnText = "StatisticValueAggregationOverflow"; break; + case 1309: returnText = "EmailMessageFromAddressIsMissing"; break; + case 1310: returnText = "EmailMessageToAddressIsMissing"; break; + case 1311: returnText = "SmtpServerAuthenticationError"; break; + case 1312: returnText = "SmtpServerLimitExceeded"; break; + case 1313: returnText = "SmtpServerInsufficientStorage"; break; + case 1314: returnText = "SmtpServerCommunicationError"; break; + case 1315: returnText = "SmtpServerGeneralFailure"; break; + case 1316: returnText = "EmailClientTimeout"; break; + case 1317: returnText = "EmailClientCanceledTask"; break; + case 1318: returnText = "EmailTemplateMissing"; break; + case 1319: returnText = "InvalidHostForTitleId"; break; + case 1320: returnText = "EmailConfirmationTokenDoesNotExist"; break; + case 1321: returnText = "EmailConfirmationTokenExpired"; break; + case 1322: returnText = "AccountDeleted"; break; + case 1323: returnText = "PlayerSecretNotConfigured"; break; + case 1324: returnText = "InvalidSignatureTime"; break; + case 1325: returnText = "NoContactEmailAddressFound"; break; + case 1326: returnText = "InvalidAuthToken"; break; + case 1327: returnText = "AuthTokenDoesNotExist"; break; + case 1328: returnText = "AuthTokenExpired"; break; + case 1329: returnText = "AuthTokenAlreadyUsedToResetPassword"; break; + case 1330: returnText = "MembershipNameTooLong"; break; + case 1331: returnText = "MembershipNotFound"; break; + case 1332: returnText = "GoogleServiceAccountInvalid"; break; + case 1333: returnText = "GoogleServiceAccountParseFailure"; break; + case 1334: returnText = "EntityTokenMissing"; break; + case 1335: returnText = "EntityTokenInvalid"; break; + case 1336: returnText = "EntityTokenExpired"; break; + case 1337: returnText = "EntityTokenRevoked"; break; + case 1338: returnText = "InvalidProductForSubscription"; break; + case 1339: returnText = "XboxInaccessible"; break; + case 1340: returnText = "SubscriptionAlreadyTaken"; break; + case 1341: returnText = "SmtpAddonNotEnabled"; break; + case 1342: returnText = "APIConcurrentRequestLimitExceeded"; break; + case 1343: returnText = "XboxRejectedXSTSExchangeRequest"; break; + case 1344: returnText = "VariableNotDefined"; break; + case 1345: returnText = "TemplateVersionNotDefined"; break; + case 1346: returnText = "FileTooLarge"; break; + case 1347: returnText = "TitleDeleted"; break; + case 1348: returnText = "TitleContainsUserAccounts"; break; + case 1349: returnText = "TitleDeletionPlayerCleanupFailure"; break; + case 1350: returnText = "EntityFileOperationPending"; break; + case 1351: returnText = "NoEntityFileOperationPending"; break; + case 1352: returnText = "EntityProfileVersionMismatch"; break; + case 1353: returnText = "TemplateVersionTooOld"; break; + case 1354: returnText = "MembershipDefinitionInUse"; break; + case 1355: returnText = "PaymentPageNotConfigured"; break; + case 1356: returnText = "FailedLoginAttemptRateLimitExceeded"; break; + case 1357: returnText = "EntityBlockedByGroup"; break; + case 1358: returnText = "RoleDoesNotExist"; break; + case 1359: returnText = "EntityIsAlreadyMember"; break; + case 1360: returnText = "DuplicateRoleId"; break; + case 1361: returnText = "GroupInvitationNotFound"; break; + case 1362: returnText = "GroupApplicationNotFound"; break; + case 1363: returnText = "OutstandingInvitationAcceptedInstead"; break; + case 1364: returnText = "OutstandingApplicationAcceptedInstead"; break; + case 1365: returnText = "RoleIsGroupDefaultMember"; break; + case 1366: returnText = "RoleIsGroupAdmin"; break; + case 1367: returnText = "RoleNameNotAvailable"; break; + case 1368: returnText = "GroupNameNotAvailable"; break; + case 1369: returnText = "EmailReportAlreadySent"; break; + case 1370: returnText = "EmailReportRecipientBlacklisted"; break; + case 1371: returnText = "EventNamespaceNotAllowed"; break; + case 1372: returnText = "EventEntityNotAllowed"; break; + case 1373: returnText = "InvalidEntityType"; break; + case 1374: returnText = "NullTokenResultFromAad"; break; + case 1375: returnText = "InvalidTokenResultFromAad"; break; + case 1376: returnText = "NoValidCertificateForAad"; break; + case 1377: returnText = "InvalidCertificateForAad"; break; + case 1378: returnText = "DuplicateDropTableId"; break; + case 1379: returnText = "MultiplayerServerError"; break; + case 1380: returnText = "MultiplayerServerTooManyRequests"; break; + case 1381: returnText = "MultiplayerServerNoContent"; break; + case 1382: returnText = "MultiplayerServerBadRequest"; break; + case 1383: returnText = "MultiplayerServerUnauthorized"; break; + case 1384: returnText = "MultiplayerServerForbidden"; break; + case 1385: returnText = "MultiplayerServerNotFound"; break; + case 1386: returnText = "MultiplayerServerConflict"; break; + case 1387: returnText = "MultiplayerServerInternalServerError"; break; + case 1388: returnText = "MultiplayerServerUnavailable"; break; + case 1389: returnText = "ExplicitContentDetected"; break; + case 1390: returnText = "PIIContentDetected"; break; + case 1391: returnText = "InvalidScheduledTaskParameter"; break; + case 1392: returnText = "PerEntityEventRateLimitExceeded"; break; + case 1393: returnText = "TitleDefaultLanguageNotSet"; break; + case 1394: returnText = "EmailTemplateMissingDefaultVersion"; break; + case 1395: returnText = "FacebookInstantGamesIdNotLinked"; break; + case 1396: returnText = "InvalidFacebookInstantGamesSignature"; break; + case 1397: returnText = "FacebookInstantGamesAuthNotConfiguredForTitle"; break; + case 2001: returnText = "MatchmakingEntityInvalid"; break; + case 2002: returnText = "MatchmakingPlayerAttributesInvalid"; break; + case 2003: returnText = "MatchmakingCreateRequestMissing"; break; + case 2004: returnText = "MatchmakingCreateRequestCreatorMissing"; break; + case 2005: returnText = "MatchmakingCreateRequestCreatorIdMissing"; break; + case 2006: returnText = "MatchmakingCreateRequestUserListMissing"; break; + case 2007: returnText = "MatchmakingCreateRequestGiveUpAfterInvalid"; break; + case 2008: returnText = "MatchmakingTicketIdMissing"; break; + case 2009: returnText = "MatchmakingMatchIdMissing"; break; + case 2010: returnText = "MatchmakingMatchIdIdMissing"; break; + case 2011: returnText = "MatchmakingQueueNameMissing"; break; + case 2012: returnText = "MatchmakingTitleIdMissing"; break; + case 2013: returnText = "MatchmakingTicketIdIdMissing"; break; + case 2014: returnText = "MatchmakingPlayerIdMissing"; break; + case 2015: returnText = "MatchmakingJoinRequestUserMissing"; break; + case 2016: returnText = "MatchmakingQueueConfigNotFound"; break; + case 2017: returnText = "MatchmakingMatchNotFound"; break; + case 2018: returnText = "MatchmakingTicketNotFound"; break; + case 2019: returnText = "MatchmakingCreateTicketServerIdentityInvalid"; break; + case 2020: returnText = "MatchmakingCreateTicketClientIdentityInvalid"; break; + case 2021: returnText = "MatchmakingGetTicketUserMismatch"; break; + case 2022: returnText = "MatchmakingJoinTicketServerIdentityInvalid"; break; + case 2023: returnText = "MatchmakingJoinTicketUserIdentityMismatch"; break; + case 2024: returnText = "MatchmakingCancelTicketServerIdentityInvalid"; break; + case 2025: returnText = "MatchmakingCancelTicketUserIdentityMismatch"; break; + case 2026: returnText = "MatchmakingGetMatchIdentityMismatch"; break; + case 2027: returnText = "MatchmakingPlayerIdentityMismatch"; break; + case 2028: returnText = "MatchmakingAlreadyJoinedTicket"; break; + case 2029: returnText = "MatchmakingTicketAlreadyCompleted"; break; + case 2030: returnText = "MatchmakingQueueNameInvalid"; break; + case 2031: returnText = "MatchmakingQueueConfigInvalid"; break; + case 2032: returnText = "MatchmakingMemberProfileInvalid"; break; + case 2033: returnText = "WriteAttemptedDuringExport"; break; + case 2034: returnText = "NintendoSwitchDeviceIdNotLinked"; break; + case 2035: returnText = "MatchmakingNotEnabled"; break; + } + + // Return the text + return returnText; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFab/Public/IPlayFab.h b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Public/IPlayFab.h new file mode 100644 index 000000000..a51ed1b30 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFab/Public/IPlayFab.h @@ -0,0 +1,178 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "Modules/ModuleManager.h" +#include "PlayFabCommon.h" + +/** +* The public interface to this module. In most cases, this interface is only public to sibling modules +* within this plugin. +*/ +class IPlayFab : public IModuleInterface +{ +public: + /** + * Singleton-like access to this module's interface. This is just for convenience! + * Beware of calling this during the shutdown phase, though. Your module might have been unloaded already. + * + * @return Returns singleton instance, loading the module on demand if needed + */ + + static inline IPlayFab& Get() + { + return FModuleManager::LoadModuleChecked< IPlayFab >("PlayFab"); + } + + /** + * Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true. + * + * @return True if the module is loaded and ready to use + */ + static inline bool IsAvailable() + { + return FModuleManager::Get().IsModuleLoaded("PlayFab"); + } + + inline FString getGameTitleId() const + { + return IPlayFabCommonModuleInterface::Get().GetTitleId(); + } + inline void setGameTitleId(const FString& NewGameTitleId) + { + IPlayFabCommonModuleInterface::Get().SetTitleId(NewGameTitleId); + } + + inline bool IsClientLoggedIn() const + { + return getSessionTicket().Len() > 0; + } + inline FString getSessionTicket() const + { + return IPlayFabCommonModuleInterface::Get().GetClientSessionTicket(); + } + inline void setSessionTicket(const FString& NewSessionTicket) + { + IPlayFabCommonModuleInterface::Get().SetClientSessionTicket(NewSessionTicket); + } + + inline FString getEntityToken() const + { + return IPlayFabCommonModuleInterface::Get().GetEntityToken(); + } + inline void setEntityToken(const FString& NewEntityToken) + { + IPlayFabCommonModuleInterface::Get().SetEntityToken(NewEntityToken); + } + + inline FString getSecretApiKey() const + { + return IPlayFabCommonModuleInterface::Get().GetPlayFabApiSecretKey(); + } + inline void setApiSecretKey(const FString& NewSecretApiKey) + { + IPlayFabCommonModuleInterface::Get().SetPlayFabApiSecretKey(NewSecretApiKey); + } + + inline FString getVersionString() const + { + return IPlayFabCommonModuleInterface::Get().GetVersionString(); + } + + inline FString getBuildIdentifier() const + { + return IPlayFabCommonModuleInterface::Get().GetBuildIdentifier(); + } + + inline FString getAD_TYPE_ANDROID_ID() const + { + return IPlayFabCommonModuleInterface::Get().GetAD_TYPE_ANDROID_ID(); + } + + inline FString getAD_TYPE_IDFA() const + { + return IPlayFabCommonModuleInterface::Get().GetAD_TYPE_IDFA(); + } + + inline FString getAdvertisingIdType() const + { + return IPlayFabCommonModuleInterface::Get().GetAdvertisingIdType(); + } + + inline void setAdvertisingIdType(FString advertisingIdType) + { + return IPlayFabCommonModuleInterface::Get().SetAdvertisingIdType(advertisingIdType); + } + + inline FString getAdvertisingIdValue() const + { + return IPlayFabCommonModuleInterface::Get().GetAdvertisingIdValue(); + } + + inline void setAdvertisingIdValue(FString advertisingIdValue) + { + return IPlayFabCommonModuleInterface::Get().SetAdvertisingIdValue(advertisingIdValue); + } + + inline FString getPhotonRealtimeAppId() const + { + return IPlayFabCommonModuleInterface::Get().GetPhotonRealtimeAppId(); + } + + inline void setPhotonRealtimeAppId(const FString& photonRealtimeAppId) + { + IPlayFabCommonModuleInterface::Get().SetPhotonRealtimeAppId(photonRealtimeAppId); + } + + inline FString getPhotonTurnbasedAppId() const + { + return IPlayFabCommonModuleInterface::Get().GetPhotonTurnbasedAppId(); + } + + inline void setPhotonTurnbasedAppId(const FString& photonTurnbasedAppId) + { + IPlayFabCommonModuleInterface::Get().SetPhotonTurnbasedAppId(photonTurnbasedAppId); + } + + inline FString getPhotonChatAppId() const + { + return IPlayFabCommonModuleInterface::Get().GetPhotonChatAppId(); + } + + inline void setPhotonChatAppId(const FString& photonChatAppId) + { + IPlayFabCommonModuleInterface::Get().SetPhotonChatAppId(photonChatAppId); + } + + inline bool getDisableAdvertising() const + { + return IPlayFabCommonModuleInterface::Get().GetDisableAdvertising(); + } + + inline FString getUrl(const FString& callPath) const + { + return IPlayFabCommonModuleInterface::Get().GetUrl(callPath); + } + + inline int32 GetPendingCallCount() + { + int32 output; + pendingCallLock.Lock(); + output = pendingCalls; + pendingCallLock.Unlock(); + return output; + } + inline void ModifyPendingCallCount(int32 delta) + { + pendingCallLock.Lock(); + pendingCalls += delta; + pendingCallLock.Unlock(); + } + +private: + FCriticalSection pendingCallLock; + int32 pendingCalls; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/PlayFabCommon.Build.cs b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/PlayFabCommon.Build.cs new file mode 100644 index 000000000..9af7bbb6c --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/PlayFabCommon.Build.cs @@ -0,0 +1,35 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +using UnrealBuildTool; +using System.IO; + +public class PlayFabCommon : ModuleRules +{ + public PlayFabCommon(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public")); + + PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private")); + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "CoreUObject", + "HTTP", + "Json", + } + ); + + if (Target.bBuildEditor == true) + { + PrivateDependencyModuleNames.AddRange(new string[] { + "Settings" + }); + } + } +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Private/PlayFabCommon.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Private/PlayFabCommon.cpp new file mode 100644 index 000000000..9c70276d5 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Private/PlayFabCommon.cpp @@ -0,0 +1,129 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFabCommon.h" + +#if WITH_EDITOR +#include "ISettingsModule.h" +#include "ISettingsSection.h" +#endif // WITH_EDITOR + +#include "PlayFabCommonSettings.h" +#include "PlayFabRuntimeSettings.h" + +#define LOCTEXT_NAMESPACE "FPlayFabCommonsModule" + +class FPlayFabCommonModule : public IPlayFabCommonModuleInterface +{ + /** IModuleInterface implementation */ + virtual void StartupModule() override; + virtual void ShutdownModule() override; + + // Settings + void RegisterSettings(); + void UnregisterSettings(); + + /** Callback for when the settings were saved. */ + bool HandleSettingsSaved(); + + FString GetSdkVersion() const override { return PlayFabCommon::PlayFabCommonSettings::sdkVersion; } + FString GetBuildIdentifier() const override { return PlayFabCommon::PlayFabCommonSettings::buildIdentifier; } + FString GetVersionString() const override { return PlayFabCommon::PlayFabCommonSettings::versionString; } + + FString GetAD_TYPE_IDFA() const override { return PlayFabCommon::PlayFabCommonSettings::AD_TYPE_IDFA; } + FString GetAD_TYPE_ANDROID_ID() const override { return PlayFabCommon::PlayFabCommonSettings::AD_TYPE_ANDROID_ID; } + + FString GetServerURL() const override { return PlayFabCommon::PlayFabCommonSettings::serverURL; } + FString GetProductionEnvironmentURL() const override { return PlayFabCommon::PlayFabCommonSettings::productionEnvironmentURL; } + FString GetTitleId() const override { return PlayFabCommon::PlayFabCommonSettings::titleId; } + FString GetClientSessionTicket() const override { return PlayFabCommon::PlayFabCommonSettings::clientSessionTicket; } + FString GetDeveloperSecretKey() const override { return PlayFabCommon::PlayFabCommonSettings::developerSecretKey; } + FString GetEntityToken() const override { return PlayFabCommon::PlayFabCommonSettings::entityToken; } + FString GetAdvertisingIdType() const override { return PlayFabCommon::PlayFabCommonSettings::advertisingIdType; } + FString GetAdvertisingIdValue() const override { return PlayFabCommon::PlayFabCommonSettings::advertisingIdValue; } + bool GetDisableAdvertising() const override { return PlayFabCommon::PlayFabCommonSettings::disableAdvertising; } + + void SetServerURL(const FString& serverURL) override { PlayFabCommon::PlayFabCommonSettings::serverURL = serverURL; } + void SetProductionEnvironmentURL(const FString& productionEnvironmentURL) override { PlayFabCommon::PlayFabCommonSettings::productionEnvironmentURL = productionEnvironmentURL; } + void SetTitleId(const FString& titleId) override { PlayFabCommon::PlayFabCommonSettings::titleId = titleId; } + void SetClientSessionTicket(const FString& clientSessionTicket) override { PlayFabCommon::PlayFabCommonSettings::clientSessionTicket = clientSessionTicket; } + void SetDeveloperSecretKey(const FString& developerSecretKey) override { PlayFabCommon::PlayFabCommonSettings::developerSecretKey = developerSecretKey; } + void SetEntityToken(const FString& entityToken) override { PlayFabCommon::PlayFabCommonSettings::entityToken = entityToken; } + void SetAdvertisingIdType(const FString& advertisingIdType) override { PlayFabCommon::PlayFabCommonSettings::advertisingIdType = advertisingIdType; } + void SetAdvertisingIdValue(const FString& advertisingIdValue) override { PlayFabCommon::PlayFabCommonSettings::advertisingIdValue = advertisingIdValue; } + void SetDisableAdvertising(bool disableAdvertising) override { PlayFabCommon::PlayFabCommonSettings::disableAdvertising = disableAdvertising; } + + FString GetPlayFabApiSecretKey() const override { return PlayFabCommon::PlayFabCommonSettings::playFabApiSecretKey; } + void SetPlayFabApiSecretKey(const FString & playFabApiSecretKey) override { PlayFabCommon::PlayFabCommonSettings::playFabApiSecretKey = playFabApiSecretKey; } + + FString GetPhotonRealtimeAppId() const override { return PlayFabCommon::PlayFabCommonSettings::photonRealtimeAppId; } + void SetPhotonRealtimeAppId(const FString & photonRealtimeAppId) override { PlayFabCommon::PlayFabCommonSettings::photonRealtimeAppId = photonRealtimeAppId; } + + FString GetPhotonTurnbasedAppId() const override { return PlayFabCommon::PlayFabCommonSettings::photonTurnbasedAppId; } + void SetPhotonTurnbasedAppId(const FString & photonTurnbasedAppId) override { PlayFabCommon::PlayFabCommonSettings::photonTurnbasedAppId = photonTurnbasedAppId; } + + FString GetPhotonChatAppId() const override { return PlayFabCommon::PlayFabCommonSettings::photonChatAppId; } + void SetPhotonChatAppId(const FString & photonChatAppId) override { PlayFabCommon::PlayFabCommonSettings::photonChatAppId = photonChatAppId; } + + FString GetUrl(const FString& callPath) const override { return PlayFabCommon::PlayFabCommonSettings::getURL(callPath); } +}; + +void FPlayFabCommonModule::StartupModule() +{ + // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module + RegisterSettings(); + HandleSettingsSaved(); +} + +void FPlayFabCommonModule::ShutdownModule() +{ + // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, + // we call this function before unloading the module. + UnregisterSettings(); +} + +void FPlayFabCommonModule::RegisterSettings() +{ +#if WITH_EDITOR + if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr("Settings")) + { + ISettingsSectionPtr SettingsSection = SettingsModule->RegisterSettings("Project", "Plugins", "PlayFab", + LOCTEXT("PlayFabSettingsName", "PlayFab"), + LOCTEXT("PlayFabSettingsDescription", "Configure the PlayFab plugin"), + GetMutableDefault() + ); + + if (SettingsSection.IsValid()) + { + SettingsSection->OnModified().BindRaw(this, &FPlayFabCommonModule::HandleSettingsSaved); + } + } +#endif // WITH_EDITOR +} + +void FPlayFabCommonModule::UnregisterSettings() +{ +#if WITH_EDITOR + if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr("Settings")) + { + SettingsModule->UnregisterSettings("Project", "Plugins", "PlayFab"); + } +#endif +} + +bool FPlayFabCommonModule::HandleSettingsSaved() +{ + // copy to the internal structure + PlayFabCommon::PlayFabCommonSettings::serverURL = FString(); // flush the previous Server URL + PlayFabCommon::PlayFabCommonSettings::productionEnvironmentURL = GetDefault()->ProductionEnvironmentURL; + PlayFabCommon::PlayFabCommonSettings::titleId = GetDefault()->TitleId; + PlayFabCommon::PlayFabCommonSettings::developerSecretKey = GetDefault()->DeveloperSecretKey; + + return true; +} + +#undef LOCTEXT_NAMESPACE + +IMPLEMENT_MODULE(FPlayFabCommonModule, PlayFabCommon) diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Private/PlayFabCommonSettings.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Private/PlayFabCommonSettings.cpp new file mode 100644 index 000000000..c07eefbc7 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Private/PlayFabCommonSettings.cpp @@ -0,0 +1,33 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFabCommonSettings.h" + +namespace PlayFabCommon +{ + const FString PlayFabCommonSettings::sdkVersion = "1.1.180829"; + const FString PlayFabCommonSettings::buildIdentifier = "jbuild_unrealmarketplaceplugin_1"; + const FString PlayFabCommonSettings::versionString = "UE4MKPL-1.1.180829"; + + FString PlayFabCommonSettings::serverURL; + FString PlayFabCommonSettings::productionEnvironmentURL = ".playfabapi.com"; + + FString PlayFabCommonSettings::titleId; + + FString PlayFabCommonSettings::clientSessionTicket; + FString PlayFabCommonSettings::developerSecretKey; + FString PlayFabCommonSettings::entityToken; + FString PlayFabCommonSettings::advertisingIdType; + FString PlayFabCommonSettings::advertisingIdValue; + + bool PlayFabCommonSettings::disableAdvertising = false; + const FString PlayFabCommonSettings::AD_TYPE_IDFA = "Idfa"; + const FString PlayFabCommonSettings::AD_TYPE_ANDROID_ID = "Adid"; + + FString PlayFabCommonSettings::playFabApiSecretKey; + FString PlayFabCommonSettings::photonRealtimeAppId; + FString PlayFabCommonSettings::photonTurnbasedAppId; + FString PlayFabCommonSettings::photonChatAppId; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Private/PlayFabRuntimeSettings.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Private/PlayFabRuntimeSettings.cpp new file mode 100644 index 000000000..cefa8c7b3 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Private/PlayFabRuntimeSettings.cpp @@ -0,0 +1,16 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + + #include "PlayFabRuntimeSettings.h" + +////////////////////////////////////////////////////////////////////////// +// UPlayFabRuntimeSettings + +UPlayFabRuntimeSettings::UPlayFabRuntimeSettings() + : ProductionEnvironmentURL(TEXT(".playfabapi.com")) + , TitleId() + , DeveloperSecretKey() +{ +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Public/PlayFabCommon.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Public/PlayFabCommon.h new file mode 100644 index 000000000..587ad6da5 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Public/PlayFabCommon.h @@ -0,0 +1,76 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" +#include "Modules/ModuleManager.h" + +class IPlayFabCommonModuleInterface : public IModuleInterface +{ +public: + + /** + * Singleton-like access to this module's interface. This is just for convenience! + * Beware of calling this during the shutdown phase, though. Your module might have been unloaded already. + * + * @return Returns singleton instance, loading the module on demand if needed + */ + static inline IPlayFabCommonModuleInterface& Get() + { + return FModuleManager::LoadModuleChecked("PlayFabCommon"); + } + + /** + * Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true. + * + * @return True if the module is loaded and ready to use + */ + static inline bool IsAvailable() + { + return FModuleManager::Get().IsModuleLoaded("PlayFabCommon"); + } + + virtual FString GetSdkVersion() const = 0; + virtual FString GetBuildIdentifier() const = 0; + virtual FString GetVersionString() const = 0; + + virtual FString GetAD_TYPE_IDFA() const = 0; + virtual FString GetAD_TYPE_ANDROID_ID() const = 0; + + virtual FString GetServerURL() const = 0; + virtual FString GetProductionEnvironmentURL() const = 0; + virtual FString GetTitleId() const = 0; + virtual FString GetClientSessionTicket() const = 0; + virtual FString GetDeveloperSecretKey() const = 0; + virtual FString GetEntityToken() const = 0; + virtual FString GetAdvertisingIdType() const = 0; + virtual FString GetAdvertisingIdValue() const = 0; + virtual bool GetDisableAdvertising() const = 0; + + virtual void SetServerURL(const FString& serverURL) = 0; + virtual void SetProductionEnvironmentURL(const FString& productionEnvironmentURL) = 0; + virtual void SetTitleId(const FString& titleId) = 0; + virtual void SetClientSessionTicket(const FString& clientSessionTicket) = 0; + virtual void SetDeveloperSecretKey(const FString& developerSecretKey) = 0; + virtual void SetEntityToken(const FString& entityToken) = 0; + virtual void SetAdvertisingIdType(const FString& advertisingIdType) = 0; + virtual void SetAdvertisingIdValue(const FString& advertisingIdValue) = 0; + virtual void SetDisableAdvertising(bool disableAdvertising) = 0; + + virtual FString GetPlayFabApiSecretKey() const = 0; + virtual void SetPlayFabApiSecretKey(const FString& playFabApiSecretKey) = 0; + + virtual FString GetPhotonRealtimeAppId() const = 0; + virtual void SetPhotonRealtimeAppId(const FString & photonRealtimeAppId) = 0; + + virtual FString GetPhotonTurnbasedAppId() const = 0; + virtual void SetPhotonTurnbasedAppId(const FString & photonTurnbasedAppId) = 0; + + virtual FString GetPhotonChatAppId() const = 0; + virtual void SetPhotonChatAppId(const FString & photonChatAppId) = 0; + + virtual FString GetUrl(const FString& callPath) const = 0; +}; \ No newline at end of file diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Public/PlayFabCommonSettings.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Public/PlayFabCommonSettings.h new file mode 100644 index 000000000..d349808c2 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Public/PlayFabCommonSettings.h @@ -0,0 +1,46 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" + +namespace PlayFabCommon +{ + class PlayFabCommonSettings + { + public: + static const FString sdkVersion; + static const FString buildIdentifier; + static const FString versionString; + + static FString serverURL; + static FString productionEnvironmentURL; + static FString titleId; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) + static FString clientSessionTicket; // Secret token that represents your session in the Client API. Set by calling any login method in the Client API + static FString developerSecretKey; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) + static FString entityToken; // Secret token that represents your session in the Entity API. Set by calling GetEntityToken in the Entity API + static FString advertisingIdType; // Set this to the appropriate AD_TYPE_X constant below + static FString advertisingIdValue; // Set this to corresponding device value + + // DisableAdvertising is provided for completeness, but changing it is not suggested + // Disabling this may prevent your advertising-related PlayFab marketplace partners from working correctly + static bool disableAdvertising; + static const FString AD_TYPE_IDFA; + static const FString AD_TYPE_ANDROID_ID; + + static FString playFabApiSecretKey; // PlayFab DeveloperSecretKey + static FString photonRealtimeAppId; + static FString photonTurnbasedAppId; + static FString photonChatAppId; + + static FString getURL(const FString& callPath) + { + if (serverURL.Len() == 0) + serverURL = TEXT("https://") + titleId + productionEnvironmentURL; + return serverURL + callPath + TEXT("?sdk=") + versionString; + } + }; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Public/PlayFabRuntimeSettings.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Public/PlayFabRuntimeSettings.h new file mode 100644 index 000000000..3ad374202 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCommon/Public/PlayFabRuntimeSettings.h @@ -0,0 +1,32 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" +#include "PlayFabRuntimeSettings.generated.h" + +/** +* Implements the settings for the PlayFab plugin. +*/ +UCLASS(config = Engine, defaultconfig) +class PLAYFABCOMMON_API UPlayFabRuntimeSettings : public UObject +{ + GENERATED_BODY() +public: + UPlayFabRuntimeSettings(); + + // URL endpoint of the PlayFab production environment + UPROPERTY(EditAnywhere, config, Category = Settings) + FString ProductionEnvironmentURL; + + // Game Title ID + UPROPERTY(EditAnywhere, config, Category = Settings) + FString TitleId; + + // Secret Key, Do not add this to the clients! + UPROPERTY(EditAnywhere, config, Category = Settings) + FString DeveloperSecretKey; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/PlayFabCpp.Build.cs b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/PlayFabCpp.Build.cs new file mode 100644 index 000000000..6026246a0 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/PlayFabCpp.Build.cs @@ -0,0 +1,30 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +using UnrealBuildTool; +using System.IO; + +public class PlayFabCpp : ModuleRules +{ + public PlayFabCpp(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public")); + + PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private")); + + PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public/Core")); + + PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private/Core")); + + PublicDependencyModuleNames.AddRange(new string[]{ + "Core", + "CoreUObject", + "HTTP", + "Json", + "PlayFabCommon" + }); + } +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAdminAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAdminAPI.cpp new file mode 100644 index 000000000..1adb2b1c2 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAdminAPI.cpp @@ -0,0 +1,2873 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabAdminAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::AdminModels; + +UPlayFabAdminAPI::UPlayFabAdminAPI() {} + +UPlayFabAdminAPI::~UPlayFabAdminAPI() {} + +int UPlayFabAdminAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabAdminAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabAdminAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabAdminAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabAdminAPI::AbortTaskInstance( + AdminModels::FAbortTaskInstanceRequest& request, + const FAbortTaskInstanceDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/AbortTaskInstance")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnAbortTaskInstanceResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnAbortTaskInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAbortTaskInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::AddNews( + AdminModels::FAddNewsRequest& request, + const FAddNewsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/AddNews")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnAddNewsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnAddNewsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddNewsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FAddNewsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::AddPlayerTag( + AdminModels::FAddPlayerTagRequest& request, + const FAddPlayerTagDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/AddPlayerTag")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnAddPlayerTagResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnAddPlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddPlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FAddPlayerTagResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::AddServerBuild( + AdminModels::FAddServerBuildRequest& request, + const FAddServerBuildDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/AddServerBuild")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnAddServerBuildResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnAddServerBuildResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddServerBuildDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FAddServerBuildResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::AddUserVirtualCurrency( + AdminModels::FAddUserVirtualCurrencyRequest& request, + const FAddUserVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/AddUserVirtualCurrency")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnAddUserVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnAddUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FModifyUserVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::AddVirtualCurrencyTypes( + AdminModels::FAddVirtualCurrencyTypesRequest& request, + const FAddVirtualCurrencyTypesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/AddVirtualCurrencyTypes")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnAddVirtualCurrencyTypesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnAddVirtualCurrencyTypesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddVirtualCurrencyTypesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FBlankResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::BanUsers( + AdminModels::FBanUsersRequest& request, + const FBanUsersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/BanUsers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnBanUsersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnBanUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FBanUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FBanUsersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::CheckLimitedEditionItemAvailability( + AdminModels::FCheckLimitedEditionItemAvailabilityRequest& request, + const FCheckLimitedEditionItemAvailabilityDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/CheckLimitedEditionItemAvailability")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnCheckLimitedEditionItemAvailabilityResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnCheckLimitedEditionItemAvailabilityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCheckLimitedEditionItemAvailabilityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FCheckLimitedEditionItemAvailabilityResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::CreateActionsOnPlayersInSegmentTask( + AdminModels::FCreateActionsOnPlayerSegmentTaskRequest& request, + const FCreateActionsOnPlayersInSegmentTaskDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/CreateActionsOnPlayersInSegmentTask")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnCreateActionsOnPlayersInSegmentTaskResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnCreateActionsOnPlayersInSegmentTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateActionsOnPlayersInSegmentTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FCreateTaskResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::CreateCloudScriptTask( + AdminModels::FCreateCloudScriptTaskRequest& request, + const FCreateCloudScriptTaskDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/CreateCloudScriptTask")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnCreateCloudScriptTaskResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnCreateCloudScriptTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateCloudScriptTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FCreateTaskResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::CreatePlayerSharedSecret( + AdminModels::FCreatePlayerSharedSecretRequest& request, + const FCreatePlayerSharedSecretDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/CreatePlayerSharedSecret")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnCreatePlayerSharedSecretResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnCreatePlayerSharedSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreatePlayerSharedSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FCreatePlayerSharedSecretResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::CreatePlayerStatisticDefinition( + AdminModels::FCreatePlayerStatisticDefinitionRequest& request, + const FCreatePlayerStatisticDefinitionDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/CreatePlayerStatisticDefinition")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnCreatePlayerStatisticDefinitionResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnCreatePlayerStatisticDefinitionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreatePlayerStatisticDefinitionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FCreatePlayerStatisticDefinitionResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeleteContent( + AdminModels::FDeleteContentRequest& request, + const FDeleteContentDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeleteContent")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeleteContentResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeleteContentResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteContentDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FBlankResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeleteMasterPlayerAccount( + AdminModels::FDeleteMasterPlayerAccountRequest& request, + const FDeleteMasterPlayerAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeleteMasterPlayerAccount")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeleteMasterPlayerAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeleteMasterPlayerAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteMasterPlayerAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FDeleteMasterPlayerAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeletePlayer( + AdminModels::FDeletePlayerRequest& request, + const FDeletePlayerDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeletePlayer")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeletePlayerResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeletePlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeletePlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FDeletePlayerResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeletePlayerSharedSecret( + AdminModels::FDeletePlayerSharedSecretRequest& request, + const FDeletePlayerSharedSecretDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeletePlayerSharedSecret")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeletePlayerSharedSecretResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeletePlayerSharedSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeletePlayerSharedSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FDeletePlayerSharedSecretResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeleteStore( + AdminModels::FDeleteStoreRequest& request, + const FDeleteStoreDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeleteStore")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeleteStoreResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeleteStoreResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteStoreDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FDeleteStoreResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeleteTask( + AdminModels::FDeleteTaskRequest& request, + const FDeleteTaskDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeleteTask")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeleteTaskResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeleteTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeleteTitle( + + const FDeleteTitleDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeleteTitle")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeleteTitleResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeleteTitleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteTitleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FDeleteTitleResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ExportMasterPlayerData( + AdminModels::FExportMasterPlayerDataRequest& request, + const FExportMasterPlayerDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ExportMasterPlayerData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnExportMasterPlayerDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnExportMasterPlayerDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExportMasterPlayerDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FExportMasterPlayerDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetActionsOnPlayersInSegmentTaskInstance( + AdminModels::FGetTaskInstanceRequest& request, + const FGetActionsOnPlayersInSegmentTaskInstanceDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetActionsOnPlayersInSegmentTaskInstance")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetActionsOnPlayersInSegmentTaskInstanceResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetActionsOnPlayersInSegmentTaskInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetActionsOnPlayersInSegmentTaskInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetActionsOnPlayersInSegmentTaskInstanceResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetAllSegments( + + const FGetAllSegmentsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetAllSegments")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetAllSegmentsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetAllSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetAllSegmentsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetCatalogItems( + AdminModels::FGetCatalogItemsRequest& request, + const FGetCatalogItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetCatalogItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetCatalogItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetCatalogItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetCloudScriptRevision( + AdminModels::FGetCloudScriptRevisionRequest& request, + const FGetCloudScriptRevisionDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetCloudScriptRevision")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetCloudScriptRevisionResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetCloudScriptRevisionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCloudScriptRevisionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetCloudScriptRevisionResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetCloudScriptTaskInstance( + AdminModels::FGetTaskInstanceRequest& request, + const FGetCloudScriptTaskInstanceDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetCloudScriptTaskInstance")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetCloudScriptTaskInstanceResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetCloudScriptTaskInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCloudScriptTaskInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetCloudScriptTaskInstanceResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetCloudScriptVersions( + + const FGetCloudScriptVersionsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetCloudScriptVersions")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetCloudScriptVersionsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetCloudScriptVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCloudScriptVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetCloudScriptVersionsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetContentList( + AdminModels::FGetContentListRequest& request, + const FGetContentListDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetContentList")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetContentListResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetContentListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetContentListResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetContentUploadUrl( + AdminModels::FGetContentUploadUrlRequest& request, + const FGetContentUploadUrlDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetContentUploadUrl")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetContentUploadUrlResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetContentUploadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentUploadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetContentUploadUrlResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetDataReport( + AdminModels::FGetDataReportRequest& request, + const FGetDataReportDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetDataReport")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetDataReportResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetDataReportResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetDataReportDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetDataReportResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetMatchmakerGameInfo( + AdminModels::FGetMatchmakerGameInfoRequest& request, + const FGetMatchmakerGameInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetMatchmakerGameInfo")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetMatchmakerGameInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetMatchmakerGameInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetMatchmakerGameInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetMatchmakerGameInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetMatchmakerGameModes( + AdminModels::FGetMatchmakerGameModesRequest& request, + const FGetMatchmakerGameModesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetMatchmakerGameModes")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetMatchmakerGameModesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetMatchmakerGameModesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetMatchmakerGameModesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetMatchmakerGameModesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayedTitleList( + AdminModels::FGetPlayedTitleListRequest& request, + const FGetPlayedTitleListDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayedTitleList")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayedTitleListResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayedTitleListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayedTitleListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayedTitleListResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerIdFromAuthToken( + AdminModels::FGetPlayerIdFromAuthTokenRequest& request, + const FGetPlayerIdFromAuthTokenDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerIdFromAuthToken")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerIdFromAuthTokenResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerIdFromAuthTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerIdFromAuthTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerIdFromAuthTokenResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerProfile( + AdminModels::FGetPlayerProfileRequest& request, + const FGetPlayerProfileDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerProfile")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerProfileResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerProfileResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerSegments( + AdminModels::FGetPlayersSegmentsRequest& request, + const FGetPlayerSegmentsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerSegments")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerSegmentsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerSegmentsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerSharedSecrets( + + const FGetPlayerSharedSecretsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerSharedSecrets")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerSharedSecretsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerSharedSecretsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSharedSecretsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerSharedSecretsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayersInSegment( + AdminModels::FGetPlayersInSegmentRequest& request, + const FGetPlayersInSegmentDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayersInSegment")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayersInSegmentResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayersInSegmentResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayersInSegmentDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayersInSegmentResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerStatisticDefinitions( + + const FGetPlayerStatisticDefinitionsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerStatisticDefinitions")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerStatisticDefinitionsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerStatisticDefinitionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticDefinitionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerStatisticDefinitionsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerStatisticVersions( + AdminModels::FGetPlayerStatisticVersionsRequest& request, + const FGetPlayerStatisticVersionsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerStatisticVersions")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerStatisticVersionsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerStatisticVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerStatisticVersionsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerTags( + AdminModels::FGetPlayerTagsRequest& request, + const FGetPlayerTagsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerTags")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerTagsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerTagsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPolicy( + AdminModels::FGetPolicyRequest& request, + const FGetPolicyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPolicy")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPolicyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPolicyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPublisherData( + AdminModels::FGetPublisherDataRequest& request, + const FGetPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPublisherDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetRandomResultTables( + AdminModels::FGetRandomResultTablesRequest& request, + const FGetRandomResultTablesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetRandomResultTables")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetRandomResultTablesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetRandomResultTablesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetRandomResultTablesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetRandomResultTablesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetServerBuildInfo( + AdminModels::FGetServerBuildInfoRequest& request, + const FGetServerBuildInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetServerBuildInfo")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetServerBuildInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetServerBuildInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetServerBuildInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetServerBuildInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetServerBuildUploadUrl( + AdminModels::FGetServerBuildUploadURLRequest& request, + const FGetServerBuildUploadUrlDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetServerBuildUploadUrl")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetServerBuildUploadUrlResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetServerBuildUploadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetServerBuildUploadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetServerBuildUploadURLResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetStoreItems( + AdminModels::FGetStoreItemsRequest& request, + const FGetStoreItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetStoreItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetStoreItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetStoreItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetTaskInstances( + AdminModels::FGetTaskInstancesRequest& request, + const FGetTaskInstancesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetTaskInstances")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetTaskInstancesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetTaskInstancesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTaskInstancesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetTaskInstancesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetTasks( + AdminModels::FGetTasksRequest& request, + const FGetTasksDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetTasks")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetTasksResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetTasksResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTasksDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetTasksResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetTitleData( + AdminModels::FGetTitleDataRequest& request, + const FGetTitleDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetTitleData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetTitleDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetTitleInternalData( + AdminModels::FGetTitleDataRequest& request, + const FGetTitleInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetTitleInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetTitleInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserAccountInfo( + AdminModels::FLookupUserAccountInfoRequest& request, + const FGetUserAccountInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserAccountInfo")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserAccountInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserAccountInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserAccountInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FLookupUserAccountInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserBans( + AdminModels::FGetUserBansRequest& request, + const FGetUserBansDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserBans")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserBansResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserBansResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserData( + AdminModels::FGetUserDataRequest& request, + const FGetUserDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserInternalData( + AdminModels::FGetUserDataRequest& request, + const FGetUserInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserInventory( + AdminModels::FGetUserInventoryRequest& request, + const FGetUserInventoryDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserInventory")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserInventoryResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserPublisherData( + AdminModels::FGetUserDataRequest& request, + const FGetUserPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserPublisherInternalData( + AdminModels::FGetUserDataRequest& request, + const FGetUserPublisherInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserPublisherInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserPublisherInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserPublisherReadOnlyData( + AdminModels::FGetUserDataRequest& request, + const FGetUserPublisherReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserPublisherReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserPublisherReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserReadOnlyData( + AdminModels::FGetUserDataRequest& request, + const FGetUserReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GrantItemsToUsers( + AdminModels::FGrantItemsToUsersRequest& request, + const FGrantItemsToUsersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GrantItemsToUsers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGrantItemsToUsersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGrantItemsToUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGrantItemsToUsersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::IncrementLimitedEditionItemAvailability( + AdminModels::FIncrementLimitedEditionItemAvailabilityRequest& request, + const FIncrementLimitedEditionItemAvailabilityDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/IncrementLimitedEditionItemAvailability")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnIncrementLimitedEditionItemAvailabilityResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnIncrementLimitedEditionItemAvailabilityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FIncrementLimitedEditionItemAvailabilityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FIncrementLimitedEditionItemAvailabilityResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::IncrementPlayerStatisticVersion( + AdminModels::FIncrementPlayerStatisticVersionRequest& request, + const FIncrementPlayerStatisticVersionDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/IncrementPlayerStatisticVersion")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnIncrementPlayerStatisticVersionResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnIncrementPlayerStatisticVersionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FIncrementPlayerStatisticVersionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FIncrementPlayerStatisticVersionResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ListServerBuilds( + + const FListServerBuildsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ListServerBuilds")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnListServerBuildsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnListServerBuildsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListServerBuildsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FListBuildsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ListVirtualCurrencyTypes( + + const FListVirtualCurrencyTypesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ListVirtualCurrencyTypes")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnListVirtualCurrencyTypesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnListVirtualCurrencyTypesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListVirtualCurrencyTypesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FListVirtualCurrencyTypesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ModifyMatchmakerGameModes( + AdminModels::FModifyMatchmakerGameModesRequest& request, + const FModifyMatchmakerGameModesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ModifyMatchmakerGameModes")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnModifyMatchmakerGameModesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnModifyMatchmakerGameModesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FModifyMatchmakerGameModesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FModifyMatchmakerGameModesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ModifyServerBuild( + AdminModels::FModifyServerBuildRequest& request, + const FModifyServerBuildDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ModifyServerBuild")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnModifyServerBuildResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnModifyServerBuildResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FModifyServerBuildDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FModifyServerBuildResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RefundPurchase( + AdminModels::FRefundPurchaseRequest& request, + const FRefundPurchaseDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RefundPurchase")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRefundPurchaseResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRefundPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefundPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRefundPurchaseResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RemovePlayerTag( + AdminModels::FRemovePlayerTagRequest& request, + const FRemovePlayerTagDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RemovePlayerTag")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRemovePlayerTagResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRemovePlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemovePlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRemovePlayerTagResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RemoveServerBuild( + AdminModels::FRemoveServerBuildRequest& request, + const FRemoveServerBuildDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RemoveServerBuild")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRemoveServerBuildResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRemoveServerBuildResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveServerBuildDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRemoveServerBuildResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RemoveVirtualCurrencyTypes( + AdminModels::FRemoveVirtualCurrencyTypesRequest& request, + const FRemoveVirtualCurrencyTypesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RemoveVirtualCurrencyTypes")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRemoveVirtualCurrencyTypesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRemoveVirtualCurrencyTypesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveVirtualCurrencyTypesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FBlankResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ResetCharacterStatistics( + AdminModels::FResetCharacterStatisticsRequest& request, + const FResetCharacterStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ResetCharacterStatistics")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnResetCharacterStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnResetCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResetCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FResetCharacterStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ResetPassword( + AdminModels::FResetPasswordRequest& request, + const FResetPasswordDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ResetPassword")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnResetPasswordResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnResetPasswordResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResetPasswordDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FResetPasswordResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ResetUserStatistics( + AdminModels::FResetUserStatisticsRequest& request, + const FResetUserStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ResetUserStatistics")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnResetUserStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnResetUserStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResetUserStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FResetUserStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ResolvePurchaseDispute( + AdminModels::FResolvePurchaseDisputeRequest& request, + const FResolvePurchaseDisputeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ResolvePurchaseDispute")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnResolvePurchaseDisputeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnResolvePurchaseDisputeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResolvePurchaseDisputeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FResolvePurchaseDisputeResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RevokeAllBansForUser( + AdminModels::FRevokeAllBansForUserRequest& request, + const FRevokeAllBansForUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RevokeAllBansForUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRevokeAllBansForUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRevokeAllBansForUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeAllBansForUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRevokeAllBansForUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RevokeBans( + AdminModels::FRevokeBansRequest& request, + const FRevokeBansDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RevokeBans")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRevokeBansResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRevokeBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRevokeBansResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RevokeInventoryItem( + AdminModels::FRevokeInventoryItemRequest& request, + const FRevokeInventoryItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RevokeInventoryItem")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRevokeInventoryItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRevokeInventoryItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRevokeInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RevokeInventoryItems( + AdminModels::FRevokeInventoryItemsRequest& request, + const FRevokeInventoryItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RevokeInventoryItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRevokeInventoryItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRevokeInventoryItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRevokeInventoryItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RunTask( + AdminModels::FRunTaskRequest& request, + const FRunTaskDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RunTask")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRunTaskResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRunTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRunTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRunTaskResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SendAccountRecoveryEmail( + AdminModels::FSendAccountRecoveryEmailRequest& request, + const FSendAccountRecoveryEmailDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SendAccountRecoveryEmail")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSendAccountRecoveryEmailResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSendAccountRecoveryEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendAccountRecoveryEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSendAccountRecoveryEmailResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetCatalogItems( + AdminModels::FUpdateCatalogItemsRequest& request, + const FSetCatalogItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetCatalogItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetCatalogItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateCatalogItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetPlayerSecret( + AdminModels::FSetPlayerSecretRequest& request, + const FSetPlayerSecretDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetPlayerSecret")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetPlayerSecretResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetPlayerSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPlayerSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSetPlayerSecretResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetPublishedRevision( + AdminModels::FSetPublishedRevisionRequest& request, + const FSetPublishedRevisionDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetPublishedRevision")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetPublishedRevisionResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetPublishedRevisionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPublishedRevisionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSetPublishedRevisionResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetPublisherData( + AdminModels::FSetPublisherDataRequest& request, + const FSetPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSetPublisherDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetStoreItems( + AdminModels::FUpdateStoreItemsRequest& request, + const FSetStoreItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetStoreItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetStoreItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateStoreItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetTitleData( + AdminModels::FSetTitleDataRequest& request, + const FSetTitleDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetTitleData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetTitleDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetTitleInternalData( + AdminModels::FSetTitleDataRequest& request, + const FSetTitleInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetTitleInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetTitleInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetupPushNotification( + AdminModels::FSetupPushNotificationRequest& request, + const FSetupPushNotificationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetupPushNotification")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetupPushNotificationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetupPushNotificationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetupPushNotificationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSetupPushNotificationResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SubtractUserVirtualCurrency( + AdminModels::FSubtractUserVirtualCurrencyRequest& request, + const FSubtractUserVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SubtractUserVirtualCurrency")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSubtractUserVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSubtractUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FModifyUserVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateBans( + AdminModels::FUpdateBansRequest& request, + const FUpdateBansDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateBans")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateBansResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateBansResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateCatalogItems( + AdminModels::FUpdateCatalogItemsRequest& request, + const FUpdateCatalogItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateCatalogItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateCatalogItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateCatalogItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateCloudScript( + AdminModels::FUpdateCloudScriptRequest& request, + const FUpdateCloudScriptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateCloudScript")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateCloudScriptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateCloudScriptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdatePlayerSharedSecret( + AdminModels::FUpdatePlayerSharedSecretRequest& request, + const FUpdatePlayerSharedSecretDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdatePlayerSharedSecret")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdatePlayerSharedSecretResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdatePlayerSharedSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerSharedSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdatePlayerSharedSecretResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdatePlayerStatisticDefinition( + AdminModels::FUpdatePlayerStatisticDefinitionRequest& request, + const FUpdatePlayerStatisticDefinitionDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdatePlayerStatisticDefinition")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdatePlayerStatisticDefinitionResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdatePlayerStatisticDefinitionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerStatisticDefinitionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdatePlayerStatisticDefinitionResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdatePolicy( + AdminModels::FUpdatePolicyRequest& request, + const FUpdatePolicyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdatePolicy")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdatePolicyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdatePolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdatePolicyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateRandomResultTables( + AdminModels::FUpdateRandomResultTablesRequest& request, + const FUpdateRandomResultTablesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateRandomResultTables")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateRandomResultTablesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateRandomResultTablesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateRandomResultTablesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateRandomResultTablesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateStoreItems( + AdminModels::FUpdateStoreItemsRequest& request, + const FUpdateStoreItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateStoreItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateStoreItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateStoreItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateTask( + AdminModels::FUpdateTaskRequest& request, + const FUpdateTaskDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateTask")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateTaskResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserData( + AdminModels::FUpdateUserDataRequest& request, + const FUpdateUserDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserInternalData( + AdminModels::FUpdateUserInternalDataRequest& request, + const FUpdateUserInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserPublisherData( + AdminModels::FUpdateUserDataRequest& request, + const FUpdateUserPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserPublisherInternalData( + AdminModels::FUpdateUserInternalDataRequest& request, + const FUpdateUserPublisherInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserPublisherInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserPublisherInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserPublisherReadOnlyData( + AdminModels::FUpdateUserDataRequest& request, + const FUpdateUserPublisherReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserPublisherReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserPublisherReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserReadOnlyData( + AdminModels::FUpdateUserDataRequest& request, + const FUpdateUserReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserTitleDisplayName( + AdminModels::FUpdateUserTitleDisplayNameRequest& request, + const FUpdateUserTitleDisplayNameDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserTitleDisplayName")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserTitleDisplayNameResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserTitleDisplayNameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserTitleDisplayNameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserTitleDisplayNameResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAdminDataModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAdminDataModels.cpp new file mode 100644 index 000000000..820d02726 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAdminDataModels.cpp @@ -0,0 +1,13448 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabAdminDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::AdminModels; + +PlayFab::AdminModels::FAbortTaskInstanceRequest::~FAbortTaskInstanceRequest() +{ + +} + +void PlayFab::AdminModels::FAbortTaskInstanceRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("TaskInstanceId")); writer->WriteValue(TaskInstanceId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAbortTaskInstanceRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TaskInstanceIdValue = obj->TryGetField(TEXT("TaskInstanceId")); + if (TaskInstanceIdValue.IsValid() && !TaskInstanceIdValue->IsNull()) + { + FString TmpValue; + if (TaskInstanceIdValue->TryGetString(TmpValue)) { TaskInstanceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FActionsOnPlayersInSegmentTaskParameter::~FActionsOnPlayersInSegmentTaskParameter() +{ + +} + +void PlayFab::AdminModels::FActionsOnPlayersInSegmentTaskParameter::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ActionId")); writer->WriteValue(ActionId); + + writer->WriteIdentifierPrefix(TEXT("SegmentId")); writer->WriteValue(SegmentId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FActionsOnPlayersInSegmentTaskParameter::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActionIdValue = obj->TryGetField(TEXT("ActionId")); + if (ActionIdValue.IsValid() && !ActionIdValue->IsNull()) + { + FString TmpValue; + if (ActionIdValue->TryGetString(TmpValue)) { ActionId = TmpValue; } + } + + const TSharedPtr SegmentIdValue = obj->TryGetField(TEXT("SegmentId")); + if (SegmentIdValue.IsValid() && !SegmentIdValue->IsNull()) + { + FString TmpValue; + if (SegmentIdValue->TryGetString(TmpValue)) { SegmentId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeTaskInstanceStatusEnumJSON(TaskInstanceStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case TaskInstanceStatusSucceeded: writer->WriteValue(TEXT("Succeeded")); break; + case TaskInstanceStatusStarting: writer->WriteValue(TEXT("Starting")); break; + case TaskInstanceStatusInProgress: writer->WriteValue(TEXT("InProgress")); break; + case TaskInstanceStatusFailed: writer->WriteValue(TEXT("Failed")); break; + case TaskInstanceStatusAborted: writer->WriteValue(TEXT("Aborted")); break; + case TaskInstanceStatusPending: writer->WriteValue(TEXT("Pending")); break; + } +} + +AdminModels::TaskInstanceStatus PlayFab::AdminModels::readTaskInstanceStatusFromValue(const TSharedPtr& value) +{ + return readTaskInstanceStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::TaskInstanceStatus PlayFab::AdminModels::readTaskInstanceStatusFromValue(const FString& value) +{ + static TMap _TaskInstanceStatusMap; + if (_TaskInstanceStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _TaskInstanceStatusMap.Add(TEXT("Succeeded"), TaskInstanceStatusSucceeded); + _TaskInstanceStatusMap.Add(TEXT("Starting"), TaskInstanceStatusStarting); + _TaskInstanceStatusMap.Add(TEXT("InProgress"), TaskInstanceStatusInProgress); + _TaskInstanceStatusMap.Add(TEXT("Failed"), TaskInstanceStatusFailed); + _TaskInstanceStatusMap.Add(TEXT("Aborted"), TaskInstanceStatusAborted); + _TaskInstanceStatusMap.Add(TEXT("Pending"), TaskInstanceStatusPending); + + } + + if (!value.IsEmpty()) + { + auto output = _TaskInstanceStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return TaskInstanceStatusSucceeded; // Basically critical fail +} + +PlayFab::AdminModels::FNameIdentifier::~FNameIdentifier() +{ + +} + +void PlayFab::AdminModels::FNameIdentifier::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Id.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FNameIdentifier::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FActionsOnPlayersInSegmentTaskSummary::~FActionsOnPlayersInSegmentTaskSummary() +{ + //if (TaskIdentifier != nullptr) delete TaskIdentifier; + +} + +void PlayFab::AdminModels::FActionsOnPlayersInSegmentTaskSummary::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CompletedAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("CompletedAt")); writeDatetime(CompletedAt, writer); } + + if (ErrorMessage.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ErrorMessage")); writer->WriteValue(ErrorMessage); } + + if (ErrorWasFatal.notNull()) { writer->WriteIdentifierPrefix(TEXT("ErrorWasFatal")); writer->WriteValue(ErrorWasFatal); } + + if (EstimatedSecondsRemaining.notNull()) { writer->WriteIdentifierPrefix(TEXT("EstimatedSecondsRemaining")); writer->WriteValue(EstimatedSecondsRemaining); } + + if (PercentComplete.notNull()) { writer->WriteIdentifierPrefix(TEXT("PercentComplete")); writer->WriteValue(PercentComplete); } + + if (ScheduledByUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ScheduledByUserId")); writer->WriteValue(ScheduledByUserId); } + + writer->WriteIdentifierPrefix(TEXT("StartedAt")); writeDatetime(StartedAt, writer); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeTaskInstanceStatusEnumJSON(Status, writer); } + + if (TaskIdentifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TaskIdentifier")); TaskIdentifier->writeJSON(writer); } + + if (TaskInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TaskInstanceId")); writer->WriteValue(TaskInstanceId); } + + if (TotalPlayersInSegment.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalPlayersInSegment")); writer->WriteValue(TotalPlayersInSegment); } + + if (TotalPlayersProcessed.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalPlayersProcessed")); writer->WriteValue(TotalPlayersProcessed); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FActionsOnPlayersInSegmentTaskSummary::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CompletedAtValue = obj->TryGetField(TEXT("CompletedAt")); + if (CompletedAtValue.IsValid()) + CompletedAt = readDatetime(CompletedAtValue); + + + const TSharedPtr ErrorMessageValue = obj->TryGetField(TEXT("ErrorMessage")); + if (ErrorMessageValue.IsValid() && !ErrorMessageValue->IsNull()) + { + FString TmpValue; + if (ErrorMessageValue->TryGetString(TmpValue)) { ErrorMessage = TmpValue; } + } + + const TSharedPtr ErrorWasFatalValue = obj->TryGetField(TEXT("ErrorWasFatal")); + if (ErrorWasFatalValue.IsValid() && !ErrorWasFatalValue->IsNull()) + { + bool TmpValue; + if (ErrorWasFatalValue->TryGetBool(TmpValue)) { ErrorWasFatal = TmpValue; } + } + + const TSharedPtr EstimatedSecondsRemainingValue = obj->TryGetField(TEXT("EstimatedSecondsRemaining")); + if (EstimatedSecondsRemainingValue.IsValid() && !EstimatedSecondsRemainingValue->IsNull()) + { + double TmpValue; + if (EstimatedSecondsRemainingValue->TryGetNumber(TmpValue)) { EstimatedSecondsRemaining = TmpValue; } + } + + const TSharedPtr PercentCompleteValue = obj->TryGetField(TEXT("PercentComplete")); + if (PercentCompleteValue.IsValid() && !PercentCompleteValue->IsNull()) + { + double TmpValue; + if (PercentCompleteValue->TryGetNumber(TmpValue)) { PercentComplete = TmpValue; } + } + + const TSharedPtr ScheduledByUserIdValue = obj->TryGetField(TEXT("ScheduledByUserId")); + if (ScheduledByUserIdValue.IsValid() && !ScheduledByUserIdValue->IsNull()) + { + FString TmpValue; + if (ScheduledByUserIdValue->TryGetString(TmpValue)) { ScheduledByUserId = TmpValue; } + } + + const TSharedPtr StartedAtValue = obj->TryGetField(TEXT("StartedAt")); + if (StartedAtValue.IsValid()) + StartedAt = readDatetime(StartedAtValue); + + + Status = readTaskInstanceStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TaskIdentifierValue = obj->TryGetField(TEXT("TaskIdentifier")); + if (TaskIdentifierValue.IsValid() && !TaskIdentifierValue->IsNull()) + { + TaskIdentifier = MakeShareable(new FNameIdentifier(TaskIdentifierValue->AsObject())); + } + + const TSharedPtr TaskInstanceIdValue = obj->TryGetField(TEXT("TaskInstanceId")); + if (TaskInstanceIdValue.IsValid() && !TaskInstanceIdValue->IsNull()) + { + FString TmpValue; + if (TaskInstanceIdValue->TryGetString(TmpValue)) { TaskInstanceId = TmpValue; } + } + + const TSharedPtr TotalPlayersInSegmentValue = obj->TryGetField(TEXT("TotalPlayersInSegment")); + if (TotalPlayersInSegmentValue.IsValid() && !TotalPlayersInSegmentValue->IsNull()) + { + int32 TmpValue; + if (TotalPlayersInSegmentValue->TryGetNumber(TmpValue)) { TotalPlayersInSegment = TmpValue; } + } + + const TSharedPtr TotalPlayersProcessedValue = obj->TryGetField(TEXT("TotalPlayersProcessed")); + if (TotalPlayersProcessedValue.IsValid() && !TotalPlayersProcessedValue->IsNull()) + { + int32 TmpValue; + if (TotalPlayersProcessedValue->TryGetNumber(TmpValue)) { TotalPlayersProcessed = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAdCampaignAttribution::~FAdCampaignAttribution() +{ + +} + +void PlayFab::AdminModels::FAdCampaignAttribution::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AttributedAt")); writeDatetime(AttributedAt, writer); + + if (CampaignId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CampaignId")); writer->WriteValue(CampaignId); } + + if (Platform.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Platform")); writer->WriteValue(Platform); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAdCampaignAttribution::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AttributedAtValue = obj->TryGetField(TEXT("AttributedAt")); + if (AttributedAtValue.IsValid()) + AttributedAt = readDatetime(AttributedAtValue); + + + const TSharedPtr CampaignIdValue = obj->TryGetField(TEXT("CampaignId")); + if (CampaignIdValue.IsValid() && !CampaignIdValue->IsNull()) + { + FString TmpValue; + if (CampaignIdValue->TryGetString(TmpValue)) { CampaignId = TmpValue; } + } + + const TSharedPtr PlatformValue = obj->TryGetField(TEXT("Platform")); + if (PlatformValue.IsValid() && !PlatformValue->IsNull()) + { + FString TmpValue; + if (PlatformValue->TryGetString(TmpValue)) { Platform = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAdCampaignAttributionModel::~FAdCampaignAttributionModel() +{ + +} + +void PlayFab::AdminModels::FAdCampaignAttributionModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AttributedAt")); writeDatetime(AttributedAt, writer); + + if (CampaignId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CampaignId")); writer->WriteValue(CampaignId); } + + if (Platform.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Platform")); writer->WriteValue(Platform); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAdCampaignAttributionModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AttributedAtValue = obj->TryGetField(TEXT("AttributedAt")); + if (AttributedAtValue.IsValid()) + AttributedAt = readDatetime(AttributedAtValue); + + + const TSharedPtr CampaignIdValue = obj->TryGetField(TEXT("CampaignId")); + if (CampaignIdValue.IsValid() && !CampaignIdValue->IsNull()) + { + FString TmpValue; + if (CampaignIdValue->TryGetString(TmpValue)) { CampaignId = TmpValue; } + } + + const TSharedPtr PlatformValue = obj->TryGetField(TEXT("Platform")); + if (PlatformValue.IsValid() && !PlatformValue->IsNull()) + { + FString TmpValue; + if (PlatformValue->TryGetString(TmpValue)) { Platform = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAddNewsRequest::~FAddNewsRequest() +{ + +} + +void PlayFab::AdminModels::FAddNewsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Body")); writer->WriteValue(Body); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteIdentifierPrefix(TEXT("Title")); writer->WriteValue(Title); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddNewsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BodyValue = obj->TryGetField(TEXT("Body")); + if (BodyValue.IsValid() && !BodyValue->IsNull()) + { + FString TmpValue; + if (BodyValue->TryGetString(TmpValue)) { Body = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + const TSharedPtr TitleValue = obj->TryGetField(TEXT("Title")); + if (TitleValue.IsValid() && !TitleValue->IsNull()) + { + FString TmpValue; + if (TitleValue->TryGetString(TmpValue)) { Title = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAddNewsResult::~FAddNewsResult() +{ + +} + +void PlayFab::AdminModels::FAddNewsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NewsId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NewsId")); writer->WriteValue(NewsId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddNewsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NewsIdValue = obj->TryGetField(TEXT("NewsId")); + if (NewsIdValue.IsValid() && !NewsIdValue->IsNull()) + { + FString TmpValue; + if (NewsIdValue->TryGetString(TmpValue)) { NewsId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAddPlayerTagRequest::~FAddPlayerTagRequest() +{ + +} + +void PlayFab::AdminModels::FAddPlayerTagRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("TagName")); writer->WriteValue(TagName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddPlayerTagRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TagNameValue = obj->TryGetField(TEXT("TagName")); + if (TagNameValue.IsValid() && !TagNameValue->IsNull()) + { + FString TmpValue; + if (TagNameValue->TryGetString(TmpValue)) { TagName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAddPlayerTagResult::~FAddPlayerTagResult() +{ + +} + +void PlayFab::AdminModels::FAddPlayerTagResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddPlayerTagResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeRegionEnumJSON(Region enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case RegionUSCentral: writer->WriteValue(TEXT("USCentral")); break; + case RegionUSEast: writer->WriteValue(TEXT("USEast")); break; + case RegionEUWest: writer->WriteValue(TEXT("EUWest")); break; + case RegionSingapore: writer->WriteValue(TEXT("Singapore")); break; + case RegionJapan: writer->WriteValue(TEXT("Japan")); break; + case RegionBrazil: writer->WriteValue(TEXT("Brazil")); break; + case RegionAustralia: writer->WriteValue(TEXT("Australia")); break; + } +} + +AdminModels::Region PlayFab::AdminModels::readRegionFromValue(const TSharedPtr& value) +{ + return readRegionFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::Region PlayFab::AdminModels::readRegionFromValue(const FString& value) +{ + static TMap _RegionMap; + if (_RegionMap.Num() == 0) + { + // Auto-generate the map on the first use + _RegionMap.Add(TEXT("USCentral"), RegionUSCentral); + _RegionMap.Add(TEXT("USEast"), RegionUSEast); + _RegionMap.Add(TEXT("EUWest"), RegionEUWest); + _RegionMap.Add(TEXT("Singapore"), RegionSingapore); + _RegionMap.Add(TEXT("Japan"), RegionJapan); + _RegionMap.Add(TEXT("Brazil"), RegionBrazil); + _RegionMap.Add(TEXT("Australia"), RegionAustralia); + + } + + if (!value.IsEmpty()) + { + auto output = _RegionMap.Find(value); + if (output != nullptr) + return *output; + } + + return RegionUSCentral; // Basically critical fail +} + +PlayFab::AdminModels::FAddServerBuildRequest::~FAddServerBuildRequest() +{ + +} + +void PlayFab::AdminModels::FAddServerBuildRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ActiveRegions.Num() != 0) + { + writer->WriteArrayStart(TEXT("ActiveRegions")); + for (const Region& item : ActiveRegions) + writeRegionEnumJSON(item, writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); + + if (CommandLineTemplate.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CommandLineTemplate")); writer->WriteValue(CommandLineTemplate); } + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + if (ExecutablePath.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ExecutablePath")); writer->WriteValue(ExecutablePath); } + + writer->WriteIdentifierPrefix(TEXT("MaxGamesPerHost")); writer->WriteValue(MaxGamesPerHost); + + writer->WriteIdentifierPrefix(TEXT("MinFreeGameSlots")); writer->WriteValue(MinFreeGameSlots); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddServerBuildRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ActiveRegionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ActiveRegions")); + for (int32 Idx = 0; Idx < ActiveRegionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ActiveRegionsArray[Idx]; + ActiveRegions.Add(readRegionFromValue(CurrentItem)); + } + + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + const TSharedPtr CommandLineTemplateValue = obj->TryGetField(TEXT("CommandLineTemplate")); + if (CommandLineTemplateValue.IsValid() && !CommandLineTemplateValue->IsNull()) + { + FString TmpValue; + if (CommandLineTemplateValue->TryGetString(TmpValue)) { CommandLineTemplate = TmpValue; } + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ExecutablePathValue = obj->TryGetField(TEXT("ExecutablePath")); + if (ExecutablePathValue.IsValid() && !ExecutablePathValue->IsNull()) + { + FString TmpValue; + if (ExecutablePathValue->TryGetString(TmpValue)) { ExecutablePath = TmpValue; } + } + + const TSharedPtr MaxGamesPerHostValue = obj->TryGetField(TEXT("MaxGamesPerHost")); + if (MaxGamesPerHostValue.IsValid() && !MaxGamesPerHostValue->IsNull()) + { + int32 TmpValue; + if (MaxGamesPerHostValue->TryGetNumber(TmpValue)) { MaxGamesPerHost = TmpValue; } + } + + const TSharedPtr MinFreeGameSlotsValue = obj->TryGetField(TEXT("MinFreeGameSlots")); + if (MinFreeGameSlotsValue.IsValid() && !MinFreeGameSlotsValue->IsNull()) + { + int32 TmpValue; + if (MinFreeGameSlotsValue->TryGetNumber(TmpValue)) { MinFreeGameSlots = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeGameBuildStatusEnumJSON(GameBuildStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case GameBuildStatusAvailable: writer->WriteValue(TEXT("Available")); break; + case GameBuildStatusValidating: writer->WriteValue(TEXT("Validating")); break; + case GameBuildStatusInvalidBuildPackage: writer->WriteValue(TEXT("InvalidBuildPackage")); break; + case GameBuildStatusProcessing: writer->WriteValue(TEXT("Processing")); break; + case GameBuildStatusFailedToProcess: writer->WriteValue(TEXT("FailedToProcess")); break; + } +} + +AdminModels::GameBuildStatus PlayFab::AdminModels::readGameBuildStatusFromValue(const TSharedPtr& value) +{ + return readGameBuildStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::GameBuildStatus PlayFab::AdminModels::readGameBuildStatusFromValue(const FString& value) +{ + static TMap _GameBuildStatusMap; + if (_GameBuildStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _GameBuildStatusMap.Add(TEXT("Available"), GameBuildStatusAvailable); + _GameBuildStatusMap.Add(TEXT("Validating"), GameBuildStatusValidating); + _GameBuildStatusMap.Add(TEXT("InvalidBuildPackage"), GameBuildStatusInvalidBuildPackage); + _GameBuildStatusMap.Add(TEXT("Processing"), GameBuildStatusProcessing); + _GameBuildStatusMap.Add(TEXT("FailedToProcess"), GameBuildStatusFailedToProcess); + + } + + if (!value.IsEmpty()) + { + auto output = _GameBuildStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return GameBuildStatusAvailable; // Basically critical fail +} + +PlayFab::AdminModels::FAddServerBuildResult::~FAddServerBuildResult() +{ + +} + +void PlayFab::AdminModels::FAddServerBuildResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ActiveRegions.Num() != 0) + { + writer->WriteArrayStart(TEXT("ActiveRegions")); + for (const Region& item : ActiveRegions) + writeRegionEnumJSON(item, writer); + writer->WriteArrayEnd(); + } + + + if (BuildId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); } + + if (CommandLineTemplate.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CommandLineTemplate")); writer->WriteValue(CommandLineTemplate); } + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + if (ExecutablePath.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ExecutablePath")); writer->WriteValue(ExecutablePath); } + + writer->WriteIdentifierPrefix(TEXT("MaxGamesPerHost")); writer->WriteValue(MaxGamesPerHost); + + writer->WriteIdentifierPrefix(TEXT("MinFreeGameSlots")); writer->WriteValue(MinFreeGameSlots); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeGameBuildStatusEnumJSON(Status, writer); } + + writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddServerBuildResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ActiveRegionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ActiveRegions")); + for (int32 Idx = 0; Idx < ActiveRegionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ActiveRegionsArray[Idx]; + ActiveRegions.Add(readRegionFromValue(CurrentItem)); + } + + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + const TSharedPtr CommandLineTemplateValue = obj->TryGetField(TEXT("CommandLineTemplate")); + if (CommandLineTemplateValue.IsValid() && !CommandLineTemplateValue->IsNull()) + { + FString TmpValue; + if (CommandLineTemplateValue->TryGetString(TmpValue)) { CommandLineTemplate = TmpValue; } + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ExecutablePathValue = obj->TryGetField(TEXT("ExecutablePath")); + if (ExecutablePathValue.IsValid() && !ExecutablePathValue->IsNull()) + { + FString TmpValue; + if (ExecutablePathValue->TryGetString(TmpValue)) { ExecutablePath = TmpValue; } + } + + const TSharedPtr MaxGamesPerHostValue = obj->TryGetField(TEXT("MaxGamesPerHost")); + if (MaxGamesPerHostValue.IsValid() && !MaxGamesPerHostValue->IsNull()) + { + int32 TmpValue; + if (MaxGamesPerHostValue->TryGetNumber(TmpValue)) { MaxGamesPerHost = TmpValue; } + } + + const TSharedPtr MinFreeGameSlotsValue = obj->TryGetField(TEXT("MinFreeGameSlots")); + if (MinFreeGameSlotsValue.IsValid() && !MinFreeGameSlotsValue->IsNull()) + { + int32 TmpValue; + if (MinFreeGameSlotsValue->TryGetNumber(TmpValue)) { MinFreeGameSlots = TmpValue; } + } + + Status = readGameBuildStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAddUserVirtualCurrencyRequest::~FAddUserVirtualCurrencyRequest() +{ + +} + +void PlayFab::AdminModels::FAddUserVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddUserVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FVirtualCurrencyData::~FVirtualCurrencyData() +{ + +} + +void PlayFab::AdminModels::FVirtualCurrencyData::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CurrencyCode")); writer->WriteValue(CurrencyCode); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (InitialDeposit.notNull()) { writer->WriteIdentifierPrefix(TEXT("InitialDeposit")); writer->WriteValue(InitialDeposit); } + + if (RechargeMax.notNull()) { writer->WriteIdentifierPrefix(TEXT("RechargeMax")); writer->WriteValue(RechargeMax); } + + if (RechargeRate.notNull()) { writer->WriteIdentifierPrefix(TEXT("RechargeRate")); writer->WriteValue(RechargeRate); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FVirtualCurrencyData::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyCodeValue = obj->TryGetField(TEXT("CurrencyCode")); + if (CurrencyCodeValue.IsValid() && !CurrencyCodeValue->IsNull()) + { + FString TmpValue; + if (CurrencyCodeValue->TryGetString(TmpValue)) { CurrencyCode = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr InitialDepositValue = obj->TryGetField(TEXT("InitialDeposit")); + if (InitialDepositValue.IsValid() && !InitialDepositValue->IsNull()) + { + int32 TmpValue; + if (InitialDepositValue->TryGetNumber(TmpValue)) { InitialDeposit = TmpValue; } + } + + const TSharedPtr RechargeMaxValue = obj->TryGetField(TEXT("RechargeMax")); + if (RechargeMaxValue.IsValid() && !RechargeMaxValue->IsNull()) + { + int32 TmpValue; + if (RechargeMaxValue->TryGetNumber(TmpValue)) { RechargeMax = TmpValue; } + } + + const TSharedPtr RechargeRateValue = obj->TryGetField(TEXT("RechargeRate")); + if (RechargeRateValue.IsValid() && !RechargeRateValue->IsNull()) + { + int32 TmpValue; + if (RechargeRateValue->TryGetNumber(TmpValue)) { RechargeRate = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAddVirtualCurrencyTypesRequest::~FAddVirtualCurrencyTypesRequest() +{ + +} + +void PlayFab::AdminModels::FAddVirtualCurrencyTypesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("VirtualCurrencies")); + for (const FVirtualCurrencyData& item : VirtualCurrencies) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddVirtualCurrencyTypesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&VirtualCurrenciesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("VirtualCurrencies")); + for (int32 Idx = 0; Idx < VirtualCurrenciesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = VirtualCurrenciesArray[Idx]; + VirtualCurrencies.Add(FVirtualCurrencyData(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeConditionalsEnumJSON(Conditionals enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ConditionalsAny: writer->WriteValue(TEXT("Any")); break; + case ConditionalsTrue: writer->WriteValue(TEXT("True")); break; + case ConditionalsFalse: writer->WriteValue(TEXT("False")); break; + } +} + +AdminModels::Conditionals PlayFab::AdminModels::readConditionalsFromValue(const TSharedPtr& value) +{ + return readConditionalsFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::Conditionals PlayFab::AdminModels::readConditionalsFromValue(const FString& value) +{ + static TMap _ConditionalsMap; + if (_ConditionalsMap.Num() == 0) + { + // Auto-generate the map on the first use + _ConditionalsMap.Add(TEXT("Any"), ConditionalsAny); + _ConditionalsMap.Add(TEXT("True"), ConditionalsTrue); + _ConditionalsMap.Add(TEXT("False"), ConditionalsFalse); + + } + + if (!value.IsEmpty()) + { + auto output = _ConditionalsMap.Find(value); + if (output != nullptr) + return *output; + } + + return ConditionalsAny; // Basically critical fail +} + +PlayFab::AdminModels::FApiCondition::~FApiCondition() +{ + +} + +void PlayFab::AdminModels::FApiCondition::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (HasSignatureOrEncryption.notNull()) { writer->WriteIdentifierPrefix(TEXT("HasSignatureOrEncryption")); writeConditionalsEnumJSON(HasSignatureOrEncryption, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FApiCondition::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSignatureOrEncryption = readConditionalsFromValue(obj->TryGetField(TEXT("HasSignatureOrEncryption"))); + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeAuthTokenTypeEnumJSON(AuthTokenType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case AuthTokenTypeEmail: writer->WriteValue(TEXT("Email")); break; + } +} + +AdminModels::AuthTokenType PlayFab::AdminModels::readAuthTokenTypeFromValue(const TSharedPtr& value) +{ + return readAuthTokenTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::AuthTokenType PlayFab::AdminModels::readAuthTokenTypeFromValue(const FString& value) +{ + static TMap _AuthTokenTypeMap; + if (_AuthTokenTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _AuthTokenTypeMap.Add(TEXT("Email"), AuthTokenTypeEmail); + + } + + if (!value.IsEmpty()) + { + auto output = _AuthTokenTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return AuthTokenTypeEmail; // Basically critical fail +} + +PlayFab::AdminModels::FBanInfo::~FBanInfo() +{ + +} + +void PlayFab::AdminModels::FBanInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Active")); writer->WriteValue(Active); + + if (BanId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BanId")); writer->WriteValue(BanId); } + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (Expires.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); } + + if (IPAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IPAddress")); writer->WriteValue(IPAddress); } + + if (MACAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MACAddress")); writer->WriteValue(MACAddress); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FBanInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActiveValue = obj->TryGetField(TEXT("Active")); + if (ActiveValue.IsValid() && !ActiveValue->IsNull()) + { + bool TmpValue; + if (ActiveValue->TryGetBool(TmpValue)) { Active = TmpValue; } + } + + const TSharedPtr BanIdValue = obj->TryGetField(TEXT("BanId")); + if (BanIdValue.IsValid() && !BanIdValue->IsNull()) + { + FString TmpValue; + if (BanIdValue->TryGetString(TmpValue)) { BanId = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr IPAddressValue = obj->TryGetField(TEXT("IPAddress")); + if (IPAddressValue.IsValid() && !IPAddressValue->IsNull()) + { + FString TmpValue; + if (IPAddressValue->TryGetString(TmpValue)) { IPAddress = TmpValue; } + } + + const TSharedPtr MACAddressValue = obj->TryGetField(TEXT("MACAddress")); + if (MACAddressValue.IsValid() && !MACAddressValue->IsNull()) + { + FString TmpValue; + if (MACAddressValue->TryGetString(TmpValue)) { MACAddress = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FBanRequest::~FBanRequest() +{ + +} + +void PlayFab::AdminModels::FBanRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DurationInHours.notNull()) { writer->WriteIdentifierPrefix(TEXT("DurationInHours")); writer->WriteValue(static_cast(DurationInHours)); } + + if (IPAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IPAddress")); writer->WriteValue(IPAddress); } + + if (MACAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MACAddress")); writer->WriteValue(MACAddress); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FBanRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DurationInHoursValue = obj->TryGetField(TEXT("DurationInHours")); + if (DurationInHoursValue.IsValid() && !DurationInHoursValue->IsNull()) + { + uint32 TmpValue; + if (DurationInHoursValue->TryGetNumber(TmpValue)) { DurationInHours = TmpValue; } + } + + const TSharedPtr IPAddressValue = obj->TryGetField(TEXT("IPAddress")); + if (IPAddressValue.IsValid() && !IPAddressValue->IsNull()) + { + FString TmpValue; + if (IPAddressValue->TryGetString(TmpValue)) { IPAddress = TmpValue; } + } + + const TSharedPtr MACAddressValue = obj->TryGetField(TEXT("MACAddress")); + if (MACAddressValue.IsValid() && !MACAddressValue->IsNull()) + { + FString TmpValue; + if (MACAddressValue->TryGetString(TmpValue)) { MACAddress = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FBanUsersRequest::~FBanUsersRequest() +{ + +} + +void PlayFab::AdminModels::FBanUsersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Bans")); + for (const FBanRequest& item : Bans) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FBanUsersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BansArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Bans")); + for (int32 Idx = 0; Idx < BansArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BansArray[Idx]; + Bans.Add(FBanRequest(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FBanUsersResult::~FBanUsersResult() +{ + +} + +void PlayFab::AdminModels::FBanUsersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FBanUsersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FBlankResult::~FBlankResult() +{ + +} + +void PlayFab::AdminModels::FBlankResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FBlankResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FCatalogItemBundleInfo::~FCatalogItemBundleInfo() +{ + +} + +void PlayFab::AdminModels::FCatalogItemBundleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BundledItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundledItems")); + for (const FString& item : BundledItems) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundledResultTables.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundledResultTables")); + for (const FString& item : BundledResultTables) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundledVirtualCurrencies.Num() != 0) + { + writer->WriteObjectStart(TEXT("BundledVirtualCurrencies")); + for (TMap::TConstIterator It(BundledVirtualCurrencies); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCatalogItemBundleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("BundledItems"), BundledItems); + + obj->TryGetStringArrayField(TEXT("BundledResultTables"), BundledResultTables); + + const TSharedPtr* BundledVirtualCurrenciesObject; + if (obj->TryGetObjectField(TEXT("BundledVirtualCurrencies"), BundledVirtualCurrenciesObject)) + { + for (TMap>::TConstIterator It((*BundledVirtualCurrenciesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + BundledVirtualCurrencies.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCatalogItemConsumableInfo::~FCatalogItemConsumableInfo() +{ + +} + +void PlayFab::AdminModels::FCatalogItemConsumableInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (UsageCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsageCount")); writer->WriteValue(static_cast(UsageCount)); } + + if (UsagePeriod.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsagePeriod")); writer->WriteValue(static_cast(UsagePeriod)); } + + if (UsagePeriodGroup.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UsagePeriodGroup")); writer->WriteValue(UsagePeriodGroup); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCatalogItemConsumableInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UsageCountValue = obj->TryGetField(TEXT("UsageCount")); + if (UsageCountValue.IsValid() && !UsageCountValue->IsNull()) + { + uint32 TmpValue; + if (UsageCountValue->TryGetNumber(TmpValue)) { UsageCount = TmpValue; } + } + + const TSharedPtr UsagePeriodValue = obj->TryGetField(TEXT("UsagePeriod")); + if (UsagePeriodValue.IsValid() && !UsagePeriodValue->IsNull()) + { + uint32 TmpValue; + if (UsagePeriodValue->TryGetNumber(TmpValue)) { UsagePeriod = TmpValue; } + } + + const TSharedPtr UsagePeriodGroupValue = obj->TryGetField(TEXT("UsagePeriodGroup")); + if (UsagePeriodGroupValue.IsValid() && !UsagePeriodGroupValue->IsNull()) + { + FString TmpValue; + if (UsagePeriodGroupValue->TryGetString(TmpValue)) { UsagePeriodGroup = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCatalogItemContainerInfo::~FCatalogItemContainerInfo() +{ + +} + +void PlayFab::AdminModels::FCatalogItemContainerInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemContents")); + for (const FString& item : ItemContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (KeyItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KeyItemId")); writer->WriteValue(KeyItemId); } + + if (ResultTableContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("ResultTableContents")); + for (const FString& item : ResultTableContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyContents.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyContents")); + for (TMap::TConstIterator It(VirtualCurrencyContents); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCatalogItemContainerInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("ItemContents"), ItemContents); + + const TSharedPtr KeyItemIdValue = obj->TryGetField(TEXT("KeyItemId")); + if (KeyItemIdValue.IsValid() && !KeyItemIdValue->IsNull()) + { + FString TmpValue; + if (KeyItemIdValue->TryGetString(TmpValue)) { KeyItemId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("ResultTableContents"), ResultTableContents); + + const TSharedPtr* VirtualCurrencyContentsObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyContents"), VirtualCurrencyContentsObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyContentsObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyContents.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCatalogItem::~FCatalogItem() +{ + //if (Bundle != nullptr) delete Bundle; + //if (Consumable != nullptr) delete Consumable; + //if (Container != nullptr) delete Container; + +} + +void PlayFab::AdminModels::FCatalogItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Bundle.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Bundle")); Bundle->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("CanBecomeCharacter")); writer->WriteValue(CanBecomeCharacter); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (Consumable.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Consumable")); Consumable->writeJSON(writer); } + + if (Container.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Container")); Container->writeJSON(writer); } + + if (CustomData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomData")); writer->WriteValue(CustomData); } + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + writer->WriteIdentifierPrefix(TEXT("InitialLimitedEditionCount")); writer->WriteValue(InitialLimitedEditionCount); + + writer->WriteIdentifierPrefix(TEXT("IsLimitedEdition")); writer->WriteValue(IsLimitedEdition); + + writer->WriteIdentifierPrefix(TEXT("IsStackable")); writer->WriteValue(IsStackable); + + writer->WriteIdentifierPrefix(TEXT("IsTradable")); writer->WriteValue(IsTradable); + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (ItemImageUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemImageUrl")); writer->WriteValue(ItemImageUrl); } + + if (RealCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("RealCurrencyPrices")); + for (TMap::TConstIterator It(RealCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyPrices")); + for (TMap::TConstIterator It(VirtualCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCatalogItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BundleValue = obj->TryGetField(TEXT("Bundle")); + if (BundleValue.IsValid() && !BundleValue->IsNull()) + { + Bundle = MakeShareable(new FCatalogItemBundleInfo(BundleValue->AsObject())); + } + + const TSharedPtr CanBecomeCharacterValue = obj->TryGetField(TEXT("CanBecomeCharacter")); + if (CanBecomeCharacterValue.IsValid() && !CanBecomeCharacterValue->IsNull()) + { + bool TmpValue; + if (CanBecomeCharacterValue->TryGetBool(TmpValue)) { CanBecomeCharacter = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr ConsumableValue = obj->TryGetField(TEXT("Consumable")); + if (ConsumableValue.IsValid() && !ConsumableValue->IsNull()) + { + Consumable = MakeShareable(new FCatalogItemConsumableInfo(ConsumableValue->AsObject())); + } + + const TSharedPtr ContainerValue = obj->TryGetField(TEXT("Container")); + if (ContainerValue.IsValid() && !ContainerValue->IsNull()) + { + Container = MakeShareable(new FCatalogItemContainerInfo(ContainerValue->AsObject())); + } + + const TSharedPtr CustomDataValue = obj->TryGetField(TEXT("CustomData")); + if (CustomDataValue.IsValid() && !CustomDataValue->IsNull()) + { + FString TmpValue; + if (CustomDataValue->TryGetString(TmpValue)) { CustomData = TmpValue; } + } + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr InitialLimitedEditionCountValue = obj->TryGetField(TEXT("InitialLimitedEditionCount")); + if (InitialLimitedEditionCountValue.IsValid() && !InitialLimitedEditionCountValue->IsNull()) + { + int32 TmpValue; + if (InitialLimitedEditionCountValue->TryGetNumber(TmpValue)) { InitialLimitedEditionCount = TmpValue; } + } + + const TSharedPtr IsLimitedEditionValue = obj->TryGetField(TEXT("IsLimitedEdition")); + if (IsLimitedEditionValue.IsValid() && !IsLimitedEditionValue->IsNull()) + { + bool TmpValue; + if (IsLimitedEditionValue->TryGetBool(TmpValue)) { IsLimitedEdition = TmpValue; } + } + + const TSharedPtr IsStackableValue = obj->TryGetField(TEXT("IsStackable")); + if (IsStackableValue.IsValid() && !IsStackableValue->IsNull()) + { + bool TmpValue; + if (IsStackableValue->TryGetBool(TmpValue)) { IsStackable = TmpValue; } + } + + const TSharedPtr IsTradableValue = obj->TryGetField(TEXT("IsTradable")); + if (IsTradableValue.IsValid() && !IsTradableValue->IsNull()) + { + bool TmpValue; + if (IsTradableValue->TryGetBool(TmpValue)) { IsTradable = TmpValue; } + } + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemImageUrlValue = obj->TryGetField(TEXT("ItemImageUrl")); + if (ItemImageUrlValue.IsValid() && !ItemImageUrlValue->IsNull()) + { + FString TmpValue; + if (ItemImageUrlValue->TryGetString(TmpValue)) { ItemImageUrl = TmpValue; } + } + + const TSharedPtr* RealCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("RealCurrencyPrices"), RealCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*RealCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + RealCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr* VirtualCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyPrices"), VirtualCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCheckLimitedEditionItemAvailabilityRequest::~FCheckLimitedEditionItemAvailabilityRequest() +{ + +} + +void PlayFab::AdminModels::FCheckLimitedEditionItemAvailabilityRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCheckLimitedEditionItemAvailabilityRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCheckLimitedEditionItemAvailabilityResult::~FCheckLimitedEditionItemAvailabilityResult() +{ + +} + +void PlayFab::AdminModels::FCheckLimitedEditionItemAvailabilityResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCheckLimitedEditionItemAvailabilityResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCloudScriptFile::~FCloudScriptFile() +{ + +} + +void PlayFab::AdminModels::FCloudScriptFile::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FileContents")); writer->WriteValue(FileContents); + + writer->WriteIdentifierPrefix(TEXT("Filename")); writer->WriteValue(Filename); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCloudScriptFile::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FileContentsValue = obj->TryGetField(TEXT("FileContents")); + if (FileContentsValue.IsValid() && !FileContentsValue->IsNull()) + { + FString TmpValue; + if (FileContentsValue->TryGetString(TmpValue)) { FileContents = TmpValue; } + } + + const TSharedPtr FilenameValue = obj->TryGetField(TEXT("Filename")); + if (FilenameValue.IsValid() && !FilenameValue->IsNull()) + { + FString TmpValue; + if (FilenameValue->TryGetString(TmpValue)) { Filename = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCloudScriptTaskParameter::~FCloudScriptTaskParameter() +{ + +} + +void PlayFab::AdminModels::FCloudScriptTaskParameter::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Argument.notNull()) { writer->WriteIdentifierPrefix(TEXT("Argument")); Argument.writeJSON(writer); } + + if (FunctionName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCloudScriptTaskParameter::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ArgumentValue = obj->TryGetField(TEXT("Argument")); + if (ArgumentValue.IsValid() && !ArgumentValue->IsNull()) + { + Argument = FJsonKeeper(ArgumentValue); + } + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FScriptExecutionError::~FScriptExecutionError() +{ + +} + +void PlayFab::AdminModels::FScriptExecutionError::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + if (StackTrace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StackTrace")); writer->WriteValue(StackTrace); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FScriptExecutionError::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + const TSharedPtr StackTraceValue = obj->TryGetField(TEXT("StackTrace")); + if (StackTraceValue.IsValid() && !StackTraceValue->IsNull()) + { + FString TmpValue; + if (StackTraceValue->TryGetString(TmpValue)) { StackTrace = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FLogStatement::~FLogStatement() +{ + +} + +void PlayFab::AdminModels::FLogStatement::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.notNull()) { writer->WriteIdentifierPrefix(TEXT("Data")); Data.writeJSON(writer); } + + if (Level.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Level")); writer->WriteValue(Level); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FLogStatement::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataValue = obj->TryGetField(TEXT("Data")); + if (DataValue.IsValid() && !DataValue->IsNull()) + { + Data = FJsonKeeper(DataValue); + } + + const TSharedPtr LevelValue = obj->TryGetField(TEXT("Level")); + if (LevelValue.IsValid() && !LevelValue->IsNull()) + { + FString TmpValue; + if (LevelValue->TryGetString(TmpValue)) { Level = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FExecuteCloudScriptResult::~FExecuteCloudScriptResult() +{ + //if (Error != nullptr) delete Error; + +} + +void PlayFab::AdminModels::FExecuteCloudScriptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("APIRequestsIssued")); writer->WriteValue(APIRequestsIssued); + + if (Error.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Error")); Error->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ExecutionTimeSeconds")); writer->WriteValue(ExecutionTimeSeconds); + + if (FunctionName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); } + + if (FunctionResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResult")); FunctionResult.writeJSON(writer); } + + if (FunctionResultTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResultTooLarge")); writer->WriteValue(FunctionResultTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("HttpRequestsIssued")); writer->WriteValue(HttpRequestsIssued); + + if (Logs.Num() != 0) + { + writer->WriteArrayStart(TEXT("Logs")); + for (const FLogStatement& item : Logs) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (LogsTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("LogsTooLarge")); writer->WriteValue(LogsTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("MemoryConsumedBytes")); writer->WriteValue(static_cast(MemoryConsumedBytes)); + + writer->WriteIdentifierPrefix(TEXT("ProcessorTimeSeconds")); writer->WriteValue(ProcessorTimeSeconds); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FExecuteCloudScriptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr APIRequestsIssuedValue = obj->TryGetField(TEXT("APIRequestsIssued")); + if (APIRequestsIssuedValue.IsValid() && !APIRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (APIRequestsIssuedValue->TryGetNumber(TmpValue)) { APIRequestsIssued = TmpValue; } + } + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + Error = MakeShareable(new FScriptExecutionError(ErrorValue->AsObject())); + } + + const TSharedPtr ExecutionTimeSecondsValue = obj->TryGetField(TEXT("ExecutionTimeSeconds")); + if (ExecutionTimeSecondsValue.IsValid() && !ExecutionTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ExecutionTimeSecondsValue->TryGetNumber(TmpValue)) { ExecutionTimeSeconds = TmpValue; } + } + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionResultValue = obj->TryGetField(TEXT("FunctionResult")); + if (FunctionResultValue.IsValid() && !FunctionResultValue->IsNull()) + { + FunctionResult = FJsonKeeper(FunctionResultValue); + } + + const TSharedPtr FunctionResultTooLargeValue = obj->TryGetField(TEXT("FunctionResultTooLarge")); + if (FunctionResultTooLargeValue.IsValid() && !FunctionResultTooLargeValue->IsNull()) + { + bool TmpValue; + if (FunctionResultTooLargeValue->TryGetBool(TmpValue)) { FunctionResultTooLarge = TmpValue; } + } + + const TSharedPtr HttpRequestsIssuedValue = obj->TryGetField(TEXT("HttpRequestsIssued")); + if (HttpRequestsIssuedValue.IsValid() && !HttpRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (HttpRequestsIssuedValue->TryGetNumber(TmpValue)) { HttpRequestsIssued = TmpValue; } + } + + const TArray>&LogsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Logs")); + for (int32 Idx = 0; Idx < LogsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LogsArray[Idx]; + Logs.Add(FLogStatement(CurrentItem->AsObject())); + } + + + const TSharedPtr LogsTooLargeValue = obj->TryGetField(TEXT("LogsTooLarge")); + if (LogsTooLargeValue.IsValid() && !LogsTooLargeValue->IsNull()) + { + bool TmpValue; + if (LogsTooLargeValue->TryGetBool(TmpValue)) { LogsTooLarge = TmpValue; } + } + + const TSharedPtr MemoryConsumedBytesValue = obj->TryGetField(TEXT("MemoryConsumedBytes")); + if (MemoryConsumedBytesValue.IsValid() && !MemoryConsumedBytesValue->IsNull()) + { + uint32 TmpValue; + if (MemoryConsumedBytesValue->TryGetNumber(TmpValue)) { MemoryConsumedBytes = TmpValue; } + } + + const TSharedPtr ProcessorTimeSecondsValue = obj->TryGetField(TEXT("ProcessorTimeSeconds")); + if (ProcessorTimeSecondsValue.IsValid() && !ProcessorTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ProcessorTimeSecondsValue->TryGetNumber(TmpValue)) { ProcessorTimeSeconds = TmpValue; } + } + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCloudScriptTaskSummary::~FCloudScriptTaskSummary() +{ + //if (Result != nullptr) delete Result; + //if (TaskIdentifier != nullptr) delete TaskIdentifier; + +} + +void PlayFab::AdminModels::FCloudScriptTaskSummary::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CompletedAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("CompletedAt")); writeDatetime(CompletedAt, writer); } + + if (EstimatedSecondsRemaining.notNull()) { writer->WriteIdentifierPrefix(TEXT("EstimatedSecondsRemaining")); writer->WriteValue(EstimatedSecondsRemaining); } + + if (PercentComplete.notNull()) { writer->WriteIdentifierPrefix(TEXT("PercentComplete")); writer->WriteValue(PercentComplete); } + + if (Result.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Result")); Result->writeJSON(writer); } + + if (ScheduledByUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ScheduledByUserId")); writer->WriteValue(ScheduledByUserId); } + + writer->WriteIdentifierPrefix(TEXT("StartedAt")); writeDatetime(StartedAt, writer); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeTaskInstanceStatusEnumJSON(Status, writer); } + + if (TaskIdentifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TaskIdentifier")); TaskIdentifier->writeJSON(writer); } + + if (TaskInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TaskInstanceId")); writer->WriteValue(TaskInstanceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCloudScriptTaskSummary::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CompletedAtValue = obj->TryGetField(TEXT("CompletedAt")); + if (CompletedAtValue.IsValid()) + CompletedAt = readDatetime(CompletedAtValue); + + + const TSharedPtr EstimatedSecondsRemainingValue = obj->TryGetField(TEXT("EstimatedSecondsRemaining")); + if (EstimatedSecondsRemainingValue.IsValid() && !EstimatedSecondsRemainingValue->IsNull()) + { + double TmpValue; + if (EstimatedSecondsRemainingValue->TryGetNumber(TmpValue)) { EstimatedSecondsRemaining = TmpValue; } + } + + const TSharedPtr PercentCompleteValue = obj->TryGetField(TEXT("PercentComplete")); + if (PercentCompleteValue.IsValid() && !PercentCompleteValue->IsNull()) + { + double TmpValue; + if (PercentCompleteValue->TryGetNumber(TmpValue)) { PercentComplete = TmpValue; } + } + + const TSharedPtr ResultValue = obj->TryGetField(TEXT("Result")); + if (ResultValue.IsValid() && !ResultValue->IsNull()) + { + Result = MakeShareable(new FExecuteCloudScriptResult(ResultValue->AsObject())); + } + + const TSharedPtr ScheduledByUserIdValue = obj->TryGetField(TEXT("ScheduledByUserId")); + if (ScheduledByUserIdValue.IsValid() && !ScheduledByUserIdValue->IsNull()) + { + FString TmpValue; + if (ScheduledByUserIdValue->TryGetString(TmpValue)) { ScheduledByUserId = TmpValue; } + } + + const TSharedPtr StartedAtValue = obj->TryGetField(TEXT("StartedAt")); + if (StartedAtValue.IsValid()) + StartedAt = readDatetime(StartedAtValue); + + + Status = readTaskInstanceStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TaskIdentifierValue = obj->TryGetField(TEXT("TaskIdentifier")); + if (TaskIdentifierValue.IsValid() && !TaskIdentifierValue->IsNull()) + { + TaskIdentifier = MakeShareable(new FNameIdentifier(TaskIdentifierValue->AsObject())); + } + + const TSharedPtr TaskInstanceIdValue = obj->TryGetField(TEXT("TaskInstanceId")); + if (TaskInstanceIdValue.IsValid() && !TaskInstanceIdValue->IsNull()) + { + FString TmpValue; + if (TaskInstanceIdValue->TryGetString(TmpValue)) { TaskInstanceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCloudScriptVersionStatus::~FCloudScriptVersionStatus() +{ + +} + +void PlayFab::AdminModels::FCloudScriptVersionStatus::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LatestRevision")); writer->WriteValue(LatestRevision); + + writer->WriteIdentifierPrefix(TEXT("PublishedRevision")); writer->WriteValue(PublishedRevision); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCloudScriptVersionStatus::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LatestRevisionValue = obj->TryGetField(TEXT("LatestRevision")); + if (LatestRevisionValue.IsValid() && !LatestRevisionValue->IsNull()) + { + int32 TmpValue; + if (LatestRevisionValue->TryGetNumber(TmpValue)) { LatestRevision = TmpValue; } + } + + const TSharedPtr PublishedRevisionValue = obj->TryGetField(TEXT("PublishedRevision")); + if (PublishedRevisionValue.IsValid() && !PublishedRevisionValue->IsNull()) + { + int32 TmpValue; + if (PublishedRevisionValue->TryGetNumber(TmpValue)) { PublishedRevision = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeEmailVerificationStatusEnumJSON(EmailVerificationStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case EmailVerificationStatusUnverified: writer->WriteValue(TEXT("Unverified")); break; + case EmailVerificationStatusPending: writer->WriteValue(TEXT("Pending")); break; + case EmailVerificationStatusConfirmed: writer->WriteValue(TEXT("Confirmed")); break; + } +} + +AdminModels::EmailVerificationStatus PlayFab::AdminModels::readEmailVerificationStatusFromValue(const TSharedPtr& value) +{ + return readEmailVerificationStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::EmailVerificationStatus PlayFab::AdminModels::readEmailVerificationStatusFromValue(const FString& value) +{ + static TMap _EmailVerificationStatusMap; + if (_EmailVerificationStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _EmailVerificationStatusMap.Add(TEXT("Unverified"), EmailVerificationStatusUnverified); + _EmailVerificationStatusMap.Add(TEXT("Pending"), EmailVerificationStatusPending); + _EmailVerificationStatusMap.Add(TEXT("Confirmed"), EmailVerificationStatusConfirmed); + + } + + if (!value.IsEmpty()) + { + auto output = _EmailVerificationStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return EmailVerificationStatusUnverified; // Basically critical fail +} + +PlayFab::AdminModels::FContactEmailInfo::~FContactEmailInfo() +{ + +} + +void PlayFab::AdminModels::FContactEmailInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EmailAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailAddress")); writer->WriteValue(EmailAddress); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + if (VerificationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("VerificationStatus")); writeEmailVerificationStatusEnumJSON(VerificationStatus, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FContactEmailInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailAddressValue = obj->TryGetField(TEXT("EmailAddress")); + if (EmailAddressValue.IsValid() && !EmailAddressValue->IsNull()) + { + FString TmpValue; + if (EmailAddressValue->TryGetString(TmpValue)) { EmailAddress = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + VerificationStatus = readEmailVerificationStatusFromValue(obj->TryGetField(TEXT("VerificationStatus"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FContactEmailInfoModel::~FContactEmailInfoModel() +{ + +} + +void PlayFab::AdminModels::FContactEmailInfoModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EmailAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailAddress")); writer->WriteValue(EmailAddress); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + if (VerificationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("VerificationStatus")); writeEmailVerificationStatusEnumJSON(VerificationStatus, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FContactEmailInfoModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailAddressValue = obj->TryGetField(TEXT("EmailAddress")); + if (EmailAddressValue.IsValid() && !EmailAddressValue->IsNull()) + { + FString TmpValue; + if (EmailAddressValue->TryGetString(TmpValue)) { EmailAddress = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + VerificationStatus = readEmailVerificationStatusFromValue(obj->TryGetField(TEXT("VerificationStatus"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FContentInfo::~FContentInfo() +{ + +} + +void PlayFab::AdminModels::FContentInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Key.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); } + + writer->WriteIdentifierPrefix(TEXT("LastModified")); writeDatetime(LastModified, writer); + + writer->WriteIdentifierPrefix(TEXT("Size")); writer->WriteValue(static_cast(Size)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FContentInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr LastModifiedValue = obj->TryGetField(TEXT("LastModified")); + if (LastModifiedValue.IsValid()) + LastModified = readDatetime(LastModifiedValue); + + + const TSharedPtr SizeValue = obj->TryGetField(TEXT("Size")); + if (SizeValue.IsValid() && !SizeValue->IsNull()) + { + uint32 TmpValue; + if (SizeValue->TryGetNumber(TmpValue)) { Size = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeContinentCodeEnumJSON(ContinentCode enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ContinentCodeAF: writer->WriteValue(TEXT("AF")); break; + case ContinentCodeAN: writer->WriteValue(TEXT("AN")); break; + case ContinentCodeAS: writer->WriteValue(TEXT("AS")); break; + case ContinentCodeEU: writer->WriteValue(TEXT("EU")); break; + case ContinentCodeNA: writer->WriteValue(TEXT("NA")); break; + case ContinentCodeOC: writer->WriteValue(TEXT("OC")); break; + case ContinentCodeSA: writer->WriteValue(TEXT("SA")); break; + } +} + +AdminModels::ContinentCode PlayFab::AdminModels::readContinentCodeFromValue(const TSharedPtr& value) +{ + return readContinentCodeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::ContinentCode PlayFab::AdminModels::readContinentCodeFromValue(const FString& value) +{ + static TMap _ContinentCodeMap; + if (_ContinentCodeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ContinentCodeMap.Add(TEXT("AF"), ContinentCodeAF); + _ContinentCodeMap.Add(TEXT("AN"), ContinentCodeAN); + _ContinentCodeMap.Add(TEXT("AS"), ContinentCodeAS); + _ContinentCodeMap.Add(TEXT("EU"), ContinentCodeEU); + _ContinentCodeMap.Add(TEXT("NA"), ContinentCodeNA); + _ContinentCodeMap.Add(TEXT("OC"), ContinentCodeOC); + _ContinentCodeMap.Add(TEXT("SA"), ContinentCodeSA); + + } + + if (!value.IsEmpty()) + { + auto output = _ContinentCodeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ContinentCodeAF; // Basically critical fail +} + +void PlayFab::AdminModels::writeCountryCodeEnumJSON(CountryCode enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CountryCodeAF: writer->WriteValue(TEXT("AF")); break; + case CountryCodeAX: writer->WriteValue(TEXT("AX")); break; + case CountryCodeAL: writer->WriteValue(TEXT("AL")); break; + case CountryCodeDZ: writer->WriteValue(TEXT("DZ")); break; + case CountryCodeAS: writer->WriteValue(TEXT("AS")); break; + case CountryCodeAD: writer->WriteValue(TEXT("AD")); break; + case CountryCodeAO: writer->WriteValue(TEXT("AO")); break; + case CountryCodeAI: writer->WriteValue(TEXT("AI")); break; + case CountryCodeAQ: writer->WriteValue(TEXT("AQ")); break; + case CountryCodeAG: writer->WriteValue(TEXT("AG")); break; + case CountryCodeAR: writer->WriteValue(TEXT("AR")); break; + case CountryCodeAM: writer->WriteValue(TEXT("AM")); break; + case CountryCodeAW: writer->WriteValue(TEXT("AW")); break; + case CountryCodeAU: writer->WriteValue(TEXT("AU")); break; + case CountryCodeAT: writer->WriteValue(TEXT("AT")); break; + case CountryCodeAZ: writer->WriteValue(TEXT("AZ")); break; + case CountryCodeBS: writer->WriteValue(TEXT("BS")); break; + case CountryCodeBH: writer->WriteValue(TEXT("BH")); break; + case CountryCodeBD: writer->WriteValue(TEXT("BD")); break; + case CountryCodeBB: writer->WriteValue(TEXT("BB")); break; + case CountryCodeBY: writer->WriteValue(TEXT("BY")); break; + case CountryCodeBE: writer->WriteValue(TEXT("BE")); break; + case CountryCodeBZ: writer->WriteValue(TEXT("BZ")); break; + case CountryCodeBJ: writer->WriteValue(TEXT("BJ")); break; + case CountryCodeBM: writer->WriteValue(TEXT("BM")); break; + case CountryCodeBT: writer->WriteValue(TEXT("BT")); break; + case CountryCodeBO: writer->WriteValue(TEXT("BO")); break; + case CountryCodeBQ: writer->WriteValue(TEXT("BQ")); break; + case CountryCodeBA: writer->WriteValue(TEXT("BA")); break; + case CountryCodeBW: writer->WriteValue(TEXT("BW")); break; + case CountryCodeBV: writer->WriteValue(TEXT("BV")); break; + case CountryCodeBR: writer->WriteValue(TEXT("BR")); break; + case CountryCodeIO: writer->WriteValue(TEXT("IO")); break; + case CountryCodeBN: writer->WriteValue(TEXT("BN")); break; + case CountryCodeBG: writer->WriteValue(TEXT("BG")); break; + case CountryCodeBF: writer->WriteValue(TEXT("BF")); break; + case CountryCodeBI: writer->WriteValue(TEXT("BI")); break; + case CountryCodeKH: writer->WriteValue(TEXT("KH")); break; + case CountryCodeCM: writer->WriteValue(TEXT("CM")); break; + case CountryCodeCA: writer->WriteValue(TEXT("CA")); break; + case CountryCodeCV: writer->WriteValue(TEXT("CV")); break; + case CountryCodeKY: writer->WriteValue(TEXT("KY")); break; + case CountryCodeCF: writer->WriteValue(TEXT("CF")); break; + case CountryCodeTD: writer->WriteValue(TEXT("TD")); break; + case CountryCodeCL: writer->WriteValue(TEXT("CL")); break; + case CountryCodeCN: writer->WriteValue(TEXT("CN")); break; + case CountryCodeCX: writer->WriteValue(TEXT("CX")); break; + case CountryCodeCC: writer->WriteValue(TEXT("CC")); break; + case CountryCodeCO: writer->WriteValue(TEXT("CO")); break; + case CountryCodeKM: writer->WriteValue(TEXT("KM")); break; + case CountryCodeCG: writer->WriteValue(TEXT("CG")); break; + case CountryCodeCD: writer->WriteValue(TEXT("CD")); break; + case CountryCodeCK: writer->WriteValue(TEXT("CK")); break; + case CountryCodeCR: writer->WriteValue(TEXT("CR")); break; + case CountryCodeCI: writer->WriteValue(TEXT("CI")); break; + case CountryCodeHR: writer->WriteValue(TEXT("HR")); break; + case CountryCodeCU: writer->WriteValue(TEXT("CU")); break; + case CountryCodeCW: writer->WriteValue(TEXT("CW")); break; + case CountryCodeCY: writer->WriteValue(TEXT("CY")); break; + case CountryCodeCZ: writer->WriteValue(TEXT("CZ")); break; + case CountryCodeDK: writer->WriteValue(TEXT("DK")); break; + case CountryCodeDJ: writer->WriteValue(TEXT("DJ")); break; + case CountryCodeDM: writer->WriteValue(TEXT("DM")); break; + case CountryCodeDO: writer->WriteValue(TEXT("DO")); break; + case CountryCodeEC: writer->WriteValue(TEXT("EC")); break; + case CountryCodeEG: writer->WriteValue(TEXT("EG")); break; + case CountryCodeSV: writer->WriteValue(TEXT("SV")); break; + case CountryCodeGQ: writer->WriteValue(TEXT("GQ")); break; + case CountryCodeER: writer->WriteValue(TEXT("ER")); break; + case CountryCodeEE: writer->WriteValue(TEXT("EE")); break; + case CountryCodeET: writer->WriteValue(TEXT("ET")); break; + case CountryCodeFK: writer->WriteValue(TEXT("FK")); break; + case CountryCodeFO: writer->WriteValue(TEXT("FO")); break; + case CountryCodeFJ: writer->WriteValue(TEXT("FJ")); break; + case CountryCodeFI: writer->WriteValue(TEXT("FI")); break; + case CountryCodeFR: writer->WriteValue(TEXT("FR")); break; + case CountryCodeGF: writer->WriteValue(TEXT("GF")); break; + case CountryCodePF: writer->WriteValue(TEXT("PF")); break; + case CountryCodeTF: writer->WriteValue(TEXT("TF")); break; + case CountryCodeGA: writer->WriteValue(TEXT("GA")); break; + case CountryCodeGM: writer->WriteValue(TEXT("GM")); break; + case CountryCodeGE: writer->WriteValue(TEXT("GE")); break; + case CountryCodeDE: writer->WriteValue(TEXT("DE")); break; + case CountryCodeGH: writer->WriteValue(TEXT("GH")); break; + case CountryCodeGI: writer->WriteValue(TEXT("GI")); break; + case CountryCodeGR: writer->WriteValue(TEXT("GR")); break; + case CountryCodeGL: writer->WriteValue(TEXT("GL")); break; + case CountryCodeGD: writer->WriteValue(TEXT("GD")); break; + case CountryCodeGP: writer->WriteValue(TEXT("GP")); break; + case CountryCodeGU: writer->WriteValue(TEXT("GU")); break; + case CountryCodeGT: writer->WriteValue(TEXT("GT")); break; + case CountryCodeGG: writer->WriteValue(TEXT("GG")); break; + case CountryCodeGN: writer->WriteValue(TEXT("GN")); break; + case CountryCodeGW: writer->WriteValue(TEXT("GW")); break; + case CountryCodeGY: writer->WriteValue(TEXT("GY")); break; + case CountryCodeHT: writer->WriteValue(TEXT("HT")); break; + case CountryCodeHM: writer->WriteValue(TEXT("HM")); break; + case CountryCodeVA: writer->WriteValue(TEXT("VA")); break; + case CountryCodeHN: writer->WriteValue(TEXT("HN")); break; + case CountryCodeHK: writer->WriteValue(TEXT("HK")); break; + case CountryCodeHU: writer->WriteValue(TEXT("HU")); break; + case CountryCodeIS: writer->WriteValue(TEXT("IS")); break; + case CountryCodeIN: writer->WriteValue(TEXT("IN")); break; + case CountryCodeID: writer->WriteValue(TEXT("ID")); break; + case CountryCodeIR: writer->WriteValue(TEXT("IR")); break; + case CountryCodeIQ: writer->WriteValue(TEXT("IQ")); break; + case CountryCodeIE: writer->WriteValue(TEXT("IE")); break; + case CountryCodeIM: writer->WriteValue(TEXT("IM")); break; + case CountryCodeIL: writer->WriteValue(TEXT("IL")); break; + case CountryCodeIT: writer->WriteValue(TEXT("IT")); break; + case CountryCodeJM: writer->WriteValue(TEXT("JM")); break; + case CountryCodeJP: writer->WriteValue(TEXT("JP")); break; + case CountryCodeJE: writer->WriteValue(TEXT("JE")); break; + case CountryCodeJO: writer->WriteValue(TEXT("JO")); break; + case CountryCodeKZ: writer->WriteValue(TEXT("KZ")); break; + case CountryCodeKE: writer->WriteValue(TEXT("KE")); break; + case CountryCodeKI: writer->WriteValue(TEXT("KI")); break; + case CountryCodeKP: writer->WriteValue(TEXT("KP")); break; + case CountryCodeKR: writer->WriteValue(TEXT("KR")); break; + case CountryCodeKW: writer->WriteValue(TEXT("KW")); break; + case CountryCodeKG: writer->WriteValue(TEXT("KG")); break; + case CountryCodeLA: writer->WriteValue(TEXT("LA")); break; + case CountryCodeLV: writer->WriteValue(TEXT("LV")); break; + case CountryCodeLB: writer->WriteValue(TEXT("LB")); break; + case CountryCodeLS: writer->WriteValue(TEXT("LS")); break; + case CountryCodeLR: writer->WriteValue(TEXT("LR")); break; + case CountryCodeLY: writer->WriteValue(TEXT("LY")); break; + case CountryCodeLI: writer->WriteValue(TEXT("LI")); break; + case CountryCodeLT: writer->WriteValue(TEXT("LT")); break; + case CountryCodeLU: writer->WriteValue(TEXT("LU")); break; + case CountryCodeMO: writer->WriteValue(TEXT("MO")); break; + case CountryCodeMK: writer->WriteValue(TEXT("MK")); break; + case CountryCodeMG: writer->WriteValue(TEXT("MG")); break; + case CountryCodeMW: writer->WriteValue(TEXT("MW")); break; + case CountryCodeMY: writer->WriteValue(TEXT("MY")); break; + case CountryCodeMV: writer->WriteValue(TEXT("MV")); break; + case CountryCodeML: writer->WriteValue(TEXT("ML")); break; + case CountryCodeMT: writer->WriteValue(TEXT("MT")); break; + case CountryCodeMH: writer->WriteValue(TEXT("MH")); break; + case CountryCodeMQ: writer->WriteValue(TEXT("MQ")); break; + case CountryCodeMR: writer->WriteValue(TEXT("MR")); break; + case CountryCodeMU: writer->WriteValue(TEXT("MU")); break; + case CountryCodeYT: writer->WriteValue(TEXT("YT")); break; + case CountryCodeMX: writer->WriteValue(TEXT("MX")); break; + case CountryCodeFM: writer->WriteValue(TEXT("FM")); break; + case CountryCodeMD: writer->WriteValue(TEXT("MD")); break; + case CountryCodeMC: writer->WriteValue(TEXT("MC")); break; + case CountryCodeMN: writer->WriteValue(TEXT("MN")); break; + case CountryCodeME: writer->WriteValue(TEXT("ME")); break; + case CountryCodeMS: writer->WriteValue(TEXT("MS")); break; + case CountryCodeMA: writer->WriteValue(TEXT("MA")); break; + case CountryCodeMZ: writer->WriteValue(TEXT("MZ")); break; + case CountryCodeMM: writer->WriteValue(TEXT("MM")); break; + case CountryCodeNA: writer->WriteValue(TEXT("NA")); break; + case CountryCodeNR: writer->WriteValue(TEXT("NR")); break; + case CountryCodeNP: writer->WriteValue(TEXT("NP")); break; + case CountryCodeNL: writer->WriteValue(TEXT("NL")); break; + case CountryCodeNC: writer->WriteValue(TEXT("NC")); break; + case CountryCodeNZ: writer->WriteValue(TEXT("NZ")); break; + case CountryCodeNI: writer->WriteValue(TEXT("NI")); break; + case CountryCodeNE: writer->WriteValue(TEXT("NE")); break; + case CountryCodeNG: writer->WriteValue(TEXT("NG")); break; + case CountryCodeNU: writer->WriteValue(TEXT("NU")); break; + case CountryCodeNF: writer->WriteValue(TEXT("NF")); break; + case CountryCodeMP: writer->WriteValue(TEXT("MP")); break; + case CountryCodeNO: writer->WriteValue(TEXT("NO")); break; + case CountryCodeOM: writer->WriteValue(TEXT("OM")); break; + case CountryCodePK: writer->WriteValue(TEXT("PK")); break; + case CountryCodePW: writer->WriteValue(TEXT("PW")); break; + case CountryCodePS: writer->WriteValue(TEXT("PS")); break; + case CountryCodePA: writer->WriteValue(TEXT("PA")); break; + case CountryCodePG: writer->WriteValue(TEXT("PG")); break; + case CountryCodePY: writer->WriteValue(TEXT("PY")); break; + case CountryCodePE: writer->WriteValue(TEXT("PE")); break; + case CountryCodePH: writer->WriteValue(TEXT("PH")); break; + case CountryCodePN: writer->WriteValue(TEXT("PN")); break; + case CountryCodePL: writer->WriteValue(TEXT("PL")); break; + case CountryCodePT: writer->WriteValue(TEXT("PT")); break; + case CountryCodePR: writer->WriteValue(TEXT("PR")); break; + case CountryCodeQA: writer->WriteValue(TEXT("QA")); break; + case CountryCodeRE: writer->WriteValue(TEXT("RE")); break; + case CountryCodeRO: writer->WriteValue(TEXT("RO")); break; + case CountryCodeRU: writer->WriteValue(TEXT("RU")); break; + case CountryCodeRW: writer->WriteValue(TEXT("RW")); break; + case CountryCodeBL: writer->WriteValue(TEXT("BL")); break; + case CountryCodeSH: writer->WriteValue(TEXT("SH")); break; + case CountryCodeKN: writer->WriteValue(TEXT("KN")); break; + case CountryCodeLC: writer->WriteValue(TEXT("LC")); break; + case CountryCodeMF: writer->WriteValue(TEXT("MF")); break; + case CountryCodePM: writer->WriteValue(TEXT("PM")); break; + case CountryCodeVC: writer->WriteValue(TEXT("VC")); break; + case CountryCodeWS: writer->WriteValue(TEXT("WS")); break; + case CountryCodeSM: writer->WriteValue(TEXT("SM")); break; + case CountryCodeST: writer->WriteValue(TEXT("ST")); break; + case CountryCodeSA: writer->WriteValue(TEXT("SA")); break; + case CountryCodeSN: writer->WriteValue(TEXT("SN")); break; + case CountryCodeRS: writer->WriteValue(TEXT("RS")); break; + case CountryCodeSC: writer->WriteValue(TEXT("SC")); break; + case CountryCodeSL: writer->WriteValue(TEXT("SL")); break; + case CountryCodeSG: writer->WriteValue(TEXT("SG")); break; + case CountryCodeSX: writer->WriteValue(TEXT("SX")); break; + case CountryCodeSK: writer->WriteValue(TEXT("SK")); break; + case CountryCodeSI: writer->WriteValue(TEXT("SI")); break; + case CountryCodeSB: writer->WriteValue(TEXT("SB")); break; + case CountryCodeSO: writer->WriteValue(TEXT("SO")); break; + case CountryCodeZA: writer->WriteValue(TEXT("ZA")); break; + case CountryCodeGS: writer->WriteValue(TEXT("GS")); break; + case CountryCodeSS: writer->WriteValue(TEXT("SS")); break; + case CountryCodeES: writer->WriteValue(TEXT("ES")); break; + case CountryCodeLK: writer->WriteValue(TEXT("LK")); break; + case CountryCodeSD: writer->WriteValue(TEXT("SD")); break; + case CountryCodeSR: writer->WriteValue(TEXT("SR")); break; + case CountryCodeSJ: writer->WriteValue(TEXT("SJ")); break; + case CountryCodeSZ: writer->WriteValue(TEXT("SZ")); break; + case CountryCodeSE: writer->WriteValue(TEXT("SE")); break; + case CountryCodeCH: writer->WriteValue(TEXT("CH")); break; + case CountryCodeSY: writer->WriteValue(TEXT("SY")); break; + case CountryCodeTW: writer->WriteValue(TEXT("TW")); break; + case CountryCodeTJ: writer->WriteValue(TEXT("TJ")); break; + case CountryCodeTZ: writer->WriteValue(TEXT("TZ")); break; + case CountryCodeTH: writer->WriteValue(TEXT("TH")); break; + case CountryCodeTL: writer->WriteValue(TEXT("TL")); break; + case CountryCodeTG: writer->WriteValue(TEXT("TG")); break; + case CountryCodeTK: writer->WriteValue(TEXT("TK")); break; + case CountryCodeTO: writer->WriteValue(TEXT("TO")); break; + case CountryCodeTT: writer->WriteValue(TEXT("TT")); break; + case CountryCodeTN: writer->WriteValue(TEXT("TN")); break; + case CountryCodeTR: writer->WriteValue(TEXT("TR")); break; + case CountryCodeTM: writer->WriteValue(TEXT("TM")); break; + case CountryCodeTC: writer->WriteValue(TEXT("TC")); break; + case CountryCodeTV: writer->WriteValue(TEXT("TV")); break; + case CountryCodeUG: writer->WriteValue(TEXT("UG")); break; + case CountryCodeUA: writer->WriteValue(TEXT("UA")); break; + case CountryCodeAE: writer->WriteValue(TEXT("AE")); break; + case CountryCodeGB: writer->WriteValue(TEXT("GB")); break; + case CountryCodeUS: writer->WriteValue(TEXT("US")); break; + case CountryCodeUM: writer->WriteValue(TEXT("UM")); break; + case CountryCodeUY: writer->WriteValue(TEXT("UY")); break; + case CountryCodeUZ: writer->WriteValue(TEXT("UZ")); break; + case CountryCodeVU: writer->WriteValue(TEXT("VU")); break; + case CountryCodeVE: writer->WriteValue(TEXT("VE")); break; + case CountryCodeVN: writer->WriteValue(TEXT("VN")); break; + case CountryCodeVG: writer->WriteValue(TEXT("VG")); break; + case CountryCodeVI: writer->WriteValue(TEXT("VI")); break; + case CountryCodeWF: writer->WriteValue(TEXT("WF")); break; + case CountryCodeEH: writer->WriteValue(TEXT("EH")); break; + case CountryCodeYE: writer->WriteValue(TEXT("YE")); break; + case CountryCodeZM: writer->WriteValue(TEXT("ZM")); break; + case CountryCodeZW: writer->WriteValue(TEXT("ZW")); break; + } +} + +AdminModels::CountryCode PlayFab::AdminModels::readCountryCodeFromValue(const TSharedPtr& value) +{ + return readCountryCodeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::CountryCode PlayFab::AdminModels::readCountryCodeFromValue(const FString& value) +{ + static TMap _CountryCodeMap; + if (_CountryCodeMap.Num() == 0) + { + // Auto-generate the map on the first use + _CountryCodeMap.Add(TEXT("AF"), CountryCodeAF); + _CountryCodeMap.Add(TEXT("AX"), CountryCodeAX); + _CountryCodeMap.Add(TEXT("AL"), CountryCodeAL); + _CountryCodeMap.Add(TEXT("DZ"), CountryCodeDZ); + _CountryCodeMap.Add(TEXT("AS"), CountryCodeAS); + _CountryCodeMap.Add(TEXT("AD"), CountryCodeAD); + _CountryCodeMap.Add(TEXT("AO"), CountryCodeAO); + _CountryCodeMap.Add(TEXT("AI"), CountryCodeAI); + _CountryCodeMap.Add(TEXT("AQ"), CountryCodeAQ); + _CountryCodeMap.Add(TEXT("AG"), CountryCodeAG); + _CountryCodeMap.Add(TEXT("AR"), CountryCodeAR); + _CountryCodeMap.Add(TEXT("AM"), CountryCodeAM); + _CountryCodeMap.Add(TEXT("AW"), CountryCodeAW); + _CountryCodeMap.Add(TEXT("AU"), CountryCodeAU); + _CountryCodeMap.Add(TEXT("AT"), CountryCodeAT); + _CountryCodeMap.Add(TEXT("AZ"), CountryCodeAZ); + _CountryCodeMap.Add(TEXT("BS"), CountryCodeBS); + _CountryCodeMap.Add(TEXT("BH"), CountryCodeBH); + _CountryCodeMap.Add(TEXT("BD"), CountryCodeBD); + _CountryCodeMap.Add(TEXT("BB"), CountryCodeBB); + _CountryCodeMap.Add(TEXT("BY"), CountryCodeBY); + _CountryCodeMap.Add(TEXT("BE"), CountryCodeBE); + _CountryCodeMap.Add(TEXT("BZ"), CountryCodeBZ); + _CountryCodeMap.Add(TEXT("BJ"), CountryCodeBJ); + _CountryCodeMap.Add(TEXT("BM"), CountryCodeBM); + _CountryCodeMap.Add(TEXT("BT"), CountryCodeBT); + _CountryCodeMap.Add(TEXT("BO"), CountryCodeBO); + _CountryCodeMap.Add(TEXT("BQ"), CountryCodeBQ); + _CountryCodeMap.Add(TEXT("BA"), CountryCodeBA); + _CountryCodeMap.Add(TEXT("BW"), CountryCodeBW); + _CountryCodeMap.Add(TEXT("BV"), CountryCodeBV); + _CountryCodeMap.Add(TEXT("BR"), CountryCodeBR); + _CountryCodeMap.Add(TEXT("IO"), CountryCodeIO); + _CountryCodeMap.Add(TEXT("BN"), CountryCodeBN); + _CountryCodeMap.Add(TEXT("BG"), CountryCodeBG); + _CountryCodeMap.Add(TEXT("BF"), CountryCodeBF); + _CountryCodeMap.Add(TEXT("BI"), CountryCodeBI); + _CountryCodeMap.Add(TEXT("KH"), CountryCodeKH); + _CountryCodeMap.Add(TEXT("CM"), CountryCodeCM); + _CountryCodeMap.Add(TEXT("CA"), CountryCodeCA); + _CountryCodeMap.Add(TEXT("CV"), CountryCodeCV); + _CountryCodeMap.Add(TEXT("KY"), CountryCodeKY); + _CountryCodeMap.Add(TEXT("CF"), CountryCodeCF); + _CountryCodeMap.Add(TEXT("TD"), CountryCodeTD); + _CountryCodeMap.Add(TEXT("CL"), CountryCodeCL); + _CountryCodeMap.Add(TEXT("CN"), CountryCodeCN); + _CountryCodeMap.Add(TEXT("CX"), CountryCodeCX); + _CountryCodeMap.Add(TEXT("CC"), CountryCodeCC); + _CountryCodeMap.Add(TEXT("CO"), CountryCodeCO); + _CountryCodeMap.Add(TEXT("KM"), CountryCodeKM); + _CountryCodeMap.Add(TEXT("CG"), CountryCodeCG); + _CountryCodeMap.Add(TEXT("CD"), CountryCodeCD); + _CountryCodeMap.Add(TEXT("CK"), CountryCodeCK); + _CountryCodeMap.Add(TEXT("CR"), CountryCodeCR); + _CountryCodeMap.Add(TEXT("CI"), CountryCodeCI); + _CountryCodeMap.Add(TEXT("HR"), CountryCodeHR); + _CountryCodeMap.Add(TEXT("CU"), CountryCodeCU); + _CountryCodeMap.Add(TEXT("CW"), CountryCodeCW); + _CountryCodeMap.Add(TEXT("CY"), CountryCodeCY); + _CountryCodeMap.Add(TEXT("CZ"), CountryCodeCZ); + _CountryCodeMap.Add(TEXT("DK"), CountryCodeDK); + _CountryCodeMap.Add(TEXT("DJ"), CountryCodeDJ); + _CountryCodeMap.Add(TEXT("DM"), CountryCodeDM); + _CountryCodeMap.Add(TEXT("DO"), CountryCodeDO); + _CountryCodeMap.Add(TEXT("EC"), CountryCodeEC); + _CountryCodeMap.Add(TEXT("EG"), CountryCodeEG); + _CountryCodeMap.Add(TEXT("SV"), CountryCodeSV); + _CountryCodeMap.Add(TEXT("GQ"), CountryCodeGQ); + _CountryCodeMap.Add(TEXT("ER"), CountryCodeER); + _CountryCodeMap.Add(TEXT("EE"), CountryCodeEE); + _CountryCodeMap.Add(TEXT("ET"), CountryCodeET); + _CountryCodeMap.Add(TEXT("FK"), CountryCodeFK); + _CountryCodeMap.Add(TEXT("FO"), CountryCodeFO); + _CountryCodeMap.Add(TEXT("FJ"), CountryCodeFJ); + _CountryCodeMap.Add(TEXT("FI"), CountryCodeFI); + _CountryCodeMap.Add(TEXT("FR"), CountryCodeFR); + _CountryCodeMap.Add(TEXT("GF"), CountryCodeGF); + _CountryCodeMap.Add(TEXT("PF"), CountryCodePF); + _CountryCodeMap.Add(TEXT("TF"), CountryCodeTF); + _CountryCodeMap.Add(TEXT("GA"), CountryCodeGA); + _CountryCodeMap.Add(TEXT("GM"), CountryCodeGM); + _CountryCodeMap.Add(TEXT("GE"), CountryCodeGE); + _CountryCodeMap.Add(TEXT("DE"), CountryCodeDE); + _CountryCodeMap.Add(TEXT("GH"), CountryCodeGH); + _CountryCodeMap.Add(TEXT("GI"), CountryCodeGI); + _CountryCodeMap.Add(TEXT("GR"), CountryCodeGR); + _CountryCodeMap.Add(TEXT("GL"), CountryCodeGL); + _CountryCodeMap.Add(TEXT("GD"), CountryCodeGD); + _CountryCodeMap.Add(TEXT("GP"), CountryCodeGP); + _CountryCodeMap.Add(TEXT("GU"), CountryCodeGU); + _CountryCodeMap.Add(TEXT("GT"), CountryCodeGT); + _CountryCodeMap.Add(TEXT("GG"), CountryCodeGG); + _CountryCodeMap.Add(TEXT("GN"), CountryCodeGN); + _CountryCodeMap.Add(TEXT("GW"), CountryCodeGW); + _CountryCodeMap.Add(TEXT("GY"), CountryCodeGY); + _CountryCodeMap.Add(TEXT("HT"), CountryCodeHT); + _CountryCodeMap.Add(TEXT("HM"), CountryCodeHM); + _CountryCodeMap.Add(TEXT("VA"), CountryCodeVA); + _CountryCodeMap.Add(TEXT("HN"), CountryCodeHN); + _CountryCodeMap.Add(TEXT("HK"), CountryCodeHK); + _CountryCodeMap.Add(TEXT("HU"), CountryCodeHU); + _CountryCodeMap.Add(TEXT("IS"), CountryCodeIS); + _CountryCodeMap.Add(TEXT("IN"), CountryCodeIN); + _CountryCodeMap.Add(TEXT("ID"), CountryCodeID); + _CountryCodeMap.Add(TEXT("IR"), CountryCodeIR); + _CountryCodeMap.Add(TEXT("IQ"), CountryCodeIQ); + _CountryCodeMap.Add(TEXT("IE"), CountryCodeIE); + _CountryCodeMap.Add(TEXT("IM"), CountryCodeIM); + _CountryCodeMap.Add(TEXT("IL"), CountryCodeIL); + _CountryCodeMap.Add(TEXT("IT"), CountryCodeIT); + _CountryCodeMap.Add(TEXT("JM"), CountryCodeJM); + _CountryCodeMap.Add(TEXT("JP"), CountryCodeJP); + _CountryCodeMap.Add(TEXT("JE"), CountryCodeJE); + _CountryCodeMap.Add(TEXT("JO"), CountryCodeJO); + _CountryCodeMap.Add(TEXT("KZ"), CountryCodeKZ); + _CountryCodeMap.Add(TEXT("KE"), CountryCodeKE); + _CountryCodeMap.Add(TEXT("KI"), CountryCodeKI); + _CountryCodeMap.Add(TEXT("KP"), CountryCodeKP); + _CountryCodeMap.Add(TEXT("KR"), CountryCodeKR); + _CountryCodeMap.Add(TEXT("KW"), CountryCodeKW); + _CountryCodeMap.Add(TEXT("KG"), CountryCodeKG); + _CountryCodeMap.Add(TEXT("LA"), CountryCodeLA); + _CountryCodeMap.Add(TEXT("LV"), CountryCodeLV); + _CountryCodeMap.Add(TEXT("LB"), CountryCodeLB); + _CountryCodeMap.Add(TEXT("LS"), CountryCodeLS); + _CountryCodeMap.Add(TEXT("LR"), CountryCodeLR); + _CountryCodeMap.Add(TEXT("LY"), CountryCodeLY); + _CountryCodeMap.Add(TEXT("LI"), CountryCodeLI); + _CountryCodeMap.Add(TEXT("LT"), CountryCodeLT); + _CountryCodeMap.Add(TEXT("LU"), CountryCodeLU); + _CountryCodeMap.Add(TEXT("MO"), CountryCodeMO); + _CountryCodeMap.Add(TEXT("MK"), CountryCodeMK); + _CountryCodeMap.Add(TEXT("MG"), CountryCodeMG); + _CountryCodeMap.Add(TEXT("MW"), CountryCodeMW); + _CountryCodeMap.Add(TEXT("MY"), CountryCodeMY); + _CountryCodeMap.Add(TEXT("MV"), CountryCodeMV); + _CountryCodeMap.Add(TEXT("ML"), CountryCodeML); + _CountryCodeMap.Add(TEXT("MT"), CountryCodeMT); + _CountryCodeMap.Add(TEXT("MH"), CountryCodeMH); + _CountryCodeMap.Add(TEXT("MQ"), CountryCodeMQ); + _CountryCodeMap.Add(TEXT("MR"), CountryCodeMR); + _CountryCodeMap.Add(TEXT("MU"), CountryCodeMU); + _CountryCodeMap.Add(TEXT("YT"), CountryCodeYT); + _CountryCodeMap.Add(TEXT("MX"), CountryCodeMX); + _CountryCodeMap.Add(TEXT("FM"), CountryCodeFM); + _CountryCodeMap.Add(TEXT("MD"), CountryCodeMD); + _CountryCodeMap.Add(TEXT("MC"), CountryCodeMC); + _CountryCodeMap.Add(TEXT("MN"), CountryCodeMN); + _CountryCodeMap.Add(TEXT("ME"), CountryCodeME); + _CountryCodeMap.Add(TEXT("MS"), CountryCodeMS); + _CountryCodeMap.Add(TEXT("MA"), CountryCodeMA); + _CountryCodeMap.Add(TEXT("MZ"), CountryCodeMZ); + _CountryCodeMap.Add(TEXT("MM"), CountryCodeMM); + _CountryCodeMap.Add(TEXT("NA"), CountryCodeNA); + _CountryCodeMap.Add(TEXT("NR"), CountryCodeNR); + _CountryCodeMap.Add(TEXT("NP"), CountryCodeNP); + _CountryCodeMap.Add(TEXT("NL"), CountryCodeNL); + _CountryCodeMap.Add(TEXT("NC"), CountryCodeNC); + _CountryCodeMap.Add(TEXT("NZ"), CountryCodeNZ); + _CountryCodeMap.Add(TEXT("NI"), CountryCodeNI); + _CountryCodeMap.Add(TEXT("NE"), CountryCodeNE); + _CountryCodeMap.Add(TEXT("NG"), CountryCodeNG); + _CountryCodeMap.Add(TEXT("NU"), CountryCodeNU); + _CountryCodeMap.Add(TEXT("NF"), CountryCodeNF); + _CountryCodeMap.Add(TEXT("MP"), CountryCodeMP); + _CountryCodeMap.Add(TEXT("NO"), CountryCodeNO); + _CountryCodeMap.Add(TEXT("OM"), CountryCodeOM); + _CountryCodeMap.Add(TEXT("PK"), CountryCodePK); + _CountryCodeMap.Add(TEXT("PW"), CountryCodePW); + _CountryCodeMap.Add(TEXT("PS"), CountryCodePS); + _CountryCodeMap.Add(TEXT("PA"), CountryCodePA); + _CountryCodeMap.Add(TEXT("PG"), CountryCodePG); + _CountryCodeMap.Add(TEXT("PY"), CountryCodePY); + _CountryCodeMap.Add(TEXT("PE"), CountryCodePE); + _CountryCodeMap.Add(TEXT("PH"), CountryCodePH); + _CountryCodeMap.Add(TEXT("PN"), CountryCodePN); + _CountryCodeMap.Add(TEXT("PL"), CountryCodePL); + _CountryCodeMap.Add(TEXT("PT"), CountryCodePT); + _CountryCodeMap.Add(TEXT("PR"), CountryCodePR); + _CountryCodeMap.Add(TEXT("QA"), CountryCodeQA); + _CountryCodeMap.Add(TEXT("RE"), CountryCodeRE); + _CountryCodeMap.Add(TEXT("RO"), CountryCodeRO); + _CountryCodeMap.Add(TEXT("RU"), CountryCodeRU); + _CountryCodeMap.Add(TEXT("RW"), CountryCodeRW); + _CountryCodeMap.Add(TEXT("BL"), CountryCodeBL); + _CountryCodeMap.Add(TEXT("SH"), CountryCodeSH); + _CountryCodeMap.Add(TEXT("KN"), CountryCodeKN); + _CountryCodeMap.Add(TEXT("LC"), CountryCodeLC); + _CountryCodeMap.Add(TEXT("MF"), CountryCodeMF); + _CountryCodeMap.Add(TEXT("PM"), CountryCodePM); + _CountryCodeMap.Add(TEXT("VC"), CountryCodeVC); + _CountryCodeMap.Add(TEXT("WS"), CountryCodeWS); + _CountryCodeMap.Add(TEXT("SM"), CountryCodeSM); + _CountryCodeMap.Add(TEXT("ST"), CountryCodeST); + _CountryCodeMap.Add(TEXT("SA"), CountryCodeSA); + _CountryCodeMap.Add(TEXT("SN"), CountryCodeSN); + _CountryCodeMap.Add(TEXT("RS"), CountryCodeRS); + _CountryCodeMap.Add(TEXT("SC"), CountryCodeSC); + _CountryCodeMap.Add(TEXT("SL"), CountryCodeSL); + _CountryCodeMap.Add(TEXT("SG"), CountryCodeSG); + _CountryCodeMap.Add(TEXT("SX"), CountryCodeSX); + _CountryCodeMap.Add(TEXT("SK"), CountryCodeSK); + _CountryCodeMap.Add(TEXT("SI"), CountryCodeSI); + _CountryCodeMap.Add(TEXT("SB"), CountryCodeSB); + _CountryCodeMap.Add(TEXT("SO"), CountryCodeSO); + _CountryCodeMap.Add(TEXT("ZA"), CountryCodeZA); + _CountryCodeMap.Add(TEXT("GS"), CountryCodeGS); + _CountryCodeMap.Add(TEXT("SS"), CountryCodeSS); + _CountryCodeMap.Add(TEXT("ES"), CountryCodeES); + _CountryCodeMap.Add(TEXT("LK"), CountryCodeLK); + _CountryCodeMap.Add(TEXT("SD"), CountryCodeSD); + _CountryCodeMap.Add(TEXT("SR"), CountryCodeSR); + _CountryCodeMap.Add(TEXT("SJ"), CountryCodeSJ); + _CountryCodeMap.Add(TEXT("SZ"), CountryCodeSZ); + _CountryCodeMap.Add(TEXT("SE"), CountryCodeSE); + _CountryCodeMap.Add(TEXT("CH"), CountryCodeCH); + _CountryCodeMap.Add(TEXT("SY"), CountryCodeSY); + _CountryCodeMap.Add(TEXT("TW"), CountryCodeTW); + _CountryCodeMap.Add(TEXT("TJ"), CountryCodeTJ); + _CountryCodeMap.Add(TEXT("TZ"), CountryCodeTZ); + _CountryCodeMap.Add(TEXT("TH"), CountryCodeTH); + _CountryCodeMap.Add(TEXT("TL"), CountryCodeTL); + _CountryCodeMap.Add(TEXT("TG"), CountryCodeTG); + _CountryCodeMap.Add(TEXT("TK"), CountryCodeTK); + _CountryCodeMap.Add(TEXT("TO"), CountryCodeTO); + _CountryCodeMap.Add(TEXT("TT"), CountryCodeTT); + _CountryCodeMap.Add(TEXT("TN"), CountryCodeTN); + _CountryCodeMap.Add(TEXT("TR"), CountryCodeTR); + _CountryCodeMap.Add(TEXT("TM"), CountryCodeTM); + _CountryCodeMap.Add(TEXT("TC"), CountryCodeTC); + _CountryCodeMap.Add(TEXT("TV"), CountryCodeTV); + _CountryCodeMap.Add(TEXT("UG"), CountryCodeUG); + _CountryCodeMap.Add(TEXT("UA"), CountryCodeUA); + _CountryCodeMap.Add(TEXT("AE"), CountryCodeAE); + _CountryCodeMap.Add(TEXT("GB"), CountryCodeGB); + _CountryCodeMap.Add(TEXT("US"), CountryCodeUS); + _CountryCodeMap.Add(TEXT("UM"), CountryCodeUM); + _CountryCodeMap.Add(TEXT("UY"), CountryCodeUY); + _CountryCodeMap.Add(TEXT("UZ"), CountryCodeUZ); + _CountryCodeMap.Add(TEXT("VU"), CountryCodeVU); + _CountryCodeMap.Add(TEXT("VE"), CountryCodeVE); + _CountryCodeMap.Add(TEXT("VN"), CountryCodeVN); + _CountryCodeMap.Add(TEXT("VG"), CountryCodeVG); + _CountryCodeMap.Add(TEXT("VI"), CountryCodeVI); + _CountryCodeMap.Add(TEXT("WF"), CountryCodeWF); + _CountryCodeMap.Add(TEXT("EH"), CountryCodeEH); + _CountryCodeMap.Add(TEXT("YE"), CountryCodeYE); + _CountryCodeMap.Add(TEXT("ZM"), CountryCodeZM); + _CountryCodeMap.Add(TEXT("ZW"), CountryCodeZW); + + } + + if (!value.IsEmpty()) + { + auto output = _CountryCodeMap.Find(value); + if (output != nullptr) + return *output; + } + + return CountryCodeAF; // Basically critical fail +} + +PlayFab::AdminModels::FCreateActionsOnPlayerSegmentTaskRequest::~FCreateActionsOnPlayerSegmentTaskRequest() +{ + +} + +void PlayFab::AdminModels::FCreateActionsOnPlayerSegmentTaskRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); + + writer->WriteIdentifierPrefix(TEXT("Parameter")); Parameter.writeJSON(writer); + + if (Schedule.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Schedule")); writer->WriteValue(Schedule); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreateActionsOnPlayerSegmentTaskRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr ParameterValue = obj->TryGetField(TEXT("Parameter")); + if (ParameterValue.IsValid() && !ParameterValue->IsNull()) + { + Parameter = FActionsOnPlayersInSegmentTaskParameter(ParameterValue->AsObject()); + } + + const TSharedPtr ScheduleValue = obj->TryGetField(TEXT("Schedule")); + if (ScheduleValue.IsValid() && !ScheduleValue->IsNull()) + { + FString TmpValue; + if (ScheduleValue->TryGetString(TmpValue)) { Schedule = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCreateCloudScriptTaskRequest::~FCreateCloudScriptTaskRequest() +{ + +} + +void PlayFab::AdminModels::FCreateCloudScriptTaskRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); + + writer->WriteIdentifierPrefix(TEXT("Parameter")); Parameter.writeJSON(writer); + + if (Schedule.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Schedule")); writer->WriteValue(Schedule); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreateCloudScriptTaskRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr ParameterValue = obj->TryGetField(TEXT("Parameter")); + if (ParameterValue.IsValid() && !ParameterValue->IsNull()) + { + Parameter = FCloudScriptTaskParameter(ParameterValue->AsObject()); + } + + const TSharedPtr ScheduleValue = obj->TryGetField(TEXT("Schedule")); + if (ScheduleValue.IsValid() && !ScheduleValue->IsNull()) + { + FString TmpValue; + if (ScheduleValue->TryGetString(TmpValue)) { Schedule = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCreatePlayerSharedSecretRequest::~FCreatePlayerSharedSecretRequest() +{ + +} + +void PlayFab::AdminModels::FCreatePlayerSharedSecretRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FriendlyName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendlyName")); writer->WriteValue(FriendlyName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreatePlayerSharedSecretRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendlyNameValue = obj->TryGetField(TEXT("FriendlyName")); + if (FriendlyNameValue.IsValid() && !FriendlyNameValue->IsNull()) + { + FString TmpValue; + if (FriendlyNameValue->TryGetString(TmpValue)) { FriendlyName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCreatePlayerSharedSecretResult::~FCreatePlayerSharedSecretResult() +{ + +} + +void PlayFab::AdminModels::FCreatePlayerSharedSecretResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SecretKey.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SecretKey")); writer->WriteValue(SecretKey); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreatePlayerSharedSecretResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SecretKeyValue = obj->TryGetField(TEXT("SecretKey")); + if (SecretKeyValue.IsValid() && !SecretKeyValue->IsNull()) + { + FString TmpValue; + if (SecretKeyValue->TryGetString(TmpValue)) { SecretKey = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeStatisticAggregationMethodEnumJSON(StatisticAggregationMethod enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case StatisticAggregationMethodLast: writer->WriteValue(TEXT("Last")); break; + case StatisticAggregationMethodMin: writer->WriteValue(TEXT("Min")); break; + case StatisticAggregationMethodMax: writer->WriteValue(TEXT("Max")); break; + case StatisticAggregationMethodSum: writer->WriteValue(TEXT("Sum")); break; + } +} + +AdminModels::StatisticAggregationMethod PlayFab::AdminModels::readStatisticAggregationMethodFromValue(const TSharedPtr& value) +{ + return readStatisticAggregationMethodFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::StatisticAggregationMethod PlayFab::AdminModels::readStatisticAggregationMethodFromValue(const FString& value) +{ + static TMap _StatisticAggregationMethodMap; + if (_StatisticAggregationMethodMap.Num() == 0) + { + // Auto-generate the map on the first use + _StatisticAggregationMethodMap.Add(TEXT("Last"), StatisticAggregationMethodLast); + _StatisticAggregationMethodMap.Add(TEXT("Min"), StatisticAggregationMethodMin); + _StatisticAggregationMethodMap.Add(TEXT("Max"), StatisticAggregationMethodMax); + _StatisticAggregationMethodMap.Add(TEXT("Sum"), StatisticAggregationMethodSum); + + } + + if (!value.IsEmpty()) + { + auto output = _StatisticAggregationMethodMap.Find(value); + if (output != nullptr) + return *output; + } + + return StatisticAggregationMethodLast; // Basically critical fail +} + +void PlayFab::AdminModels::writeStatisticResetIntervalOptionEnumJSON(StatisticResetIntervalOption enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case StatisticResetIntervalOptionNever: writer->WriteValue(TEXT("Never")); break; + case StatisticResetIntervalOptionHour: writer->WriteValue(TEXT("Hour")); break; + case StatisticResetIntervalOptionDay: writer->WriteValue(TEXT("Day")); break; + case StatisticResetIntervalOptionWeek: writer->WriteValue(TEXT("Week")); break; + case StatisticResetIntervalOptionMonth: writer->WriteValue(TEXT("Month")); break; + } +} + +AdminModels::StatisticResetIntervalOption PlayFab::AdminModels::readStatisticResetIntervalOptionFromValue(const TSharedPtr& value) +{ + return readStatisticResetIntervalOptionFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::StatisticResetIntervalOption PlayFab::AdminModels::readStatisticResetIntervalOptionFromValue(const FString& value) +{ + static TMap _StatisticResetIntervalOptionMap; + if (_StatisticResetIntervalOptionMap.Num() == 0) + { + // Auto-generate the map on the first use + _StatisticResetIntervalOptionMap.Add(TEXT("Never"), StatisticResetIntervalOptionNever); + _StatisticResetIntervalOptionMap.Add(TEXT("Hour"), StatisticResetIntervalOptionHour); + _StatisticResetIntervalOptionMap.Add(TEXT("Day"), StatisticResetIntervalOptionDay); + _StatisticResetIntervalOptionMap.Add(TEXT("Week"), StatisticResetIntervalOptionWeek); + _StatisticResetIntervalOptionMap.Add(TEXT("Month"), StatisticResetIntervalOptionMonth); + + } + + if (!value.IsEmpty()) + { + auto output = _StatisticResetIntervalOptionMap.Find(value); + if (output != nullptr) + return *output; + } + + return StatisticResetIntervalOptionNever; // Basically critical fail +} + +PlayFab::AdminModels::FCreatePlayerStatisticDefinitionRequest::~FCreatePlayerStatisticDefinitionRequest() +{ + +} + +void PlayFab::AdminModels::FCreatePlayerStatisticDefinitionRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AggregationMethod.notNull()) { writer->WriteIdentifierPrefix(TEXT("AggregationMethod")); writeStatisticAggregationMethodEnumJSON(AggregationMethod, writer); } + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (VersionChangeInterval.notNull()) { writer->WriteIdentifierPrefix(TEXT("VersionChangeInterval")); writeStatisticResetIntervalOptionEnumJSON(VersionChangeInterval, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreatePlayerStatisticDefinitionRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + AggregationMethod = readStatisticAggregationMethodFromValue(obj->TryGetField(TEXT("AggregationMethod"))); + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + VersionChangeInterval = readStatisticResetIntervalOptionFromValue(obj->TryGetField(TEXT("VersionChangeInterval"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerStatisticDefinition::~FPlayerStatisticDefinition() +{ + +} + +void PlayFab::AdminModels::FPlayerStatisticDefinition::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AggregationMethod.notNull()) { writer->WriteIdentifierPrefix(TEXT("AggregationMethod")); writeStatisticAggregationMethodEnumJSON(AggregationMethod, writer); } + + writer->WriteIdentifierPrefix(TEXT("CurrentVersion")); writer->WriteValue(static_cast(CurrentVersion)); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + if (VersionChangeInterval.notNull()) { writer->WriteIdentifierPrefix(TEXT("VersionChangeInterval")); writeStatisticResetIntervalOptionEnumJSON(VersionChangeInterval, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerStatisticDefinition::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + AggregationMethod = readStatisticAggregationMethodFromValue(obj->TryGetField(TEXT("AggregationMethod"))); + + const TSharedPtr CurrentVersionValue = obj->TryGetField(TEXT("CurrentVersion")); + if (CurrentVersionValue.IsValid() && !CurrentVersionValue->IsNull()) + { + uint32 TmpValue; + if (CurrentVersionValue->TryGetNumber(TmpValue)) { CurrentVersion = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + VersionChangeInterval = readStatisticResetIntervalOptionFromValue(obj->TryGetField(TEXT("VersionChangeInterval"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FCreatePlayerStatisticDefinitionResult::~FCreatePlayerStatisticDefinitionResult() +{ + //if (Statistic != nullptr) delete Statistic; + +} + +void PlayFab::AdminModels::FCreatePlayerStatisticDefinitionResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Statistic.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Statistic")); Statistic->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreatePlayerStatisticDefinitionResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticValue = obj->TryGetField(TEXT("Statistic")); + if (StatisticValue.IsValid() && !StatisticValue->IsNull()) + { + Statistic = MakeShareable(new FPlayerStatisticDefinition(StatisticValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCreateTaskResult::~FCreateTaskResult() +{ + +} + +void PlayFab::AdminModels::FCreateTaskResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TaskId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TaskId")); writer->WriteValue(TaskId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreateTaskResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TaskIdValue = obj->TryGetField(TEXT("TaskId")); + if (TaskIdValue.IsValid() && !TaskIdValue->IsNull()) + { + FString TmpValue; + if (TaskIdValue->TryGetString(TmpValue)) { TaskId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeCurrencyEnumJSON(Currency enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CurrencyAED: writer->WriteValue(TEXT("AED")); break; + case CurrencyAFN: writer->WriteValue(TEXT("AFN")); break; + case CurrencyALL: writer->WriteValue(TEXT("ALL")); break; + case CurrencyAMD: writer->WriteValue(TEXT("AMD")); break; + case CurrencyANG: writer->WriteValue(TEXT("ANG")); break; + case CurrencyAOA: writer->WriteValue(TEXT("AOA")); break; + case CurrencyARS: writer->WriteValue(TEXT("ARS")); break; + case CurrencyAUD: writer->WriteValue(TEXT("AUD")); break; + case CurrencyAWG: writer->WriteValue(TEXT("AWG")); break; + case CurrencyAZN: writer->WriteValue(TEXT("AZN")); break; + case CurrencyBAM: writer->WriteValue(TEXT("BAM")); break; + case CurrencyBBD: writer->WriteValue(TEXT("BBD")); break; + case CurrencyBDT: writer->WriteValue(TEXT("BDT")); break; + case CurrencyBGN: writer->WriteValue(TEXT("BGN")); break; + case CurrencyBHD: writer->WriteValue(TEXT("BHD")); break; + case CurrencyBIF: writer->WriteValue(TEXT("BIF")); break; + case CurrencyBMD: writer->WriteValue(TEXT("BMD")); break; + case CurrencyBND: writer->WriteValue(TEXT("BND")); break; + case CurrencyBOB: writer->WriteValue(TEXT("BOB")); break; + case CurrencyBRL: writer->WriteValue(TEXT("BRL")); break; + case CurrencyBSD: writer->WriteValue(TEXT("BSD")); break; + case CurrencyBTN: writer->WriteValue(TEXT("BTN")); break; + case CurrencyBWP: writer->WriteValue(TEXT("BWP")); break; + case CurrencyBYR: writer->WriteValue(TEXT("BYR")); break; + case CurrencyBZD: writer->WriteValue(TEXT("BZD")); break; + case CurrencyCAD: writer->WriteValue(TEXT("CAD")); break; + case CurrencyCDF: writer->WriteValue(TEXT("CDF")); break; + case CurrencyCHF: writer->WriteValue(TEXT("CHF")); break; + case CurrencyCLP: writer->WriteValue(TEXT("CLP")); break; + case CurrencyCNY: writer->WriteValue(TEXT("CNY")); break; + case CurrencyCOP: writer->WriteValue(TEXT("COP")); break; + case CurrencyCRC: writer->WriteValue(TEXT("CRC")); break; + case CurrencyCUC: writer->WriteValue(TEXT("CUC")); break; + case CurrencyCUP: writer->WriteValue(TEXT("CUP")); break; + case CurrencyCVE: writer->WriteValue(TEXT("CVE")); break; + case CurrencyCZK: writer->WriteValue(TEXT("CZK")); break; + case CurrencyDJF: writer->WriteValue(TEXT("DJF")); break; + case CurrencyDKK: writer->WriteValue(TEXT("DKK")); break; + case CurrencyDOP: writer->WriteValue(TEXT("DOP")); break; + case CurrencyDZD: writer->WriteValue(TEXT("DZD")); break; + case CurrencyEGP: writer->WriteValue(TEXT("EGP")); break; + case CurrencyERN: writer->WriteValue(TEXT("ERN")); break; + case CurrencyETB: writer->WriteValue(TEXT("ETB")); break; + case CurrencyEUR: writer->WriteValue(TEXT("EUR")); break; + case CurrencyFJD: writer->WriteValue(TEXT("FJD")); break; + case CurrencyFKP: writer->WriteValue(TEXT("FKP")); break; + case CurrencyGBP: writer->WriteValue(TEXT("GBP")); break; + case CurrencyGEL: writer->WriteValue(TEXT("GEL")); break; + case CurrencyGGP: writer->WriteValue(TEXT("GGP")); break; + case CurrencyGHS: writer->WriteValue(TEXT("GHS")); break; + case CurrencyGIP: writer->WriteValue(TEXT("GIP")); break; + case CurrencyGMD: writer->WriteValue(TEXT("GMD")); break; + case CurrencyGNF: writer->WriteValue(TEXT("GNF")); break; + case CurrencyGTQ: writer->WriteValue(TEXT("GTQ")); break; + case CurrencyGYD: writer->WriteValue(TEXT("GYD")); break; + case CurrencyHKD: writer->WriteValue(TEXT("HKD")); break; + case CurrencyHNL: writer->WriteValue(TEXT("HNL")); break; + case CurrencyHRK: writer->WriteValue(TEXT("HRK")); break; + case CurrencyHTG: writer->WriteValue(TEXT("HTG")); break; + case CurrencyHUF: writer->WriteValue(TEXT("HUF")); break; + case CurrencyIDR: writer->WriteValue(TEXT("IDR")); break; + case CurrencyILS: writer->WriteValue(TEXT("ILS")); break; + case CurrencyIMP: writer->WriteValue(TEXT("IMP")); break; + case CurrencyINR: writer->WriteValue(TEXT("INR")); break; + case CurrencyIQD: writer->WriteValue(TEXT("IQD")); break; + case CurrencyIRR: writer->WriteValue(TEXT("IRR")); break; + case CurrencyISK: writer->WriteValue(TEXT("ISK")); break; + case CurrencyJEP: writer->WriteValue(TEXT("JEP")); break; + case CurrencyJMD: writer->WriteValue(TEXT("JMD")); break; + case CurrencyJOD: writer->WriteValue(TEXT("JOD")); break; + case CurrencyJPY: writer->WriteValue(TEXT("JPY")); break; + case CurrencyKES: writer->WriteValue(TEXT("KES")); break; + case CurrencyKGS: writer->WriteValue(TEXT("KGS")); break; + case CurrencyKHR: writer->WriteValue(TEXT("KHR")); break; + case CurrencyKMF: writer->WriteValue(TEXT("KMF")); break; + case CurrencyKPW: writer->WriteValue(TEXT("KPW")); break; + case CurrencyKRW: writer->WriteValue(TEXT("KRW")); break; + case CurrencyKWD: writer->WriteValue(TEXT("KWD")); break; + case CurrencyKYD: writer->WriteValue(TEXT("KYD")); break; + case CurrencyKZT: writer->WriteValue(TEXT("KZT")); break; + case CurrencyLAK: writer->WriteValue(TEXT("LAK")); break; + case CurrencyLBP: writer->WriteValue(TEXT("LBP")); break; + case CurrencyLKR: writer->WriteValue(TEXT("LKR")); break; + case CurrencyLRD: writer->WriteValue(TEXT("LRD")); break; + case CurrencyLSL: writer->WriteValue(TEXT("LSL")); break; + case CurrencyLYD: writer->WriteValue(TEXT("LYD")); break; + case CurrencyMAD: writer->WriteValue(TEXT("MAD")); break; + case CurrencyMDL: writer->WriteValue(TEXT("MDL")); break; + case CurrencyMGA: writer->WriteValue(TEXT("MGA")); break; + case CurrencyMKD: writer->WriteValue(TEXT("MKD")); break; + case CurrencyMMK: writer->WriteValue(TEXT("MMK")); break; + case CurrencyMNT: writer->WriteValue(TEXT("MNT")); break; + case CurrencyMOP: writer->WriteValue(TEXT("MOP")); break; + case CurrencyMRO: writer->WriteValue(TEXT("MRO")); break; + case CurrencyMUR: writer->WriteValue(TEXT("MUR")); break; + case CurrencyMVR: writer->WriteValue(TEXT("MVR")); break; + case CurrencyMWK: writer->WriteValue(TEXT("MWK")); break; + case CurrencyMXN: writer->WriteValue(TEXT("MXN")); break; + case CurrencyMYR: writer->WriteValue(TEXT("MYR")); break; + case CurrencyMZN: writer->WriteValue(TEXT("MZN")); break; + case CurrencyNAD: writer->WriteValue(TEXT("NAD")); break; + case CurrencyNGN: writer->WriteValue(TEXT("NGN")); break; + case CurrencyNIO: writer->WriteValue(TEXT("NIO")); break; + case CurrencyNOK: writer->WriteValue(TEXT("NOK")); break; + case CurrencyNPR: writer->WriteValue(TEXT("NPR")); break; + case CurrencyNZD: writer->WriteValue(TEXT("NZD")); break; + case CurrencyOMR: writer->WriteValue(TEXT("OMR")); break; + case CurrencyPAB: writer->WriteValue(TEXT("PAB")); break; + case CurrencyPEN: writer->WriteValue(TEXT("PEN")); break; + case CurrencyPGK: writer->WriteValue(TEXT("PGK")); break; + case CurrencyPHP: writer->WriteValue(TEXT("PHP")); break; + case CurrencyPKR: writer->WriteValue(TEXT("PKR")); break; + case CurrencyPLN: writer->WriteValue(TEXT("PLN")); break; + case CurrencyPYG: writer->WriteValue(TEXT("PYG")); break; + case CurrencyQAR: writer->WriteValue(TEXT("QAR")); break; + case CurrencyRON: writer->WriteValue(TEXT("RON")); break; + case CurrencyRSD: writer->WriteValue(TEXT("RSD")); break; + case CurrencyRUB: writer->WriteValue(TEXT("RUB")); break; + case CurrencyRWF: writer->WriteValue(TEXT("RWF")); break; + case CurrencySAR: writer->WriteValue(TEXT("SAR")); break; + case CurrencySBD: writer->WriteValue(TEXT("SBD")); break; + case CurrencySCR: writer->WriteValue(TEXT("SCR")); break; + case CurrencySDG: writer->WriteValue(TEXT("SDG")); break; + case CurrencySEK: writer->WriteValue(TEXT("SEK")); break; + case CurrencySGD: writer->WriteValue(TEXT("SGD")); break; + case CurrencySHP: writer->WriteValue(TEXT("SHP")); break; + case CurrencySLL: writer->WriteValue(TEXT("SLL")); break; + case CurrencySOS: writer->WriteValue(TEXT("SOS")); break; + case CurrencySPL: writer->WriteValue(TEXT("SPL")); break; + case CurrencySRD: writer->WriteValue(TEXT("SRD")); break; + case CurrencySTD: writer->WriteValue(TEXT("STD")); break; + case CurrencySVC: writer->WriteValue(TEXT("SVC")); break; + case CurrencySYP: writer->WriteValue(TEXT("SYP")); break; + case CurrencySZL: writer->WriteValue(TEXT("SZL")); break; + case CurrencyTHB: writer->WriteValue(TEXT("THB")); break; + case CurrencyTJS: writer->WriteValue(TEXT("TJS")); break; + case CurrencyTMT: writer->WriteValue(TEXT("TMT")); break; + case CurrencyTND: writer->WriteValue(TEXT("TND")); break; + case CurrencyTOP: writer->WriteValue(TEXT("TOP")); break; + case CurrencyTRY: writer->WriteValue(TEXT("TRY")); break; + case CurrencyTTD: writer->WriteValue(TEXT("TTD")); break; + case CurrencyTVD: writer->WriteValue(TEXT("TVD")); break; + case CurrencyTWD: writer->WriteValue(TEXT("TWD")); break; + case CurrencyTZS: writer->WriteValue(TEXT("TZS")); break; + case CurrencyUAH: writer->WriteValue(TEXT("UAH")); break; + case CurrencyUGX: writer->WriteValue(TEXT("UGX")); break; + case CurrencyUSD: writer->WriteValue(TEXT("USD")); break; + case CurrencyUYU: writer->WriteValue(TEXT("UYU")); break; + case CurrencyUZS: writer->WriteValue(TEXT("UZS")); break; + case CurrencyVEF: writer->WriteValue(TEXT("VEF")); break; + case CurrencyVND: writer->WriteValue(TEXT("VND")); break; + case CurrencyVUV: writer->WriteValue(TEXT("VUV")); break; + case CurrencyWST: writer->WriteValue(TEXT("WST")); break; + case CurrencyXAF: writer->WriteValue(TEXT("XAF")); break; + case CurrencyXCD: writer->WriteValue(TEXT("XCD")); break; + case CurrencyXDR: writer->WriteValue(TEXT("XDR")); break; + case CurrencyXOF: writer->WriteValue(TEXT("XOF")); break; + case CurrencyXPF: writer->WriteValue(TEXT("XPF")); break; + case CurrencyYER: writer->WriteValue(TEXT("YER")); break; + case CurrencyZAR: writer->WriteValue(TEXT("ZAR")); break; + case CurrencyZMW: writer->WriteValue(TEXT("ZMW")); break; + case CurrencyZWD: writer->WriteValue(TEXT("ZWD")); break; + } +} + +AdminModels::Currency PlayFab::AdminModels::readCurrencyFromValue(const TSharedPtr& value) +{ + return readCurrencyFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::Currency PlayFab::AdminModels::readCurrencyFromValue(const FString& value) +{ + static TMap _CurrencyMap; + if (_CurrencyMap.Num() == 0) + { + // Auto-generate the map on the first use + _CurrencyMap.Add(TEXT("AED"), CurrencyAED); + _CurrencyMap.Add(TEXT("AFN"), CurrencyAFN); + _CurrencyMap.Add(TEXT("ALL"), CurrencyALL); + _CurrencyMap.Add(TEXT("AMD"), CurrencyAMD); + _CurrencyMap.Add(TEXT("ANG"), CurrencyANG); + _CurrencyMap.Add(TEXT("AOA"), CurrencyAOA); + _CurrencyMap.Add(TEXT("ARS"), CurrencyARS); + _CurrencyMap.Add(TEXT("AUD"), CurrencyAUD); + _CurrencyMap.Add(TEXT("AWG"), CurrencyAWG); + _CurrencyMap.Add(TEXT("AZN"), CurrencyAZN); + _CurrencyMap.Add(TEXT("BAM"), CurrencyBAM); + _CurrencyMap.Add(TEXT("BBD"), CurrencyBBD); + _CurrencyMap.Add(TEXT("BDT"), CurrencyBDT); + _CurrencyMap.Add(TEXT("BGN"), CurrencyBGN); + _CurrencyMap.Add(TEXT("BHD"), CurrencyBHD); + _CurrencyMap.Add(TEXT("BIF"), CurrencyBIF); + _CurrencyMap.Add(TEXT("BMD"), CurrencyBMD); + _CurrencyMap.Add(TEXT("BND"), CurrencyBND); + _CurrencyMap.Add(TEXT("BOB"), CurrencyBOB); + _CurrencyMap.Add(TEXT("BRL"), CurrencyBRL); + _CurrencyMap.Add(TEXT("BSD"), CurrencyBSD); + _CurrencyMap.Add(TEXT("BTN"), CurrencyBTN); + _CurrencyMap.Add(TEXT("BWP"), CurrencyBWP); + _CurrencyMap.Add(TEXT("BYR"), CurrencyBYR); + _CurrencyMap.Add(TEXT("BZD"), CurrencyBZD); + _CurrencyMap.Add(TEXT("CAD"), CurrencyCAD); + _CurrencyMap.Add(TEXT("CDF"), CurrencyCDF); + _CurrencyMap.Add(TEXT("CHF"), CurrencyCHF); + _CurrencyMap.Add(TEXT("CLP"), CurrencyCLP); + _CurrencyMap.Add(TEXT("CNY"), CurrencyCNY); + _CurrencyMap.Add(TEXT("COP"), CurrencyCOP); + _CurrencyMap.Add(TEXT("CRC"), CurrencyCRC); + _CurrencyMap.Add(TEXT("CUC"), CurrencyCUC); + _CurrencyMap.Add(TEXT("CUP"), CurrencyCUP); + _CurrencyMap.Add(TEXT("CVE"), CurrencyCVE); + _CurrencyMap.Add(TEXT("CZK"), CurrencyCZK); + _CurrencyMap.Add(TEXT("DJF"), CurrencyDJF); + _CurrencyMap.Add(TEXT("DKK"), CurrencyDKK); + _CurrencyMap.Add(TEXT("DOP"), CurrencyDOP); + _CurrencyMap.Add(TEXT("DZD"), CurrencyDZD); + _CurrencyMap.Add(TEXT("EGP"), CurrencyEGP); + _CurrencyMap.Add(TEXT("ERN"), CurrencyERN); + _CurrencyMap.Add(TEXT("ETB"), CurrencyETB); + _CurrencyMap.Add(TEXT("EUR"), CurrencyEUR); + _CurrencyMap.Add(TEXT("FJD"), CurrencyFJD); + _CurrencyMap.Add(TEXT("FKP"), CurrencyFKP); + _CurrencyMap.Add(TEXT("GBP"), CurrencyGBP); + _CurrencyMap.Add(TEXT("GEL"), CurrencyGEL); + _CurrencyMap.Add(TEXT("GGP"), CurrencyGGP); + _CurrencyMap.Add(TEXT("GHS"), CurrencyGHS); + _CurrencyMap.Add(TEXT("GIP"), CurrencyGIP); + _CurrencyMap.Add(TEXT("GMD"), CurrencyGMD); + _CurrencyMap.Add(TEXT("GNF"), CurrencyGNF); + _CurrencyMap.Add(TEXT("GTQ"), CurrencyGTQ); + _CurrencyMap.Add(TEXT("GYD"), CurrencyGYD); + _CurrencyMap.Add(TEXT("HKD"), CurrencyHKD); + _CurrencyMap.Add(TEXT("HNL"), CurrencyHNL); + _CurrencyMap.Add(TEXT("HRK"), CurrencyHRK); + _CurrencyMap.Add(TEXT("HTG"), CurrencyHTG); + _CurrencyMap.Add(TEXT("HUF"), CurrencyHUF); + _CurrencyMap.Add(TEXT("IDR"), CurrencyIDR); + _CurrencyMap.Add(TEXT("ILS"), CurrencyILS); + _CurrencyMap.Add(TEXT("IMP"), CurrencyIMP); + _CurrencyMap.Add(TEXT("INR"), CurrencyINR); + _CurrencyMap.Add(TEXT("IQD"), CurrencyIQD); + _CurrencyMap.Add(TEXT("IRR"), CurrencyIRR); + _CurrencyMap.Add(TEXT("ISK"), CurrencyISK); + _CurrencyMap.Add(TEXT("JEP"), CurrencyJEP); + _CurrencyMap.Add(TEXT("JMD"), CurrencyJMD); + _CurrencyMap.Add(TEXT("JOD"), CurrencyJOD); + _CurrencyMap.Add(TEXT("JPY"), CurrencyJPY); + _CurrencyMap.Add(TEXT("KES"), CurrencyKES); + _CurrencyMap.Add(TEXT("KGS"), CurrencyKGS); + _CurrencyMap.Add(TEXT("KHR"), CurrencyKHR); + _CurrencyMap.Add(TEXT("KMF"), CurrencyKMF); + _CurrencyMap.Add(TEXT("KPW"), CurrencyKPW); + _CurrencyMap.Add(TEXT("KRW"), CurrencyKRW); + _CurrencyMap.Add(TEXT("KWD"), CurrencyKWD); + _CurrencyMap.Add(TEXT("KYD"), CurrencyKYD); + _CurrencyMap.Add(TEXT("KZT"), CurrencyKZT); + _CurrencyMap.Add(TEXT("LAK"), CurrencyLAK); + _CurrencyMap.Add(TEXT("LBP"), CurrencyLBP); + _CurrencyMap.Add(TEXT("LKR"), CurrencyLKR); + _CurrencyMap.Add(TEXT("LRD"), CurrencyLRD); + _CurrencyMap.Add(TEXT("LSL"), CurrencyLSL); + _CurrencyMap.Add(TEXT("LYD"), CurrencyLYD); + _CurrencyMap.Add(TEXT("MAD"), CurrencyMAD); + _CurrencyMap.Add(TEXT("MDL"), CurrencyMDL); + _CurrencyMap.Add(TEXT("MGA"), CurrencyMGA); + _CurrencyMap.Add(TEXT("MKD"), CurrencyMKD); + _CurrencyMap.Add(TEXT("MMK"), CurrencyMMK); + _CurrencyMap.Add(TEXT("MNT"), CurrencyMNT); + _CurrencyMap.Add(TEXT("MOP"), CurrencyMOP); + _CurrencyMap.Add(TEXT("MRO"), CurrencyMRO); + _CurrencyMap.Add(TEXT("MUR"), CurrencyMUR); + _CurrencyMap.Add(TEXT("MVR"), CurrencyMVR); + _CurrencyMap.Add(TEXT("MWK"), CurrencyMWK); + _CurrencyMap.Add(TEXT("MXN"), CurrencyMXN); + _CurrencyMap.Add(TEXT("MYR"), CurrencyMYR); + _CurrencyMap.Add(TEXT("MZN"), CurrencyMZN); + _CurrencyMap.Add(TEXT("NAD"), CurrencyNAD); + _CurrencyMap.Add(TEXT("NGN"), CurrencyNGN); + _CurrencyMap.Add(TEXT("NIO"), CurrencyNIO); + _CurrencyMap.Add(TEXT("NOK"), CurrencyNOK); + _CurrencyMap.Add(TEXT("NPR"), CurrencyNPR); + _CurrencyMap.Add(TEXT("NZD"), CurrencyNZD); + _CurrencyMap.Add(TEXT("OMR"), CurrencyOMR); + _CurrencyMap.Add(TEXT("PAB"), CurrencyPAB); + _CurrencyMap.Add(TEXT("PEN"), CurrencyPEN); + _CurrencyMap.Add(TEXT("PGK"), CurrencyPGK); + _CurrencyMap.Add(TEXT("PHP"), CurrencyPHP); + _CurrencyMap.Add(TEXT("PKR"), CurrencyPKR); + _CurrencyMap.Add(TEXT("PLN"), CurrencyPLN); + _CurrencyMap.Add(TEXT("PYG"), CurrencyPYG); + _CurrencyMap.Add(TEXT("QAR"), CurrencyQAR); + _CurrencyMap.Add(TEXT("RON"), CurrencyRON); + _CurrencyMap.Add(TEXT("RSD"), CurrencyRSD); + _CurrencyMap.Add(TEXT("RUB"), CurrencyRUB); + _CurrencyMap.Add(TEXT("RWF"), CurrencyRWF); + _CurrencyMap.Add(TEXT("SAR"), CurrencySAR); + _CurrencyMap.Add(TEXT("SBD"), CurrencySBD); + _CurrencyMap.Add(TEXT("SCR"), CurrencySCR); + _CurrencyMap.Add(TEXT("SDG"), CurrencySDG); + _CurrencyMap.Add(TEXT("SEK"), CurrencySEK); + _CurrencyMap.Add(TEXT("SGD"), CurrencySGD); + _CurrencyMap.Add(TEXT("SHP"), CurrencySHP); + _CurrencyMap.Add(TEXT("SLL"), CurrencySLL); + _CurrencyMap.Add(TEXT("SOS"), CurrencySOS); + _CurrencyMap.Add(TEXT("SPL"), CurrencySPL); + _CurrencyMap.Add(TEXT("SRD"), CurrencySRD); + _CurrencyMap.Add(TEXT("STD"), CurrencySTD); + _CurrencyMap.Add(TEXT("SVC"), CurrencySVC); + _CurrencyMap.Add(TEXT("SYP"), CurrencySYP); + _CurrencyMap.Add(TEXT("SZL"), CurrencySZL); + _CurrencyMap.Add(TEXT("THB"), CurrencyTHB); + _CurrencyMap.Add(TEXT("TJS"), CurrencyTJS); + _CurrencyMap.Add(TEXT("TMT"), CurrencyTMT); + _CurrencyMap.Add(TEXT("TND"), CurrencyTND); + _CurrencyMap.Add(TEXT("TOP"), CurrencyTOP); + _CurrencyMap.Add(TEXT("TRY"), CurrencyTRY); + _CurrencyMap.Add(TEXT("TTD"), CurrencyTTD); + _CurrencyMap.Add(TEXT("TVD"), CurrencyTVD); + _CurrencyMap.Add(TEXT("TWD"), CurrencyTWD); + _CurrencyMap.Add(TEXT("TZS"), CurrencyTZS); + _CurrencyMap.Add(TEXT("UAH"), CurrencyUAH); + _CurrencyMap.Add(TEXT("UGX"), CurrencyUGX); + _CurrencyMap.Add(TEXT("USD"), CurrencyUSD); + _CurrencyMap.Add(TEXT("UYU"), CurrencyUYU); + _CurrencyMap.Add(TEXT("UZS"), CurrencyUZS); + _CurrencyMap.Add(TEXT("VEF"), CurrencyVEF); + _CurrencyMap.Add(TEXT("VND"), CurrencyVND); + _CurrencyMap.Add(TEXT("VUV"), CurrencyVUV); + _CurrencyMap.Add(TEXT("WST"), CurrencyWST); + _CurrencyMap.Add(TEXT("XAF"), CurrencyXAF); + _CurrencyMap.Add(TEXT("XCD"), CurrencyXCD); + _CurrencyMap.Add(TEXT("XDR"), CurrencyXDR); + _CurrencyMap.Add(TEXT("XOF"), CurrencyXOF); + _CurrencyMap.Add(TEXT("XPF"), CurrencyXPF); + _CurrencyMap.Add(TEXT("YER"), CurrencyYER); + _CurrencyMap.Add(TEXT("ZAR"), CurrencyZAR); + _CurrencyMap.Add(TEXT("ZMW"), CurrencyZMW); + _CurrencyMap.Add(TEXT("ZWD"), CurrencyZWD); + + } + + if (!value.IsEmpty()) + { + auto output = _CurrencyMap.Find(value); + if (output != nullptr) + return *output; + } + + return CurrencyAED; // Basically critical fail +} + +PlayFab::AdminModels::FDeleteContentRequest::~FDeleteContentRequest() +{ + +} + +void PlayFab::AdminModels::FDeleteContentRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteContentRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteMasterPlayerAccountRequest::~FDeleteMasterPlayerAccountRequest() +{ + +} + +void PlayFab::AdminModels::FDeleteMasterPlayerAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteMasterPlayerAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteMasterPlayerAccountResult::~FDeleteMasterPlayerAccountResult() +{ + +} + +void PlayFab::AdminModels::FDeleteMasterPlayerAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (JobReceiptId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("JobReceiptId")); writer->WriteValue(JobReceiptId); } + + if (TitleIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("TitleIds")); + for (const FString& item : TitleIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteMasterPlayerAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr JobReceiptIdValue = obj->TryGetField(TEXT("JobReceiptId")); + if (JobReceiptIdValue.IsValid() && !JobReceiptIdValue->IsNull()) + { + FString TmpValue; + if (JobReceiptIdValue->TryGetString(TmpValue)) { JobReceiptId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("TitleIds"), TitleIds); + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeletePlayerRequest::~FDeletePlayerRequest() +{ + +} + +void PlayFab::AdminModels::FDeletePlayerRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeletePlayerRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeletePlayerResult::~FDeletePlayerResult() +{ + +} + +void PlayFab::AdminModels::FDeletePlayerResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeletePlayerResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeletePlayerSharedSecretRequest::~FDeletePlayerSharedSecretRequest() +{ + +} + +void PlayFab::AdminModels::FDeletePlayerSharedSecretRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SecretKey.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SecretKey")); writer->WriteValue(SecretKey); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeletePlayerSharedSecretRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SecretKeyValue = obj->TryGetField(TEXT("SecretKey")); + if (SecretKeyValue.IsValid() && !SecretKeyValue->IsNull()) + { + FString TmpValue; + if (SecretKeyValue->TryGetString(TmpValue)) { SecretKey = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeletePlayerSharedSecretResult::~FDeletePlayerSharedSecretResult() +{ + +} + +void PlayFab::AdminModels::FDeletePlayerSharedSecretResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeletePlayerSharedSecretResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteStoreRequest::~FDeleteStoreRequest() +{ + +} + +void PlayFab::AdminModels::FDeleteStoreRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteStoreRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteStoreResult::~FDeleteStoreResult() +{ + +} + +void PlayFab::AdminModels::FDeleteStoreResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteStoreResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteTaskRequest::~FDeleteTaskRequest() +{ + //if (Identifier != nullptr) delete Identifier; + +} + +void PlayFab::AdminModels::FDeleteTaskRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Identifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Identifier")); Identifier->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteTaskRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdentifierValue = obj->TryGetField(TEXT("Identifier")); + if (IdentifierValue.IsValid() && !IdentifierValue->IsNull()) + { + Identifier = MakeShareable(new FNameIdentifier(IdentifierValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteTitleRequest::~FDeleteTitleRequest() +{ + +} + +void PlayFab::AdminModels::FDeleteTitleRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteTitleRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteTitleResult::~FDeleteTitleResult() +{ + +} + +void PlayFab::AdminModels::FDeleteTitleResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteTitleResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeEffectTypeEnumJSON(EffectType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case EffectTypeAllow: writer->WriteValue(TEXT("Allow")); break; + case EffectTypeDeny: writer->WriteValue(TEXT("Deny")); break; + } +} + +AdminModels::EffectType PlayFab::AdminModels::readEffectTypeFromValue(const TSharedPtr& value) +{ + return readEffectTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::EffectType PlayFab::AdminModels::readEffectTypeFromValue(const FString& value) +{ + static TMap _EffectTypeMap; + if (_EffectTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _EffectTypeMap.Add(TEXT("Allow"), EffectTypeAllow); + _EffectTypeMap.Add(TEXT("Deny"), EffectTypeDeny); + + } + + if (!value.IsEmpty()) + { + auto output = _EffectTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return EffectTypeAllow; // Basically critical fail +} + +PlayFab::AdminModels::FEmptyResponse::~FEmptyResponse() +{ + +} + +void PlayFab::AdminModels::FEmptyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FEmptyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::AdminModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FExportMasterPlayerDataRequest::~FExportMasterPlayerDataRequest() +{ + +} + +void PlayFab::AdminModels::FExportMasterPlayerDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FExportMasterPlayerDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FExportMasterPlayerDataResult::~FExportMasterPlayerDataResult() +{ + +} + +void PlayFab::AdminModels::FExportMasterPlayerDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (JobReceiptId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("JobReceiptId")); writer->WriteValue(JobReceiptId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FExportMasterPlayerDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr JobReceiptIdValue = obj->TryGetField(TEXT("JobReceiptId")); + if (JobReceiptIdValue.IsValid() && !JobReceiptIdValue->IsNull()) + { + FString TmpValue; + if (JobReceiptIdValue->TryGetString(TmpValue)) { JobReceiptId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGameModeInfo::~FGameModeInfo() +{ + +} + +void PlayFab::AdminModels::FGameModeInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Gamemode")); writer->WriteValue(Gamemode); + + writer->WriteIdentifierPrefix(TEXT("MaxPlayerCount")); writer->WriteValue(static_cast(MaxPlayerCount)); + + writer->WriteIdentifierPrefix(TEXT("MinPlayerCount")); writer->WriteValue(static_cast(MinPlayerCount)); + + if (StartOpen.notNull()) { writer->WriteIdentifierPrefix(TEXT("StartOpen")); writer->WriteValue(StartOpen); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGameModeInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GamemodeValue = obj->TryGetField(TEXT("Gamemode")); + if (GamemodeValue.IsValid() && !GamemodeValue->IsNull()) + { + FString TmpValue; + if (GamemodeValue->TryGetString(TmpValue)) { Gamemode = TmpValue; } + } + + const TSharedPtr MaxPlayerCountValue = obj->TryGetField(TEXT("MaxPlayerCount")); + if (MaxPlayerCountValue.IsValid() && !MaxPlayerCountValue->IsNull()) + { + uint32 TmpValue; + if (MaxPlayerCountValue->TryGetNumber(TmpValue)) { MaxPlayerCount = TmpValue; } + } + + const TSharedPtr MinPlayerCountValue = obj->TryGetField(TEXT("MinPlayerCount")); + if (MinPlayerCountValue.IsValid() && !MinPlayerCountValue->IsNull()) + { + uint32 TmpValue; + if (MinPlayerCountValue->TryGetNumber(TmpValue)) { MinPlayerCount = TmpValue; } + } + + const TSharedPtr StartOpenValue = obj->TryGetField(TEXT("StartOpen")); + if (StartOpenValue.IsValid() && !StartOpenValue->IsNull()) + { + bool TmpValue; + if (StartOpenValue->TryGetBool(TmpValue)) { StartOpen = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetActionsOnPlayersInSegmentTaskInstanceResult::~FGetActionsOnPlayersInSegmentTaskInstanceResult() +{ + //if (Parameter != nullptr) delete Parameter; + //if (Summary != nullptr) delete Summary; + +} + +void PlayFab::AdminModels::FGetActionsOnPlayersInSegmentTaskInstanceResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Parameter.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Parameter")); Parameter->writeJSON(writer); } + + if (Summary.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Summary")); Summary->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetActionsOnPlayersInSegmentTaskInstanceResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ParameterValue = obj->TryGetField(TEXT("Parameter")); + if (ParameterValue.IsValid() && !ParameterValue->IsNull()) + { + Parameter = MakeShareable(new FActionsOnPlayersInSegmentTaskParameter(ParameterValue->AsObject())); + } + + const TSharedPtr SummaryValue = obj->TryGetField(TEXT("Summary")); + if (SummaryValue.IsValid() && !SummaryValue->IsNull()) + { + Summary = MakeShareable(new FActionsOnPlayersInSegmentTaskSummary(SummaryValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetAllSegmentsRequest::~FGetAllSegmentsRequest() +{ + +} + +void PlayFab::AdminModels::FGetAllSegmentsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetAllSegmentsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetSegmentResult::~FGetSegmentResult() +{ + +} + +void PlayFab::AdminModels::FGetSegmentResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ABTestParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ABTestParent")); writer->WriteValue(ABTestParent); } + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetSegmentResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ABTestParentValue = obj->TryGetField(TEXT("ABTestParent")); + if (ABTestParentValue.IsValid() && !ABTestParentValue->IsNull()) + { + FString TmpValue; + if (ABTestParentValue->TryGetString(TmpValue)) { ABTestParent = TmpValue; } + } + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetAllSegmentsResult::~FGetAllSegmentsResult() +{ + +} + +void PlayFab::AdminModels::FGetAllSegmentsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Segments.Num() != 0) + { + writer->WriteArrayStart(TEXT("Segments")); + for (const FGetSegmentResult& item : Segments) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetAllSegmentsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SegmentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Segments")); + for (int32 Idx = 0; Idx < SegmentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SegmentsArray[Idx]; + Segments.Add(FGetSegmentResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCatalogItemsRequest::~FGetCatalogItemsRequest() +{ + +} + +void PlayFab::AdminModels::FGetCatalogItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCatalogItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCatalogItemsResult::~FGetCatalogItemsResult() +{ + +} + +void PlayFab::AdminModels::FGetCatalogItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Catalog.Num() != 0) + { + writer->WriteArrayStart(TEXT("Catalog")); + for (const FCatalogItem& item : Catalog) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCatalogItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&CatalogArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Catalog")); + for (int32 Idx = 0; Idx < CatalogArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CatalogArray[Idx]; + Catalog.Add(FCatalogItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCloudScriptRevisionRequest::~FGetCloudScriptRevisionRequest() +{ + +} + +void PlayFab::AdminModels::FGetCloudScriptRevisionRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Revision.notNull()) { writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCloudScriptRevisionRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCloudScriptRevisionResult::~FGetCloudScriptRevisionResult() +{ + +} + +void PlayFab::AdminModels::FGetCloudScriptRevisionResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CreatedAt")); writeDatetime(CreatedAt, writer); + + if (Files.Num() != 0) + { + writer->WriteArrayStart(TEXT("Files")); + for (const FCloudScriptFile& item : Files) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("IsPublished")); writer->WriteValue(IsPublished); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCloudScriptRevisionResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreatedAtValue = obj->TryGetField(TEXT("CreatedAt")); + if (CreatedAtValue.IsValid()) + CreatedAt = readDatetime(CreatedAtValue); + + + const TArray>&FilesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Files")); + for (int32 Idx = 0; Idx < FilesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = FilesArray[Idx]; + Files.Add(FCloudScriptFile(CurrentItem->AsObject())); + } + + + const TSharedPtr IsPublishedValue = obj->TryGetField(TEXT("IsPublished")); + if (IsPublishedValue.IsValid() && !IsPublishedValue->IsNull()) + { + bool TmpValue; + if (IsPublishedValue->TryGetBool(TmpValue)) { IsPublished = TmpValue; } + } + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCloudScriptTaskInstanceResult::~FGetCloudScriptTaskInstanceResult() +{ + //if (Parameter != nullptr) delete Parameter; + //if (Summary != nullptr) delete Summary; + +} + +void PlayFab::AdminModels::FGetCloudScriptTaskInstanceResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Parameter.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Parameter")); Parameter->writeJSON(writer); } + + if (Summary.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Summary")); Summary->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCloudScriptTaskInstanceResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ParameterValue = obj->TryGetField(TEXT("Parameter")); + if (ParameterValue.IsValid() && !ParameterValue->IsNull()) + { + Parameter = MakeShareable(new FCloudScriptTaskParameter(ParameterValue->AsObject())); + } + + const TSharedPtr SummaryValue = obj->TryGetField(TEXT("Summary")); + if (SummaryValue.IsValid() && !SummaryValue->IsNull()) + { + Summary = MakeShareable(new FCloudScriptTaskSummary(SummaryValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCloudScriptVersionsRequest::~FGetCloudScriptVersionsRequest() +{ + +} + +void PlayFab::AdminModels::FGetCloudScriptVersionsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCloudScriptVersionsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCloudScriptVersionsResult::~FGetCloudScriptVersionsResult() +{ + +} + +void PlayFab::AdminModels::FGetCloudScriptVersionsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Versions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Versions")); + for (const FCloudScriptVersionStatus& item : Versions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCloudScriptVersionsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&VersionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Versions")); + for (int32 Idx = 0; Idx < VersionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = VersionsArray[Idx]; + Versions.Add(FCloudScriptVersionStatus(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetContentListRequest::~FGetContentListRequest() +{ + +} + +void PlayFab::AdminModels::FGetContentListRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Prefix.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Prefix")); writer->WriteValue(Prefix); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetContentListRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PrefixValue = obj->TryGetField(TEXT("Prefix")); + if (PrefixValue.IsValid() && !PrefixValue->IsNull()) + { + FString TmpValue; + if (PrefixValue->TryGetString(TmpValue)) { Prefix = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetContentListResult::~FGetContentListResult() +{ + +} + +void PlayFab::AdminModels::FGetContentListResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Contents.Num() != 0) + { + writer->WriteArrayStart(TEXT("Contents")); + for (const FContentInfo& item : Contents) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("ItemCount")); writer->WriteValue(ItemCount); + + writer->WriteIdentifierPrefix(TEXT("TotalSize")); writer->WriteValue(static_cast(TotalSize)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetContentListResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ContentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Contents")); + for (int32 Idx = 0; Idx < ContentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContentsArray[Idx]; + Contents.Add(FContentInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr ItemCountValue = obj->TryGetField(TEXT("ItemCount")); + if (ItemCountValue.IsValid() && !ItemCountValue->IsNull()) + { + int32 TmpValue; + if (ItemCountValue->TryGetNumber(TmpValue)) { ItemCount = TmpValue; } + } + + const TSharedPtr TotalSizeValue = obj->TryGetField(TEXT("TotalSize")); + if (TotalSizeValue.IsValid() && !TotalSizeValue->IsNull()) + { + uint32 TmpValue; + if (TotalSizeValue->TryGetNumber(TmpValue)) { TotalSize = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetContentUploadUrlRequest::~FGetContentUploadUrlRequest() +{ + +} + +void PlayFab::AdminModels::FGetContentUploadUrlRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ContentType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ContentType")); writer->WriteValue(ContentType); } + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetContentUploadUrlRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ContentTypeValue = obj->TryGetField(TEXT("ContentType")); + if (ContentTypeValue.IsValid() && !ContentTypeValue->IsNull()) + { + FString TmpValue; + if (ContentTypeValue->TryGetString(TmpValue)) { ContentType = TmpValue; } + } + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetContentUploadUrlResult::~FGetContentUploadUrlResult() +{ + +} + +void PlayFab::AdminModels::FGetContentUploadUrlResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (URL.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("URL")); writer->WriteValue(URL); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetContentUploadUrlResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr URLValue = obj->TryGetField(TEXT("URL")); + if (URLValue.IsValid() && !URLValue->IsNull()) + { + FString TmpValue; + if (URLValue->TryGetString(TmpValue)) { URL = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetDataReportRequest::~FGetDataReportRequest() +{ + +} + +void PlayFab::AdminModels::FGetDataReportRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Day")); writer->WriteValue(Day); + + writer->WriteIdentifierPrefix(TEXT("Month")); writer->WriteValue(Month); + + writer->WriteIdentifierPrefix(TEXT("ReportName")); writer->WriteValue(ReportName); + + writer->WriteIdentifierPrefix(TEXT("Year")); writer->WriteValue(Year); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetDataReportRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DayValue = obj->TryGetField(TEXT("Day")); + if (DayValue.IsValid() && !DayValue->IsNull()) + { + int32 TmpValue; + if (DayValue->TryGetNumber(TmpValue)) { Day = TmpValue; } + } + + const TSharedPtr MonthValue = obj->TryGetField(TEXT("Month")); + if (MonthValue.IsValid() && !MonthValue->IsNull()) + { + int32 TmpValue; + if (MonthValue->TryGetNumber(TmpValue)) { Month = TmpValue; } + } + + const TSharedPtr ReportNameValue = obj->TryGetField(TEXT("ReportName")); + if (ReportNameValue.IsValid() && !ReportNameValue->IsNull()) + { + FString TmpValue; + if (ReportNameValue->TryGetString(TmpValue)) { ReportName = TmpValue; } + } + + const TSharedPtr YearValue = obj->TryGetField(TEXT("Year")); + if (YearValue.IsValid() && !YearValue->IsNull()) + { + int32 TmpValue; + if (YearValue->TryGetNumber(TmpValue)) { Year = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetDataReportResult::~FGetDataReportResult() +{ + +} + +void PlayFab::AdminModels::FGetDataReportResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DownloadUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DownloadUrl")); writer->WriteValue(DownloadUrl); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetDataReportResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DownloadUrlValue = obj->TryGetField(TEXT("DownloadUrl")); + if (DownloadUrlValue.IsValid() && !DownloadUrlValue->IsNull()) + { + FString TmpValue; + if (DownloadUrlValue->TryGetString(TmpValue)) { DownloadUrl = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetMatchmakerGameInfoRequest::~FGetMatchmakerGameInfoRequest() +{ + +} + +void PlayFab::AdminModels::FGetMatchmakerGameInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetMatchmakerGameInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetMatchmakerGameInfoResult::~FGetMatchmakerGameInfoResult() +{ + +} + +void PlayFab::AdminModels::FGetMatchmakerGameInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BuildVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); } + + if (EndTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("EndTime")); writeDatetime(EndTime, writer); } + + if (LobbyId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); } + + if (Mode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Mode")); writer->WriteValue(Mode); } + + if (Players.Num() != 0) + { + writer->WriteArrayStart(TEXT("Players")); + for (const FString& item : Players) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (pfRegion.notNull()) { writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); } + + if (ServerAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerAddress")); writer->WriteValue(ServerAddress); } + + if (ServerIPV4Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV4Address")); writer->WriteValue(ServerIPV4Address); } + + if (ServerIPV6Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV6Address")); writer->WriteValue(ServerIPV6Address); } + + writer->WriteIdentifierPrefix(TEXT("ServerPort")); writer->WriteValue(static_cast(ServerPort)); + + if (ServerPublicDNSName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerPublicDNSName")); writer->WriteValue(ServerPublicDNSName); } + + writer->WriteIdentifierPrefix(TEXT("StartTime")); writeDatetime(StartTime, writer); + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetMatchmakerGameInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TSharedPtr EndTimeValue = obj->TryGetField(TEXT("EndTime")); + if (EndTimeValue.IsValid()) + EndTime = readDatetime(EndTimeValue); + + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + const TSharedPtr ModeValue = obj->TryGetField(TEXT("Mode")); + if (ModeValue.IsValid() && !ModeValue->IsNull()) + { + FString TmpValue; + if (ModeValue->TryGetString(TmpValue)) { Mode = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Players"), Players); + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + const TSharedPtr ServerAddressValue = obj->TryGetField(TEXT("ServerAddress")); + if (ServerAddressValue.IsValid() && !ServerAddressValue->IsNull()) + { + FString TmpValue; + if (ServerAddressValue->TryGetString(TmpValue)) { ServerAddress = TmpValue; } + } + + const TSharedPtr ServerIPV4AddressValue = obj->TryGetField(TEXT("ServerIPV4Address")); + if (ServerIPV4AddressValue.IsValid() && !ServerIPV4AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV4AddressValue->TryGetString(TmpValue)) { ServerIPV4Address = TmpValue; } + } + + const TSharedPtr ServerIPV6AddressValue = obj->TryGetField(TEXT("ServerIPV6Address")); + if (ServerIPV6AddressValue.IsValid() && !ServerIPV6AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV6AddressValue->TryGetString(TmpValue)) { ServerIPV6Address = TmpValue; } + } + + const TSharedPtr ServerPortValue = obj->TryGetField(TEXT("ServerPort")); + if (ServerPortValue.IsValid() && !ServerPortValue->IsNull()) + { + uint32 TmpValue; + if (ServerPortValue->TryGetNumber(TmpValue)) { ServerPort = TmpValue; } + } + + const TSharedPtr ServerPublicDNSNameValue = obj->TryGetField(TEXT("ServerPublicDNSName")); + if (ServerPublicDNSNameValue.IsValid() && !ServerPublicDNSNameValue->IsNull()) + { + FString TmpValue; + if (ServerPublicDNSNameValue->TryGetString(TmpValue)) { ServerPublicDNSName = TmpValue; } + } + + const TSharedPtr StartTimeValue = obj->TryGetField(TEXT("StartTime")); + if (StartTimeValue.IsValid()) + StartTime = readDatetime(StartTimeValue); + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetMatchmakerGameModesRequest::~FGetMatchmakerGameModesRequest() +{ + +} + +void PlayFab::AdminModels::FGetMatchmakerGameModesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetMatchmakerGameModesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetMatchmakerGameModesResult::~FGetMatchmakerGameModesResult() +{ + +} + +void PlayFab::AdminModels::FGetMatchmakerGameModesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GameModes.Num() != 0) + { + writer->WriteArrayStart(TEXT("GameModes")); + for (const FGameModeInfo& item : GameModes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetMatchmakerGameModesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GameModesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GameModes")); + for (int32 Idx = 0; Idx < GameModesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GameModesArray[Idx]; + GameModes.Add(FGameModeInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayedTitleListRequest::~FGetPlayedTitleListRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayedTitleListRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayedTitleListRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayedTitleListResult::~FGetPlayedTitleListResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayedTitleListResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TitleIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("TitleIds")); + for (const FString& item : TitleIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayedTitleListResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("TitleIds"), TitleIds); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerIdFromAuthTokenRequest::~FGetPlayerIdFromAuthTokenRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayerIdFromAuthTokenRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Token")); writer->WriteValue(Token); + + writer->WriteIdentifierPrefix(TEXT("TokenType")); writeAuthTokenTypeEnumJSON(TokenType, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerIdFromAuthTokenRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TokenValue = obj->TryGetField(TEXT("Token")); + if (TokenValue.IsValid() && !TokenValue->IsNull()) + { + FString TmpValue; + if (TokenValue->TryGetString(TmpValue)) { Token = TmpValue; } + } + + TokenType = readAuthTokenTypeFromValue(obj->TryGetField(TEXT("TokenType"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerIdFromAuthTokenResult::~FGetPlayerIdFromAuthTokenResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayerIdFromAuthTokenResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerIdFromAuthTokenResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerProfileViewConstraints::~FPlayerProfileViewConstraints() +{ + +} + +void PlayFab::AdminModels::FPlayerProfileViewConstraints::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ShowAvatarUrl")); writer->WriteValue(ShowAvatarUrl); + + writer->WriteIdentifierPrefix(TEXT("ShowBannedUntil")); writer->WriteValue(ShowBannedUntil); + + writer->WriteIdentifierPrefix(TEXT("ShowCampaignAttributions")); writer->WriteValue(ShowCampaignAttributions); + + writer->WriteIdentifierPrefix(TEXT("ShowContactEmailAddresses")); writer->WriteValue(ShowContactEmailAddresses); + + writer->WriteIdentifierPrefix(TEXT("ShowCreated")); writer->WriteValue(ShowCreated); + + writer->WriteIdentifierPrefix(TEXT("ShowDisplayName")); writer->WriteValue(ShowDisplayName); + + writer->WriteIdentifierPrefix(TEXT("ShowLastLogin")); writer->WriteValue(ShowLastLogin); + + writer->WriteIdentifierPrefix(TEXT("ShowLinkedAccounts")); writer->WriteValue(ShowLinkedAccounts); + + writer->WriteIdentifierPrefix(TEXT("ShowLocations")); writer->WriteValue(ShowLocations); + + writer->WriteIdentifierPrefix(TEXT("ShowMemberships")); writer->WriteValue(ShowMemberships); + + writer->WriteIdentifierPrefix(TEXT("ShowOrigination")); writer->WriteValue(ShowOrigination); + + writer->WriteIdentifierPrefix(TEXT("ShowPushNotificationRegistrations")); writer->WriteValue(ShowPushNotificationRegistrations); + + writer->WriteIdentifierPrefix(TEXT("ShowStatistics")); writer->WriteValue(ShowStatistics); + + writer->WriteIdentifierPrefix(TEXT("ShowTags")); writer->WriteValue(ShowTags); + + writer->WriteIdentifierPrefix(TEXT("ShowTotalValueToDateInUsd")); writer->WriteValue(ShowTotalValueToDateInUsd); + + writer->WriteIdentifierPrefix(TEXT("ShowValuesToDate")); writer->WriteValue(ShowValuesToDate); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerProfileViewConstraints::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ShowAvatarUrlValue = obj->TryGetField(TEXT("ShowAvatarUrl")); + if (ShowAvatarUrlValue.IsValid() && !ShowAvatarUrlValue->IsNull()) + { + bool TmpValue; + if (ShowAvatarUrlValue->TryGetBool(TmpValue)) { ShowAvatarUrl = TmpValue; } + } + + const TSharedPtr ShowBannedUntilValue = obj->TryGetField(TEXT("ShowBannedUntil")); + if (ShowBannedUntilValue.IsValid() && !ShowBannedUntilValue->IsNull()) + { + bool TmpValue; + if (ShowBannedUntilValue->TryGetBool(TmpValue)) { ShowBannedUntil = TmpValue; } + } + + const TSharedPtr ShowCampaignAttributionsValue = obj->TryGetField(TEXT("ShowCampaignAttributions")); + if (ShowCampaignAttributionsValue.IsValid() && !ShowCampaignAttributionsValue->IsNull()) + { + bool TmpValue; + if (ShowCampaignAttributionsValue->TryGetBool(TmpValue)) { ShowCampaignAttributions = TmpValue; } + } + + const TSharedPtr ShowContactEmailAddressesValue = obj->TryGetField(TEXT("ShowContactEmailAddresses")); + if (ShowContactEmailAddressesValue.IsValid() && !ShowContactEmailAddressesValue->IsNull()) + { + bool TmpValue; + if (ShowContactEmailAddressesValue->TryGetBool(TmpValue)) { ShowContactEmailAddresses = TmpValue; } + } + + const TSharedPtr ShowCreatedValue = obj->TryGetField(TEXT("ShowCreated")); + if (ShowCreatedValue.IsValid() && !ShowCreatedValue->IsNull()) + { + bool TmpValue; + if (ShowCreatedValue->TryGetBool(TmpValue)) { ShowCreated = TmpValue; } + } + + const TSharedPtr ShowDisplayNameValue = obj->TryGetField(TEXT("ShowDisplayName")); + if (ShowDisplayNameValue.IsValid() && !ShowDisplayNameValue->IsNull()) + { + bool TmpValue; + if (ShowDisplayNameValue->TryGetBool(TmpValue)) { ShowDisplayName = TmpValue; } + } + + const TSharedPtr ShowLastLoginValue = obj->TryGetField(TEXT("ShowLastLogin")); + if (ShowLastLoginValue.IsValid() && !ShowLastLoginValue->IsNull()) + { + bool TmpValue; + if (ShowLastLoginValue->TryGetBool(TmpValue)) { ShowLastLogin = TmpValue; } + } + + const TSharedPtr ShowLinkedAccountsValue = obj->TryGetField(TEXT("ShowLinkedAccounts")); + if (ShowLinkedAccountsValue.IsValid() && !ShowLinkedAccountsValue->IsNull()) + { + bool TmpValue; + if (ShowLinkedAccountsValue->TryGetBool(TmpValue)) { ShowLinkedAccounts = TmpValue; } + } + + const TSharedPtr ShowLocationsValue = obj->TryGetField(TEXT("ShowLocations")); + if (ShowLocationsValue.IsValid() && !ShowLocationsValue->IsNull()) + { + bool TmpValue; + if (ShowLocationsValue->TryGetBool(TmpValue)) { ShowLocations = TmpValue; } + } + + const TSharedPtr ShowMembershipsValue = obj->TryGetField(TEXT("ShowMemberships")); + if (ShowMembershipsValue.IsValid() && !ShowMembershipsValue->IsNull()) + { + bool TmpValue; + if (ShowMembershipsValue->TryGetBool(TmpValue)) { ShowMemberships = TmpValue; } + } + + const TSharedPtr ShowOriginationValue = obj->TryGetField(TEXT("ShowOrigination")); + if (ShowOriginationValue.IsValid() && !ShowOriginationValue->IsNull()) + { + bool TmpValue; + if (ShowOriginationValue->TryGetBool(TmpValue)) { ShowOrigination = TmpValue; } + } + + const TSharedPtr ShowPushNotificationRegistrationsValue = obj->TryGetField(TEXT("ShowPushNotificationRegistrations")); + if (ShowPushNotificationRegistrationsValue.IsValid() && !ShowPushNotificationRegistrationsValue->IsNull()) + { + bool TmpValue; + if (ShowPushNotificationRegistrationsValue->TryGetBool(TmpValue)) { ShowPushNotificationRegistrations = TmpValue; } + } + + const TSharedPtr ShowStatisticsValue = obj->TryGetField(TEXT("ShowStatistics")); + if (ShowStatisticsValue.IsValid() && !ShowStatisticsValue->IsNull()) + { + bool TmpValue; + if (ShowStatisticsValue->TryGetBool(TmpValue)) { ShowStatistics = TmpValue; } + } + + const TSharedPtr ShowTagsValue = obj->TryGetField(TEXT("ShowTags")); + if (ShowTagsValue.IsValid() && !ShowTagsValue->IsNull()) + { + bool TmpValue; + if (ShowTagsValue->TryGetBool(TmpValue)) { ShowTags = TmpValue; } + } + + const TSharedPtr ShowTotalValueToDateInUsdValue = obj->TryGetField(TEXT("ShowTotalValueToDateInUsd")); + if (ShowTotalValueToDateInUsdValue.IsValid() && !ShowTotalValueToDateInUsdValue->IsNull()) + { + bool TmpValue; + if (ShowTotalValueToDateInUsdValue->TryGetBool(TmpValue)) { ShowTotalValueToDateInUsd = TmpValue; } + } + + const TSharedPtr ShowValuesToDateValue = obj->TryGetField(TEXT("ShowValuesToDate")); + if (ShowValuesToDateValue.IsValid() && !ShowValuesToDateValue->IsNull()) + { + bool TmpValue; + if (ShowValuesToDateValue->TryGetBool(TmpValue)) { ShowValuesToDate = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerProfileRequest::~FGetPlayerProfileRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::AdminModels::FGetPlayerProfileRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerProfileRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeLoginIdentityProviderEnumJSON(LoginIdentityProvider enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case LoginIdentityProviderUnknown: writer->WriteValue(TEXT("Unknown")); break; + case LoginIdentityProviderPlayFab: writer->WriteValue(TEXT("PlayFab")); break; + case LoginIdentityProviderCustom: writer->WriteValue(TEXT("Custom")); break; + case LoginIdentityProviderGameCenter: writer->WriteValue(TEXT("GameCenter")); break; + case LoginIdentityProviderGooglePlay: writer->WriteValue(TEXT("GooglePlay")); break; + case LoginIdentityProviderSteam: writer->WriteValue(TEXT("Steam")); break; + case LoginIdentityProviderXBoxLive: writer->WriteValue(TEXT("XBoxLive")); break; + case LoginIdentityProviderPSN: writer->WriteValue(TEXT("PSN")); break; + case LoginIdentityProviderKongregate: writer->WriteValue(TEXT("Kongregate")); break; + case LoginIdentityProviderFacebook: writer->WriteValue(TEXT("Facebook")); break; + case LoginIdentityProviderIOSDevice: writer->WriteValue(TEXT("IOSDevice")); break; + case LoginIdentityProviderAndroidDevice: writer->WriteValue(TEXT("AndroidDevice")); break; + case LoginIdentityProviderTwitch: writer->WriteValue(TEXT("Twitch")); break; + case LoginIdentityProviderWindowsHello: writer->WriteValue(TEXT("WindowsHello")); break; + case LoginIdentityProviderGameServer: writer->WriteValue(TEXT("GameServer")); break; + case LoginIdentityProviderCustomServer: writer->WriteValue(TEXT("CustomServer")); break; + case LoginIdentityProviderNintendoSwitch: writer->WriteValue(TEXT("NintendoSwitch")); break; + case LoginIdentityProviderFacebookInstantGames: writer->WriteValue(TEXT("FacebookInstantGames")); break; + case LoginIdentityProviderOpenIdConnect: writer->WriteValue(TEXT("OpenIdConnect")); break; + } +} + +AdminModels::LoginIdentityProvider PlayFab::AdminModels::readLoginIdentityProviderFromValue(const TSharedPtr& value) +{ + return readLoginIdentityProviderFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::LoginIdentityProvider PlayFab::AdminModels::readLoginIdentityProviderFromValue(const FString& value) +{ + static TMap _LoginIdentityProviderMap; + if (_LoginIdentityProviderMap.Num() == 0) + { + // Auto-generate the map on the first use + _LoginIdentityProviderMap.Add(TEXT("Unknown"), LoginIdentityProviderUnknown); + _LoginIdentityProviderMap.Add(TEXT("PlayFab"), LoginIdentityProviderPlayFab); + _LoginIdentityProviderMap.Add(TEXT("Custom"), LoginIdentityProviderCustom); + _LoginIdentityProviderMap.Add(TEXT("GameCenter"), LoginIdentityProviderGameCenter); + _LoginIdentityProviderMap.Add(TEXT("GooglePlay"), LoginIdentityProviderGooglePlay); + _LoginIdentityProviderMap.Add(TEXT("Steam"), LoginIdentityProviderSteam); + _LoginIdentityProviderMap.Add(TEXT("XBoxLive"), LoginIdentityProviderXBoxLive); + _LoginIdentityProviderMap.Add(TEXT("PSN"), LoginIdentityProviderPSN); + _LoginIdentityProviderMap.Add(TEXT("Kongregate"), LoginIdentityProviderKongregate); + _LoginIdentityProviderMap.Add(TEXT("Facebook"), LoginIdentityProviderFacebook); + _LoginIdentityProviderMap.Add(TEXT("IOSDevice"), LoginIdentityProviderIOSDevice); + _LoginIdentityProviderMap.Add(TEXT("AndroidDevice"), LoginIdentityProviderAndroidDevice); + _LoginIdentityProviderMap.Add(TEXT("Twitch"), LoginIdentityProviderTwitch); + _LoginIdentityProviderMap.Add(TEXT("WindowsHello"), LoginIdentityProviderWindowsHello); + _LoginIdentityProviderMap.Add(TEXT("GameServer"), LoginIdentityProviderGameServer); + _LoginIdentityProviderMap.Add(TEXT("CustomServer"), LoginIdentityProviderCustomServer); + _LoginIdentityProviderMap.Add(TEXT("NintendoSwitch"), LoginIdentityProviderNintendoSwitch); + _LoginIdentityProviderMap.Add(TEXT("FacebookInstantGames"), LoginIdentityProviderFacebookInstantGames); + _LoginIdentityProviderMap.Add(TEXT("OpenIdConnect"), LoginIdentityProviderOpenIdConnect); + + } + + if (!value.IsEmpty()) + { + auto output = _LoginIdentityProviderMap.Find(value); + if (output != nullptr) + return *output; + } + + return LoginIdentityProviderUnknown; // Basically critical fail +} + +PlayFab::AdminModels::FLinkedPlatformAccountModel::~FLinkedPlatformAccountModel() +{ + +} + +void PlayFab::AdminModels::FLinkedPlatformAccountModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writeLoginIdentityProviderEnumJSON(Platform, writer); } + + if (PlatformUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlatformUserId")); writer->WriteValue(PlatformUserId); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FLinkedPlatformAccountModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + Platform = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Platform"))); + + const TSharedPtr PlatformUserIdValue = obj->TryGetField(TEXT("PlatformUserId")); + if (PlatformUserIdValue.IsValid() && !PlatformUserIdValue->IsNull()) + { + FString TmpValue; + if (PlatformUserIdValue->TryGetString(TmpValue)) { PlatformUserId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FLocationModel::~FLocationModel() +{ + +} + +void PlayFab::AdminModels::FLocationModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (City.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("City")); writer->WriteValue(City); } + + if (pfContinentCode.notNull()) { writer->WriteIdentifierPrefix(TEXT("ContinentCode")); writeContinentCodeEnumJSON(pfContinentCode, writer); } + + if (pfCountryCode.notNull()) { writer->WriteIdentifierPrefix(TEXT("CountryCode")); writeCountryCodeEnumJSON(pfCountryCode, writer); } + + if (Latitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Latitude")); writer->WriteValue(Latitude); } + + if (Longitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Longitude")); writer->WriteValue(Longitude); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FLocationModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CityValue = obj->TryGetField(TEXT("City")); + if (CityValue.IsValid() && !CityValue->IsNull()) + { + FString TmpValue; + if (CityValue->TryGetString(TmpValue)) { City = TmpValue; } + } + + pfContinentCode = readContinentCodeFromValue(obj->TryGetField(TEXT("ContinentCode"))); + + pfCountryCode = readCountryCodeFromValue(obj->TryGetField(TEXT("CountryCode"))); + + const TSharedPtr LatitudeValue = obj->TryGetField(TEXT("Latitude")); + if (LatitudeValue.IsValid() && !LatitudeValue->IsNull()) + { + double TmpValue; + if (LatitudeValue->TryGetNumber(TmpValue)) { Latitude = TmpValue; } + } + + const TSharedPtr LongitudeValue = obj->TryGetField(TEXT("Longitude")); + if (LongitudeValue.IsValid() && !LongitudeValue->IsNull()) + { + double TmpValue; + if (LongitudeValue->TryGetNumber(TmpValue)) { Longitude = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeSubscriptionProviderStatusEnumJSON(SubscriptionProviderStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case SubscriptionProviderStatusNoError: writer->WriteValue(TEXT("NoError")); break; + case SubscriptionProviderStatusCancelled: writer->WriteValue(TEXT("Cancelled")); break; + case SubscriptionProviderStatusUnknownError: writer->WriteValue(TEXT("UnknownError")); break; + case SubscriptionProviderStatusBillingError: writer->WriteValue(TEXT("BillingError")); break; + case SubscriptionProviderStatusProductUnavailable: writer->WriteValue(TEXT("ProductUnavailable")); break; + case SubscriptionProviderStatusCustomerDidNotAcceptPriceChange: writer->WriteValue(TEXT("CustomerDidNotAcceptPriceChange")); break; + case SubscriptionProviderStatusFreeTrial: writer->WriteValue(TEXT("FreeTrial")); break; + case SubscriptionProviderStatusPaymentPending: writer->WriteValue(TEXT("PaymentPending")); break; + } +} + +AdminModels::SubscriptionProviderStatus PlayFab::AdminModels::readSubscriptionProviderStatusFromValue(const TSharedPtr& value) +{ + return readSubscriptionProviderStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::SubscriptionProviderStatus PlayFab::AdminModels::readSubscriptionProviderStatusFromValue(const FString& value) +{ + static TMap _SubscriptionProviderStatusMap; + if (_SubscriptionProviderStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _SubscriptionProviderStatusMap.Add(TEXT("NoError"), SubscriptionProviderStatusNoError); + _SubscriptionProviderStatusMap.Add(TEXT("Cancelled"), SubscriptionProviderStatusCancelled); + _SubscriptionProviderStatusMap.Add(TEXT("UnknownError"), SubscriptionProviderStatusUnknownError); + _SubscriptionProviderStatusMap.Add(TEXT("BillingError"), SubscriptionProviderStatusBillingError); + _SubscriptionProviderStatusMap.Add(TEXT("ProductUnavailable"), SubscriptionProviderStatusProductUnavailable); + _SubscriptionProviderStatusMap.Add(TEXT("CustomerDidNotAcceptPriceChange"), SubscriptionProviderStatusCustomerDidNotAcceptPriceChange); + _SubscriptionProviderStatusMap.Add(TEXT("FreeTrial"), SubscriptionProviderStatusFreeTrial); + _SubscriptionProviderStatusMap.Add(TEXT("PaymentPending"), SubscriptionProviderStatusPaymentPending); + + } + + if (!value.IsEmpty()) + { + auto output = _SubscriptionProviderStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return SubscriptionProviderStatusNoError; // Basically critical fail +} + +PlayFab::AdminModels::FSubscriptionModel::~FSubscriptionModel() +{ + +} + +void PlayFab::AdminModels::FSubscriptionModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); + + writer->WriteIdentifierPrefix(TEXT("InitialSubscriptionTime")); writeDatetime(InitialSubscriptionTime, writer); + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeSubscriptionProviderStatusEnumJSON(Status, writer); } + + if (SubscriptionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionId")); writer->WriteValue(SubscriptionId); } + + if (SubscriptionItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionItemId")); writer->WriteValue(SubscriptionItemId); } + + if (SubscriptionProvider.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionProvider")); writer->WriteValue(SubscriptionProvider); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSubscriptionModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr InitialSubscriptionTimeValue = obj->TryGetField(TEXT("InitialSubscriptionTime")); + if (InitialSubscriptionTimeValue.IsValid()) + InitialSubscriptionTime = readDatetime(InitialSubscriptionTimeValue); + + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + Status = readSubscriptionProviderStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr SubscriptionIdValue = obj->TryGetField(TEXT("SubscriptionId")); + if (SubscriptionIdValue.IsValid() && !SubscriptionIdValue->IsNull()) + { + FString TmpValue; + if (SubscriptionIdValue->TryGetString(TmpValue)) { SubscriptionId = TmpValue; } + } + + const TSharedPtr SubscriptionItemIdValue = obj->TryGetField(TEXT("SubscriptionItemId")); + if (SubscriptionItemIdValue.IsValid() && !SubscriptionItemIdValue->IsNull()) + { + FString TmpValue; + if (SubscriptionItemIdValue->TryGetString(TmpValue)) { SubscriptionItemId = TmpValue; } + } + + const TSharedPtr SubscriptionProviderValue = obj->TryGetField(TEXT("SubscriptionProvider")); + if (SubscriptionProviderValue.IsValid() && !SubscriptionProviderValue->IsNull()) + { + FString TmpValue; + if (SubscriptionProviderValue->TryGetString(TmpValue)) { SubscriptionProvider = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FMembershipModel::~FMembershipModel() +{ + +} + +void PlayFab::AdminModels::FMembershipModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + writer->WriteIdentifierPrefix(TEXT("MembershipExpiration")); writeDatetime(MembershipExpiration, writer); + + if (MembershipId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MembershipId")); writer->WriteValue(MembershipId); } + + if (OverrideExpiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("OverrideExpiration")); writeDatetime(OverrideExpiration, writer); } + + if (OverrideIsSet.notNull()) { writer->WriteIdentifierPrefix(TEXT("OverrideIsSet")); writer->WriteValue(OverrideIsSet); } + + if (Subscriptions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Subscriptions")); + for (const FSubscriptionModel& item : Subscriptions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FMembershipModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr MembershipExpirationValue = obj->TryGetField(TEXT("MembershipExpiration")); + if (MembershipExpirationValue.IsValid()) + MembershipExpiration = readDatetime(MembershipExpirationValue); + + + const TSharedPtr MembershipIdValue = obj->TryGetField(TEXT("MembershipId")); + if (MembershipIdValue.IsValid() && !MembershipIdValue->IsNull()) + { + FString TmpValue; + if (MembershipIdValue->TryGetString(TmpValue)) { MembershipId = TmpValue; } + } + + const TSharedPtr OverrideExpirationValue = obj->TryGetField(TEXT("OverrideExpiration")); + if (OverrideExpirationValue.IsValid()) + OverrideExpiration = readDatetime(OverrideExpirationValue); + + + const TSharedPtr OverrideIsSetValue = obj->TryGetField(TEXT("OverrideIsSet")); + if (OverrideIsSetValue.IsValid() && !OverrideIsSetValue->IsNull()) + { + bool TmpValue; + if (OverrideIsSetValue->TryGetBool(TmpValue)) { OverrideIsSet = TmpValue; } + } + + const TArray>&SubscriptionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Subscriptions")); + for (int32 Idx = 0; Idx < SubscriptionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SubscriptionsArray[Idx]; + Subscriptions.Add(FSubscriptionModel(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::AdminModels::writePushNotificationPlatformEnumJSON(PushNotificationPlatform enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case PushNotificationPlatformApplePushNotificationService: writer->WriteValue(TEXT("ApplePushNotificationService")); break; + case PushNotificationPlatformGoogleCloudMessaging: writer->WriteValue(TEXT("GoogleCloudMessaging")); break; + } +} + +AdminModels::PushNotificationPlatform PlayFab::AdminModels::readPushNotificationPlatformFromValue(const TSharedPtr& value) +{ + return readPushNotificationPlatformFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::PushNotificationPlatform PlayFab::AdminModels::readPushNotificationPlatformFromValue(const FString& value) +{ + static TMap _PushNotificationPlatformMap; + if (_PushNotificationPlatformMap.Num() == 0) + { + // Auto-generate the map on the first use + _PushNotificationPlatformMap.Add(TEXT("ApplePushNotificationService"), PushNotificationPlatformApplePushNotificationService); + _PushNotificationPlatformMap.Add(TEXT("GoogleCloudMessaging"), PushNotificationPlatformGoogleCloudMessaging); + + } + + if (!value.IsEmpty()) + { + auto output = _PushNotificationPlatformMap.Find(value); + if (output != nullptr) + return *output; + } + + return PushNotificationPlatformApplePushNotificationService; // Basically critical fail +} + +PlayFab::AdminModels::FPushNotificationRegistrationModel::~FPushNotificationRegistrationModel() +{ + +} + +void PlayFab::AdminModels::FPushNotificationRegistrationModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NotificationEndpointARN.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NotificationEndpointARN")); writer->WriteValue(NotificationEndpointARN); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writePushNotificationPlatformEnumJSON(Platform, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPushNotificationRegistrationModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NotificationEndpointARNValue = obj->TryGetField(TEXT("NotificationEndpointARN")); + if (NotificationEndpointARNValue.IsValid() && !NotificationEndpointARNValue->IsNull()) + { + FString TmpValue; + if (NotificationEndpointARNValue->TryGetString(TmpValue)) { NotificationEndpointARN = TmpValue; } + } + + Platform = readPushNotificationPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FStatisticModel::~FStatisticModel() +{ + +} + +void PlayFab::AdminModels::FStatisticModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FStatisticModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FTagModel::~FTagModel() +{ + +} + +void PlayFab::AdminModels::FTagModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TagValue.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TagValue")); writer->WriteValue(TagValue); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FTagModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TagValueValue = obj->TryGetField(TEXT("TagValue")); + if (TagValueValue.IsValid() && !TagValueValue->IsNull()) + { + FString TmpValue; + if (TagValueValue->TryGetString(TmpValue)) { TagValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FValueToDateModel::~FValueToDateModel() +{ + +} + +void PlayFab::AdminModels::FValueToDateModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Currency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Currency")); writer->WriteValue(Currency); } + + writer->WriteIdentifierPrefix(TEXT("TotalValue")); writer->WriteValue(static_cast(TotalValue)); + + if (TotalValueAsDecimal.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TotalValueAsDecimal")); writer->WriteValue(TotalValueAsDecimal); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FValueToDateModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyValue = obj->TryGetField(TEXT("Currency")); + if (CurrencyValue.IsValid() && !CurrencyValue->IsNull()) + { + FString TmpValue; + if (CurrencyValue->TryGetString(TmpValue)) { Currency = TmpValue; } + } + + const TSharedPtr TotalValueValue = obj->TryGetField(TEXT("TotalValue")); + if (TotalValueValue.IsValid() && !TotalValueValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueValue->TryGetNumber(TmpValue)) { TotalValue = TmpValue; } + } + + const TSharedPtr TotalValueAsDecimalValue = obj->TryGetField(TEXT("TotalValueAsDecimal")); + if (TotalValueAsDecimalValue.IsValid() && !TotalValueAsDecimalValue->IsNull()) + { + FString TmpValue; + if (TotalValueAsDecimalValue->TryGetString(TmpValue)) { TotalValueAsDecimal = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerProfileModel::~FPlayerProfileModel() +{ + +} + +void PlayFab::AdminModels::FPlayerProfileModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdCampaignAttributions.Num() != 0) + { + writer->WriteArrayStart(TEXT("AdCampaignAttributions")); + for (const FAdCampaignAttributionModel& item : AdCampaignAttributions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + if (BannedUntil.notNull()) { writer->WriteIdentifierPrefix(TEXT("BannedUntil")); writeDatetime(BannedUntil, writer); } + + if (ContactEmailAddresses.Num() != 0) + { + writer->WriteArrayStart(TEXT("ContactEmailAddresses")); + for (const FContactEmailInfoModel& item : ContactEmailAddresses) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (LinkedAccounts.Num() != 0) + { + writer->WriteArrayStart(TEXT("LinkedAccounts")); + for (const FLinkedPlatformAccountModel& item : LinkedAccounts) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Locations.Num() != 0) + { + writer->WriteArrayStart(TEXT("Locations")); + for (const FLocationModel& item : Locations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Memberships.Num() != 0) + { + writer->WriteArrayStart(TEXT("Memberships")); + for (const FMembershipModel& item : Memberships) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeLoginIdentityProviderEnumJSON(Origination, writer); } + + if (PlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerId")); writer->WriteValue(PlayerId); } + + if (PublisherId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PublisherId")); writer->WriteValue(PublisherId); } + + if (PushNotificationRegistrations.Num() != 0) + { + writer->WriteArrayStart(TEXT("PushNotificationRegistrations")); + for (const FPushNotificationRegistrationModel& item : PushNotificationRegistrations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Statistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticModel& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FTagModel& item : Tags) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + if (TotalValueToDateInUSD.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalValueToDateInUSD")); writer->WriteValue(static_cast(TotalValueToDateInUSD)); } + + if (ValuesToDate.Num() != 0) + { + writer->WriteArrayStart(TEXT("ValuesToDate")); + for (const FValueToDateModel& item : ValuesToDate) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerProfileModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AdCampaignAttributionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AdCampaignAttributions")); + for (int32 Idx = 0; Idx < AdCampaignAttributionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AdCampaignAttributionsArray[Idx]; + AdCampaignAttributions.Add(FAdCampaignAttributionModel(CurrentItem->AsObject())); + } + + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr BannedUntilValue = obj->TryGetField(TEXT("BannedUntil")); + if (BannedUntilValue.IsValid()) + BannedUntil = readDatetime(BannedUntilValue); + + + const TArray>&ContactEmailAddressesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ContactEmailAddresses")); + for (int32 Idx = 0; Idx < ContactEmailAddressesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContactEmailAddressesArray[Idx]; + ContactEmailAddresses.Add(FContactEmailInfoModel(CurrentItem->AsObject())); + } + + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + const TArray>&LinkedAccountsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("LinkedAccounts")); + for (int32 Idx = 0; Idx < LinkedAccountsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LinkedAccountsArray[Idx]; + LinkedAccounts.Add(FLinkedPlatformAccountModel(CurrentItem->AsObject())); + } + + + const TArray>&LocationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Locations")); + for (int32 Idx = 0; Idx < LocationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LocationsArray[Idx]; + Locations.Add(FLocationModel(CurrentItem->AsObject())); + } + + + const TArray>&MembershipsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Memberships")); + for (int32 Idx = 0; Idx < MembershipsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembershipsArray[Idx]; + Memberships.Add(FMembershipModel(CurrentItem->AsObject())); + } + + + Origination = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr PlayerIdValue = obj->TryGetField(TEXT("PlayerId")); + if (PlayerIdValue.IsValid() && !PlayerIdValue->IsNull()) + { + FString TmpValue; + if (PlayerIdValue->TryGetString(TmpValue)) { PlayerId = TmpValue; } + } + + const TSharedPtr PublisherIdValue = obj->TryGetField(TEXT("PublisherId")); + if (PublisherIdValue.IsValid() && !PublisherIdValue->IsNull()) + { + FString TmpValue; + if (PublisherIdValue->TryGetString(TmpValue)) { PublisherId = TmpValue; } + } + + const TArray>&PushNotificationRegistrationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PushNotificationRegistrations")); + for (int32 Idx = 0; Idx < PushNotificationRegistrationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PushNotificationRegistrationsArray[Idx]; + PushNotificationRegistrations.Add(FPushNotificationRegistrationModel(CurrentItem->AsObject())); + } + + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticModel(CurrentItem->AsObject())); + } + + + const TArray>&TagsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Tags")); + for (int32 Idx = 0; Idx < TagsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = TagsArray[Idx]; + Tags.Add(FTagModel(CurrentItem->AsObject())); + } + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr TotalValueToDateInUSDValue = obj->TryGetField(TEXT("TotalValueToDateInUSD")); + if (TotalValueToDateInUSDValue.IsValid() && !TotalValueToDateInUSDValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueToDateInUSDValue->TryGetNumber(TmpValue)) { TotalValueToDateInUSD = TmpValue; } + } + + const TArray>&ValuesToDateArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ValuesToDate")); + for (int32 Idx = 0; Idx < ValuesToDateArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ValuesToDateArray[Idx]; + ValuesToDate.Add(FValueToDateModel(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerProfileResult::~FGetPlayerProfileResult() +{ + //if (PlayerProfile != nullptr) delete PlayerProfile; + +} + +void PlayFab::AdminModels::FGetPlayerProfileResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayerProfile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PlayerProfile")); PlayerProfile->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerProfileResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayerProfileValue = obj->TryGetField(TEXT("PlayerProfile")); + if (PlayerProfileValue.IsValid() && !PlayerProfileValue->IsNull()) + { + PlayerProfile = MakeShareable(new FPlayerProfileModel(PlayerProfileValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerSegmentsResult::~FGetPlayerSegmentsResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayerSegmentsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Segments.Num() != 0) + { + writer->WriteArrayStart(TEXT("Segments")); + for (const FGetSegmentResult& item : Segments) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerSegmentsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SegmentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Segments")); + for (int32 Idx = 0; Idx < SegmentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SegmentsArray[Idx]; + Segments.Add(FGetSegmentResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerSharedSecretsRequest::~FGetPlayerSharedSecretsRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayerSharedSecretsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerSharedSecretsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FSharedSecret::~FSharedSecret() +{ + +} + +void PlayFab::AdminModels::FSharedSecret::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Disabled")); writer->WriteValue(Disabled); + + if (FriendlyName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendlyName")); writer->WriteValue(FriendlyName); } + + if (SecretKey.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SecretKey")); writer->WriteValue(SecretKey); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSharedSecret::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisabledValue = obj->TryGetField(TEXT("Disabled")); + if (DisabledValue.IsValid() && !DisabledValue->IsNull()) + { + bool TmpValue; + if (DisabledValue->TryGetBool(TmpValue)) { Disabled = TmpValue; } + } + + const TSharedPtr FriendlyNameValue = obj->TryGetField(TEXT("FriendlyName")); + if (FriendlyNameValue.IsValid() && !FriendlyNameValue->IsNull()) + { + FString TmpValue; + if (FriendlyNameValue->TryGetString(TmpValue)) { FriendlyName = TmpValue; } + } + + const TSharedPtr SecretKeyValue = obj->TryGetField(TEXT("SecretKey")); + if (SecretKeyValue.IsValid() && !SecretKeyValue->IsNull()) + { + FString TmpValue; + if (SecretKeyValue->TryGetString(TmpValue)) { SecretKey = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerSharedSecretsResult::~FGetPlayerSharedSecretsResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayerSharedSecretsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SharedSecrets.Num() != 0) + { + writer->WriteArrayStart(TEXT("SharedSecrets")); + for (const FSharedSecret& item : SharedSecrets) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerSharedSecretsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SharedSecretsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("SharedSecrets")); + for (int32 Idx = 0; Idx < SharedSecretsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SharedSecretsArray[Idx]; + SharedSecrets.Add(FSharedSecret(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayersInSegmentRequest::~FGetPlayersInSegmentRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayersInSegmentRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ContinuationToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ContinuationToken")); writer->WriteValue(ContinuationToken); } + + if (MaxBatchSize.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxBatchSize")); writer->WriteValue(static_cast(MaxBatchSize)); } + + if (SecondsToLive.notNull()) { writer->WriteIdentifierPrefix(TEXT("SecondsToLive")); writer->WriteValue(static_cast(SecondsToLive)); } + + writer->WriteIdentifierPrefix(TEXT("SegmentId")); writer->WriteValue(SegmentId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayersInSegmentRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ContinuationTokenValue = obj->TryGetField(TEXT("ContinuationToken")); + if (ContinuationTokenValue.IsValid() && !ContinuationTokenValue->IsNull()) + { + FString TmpValue; + if (ContinuationTokenValue->TryGetString(TmpValue)) { ContinuationToken = TmpValue; } + } + + const TSharedPtr MaxBatchSizeValue = obj->TryGetField(TEXT("MaxBatchSize")); + if (MaxBatchSizeValue.IsValid() && !MaxBatchSizeValue->IsNull()) + { + uint32 TmpValue; + if (MaxBatchSizeValue->TryGetNumber(TmpValue)) { MaxBatchSize = TmpValue; } + } + + const TSharedPtr SecondsToLiveValue = obj->TryGetField(TEXT("SecondsToLive")); + if (SecondsToLiveValue.IsValid() && !SecondsToLiveValue->IsNull()) + { + uint32 TmpValue; + if (SecondsToLiveValue->TryGetNumber(TmpValue)) { SecondsToLive = TmpValue; } + } + + const TSharedPtr SegmentIdValue = obj->TryGetField(TEXT("SegmentId")); + if (SegmentIdValue.IsValid() && !SegmentIdValue->IsNull()) + { + FString TmpValue; + if (SegmentIdValue->TryGetString(TmpValue)) { SegmentId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerLinkedAccount::~FPlayerLinkedAccount() +{ + +} + +void PlayFab::AdminModels::FPlayerLinkedAccount::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writeLoginIdentityProviderEnumJSON(Platform, writer); } + + if (PlatformUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlatformUserId")); writer->WriteValue(PlatformUserId); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerLinkedAccount::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + Platform = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Platform"))); + + const TSharedPtr PlatformUserIdValue = obj->TryGetField(TEXT("PlatformUserId")); + if (PlatformUserIdValue.IsValid() && !PlatformUserIdValue->IsNull()) + { + FString TmpValue; + if (PlatformUserIdValue->TryGetString(TmpValue)) { PlatformUserId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerLocation::~FPlayerLocation() +{ + +} + +void PlayFab::AdminModels::FPlayerLocation::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (City.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("City")); writer->WriteValue(City); } + + writer->WriteIdentifierPrefix(TEXT("ContinentCode")); writeContinentCodeEnumJSON(pfContinentCode, writer); + + writer->WriteIdentifierPrefix(TEXT("CountryCode")); writeCountryCodeEnumJSON(pfCountryCode, writer); + + if (Latitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Latitude")); writer->WriteValue(Latitude); } + + if (Longitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Longitude")); writer->WriteValue(Longitude); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerLocation::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CityValue = obj->TryGetField(TEXT("City")); + if (CityValue.IsValid() && !CityValue->IsNull()) + { + FString TmpValue; + if (CityValue->TryGetString(TmpValue)) { City = TmpValue; } + } + + pfContinentCode = readContinentCodeFromValue(obj->TryGetField(TEXT("ContinentCode"))); + + pfCountryCode = readCountryCodeFromValue(obj->TryGetField(TEXT("CountryCode"))); + + const TSharedPtr LatitudeValue = obj->TryGetField(TEXT("Latitude")); + if (LatitudeValue.IsValid() && !LatitudeValue->IsNull()) + { + double TmpValue; + if (LatitudeValue->TryGetNumber(TmpValue)) { Latitude = TmpValue; } + } + + const TSharedPtr LongitudeValue = obj->TryGetField(TEXT("Longitude")); + if (LongitudeValue.IsValid() && !LongitudeValue->IsNull()) + { + double TmpValue; + if (LongitudeValue->TryGetNumber(TmpValue)) { Longitude = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerStatistic::~FPlayerStatistic() +{ + +} + +void PlayFab::AdminModels::FPlayerStatistic::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Id.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteIdentifierPrefix(TEXT("StatisticValue")); writer->WriteValue(StatisticValue); + + writer->WriteIdentifierPrefix(TEXT("StatisticVersion")); writer->WriteValue(StatisticVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerStatistic::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr StatisticValueValue = obj->TryGetField(TEXT("StatisticValue")); + if (StatisticValueValue.IsValid() && !StatisticValueValue->IsNull()) + { + int32 TmpValue; + if (StatisticValueValue->TryGetNumber(TmpValue)) { StatisticValue = TmpValue; } + } + + const TSharedPtr StatisticVersionValue = obj->TryGetField(TEXT("StatisticVersion")); + if (StatisticVersionValue.IsValid() && !StatisticVersionValue->IsNull()) + { + int32 TmpValue; + if (StatisticVersionValue->TryGetNumber(TmpValue)) { StatisticVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPushNotificationRegistration::~FPushNotificationRegistration() +{ + +} + +void PlayFab::AdminModels::FPushNotificationRegistration::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NotificationEndpointARN.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NotificationEndpointARN")); writer->WriteValue(NotificationEndpointARN); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writePushNotificationPlatformEnumJSON(Platform, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPushNotificationRegistration::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NotificationEndpointARNValue = obj->TryGetField(TEXT("NotificationEndpointARN")); + if (NotificationEndpointARNValue.IsValid() && !NotificationEndpointARNValue->IsNull()) + { + FString TmpValue; + if (NotificationEndpointARNValue->TryGetString(TmpValue)) { NotificationEndpointARN = TmpValue; } + } + + Platform = readPushNotificationPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerProfile::~FPlayerProfile() +{ + +} + +void PlayFab::AdminModels::FPlayerProfile::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdCampaignAttributions.Num() != 0) + { + writer->WriteArrayStart(TEXT("AdCampaignAttributions")); + for (const FAdCampaignAttribution& item : AdCampaignAttributions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + if (BannedUntil.notNull()) { writer->WriteIdentifierPrefix(TEXT("BannedUntil")); writeDatetime(BannedUntil, writer); } + + if (ContactEmailAddresses.Num() != 0) + { + writer->WriteArrayStart(TEXT("ContactEmailAddresses")); + for (const FContactEmailInfo& item : ContactEmailAddresses) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (LinkedAccounts.Num() != 0) + { + writer->WriteArrayStart(TEXT("LinkedAccounts")); + for (const FPlayerLinkedAccount& item : LinkedAccounts) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Locations.Num() != 0) + { + writer->WriteObjectStart(TEXT("Locations")); + for (TMap::TConstIterator It(Locations); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeLoginIdentityProviderEnumJSON(Origination, writer); } + + if (PlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerId")); writer->WriteValue(PlayerId); } + + if (PlayerStatistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerStatistics")); + for (const FPlayerStatistic& item : PlayerStatistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PublisherId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PublisherId")); writer->WriteValue(PublisherId); } + + if (PushNotificationRegistrations.Num() != 0) + { + writer->WriteArrayStart(TEXT("PushNotificationRegistrations")); + for (const FPushNotificationRegistration& item : PushNotificationRegistrations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Statistics.Num() != 0) + { + writer->WriteObjectStart(TEXT("Statistics")); + for (TMap::TConstIterator It(Statistics); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + if (TotalValueToDateInUSD.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalValueToDateInUSD")); writer->WriteValue(static_cast(TotalValueToDateInUSD)); } + + if (ValuesToDate.Num() != 0) + { + writer->WriteObjectStart(TEXT("ValuesToDate")); + for (TMap::TConstIterator It(ValuesToDate); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyBalances.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyBalances")); + for (TMap::TConstIterator It(VirtualCurrencyBalances); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerProfile::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AdCampaignAttributionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AdCampaignAttributions")); + for (int32 Idx = 0; Idx < AdCampaignAttributionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AdCampaignAttributionsArray[Idx]; + AdCampaignAttributions.Add(FAdCampaignAttribution(CurrentItem->AsObject())); + } + + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr BannedUntilValue = obj->TryGetField(TEXT("BannedUntil")); + if (BannedUntilValue.IsValid()) + BannedUntil = readDatetime(BannedUntilValue); + + + const TArray>&ContactEmailAddressesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ContactEmailAddresses")); + for (int32 Idx = 0; Idx < ContactEmailAddressesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContactEmailAddressesArray[Idx]; + ContactEmailAddresses.Add(FContactEmailInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + const TArray>&LinkedAccountsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("LinkedAccounts")); + for (int32 Idx = 0; Idx < LinkedAccountsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LinkedAccountsArray[Idx]; + LinkedAccounts.Add(FPlayerLinkedAccount(CurrentItem->AsObject())); + } + + + const TSharedPtr* LocationsObject; + if (obj->TryGetObjectField(TEXT("Locations"), LocationsObject)) + { + for (TMap>::TConstIterator It((*LocationsObject)->Values); It; ++It) + { + Locations.Add(It.Key(), FPlayerLocation(It.Value()->AsObject())); + } + } + + Origination = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr PlayerIdValue = obj->TryGetField(TEXT("PlayerId")); + if (PlayerIdValue.IsValid() && !PlayerIdValue->IsNull()) + { + FString TmpValue; + if (PlayerIdValue->TryGetString(TmpValue)) { PlayerId = TmpValue; } + } + + const TArray>&PlayerStatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PlayerStatistics")); + for (int32 Idx = 0; Idx < PlayerStatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PlayerStatisticsArray[Idx]; + PlayerStatistics.Add(FPlayerStatistic(CurrentItem->AsObject())); + } + + + const TSharedPtr PublisherIdValue = obj->TryGetField(TEXT("PublisherId")); + if (PublisherIdValue.IsValid() && !PublisherIdValue->IsNull()) + { + FString TmpValue; + if (PublisherIdValue->TryGetString(TmpValue)) { PublisherId = TmpValue; } + } + + const TArray>&PushNotificationRegistrationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PushNotificationRegistrations")); + for (int32 Idx = 0; Idx < PushNotificationRegistrationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PushNotificationRegistrationsArray[Idx]; + PushNotificationRegistrations.Add(FPushNotificationRegistration(CurrentItem->AsObject())); + } + + + const TSharedPtr* StatisticsObject; + if (obj->TryGetObjectField(TEXT("Statistics"), StatisticsObject)) + { + for (TMap>::TConstIterator It((*StatisticsObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + Statistics.Add(It.Key(), TmpValue); + } + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr TotalValueToDateInUSDValue = obj->TryGetField(TEXT("TotalValueToDateInUSD")); + if (TotalValueToDateInUSDValue.IsValid() && !TotalValueToDateInUSDValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueToDateInUSDValue->TryGetNumber(TmpValue)) { TotalValueToDateInUSD = TmpValue; } + } + + const TSharedPtr* ValuesToDateObject; + if (obj->TryGetObjectField(TEXT("ValuesToDate"), ValuesToDateObject)) + { + for (TMap>::TConstIterator It((*ValuesToDateObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + ValuesToDate.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyBalancesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyBalances"), VirtualCurrencyBalancesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyBalancesObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyBalances.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayersInSegmentResult::~FGetPlayersInSegmentResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayersInSegmentResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ContinuationToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ContinuationToken")); writer->WriteValue(ContinuationToken); } + + if (PlayerProfiles.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerProfiles")); + for (const FPlayerProfile& item : PlayerProfiles) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("ProfilesInSegment")); writer->WriteValue(ProfilesInSegment); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayersInSegmentResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ContinuationTokenValue = obj->TryGetField(TEXT("ContinuationToken")); + if (ContinuationTokenValue.IsValid() && !ContinuationTokenValue->IsNull()) + { + FString TmpValue; + if (ContinuationTokenValue->TryGetString(TmpValue)) { ContinuationToken = TmpValue; } + } + + const TArray>&PlayerProfilesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PlayerProfiles")); + for (int32 Idx = 0; Idx < PlayerProfilesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PlayerProfilesArray[Idx]; + PlayerProfiles.Add(FPlayerProfile(CurrentItem->AsObject())); + } + + + const TSharedPtr ProfilesInSegmentValue = obj->TryGetField(TEXT("ProfilesInSegment")); + if (ProfilesInSegmentValue.IsValid() && !ProfilesInSegmentValue->IsNull()) + { + int32 TmpValue; + if (ProfilesInSegmentValue->TryGetNumber(TmpValue)) { ProfilesInSegment = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayersSegmentsRequest::~FGetPlayersSegmentsRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayersSegmentsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayersSegmentsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerStatisticDefinitionsRequest::~FGetPlayerStatisticDefinitionsRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayerStatisticDefinitionsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerStatisticDefinitionsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerStatisticDefinitionsResult::~FGetPlayerStatisticDefinitionsResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayerStatisticDefinitionsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Statistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statistics")); + for (const FPlayerStatisticDefinition& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerStatisticDefinitionsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FPlayerStatisticDefinition(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerStatisticVersionsRequest::~FGetPlayerStatisticVersionsRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayerStatisticVersionsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerStatisticVersionsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeStatisticVersionStatusEnumJSON(StatisticVersionStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case StatisticVersionStatusActive: writer->WriteValue(TEXT("Active")); break; + case StatisticVersionStatusSnapshotPending: writer->WriteValue(TEXT("SnapshotPending")); break; + case StatisticVersionStatusSnapshot: writer->WriteValue(TEXT("Snapshot")); break; + case StatisticVersionStatusArchivalPending: writer->WriteValue(TEXT("ArchivalPending")); break; + case StatisticVersionStatusArchived: writer->WriteValue(TEXT("Archived")); break; + } +} + +AdminModels::StatisticVersionStatus PlayFab::AdminModels::readStatisticVersionStatusFromValue(const TSharedPtr& value) +{ + return readStatisticVersionStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::StatisticVersionStatus PlayFab::AdminModels::readStatisticVersionStatusFromValue(const FString& value) +{ + static TMap _StatisticVersionStatusMap; + if (_StatisticVersionStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _StatisticVersionStatusMap.Add(TEXT("Active"), StatisticVersionStatusActive); + _StatisticVersionStatusMap.Add(TEXT("SnapshotPending"), StatisticVersionStatusSnapshotPending); + _StatisticVersionStatusMap.Add(TEXT("Snapshot"), StatisticVersionStatusSnapshot); + _StatisticVersionStatusMap.Add(TEXT("ArchivalPending"), StatisticVersionStatusArchivalPending); + _StatisticVersionStatusMap.Add(TEXT("Archived"), StatisticVersionStatusArchived); + + } + + if (!value.IsEmpty()) + { + auto output = _StatisticVersionStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return StatisticVersionStatusActive; // Basically critical fail +} + +PlayFab::AdminModels::FPlayerStatisticVersion::~FPlayerStatisticVersion() +{ + +} + +void PlayFab::AdminModels::FPlayerStatisticVersion::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ActivationTime")); writeDatetime(ActivationTime, writer); + + if (ArchiveDownloadUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ArchiveDownloadUrl")); writer->WriteValue(ArchiveDownloadUrl); } + + if (DeactivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("DeactivationTime")); writeDatetime(DeactivationTime, writer); } + + if (ScheduledActivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("ScheduledActivationTime")); writeDatetime(ScheduledActivationTime, writer); } + + if (ScheduledDeactivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("ScheduledDeactivationTime")); writeDatetime(ScheduledDeactivationTime, writer); } + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeStatisticVersionStatusEnumJSON(Status, writer); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerStatisticVersion::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActivationTimeValue = obj->TryGetField(TEXT("ActivationTime")); + if (ActivationTimeValue.IsValid()) + ActivationTime = readDatetime(ActivationTimeValue); + + + const TSharedPtr ArchiveDownloadUrlValue = obj->TryGetField(TEXT("ArchiveDownloadUrl")); + if (ArchiveDownloadUrlValue.IsValid() && !ArchiveDownloadUrlValue->IsNull()) + { + FString TmpValue; + if (ArchiveDownloadUrlValue->TryGetString(TmpValue)) { ArchiveDownloadUrl = TmpValue; } + } + + const TSharedPtr DeactivationTimeValue = obj->TryGetField(TEXT("DeactivationTime")); + if (DeactivationTimeValue.IsValid()) + DeactivationTime = readDatetime(DeactivationTimeValue); + + + const TSharedPtr ScheduledActivationTimeValue = obj->TryGetField(TEXT("ScheduledActivationTime")); + if (ScheduledActivationTimeValue.IsValid()) + ScheduledActivationTime = readDatetime(ScheduledActivationTimeValue); + + + const TSharedPtr ScheduledDeactivationTimeValue = obj->TryGetField(TEXT("ScheduledDeactivationTime")); + if (ScheduledDeactivationTimeValue.IsValid()) + ScheduledDeactivationTime = readDatetime(ScheduledDeactivationTimeValue); + + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + Status = readStatisticVersionStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerStatisticVersionsResult::~FGetPlayerStatisticVersionsResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayerStatisticVersionsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticVersions.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticVersions")); + for (const FPlayerStatisticVersion& item : StatisticVersions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerStatisticVersionsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&StatisticVersionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("StatisticVersions")); + for (int32 Idx = 0; Idx < StatisticVersionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticVersionsArray[Idx]; + StatisticVersions.Add(FPlayerStatisticVersion(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerTagsRequest::~FGetPlayerTagsRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayerTagsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Namespace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Namespace")); writer->WriteValue(Namespace); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerTagsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NamespaceValue = obj->TryGetField(TEXT("Namespace")); + if (NamespaceValue.IsValid() && !NamespaceValue->IsNull()) + { + FString TmpValue; + if (NamespaceValue->TryGetString(TmpValue)) { Namespace = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerTagsResult::~FGetPlayerTagsResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayerTagsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerTagsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPolicyRequest::~FGetPolicyRequest() +{ + +} + +void PlayFab::AdminModels::FGetPolicyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PolicyName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PolicyName")); writer->WriteValue(PolicyName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPolicyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PolicyNameValue = obj->TryGetField(TEXT("PolicyName")); + if (PolicyNameValue.IsValid() && !PolicyNameValue->IsNull()) + { + FString TmpValue; + if (PolicyNameValue->TryGetString(TmpValue)) { PolicyName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPermissionStatement::~FPermissionStatement() +{ + //if (ApiConditions != nullptr) delete ApiConditions; + +} + +void PlayFab::AdminModels::FPermissionStatement::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Action")); writer->WriteValue(Action); + + if (ApiConditions.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ApiConditions")); ApiConditions->writeJSON(writer); } + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + writer->WriteIdentifierPrefix(TEXT("Effect")); writeEffectTypeEnumJSON(Effect, writer); + + writer->WriteIdentifierPrefix(TEXT("Principal")); writer->WriteValue(Principal); + + writer->WriteIdentifierPrefix(TEXT("Resource")); writer->WriteValue(Resource); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPermissionStatement::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActionValue = obj->TryGetField(TEXT("Action")); + if (ActionValue.IsValid() && !ActionValue->IsNull()) + { + FString TmpValue; + if (ActionValue->TryGetString(TmpValue)) { Action = TmpValue; } + } + + const TSharedPtr ApiConditionsValue = obj->TryGetField(TEXT("ApiConditions")); + if (ApiConditionsValue.IsValid() && !ApiConditionsValue->IsNull()) + { + ApiConditions = MakeShareable(new FApiCondition(ApiConditionsValue->AsObject())); + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + Effect = readEffectTypeFromValue(obj->TryGetField(TEXT("Effect"))); + + const TSharedPtr PrincipalValue = obj->TryGetField(TEXT("Principal")); + if (PrincipalValue.IsValid() && !PrincipalValue->IsNull()) + { + FString TmpValue; + if (PrincipalValue->TryGetString(TmpValue)) { Principal = TmpValue; } + } + + const TSharedPtr ResourceValue = obj->TryGetField(TEXT("Resource")); + if (ResourceValue.IsValid() && !ResourceValue->IsNull()) + { + FString TmpValue; + if (ResourceValue->TryGetString(TmpValue)) { Resource = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPolicyResponse::~FGetPolicyResponse() +{ + +} + +void PlayFab::AdminModels::FGetPolicyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PolicyName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PolicyName")); writer->WriteValue(PolicyName); } + + if (Statements.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statements")); + for (const FPermissionStatement& item : Statements) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPolicyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PolicyNameValue = obj->TryGetField(TEXT("PolicyName")); + if (PolicyNameValue.IsValid() && !PolicyNameValue->IsNull()) + { + FString TmpValue; + if (PolicyNameValue->TryGetString(TmpValue)) { PolicyName = TmpValue; } + } + + const TArray>&StatementsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statements")); + for (int32 Idx = 0; Idx < StatementsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatementsArray[Idx]; + Statements.Add(FPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPublisherDataRequest::~FGetPublisherDataRequest() +{ + +} + +void PlayFab::AdminModels::FGetPublisherDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPublisherDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPublisherDataResult::~FGetPublisherDataResult() +{ + +} + +void PlayFab::AdminModels::FGetPublisherDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPublisherDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetRandomResultTablesRequest::~FGetRandomResultTablesRequest() +{ + +} + +void PlayFab::AdminModels::FGetRandomResultTablesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetRandomResultTablesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeResultTableNodeTypeEnumJSON(ResultTableNodeType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ResultTableNodeTypeItemId: writer->WriteValue(TEXT("ItemId")); break; + case ResultTableNodeTypeTableId: writer->WriteValue(TEXT("TableId")); break; + } +} + +AdminModels::ResultTableNodeType PlayFab::AdminModels::readResultTableNodeTypeFromValue(const TSharedPtr& value) +{ + return readResultTableNodeTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::ResultTableNodeType PlayFab::AdminModels::readResultTableNodeTypeFromValue(const FString& value) +{ + static TMap _ResultTableNodeTypeMap; + if (_ResultTableNodeTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ResultTableNodeTypeMap.Add(TEXT("ItemId"), ResultTableNodeTypeItemId); + _ResultTableNodeTypeMap.Add(TEXT("TableId"), ResultTableNodeTypeTableId); + + } + + if (!value.IsEmpty()) + { + auto output = _ResultTableNodeTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ResultTableNodeTypeItemId; // Basically critical fail +} + +PlayFab::AdminModels::FResultTableNode::~FResultTableNode() +{ + +} + +void PlayFab::AdminModels::FResultTableNode::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ResultItem")); writer->WriteValue(ResultItem); + + writer->WriteIdentifierPrefix(TEXT("ResultItemType")); writeResultTableNodeTypeEnumJSON(ResultItemType, writer); + + writer->WriteIdentifierPrefix(TEXT("Weight")); writer->WriteValue(Weight); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResultTableNode::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ResultItemValue = obj->TryGetField(TEXT("ResultItem")); + if (ResultItemValue.IsValid() && !ResultItemValue->IsNull()) + { + FString TmpValue; + if (ResultItemValue->TryGetString(TmpValue)) { ResultItem = TmpValue; } + } + + ResultItemType = readResultTableNodeTypeFromValue(obj->TryGetField(TEXT("ResultItemType"))); + + const TSharedPtr WeightValue = obj->TryGetField(TEXT("Weight")); + if (WeightValue.IsValid() && !WeightValue->IsNull()) + { + int32 TmpValue; + if (WeightValue->TryGetNumber(TmpValue)) { Weight = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRandomResultTableListing::~FRandomResultTableListing() +{ + +} + +void PlayFab::AdminModels::FRandomResultTableListing::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("Nodes")); + for (const FResultTableNode& item : Nodes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("TableId")); writer->WriteValue(TableId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRandomResultTableListing::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TArray>&NodesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Nodes")); + for (int32 Idx = 0; Idx < NodesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = NodesArray[Idx]; + Nodes.Add(FResultTableNode(CurrentItem->AsObject())); + } + + + const TSharedPtr TableIdValue = obj->TryGetField(TEXT("TableId")); + if (TableIdValue.IsValid() && !TableIdValue->IsNull()) + { + FString TmpValue; + if (TableIdValue->TryGetString(TmpValue)) { TableId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetRandomResultTablesResult::~FGetRandomResultTablesResult() +{ + +} + +void PlayFab::AdminModels::FGetRandomResultTablesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Tables.Num() != 0) + { + writer->WriteObjectStart(TEXT("Tables")); + for (TMap::TConstIterator It(Tables); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetRandomResultTablesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* TablesObject; + if (obj->TryGetObjectField(TEXT("Tables"), TablesObject)) + { + for (TMap>::TConstIterator It((*TablesObject)->Values); It; ++It) + { + Tables.Add(It.Key(), FRandomResultTableListing(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetServerBuildInfoRequest::~FGetServerBuildInfoRequest() +{ + +} + +void PlayFab::AdminModels::FGetServerBuildInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetServerBuildInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetServerBuildInfoResult::~FGetServerBuildInfoResult() +{ + +} + +void PlayFab::AdminModels::FGetServerBuildInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ActiveRegions.Num() != 0) + { + writer->WriteArrayStart(TEXT("ActiveRegions")); + for (const Region& item : ActiveRegions) + writeRegionEnumJSON(item, writer); + writer->WriteArrayEnd(); + } + + + if (BuildId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); } + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + if (ErrorMessage.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ErrorMessage")); writer->WriteValue(ErrorMessage); } + + writer->WriteIdentifierPrefix(TEXT("MaxGamesPerHost")); writer->WriteValue(MaxGamesPerHost); + + writer->WriteIdentifierPrefix(TEXT("MinFreeGameSlots")); writer->WriteValue(MinFreeGameSlots); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeGameBuildStatusEnumJSON(Status, writer); } + + writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetServerBuildInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ActiveRegionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ActiveRegions")); + for (int32 Idx = 0; Idx < ActiveRegionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ActiveRegionsArray[Idx]; + ActiveRegions.Add(readRegionFromValue(CurrentItem)); + } + + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ErrorMessageValue = obj->TryGetField(TEXT("ErrorMessage")); + if (ErrorMessageValue.IsValid() && !ErrorMessageValue->IsNull()) + { + FString TmpValue; + if (ErrorMessageValue->TryGetString(TmpValue)) { ErrorMessage = TmpValue; } + } + + const TSharedPtr MaxGamesPerHostValue = obj->TryGetField(TEXT("MaxGamesPerHost")); + if (MaxGamesPerHostValue.IsValid() && !MaxGamesPerHostValue->IsNull()) + { + int32 TmpValue; + if (MaxGamesPerHostValue->TryGetNumber(TmpValue)) { MaxGamesPerHost = TmpValue; } + } + + const TSharedPtr MinFreeGameSlotsValue = obj->TryGetField(TEXT("MinFreeGameSlots")); + if (MinFreeGameSlotsValue.IsValid() && !MinFreeGameSlotsValue->IsNull()) + { + int32 TmpValue; + if (MinFreeGameSlotsValue->TryGetNumber(TmpValue)) { MinFreeGameSlots = TmpValue; } + } + + Status = readGameBuildStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetServerBuildUploadURLRequest::~FGetServerBuildUploadURLRequest() +{ + +} + +void PlayFab::AdminModels::FGetServerBuildUploadURLRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetServerBuildUploadURLRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetServerBuildUploadURLResult::~FGetServerBuildUploadURLResult() +{ + +} + +void PlayFab::AdminModels::FGetServerBuildUploadURLResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (URL.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("URL")); writer->WriteValue(URL); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetServerBuildUploadURLResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr URLValue = obj->TryGetField(TEXT("URL")); + if (URLValue.IsValid() && !URLValue->IsNull()) + { + FString TmpValue; + if (URLValue->TryGetString(TmpValue)) { URL = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetStoreItemsRequest::~FGetStoreItemsRequest() +{ + +} + +void PlayFab::AdminModels::FGetStoreItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetStoreItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FStoreMarketingModel::~FStoreMarketingModel() +{ + +} + +void PlayFab::AdminModels::FStoreMarketingModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Metadata.notNull()) { writer->WriteIdentifierPrefix(TEXT("Metadata")); Metadata.writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FStoreMarketingModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr MetadataValue = obj->TryGetField(TEXT("Metadata")); + if (MetadataValue.IsValid() && !MetadataValue->IsNull()) + { + Metadata = FJsonKeeper(MetadataValue); + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeSourceTypeEnumJSON(SourceType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case SourceTypeAdmin: writer->WriteValue(TEXT("Admin")); break; + case SourceTypeBackEnd: writer->WriteValue(TEXT("BackEnd")); break; + case SourceTypeGameClient: writer->WriteValue(TEXT("GameClient")); break; + case SourceTypeGameServer: writer->WriteValue(TEXT("GameServer")); break; + case SourceTypePartner: writer->WriteValue(TEXT("Partner")); break; + case SourceTypeCustom: writer->WriteValue(TEXT("Custom")); break; + case SourceTypeAPI: writer->WriteValue(TEXT("API")); break; + } +} + +AdminModels::SourceType PlayFab::AdminModels::readSourceTypeFromValue(const TSharedPtr& value) +{ + return readSourceTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::SourceType PlayFab::AdminModels::readSourceTypeFromValue(const FString& value) +{ + static TMap _SourceTypeMap; + if (_SourceTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _SourceTypeMap.Add(TEXT("Admin"), SourceTypeAdmin); + _SourceTypeMap.Add(TEXT("BackEnd"), SourceTypeBackEnd); + _SourceTypeMap.Add(TEXT("GameClient"), SourceTypeGameClient); + _SourceTypeMap.Add(TEXT("GameServer"), SourceTypeGameServer); + _SourceTypeMap.Add(TEXT("Partner"), SourceTypePartner); + _SourceTypeMap.Add(TEXT("Custom"), SourceTypeCustom); + _SourceTypeMap.Add(TEXT("API"), SourceTypeAPI); + + } + + if (!value.IsEmpty()) + { + auto output = _SourceTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return SourceTypeAdmin; // Basically critical fail +} + +PlayFab::AdminModels::FStoreItem::~FStoreItem() +{ + +} + +void PlayFab::AdminModels::FStoreItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CustomData.notNull()) { writer->WriteIdentifierPrefix(TEXT("CustomData")); CustomData.writeJSON(writer); } + + if (DisplayPosition.notNull()) { writer->WriteIdentifierPrefix(TEXT("DisplayPosition")); writer->WriteValue(static_cast(DisplayPosition)); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (RealCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("RealCurrencyPrices")); + for (TMap::TConstIterator It(RealCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyPrices")); + for (TMap::TConstIterator It(VirtualCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FStoreItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomDataValue = obj->TryGetField(TEXT("CustomData")); + if (CustomDataValue.IsValid() && !CustomDataValue->IsNull()) + { + CustomData = FJsonKeeper(CustomDataValue); + } + + const TSharedPtr DisplayPositionValue = obj->TryGetField(TEXT("DisplayPosition")); + if (DisplayPositionValue.IsValid() && !DisplayPositionValue->IsNull()) + { + uint32 TmpValue; + if (DisplayPositionValue->TryGetNumber(TmpValue)) { DisplayPosition = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr* RealCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("RealCurrencyPrices"), RealCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*RealCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + RealCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyPrices"), VirtualCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetStoreItemsResult::~FGetStoreItemsResult() +{ + //if (MarketingData != nullptr) delete MarketingData; + +} + +void PlayFab::AdminModels::FGetStoreItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (MarketingData.IsValid()) { writer->WriteIdentifierPrefix(TEXT("MarketingData")); MarketingData->writeJSON(writer); } + + if (Source.notNull()) { writer->WriteIdentifierPrefix(TEXT("Source")); writeSourceTypeEnumJSON(Source, writer); } + + if (Store.Num() != 0) + { + writer->WriteArrayStart(TEXT("Store")); + for (const FStoreItem& item : Store) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (StoreId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetStoreItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr MarketingDataValue = obj->TryGetField(TEXT("MarketingData")); + if (MarketingDataValue.IsValid() && !MarketingDataValue->IsNull()) + { + MarketingData = MakeShareable(new FStoreMarketingModel(MarketingDataValue->AsObject())); + } + + Source = readSourceTypeFromValue(obj->TryGetField(TEXT("Source"))); + + const TArray>&StoreArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Store")); + for (int32 Idx = 0; Idx < StoreArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StoreArray[Idx]; + Store.Add(FStoreItem(CurrentItem->AsObject())); + } + + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTaskInstanceRequest::~FGetTaskInstanceRequest() +{ + +} + +void PlayFab::AdminModels::FGetTaskInstanceRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("TaskInstanceId")); writer->WriteValue(TaskInstanceId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTaskInstanceRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TaskInstanceIdValue = obj->TryGetField(TEXT("TaskInstanceId")); + if (TaskInstanceIdValue.IsValid() && !TaskInstanceIdValue->IsNull()) + { + FString TmpValue; + if (TaskInstanceIdValue->TryGetString(TmpValue)) { TaskInstanceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTaskInstancesRequest::~FGetTaskInstancesRequest() +{ + //if (TaskIdentifier != nullptr) delete TaskIdentifier; + +} + +void PlayFab::AdminModels::FGetTaskInstancesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StartedAtRangeFrom.notNull()) { writer->WriteIdentifierPrefix(TEXT("StartedAtRangeFrom")); writeDatetime(StartedAtRangeFrom, writer); } + + if (StartedAtRangeTo.notNull()) { writer->WriteIdentifierPrefix(TEXT("StartedAtRangeTo")); writeDatetime(StartedAtRangeTo, writer); } + + if (StatusFilter.notNull()) { writer->WriteIdentifierPrefix(TEXT("StatusFilter")); writeTaskInstanceStatusEnumJSON(StatusFilter, writer); } + + if (TaskIdentifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TaskIdentifier")); TaskIdentifier->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTaskInstancesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StartedAtRangeFromValue = obj->TryGetField(TEXT("StartedAtRangeFrom")); + if (StartedAtRangeFromValue.IsValid()) + StartedAtRangeFrom = readDatetime(StartedAtRangeFromValue); + + + const TSharedPtr StartedAtRangeToValue = obj->TryGetField(TEXT("StartedAtRangeTo")); + if (StartedAtRangeToValue.IsValid()) + StartedAtRangeTo = readDatetime(StartedAtRangeToValue); + + + StatusFilter = readTaskInstanceStatusFromValue(obj->TryGetField(TEXT("StatusFilter"))); + + const TSharedPtr TaskIdentifierValue = obj->TryGetField(TEXT("TaskIdentifier")); + if (TaskIdentifierValue.IsValid() && !TaskIdentifierValue->IsNull()) + { + TaskIdentifier = MakeShareable(new FNameIdentifier(TaskIdentifierValue->AsObject())); + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeScheduledTaskTypeEnumJSON(ScheduledTaskType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ScheduledTaskTypeCloudScript: writer->WriteValue(TEXT("CloudScript")); break; + case ScheduledTaskTypeActionsOnPlayerSegment: writer->WriteValue(TEXT("ActionsOnPlayerSegment")); break; + } +} + +AdminModels::ScheduledTaskType PlayFab::AdminModels::readScheduledTaskTypeFromValue(const TSharedPtr& value) +{ + return readScheduledTaskTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::ScheduledTaskType PlayFab::AdminModels::readScheduledTaskTypeFromValue(const FString& value) +{ + static TMap _ScheduledTaskTypeMap; + if (_ScheduledTaskTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ScheduledTaskTypeMap.Add(TEXT("CloudScript"), ScheduledTaskTypeCloudScript); + _ScheduledTaskTypeMap.Add(TEXT("ActionsOnPlayerSegment"), ScheduledTaskTypeActionsOnPlayerSegment); + + } + + if (!value.IsEmpty()) + { + auto output = _ScheduledTaskTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ScheduledTaskTypeCloudScript; // Basically critical fail +} + +PlayFab::AdminModels::FTaskInstanceBasicSummary::~FTaskInstanceBasicSummary() +{ + //if (TaskIdentifier != nullptr) delete TaskIdentifier; + +} + +void PlayFab::AdminModels::FTaskInstanceBasicSummary::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CompletedAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("CompletedAt")); writeDatetime(CompletedAt, writer); } + + if (EstimatedSecondsRemaining.notNull()) { writer->WriteIdentifierPrefix(TEXT("EstimatedSecondsRemaining")); writer->WriteValue(EstimatedSecondsRemaining); } + + if (PercentComplete.notNull()) { writer->WriteIdentifierPrefix(TEXT("PercentComplete")); writer->WriteValue(PercentComplete); } + + if (ScheduledByUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ScheduledByUserId")); writer->WriteValue(ScheduledByUserId); } + + writer->WriteIdentifierPrefix(TEXT("StartedAt")); writeDatetime(StartedAt, writer); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeTaskInstanceStatusEnumJSON(Status, writer); } + + if (TaskIdentifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TaskIdentifier")); TaskIdentifier->writeJSON(writer); } + + if (TaskInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TaskInstanceId")); writer->WriteValue(TaskInstanceId); } + + if (Type.notNull()) { writer->WriteIdentifierPrefix(TEXT("Type")); writeScheduledTaskTypeEnumJSON(Type, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FTaskInstanceBasicSummary::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CompletedAtValue = obj->TryGetField(TEXT("CompletedAt")); + if (CompletedAtValue.IsValid()) + CompletedAt = readDatetime(CompletedAtValue); + + + const TSharedPtr EstimatedSecondsRemainingValue = obj->TryGetField(TEXT("EstimatedSecondsRemaining")); + if (EstimatedSecondsRemainingValue.IsValid() && !EstimatedSecondsRemainingValue->IsNull()) + { + double TmpValue; + if (EstimatedSecondsRemainingValue->TryGetNumber(TmpValue)) { EstimatedSecondsRemaining = TmpValue; } + } + + const TSharedPtr PercentCompleteValue = obj->TryGetField(TEXT("PercentComplete")); + if (PercentCompleteValue.IsValid() && !PercentCompleteValue->IsNull()) + { + double TmpValue; + if (PercentCompleteValue->TryGetNumber(TmpValue)) { PercentComplete = TmpValue; } + } + + const TSharedPtr ScheduledByUserIdValue = obj->TryGetField(TEXT("ScheduledByUserId")); + if (ScheduledByUserIdValue.IsValid() && !ScheduledByUserIdValue->IsNull()) + { + FString TmpValue; + if (ScheduledByUserIdValue->TryGetString(TmpValue)) { ScheduledByUserId = TmpValue; } + } + + const TSharedPtr StartedAtValue = obj->TryGetField(TEXT("StartedAt")); + if (StartedAtValue.IsValid()) + StartedAt = readDatetime(StartedAtValue); + + + Status = readTaskInstanceStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TaskIdentifierValue = obj->TryGetField(TEXT("TaskIdentifier")); + if (TaskIdentifierValue.IsValid() && !TaskIdentifierValue->IsNull()) + { + TaskIdentifier = MakeShareable(new FNameIdentifier(TaskIdentifierValue->AsObject())); + } + + const TSharedPtr TaskInstanceIdValue = obj->TryGetField(TEXT("TaskInstanceId")); + if (TaskInstanceIdValue.IsValid() && !TaskInstanceIdValue->IsNull()) + { + FString TmpValue; + if (TaskInstanceIdValue->TryGetString(TmpValue)) { TaskInstanceId = TmpValue; } + } + + Type = readScheduledTaskTypeFromValue(obj->TryGetField(TEXT("Type"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTaskInstancesResult::~FGetTaskInstancesResult() +{ + +} + +void PlayFab::AdminModels::FGetTaskInstancesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Summaries.Num() != 0) + { + writer->WriteArrayStart(TEXT("Summaries")); + for (const FTaskInstanceBasicSummary& item : Summaries) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTaskInstancesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SummariesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Summaries")); + for (int32 Idx = 0; Idx < SummariesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SummariesArray[Idx]; + Summaries.Add(FTaskInstanceBasicSummary(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTasksRequest::~FGetTasksRequest() +{ + //if (Identifier != nullptr) delete Identifier; + +} + +void PlayFab::AdminModels::FGetTasksRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Identifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Identifier")); Identifier->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTasksRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdentifierValue = obj->TryGetField(TEXT("Identifier")); + if (IdentifierValue.IsValid() && !IdentifierValue->IsNull()) + { + Identifier = MakeShareable(new FNameIdentifier(IdentifierValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FScheduledTask::~FScheduledTask() +{ + +} + +void PlayFab::AdminModels::FScheduledTask::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + if (LastRunTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastRunTime")); writeDatetime(LastRunTime, writer); } + + writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); + + if (NextRunTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("NextRunTime")); writeDatetime(NextRunTime, writer); } + + if (Parameter.notNull()) { writer->WriteIdentifierPrefix(TEXT("Parameter")); Parameter.writeJSON(writer); } + + if (Schedule.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Schedule")); writer->WriteValue(Schedule); } + + if (TaskId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TaskId")); writer->WriteValue(TaskId); } + + if (Type.notNull()) { writer->WriteIdentifierPrefix(TEXT("Type")); writeScheduledTaskTypeEnumJSON(Type, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FScheduledTask::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr LastRunTimeValue = obj->TryGetField(TEXT("LastRunTime")); + if (LastRunTimeValue.IsValid()) + LastRunTime = readDatetime(LastRunTimeValue); + + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr NextRunTimeValue = obj->TryGetField(TEXT("NextRunTime")); + if (NextRunTimeValue.IsValid()) + NextRunTime = readDatetime(NextRunTimeValue); + + + const TSharedPtr ParameterValue = obj->TryGetField(TEXT("Parameter")); + if (ParameterValue.IsValid() && !ParameterValue->IsNull()) + { + Parameter = FJsonKeeper(ParameterValue); + } + + const TSharedPtr ScheduleValue = obj->TryGetField(TEXT("Schedule")); + if (ScheduleValue.IsValid() && !ScheduleValue->IsNull()) + { + FString TmpValue; + if (ScheduleValue->TryGetString(TmpValue)) { Schedule = TmpValue; } + } + + const TSharedPtr TaskIdValue = obj->TryGetField(TEXT("TaskId")); + if (TaskIdValue.IsValid() && !TaskIdValue->IsNull()) + { + FString TmpValue; + if (TaskIdValue->TryGetString(TmpValue)) { TaskId = TmpValue; } + } + + Type = readScheduledTaskTypeFromValue(obj->TryGetField(TEXT("Type"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTasksResult::~FGetTasksResult() +{ + +} + +void PlayFab::AdminModels::FGetTasksResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Tasks.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tasks")); + for (const FScheduledTask& item : Tasks) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTasksResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&TasksArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Tasks")); + for (int32 Idx = 0; Idx < TasksArray.Num(); Idx++) + { + TSharedPtr CurrentItem = TasksArray[Idx]; + Tasks.Add(FScheduledTask(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTitleDataRequest::~FGetTitleDataRequest() +{ + +} + +void PlayFab::AdminModels::FGetTitleDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTitleDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTitleDataResult::~FGetTitleDataResult() +{ + +} + +void PlayFab::AdminModels::FGetTitleDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTitleDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetUserBansRequest::~FGetUserBansRequest() +{ + +} + +void PlayFab::AdminModels::FGetUserBansRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetUserBansRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetUserBansResult::~FGetUserBansResult() +{ + +} + +void PlayFab::AdminModels::FGetUserBansResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetUserBansResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetUserDataRequest::~FGetUserDataRequest() +{ + +} + +void PlayFab::AdminModels::FGetUserDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IfChangedFromDataVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("IfChangedFromDataVersion")); writer->WriteValue(static_cast(IfChangedFromDataVersion)); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetUserDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IfChangedFromDataVersionValue = obj->TryGetField(TEXT("IfChangedFromDataVersion")); + if (IfChangedFromDataVersionValue.IsValid() && !IfChangedFromDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (IfChangedFromDataVersionValue->TryGetNumber(TmpValue)) { IfChangedFromDataVersion = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeUserDataPermissionEnumJSON(UserDataPermission enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case UserDataPermissionPrivate: writer->WriteValue(TEXT("Private")); break; + case UserDataPermissionPublic: writer->WriteValue(TEXT("Public")); break; + } +} + +AdminModels::UserDataPermission PlayFab::AdminModels::readUserDataPermissionFromValue(const TSharedPtr& value) +{ + return readUserDataPermissionFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::UserDataPermission PlayFab::AdminModels::readUserDataPermissionFromValue(const FString& value) +{ + static TMap _UserDataPermissionMap; + if (_UserDataPermissionMap.Num() == 0) + { + // Auto-generate the map on the first use + _UserDataPermissionMap.Add(TEXT("Private"), UserDataPermissionPrivate); + _UserDataPermissionMap.Add(TEXT("Public"), UserDataPermissionPublic); + + } + + if (!value.IsEmpty()) + { + auto output = _UserDataPermissionMap.Find(value); + if (output != nullptr) + return *output; + } + + return UserDataPermissionPrivate; // Basically critical fail +} + +PlayFab::AdminModels::FUserDataRecord::~FUserDataRecord() +{ + +} + +void PlayFab::AdminModels::FUserDataRecord::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LastUpdated")); writeDatetime(LastUpdated, writer); + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserDataRecord::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LastUpdatedValue = obj->TryGetField(TEXT("LastUpdated")); + if (LastUpdatedValue.IsValid()) + LastUpdated = readDatetime(LastUpdatedValue); + + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetUserDataResult::~FGetUserDataResult() +{ + +} + +void PlayFab::AdminModels::FGetUserDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetUserDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetUserInventoryRequest::~FGetUserInventoryRequest() +{ + +} + +void PlayFab::AdminModels::FGetUserInventoryRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetUserInventoryRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FItemInstance::~FItemInstance() +{ + +} + +void PlayFab::AdminModels::FItemInstance::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (BundleContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundleContents")); + for (const FString& item : BundleContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundleParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BundleParent")); writer->WriteValue(BundleParent); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CustomData.Num() != 0) + { + writer->WriteObjectStart(TEXT("CustomData")); + for (TMap::TConstIterator It(CustomData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Expiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (PurchaseDate.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); } + + if (RemainingUses.notNull()) { writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); } + + if (UnitCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnitCurrency")); writer->WriteValue(UnitCurrency); } + + writer->WriteIdentifierPrefix(TEXT("UnitPrice")); writer->WriteValue(static_cast(UnitPrice)); + + if (UsesIncrementedBy.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsesIncrementedBy")); writer->WriteValue(UsesIncrementedBy); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FItemInstance::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("BundleContents"), BundleContents); + + const TSharedPtr BundleParentValue = obj->TryGetField(TEXT("BundleParent")); + if (BundleParentValue.IsValid() && !BundleParentValue->IsNull()) + { + FString TmpValue; + if (BundleParentValue->TryGetString(TmpValue)) { BundleParent = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr* CustomDataObject; + if (obj->TryGetObjectField(TEXT("CustomData"), CustomDataObject)) + { + for (TMap>::TConstIterator It((*CustomDataObject)->Values); It; ++It) + { + CustomData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + const TSharedPtr UnitCurrencyValue = obj->TryGetField(TEXT("UnitCurrency")); + if (UnitCurrencyValue.IsValid() && !UnitCurrencyValue->IsNull()) + { + FString TmpValue; + if (UnitCurrencyValue->TryGetString(TmpValue)) { UnitCurrency = TmpValue; } + } + + const TSharedPtr UnitPriceValue = obj->TryGetField(TEXT("UnitPrice")); + if (UnitPriceValue.IsValid() && !UnitPriceValue->IsNull()) + { + uint32 TmpValue; + if (UnitPriceValue->TryGetNumber(TmpValue)) { UnitPrice = TmpValue; } + } + + const TSharedPtr UsesIncrementedByValue = obj->TryGetField(TEXT("UsesIncrementedBy")); + if (UsesIncrementedByValue.IsValid() && !UsesIncrementedByValue->IsNull()) + { + int32 TmpValue; + if (UsesIncrementedByValue->TryGetNumber(TmpValue)) { UsesIncrementedBy = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FVirtualCurrencyRechargeTime::~FVirtualCurrencyRechargeTime() +{ + +} + +void PlayFab::AdminModels::FVirtualCurrencyRechargeTime::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("RechargeMax")); writer->WriteValue(RechargeMax); + + writer->WriteIdentifierPrefix(TEXT("RechargeTime")); writeDatetime(RechargeTime, writer); + + writer->WriteIdentifierPrefix(TEXT("SecondsToRecharge")); writer->WriteValue(SecondsToRecharge); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FVirtualCurrencyRechargeTime::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RechargeMaxValue = obj->TryGetField(TEXT("RechargeMax")); + if (RechargeMaxValue.IsValid() && !RechargeMaxValue->IsNull()) + { + int32 TmpValue; + if (RechargeMaxValue->TryGetNumber(TmpValue)) { RechargeMax = TmpValue; } + } + + const TSharedPtr RechargeTimeValue = obj->TryGetField(TEXT("RechargeTime")); + if (RechargeTimeValue.IsValid()) + RechargeTime = readDatetime(RechargeTimeValue); + + + const TSharedPtr SecondsToRechargeValue = obj->TryGetField(TEXT("SecondsToRecharge")); + if (SecondsToRechargeValue.IsValid() && !SecondsToRechargeValue->IsNull()) + { + int32 TmpValue; + if (SecondsToRechargeValue->TryGetNumber(TmpValue)) { SecondsToRecharge = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetUserInventoryResult::~FGetUserInventoryResult() +{ + +} + +void PlayFab::AdminModels::FGetUserInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(VirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetUserInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyRechargeTimes"), VirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + VirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGrantedItemInstance::~FGrantedItemInstance() +{ + +} + +void PlayFab::AdminModels::FGrantedItemInstance::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (BundleContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundleContents")); + for (const FString& item : BundleContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundleParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BundleParent")); writer->WriteValue(BundleParent); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CustomData.Num() != 0) + { + writer->WriteObjectStart(TEXT("CustomData")); + for (TMap::TConstIterator It(CustomData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Expiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (PurchaseDate.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); } + + if (RemainingUses.notNull()) { writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); } + + writer->WriteIdentifierPrefix(TEXT("Result")); writer->WriteValue(Result); + + if (UnitCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnitCurrency")); writer->WriteValue(UnitCurrency); } + + writer->WriteIdentifierPrefix(TEXT("UnitPrice")); writer->WriteValue(static_cast(UnitPrice)); + + if (UsesIncrementedBy.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsesIncrementedBy")); writer->WriteValue(UsesIncrementedBy); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGrantedItemInstance::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("BundleContents"), BundleContents); + + const TSharedPtr BundleParentValue = obj->TryGetField(TEXT("BundleParent")); + if (BundleParentValue.IsValid() && !BundleParentValue->IsNull()) + { + FString TmpValue; + if (BundleParentValue->TryGetString(TmpValue)) { BundleParent = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* CustomDataObject; + if (obj->TryGetObjectField(TEXT("CustomData"), CustomDataObject)) + { + for (TMap>::TConstIterator It((*CustomDataObject)->Values); It; ++It) + { + CustomData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + const TSharedPtr ResultValue = obj->TryGetField(TEXT("Result")); + if (ResultValue.IsValid() && !ResultValue->IsNull()) + { + bool TmpValue; + if (ResultValue->TryGetBool(TmpValue)) { Result = TmpValue; } + } + + const TSharedPtr UnitCurrencyValue = obj->TryGetField(TEXT("UnitCurrency")); + if (UnitCurrencyValue.IsValid() && !UnitCurrencyValue->IsNull()) + { + FString TmpValue; + if (UnitCurrencyValue->TryGetString(TmpValue)) { UnitCurrency = TmpValue; } + } + + const TSharedPtr UnitPriceValue = obj->TryGetField(TEXT("UnitPrice")); + if (UnitPriceValue.IsValid() && !UnitPriceValue->IsNull()) + { + uint32 TmpValue; + if (UnitPriceValue->TryGetNumber(TmpValue)) { UnitPrice = TmpValue; } + } + + const TSharedPtr UsesIncrementedByValue = obj->TryGetField(TEXT("UsesIncrementedBy")); + if (UsesIncrementedByValue.IsValid() && !UsesIncrementedByValue->IsNull()) + { + int32 TmpValue; + if (UsesIncrementedByValue->TryGetNumber(TmpValue)) { UsesIncrementedBy = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FItemGrant::~FItemGrant() +{ + +} + +void PlayFab::AdminModels::FItemGrant::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FItemGrant::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGrantItemsToUsersRequest::~FGrantItemsToUsersRequest() +{ + +} + +void PlayFab::AdminModels::FGrantItemsToUsersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("ItemGrants")); + for (const FItemGrant& item : ItemGrants) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGrantItemsToUsersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TArray>&ItemGrantsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ItemGrants")); + for (int32 Idx = 0; Idx < ItemGrantsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemGrantsArray[Idx]; + ItemGrants.Add(FItemGrant(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGrantItemsToUsersResult::~FGrantItemsToUsersResult() +{ + +} + +void PlayFab::AdminModels::FGrantItemsToUsersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemGrantResults.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemGrantResults")); + for (const FGrantedItemInstance& item : ItemGrantResults) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGrantItemsToUsersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemGrantResultsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ItemGrantResults")); + for (int32 Idx = 0; Idx < ItemGrantResultsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemGrantResultsArray[Idx]; + ItemGrantResults.Add(FGrantedItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FIncrementLimitedEditionItemAvailabilityRequest::~FIncrementLimitedEditionItemAvailabilityRequest() +{ + +} + +void PlayFab::AdminModels::FIncrementLimitedEditionItemAvailabilityRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FIncrementLimitedEditionItemAvailabilityRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FIncrementLimitedEditionItemAvailabilityResult::~FIncrementLimitedEditionItemAvailabilityResult() +{ + +} + +void PlayFab::AdminModels::FIncrementLimitedEditionItemAvailabilityResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FIncrementLimitedEditionItemAvailabilityResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FIncrementPlayerStatisticVersionRequest::~FIncrementPlayerStatisticVersionRequest() +{ + +} + +void PlayFab::AdminModels::FIncrementPlayerStatisticVersionRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FIncrementPlayerStatisticVersionRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FIncrementPlayerStatisticVersionResult::~FIncrementPlayerStatisticVersionResult() +{ + //if (StatisticVersion != nullptr) delete StatisticVersion; + +} + +void PlayFab::AdminModels::FIncrementPlayerStatisticVersionResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticVersion.IsValid()) { writer->WriteIdentifierPrefix(TEXT("StatisticVersion")); StatisticVersion->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FIncrementPlayerStatisticVersionResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticVersionValue = obj->TryGetField(TEXT("StatisticVersion")); + if (StatisticVersionValue.IsValid() && !StatisticVersionValue->IsNull()) + { + StatisticVersion = MakeShareable(new FPlayerStatisticVersion(StatisticVersionValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FListBuildsRequest::~FListBuildsRequest() +{ + +} + +void PlayFab::AdminModels::FListBuildsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FListBuildsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FListBuildsResult::~FListBuildsResult() +{ + +} + +void PlayFab::AdminModels::FListBuildsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Builds.Num() != 0) + { + writer->WriteArrayStart(TEXT("Builds")); + for (const FGetServerBuildInfoResult& item : Builds) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FListBuildsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BuildsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Builds")); + for (int32 Idx = 0; Idx < BuildsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BuildsArray[Idx]; + Builds.Add(FGetServerBuildInfoResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FListVirtualCurrencyTypesRequest::~FListVirtualCurrencyTypesRequest() +{ + +} + +void PlayFab::AdminModels::FListVirtualCurrencyTypesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FListVirtualCurrencyTypesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FListVirtualCurrencyTypesResult::~FListVirtualCurrencyTypesResult() +{ + +} + +void PlayFab::AdminModels::FListVirtualCurrencyTypesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (VirtualCurrencies.Num() != 0) + { + writer->WriteArrayStart(TEXT("VirtualCurrencies")); + for (const FVirtualCurrencyData& item : VirtualCurrencies) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FListVirtualCurrencyTypesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&VirtualCurrenciesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("VirtualCurrencies")); + for (int32 Idx = 0; Idx < VirtualCurrenciesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = VirtualCurrenciesArray[Idx]; + VirtualCurrencies.Add(FVirtualCurrencyData(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FLookupUserAccountInfoRequest::~FLookupUserAccountInfoRequest() +{ + +} + +void PlayFab::AdminModels::FLookupUserAccountInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (TitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleDisplayName")); writer->WriteValue(TitleDisplayName); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FLookupUserAccountInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TitleDisplayNameValue = obj->TryGetField(TEXT("TitleDisplayName")); + if (TitleDisplayNameValue.IsValid() && !TitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (TitleDisplayNameValue->TryGetString(TmpValue)) { TitleDisplayName = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserAndroidDeviceInfo::~FUserAndroidDeviceInfo() +{ + +} + +void PlayFab::AdminModels::FUserAndroidDeviceInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceId")); writer->WriteValue(AndroidDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserAndroidDeviceInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceIdValue = obj->TryGetField(TEXT("AndroidDeviceId")); + if (AndroidDeviceIdValue.IsValid() && !AndroidDeviceIdValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceIdValue->TryGetString(TmpValue)) { AndroidDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserCustomIdInfo::~FUserCustomIdInfo() +{ + +} + +void PlayFab::AdminModels::FUserCustomIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CustomId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomId")); writer->WriteValue(CustomId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserCustomIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomIdValue = obj->TryGetField(TEXT("CustomId")); + if (CustomIdValue.IsValid() && !CustomIdValue->IsNull()) + { + FString TmpValue; + if (CustomIdValue->TryGetString(TmpValue)) { CustomId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserFacebookInfo::~FUserFacebookInfo() +{ + +} + +void PlayFab::AdminModels::FUserFacebookInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookId")); writer->WriteValue(FacebookId); } + + if (FullName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FullName")); writer->WriteValue(FullName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserFacebookInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookIdValue = obj->TryGetField(TEXT("FacebookId")); + if (FacebookIdValue.IsValid() && !FacebookIdValue->IsNull()) + { + FString TmpValue; + if (FacebookIdValue->TryGetString(TmpValue)) { FacebookId = TmpValue; } + } + + const TSharedPtr FullNameValue = obj->TryGetField(TEXT("FullName")); + if (FullNameValue.IsValid() && !FullNameValue->IsNull()) + { + FString TmpValue; + if (FullNameValue->TryGetString(TmpValue)) { FullName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserFacebookInstantGamesIdInfo::~FUserFacebookInstantGamesIdInfo() +{ + +} + +void PlayFab::AdminModels::FUserFacebookInstantGamesIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookInstantGamesId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesId")); writer->WriteValue(FacebookInstantGamesId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserFacebookInstantGamesIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesIdValue = obj->TryGetField(TEXT("FacebookInstantGamesId")); + if (FacebookInstantGamesIdValue.IsValid() && !FacebookInstantGamesIdValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesIdValue->TryGetString(TmpValue)) { FacebookInstantGamesId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserGameCenterInfo::~FUserGameCenterInfo() +{ + +} + +void PlayFab::AdminModels::FUserGameCenterInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GameCenterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameCenterId")); writer->WriteValue(GameCenterId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserGameCenterInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameCenterIdValue = obj->TryGetField(TEXT("GameCenterId")); + if (GameCenterIdValue.IsValid() && !GameCenterIdValue->IsNull()) + { + FString TmpValue; + if (GameCenterIdValue->TryGetString(TmpValue)) { GameCenterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserGoogleInfo::~FUserGoogleInfo() +{ + +} + +void PlayFab::AdminModels::FUserGoogleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GoogleEmail.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleEmail")); writer->WriteValue(GoogleEmail); } + + if (GoogleGender.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleGender")); writer->WriteValue(GoogleGender); } + + if (GoogleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleId")); writer->WriteValue(GoogleId); } + + if (GoogleLocale.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleLocale")); writer->WriteValue(GoogleLocale); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserGoogleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GoogleEmailValue = obj->TryGetField(TEXT("GoogleEmail")); + if (GoogleEmailValue.IsValid() && !GoogleEmailValue->IsNull()) + { + FString TmpValue; + if (GoogleEmailValue->TryGetString(TmpValue)) { GoogleEmail = TmpValue; } + } + + const TSharedPtr GoogleGenderValue = obj->TryGetField(TEXT("GoogleGender")); + if (GoogleGenderValue.IsValid() && !GoogleGenderValue->IsNull()) + { + FString TmpValue; + if (GoogleGenderValue->TryGetString(TmpValue)) { GoogleGender = TmpValue; } + } + + const TSharedPtr GoogleIdValue = obj->TryGetField(TEXT("GoogleId")); + if (GoogleIdValue.IsValid() && !GoogleIdValue->IsNull()) + { + FString TmpValue; + if (GoogleIdValue->TryGetString(TmpValue)) { GoogleId = TmpValue; } + } + + const TSharedPtr GoogleLocaleValue = obj->TryGetField(TEXT("GoogleLocale")); + if (GoogleLocaleValue.IsValid() && !GoogleLocaleValue->IsNull()) + { + FString TmpValue; + if (GoogleLocaleValue->TryGetString(TmpValue)) { GoogleLocale = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserIosDeviceInfo::~FUserIosDeviceInfo() +{ + +} + +void PlayFab::AdminModels::FUserIosDeviceInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IosDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IosDeviceId")); writer->WriteValue(IosDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserIosDeviceInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IosDeviceIdValue = obj->TryGetField(TEXT("IosDeviceId")); + if (IosDeviceIdValue.IsValid() && !IosDeviceIdValue->IsNull()) + { + FString TmpValue; + if (IosDeviceIdValue->TryGetString(TmpValue)) { IosDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserKongregateInfo::~FUserKongregateInfo() +{ + +} + +void PlayFab::AdminModels::FUserKongregateInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (KongregateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateId")); writer->WriteValue(KongregateId); } + + if (KongregateName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateName")); writer->WriteValue(KongregateName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserKongregateInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KongregateIdValue = obj->TryGetField(TEXT("KongregateId")); + if (KongregateIdValue.IsValid() && !KongregateIdValue->IsNull()) + { + FString TmpValue; + if (KongregateIdValue->TryGetString(TmpValue)) { KongregateId = TmpValue; } + } + + const TSharedPtr KongregateNameValue = obj->TryGetField(TEXT("KongregateName")); + if (KongregateNameValue.IsValid() && !KongregateNameValue->IsNull()) + { + FString TmpValue; + if (KongregateNameValue->TryGetString(TmpValue)) { KongregateName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserNintendoSwitchDeviceIdInfo::~FUserNintendoSwitchDeviceIdInfo() +{ + +} + +void PlayFab::AdminModels::FUserNintendoSwitchDeviceIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserNintendoSwitchDeviceIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserOpenIdInfo::~FUserOpenIdInfo() +{ + +} + +void PlayFab::AdminModels::FUserOpenIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ConnectionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ConnectionId")); writer->WriteValue(ConnectionId); } + + if (Issuer.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Issuer")); writer->WriteValue(Issuer); } + + if (Subject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Subject")); writer->WriteValue(Subject); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserOpenIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ConnectionIdValue = obj->TryGetField(TEXT("ConnectionId")); + if (ConnectionIdValue.IsValid() && !ConnectionIdValue->IsNull()) + { + FString TmpValue; + if (ConnectionIdValue->TryGetString(TmpValue)) { ConnectionId = TmpValue; } + } + + const TSharedPtr IssuerValue = obj->TryGetField(TEXT("Issuer")); + if (IssuerValue.IsValid() && !IssuerValue->IsNull()) + { + FString TmpValue; + if (IssuerValue->TryGetString(TmpValue)) { Issuer = TmpValue; } + } + + const TSharedPtr SubjectValue = obj->TryGetField(TEXT("Subject")); + if (SubjectValue.IsValid() && !SubjectValue->IsNull()) + { + FString TmpValue; + if (SubjectValue->TryGetString(TmpValue)) { Subject = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserPrivateAccountInfo::~FUserPrivateAccountInfo() +{ + +} + +void PlayFab::AdminModels::FUserPrivateAccountInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserPrivateAccountInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserPsnInfo::~FUserPsnInfo() +{ + +} + +void PlayFab::AdminModels::FUserPsnInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PsnAccountId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PsnAccountId")); writer->WriteValue(PsnAccountId); } + + if (PsnOnlineId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PsnOnlineId")); writer->WriteValue(PsnOnlineId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserPsnInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PsnAccountIdValue = obj->TryGetField(TEXT("PsnAccountId")); + if (PsnAccountIdValue.IsValid() && !PsnAccountIdValue->IsNull()) + { + FString TmpValue; + if (PsnAccountIdValue->TryGetString(TmpValue)) { PsnAccountId = TmpValue; } + } + + const TSharedPtr PsnOnlineIdValue = obj->TryGetField(TEXT("PsnOnlineId")); + if (PsnOnlineIdValue.IsValid() && !PsnOnlineIdValue->IsNull()) + { + FString TmpValue; + if (PsnOnlineIdValue->TryGetString(TmpValue)) { PsnOnlineId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeTitleActivationStatusEnumJSON(TitleActivationStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case TitleActivationStatusNone: writer->WriteValue(TEXT("None")); break; + case TitleActivationStatusActivatedTitleKey: writer->WriteValue(TEXT("ActivatedTitleKey")); break; + case TitleActivationStatusPendingSteam: writer->WriteValue(TEXT("PendingSteam")); break; + case TitleActivationStatusActivatedSteam: writer->WriteValue(TEXT("ActivatedSteam")); break; + case TitleActivationStatusRevokedSteam: writer->WriteValue(TEXT("RevokedSteam")); break; + } +} + +AdminModels::TitleActivationStatus PlayFab::AdminModels::readTitleActivationStatusFromValue(const TSharedPtr& value) +{ + return readTitleActivationStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::TitleActivationStatus PlayFab::AdminModels::readTitleActivationStatusFromValue(const FString& value) +{ + static TMap _TitleActivationStatusMap; + if (_TitleActivationStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _TitleActivationStatusMap.Add(TEXT("None"), TitleActivationStatusNone); + _TitleActivationStatusMap.Add(TEXT("ActivatedTitleKey"), TitleActivationStatusActivatedTitleKey); + _TitleActivationStatusMap.Add(TEXT("PendingSteam"), TitleActivationStatusPendingSteam); + _TitleActivationStatusMap.Add(TEXT("ActivatedSteam"), TitleActivationStatusActivatedSteam); + _TitleActivationStatusMap.Add(TEXT("RevokedSteam"), TitleActivationStatusRevokedSteam); + + } + + if (!value.IsEmpty()) + { + auto output = _TitleActivationStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return TitleActivationStatusNone; // Basically critical fail +} + +PlayFab::AdminModels::FUserSteamInfo::~FUserSteamInfo() +{ + +} + +void PlayFab::AdminModels::FUserSteamInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SteamActivationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("SteamActivationStatus")); writeTitleActivationStatusEnumJSON(SteamActivationStatus, writer); } + + if (SteamCountry.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamCountry")); writer->WriteValue(SteamCountry); } + + if (SteamCurrency.notNull()) { writer->WriteIdentifierPrefix(TEXT("SteamCurrency")); writeCurrencyEnumJSON(SteamCurrency, writer); } + + if (SteamId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamId")); writer->WriteValue(SteamId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserSteamInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + SteamActivationStatus = readTitleActivationStatusFromValue(obj->TryGetField(TEXT("SteamActivationStatus"))); + + const TSharedPtr SteamCountryValue = obj->TryGetField(TEXT("SteamCountry")); + if (SteamCountryValue.IsValid() && !SteamCountryValue->IsNull()) + { + FString TmpValue; + if (SteamCountryValue->TryGetString(TmpValue)) { SteamCountry = TmpValue; } + } + + SteamCurrency = readCurrencyFromValue(obj->TryGetField(TEXT("SteamCurrency"))); + + const TSharedPtr SteamIdValue = obj->TryGetField(TEXT("SteamId")); + if (SteamIdValue.IsValid() && !SteamIdValue->IsNull()) + { + FString TmpValue; + if (SteamIdValue->TryGetString(TmpValue)) { SteamId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeUserOriginationEnumJSON(UserOrigination enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case UserOriginationOrganic: writer->WriteValue(TEXT("Organic")); break; + case UserOriginationSteam: writer->WriteValue(TEXT("Steam")); break; + case UserOriginationGoogle: writer->WriteValue(TEXT("Google")); break; + case UserOriginationAmazon: writer->WriteValue(TEXT("Amazon")); break; + case UserOriginationFacebook: writer->WriteValue(TEXT("Facebook")); break; + case UserOriginationKongregate: writer->WriteValue(TEXT("Kongregate")); break; + case UserOriginationGamersFirst: writer->WriteValue(TEXT("GamersFirst")); break; + case UserOriginationUnknown: writer->WriteValue(TEXT("Unknown")); break; + case UserOriginationIOS: writer->WriteValue(TEXT("IOS")); break; + case UserOriginationLoadTest: writer->WriteValue(TEXT("LoadTest")); break; + case UserOriginationAndroid: writer->WriteValue(TEXT("Android")); break; + case UserOriginationPSN: writer->WriteValue(TEXT("PSN")); break; + case UserOriginationGameCenter: writer->WriteValue(TEXT("GameCenter")); break; + case UserOriginationCustomId: writer->WriteValue(TEXT("CustomId")); break; + case UserOriginationXboxLive: writer->WriteValue(TEXT("XboxLive")); break; + case UserOriginationParse: writer->WriteValue(TEXT("Parse")); break; + case UserOriginationTwitch: writer->WriteValue(TEXT("Twitch")); break; + case UserOriginationWindowsHello: writer->WriteValue(TEXT("WindowsHello")); break; + case UserOriginationServerCustomId: writer->WriteValue(TEXT("ServerCustomId")); break; + case UserOriginationNintendoSwitchDeviceId: writer->WriteValue(TEXT("NintendoSwitchDeviceId")); break; + case UserOriginationFacebookInstantGamesId: writer->WriteValue(TEXT("FacebookInstantGamesId")); break; + case UserOriginationOpenIdConnect: writer->WriteValue(TEXT("OpenIdConnect")); break; + } +} + +AdminModels::UserOrigination PlayFab::AdminModels::readUserOriginationFromValue(const TSharedPtr& value) +{ + return readUserOriginationFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::UserOrigination PlayFab::AdminModels::readUserOriginationFromValue(const FString& value) +{ + static TMap _UserOriginationMap; + if (_UserOriginationMap.Num() == 0) + { + // Auto-generate the map on the first use + _UserOriginationMap.Add(TEXT("Organic"), UserOriginationOrganic); + _UserOriginationMap.Add(TEXT("Steam"), UserOriginationSteam); + _UserOriginationMap.Add(TEXT("Google"), UserOriginationGoogle); + _UserOriginationMap.Add(TEXT("Amazon"), UserOriginationAmazon); + _UserOriginationMap.Add(TEXT("Facebook"), UserOriginationFacebook); + _UserOriginationMap.Add(TEXT("Kongregate"), UserOriginationKongregate); + _UserOriginationMap.Add(TEXT("GamersFirst"), UserOriginationGamersFirst); + _UserOriginationMap.Add(TEXT("Unknown"), UserOriginationUnknown); + _UserOriginationMap.Add(TEXT("IOS"), UserOriginationIOS); + _UserOriginationMap.Add(TEXT("LoadTest"), UserOriginationLoadTest); + _UserOriginationMap.Add(TEXT("Android"), UserOriginationAndroid); + _UserOriginationMap.Add(TEXT("PSN"), UserOriginationPSN); + _UserOriginationMap.Add(TEXT("GameCenter"), UserOriginationGameCenter); + _UserOriginationMap.Add(TEXT("CustomId"), UserOriginationCustomId); + _UserOriginationMap.Add(TEXT("XboxLive"), UserOriginationXboxLive); + _UserOriginationMap.Add(TEXT("Parse"), UserOriginationParse); + _UserOriginationMap.Add(TEXT("Twitch"), UserOriginationTwitch); + _UserOriginationMap.Add(TEXT("WindowsHello"), UserOriginationWindowsHello); + _UserOriginationMap.Add(TEXT("ServerCustomId"), UserOriginationServerCustomId); + _UserOriginationMap.Add(TEXT("NintendoSwitchDeviceId"), UserOriginationNintendoSwitchDeviceId); + _UserOriginationMap.Add(TEXT("FacebookInstantGamesId"), UserOriginationFacebookInstantGamesId); + _UserOriginationMap.Add(TEXT("OpenIdConnect"), UserOriginationOpenIdConnect); + + } + + if (!value.IsEmpty()) + { + auto output = _UserOriginationMap.Find(value); + if (output != nullptr) + return *output; + } + + return UserOriginationOrganic; // Basically critical fail +} + +PlayFab::AdminModels::FUserTitleInfo::~FUserTitleInfo() +{ + //if (TitlePlayerAccount != nullptr) delete TitlePlayerAccount; + +} + +void PlayFab::AdminModels::FUserTitleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (FirstLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("FirstLogin")); writeDatetime(FirstLogin, writer); } + + if (isBanned.notNull()) { writer->WriteIdentifierPrefix(TEXT("isBanned")); writer->WriteValue(isBanned); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeUserOriginationEnumJSON(Origination, writer); } + + if (TitlePlayerAccount.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TitlePlayerAccount")); TitlePlayerAccount->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserTitleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr FirstLoginValue = obj->TryGetField(TEXT("FirstLogin")); + if (FirstLoginValue.IsValid()) + FirstLogin = readDatetime(FirstLoginValue); + + + const TSharedPtr isBannedValue = obj->TryGetField(TEXT("isBanned")); + if (isBannedValue.IsValid() && !isBannedValue->IsNull()) + { + bool TmpValue; + if (isBannedValue->TryGetBool(TmpValue)) { isBanned = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + Origination = readUserOriginationFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr TitlePlayerAccountValue = obj->TryGetField(TEXT("TitlePlayerAccount")); + if (TitlePlayerAccountValue.IsValid() && !TitlePlayerAccountValue->IsNull()) + { + TitlePlayerAccount = MakeShareable(new FEntityKey(TitlePlayerAccountValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserTwitchInfo::~FUserTwitchInfo() +{ + +} + +void PlayFab::AdminModels::FUserTwitchInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TwitchId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchId")); writer->WriteValue(TwitchId); } + + if (TwitchUserName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchUserName")); writer->WriteValue(TwitchUserName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserTwitchInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TwitchIdValue = obj->TryGetField(TEXT("TwitchId")); + if (TwitchIdValue.IsValid() && !TwitchIdValue->IsNull()) + { + FString TmpValue; + if (TwitchIdValue->TryGetString(TmpValue)) { TwitchId = TmpValue; } + } + + const TSharedPtr TwitchUserNameValue = obj->TryGetField(TEXT("TwitchUserName")); + if (TwitchUserNameValue.IsValid() && !TwitchUserNameValue->IsNull()) + { + FString TmpValue; + if (TwitchUserNameValue->TryGetString(TmpValue)) { TwitchUserName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserWindowsHelloInfo::~FUserWindowsHelloInfo() +{ + +} + +void PlayFab::AdminModels::FUserWindowsHelloInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (WindowsHelloDeviceName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloDeviceName")); writer->WriteValue(WindowsHelloDeviceName); } + + if (WindowsHelloPublicKeyHash.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloPublicKeyHash")); writer->WriteValue(WindowsHelloPublicKeyHash); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserWindowsHelloInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr WindowsHelloDeviceNameValue = obj->TryGetField(TEXT("WindowsHelloDeviceName")); + if (WindowsHelloDeviceNameValue.IsValid() && !WindowsHelloDeviceNameValue->IsNull()) + { + FString TmpValue; + if (WindowsHelloDeviceNameValue->TryGetString(TmpValue)) { WindowsHelloDeviceName = TmpValue; } + } + + const TSharedPtr WindowsHelloPublicKeyHashValue = obj->TryGetField(TEXT("WindowsHelloPublicKeyHash")); + if (WindowsHelloPublicKeyHashValue.IsValid() && !WindowsHelloPublicKeyHashValue->IsNull()) + { + FString TmpValue; + if (WindowsHelloPublicKeyHashValue->TryGetString(TmpValue)) { WindowsHelloPublicKeyHash = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserXboxInfo::~FUserXboxInfo() +{ + +} + +void PlayFab::AdminModels::FUserXboxInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (XboxUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxUserId")); writer->WriteValue(XboxUserId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserXboxInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr XboxUserIdValue = obj->TryGetField(TEXT("XboxUserId")); + if (XboxUserIdValue.IsValid() && !XboxUserIdValue->IsNull()) + { + FString TmpValue; + if (XboxUserIdValue->TryGetString(TmpValue)) { XboxUserId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserAccountInfo::~FUserAccountInfo() +{ + //if (AndroidDeviceInfo != nullptr) delete AndroidDeviceInfo; + //if (CustomIdInfo != nullptr) delete CustomIdInfo; + //if (FacebookInfo != nullptr) delete FacebookInfo; + //if (FacebookInstantGamesIdInfo != nullptr) delete FacebookInstantGamesIdInfo; + //if (GameCenterInfo != nullptr) delete GameCenterInfo; + //if (GoogleInfo != nullptr) delete GoogleInfo; + //if (IosDeviceInfo != nullptr) delete IosDeviceInfo; + //if (KongregateInfo != nullptr) delete KongregateInfo; + //if (NintendoSwitchDeviceIdInfo != nullptr) delete NintendoSwitchDeviceIdInfo; + //if (PrivateInfo != nullptr) delete PrivateInfo; + //if (PsnInfo != nullptr) delete PsnInfo; + //if (SteamInfo != nullptr) delete SteamInfo; + //if (TitleInfo != nullptr) delete TitleInfo; + //if (TwitchInfo != nullptr) delete TwitchInfo; + //if (WindowsHelloInfo != nullptr) delete WindowsHelloInfo; + //if (XboxInfo != nullptr) delete XboxInfo; + +} + +void PlayFab::AdminModels::FUserAccountInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceInfo")); AndroidDeviceInfo->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + if (CustomIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("CustomIdInfo")); CustomIdInfo->writeJSON(writer); } + + if (FacebookInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInfo")); FacebookInfo->writeJSON(writer); } + + if (FacebookInstantGamesIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesIdInfo")); FacebookInstantGamesIdInfo->writeJSON(writer); } + + if (GameCenterInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GameCenterInfo")); GameCenterInfo->writeJSON(writer); } + + if (GoogleInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GoogleInfo")); GoogleInfo->writeJSON(writer); } + + if (IosDeviceInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("IosDeviceInfo")); IosDeviceInfo->writeJSON(writer); } + + if (KongregateInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("KongregateInfo")); KongregateInfo->writeJSON(writer); } + + if (NintendoSwitchDeviceIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceIdInfo")); NintendoSwitchDeviceIdInfo->writeJSON(writer); } + + if (OpenIdInfo.Num() != 0) + { + writer->WriteArrayStart(TEXT("OpenIdInfo")); + for (const FUserOpenIdInfo& item : OpenIdInfo) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (PrivateInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PrivateInfo")); PrivateInfo->writeJSON(writer); } + + if (PsnInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PsnInfo")); PsnInfo->writeJSON(writer); } + + if (SteamInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SteamInfo")); SteamInfo->writeJSON(writer); } + + if (TitleInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TitleInfo")); TitleInfo->writeJSON(writer); } + + if (TwitchInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TwitchInfo")); TwitchInfo->writeJSON(writer); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + if (WindowsHelloInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloInfo")); WindowsHelloInfo->writeJSON(writer); } + + if (XboxInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("XboxInfo")); XboxInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserAccountInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceInfoValue = obj->TryGetField(TEXT("AndroidDeviceInfo")); + if (AndroidDeviceInfoValue.IsValid() && !AndroidDeviceInfoValue->IsNull()) + { + AndroidDeviceInfo = MakeShareable(new FUserAndroidDeviceInfo(AndroidDeviceInfoValue->AsObject())); + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr CustomIdInfoValue = obj->TryGetField(TEXT("CustomIdInfo")); + if (CustomIdInfoValue.IsValid() && !CustomIdInfoValue->IsNull()) + { + CustomIdInfo = MakeShareable(new FUserCustomIdInfo(CustomIdInfoValue->AsObject())); + } + + const TSharedPtr FacebookInfoValue = obj->TryGetField(TEXT("FacebookInfo")); + if (FacebookInfoValue.IsValid() && !FacebookInfoValue->IsNull()) + { + FacebookInfo = MakeShareable(new FUserFacebookInfo(FacebookInfoValue->AsObject())); + } + + const TSharedPtr FacebookInstantGamesIdInfoValue = obj->TryGetField(TEXT("FacebookInstantGamesIdInfo")); + if (FacebookInstantGamesIdInfoValue.IsValid() && !FacebookInstantGamesIdInfoValue->IsNull()) + { + FacebookInstantGamesIdInfo = MakeShareable(new FUserFacebookInstantGamesIdInfo(FacebookInstantGamesIdInfoValue->AsObject())); + } + + const TSharedPtr GameCenterInfoValue = obj->TryGetField(TEXT("GameCenterInfo")); + if (GameCenterInfoValue.IsValid() && !GameCenterInfoValue->IsNull()) + { + GameCenterInfo = MakeShareable(new FUserGameCenterInfo(GameCenterInfoValue->AsObject())); + } + + const TSharedPtr GoogleInfoValue = obj->TryGetField(TEXT("GoogleInfo")); + if (GoogleInfoValue.IsValid() && !GoogleInfoValue->IsNull()) + { + GoogleInfo = MakeShareable(new FUserGoogleInfo(GoogleInfoValue->AsObject())); + } + + const TSharedPtr IosDeviceInfoValue = obj->TryGetField(TEXT("IosDeviceInfo")); + if (IosDeviceInfoValue.IsValid() && !IosDeviceInfoValue->IsNull()) + { + IosDeviceInfo = MakeShareable(new FUserIosDeviceInfo(IosDeviceInfoValue->AsObject())); + } + + const TSharedPtr KongregateInfoValue = obj->TryGetField(TEXT("KongregateInfo")); + if (KongregateInfoValue.IsValid() && !KongregateInfoValue->IsNull()) + { + KongregateInfo = MakeShareable(new FUserKongregateInfo(KongregateInfoValue->AsObject())); + } + + const TSharedPtr NintendoSwitchDeviceIdInfoValue = obj->TryGetField(TEXT("NintendoSwitchDeviceIdInfo")); + if (NintendoSwitchDeviceIdInfoValue.IsValid() && !NintendoSwitchDeviceIdInfoValue->IsNull()) + { + NintendoSwitchDeviceIdInfo = MakeShareable(new FUserNintendoSwitchDeviceIdInfo(NintendoSwitchDeviceIdInfoValue->AsObject())); + } + + const TArray>&OpenIdInfoArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("OpenIdInfo")); + for (int32 Idx = 0; Idx < OpenIdInfoArray.Num(); Idx++) + { + TSharedPtr CurrentItem = OpenIdInfoArray[Idx]; + OpenIdInfo.Add(FUserOpenIdInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PrivateInfoValue = obj->TryGetField(TEXT("PrivateInfo")); + if (PrivateInfoValue.IsValid() && !PrivateInfoValue->IsNull()) + { + PrivateInfo = MakeShareable(new FUserPrivateAccountInfo(PrivateInfoValue->AsObject())); + } + + const TSharedPtr PsnInfoValue = obj->TryGetField(TEXT("PsnInfo")); + if (PsnInfoValue.IsValid() && !PsnInfoValue->IsNull()) + { + PsnInfo = MakeShareable(new FUserPsnInfo(PsnInfoValue->AsObject())); + } + + const TSharedPtr SteamInfoValue = obj->TryGetField(TEXT("SteamInfo")); + if (SteamInfoValue.IsValid() && !SteamInfoValue->IsNull()) + { + SteamInfo = MakeShareable(new FUserSteamInfo(SteamInfoValue->AsObject())); + } + + const TSharedPtr TitleInfoValue = obj->TryGetField(TEXT("TitleInfo")); + if (TitleInfoValue.IsValid() && !TitleInfoValue->IsNull()) + { + TitleInfo = MakeShareable(new FUserTitleInfo(TitleInfoValue->AsObject())); + } + + const TSharedPtr TwitchInfoValue = obj->TryGetField(TEXT("TwitchInfo")); + if (TwitchInfoValue.IsValid() && !TwitchInfoValue->IsNull()) + { + TwitchInfo = MakeShareable(new FUserTwitchInfo(TwitchInfoValue->AsObject())); + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + const TSharedPtr WindowsHelloInfoValue = obj->TryGetField(TEXT("WindowsHelloInfo")); + if (WindowsHelloInfoValue.IsValid() && !WindowsHelloInfoValue->IsNull()) + { + WindowsHelloInfo = MakeShareable(new FUserWindowsHelloInfo(WindowsHelloInfoValue->AsObject())); + } + + const TSharedPtr XboxInfoValue = obj->TryGetField(TEXT("XboxInfo")); + if (XboxInfoValue.IsValid() && !XboxInfoValue->IsNull()) + { + XboxInfo = MakeShareable(new FUserXboxInfo(XboxInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FLookupUserAccountInfoResult::~FLookupUserAccountInfoResult() +{ + //if (UserInfo != nullptr) delete UserInfo; + +} + +void PlayFab::AdminModels::FLookupUserAccountInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (UserInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("UserInfo")); UserInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FLookupUserAccountInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UserInfoValue = obj->TryGetField(TEXT("UserInfo")); + if (UserInfoValue.IsValid() && !UserInfoValue->IsNull()) + { + UserInfo = MakeShareable(new FUserAccountInfo(UserInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FModifyMatchmakerGameModesRequest::~FModifyMatchmakerGameModesRequest() +{ + +} + +void PlayFab::AdminModels::FModifyMatchmakerGameModesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); + + writer->WriteArrayStart(TEXT("GameModes")); + for (const FGameModeInfo& item : GameModes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FModifyMatchmakerGameModesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TArray>&GameModesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GameModes")); + for (int32 Idx = 0; Idx < GameModesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GameModesArray[Idx]; + GameModes.Add(FGameModeInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FModifyMatchmakerGameModesResult::~FModifyMatchmakerGameModesResult() +{ + +} + +void PlayFab::AdminModels::FModifyMatchmakerGameModesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FModifyMatchmakerGameModesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FModifyServerBuildRequest::~FModifyServerBuildRequest() +{ + +} + +void PlayFab::AdminModels::FModifyServerBuildRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ActiveRegions.Num() != 0) + { + writer->WriteArrayStart(TEXT("ActiveRegions")); + for (const Region& item : ActiveRegions) + writeRegionEnumJSON(item, writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); + + if (CommandLineTemplate.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CommandLineTemplate")); writer->WriteValue(CommandLineTemplate); } + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + if (ExecutablePath.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ExecutablePath")); writer->WriteValue(ExecutablePath); } + + writer->WriteIdentifierPrefix(TEXT("MaxGamesPerHost")); writer->WriteValue(MaxGamesPerHost); + + writer->WriteIdentifierPrefix(TEXT("MinFreeGameSlots")); writer->WriteValue(MinFreeGameSlots); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FModifyServerBuildRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ActiveRegionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ActiveRegions")); + for (int32 Idx = 0; Idx < ActiveRegionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ActiveRegionsArray[Idx]; + ActiveRegions.Add(readRegionFromValue(CurrentItem)); + } + + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + const TSharedPtr CommandLineTemplateValue = obj->TryGetField(TEXT("CommandLineTemplate")); + if (CommandLineTemplateValue.IsValid() && !CommandLineTemplateValue->IsNull()) + { + FString TmpValue; + if (CommandLineTemplateValue->TryGetString(TmpValue)) { CommandLineTemplate = TmpValue; } + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ExecutablePathValue = obj->TryGetField(TEXT("ExecutablePath")); + if (ExecutablePathValue.IsValid() && !ExecutablePathValue->IsNull()) + { + FString TmpValue; + if (ExecutablePathValue->TryGetString(TmpValue)) { ExecutablePath = TmpValue; } + } + + const TSharedPtr MaxGamesPerHostValue = obj->TryGetField(TEXT("MaxGamesPerHost")); + if (MaxGamesPerHostValue.IsValid() && !MaxGamesPerHostValue->IsNull()) + { + int32 TmpValue; + if (MaxGamesPerHostValue->TryGetNumber(TmpValue)) { MaxGamesPerHost = TmpValue; } + } + + const TSharedPtr MinFreeGameSlotsValue = obj->TryGetField(TEXT("MinFreeGameSlots")); + if (MinFreeGameSlotsValue.IsValid() && !MinFreeGameSlotsValue->IsNull()) + { + int32 TmpValue; + if (MinFreeGameSlotsValue->TryGetNumber(TmpValue)) { MinFreeGameSlots = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + +PlayFab::AdminModels::FModifyServerBuildResult::~FModifyServerBuildResult() +{ + +} + +void PlayFab::AdminModels::FModifyServerBuildResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ActiveRegions.Num() != 0) + { + writer->WriteArrayStart(TEXT("ActiveRegions")); + for (const Region& item : ActiveRegions) + writeRegionEnumJSON(item, writer); + writer->WriteArrayEnd(); + } + + + if (BuildId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); } + + if (CommandLineTemplate.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CommandLineTemplate")); writer->WriteValue(CommandLineTemplate); } + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + if (ExecutablePath.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ExecutablePath")); writer->WriteValue(ExecutablePath); } + + writer->WriteIdentifierPrefix(TEXT("MaxGamesPerHost")); writer->WriteValue(MaxGamesPerHost); + + writer->WriteIdentifierPrefix(TEXT("MinFreeGameSlots")); writer->WriteValue(MinFreeGameSlots); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeGameBuildStatusEnumJSON(Status, writer); } + + writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FModifyServerBuildResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ActiveRegionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ActiveRegions")); + for (int32 Idx = 0; Idx < ActiveRegionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ActiveRegionsArray[Idx]; + ActiveRegions.Add(readRegionFromValue(CurrentItem)); + } + + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + const TSharedPtr CommandLineTemplateValue = obj->TryGetField(TEXT("CommandLineTemplate")); + if (CommandLineTemplateValue.IsValid() && !CommandLineTemplateValue->IsNull()) + { + FString TmpValue; + if (CommandLineTemplateValue->TryGetString(TmpValue)) { CommandLineTemplate = TmpValue; } + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ExecutablePathValue = obj->TryGetField(TEXT("ExecutablePath")); + if (ExecutablePathValue.IsValid() && !ExecutablePathValue->IsNull()) + { + FString TmpValue; + if (ExecutablePathValue->TryGetString(TmpValue)) { ExecutablePath = TmpValue; } + } + + const TSharedPtr MaxGamesPerHostValue = obj->TryGetField(TEXT("MaxGamesPerHost")); + if (MaxGamesPerHostValue.IsValid() && !MaxGamesPerHostValue->IsNull()) + { + int32 TmpValue; + if (MaxGamesPerHostValue->TryGetNumber(TmpValue)) { MaxGamesPerHost = TmpValue; } + } + + const TSharedPtr MinFreeGameSlotsValue = obj->TryGetField(TEXT("MinFreeGameSlots")); + if (MinFreeGameSlotsValue.IsValid() && !MinFreeGameSlotsValue->IsNull()) + { + int32 TmpValue; + if (MinFreeGameSlotsValue->TryGetNumber(TmpValue)) { MinFreeGameSlots = TmpValue; } + } + + Status = readGameBuildStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FModifyUserVirtualCurrencyResult::~FModifyUserVirtualCurrencyResult() +{ + +} + +void PlayFab::AdminModels::FModifyUserVirtualCurrencyResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Balance")); writer->WriteValue(Balance); + + writer->WriteIdentifierPrefix(TEXT("BalanceChange")); writer->WriteValue(BalanceChange); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (VirtualCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FModifyUserVirtualCurrencyResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BalanceValue = obj->TryGetField(TEXT("Balance")); + if (BalanceValue.IsValid() && !BalanceValue->IsNull()) + { + int32 TmpValue; + if (BalanceValue->TryGetNumber(TmpValue)) { Balance = TmpValue; } + } + + const TSharedPtr BalanceChangeValue = obj->TryGetField(TEXT("BalanceChange")); + if (BalanceChangeValue.IsValid() && !BalanceChangeValue->IsNull()) + { + int32 TmpValue; + if (BalanceChangeValue->TryGetNumber(TmpValue)) { BalanceChange = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writePushSetupPlatformEnumJSON(PushSetupPlatform enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case PushSetupPlatformGCM: writer->WriteValue(TEXT("GCM")); break; + case PushSetupPlatformAPNS: writer->WriteValue(TEXT("APNS")); break; + case PushSetupPlatformAPNS_SANDBOX: writer->WriteValue(TEXT("APNS_SANDBOX")); break; + } +} + +AdminModels::PushSetupPlatform PlayFab::AdminModels::readPushSetupPlatformFromValue(const TSharedPtr& value) +{ + return readPushSetupPlatformFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::PushSetupPlatform PlayFab::AdminModels::readPushSetupPlatformFromValue(const FString& value) +{ + static TMap _PushSetupPlatformMap; + if (_PushSetupPlatformMap.Num() == 0) + { + // Auto-generate the map on the first use + _PushSetupPlatformMap.Add(TEXT("GCM"), PushSetupPlatformGCM); + _PushSetupPlatformMap.Add(TEXT("APNS"), PushSetupPlatformAPNS); + _PushSetupPlatformMap.Add(TEXT("APNS_SANDBOX"), PushSetupPlatformAPNS_SANDBOX); + + } + + if (!value.IsEmpty()) + { + auto output = _PushSetupPlatformMap.Find(value); + if (output != nullptr) + return *output; + } + + return PushSetupPlatformGCM; // Basically critical fail +} + +PlayFab::AdminModels::FRandomResultTable::~FRandomResultTable() +{ + +} + +void PlayFab::AdminModels::FRandomResultTable::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Nodes")); + for (const FResultTableNode& item : Nodes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("TableId")); writer->WriteValue(TableId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRandomResultTable::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&NodesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Nodes")); + for (int32 Idx = 0; Idx < NodesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = NodesArray[Idx]; + Nodes.Add(FResultTableNode(CurrentItem->AsObject())); + } + + + const TSharedPtr TableIdValue = obj->TryGetField(TEXT("TableId")); + if (TableIdValue.IsValid() && !TableIdValue->IsNull()) + { + FString TmpValue; + if (TableIdValue->TryGetString(TmpValue)) { TableId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRefundPurchaseRequest::~FRefundPurchaseRequest() +{ + +} + +void PlayFab::AdminModels::FRefundPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRefundPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRefundPurchaseResponse::~FRefundPurchaseResponse() +{ + +} + +void PlayFab::AdminModels::FRefundPurchaseResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PurchaseStatus.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PurchaseStatus")); writer->WriteValue(PurchaseStatus); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRefundPurchaseResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PurchaseStatusValue = obj->TryGetField(TEXT("PurchaseStatus")); + if (PurchaseStatusValue.IsValid() && !PurchaseStatusValue->IsNull()) + { + FString TmpValue; + if (PurchaseStatusValue->TryGetString(TmpValue)) { PurchaseStatus = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRemovePlayerTagRequest::~FRemovePlayerTagRequest() +{ + +} + +void PlayFab::AdminModels::FRemovePlayerTagRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("TagName")); writer->WriteValue(TagName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRemovePlayerTagRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TagNameValue = obj->TryGetField(TEXT("TagName")); + if (TagNameValue.IsValid() && !TagNameValue->IsNull()) + { + FString TmpValue; + if (TagNameValue->TryGetString(TmpValue)) { TagName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRemovePlayerTagResult::~FRemovePlayerTagResult() +{ + +} + +void PlayFab::AdminModels::FRemovePlayerTagResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRemovePlayerTagResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FRemoveServerBuildRequest::~FRemoveServerBuildRequest() +{ + +} + +void PlayFab::AdminModels::FRemoveServerBuildRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRemoveServerBuildRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRemoveServerBuildResult::~FRemoveServerBuildResult() +{ + +} + +void PlayFab::AdminModels::FRemoveServerBuildResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRemoveServerBuildResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FRemoveVirtualCurrencyTypesRequest::~FRemoveVirtualCurrencyTypesRequest() +{ + +} + +void PlayFab::AdminModels::FRemoveVirtualCurrencyTypesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("VirtualCurrencies")); + for (const FVirtualCurrencyData& item : VirtualCurrencies) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRemoveVirtualCurrencyTypesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&VirtualCurrenciesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("VirtualCurrencies")); + for (int32 Idx = 0; Idx < VirtualCurrenciesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = VirtualCurrenciesArray[Idx]; + VirtualCurrencies.Add(FVirtualCurrencyData(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FResetCharacterStatisticsRequest::~FResetCharacterStatisticsRequest() +{ + +} + +void PlayFab::AdminModels::FResetCharacterStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResetCharacterStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FResetCharacterStatisticsResult::~FResetCharacterStatisticsResult() +{ + +} + +void PlayFab::AdminModels::FResetCharacterStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResetCharacterStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FResetPasswordRequest::~FResetPasswordRequest() +{ + +} + +void PlayFab::AdminModels::FResetPasswordRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Password")); writer->WriteValue(Password); + + writer->WriteIdentifierPrefix(TEXT("Token")); writer->WriteValue(Token); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResetPasswordRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PasswordValue = obj->TryGetField(TEXT("Password")); + if (PasswordValue.IsValid() && !PasswordValue->IsNull()) + { + FString TmpValue; + if (PasswordValue->TryGetString(TmpValue)) { Password = TmpValue; } + } + + const TSharedPtr TokenValue = obj->TryGetField(TEXT("Token")); + if (TokenValue.IsValid() && !TokenValue->IsNull()) + { + FString TmpValue; + if (TokenValue->TryGetString(TmpValue)) { Token = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FResetPasswordResult::~FResetPasswordResult() +{ + +} + +void PlayFab::AdminModels::FResetPasswordResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResetPasswordResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FResetUserStatisticsRequest::~FResetUserStatisticsRequest() +{ + +} + +void PlayFab::AdminModels::FResetUserStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResetUserStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FResetUserStatisticsResult::~FResetUserStatisticsResult() +{ + +} + +void PlayFab::AdminModels::FResetUserStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResetUserStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeResolutionOutcomeEnumJSON(ResolutionOutcome enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ResolutionOutcomeRevoke: writer->WriteValue(TEXT("Revoke")); break; + case ResolutionOutcomeReinstate: writer->WriteValue(TEXT("Reinstate")); break; + case ResolutionOutcomeManual: writer->WriteValue(TEXT("Manual")); break; + } +} + +AdminModels::ResolutionOutcome PlayFab::AdminModels::readResolutionOutcomeFromValue(const TSharedPtr& value) +{ + return readResolutionOutcomeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::ResolutionOutcome PlayFab::AdminModels::readResolutionOutcomeFromValue(const FString& value) +{ + static TMap _ResolutionOutcomeMap; + if (_ResolutionOutcomeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ResolutionOutcomeMap.Add(TEXT("Revoke"), ResolutionOutcomeRevoke); + _ResolutionOutcomeMap.Add(TEXT("Reinstate"), ResolutionOutcomeReinstate); + _ResolutionOutcomeMap.Add(TEXT("Manual"), ResolutionOutcomeManual); + + } + + if (!value.IsEmpty()) + { + auto output = _ResolutionOutcomeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ResolutionOutcomeRevoke; // Basically critical fail +} + +PlayFab::AdminModels::FResolvePurchaseDisputeRequest::~FResolvePurchaseDisputeRequest() +{ + +} + +void PlayFab::AdminModels::FResolvePurchaseDisputeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); + + writer->WriteIdentifierPrefix(TEXT("Outcome")); writeResolutionOutcomeEnumJSON(Outcome, writer); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResolvePurchaseDisputeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + Outcome = readResolutionOutcomeFromValue(obj->TryGetField(TEXT("Outcome"))); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FResolvePurchaseDisputeResponse::~FResolvePurchaseDisputeResponse() +{ + +} + +void PlayFab::AdminModels::FResolvePurchaseDisputeResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PurchaseStatus.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PurchaseStatus")); writer->WriteValue(PurchaseStatus); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResolvePurchaseDisputeResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PurchaseStatusValue = obj->TryGetField(TEXT("PurchaseStatus")); + if (PurchaseStatusValue.IsValid() && !PurchaseStatusValue->IsNull()) + { + FString TmpValue; + if (PurchaseStatusValue->TryGetString(TmpValue)) { PurchaseStatus = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeAllBansForUserRequest::~FRevokeAllBansForUserRequest() +{ + +} + +void PlayFab::AdminModels::FRevokeAllBansForUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeAllBansForUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeAllBansForUserResult::~FRevokeAllBansForUserResult() +{ + +} + +void PlayFab::AdminModels::FRevokeAllBansForUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeAllBansForUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeBansRequest::~FRevokeBansRequest() +{ + +} + +void PlayFab::AdminModels::FRevokeBansRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("BanIds")); + for (const FString& item : BanIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeBansRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("BanIds"), BanIds); + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeBansResult::~FRevokeBansResult() +{ + +} + +void PlayFab::AdminModels::FRevokeBansResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeBansResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeInventoryItem::~FRevokeInventoryItem() +{ + +} + +void PlayFab::AdminModels::FRevokeInventoryItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeInventoryItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeInventoryItemRequest::~FRevokeInventoryItemRequest() +{ + +} + +void PlayFab::AdminModels::FRevokeInventoryItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeInventoryItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeInventoryItemsRequest::~FRevokeInventoryItemsRequest() +{ + +} + +void PlayFab::AdminModels::FRevokeInventoryItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Items")); + for (const FRevokeInventoryItem& item : Items) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeInventoryItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Items")); + for (int32 Idx = 0; Idx < ItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemsArray[Idx]; + Items.Add(FRevokeInventoryItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeItemError::~FRevokeItemError() +{ + //if (Item != nullptr) delete Item; + +} + +void PlayFab::AdminModels::FRevokeItemError::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + if (Item.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Item")); Item->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeItemError::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr ItemValue = obj->TryGetField(TEXT("Item")); + if (ItemValue.IsValid() && !ItemValue->IsNull()) + { + Item = MakeShareable(new FRevokeInventoryItem(ItemValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeInventoryItemsResult::~FRevokeInventoryItemsResult() +{ + +} + +void PlayFab::AdminModels::FRevokeInventoryItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Errors.Num() != 0) + { + writer->WriteArrayStart(TEXT("Errors")); + for (const FRevokeItemError& item : Errors) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeInventoryItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ErrorsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Errors")); + for (int32 Idx = 0; Idx < ErrorsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ErrorsArray[Idx]; + Errors.Add(FRevokeItemError(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeInventoryResult::~FRevokeInventoryResult() +{ + +} + +void PlayFab::AdminModels::FRevokeInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FRunTaskRequest::~FRunTaskRequest() +{ + //if (Identifier != nullptr) delete Identifier; + +} + +void PlayFab::AdminModels::FRunTaskRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Identifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Identifier")); Identifier->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRunTaskRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdentifierValue = obj->TryGetField(TEXT("Identifier")); + if (IdentifierValue.IsValid() && !IdentifierValue->IsNull()) + { + Identifier = MakeShareable(new FNameIdentifier(IdentifierValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRunTaskResult::~FRunTaskResult() +{ + +} + +void PlayFab::AdminModels::FRunTaskResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TaskInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TaskInstanceId")); writer->WriteValue(TaskInstanceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRunTaskResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TaskInstanceIdValue = obj->TryGetField(TEXT("TaskInstanceId")); + if (TaskInstanceIdValue.IsValid() && !TaskInstanceIdValue->IsNull()) + { + FString TmpValue; + if (TaskInstanceIdValue->TryGetString(TmpValue)) { TaskInstanceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FSendAccountRecoveryEmailRequest::~FSendAccountRecoveryEmailRequest() +{ + +} + +void PlayFab::AdminModels::FSendAccountRecoveryEmailRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); + + if (EmailTemplateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailTemplateId")); writer->WriteValue(EmailTemplateId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSendAccountRecoveryEmailRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr EmailTemplateIdValue = obj->TryGetField(TEXT("EmailTemplateId")); + if (EmailTemplateIdValue.IsValid() && !EmailTemplateIdValue->IsNull()) + { + FString TmpValue; + if (EmailTemplateIdValue->TryGetString(TmpValue)) { EmailTemplateId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FSendAccountRecoveryEmailResult::~FSendAccountRecoveryEmailResult() +{ + +} + +void PlayFab::AdminModels::FSendAccountRecoveryEmailResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSendAccountRecoveryEmailResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetPlayerSecretRequest::~FSetPlayerSecretRequest() +{ + +} + +void PlayFab::AdminModels::FSetPlayerSecretRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetPlayerSecretRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetPlayerSecretResult::~FSetPlayerSecretResult() +{ + +} + +void PlayFab::AdminModels::FSetPlayerSecretResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetPlayerSecretResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetPublishedRevisionRequest::~FSetPublishedRevisionRequest() +{ + +} + +void PlayFab::AdminModels::FSetPublishedRevisionRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetPublishedRevisionRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetPublishedRevisionResult::~FSetPublishedRevisionResult() +{ + +} + +void PlayFab::AdminModels::FSetPublishedRevisionResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetPublishedRevisionResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetPublisherDataRequest::~FSetPublisherDataRequest() +{ + +} + +void PlayFab::AdminModels::FSetPublisherDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetPublisherDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetPublisherDataResult::~FSetPublisherDataResult() +{ + +} + +void PlayFab::AdminModels::FSetPublisherDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetPublisherDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetTitleDataRequest::~FSetTitleDataRequest() +{ + +} + +void PlayFab::AdminModels::FSetTitleDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetTitleDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetTitleDataResult::~FSetTitleDataResult() +{ + +} + +void PlayFab::AdminModels::FSetTitleDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetTitleDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetupPushNotificationRequest::~FSetupPushNotificationRequest() +{ + +} + +void PlayFab::AdminModels::FSetupPushNotificationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Credential")); writer->WriteValue(Credential); + + if (Key.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); } + + writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); + + writer->WriteIdentifierPrefix(TEXT("OverwriteOldARN")); writer->WriteValue(OverwriteOldARN); + + writer->WriteIdentifierPrefix(TEXT("Platform")); writePushSetupPlatformEnumJSON(Platform, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetupPushNotificationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CredentialValue = obj->TryGetField(TEXT("Credential")); + if (CredentialValue.IsValid() && !CredentialValue->IsNull()) + { + FString TmpValue; + if (CredentialValue->TryGetString(TmpValue)) { Credential = TmpValue; } + } + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr OverwriteOldARNValue = obj->TryGetField(TEXT("OverwriteOldARN")); + if (OverwriteOldARNValue.IsValid() && !OverwriteOldARNValue->IsNull()) + { + bool TmpValue; + if (OverwriteOldARNValue->TryGetBool(TmpValue)) { OverwriteOldARN = TmpValue; } + } + + Platform = readPushSetupPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetupPushNotificationResult::~FSetupPushNotificationResult() +{ + +} + +void PlayFab::AdminModels::FSetupPushNotificationResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ARN.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ARN")); writer->WriteValue(ARN); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetupPushNotificationResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ARNValue = obj->TryGetField(TEXT("ARN")); + if (ARNValue.IsValid() && !ARNValue->IsNull()) + { + FString TmpValue; + if (ARNValue->TryGetString(TmpValue)) { ARN = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeStatisticVersionArchivalStatusEnumJSON(StatisticVersionArchivalStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case StatisticVersionArchivalStatusNotScheduled: writer->WriteValue(TEXT("NotScheduled")); break; + case StatisticVersionArchivalStatusScheduled: writer->WriteValue(TEXT("Scheduled")); break; + case StatisticVersionArchivalStatusQueued: writer->WriteValue(TEXT("Queued")); break; + case StatisticVersionArchivalStatusInProgress: writer->WriteValue(TEXT("InProgress")); break; + case StatisticVersionArchivalStatusComplete: writer->WriteValue(TEXT("Complete")); break; + } +} + +AdminModels::StatisticVersionArchivalStatus PlayFab::AdminModels::readStatisticVersionArchivalStatusFromValue(const TSharedPtr& value) +{ + return readStatisticVersionArchivalStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::StatisticVersionArchivalStatus PlayFab::AdminModels::readStatisticVersionArchivalStatusFromValue(const FString& value) +{ + static TMap _StatisticVersionArchivalStatusMap; + if (_StatisticVersionArchivalStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _StatisticVersionArchivalStatusMap.Add(TEXT("NotScheduled"), StatisticVersionArchivalStatusNotScheduled); + _StatisticVersionArchivalStatusMap.Add(TEXT("Scheduled"), StatisticVersionArchivalStatusScheduled); + _StatisticVersionArchivalStatusMap.Add(TEXT("Queued"), StatisticVersionArchivalStatusQueued); + _StatisticVersionArchivalStatusMap.Add(TEXT("InProgress"), StatisticVersionArchivalStatusInProgress); + _StatisticVersionArchivalStatusMap.Add(TEXT("Complete"), StatisticVersionArchivalStatusComplete); + + } + + if (!value.IsEmpty()) + { + auto output = _StatisticVersionArchivalStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return StatisticVersionArchivalStatusNotScheduled; // Basically critical fail +} + +PlayFab::AdminModels::FSubtractUserVirtualCurrencyRequest::~FSubtractUserVirtualCurrencyRequest() +{ + +} + +void PlayFab::AdminModels::FSubtractUserVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSubtractUserVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateBanRequest::~FUpdateBanRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateBanRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Active.notNull()) { writer->WriteIdentifierPrefix(TEXT("Active")); writer->WriteValue(Active); } + + writer->WriteIdentifierPrefix(TEXT("BanId")); writer->WriteValue(BanId); + + if (Expires.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); } + + if (IPAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IPAddress")); writer->WriteValue(IPAddress); } + + if (MACAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MACAddress")); writer->WriteValue(MACAddress); } + + if (Permanent.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permanent")); writer->WriteValue(Permanent); } + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateBanRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActiveValue = obj->TryGetField(TEXT("Active")); + if (ActiveValue.IsValid() && !ActiveValue->IsNull()) + { + bool TmpValue; + if (ActiveValue->TryGetBool(TmpValue)) { Active = TmpValue; } + } + + const TSharedPtr BanIdValue = obj->TryGetField(TEXT("BanId")); + if (BanIdValue.IsValid() && !BanIdValue->IsNull()) + { + FString TmpValue; + if (BanIdValue->TryGetString(TmpValue)) { BanId = TmpValue; } + } + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr IPAddressValue = obj->TryGetField(TEXT("IPAddress")); + if (IPAddressValue.IsValid() && !IPAddressValue->IsNull()) + { + FString TmpValue; + if (IPAddressValue->TryGetString(TmpValue)) { IPAddress = TmpValue; } + } + + const TSharedPtr MACAddressValue = obj->TryGetField(TEXT("MACAddress")); + if (MACAddressValue.IsValid() && !MACAddressValue->IsNull()) + { + FString TmpValue; + if (MACAddressValue->TryGetString(TmpValue)) { MACAddress = TmpValue; } + } + + const TSharedPtr PermanentValue = obj->TryGetField(TEXT("Permanent")); + if (PermanentValue.IsValid() && !PermanentValue->IsNull()) + { + bool TmpValue; + if (PermanentValue->TryGetBool(TmpValue)) { Permanent = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateBansRequest::~FUpdateBansRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateBansRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Bans")); + for (const FUpdateBanRequest& item : Bans) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateBansRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BansArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Bans")); + for (int32 Idx = 0; Idx < BansArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BansArray[Idx]; + Bans.Add(FUpdateBanRequest(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateBansResult::~FUpdateBansResult() +{ + +} + +void PlayFab::AdminModels::FUpdateBansResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateBansResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateCatalogItemsRequest::~FUpdateCatalogItemsRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateCatalogItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Catalog.Num() != 0) + { + writer->WriteArrayStart(TEXT("Catalog")); + for (const FCatalogItem& item : Catalog) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (SetAsDefaultCatalog.notNull()) { writer->WriteIdentifierPrefix(TEXT("SetAsDefaultCatalog")); writer->WriteValue(SetAsDefaultCatalog); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateCatalogItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&CatalogArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Catalog")); + for (int32 Idx = 0; Idx < CatalogArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CatalogArray[Idx]; + Catalog.Add(FCatalogItem(CurrentItem->AsObject())); + } + + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr SetAsDefaultCatalogValue = obj->TryGetField(TEXT("SetAsDefaultCatalog")); + if (SetAsDefaultCatalogValue.IsValid() && !SetAsDefaultCatalogValue->IsNull()) + { + bool TmpValue; + if (SetAsDefaultCatalogValue->TryGetBool(TmpValue)) { SetAsDefaultCatalog = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateCatalogItemsResult::~FUpdateCatalogItemsResult() +{ + +} + +void PlayFab::AdminModels::FUpdateCatalogItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateCatalogItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateCloudScriptRequest::~FUpdateCloudScriptRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateCloudScriptRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DeveloperPlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeveloperPlayFabId")); writer->WriteValue(DeveloperPlayFabId); } + + writer->WriteArrayStart(TEXT("Files")); + for (const FCloudScriptFile& item : Files) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("Publish")); writer->WriteValue(Publish); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateCloudScriptRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DeveloperPlayFabIdValue = obj->TryGetField(TEXT("DeveloperPlayFabId")); + if (DeveloperPlayFabIdValue.IsValid() && !DeveloperPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (DeveloperPlayFabIdValue->TryGetString(TmpValue)) { DeveloperPlayFabId = TmpValue; } + } + + const TArray>&FilesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Files")); + for (int32 Idx = 0; Idx < FilesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = FilesArray[Idx]; + Files.Add(FCloudScriptFile(CurrentItem->AsObject())); + } + + + const TSharedPtr PublishValue = obj->TryGetField(TEXT("Publish")); + if (PublishValue.IsValid() && !PublishValue->IsNull()) + { + bool TmpValue; + if (PublishValue->TryGetBool(TmpValue)) { Publish = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateCloudScriptResult::~FUpdateCloudScriptResult() +{ + +} + +void PlayFab::AdminModels::FUpdateCloudScriptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateCloudScriptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdatePlayerSharedSecretRequest::~FUpdatePlayerSharedSecretRequest() +{ + +} + +void PlayFab::AdminModels::FUpdatePlayerSharedSecretRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Disabled")); writer->WriteValue(Disabled); + + if (FriendlyName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendlyName")); writer->WriteValue(FriendlyName); } + + if (SecretKey.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SecretKey")); writer->WriteValue(SecretKey); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdatePlayerSharedSecretRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisabledValue = obj->TryGetField(TEXT("Disabled")); + if (DisabledValue.IsValid() && !DisabledValue->IsNull()) + { + bool TmpValue; + if (DisabledValue->TryGetBool(TmpValue)) { Disabled = TmpValue; } + } + + const TSharedPtr FriendlyNameValue = obj->TryGetField(TEXT("FriendlyName")); + if (FriendlyNameValue.IsValid() && !FriendlyNameValue->IsNull()) + { + FString TmpValue; + if (FriendlyNameValue->TryGetString(TmpValue)) { FriendlyName = TmpValue; } + } + + const TSharedPtr SecretKeyValue = obj->TryGetField(TEXT("SecretKey")); + if (SecretKeyValue.IsValid() && !SecretKeyValue->IsNull()) + { + FString TmpValue; + if (SecretKeyValue->TryGetString(TmpValue)) { SecretKey = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdatePlayerSharedSecretResult::~FUpdatePlayerSharedSecretResult() +{ + +} + +void PlayFab::AdminModels::FUpdatePlayerSharedSecretResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdatePlayerSharedSecretResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdatePlayerStatisticDefinitionRequest::~FUpdatePlayerStatisticDefinitionRequest() +{ + +} + +void PlayFab::AdminModels::FUpdatePlayerStatisticDefinitionRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AggregationMethod.notNull()) { writer->WriteIdentifierPrefix(TEXT("AggregationMethod")); writeStatisticAggregationMethodEnumJSON(AggregationMethod, writer); } + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (VersionChangeInterval.notNull()) { writer->WriteIdentifierPrefix(TEXT("VersionChangeInterval")); writeStatisticResetIntervalOptionEnumJSON(VersionChangeInterval, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdatePlayerStatisticDefinitionRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + AggregationMethod = readStatisticAggregationMethodFromValue(obj->TryGetField(TEXT("AggregationMethod"))); + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + VersionChangeInterval = readStatisticResetIntervalOptionFromValue(obj->TryGetField(TEXT("VersionChangeInterval"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdatePlayerStatisticDefinitionResult::~FUpdatePlayerStatisticDefinitionResult() +{ + //if (Statistic != nullptr) delete Statistic; + +} + +void PlayFab::AdminModels::FUpdatePlayerStatisticDefinitionResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Statistic.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Statistic")); Statistic->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdatePlayerStatisticDefinitionResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticValue = obj->TryGetField(TEXT("Statistic")); + if (StatisticValue.IsValid() && !StatisticValue->IsNull()) + { + Statistic = MakeShareable(new FPlayerStatisticDefinition(StatisticValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdatePolicyRequest::~FUpdatePolicyRequest() +{ + +} + +void PlayFab::AdminModels::FUpdatePolicyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("OverwritePolicy")); writer->WriteValue(OverwritePolicy); + + writer->WriteIdentifierPrefix(TEXT("PolicyName")); writer->WriteValue(PolicyName); + + writer->WriteArrayStart(TEXT("Statements")); + for (const FPermissionStatement& item : Statements) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdatePolicyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OverwritePolicyValue = obj->TryGetField(TEXT("OverwritePolicy")); + if (OverwritePolicyValue.IsValid() && !OverwritePolicyValue->IsNull()) + { + bool TmpValue; + if (OverwritePolicyValue->TryGetBool(TmpValue)) { OverwritePolicy = TmpValue; } + } + + const TSharedPtr PolicyNameValue = obj->TryGetField(TEXT("PolicyName")); + if (PolicyNameValue.IsValid() && !PolicyNameValue->IsNull()) + { + FString TmpValue; + if (PolicyNameValue->TryGetString(TmpValue)) { PolicyName = TmpValue; } + } + + const TArray>&StatementsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statements")); + for (int32 Idx = 0; Idx < StatementsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatementsArray[Idx]; + Statements.Add(FPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdatePolicyResponse::~FUpdatePolicyResponse() +{ + +} + +void PlayFab::AdminModels::FUpdatePolicyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PolicyName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PolicyName")); writer->WriteValue(PolicyName); } + + if (Statements.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statements")); + for (const FPermissionStatement& item : Statements) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdatePolicyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PolicyNameValue = obj->TryGetField(TEXT("PolicyName")); + if (PolicyNameValue.IsValid() && !PolicyNameValue->IsNull()) + { + FString TmpValue; + if (PolicyNameValue->TryGetString(TmpValue)) { PolicyName = TmpValue; } + } + + const TArray>&StatementsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statements")); + for (int32 Idx = 0; Idx < StatementsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatementsArray[Idx]; + Statements.Add(FPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateRandomResultTablesRequest::~FUpdateRandomResultTablesRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateRandomResultTablesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (Tables.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tables")); + for (const FRandomResultTable& item : Tables) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateRandomResultTablesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TArray>&TablesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Tables")); + for (int32 Idx = 0; Idx < TablesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = TablesArray[Idx]; + Tables.Add(FRandomResultTable(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateRandomResultTablesResult::~FUpdateRandomResultTablesResult() +{ + +} + +void PlayFab::AdminModels::FUpdateRandomResultTablesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateRandomResultTablesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateStoreItemsRequest::~FUpdateStoreItemsRequest() +{ + //if (MarketingData != nullptr) delete MarketingData; + +} + +void PlayFab::AdminModels::FUpdateStoreItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (MarketingData.IsValid()) { writer->WriteIdentifierPrefix(TEXT("MarketingData")); MarketingData->writeJSON(writer); } + + if (Store.Num() != 0) + { + writer->WriteArrayStart(TEXT("Store")); + for (const FStoreItem& item : Store) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateStoreItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr MarketingDataValue = obj->TryGetField(TEXT("MarketingData")); + if (MarketingDataValue.IsValid() && !MarketingDataValue->IsNull()) + { + MarketingData = MakeShareable(new FStoreMarketingModel(MarketingDataValue->AsObject())); + } + + const TArray>&StoreArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Store")); + for (int32 Idx = 0; Idx < StoreArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StoreArray[Idx]; + Store.Add(FStoreItem(CurrentItem->AsObject())); + } + + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateStoreItemsResult::~FUpdateStoreItemsResult() +{ + +} + +void PlayFab::AdminModels::FUpdateStoreItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateStoreItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateTaskRequest::~FUpdateTaskRequest() +{ + //if (Identifier != nullptr) delete Identifier; + +} + +void PlayFab::AdminModels::FUpdateTaskRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (Identifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Identifier")); Identifier->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); + + if (Parameter.notNull()) { writer->WriteIdentifierPrefix(TEXT("Parameter")); Parameter.writeJSON(writer); } + + if (Schedule.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Schedule")); writer->WriteValue(Schedule); } + + writer->WriteIdentifierPrefix(TEXT("Type")); writeScheduledTaskTypeEnumJSON(Type, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateTaskRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr IdentifierValue = obj->TryGetField(TEXT("Identifier")); + if (IdentifierValue.IsValid() && !IdentifierValue->IsNull()) + { + Identifier = MakeShareable(new FNameIdentifier(IdentifierValue->AsObject())); + } + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr ParameterValue = obj->TryGetField(TEXT("Parameter")); + if (ParameterValue.IsValid() && !ParameterValue->IsNull()) + { + Parameter = FJsonKeeper(ParameterValue); + } + + const TSharedPtr ScheduleValue = obj->TryGetField(TEXT("Schedule")); + if (ScheduleValue.IsValid() && !ScheduleValue->IsNull()) + { + FString TmpValue; + if (ScheduleValue->TryGetString(TmpValue)) { Schedule = TmpValue; } + } + + Type = readScheduledTaskTypeFromValue(obj->TryGetField(TEXT("Type"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateUserDataRequest::~FUpdateUserDataRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateUserDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateUserDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateUserDataResult::~FUpdateUserDataResult() +{ + +} + +void PlayFab::AdminModels::FUpdateUserDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateUserDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateUserInternalDataRequest::~FUpdateUserInternalDataRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateUserInternalDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateUserInternalDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateUserTitleDisplayNameRequest::~FUpdateUserTitleDisplayNameRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateUserTitleDisplayNameRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateUserTitleDisplayNameRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateUserTitleDisplayNameResult::~FUpdateUserTitleDisplayNameResult() +{ + +} + +void PlayFab::AdminModels::FUpdateUserTitleDisplayNameResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateUserTitleDisplayNameResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + return HasSucceeded; +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAuthenticationAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAuthenticationAPI.cpp new file mode 100644 index 000000000..1c980fdae --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAuthenticationAPI.cpp @@ -0,0 +1,73 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabAuthenticationAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::AuthenticationModels; + +UPlayFabAuthenticationAPI::UPlayFabAuthenticationAPI() {} + +UPlayFabAuthenticationAPI::~UPlayFabAuthenticationAPI() {} + +int UPlayFabAuthenticationAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabAuthenticationAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabAuthenticationAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabAuthenticationAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabAuthenticationAPI::GetEntityToken( + AuthenticationModels::FGetEntityTokenRequest& request, + const FGetEntityTokenDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + FString authKey; FString authValue; + if (PlayFabSettings::GetEntityToken().Len() > 0) { + authKey = TEXT("X-EntityToken"); authValue = PlayFabSettings::GetEntityToken(); + } else if (PlayFabSettings::GetClientSessionTicket().Len() > 0) { + authKey = TEXT("X-Authorization"); authValue = PlayFabSettings::GetClientSessionTicket(); + } else if (PlayFabSettings::GetDeveloperSecretKey().Len() > 0) { + authKey = TEXT("X-SecretKey"); authValue = PlayFabSettings::GetDeveloperSecretKey(); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Authentication/GetEntityToken")), request.toJSONString(), authKey, authValue); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAuthenticationAPI::OnGetEntityTokenResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAuthenticationAPI::OnGetEntityTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetEntityTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AuthenticationModels::FGetEntityTokenResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.EntityToken.Len() > 0) + PlayFabSettings::SetEntityToken(outResult.EntityToken); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAuthenticationDataModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAuthenticationDataModels.cpp new file mode 100644 index 000000000..1984f34b2 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAuthenticationDataModels.cpp @@ -0,0 +1,122 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabAuthenticationDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::AuthenticationModels; + +PlayFab::AuthenticationModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::AuthenticationModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AuthenticationModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AuthenticationModels::FGetEntityTokenRequest::~FGetEntityTokenRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::AuthenticationModels::FGetEntityTokenRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AuthenticationModels::FGetEntityTokenRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AuthenticationModels::FGetEntityTokenResponse::~FGetEntityTokenResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::AuthenticationModels::FGetEntityTokenResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + if (EntityToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EntityToken")); writer->WriteValue(EntityToken); } + + if (TokenExpiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("TokenExpiration")); writeDatetime(TokenExpiration, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AuthenticationModels::FGetEntityTokenResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr EntityTokenValue = obj->TryGetField(TEXT("EntityToken")); + if (EntityTokenValue.IsValid() && !EntityTokenValue->IsNull()) + { + FString TmpValue; + if (EntityTokenValue->TryGetString(TmpValue)) { EntityToken = TmpValue; } + } + + const TSharedPtr TokenExpirationValue = obj->TryGetField(TEXT("TokenExpiration")); + if (TokenExpirationValue.IsValid()) + TokenExpiration = readDatetime(TokenExpirationValue); + + + return HasSucceeded; +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabBaseModel.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabBaseModel.cpp new file mode 100644 index 000000000..6c1de5da9 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabBaseModel.cpp @@ -0,0 +1,110 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFabBaseModel.h" +#include "PlayFab.h" + +using namespace PlayFab; + +FString FPlayFabBaseModel::toJSONString() const +{ + FString JsonOutString; + JsonWriter Json = TJsonWriterFactory >::Create(&JsonOutString); + writeJSON(Json); + + if (Json->Close()) + { + // write log here + } + + return JsonOutString; +} + +void FJsonKeeper::writeJSON(JsonWriter& writer) const +{ + switch (JsonValue->Type) + { + case EJson::None: + { + break; + } + case EJson::Array: + { + writer->WriteArrayStart(); + for (auto Elem : JsonValue->AsArray()) + { + FJsonKeeper(Elem).writeJSON(writer); + } + writer->WriteArrayEnd(); + break; + } + case EJson::Boolean: + { + writer->WriteValue(JsonValue->AsBool()); + break; + } + case EJson::Number: + { + writer->WriteValue(JsonValue->AsNumber()); + break; + } + case EJson::Object: + { + writer->WriteObjectStart(); + for (auto Elem : JsonValue->AsObject()->Values) + { + writer->WriteIdentifierPrefix(Elem.Key); + FJsonKeeper(Elem.Value).writeJSON(writer); + } + writer->WriteObjectEnd(); + break; + } + case EJson::String: + { + writer->WriteValue(JsonValue->AsString()); + break; + } + case EJson::Null: + { + writer->WriteNull(); + break; + } + default: + { + break; + } + } +} + +bool FJsonKeeper::readFromValue(const TSharedPtr& obj) +{ + return false; +} + +bool FJsonKeeper::readFromValue(const TSharedPtr& value) +{ + if (value.IsValid()) + { + JsonValue = value.ToSharedRef(); + } + return true; +} + +void PlayFab::writeDatetime(FDateTime datetime, JsonWriter& writer) +{ + writer->WriteValue(datetime.ToIso8601()); +} + +FDateTime PlayFab::readDatetime(const TSharedPtr& value) +{ + FDateTime DateTimeOut; + FString DateString = value->AsString(); + if (!FDateTime::ParseIso8601(*DateString, DateTimeOut)) + { + UE_LOG(LogPlayFab, Error, TEXT("readDatetime - Unable to import FDateTime from Iso8601 String")); + } + + return DateTimeOut; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabClientAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabClientAPI.cpp new file mode 100644 index 000000000..581143277 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabClientAPI.cpp @@ -0,0 +1,4062 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabClientAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::ClientModels; + +UPlayFabClientAPI::UPlayFabClientAPI() {} + +UPlayFabClientAPI::~UPlayFabClientAPI() {} + +int UPlayFabClientAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabClientAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabClientAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +bool UPlayFabClientAPI::SetAdvertId(const FString& advertisingIdType, const FString& advertisingIdValue) +{ + // TODO: Work on exposing PlayFabSettings::AD_TYPE_X vars, for now, just validate against them + bool valid = advertisingIdType == PlayFabSettings::AD_TYPE_IDFA || advertisingIdType == PlayFabSettings::AD_TYPE_ANDROID_ID; + if (valid) + { + PlayFabSettings::SetAdvertisingIdType(advertisingIdType); + PlayFabSettings::SetAdvertisingIdValue(advertisingIdValue); + } + return valid; +} + +bool UPlayFabClientAPI::AdvertIdSuccessful() +{ + return PlayFabSettings::GetAdvertisingIdType().EndsWith("_Successful"); +} + +bool UPlayFabClientAPI::IsClientLoggedIn() const +{ + return !PlayFabSettings::GetClientSessionTicket().IsEmpty(); +} + +void UPlayFabClientAPI::MultiStepClientLogin(bool needsAttribution) +{ + if (needsAttribution && !PlayFabSettings::GetDisableAdvertising() && !PlayFabSettings::GetAdvertisingIdType().IsEmpty() && !PlayFabSettings::GetAdvertisingIdValue().IsEmpty()) + { + PlayFab::ClientModels::FAttributeInstallRequest request; + if (PlayFabSettings::GetAdvertisingIdType() == PlayFabSettings::AD_TYPE_IDFA) + request.Idfa = PlayFabSettings::GetAdvertisingIdValue(); + else if (PlayFabSettings::GetAdvertisingIdType() == PlayFabSettings::AD_TYPE_ANDROID_ID) + request.Adid = PlayFabSettings::GetAdvertisingIdValue(); + else + return; + AttributeInstall(request); + } +} + +void UPlayFabClientAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabClientAPI::AcceptTrade( + ClientModels::FAcceptTradeRequest& request, + const FAcceptTradeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AcceptTrade")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAcceptTradeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAcceptTradeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAcceptTradeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAcceptTradeResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AddFriend( + ClientModels::FAddFriendRequest& request, + const FAddFriendDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AddFriend")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAddFriendResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAddFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAddFriendResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AddGenericID( + ClientModels::FAddGenericIDRequest& request, + const FAddGenericIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AddGenericID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAddGenericIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAddGenericIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddGenericIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAddGenericIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AddOrUpdateContactEmail( + ClientModels::FAddOrUpdateContactEmailRequest& request, + const FAddOrUpdateContactEmailDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AddOrUpdateContactEmail")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAddOrUpdateContactEmailResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAddOrUpdateContactEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddOrUpdateContactEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAddOrUpdateContactEmailResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AddSharedGroupMembers( + ClientModels::FAddSharedGroupMembersRequest& request, + const FAddSharedGroupMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AddSharedGroupMembers")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAddSharedGroupMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAddSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAddSharedGroupMembersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AddUsernamePassword( + ClientModels::FAddUsernamePasswordRequest& request, + const FAddUsernamePasswordDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AddUsernamePassword")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAddUsernamePasswordResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAddUsernamePasswordResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUsernamePasswordDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAddUsernamePasswordResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AddUserVirtualCurrency( + ClientModels::FAddUserVirtualCurrencyRequest& request, + const FAddUserVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AddUserVirtualCurrency")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAddUserVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAddUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FModifyUserVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AndroidDevicePushNotificationRegistration( + ClientModels::FAndroidDevicePushNotificationRegistrationRequest& request, + const FAndroidDevicePushNotificationRegistrationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AndroidDevicePushNotificationRegistration")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAndroidDevicePushNotificationRegistrationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAndroidDevicePushNotificationRegistrationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAndroidDevicePushNotificationRegistrationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAndroidDevicePushNotificationRegistrationResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AttributeInstall( + ClientModels::FAttributeInstallRequest& request, + const FAttributeInstallDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AttributeInstall")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAttributeInstallResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAttributeInstallResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAttributeInstallDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAttributeInstallResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + // Modify advertisingIdType: Prevents us from sending the id multiple times, and allows automated tests to determine id was sent successfully + PlayFabSettings::SetAdvertisingIdType(PlayFabSettings::GetAdvertisingIdType() + "_Successful"); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::CancelTrade( + ClientModels::FCancelTradeRequest& request, + const FCancelTradeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/CancelTrade")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnCancelTradeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnCancelTradeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCancelTradeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FCancelTradeResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ConfirmPurchase( + ClientModels::FConfirmPurchaseRequest& request, + const FConfirmPurchaseDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ConfirmPurchase")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnConfirmPurchaseResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnConfirmPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConfirmPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FConfirmPurchaseResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ConsumeItem( + ClientModels::FConsumeItemRequest& request, + const FConsumeItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ConsumeItem")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnConsumeItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnConsumeItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConsumeItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FConsumeItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ConsumeXboxEntitlements( + ClientModels::FConsumeXboxEntitlementsRequest& request, + const FConsumeXboxEntitlementsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ConsumeXboxEntitlements")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnConsumeXboxEntitlementsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnConsumeXboxEntitlementsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConsumeXboxEntitlementsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FConsumeXboxEntitlementsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::CreateSharedGroup( + ClientModels::FCreateSharedGroupRequest& request, + const FCreateSharedGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/CreateSharedGroup")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnCreateSharedGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnCreateSharedGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateSharedGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FCreateSharedGroupResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ExecuteCloudScript( + ClientModels::FExecuteCloudScriptRequest& request, + const FExecuteCloudScriptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ExecuteCloudScript")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnExecuteCloudScriptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnExecuteCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExecuteCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FExecuteCloudScriptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetAccountInfo( + ClientModels::FGetAccountInfoRequest& request, + const FGetAccountInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetAccountInfo")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetAccountInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetAccountInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAccountInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetAccountInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetAllUsersCharacters( + ClientModels::FListUsersCharactersRequest& request, + const FGetAllUsersCharactersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetAllUsersCharacters")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetAllUsersCharactersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetAllUsersCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllUsersCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FListUsersCharactersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCatalogItems( + ClientModels::FGetCatalogItemsRequest& request, + const FGetCatalogItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCatalogItems")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCatalogItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetCatalogItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCharacterData( + ClientModels::FGetCharacterDataRequest& request, + const FGetCharacterDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCharacterData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCharacterDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCharacterInventory( + ClientModels::FGetCharacterInventoryRequest& request, + const FGetCharacterInventoryDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCharacterInventory")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCharacterInventoryResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCharacterInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetCharacterInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCharacterLeaderboard( + ClientModels::FGetCharacterLeaderboardRequest& request, + const FGetCharacterLeaderboardDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCharacterLeaderboard")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCharacterLeaderboardResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCharacterLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetCharacterLeaderboardResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCharacterReadOnlyData( + ClientModels::FGetCharacterDataRequest& request, + const FGetCharacterReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCharacterReadOnlyData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCharacterReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCharacterReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCharacterStatistics( + ClientModels::FGetCharacterStatisticsRequest& request, + const FGetCharacterStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCharacterStatistics")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCharacterStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetCharacterStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetContentDownloadUrl( + ClientModels::FGetContentDownloadUrlRequest& request, + const FGetContentDownloadUrlDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetContentDownloadUrl")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetContentDownloadUrlResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetContentDownloadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentDownloadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetContentDownloadUrlResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCurrentGames( + ClientModels::FCurrentGamesRequest& request, + const FGetCurrentGamesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCurrentGames")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCurrentGamesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCurrentGamesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCurrentGamesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FCurrentGamesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetFriendLeaderboard( + ClientModels::FGetFriendLeaderboardRequest& request, + const FGetFriendLeaderboardDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetFriendLeaderboard")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetFriendLeaderboardResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetFriendLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetLeaderboardResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetFriendLeaderboardAroundPlayer( + ClientModels::FGetFriendLeaderboardAroundPlayerRequest& request, + const FGetFriendLeaderboardAroundPlayerDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetFriendLeaderboardAroundPlayer")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetFriendLeaderboardAroundPlayerResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetFriendLeaderboardAroundPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendLeaderboardAroundPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetFriendLeaderboardAroundPlayerResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetFriendsList( + ClientModels::FGetFriendsListRequest& request, + const FGetFriendsListDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetFriendsList")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetFriendsListResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetFriendsListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendsListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetFriendsListResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetGameServerRegions( + ClientModels::FGameServerRegionsRequest& request, + const FGetGameServerRegionsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetGameServerRegions")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetGameServerRegionsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetGameServerRegionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetGameServerRegionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGameServerRegionsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetLeaderboard( + ClientModels::FGetLeaderboardRequest& request, + const FGetLeaderboardDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetLeaderboard")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetLeaderboardResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetLeaderboardResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetLeaderboardAroundCharacter( + ClientModels::FGetLeaderboardAroundCharacterRequest& request, + const FGetLeaderboardAroundCharacterDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetLeaderboardAroundCharacter")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetLeaderboardAroundCharacterResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetLeaderboardAroundCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetLeaderboardAroundCharacterResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetLeaderboardAroundPlayer( + ClientModels::FGetLeaderboardAroundPlayerRequest& request, + const FGetLeaderboardAroundPlayerDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetLeaderboardAroundPlayer")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetLeaderboardAroundPlayerResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetLeaderboardAroundPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetLeaderboardAroundPlayerResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetLeaderboardForUserCharacters( + ClientModels::FGetLeaderboardForUsersCharactersRequest& request, + const FGetLeaderboardForUserCharactersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetLeaderboardForUserCharacters")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetLeaderboardForUserCharactersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetLeaderboardForUserCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardForUserCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetLeaderboardForUsersCharactersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPaymentToken( + ClientModels::FGetPaymentTokenRequest& request, + const FGetPaymentTokenDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPaymentToken")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPaymentTokenResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPaymentTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPaymentTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPaymentTokenResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPhotonAuthenticationToken( + ClientModels::FGetPhotonAuthenticationTokenRequest& request, + const FGetPhotonAuthenticationTokenDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPhotonAuthenticationToken")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPhotonAuthenticationTokenResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPhotonAuthenticationTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPhotonAuthenticationTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPhotonAuthenticationTokenResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerCombinedInfo( + ClientModels::FGetPlayerCombinedInfoRequest& request, + const FGetPlayerCombinedInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerCombinedInfo")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerCombinedInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerCombinedInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerCombinedInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerCombinedInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerProfile( + ClientModels::FGetPlayerProfileRequest& request, + const FGetPlayerProfileDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerProfile")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerProfileResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerProfileResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerSegments( + + const FGetPlayerSegmentsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerSegments")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerSegmentsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerSegmentsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerStatistics( + ClientModels::FGetPlayerStatisticsRequest& request, + const FGetPlayerStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerStatistics")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerStatisticVersions( + ClientModels::FGetPlayerStatisticVersionsRequest& request, + const FGetPlayerStatisticVersionsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerStatisticVersions")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerStatisticVersionsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerStatisticVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerStatisticVersionsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerTags( + ClientModels::FGetPlayerTagsRequest& request, + const FGetPlayerTagsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerTags")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerTagsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerTagsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerTrades( + ClientModels::FGetPlayerTradesRequest& request, + const FGetPlayerTradesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerTrades")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerTradesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerTradesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTradesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerTradesResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromFacebookIDs( + ClientModels::FGetPlayFabIDsFromFacebookIDsRequest& request, + const FGetPlayFabIDsFromFacebookIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromFacebookIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromFacebookIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromFacebookIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromFacebookIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromFacebookInstantGamesIds( + ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest& request, + const FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromFacebookInstantGamesIds")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromFacebookInstantGamesIdsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromFacebookInstantGamesIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromGameCenterIDs( + ClientModels::FGetPlayFabIDsFromGameCenterIDsRequest& request, + const FGetPlayFabIDsFromGameCenterIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromGameCenterIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromGameCenterIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromGameCenterIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromGameCenterIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromGameCenterIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromGenericIDs( + ClientModels::FGetPlayFabIDsFromGenericIDsRequest& request, + const FGetPlayFabIDsFromGenericIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromGenericIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromGenericIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromGenericIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromGenericIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromGenericIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromGoogleIDs( + ClientModels::FGetPlayFabIDsFromGoogleIDsRequest& request, + const FGetPlayFabIDsFromGoogleIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromGoogleIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromGoogleIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromGoogleIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromGoogleIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromGoogleIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromKongregateIDs( + ClientModels::FGetPlayFabIDsFromKongregateIDsRequest& request, + const FGetPlayFabIDsFromKongregateIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromKongregateIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromKongregateIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromKongregateIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromKongregateIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromKongregateIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromNintendoSwitchDeviceIds( + ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& request, + const FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromNintendoSwitchDeviceIds")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromSteamIDs( + ClientModels::FGetPlayFabIDsFromSteamIDsRequest& request, + const FGetPlayFabIDsFromSteamIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromSteamIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromSteamIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromSteamIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromSteamIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromSteamIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromTwitchIDs( + ClientModels::FGetPlayFabIDsFromTwitchIDsRequest& request, + const FGetPlayFabIDsFromTwitchIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromTwitchIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromTwitchIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromTwitchIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromTwitchIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromTwitchIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPublisherData( + ClientModels::FGetPublisherDataRequest& request, + const FGetPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPublisherData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPublisherDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPurchase( + ClientModels::FGetPurchaseRequest& request, + const FGetPurchaseDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPurchase")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPurchaseResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPurchaseResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetSharedGroupData( + ClientModels::FGetSharedGroupDataRequest& request, + const FGetSharedGroupDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetSharedGroupData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetSharedGroupDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetSharedGroupDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetStoreItems( + ClientModels::FGetStoreItemsRequest& request, + const FGetStoreItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetStoreItems")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetStoreItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetStoreItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetTime( + + const FGetTimeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetTime")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetTimeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetTimeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTimeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetTimeResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetTitleData( + ClientModels::FGetTitleDataRequest& request, + const FGetTitleDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetTitleData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetTitleDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetTitleNews( + ClientModels::FGetTitleNewsRequest& request, + const FGetTitleNewsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetTitleNews")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetTitleNewsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetTitleNewsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleNewsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetTitleNewsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetTitlePublicKey( + ClientModels::FGetTitlePublicKeyRequest& request, + const FGetTitlePublicKeyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetTitlePublicKey")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetTitlePublicKeyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetTitlePublicKeyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitlePublicKeyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetTitlePublicKeyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetTradeStatus( + ClientModels::FGetTradeStatusRequest& request, + const FGetTradeStatusDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetTradeStatus")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetTradeStatusResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetTradeStatusResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTradeStatusDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetTradeStatusResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetUserData( + ClientModels::FGetUserDataRequest& request, + const FGetUserDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetUserData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetUserDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetUserInventory( + + const FGetUserInventoryDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetUserInventory")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetUserInventoryResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetUserInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetUserInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetUserPublisherData( + ClientModels::FGetUserDataRequest& request, + const FGetUserPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetUserPublisherData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetUserPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetUserPublisherReadOnlyData( + ClientModels::FGetUserDataRequest& request, + const FGetUserPublisherReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetUserPublisherReadOnlyData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetUserPublisherReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetUserReadOnlyData( + ClientModels::FGetUserDataRequest& request, + const FGetUserReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetUserReadOnlyData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetUserReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetWindowsHelloChallenge( + ClientModels::FGetWindowsHelloChallengeRequest& request, + const FGetWindowsHelloChallengeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetWindowsHelloChallenge")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetWindowsHelloChallengeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetWindowsHelloChallengeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetWindowsHelloChallengeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetWindowsHelloChallengeResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GrantCharacterToUser( + ClientModels::FGrantCharacterToUserRequest& request, + const FGrantCharacterToUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GrantCharacterToUser")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGrantCharacterToUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGrantCharacterToUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantCharacterToUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGrantCharacterToUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkAndroidDeviceID( + ClientModels::FLinkAndroidDeviceIDRequest& request, + const FLinkAndroidDeviceIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkAndroidDeviceID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkAndroidDeviceIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkAndroidDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkAndroidDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkAndroidDeviceIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkCustomID( + ClientModels::FLinkCustomIDRequest& request, + const FLinkCustomIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkCustomID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkCustomIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkCustomIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkCustomIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkCustomIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkFacebookAccount( + ClientModels::FLinkFacebookAccountRequest& request, + const FLinkFacebookAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkFacebookAccount")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkFacebookAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkFacebookAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkFacebookAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkFacebookAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkFacebookInstantGamesId( + ClientModels::FLinkFacebookInstantGamesIdRequest& request, + const FLinkFacebookInstantGamesIdDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkFacebookInstantGamesId")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkFacebookInstantGamesIdResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkFacebookInstantGamesIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkFacebookInstantGamesIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkFacebookInstantGamesIdResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkGameCenterAccount( + ClientModels::FLinkGameCenterAccountRequest& request, + const FLinkGameCenterAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkGameCenterAccount")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkGameCenterAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkGameCenterAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkGameCenterAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkGameCenterAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkGoogleAccount( + ClientModels::FLinkGoogleAccountRequest& request, + const FLinkGoogleAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkGoogleAccount")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkGoogleAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkGoogleAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkGoogleAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkGoogleAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkIOSDeviceID( + ClientModels::FLinkIOSDeviceIDRequest& request, + const FLinkIOSDeviceIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkIOSDeviceID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkIOSDeviceIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkIOSDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkIOSDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkIOSDeviceIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkKongregate( + ClientModels::FLinkKongregateAccountRequest& request, + const FLinkKongregateDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkKongregate")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkKongregateResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkKongregateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkKongregateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkKongregateAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkNintendoSwitchDeviceId( + ClientModels::FLinkNintendoSwitchDeviceIdRequest& request, + const FLinkNintendoSwitchDeviceIdDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkNintendoSwitchDeviceId")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkNintendoSwitchDeviceIdResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkNintendoSwitchDeviceIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkNintendoSwitchDeviceIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkNintendoSwitchDeviceIdResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkSteamAccount( + ClientModels::FLinkSteamAccountRequest& request, + const FLinkSteamAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkSteamAccount")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkSteamAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkSteamAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkSteamAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkSteamAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkTwitch( + ClientModels::FLinkTwitchAccountRequest& request, + const FLinkTwitchDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkTwitch")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkTwitchResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkTwitchResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkTwitchDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkTwitchAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkWindowsHello( + ClientModels::FLinkWindowsHelloAccountRequest& request, + const FLinkWindowsHelloDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkWindowsHello")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkWindowsHelloResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkWindowsHelloAccountResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkXboxAccount( + ClientModels::FLinkXboxAccountRequest& request, + const FLinkXboxAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkXboxAccount")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkXboxAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkXboxAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkXboxAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkXboxAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithAndroidDeviceID( + ClientModels::FLoginWithAndroidDeviceIDRequest& request, + const FLoginWithAndroidDeviceIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithAndroidDeviceID")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithAndroidDeviceIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithAndroidDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithAndroidDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithCustomID( + ClientModels::FLoginWithCustomIDRequest& request, + const FLoginWithCustomIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithCustomID")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithCustomIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithCustomIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithCustomIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithEmailAddress( + ClientModels::FLoginWithEmailAddressRequest& request, + const FLoginWithEmailAddressDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithEmailAddress")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithEmailAddressResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithEmailAddressResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithEmailAddressDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithFacebook( + ClientModels::FLoginWithFacebookRequest& request, + const FLoginWithFacebookDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithFacebook")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithFacebookResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithFacebookResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithFacebookDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithFacebookInstantGamesId( + ClientModels::FLoginWithFacebookInstantGamesIdRequest& request, + const FLoginWithFacebookInstantGamesIdDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithFacebookInstantGamesId")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithFacebookInstantGamesIdResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithFacebookInstantGamesIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithFacebookInstantGamesIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithGameCenter( + ClientModels::FLoginWithGameCenterRequest& request, + const FLoginWithGameCenterDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithGameCenter")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithGameCenterResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithGameCenterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithGameCenterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithGoogleAccount( + ClientModels::FLoginWithGoogleAccountRequest& request, + const FLoginWithGoogleAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithGoogleAccount")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithGoogleAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithGoogleAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithGoogleAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithIOSDeviceID( + ClientModels::FLoginWithIOSDeviceIDRequest& request, + const FLoginWithIOSDeviceIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithIOSDeviceID")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithIOSDeviceIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithIOSDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithIOSDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithKongregate( + ClientModels::FLoginWithKongregateRequest& request, + const FLoginWithKongregateDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithKongregate")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithKongregateResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithKongregateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithKongregateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithNintendoSwitchDeviceId( + ClientModels::FLoginWithNintendoSwitchDeviceIdRequest& request, + const FLoginWithNintendoSwitchDeviceIdDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithNintendoSwitchDeviceId")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithNintendoSwitchDeviceIdResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithNintendoSwitchDeviceIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithNintendoSwitchDeviceIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithPlayFab( + ClientModels::FLoginWithPlayFabRequest& request, + const FLoginWithPlayFabDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithPlayFab")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithPlayFabResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithPlayFabResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithPlayFabDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithSteam( + ClientModels::FLoginWithSteamRequest& request, + const FLoginWithSteamDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithSteam")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithSteamResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithSteamResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithSteamDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithTwitch( + ClientModels::FLoginWithTwitchRequest& request, + const FLoginWithTwitchDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithTwitch")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithTwitchResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithTwitchResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithTwitchDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithWindowsHello( + ClientModels::FLoginWithWindowsHelloRequest& request, + const FLoginWithWindowsHelloDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithWindowsHello")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithWindowsHelloResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithXbox( + ClientModels::FLoginWithXboxRequest& request, + const FLoginWithXboxDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithXbox")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithXboxResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithXboxResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithXboxDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::Matchmake( + ClientModels::FMatchmakeRequest& request, + const FMatchmakeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/Matchmake")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnMatchmakeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnMatchmakeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMatchmakeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FMatchmakeResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::OpenTrade( + ClientModels::FOpenTradeRequest& request, + const FOpenTradeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/OpenTrade")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnOpenTradeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnOpenTradeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FOpenTradeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FOpenTradeResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::PayForPurchase( + ClientModels::FPayForPurchaseRequest& request, + const FPayForPurchaseDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/PayForPurchase")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnPayForPurchaseResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnPayForPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPayForPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FPayForPurchaseResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::PurchaseItem( + ClientModels::FPurchaseItemRequest& request, + const FPurchaseItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/PurchaseItem")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnPurchaseItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnPurchaseItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPurchaseItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FPurchaseItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RedeemCoupon( + ClientModels::FRedeemCouponRequest& request, + const FRedeemCouponDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RedeemCoupon")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRedeemCouponResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRedeemCouponResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRedeemCouponDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRedeemCouponResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RegisterForIOSPushNotification( + ClientModels::FRegisterForIOSPushNotificationRequest& request, + const FRegisterForIOSPushNotificationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RegisterForIOSPushNotification")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRegisterForIOSPushNotificationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRegisterForIOSPushNotificationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterForIOSPushNotificationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRegisterForIOSPushNotificationResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RegisterPlayFabUser( + ClientModels::FRegisterPlayFabUserRequest& request, + const FRegisterPlayFabUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RegisterPlayFabUser")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRegisterPlayFabUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRegisterPlayFabUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterPlayFabUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRegisterPlayFabUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) + PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RegisterWithWindowsHello( + ClientModels::FRegisterWithWindowsHelloRequest& request, + const FRegisterWithWindowsHelloDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RegisterWithWindowsHello")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRegisterWithWindowsHelloResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRegisterWithWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterWithWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RemoveContactEmail( + + const FRemoveContactEmailDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RemoveContactEmail")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRemoveContactEmailResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRemoveContactEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveContactEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRemoveContactEmailResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RemoveFriend( + ClientModels::FRemoveFriendRequest& request, + const FRemoveFriendDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RemoveFriend")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRemoveFriendResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRemoveFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRemoveFriendResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RemoveGenericID( + ClientModels::FRemoveGenericIDRequest& request, + const FRemoveGenericIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RemoveGenericID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRemoveGenericIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRemoveGenericIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveGenericIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRemoveGenericIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RemoveSharedGroupMembers( + ClientModels::FRemoveSharedGroupMembersRequest& request, + const FRemoveSharedGroupMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RemoveSharedGroupMembers")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRemoveSharedGroupMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRemoveSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRemoveSharedGroupMembersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ReportDeviceInfo( + ClientModels::FDeviceInfoRequest& request, + const FReportDeviceInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ReportDeviceInfo")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnReportDeviceInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnReportDeviceInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FReportDeviceInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ReportPlayer( + ClientModels::FReportPlayerClientRequest& request, + const FReportPlayerDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ReportPlayer")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnReportPlayerResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnReportPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FReportPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FReportPlayerClientResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RestoreIOSPurchases( + ClientModels::FRestoreIOSPurchasesRequest& request, + const FRestoreIOSPurchasesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RestoreIOSPurchases")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRestoreIOSPurchasesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRestoreIOSPurchasesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRestoreIOSPurchasesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRestoreIOSPurchasesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::SendAccountRecoveryEmail( + ClientModels::FSendAccountRecoveryEmailRequest& request, + const FSendAccountRecoveryEmailDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/SendAccountRecoveryEmail")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnSendAccountRecoveryEmailResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnSendAccountRecoveryEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendAccountRecoveryEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FSendAccountRecoveryEmailResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::SetFriendTags( + ClientModels::FSetFriendTagsRequest& request, + const FSetFriendTagsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/SetFriendTags")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnSetFriendTagsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnSetFriendTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetFriendTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FSetFriendTagsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::SetPlayerSecret( + ClientModels::FSetPlayerSecretRequest& request, + const FSetPlayerSecretDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/SetPlayerSecret")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnSetPlayerSecretResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnSetPlayerSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPlayerSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FSetPlayerSecretResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::StartGame( + ClientModels::FStartGameRequest& request, + const FStartGameDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/StartGame")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnStartGameResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnStartGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FStartGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FStartGameResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::StartPurchase( + ClientModels::FStartPurchaseRequest& request, + const FStartPurchaseDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/StartPurchase")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnStartPurchaseResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnStartPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FStartPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FStartPurchaseResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::SubtractUserVirtualCurrency( + ClientModels::FSubtractUserVirtualCurrencyRequest& request, + const FSubtractUserVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/SubtractUserVirtualCurrency")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnSubtractUserVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnSubtractUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FModifyUserVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkAndroidDeviceID( + ClientModels::FUnlinkAndroidDeviceIDRequest& request, + const FUnlinkAndroidDeviceIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkAndroidDeviceID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkAndroidDeviceIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkAndroidDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkAndroidDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkAndroidDeviceIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkCustomID( + ClientModels::FUnlinkCustomIDRequest& request, + const FUnlinkCustomIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkCustomID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkCustomIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkCustomIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkCustomIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkCustomIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkFacebookAccount( + + const FUnlinkFacebookAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkFacebookAccount")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkFacebookAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkFacebookAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkFacebookAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkFacebookAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkFacebookInstantGamesId( + ClientModels::FUnlinkFacebookInstantGamesIdRequest& request, + const FUnlinkFacebookInstantGamesIdDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkFacebookInstantGamesId")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkFacebookInstantGamesIdResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkFacebookInstantGamesIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkFacebookInstantGamesIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkFacebookInstantGamesIdResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkGameCenterAccount( + + const FUnlinkGameCenterAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkGameCenterAccount")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkGameCenterAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkGameCenterAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkGameCenterAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkGameCenterAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkGoogleAccount( + + const FUnlinkGoogleAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkGoogleAccount")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkGoogleAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkGoogleAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkGoogleAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkGoogleAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkIOSDeviceID( + ClientModels::FUnlinkIOSDeviceIDRequest& request, + const FUnlinkIOSDeviceIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkIOSDeviceID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkIOSDeviceIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkIOSDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkIOSDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkIOSDeviceIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkKongregate( + + const FUnlinkKongregateDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkKongregate")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkKongregateResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkKongregateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkKongregateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkKongregateAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkNintendoSwitchDeviceId( + ClientModels::FUnlinkNintendoSwitchDeviceIdRequest& request, + const FUnlinkNintendoSwitchDeviceIdDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkNintendoSwitchDeviceId")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkNintendoSwitchDeviceIdResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkNintendoSwitchDeviceIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkNintendoSwitchDeviceIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkNintendoSwitchDeviceIdResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkSteamAccount( + + const FUnlinkSteamAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkSteamAccount")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkSteamAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkSteamAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkSteamAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkSteamAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkTwitch( + + const FUnlinkTwitchDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkTwitch")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkTwitchResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkTwitchResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkTwitchDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkTwitchAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkWindowsHello( + ClientModels::FUnlinkWindowsHelloAccountRequest& request, + const FUnlinkWindowsHelloDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkWindowsHello")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkWindowsHelloResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkWindowsHelloAccountResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkXboxAccount( + ClientModels::FUnlinkXboxAccountRequest& request, + const FUnlinkXboxAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkXboxAccount")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkXboxAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkXboxAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkXboxAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkXboxAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlockContainerInstance( + ClientModels::FUnlockContainerInstanceRequest& request, + const FUnlockContainerInstanceDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlockContainerInstance")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlockContainerInstanceResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlockContainerInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlockContainerItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlockContainerItem( + ClientModels::FUnlockContainerItemRequest& request, + const FUnlockContainerItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlockContainerItem")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlockContainerItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlockContainerItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlockContainerItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateAvatarUrl( + ClientModels::FUpdateAvatarUrlRequest& request, + const FUpdateAvatarUrlDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateAvatarUrl")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateAvatarUrlResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateAvatarUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateAvatarUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateCharacterData( + ClientModels::FUpdateCharacterDataRequest& request, + const FUpdateCharacterDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateCharacterData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateCharacterDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdateCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateCharacterStatistics( + ClientModels::FUpdateCharacterStatisticsRequest& request, + const FUpdateCharacterStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateCharacterStatistics")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateCharacterStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdateCharacterStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdatePlayerStatistics( + ClientModels::FUpdatePlayerStatisticsRequest& request, + const FUpdatePlayerStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdatePlayerStatistics")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdatePlayerStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdatePlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdatePlayerStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateSharedGroupData( + ClientModels::FUpdateSharedGroupDataRequest& request, + const FUpdateSharedGroupDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateSharedGroupData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateSharedGroupDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdateSharedGroupDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateUserData( + ClientModels::FUpdateUserDataRequest& request, + const FUpdateUserDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateUserData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateUserDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateUserPublisherData( + ClientModels::FUpdateUserDataRequest& request, + const FUpdateUserPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateUserPublisherData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateUserPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateUserTitleDisplayName( + ClientModels::FUpdateUserTitleDisplayNameRequest& request, + const FUpdateUserTitleDisplayNameDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateUserTitleDisplayName")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateUserTitleDisplayNameResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateUserTitleDisplayNameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserTitleDisplayNameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdateUserTitleDisplayNameResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ValidateAmazonIAPReceipt( + ClientModels::FValidateAmazonReceiptRequest& request, + const FValidateAmazonIAPReceiptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ValidateAmazonIAPReceipt")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnValidateAmazonIAPReceiptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnValidateAmazonIAPReceiptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateAmazonIAPReceiptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FValidateAmazonReceiptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ValidateGooglePlayPurchase( + ClientModels::FValidateGooglePlayPurchaseRequest& request, + const FValidateGooglePlayPurchaseDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ValidateGooglePlayPurchase")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnValidateGooglePlayPurchaseResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnValidateGooglePlayPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateGooglePlayPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FValidateGooglePlayPurchaseResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ValidateIOSReceipt( + ClientModels::FValidateIOSReceiptRequest& request, + const FValidateIOSReceiptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ValidateIOSReceipt")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnValidateIOSReceiptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnValidateIOSReceiptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateIOSReceiptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FValidateIOSReceiptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ValidateWindowsStoreReceipt( + ClientModels::FValidateWindowsReceiptRequest& request, + const FValidateWindowsStoreReceiptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ValidateWindowsStoreReceipt")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnValidateWindowsStoreReceiptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnValidateWindowsStoreReceiptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateWindowsStoreReceiptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FValidateWindowsReceiptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::WriteCharacterEvent( + ClientModels::FWriteClientCharacterEventRequest& request, + const FWriteCharacterEventDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/WriteCharacterEvent")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnWriteCharacterEventResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnWriteCharacterEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteCharacterEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FWriteEventResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::WritePlayerEvent( + ClientModels::FWriteClientPlayerEventRequest& request, + const FWritePlayerEventDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/WritePlayerEvent")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnWritePlayerEventResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnWritePlayerEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWritePlayerEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FWriteEventResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::WriteTitleEvent( + ClientModels::FWriteTitleEventRequest& request, + const FWriteTitleEventDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/WriteTitleEvent")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnWriteTitleEventResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnWriteTitleEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteTitleEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FWriteEventResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabClientDataModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabClientDataModels.cpp new file mode 100644 index 000000000..e7e737a2a --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabClientDataModels.cpp @@ -0,0 +1,17070 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabClientDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::ClientModels; + +PlayFab::ClientModels::FAcceptTradeRequest::~FAcceptTradeRequest() +{ + +} + +void PlayFab::ClientModels::FAcceptTradeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AcceptedInventoryInstanceIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("AcceptedInventoryInstanceIds")); + for (const FString& item : AcceptedInventoryInstanceIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("OfferingPlayerId")); writer->WriteValue(OfferingPlayerId); + + writer->WriteIdentifierPrefix(TEXT("TradeId")); writer->WriteValue(TradeId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAcceptTradeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("AcceptedInventoryInstanceIds"), AcceptedInventoryInstanceIds); + + const TSharedPtr OfferingPlayerIdValue = obj->TryGetField(TEXT("OfferingPlayerId")); + if (OfferingPlayerIdValue.IsValid() && !OfferingPlayerIdValue->IsNull()) + { + FString TmpValue; + if (OfferingPlayerIdValue->TryGetString(TmpValue)) { OfferingPlayerId = TmpValue; } + } + + const TSharedPtr TradeIdValue = obj->TryGetField(TEXT("TradeId")); + if (TradeIdValue.IsValid() && !TradeIdValue->IsNull()) + { + FString TmpValue; + if (TradeIdValue->TryGetString(TmpValue)) { TradeId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeTradeStatusEnumJSON(TradeStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case TradeStatusInvalid: writer->WriteValue(TEXT("Invalid")); break; + case TradeStatusOpening: writer->WriteValue(TEXT("Opening")); break; + case TradeStatusOpen: writer->WriteValue(TEXT("Open")); break; + case TradeStatusAccepting: writer->WriteValue(TEXT("Accepting")); break; + case TradeStatusAccepted: writer->WriteValue(TEXT("Accepted")); break; + case TradeStatusFilled: writer->WriteValue(TEXT("Filled")); break; + case TradeStatusCancelled: writer->WriteValue(TEXT("Cancelled")); break; + } +} + +ClientModels::TradeStatus PlayFab::ClientModels::readTradeStatusFromValue(const TSharedPtr& value) +{ + return readTradeStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::TradeStatus PlayFab::ClientModels::readTradeStatusFromValue(const FString& value) +{ + static TMap _TradeStatusMap; + if (_TradeStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _TradeStatusMap.Add(TEXT("Invalid"), TradeStatusInvalid); + _TradeStatusMap.Add(TEXT("Opening"), TradeStatusOpening); + _TradeStatusMap.Add(TEXT("Open"), TradeStatusOpen); + _TradeStatusMap.Add(TEXT("Accepting"), TradeStatusAccepting); + _TradeStatusMap.Add(TEXT("Accepted"), TradeStatusAccepted); + _TradeStatusMap.Add(TEXT("Filled"), TradeStatusFilled); + _TradeStatusMap.Add(TEXT("Cancelled"), TradeStatusCancelled); + + } + + if (!value.IsEmpty()) + { + auto output = _TradeStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return TradeStatusInvalid; // Basically critical fail +} + +PlayFab::ClientModels::FTradeInfo::~FTradeInfo() +{ + +} + +void PlayFab::ClientModels::FTradeInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AcceptedInventoryInstanceIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("AcceptedInventoryInstanceIds")); + for (const FString& item : AcceptedInventoryInstanceIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (AcceptedPlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AcceptedPlayerId")); writer->WriteValue(AcceptedPlayerId); } + + if (AllowedPlayerIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("AllowedPlayerIds")); + for (const FString& item : AllowedPlayerIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (CancelledAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("CancelledAt")); writeDatetime(CancelledAt, writer); } + + if (FilledAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("FilledAt")); writeDatetime(FilledAt, writer); } + + if (InvalidatedAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("InvalidatedAt")); writeDatetime(InvalidatedAt, writer); } + + if (OfferedCatalogItemIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("OfferedCatalogItemIds")); + for (const FString& item : OfferedCatalogItemIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (OfferedInventoryInstanceIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("OfferedInventoryInstanceIds")); + for (const FString& item : OfferedInventoryInstanceIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (OfferingPlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OfferingPlayerId")); writer->WriteValue(OfferingPlayerId); } + + if (OpenedAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("OpenedAt")); writeDatetime(OpenedAt, writer); } + + if (RequestedCatalogItemIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("RequestedCatalogItemIds")); + for (const FString& item : RequestedCatalogItemIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeTradeStatusEnumJSON(Status, writer); } + + if (TradeId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TradeId")); writer->WriteValue(TradeId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FTradeInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("AcceptedInventoryInstanceIds"), AcceptedInventoryInstanceIds); + + const TSharedPtr AcceptedPlayerIdValue = obj->TryGetField(TEXT("AcceptedPlayerId")); + if (AcceptedPlayerIdValue.IsValid() && !AcceptedPlayerIdValue->IsNull()) + { + FString TmpValue; + if (AcceptedPlayerIdValue->TryGetString(TmpValue)) { AcceptedPlayerId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("AllowedPlayerIds"), AllowedPlayerIds); + + const TSharedPtr CancelledAtValue = obj->TryGetField(TEXT("CancelledAt")); + if (CancelledAtValue.IsValid()) + CancelledAt = readDatetime(CancelledAtValue); + + + const TSharedPtr FilledAtValue = obj->TryGetField(TEXT("FilledAt")); + if (FilledAtValue.IsValid()) + FilledAt = readDatetime(FilledAtValue); + + + const TSharedPtr InvalidatedAtValue = obj->TryGetField(TEXT("InvalidatedAt")); + if (InvalidatedAtValue.IsValid()) + InvalidatedAt = readDatetime(InvalidatedAtValue); + + + obj->TryGetStringArrayField(TEXT("OfferedCatalogItemIds"), OfferedCatalogItemIds); + + obj->TryGetStringArrayField(TEXT("OfferedInventoryInstanceIds"), OfferedInventoryInstanceIds); + + const TSharedPtr OfferingPlayerIdValue = obj->TryGetField(TEXT("OfferingPlayerId")); + if (OfferingPlayerIdValue.IsValid() && !OfferingPlayerIdValue->IsNull()) + { + FString TmpValue; + if (OfferingPlayerIdValue->TryGetString(TmpValue)) { OfferingPlayerId = TmpValue; } + } + + const TSharedPtr OpenedAtValue = obj->TryGetField(TEXT("OpenedAt")); + if (OpenedAtValue.IsValid()) + OpenedAt = readDatetime(OpenedAtValue); + + + obj->TryGetStringArrayField(TEXT("RequestedCatalogItemIds"), RequestedCatalogItemIds); + + Status = readTradeStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TradeIdValue = obj->TryGetField(TEXT("TradeId")); + if (TradeIdValue.IsValid() && !TradeIdValue->IsNull()) + { + FString TmpValue; + if (TradeIdValue->TryGetString(TmpValue)) { TradeId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAcceptTradeResponse::~FAcceptTradeResponse() +{ + //if (Trade != nullptr) delete Trade; + +} + +void PlayFab::ClientModels::FAcceptTradeResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Trade.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Trade")); Trade->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAcceptTradeResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TradeValue = obj->TryGetField(TEXT("Trade")); + if (TradeValue.IsValid() && !TradeValue->IsNull()) + { + Trade = MakeShareable(new FTradeInfo(TradeValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAdCampaignAttributionModel::~FAdCampaignAttributionModel() +{ + +} + +void PlayFab::ClientModels::FAdCampaignAttributionModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AttributedAt")); writeDatetime(AttributedAt, writer); + + if (CampaignId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CampaignId")); writer->WriteValue(CampaignId); } + + if (Platform.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Platform")); writer->WriteValue(Platform); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAdCampaignAttributionModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AttributedAtValue = obj->TryGetField(TEXT("AttributedAt")); + if (AttributedAtValue.IsValid()) + AttributedAt = readDatetime(AttributedAtValue); + + + const TSharedPtr CampaignIdValue = obj->TryGetField(TEXT("CampaignId")); + if (CampaignIdValue.IsValid() && !CampaignIdValue->IsNull()) + { + FString TmpValue; + if (CampaignIdValue->TryGetString(TmpValue)) { CampaignId = TmpValue; } + } + + const TSharedPtr PlatformValue = obj->TryGetField(TEXT("Platform")); + if (PlatformValue.IsValid() && !PlatformValue->IsNull()) + { + FString TmpValue; + if (PlatformValue->TryGetString(TmpValue)) { Platform = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddFriendRequest::~FAddFriendRequest() +{ + +} + +void PlayFab::ClientModels::FAddFriendRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FriendEmail.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendEmail")); writer->WriteValue(FriendEmail); } + + if (FriendPlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); } + + if (FriendTitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendTitleDisplayName")); writer->WriteValue(FriendTitleDisplayName); } + + if (FriendUsername.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendUsername")); writer->WriteValue(FriendUsername); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddFriendRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendEmailValue = obj->TryGetField(TEXT("FriendEmail")); + if (FriendEmailValue.IsValid() && !FriendEmailValue->IsNull()) + { + FString TmpValue; + if (FriendEmailValue->TryGetString(TmpValue)) { FriendEmail = TmpValue; } + } + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + const TSharedPtr FriendTitleDisplayNameValue = obj->TryGetField(TEXT("FriendTitleDisplayName")); + if (FriendTitleDisplayNameValue.IsValid() && !FriendTitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (FriendTitleDisplayNameValue->TryGetString(TmpValue)) { FriendTitleDisplayName = TmpValue; } + } + + const TSharedPtr FriendUsernameValue = obj->TryGetField(TEXT("FriendUsername")); + if (FriendUsernameValue.IsValid() && !FriendUsernameValue->IsNull()) + { + FString TmpValue; + if (FriendUsernameValue->TryGetString(TmpValue)) { FriendUsername = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddFriendResult::~FAddFriendResult() +{ + +} + +void PlayFab::ClientModels::FAddFriendResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Created")); writer->WriteValue(Created); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddFriendResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid() && !CreatedValue->IsNull()) + { + bool TmpValue; + if (CreatedValue->TryGetBool(TmpValue)) { Created = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGenericServiceId::~FGenericServiceId() +{ + +} + +void PlayFab::ClientModels::FGenericServiceId::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ServiceName")); writer->WriteValue(ServiceName); + + writer->WriteIdentifierPrefix(TEXT("UserId")); writer->WriteValue(UserId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGenericServiceId::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ServiceNameValue = obj->TryGetField(TEXT("ServiceName")); + if (ServiceNameValue.IsValid() && !ServiceNameValue->IsNull()) + { + FString TmpValue; + if (ServiceNameValue->TryGetString(TmpValue)) { ServiceName = TmpValue; } + } + + const TSharedPtr UserIdValue = obj->TryGetField(TEXT("UserId")); + if (UserIdValue.IsValid() && !UserIdValue->IsNull()) + { + FString TmpValue; + if (UserIdValue->TryGetString(TmpValue)) { UserId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddGenericIDRequest::~FAddGenericIDRequest() +{ + +} + +void PlayFab::ClientModels::FAddGenericIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GenericId")); GenericId.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddGenericIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GenericIdValue = obj->TryGetField(TEXT("GenericId")); + if (GenericIdValue.IsValid() && !GenericIdValue->IsNull()) + { + GenericId = FGenericServiceId(GenericIdValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddGenericIDResult::~FAddGenericIDResult() +{ + +} + +void PlayFab::ClientModels::FAddGenericIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddGenericIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddOrUpdateContactEmailRequest::~FAddOrUpdateContactEmailRequest() +{ + +} + +void PlayFab::ClientModels::FAddOrUpdateContactEmailRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("EmailAddress")); writer->WriteValue(EmailAddress); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddOrUpdateContactEmailRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailAddressValue = obj->TryGetField(TEXT("EmailAddress")); + if (EmailAddressValue.IsValid() && !EmailAddressValue->IsNull()) + { + FString TmpValue; + if (EmailAddressValue->TryGetString(TmpValue)) { EmailAddress = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddOrUpdateContactEmailResult::~FAddOrUpdateContactEmailResult() +{ + +} + +void PlayFab::ClientModels::FAddOrUpdateContactEmailResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddOrUpdateContactEmailResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddSharedGroupMembersRequest::~FAddSharedGroupMembersRequest() +{ + +} + +void PlayFab::ClientModels::FAddSharedGroupMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("PlayFabIds")); + for (const FString& item : PlayFabIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddSharedGroupMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("PlayFabIds"), PlayFabIds); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddSharedGroupMembersResult::~FAddSharedGroupMembersResult() +{ + +} + +void PlayFab::ClientModels::FAddSharedGroupMembersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddSharedGroupMembersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddUsernamePasswordRequest::~FAddUsernamePasswordRequest() +{ + +} + +void PlayFab::ClientModels::FAddUsernamePasswordRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); + + writer->WriteIdentifierPrefix(TEXT("Password")); writer->WriteValue(Password); + + writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddUsernamePasswordRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr PasswordValue = obj->TryGetField(TEXT("Password")); + if (PasswordValue.IsValid() && !PasswordValue->IsNull()) + { + FString TmpValue; + if (PasswordValue->TryGetString(TmpValue)) { Password = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddUsernamePasswordResult::~FAddUsernamePasswordResult() +{ + +} + +void PlayFab::ClientModels::FAddUsernamePasswordResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddUsernamePasswordResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddUserVirtualCurrencyRequest::~FAddUserVirtualCurrencyRequest() +{ + +} + +void PlayFab::ClientModels::FAddUserVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddUserVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAndroidDevicePushNotificationRegistrationRequest::~FAndroidDevicePushNotificationRegistrationRequest() +{ + +} + +void PlayFab::ClientModels::FAndroidDevicePushNotificationRegistrationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ConfirmationMessage.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ConfirmationMessage")); writer->WriteValue(ConfirmationMessage); } + + writer->WriteIdentifierPrefix(TEXT("DeviceToken")); writer->WriteValue(DeviceToken); + + if (SendPushNotificationConfirmation.notNull()) { writer->WriteIdentifierPrefix(TEXT("SendPushNotificationConfirmation")); writer->WriteValue(SendPushNotificationConfirmation); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAndroidDevicePushNotificationRegistrationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ConfirmationMessageValue = obj->TryGetField(TEXT("ConfirmationMessage")); + if (ConfirmationMessageValue.IsValid() && !ConfirmationMessageValue->IsNull()) + { + FString TmpValue; + if (ConfirmationMessageValue->TryGetString(TmpValue)) { ConfirmationMessage = TmpValue; } + } + + const TSharedPtr DeviceTokenValue = obj->TryGetField(TEXT("DeviceToken")); + if (DeviceTokenValue.IsValid() && !DeviceTokenValue->IsNull()) + { + FString TmpValue; + if (DeviceTokenValue->TryGetString(TmpValue)) { DeviceToken = TmpValue; } + } + + const TSharedPtr SendPushNotificationConfirmationValue = obj->TryGetField(TEXT("SendPushNotificationConfirmation")); + if (SendPushNotificationConfirmationValue.IsValid() && !SendPushNotificationConfirmationValue->IsNull()) + { + bool TmpValue; + if (SendPushNotificationConfirmationValue->TryGetBool(TmpValue)) { SendPushNotificationConfirmation = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAndroidDevicePushNotificationRegistrationResult::~FAndroidDevicePushNotificationRegistrationResult() +{ + +} + +void PlayFab::ClientModels::FAndroidDevicePushNotificationRegistrationResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAndroidDevicePushNotificationRegistrationResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FAttributeInstallRequest::~FAttributeInstallRequest() +{ + +} + +void PlayFab::ClientModels::FAttributeInstallRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Adid.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Adid")); writer->WriteValue(Adid); } + + if (Idfa.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Idfa")); writer->WriteValue(Idfa); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAttributeInstallRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AdidValue = obj->TryGetField(TEXT("Adid")); + if (AdidValue.IsValid() && !AdidValue->IsNull()) + { + FString TmpValue; + if (AdidValue->TryGetString(TmpValue)) { Adid = TmpValue; } + } + + const TSharedPtr IdfaValue = obj->TryGetField(TEXT("Idfa")); + if (IdfaValue.IsValid() && !IdfaValue->IsNull()) + { + FString TmpValue; + if (IdfaValue->TryGetString(TmpValue)) { Idfa = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAttributeInstallResult::~FAttributeInstallResult() +{ + +} + +void PlayFab::ClientModels::FAttributeInstallResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAttributeInstallResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FCancelTradeRequest::~FCancelTradeRequest() +{ + +} + +void PlayFab::ClientModels::FCancelTradeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("TradeId")); writer->WriteValue(TradeId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCancelTradeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TradeIdValue = obj->TryGetField(TEXT("TradeId")); + if (TradeIdValue.IsValid() && !TradeIdValue->IsNull()) + { + FString TmpValue; + if (TradeIdValue->TryGetString(TmpValue)) { TradeId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCancelTradeResponse::~FCancelTradeResponse() +{ + //if (Trade != nullptr) delete Trade; + +} + +void PlayFab::ClientModels::FCancelTradeResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Trade.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Trade")); Trade->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCancelTradeResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TradeValue = obj->TryGetField(TEXT("Trade")); + if (TradeValue.IsValid() && !TradeValue->IsNull()) + { + Trade = MakeShareable(new FTradeInfo(TradeValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCartItem::~FCartItem() +{ + +} + +void PlayFab::ClientModels::FCartItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (RealCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("RealCurrencyPrices")); + for (TMap::TConstIterator It(RealCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (VCAmount.Num() != 0) + { + writer->WriteObjectStart(TEXT("VCAmount")); + for (TMap::TConstIterator It(VCAmount); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyPrices")); + for (TMap::TConstIterator It(VirtualCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCartItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr* RealCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("RealCurrencyPrices"), RealCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*RealCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + RealCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VCAmountObject; + if (obj->TryGetObjectField(TEXT("VCAmount"), VCAmountObject)) + { + for (TMap>::TConstIterator It((*VCAmountObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VCAmount.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyPrices"), VirtualCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCatalogItemBundleInfo::~FCatalogItemBundleInfo() +{ + +} + +void PlayFab::ClientModels::FCatalogItemBundleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BundledItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundledItems")); + for (const FString& item : BundledItems) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundledResultTables.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundledResultTables")); + for (const FString& item : BundledResultTables) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundledVirtualCurrencies.Num() != 0) + { + writer->WriteObjectStart(TEXT("BundledVirtualCurrencies")); + for (TMap::TConstIterator It(BundledVirtualCurrencies); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCatalogItemBundleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("BundledItems"), BundledItems); + + obj->TryGetStringArrayField(TEXT("BundledResultTables"), BundledResultTables); + + const TSharedPtr* BundledVirtualCurrenciesObject; + if (obj->TryGetObjectField(TEXT("BundledVirtualCurrencies"), BundledVirtualCurrenciesObject)) + { + for (TMap>::TConstIterator It((*BundledVirtualCurrenciesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + BundledVirtualCurrencies.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCatalogItemConsumableInfo::~FCatalogItemConsumableInfo() +{ + +} + +void PlayFab::ClientModels::FCatalogItemConsumableInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (UsageCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsageCount")); writer->WriteValue(static_cast(UsageCount)); } + + if (UsagePeriod.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsagePeriod")); writer->WriteValue(static_cast(UsagePeriod)); } + + if (UsagePeriodGroup.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UsagePeriodGroup")); writer->WriteValue(UsagePeriodGroup); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCatalogItemConsumableInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UsageCountValue = obj->TryGetField(TEXT("UsageCount")); + if (UsageCountValue.IsValid() && !UsageCountValue->IsNull()) + { + uint32 TmpValue; + if (UsageCountValue->TryGetNumber(TmpValue)) { UsageCount = TmpValue; } + } + + const TSharedPtr UsagePeriodValue = obj->TryGetField(TEXT("UsagePeriod")); + if (UsagePeriodValue.IsValid() && !UsagePeriodValue->IsNull()) + { + uint32 TmpValue; + if (UsagePeriodValue->TryGetNumber(TmpValue)) { UsagePeriod = TmpValue; } + } + + const TSharedPtr UsagePeriodGroupValue = obj->TryGetField(TEXT("UsagePeriodGroup")); + if (UsagePeriodGroupValue.IsValid() && !UsagePeriodGroupValue->IsNull()) + { + FString TmpValue; + if (UsagePeriodGroupValue->TryGetString(TmpValue)) { UsagePeriodGroup = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCatalogItemContainerInfo::~FCatalogItemContainerInfo() +{ + +} + +void PlayFab::ClientModels::FCatalogItemContainerInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemContents")); + for (const FString& item : ItemContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (KeyItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KeyItemId")); writer->WriteValue(KeyItemId); } + + if (ResultTableContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("ResultTableContents")); + for (const FString& item : ResultTableContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyContents.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyContents")); + for (TMap::TConstIterator It(VirtualCurrencyContents); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCatalogItemContainerInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("ItemContents"), ItemContents); + + const TSharedPtr KeyItemIdValue = obj->TryGetField(TEXT("KeyItemId")); + if (KeyItemIdValue.IsValid() && !KeyItemIdValue->IsNull()) + { + FString TmpValue; + if (KeyItemIdValue->TryGetString(TmpValue)) { KeyItemId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("ResultTableContents"), ResultTableContents); + + const TSharedPtr* VirtualCurrencyContentsObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyContents"), VirtualCurrencyContentsObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyContentsObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyContents.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCatalogItem::~FCatalogItem() +{ + //if (Bundle != nullptr) delete Bundle; + //if (Consumable != nullptr) delete Consumable; + //if (Container != nullptr) delete Container; + +} + +void PlayFab::ClientModels::FCatalogItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Bundle.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Bundle")); Bundle->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("CanBecomeCharacter")); writer->WriteValue(CanBecomeCharacter); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (Consumable.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Consumable")); Consumable->writeJSON(writer); } + + if (Container.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Container")); Container->writeJSON(writer); } + + if (CustomData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomData")); writer->WriteValue(CustomData); } + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + writer->WriteIdentifierPrefix(TEXT("InitialLimitedEditionCount")); writer->WriteValue(InitialLimitedEditionCount); + + writer->WriteIdentifierPrefix(TEXT("IsLimitedEdition")); writer->WriteValue(IsLimitedEdition); + + writer->WriteIdentifierPrefix(TEXT("IsStackable")); writer->WriteValue(IsStackable); + + writer->WriteIdentifierPrefix(TEXT("IsTradable")); writer->WriteValue(IsTradable); + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (ItemImageUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemImageUrl")); writer->WriteValue(ItemImageUrl); } + + if (RealCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("RealCurrencyPrices")); + for (TMap::TConstIterator It(RealCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyPrices")); + for (TMap::TConstIterator It(VirtualCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCatalogItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BundleValue = obj->TryGetField(TEXT("Bundle")); + if (BundleValue.IsValid() && !BundleValue->IsNull()) + { + Bundle = MakeShareable(new FCatalogItemBundleInfo(BundleValue->AsObject())); + } + + const TSharedPtr CanBecomeCharacterValue = obj->TryGetField(TEXT("CanBecomeCharacter")); + if (CanBecomeCharacterValue.IsValid() && !CanBecomeCharacterValue->IsNull()) + { + bool TmpValue; + if (CanBecomeCharacterValue->TryGetBool(TmpValue)) { CanBecomeCharacter = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr ConsumableValue = obj->TryGetField(TEXT("Consumable")); + if (ConsumableValue.IsValid() && !ConsumableValue->IsNull()) + { + Consumable = MakeShareable(new FCatalogItemConsumableInfo(ConsumableValue->AsObject())); + } + + const TSharedPtr ContainerValue = obj->TryGetField(TEXT("Container")); + if (ContainerValue.IsValid() && !ContainerValue->IsNull()) + { + Container = MakeShareable(new FCatalogItemContainerInfo(ContainerValue->AsObject())); + } + + const TSharedPtr CustomDataValue = obj->TryGetField(TEXT("CustomData")); + if (CustomDataValue.IsValid() && !CustomDataValue->IsNull()) + { + FString TmpValue; + if (CustomDataValue->TryGetString(TmpValue)) { CustomData = TmpValue; } + } + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr InitialLimitedEditionCountValue = obj->TryGetField(TEXT("InitialLimitedEditionCount")); + if (InitialLimitedEditionCountValue.IsValid() && !InitialLimitedEditionCountValue->IsNull()) + { + int32 TmpValue; + if (InitialLimitedEditionCountValue->TryGetNumber(TmpValue)) { InitialLimitedEditionCount = TmpValue; } + } + + const TSharedPtr IsLimitedEditionValue = obj->TryGetField(TEXT("IsLimitedEdition")); + if (IsLimitedEditionValue.IsValid() && !IsLimitedEditionValue->IsNull()) + { + bool TmpValue; + if (IsLimitedEditionValue->TryGetBool(TmpValue)) { IsLimitedEdition = TmpValue; } + } + + const TSharedPtr IsStackableValue = obj->TryGetField(TEXT("IsStackable")); + if (IsStackableValue.IsValid() && !IsStackableValue->IsNull()) + { + bool TmpValue; + if (IsStackableValue->TryGetBool(TmpValue)) { IsStackable = TmpValue; } + } + + const TSharedPtr IsTradableValue = obj->TryGetField(TEXT("IsTradable")); + if (IsTradableValue.IsValid() && !IsTradableValue->IsNull()) + { + bool TmpValue; + if (IsTradableValue->TryGetBool(TmpValue)) { IsTradable = TmpValue; } + } + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemImageUrlValue = obj->TryGetField(TEXT("ItemImageUrl")); + if (ItemImageUrlValue.IsValid() && !ItemImageUrlValue->IsNull()) + { + FString TmpValue; + if (ItemImageUrlValue->TryGetString(TmpValue)) { ItemImageUrl = TmpValue; } + } + + const TSharedPtr* RealCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("RealCurrencyPrices"), RealCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*RealCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + RealCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr* VirtualCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyPrices"), VirtualCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FItemInstance::~FItemInstance() +{ + +} + +void PlayFab::ClientModels::FItemInstance::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (BundleContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundleContents")); + for (const FString& item : BundleContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundleParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BundleParent")); writer->WriteValue(BundleParent); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CustomData.Num() != 0) + { + writer->WriteObjectStart(TEXT("CustomData")); + for (TMap::TConstIterator It(CustomData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Expiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (PurchaseDate.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); } + + if (RemainingUses.notNull()) { writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); } + + if (UnitCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnitCurrency")); writer->WriteValue(UnitCurrency); } + + writer->WriteIdentifierPrefix(TEXT("UnitPrice")); writer->WriteValue(static_cast(UnitPrice)); + + if (UsesIncrementedBy.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsesIncrementedBy")); writer->WriteValue(UsesIncrementedBy); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FItemInstance::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("BundleContents"), BundleContents); + + const TSharedPtr BundleParentValue = obj->TryGetField(TEXT("BundleParent")); + if (BundleParentValue.IsValid() && !BundleParentValue->IsNull()) + { + FString TmpValue; + if (BundleParentValue->TryGetString(TmpValue)) { BundleParent = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr* CustomDataObject; + if (obj->TryGetObjectField(TEXT("CustomData"), CustomDataObject)) + { + for (TMap>::TConstIterator It((*CustomDataObject)->Values); It; ++It) + { + CustomData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + const TSharedPtr UnitCurrencyValue = obj->TryGetField(TEXT("UnitCurrency")); + if (UnitCurrencyValue.IsValid() && !UnitCurrencyValue->IsNull()) + { + FString TmpValue; + if (UnitCurrencyValue->TryGetString(TmpValue)) { UnitCurrency = TmpValue; } + } + + const TSharedPtr UnitPriceValue = obj->TryGetField(TEXT("UnitPrice")); + if (UnitPriceValue.IsValid() && !UnitPriceValue->IsNull()) + { + uint32 TmpValue; + if (UnitPriceValue->TryGetNumber(TmpValue)) { UnitPrice = TmpValue; } + } + + const TSharedPtr UsesIncrementedByValue = obj->TryGetField(TEXT("UsesIncrementedBy")); + if (UsesIncrementedByValue.IsValid() && !UsesIncrementedByValue->IsNull()) + { + int32 TmpValue; + if (UsesIncrementedByValue->TryGetNumber(TmpValue)) { UsesIncrementedBy = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCharacterInventory::~FCharacterInventory() +{ + +} + +void PlayFab::ClientModels::FCharacterInventory::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCharacterInventory::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FCharacterLeaderboardEntry::~FCharacterLeaderboardEntry() +{ + +} + +void PlayFab::ClientModels::FCharacterLeaderboardEntry::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CharacterName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterName")); writer->WriteValue(CharacterName); } + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteIdentifierPrefix(TEXT("Position")); writer->WriteValue(Position); + + writer->WriteIdentifierPrefix(TEXT("StatValue")); writer->WriteValue(StatValue); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCharacterLeaderboardEntry::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterNameValue = obj->TryGetField(TEXT("CharacterName")); + if (CharacterNameValue.IsValid() && !CharacterNameValue->IsNull()) + { + FString TmpValue; + if (CharacterNameValue->TryGetString(TmpValue)) { CharacterName = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PositionValue = obj->TryGetField(TEXT("Position")); + if (PositionValue.IsValid() && !PositionValue->IsNull()) + { + int32 TmpValue; + if (PositionValue->TryGetNumber(TmpValue)) { Position = TmpValue; } + } + + const TSharedPtr StatValueValue = obj->TryGetField(TEXT("StatValue")); + if (StatValueValue.IsValid() && !StatValueValue->IsNull()) + { + int32 TmpValue; + if (StatValueValue->TryGetNumber(TmpValue)) { StatValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCharacterResult::~FCharacterResult() +{ + +} + +void PlayFab::ClientModels::FCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CharacterName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterName")); writer->WriteValue(CharacterName); } + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterNameValue = obj->TryGetField(TEXT("CharacterName")); + if (CharacterNameValue.IsValid() && !CharacterNameValue->IsNull()) + { + FString TmpValue; + if (CharacterNameValue->TryGetString(TmpValue)) { CharacterName = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeCloudScriptRevisionOptionEnumJSON(CloudScriptRevisionOption enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CloudScriptRevisionOptionLive: writer->WriteValue(TEXT("Live")); break; + case CloudScriptRevisionOptionLatest: writer->WriteValue(TEXT("Latest")); break; + case CloudScriptRevisionOptionSpecific: writer->WriteValue(TEXT("Specific")); break; + } +} + +ClientModels::CloudScriptRevisionOption PlayFab::ClientModels::readCloudScriptRevisionOptionFromValue(const TSharedPtr& value) +{ + return readCloudScriptRevisionOptionFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::CloudScriptRevisionOption PlayFab::ClientModels::readCloudScriptRevisionOptionFromValue(const FString& value) +{ + static TMap _CloudScriptRevisionOptionMap; + if (_CloudScriptRevisionOptionMap.Num() == 0) + { + // Auto-generate the map on the first use + _CloudScriptRevisionOptionMap.Add(TEXT("Live"), CloudScriptRevisionOptionLive); + _CloudScriptRevisionOptionMap.Add(TEXT("Latest"), CloudScriptRevisionOptionLatest); + _CloudScriptRevisionOptionMap.Add(TEXT("Specific"), CloudScriptRevisionOptionSpecific); + + } + + if (!value.IsEmpty()) + { + auto output = _CloudScriptRevisionOptionMap.Find(value); + if (output != nullptr) + return *output; + } + + return CloudScriptRevisionOptionLive; // Basically critical fail +} + +PlayFab::ClientModels::FContainer_Dictionary_String_String::~FContainer_Dictionary_String_String() +{ + +} + +void PlayFab::ClientModels::FContainer_Dictionary_String_String::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FContainer_Dictionary_String_String::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCollectionFilter::~FCollectionFilter() +{ + +} + +void PlayFab::ClientModels::FCollectionFilter::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Excludes.Num() != 0) + { + writer->WriteArrayStart(TEXT("Excludes")); + for (const FContainer_Dictionary_String_String& item : Excludes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Includes.Num() != 0) + { + writer->WriteArrayStart(TEXT("Includes")); + for (const FContainer_Dictionary_String_String& item : Includes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCollectionFilter::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ExcludesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Excludes")); + for (int32 Idx = 0; Idx < ExcludesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ExcludesArray[Idx]; + Excludes.Add(FContainer_Dictionary_String_String(CurrentItem->AsObject())); + } + + + const TArray>&IncludesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Includes")); + for (int32 Idx = 0; Idx < IncludesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = IncludesArray[Idx]; + Includes.Add(FContainer_Dictionary_String_String(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FConfirmPurchaseRequest::~FConfirmPurchaseRequest() +{ + +} + +void PlayFab::ClientModels::FConfirmPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FConfirmPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FConfirmPurchaseResult::~FConfirmPurchaseResult() +{ + +} + +void PlayFab::ClientModels::FConfirmPurchaseResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Items.Num() != 0) + { + writer->WriteArrayStart(TEXT("Items")); + for (const FItemInstance& item : Items) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (OrderId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); } + + writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FConfirmPurchaseResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Items")); + for (int32 Idx = 0; Idx < ItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemsArray[Idx]; + Items.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + return HasSucceeded; +} + +PlayFab::ClientModels::FConsumeItemRequest::~FConsumeItemRequest() +{ + +} + +void PlayFab::ClientModels::FConsumeItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ConsumeCount")); writer->WriteValue(ConsumeCount); + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FConsumeItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ConsumeCountValue = obj->TryGetField(TEXT("ConsumeCount")); + if (ConsumeCountValue.IsValid() && !ConsumeCountValue->IsNull()) + { + int32 TmpValue; + if (ConsumeCountValue->TryGetNumber(TmpValue)) { ConsumeCount = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FConsumeItemResult::~FConsumeItemResult() +{ + +} + +void PlayFab::ClientModels::FConsumeItemResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FConsumeItemResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FConsumeXboxEntitlementsRequest::~FConsumeXboxEntitlementsRequest() +{ + +} + +void PlayFab::ClientModels::FConsumeXboxEntitlementsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FConsumeXboxEntitlementsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FConsumeXboxEntitlementsResult::~FConsumeXboxEntitlementsResult() +{ + +} + +void PlayFab::ClientModels::FConsumeXboxEntitlementsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Items.Num() != 0) + { + writer->WriteArrayStart(TEXT("Items")); + for (const FItemInstance& item : Items) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FConsumeXboxEntitlementsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Items")); + for (int32 Idx = 0; Idx < ItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemsArray[Idx]; + Items.Add(FItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeEmailVerificationStatusEnumJSON(EmailVerificationStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case EmailVerificationStatusUnverified: writer->WriteValue(TEXT("Unverified")); break; + case EmailVerificationStatusPending: writer->WriteValue(TEXT("Pending")); break; + case EmailVerificationStatusConfirmed: writer->WriteValue(TEXT("Confirmed")); break; + } +} + +ClientModels::EmailVerificationStatus PlayFab::ClientModels::readEmailVerificationStatusFromValue(const TSharedPtr& value) +{ + return readEmailVerificationStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::EmailVerificationStatus PlayFab::ClientModels::readEmailVerificationStatusFromValue(const FString& value) +{ + static TMap _EmailVerificationStatusMap; + if (_EmailVerificationStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _EmailVerificationStatusMap.Add(TEXT("Unverified"), EmailVerificationStatusUnverified); + _EmailVerificationStatusMap.Add(TEXT("Pending"), EmailVerificationStatusPending); + _EmailVerificationStatusMap.Add(TEXT("Confirmed"), EmailVerificationStatusConfirmed); + + } + + if (!value.IsEmpty()) + { + auto output = _EmailVerificationStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return EmailVerificationStatusUnverified; // Basically critical fail +} + +PlayFab::ClientModels::FContactEmailInfoModel::~FContactEmailInfoModel() +{ + +} + +void PlayFab::ClientModels::FContactEmailInfoModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EmailAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailAddress")); writer->WriteValue(EmailAddress); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + if (VerificationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("VerificationStatus")); writeEmailVerificationStatusEnumJSON(VerificationStatus, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FContactEmailInfoModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailAddressValue = obj->TryGetField(TEXT("EmailAddress")); + if (EmailAddressValue.IsValid() && !EmailAddressValue->IsNull()) + { + FString TmpValue; + if (EmailAddressValue->TryGetString(TmpValue)) { EmailAddress = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + VerificationStatus = readEmailVerificationStatusFromValue(obj->TryGetField(TEXT("VerificationStatus"))); + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeContinentCodeEnumJSON(ContinentCode enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ContinentCodeAF: writer->WriteValue(TEXT("AF")); break; + case ContinentCodeAN: writer->WriteValue(TEXT("AN")); break; + case ContinentCodeAS: writer->WriteValue(TEXT("AS")); break; + case ContinentCodeEU: writer->WriteValue(TEXT("EU")); break; + case ContinentCodeNA: writer->WriteValue(TEXT("NA")); break; + case ContinentCodeOC: writer->WriteValue(TEXT("OC")); break; + case ContinentCodeSA: writer->WriteValue(TEXT("SA")); break; + } +} + +ClientModels::ContinentCode PlayFab::ClientModels::readContinentCodeFromValue(const TSharedPtr& value) +{ + return readContinentCodeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::ContinentCode PlayFab::ClientModels::readContinentCodeFromValue(const FString& value) +{ + static TMap _ContinentCodeMap; + if (_ContinentCodeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ContinentCodeMap.Add(TEXT("AF"), ContinentCodeAF); + _ContinentCodeMap.Add(TEXT("AN"), ContinentCodeAN); + _ContinentCodeMap.Add(TEXT("AS"), ContinentCodeAS); + _ContinentCodeMap.Add(TEXT("EU"), ContinentCodeEU); + _ContinentCodeMap.Add(TEXT("NA"), ContinentCodeNA); + _ContinentCodeMap.Add(TEXT("OC"), ContinentCodeOC); + _ContinentCodeMap.Add(TEXT("SA"), ContinentCodeSA); + + } + + if (!value.IsEmpty()) + { + auto output = _ContinentCodeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ContinentCodeAF; // Basically critical fail +} + +void PlayFab::ClientModels::writeCountryCodeEnumJSON(CountryCode enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CountryCodeAF: writer->WriteValue(TEXT("AF")); break; + case CountryCodeAX: writer->WriteValue(TEXT("AX")); break; + case CountryCodeAL: writer->WriteValue(TEXT("AL")); break; + case CountryCodeDZ: writer->WriteValue(TEXT("DZ")); break; + case CountryCodeAS: writer->WriteValue(TEXT("AS")); break; + case CountryCodeAD: writer->WriteValue(TEXT("AD")); break; + case CountryCodeAO: writer->WriteValue(TEXT("AO")); break; + case CountryCodeAI: writer->WriteValue(TEXT("AI")); break; + case CountryCodeAQ: writer->WriteValue(TEXT("AQ")); break; + case CountryCodeAG: writer->WriteValue(TEXT("AG")); break; + case CountryCodeAR: writer->WriteValue(TEXT("AR")); break; + case CountryCodeAM: writer->WriteValue(TEXT("AM")); break; + case CountryCodeAW: writer->WriteValue(TEXT("AW")); break; + case CountryCodeAU: writer->WriteValue(TEXT("AU")); break; + case CountryCodeAT: writer->WriteValue(TEXT("AT")); break; + case CountryCodeAZ: writer->WriteValue(TEXT("AZ")); break; + case CountryCodeBS: writer->WriteValue(TEXT("BS")); break; + case CountryCodeBH: writer->WriteValue(TEXT("BH")); break; + case CountryCodeBD: writer->WriteValue(TEXT("BD")); break; + case CountryCodeBB: writer->WriteValue(TEXT("BB")); break; + case CountryCodeBY: writer->WriteValue(TEXT("BY")); break; + case CountryCodeBE: writer->WriteValue(TEXT("BE")); break; + case CountryCodeBZ: writer->WriteValue(TEXT("BZ")); break; + case CountryCodeBJ: writer->WriteValue(TEXT("BJ")); break; + case CountryCodeBM: writer->WriteValue(TEXT("BM")); break; + case CountryCodeBT: writer->WriteValue(TEXT("BT")); break; + case CountryCodeBO: writer->WriteValue(TEXT("BO")); break; + case CountryCodeBQ: writer->WriteValue(TEXT("BQ")); break; + case CountryCodeBA: writer->WriteValue(TEXT("BA")); break; + case CountryCodeBW: writer->WriteValue(TEXT("BW")); break; + case CountryCodeBV: writer->WriteValue(TEXT("BV")); break; + case CountryCodeBR: writer->WriteValue(TEXT("BR")); break; + case CountryCodeIO: writer->WriteValue(TEXT("IO")); break; + case CountryCodeBN: writer->WriteValue(TEXT("BN")); break; + case CountryCodeBG: writer->WriteValue(TEXT("BG")); break; + case CountryCodeBF: writer->WriteValue(TEXT("BF")); break; + case CountryCodeBI: writer->WriteValue(TEXT("BI")); break; + case CountryCodeKH: writer->WriteValue(TEXT("KH")); break; + case CountryCodeCM: writer->WriteValue(TEXT("CM")); break; + case CountryCodeCA: writer->WriteValue(TEXT("CA")); break; + case CountryCodeCV: writer->WriteValue(TEXT("CV")); break; + case CountryCodeKY: writer->WriteValue(TEXT("KY")); break; + case CountryCodeCF: writer->WriteValue(TEXT("CF")); break; + case CountryCodeTD: writer->WriteValue(TEXT("TD")); break; + case CountryCodeCL: writer->WriteValue(TEXT("CL")); break; + case CountryCodeCN: writer->WriteValue(TEXT("CN")); break; + case CountryCodeCX: writer->WriteValue(TEXT("CX")); break; + case CountryCodeCC: writer->WriteValue(TEXT("CC")); break; + case CountryCodeCO: writer->WriteValue(TEXT("CO")); break; + case CountryCodeKM: writer->WriteValue(TEXT("KM")); break; + case CountryCodeCG: writer->WriteValue(TEXT("CG")); break; + case CountryCodeCD: writer->WriteValue(TEXT("CD")); break; + case CountryCodeCK: writer->WriteValue(TEXT("CK")); break; + case CountryCodeCR: writer->WriteValue(TEXT("CR")); break; + case CountryCodeCI: writer->WriteValue(TEXT("CI")); break; + case CountryCodeHR: writer->WriteValue(TEXT("HR")); break; + case CountryCodeCU: writer->WriteValue(TEXT("CU")); break; + case CountryCodeCW: writer->WriteValue(TEXT("CW")); break; + case CountryCodeCY: writer->WriteValue(TEXT("CY")); break; + case CountryCodeCZ: writer->WriteValue(TEXT("CZ")); break; + case CountryCodeDK: writer->WriteValue(TEXT("DK")); break; + case CountryCodeDJ: writer->WriteValue(TEXT("DJ")); break; + case CountryCodeDM: writer->WriteValue(TEXT("DM")); break; + case CountryCodeDO: writer->WriteValue(TEXT("DO")); break; + case CountryCodeEC: writer->WriteValue(TEXT("EC")); break; + case CountryCodeEG: writer->WriteValue(TEXT("EG")); break; + case CountryCodeSV: writer->WriteValue(TEXT("SV")); break; + case CountryCodeGQ: writer->WriteValue(TEXT("GQ")); break; + case CountryCodeER: writer->WriteValue(TEXT("ER")); break; + case CountryCodeEE: writer->WriteValue(TEXT("EE")); break; + case CountryCodeET: writer->WriteValue(TEXT("ET")); break; + case CountryCodeFK: writer->WriteValue(TEXT("FK")); break; + case CountryCodeFO: writer->WriteValue(TEXT("FO")); break; + case CountryCodeFJ: writer->WriteValue(TEXT("FJ")); break; + case CountryCodeFI: writer->WriteValue(TEXT("FI")); break; + case CountryCodeFR: writer->WriteValue(TEXT("FR")); break; + case CountryCodeGF: writer->WriteValue(TEXT("GF")); break; + case CountryCodePF: writer->WriteValue(TEXT("PF")); break; + case CountryCodeTF: writer->WriteValue(TEXT("TF")); break; + case CountryCodeGA: writer->WriteValue(TEXT("GA")); break; + case CountryCodeGM: writer->WriteValue(TEXT("GM")); break; + case CountryCodeGE: writer->WriteValue(TEXT("GE")); break; + case CountryCodeDE: writer->WriteValue(TEXT("DE")); break; + case CountryCodeGH: writer->WriteValue(TEXT("GH")); break; + case CountryCodeGI: writer->WriteValue(TEXT("GI")); break; + case CountryCodeGR: writer->WriteValue(TEXT("GR")); break; + case CountryCodeGL: writer->WriteValue(TEXT("GL")); break; + case CountryCodeGD: writer->WriteValue(TEXT("GD")); break; + case CountryCodeGP: writer->WriteValue(TEXT("GP")); break; + case CountryCodeGU: writer->WriteValue(TEXT("GU")); break; + case CountryCodeGT: writer->WriteValue(TEXT("GT")); break; + case CountryCodeGG: writer->WriteValue(TEXT("GG")); break; + case CountryCodeGN: writer->WriteValue(TEXT("GN")); break; + case CountryCodeGW: writer->WriteValue(TEXT("GW")); break; + case CountryCodeGY: writer->WriteValue(TEXT("GY")); break; + case CountryCodeHT: writer->WriteValue(TEXT("HT")); break; + case CountryCodeHM: writer->WriteValue(TEXT("HM")); break; + case CountryCodeVA: writer->WriteValue(TEXT("VA")); break; + case CountryCodeHN: writer->WriteValue(TEXT("HN")); break; + case CountryCodeHK: writer->WriteValue(TEXT("HK")); break; + case CountryCodeHU: writer->WriteValue(TEXT("HU")); break; + case CountryCodeIS: writer->WriteValue(TEXT("IS")); break; + case CountryCodeIN: writer->WriteValue(TEXT("IN")); break; + case CountryCodeID: writer->WriteValue(TEXT("ID")); break; + case CountryCodeIR: writer->WriteValue(TEXT("IR")); break; + case CountryCodeIQ: writer->WriteValue(TEXT("IQ")); break; + case CountryCodeIE: writer->WriteValue(TEXT("IE")); break; + case CountryCodeIM: writer->WriteValue(TEXT("IM")); break; + case CountryCodeIL: writer->WriteValue(TEXT("IL")); break; + case CountryCodeIT: writer->WriteValue(TEXT("IT")); break; + case CountryCodeJM: writer->WriteValue(TEXT("JM")); break; + case CountryCodeJP: writer->WriteValue(TEXT("JP")); break; + case CountryCodeJE: writer->WriteValue(TEXT("JE")); break; + case CountryCodeJO: writer->WriteValue(TEXT("JO")); break; + case CountryCodeKZ: writer->WriteValue(TEXT("KZ")); break; + case CountryCodeKE: writer->WriteValue(TEXT("KE")); break; + case CountryCodeKI: writer->WriteValue(TEXT("KI")); break; + case CountryCodeKP: writer->WriteValue(TEXT("KP")); break; + case CountryCodeKR: writer->WriteValue(TEXT("KR")); break; + case CountryCodeKW: writer->WriteValue(TEXT("KW")); break; + case CountryCodeKG: writer->WriteValue(TEXT("KG")); break; + case CountryCodeLA: writer->WriteValue(TEXT("LA")); break; + case CountryCodeLV: writer->WriteValue(TEXT("LV")); break; + case CountryCodeLB: writer->WriteValue(TEXT("LB")); break; + case CountryCodeLS: writer->WriteValue(TEXT("LS")); break; + case CountryCodeLR: writer->WriteValue(TEXT("LR")); break; + case CountryCodeLY: writer->WriteValue(TEXT("LY")); break; + case CountryCodeLI: writer->WriteValue(TEXT("LI")); break; + case CountryCodeLT: writer->WriteValue(TEXT("LT")); break; + case CountryCodeLU: writer->WriteValue(TEXT("LU")); break; + case CountryCodeMO: writer->WriteValue(TEXT("MO")); break; + case CountryCodeMK: writer->WriteValue(TEXT("MK")); break; + case CountryCodeMG: writer->WriteValue(TEXT("MG")); break; + case CountryCodeMW: writer->WriteValue(TEXT("MW")); break; + case CountryCodeMY: writer->WriteValue(TEXT("MY")); break; + case CountryCodeMV: writer->WriteValue(TEXT("MV")); break; + case CountryCodeML: writer->WriteValue(TEXT("ML")); break; + case CountryCodeMT: writer->WriteValue(TEXT("MT")); break; + case CountryCodeMH: writer->WriteValue(TEXT("MH")); break; + case CountryCodeMQ: writer->WriteValue(TEXT("MQ")); break; + case CountryCodeMR: writer->WriteValue(TEXT("MR")); break; + case CountryCodeMU: writer->WriteValue(TEXT("MU")); break; + case CountryCodeYT: writer->WriteValue(TEXT("YT")); break; + case CountryCodeMX: writer->WriteValue(TEXT("MX")); break; + case CountryCodeFM: writer->WriteValue(TEXT("FM")); break; + case CountryCodeMD: writer->WriteValue(TEXT("MD")); break; + case CountryCodeMC: writer->WriteValue(TEXT("MC")); break; + case CountryCodeMN: writer->WriteValue(TEXT("MN")); break; + case CountryCodeME: writer->WriteValue(TEXT("ME")); break; + case CountryCodeMS: writer->WriteValue(TEXT("MS")); break; + case CountryCodeMA: writer->WriteValue(TEXT("MA")); break; + case CountryCodeMZ: writer->WriteValue(TEXT("MZ")); break; + case CountryCodeMM: writer->WriteValue(TEXT("MM")); break; + case CountryCodeNA: writer->WriteValue(TEXT("NA")); break; + case CountryCodeNR: writer->WriteValue(TEXT("NR")); break; + case CountryCodeNP: writer->WriteValue(TEXT("NP")); break; + case CountryCodeNL: writer->WriteValue(TEXT("NL")); break; + case CountryCodeNC: writer->WriteValue(TEXT("NC")); break; + case CountryCodeNZ: writer->WriteValue(TEXT("NZ")); break; + case CountryCodeNI: writer->WriteValue(TEXT("NI")); break; + case CountryCodeNE: writer->WriteValue(TEXT("NE")); break; + case CountryCodeNG: writer->WriteValue(TEXT("NG")); break; + case CountryCodeNU: writer->WriteValue(TEXT("NU")); break; + case CountryCodeNF: writer->WriteValue(TEXT("NF")); break; + case CountryCodeMP: writer->WriteValue(TEXT("MP")); break; + case CountryCodeNO: writer->WriteValue(TEXT("NO")); break; + case CountryCodeOM: writer->WriteValue(TEXT("OM")); break; + case CountryCodePK: writer->WriteValue(TEXT("PK")); break; + case CountryCodePW: writer->WriteValue(TEXT("PW")); break; + case CountryCodePS: writer->WriteValue(TEXT("PS")); break; + case CountryCodePA: writer->WriteValue(TEXT("PA")); break; + case CountryCodePG: writer->WriteValue(TEXT("PG")); break; + case CountryCodePY: writer->WriteValue(TEXT("PY")); break; + case CountryCodePE: writer->WriteValue(TEXT("PE")); break; + case CountryCodePH: writer->WriteValue(TEXT("PH")); break; + case CountryCodePN: writer->WriteValue(TEXT("PN")); break; + case CountryCodePL: writer->WriteValue(TEXT("PL")); break; + case CountryCodePT: writer->WriteValue(TEXT("PT")); break; + case CountryCodePR: writer->WriteValue(TEXT("PR")); break; + case CountryCodeQA: writer->WriteValue(TEXT("QA")); break; + case CountryCodeRE: writer->WriteValue(TEXT("RE")); break; + case CountryCodeRO: writer->WriteValue(TEXT("RO")); break; + case CountryCodeRU: writer->WriteValue(TEXT("RU")); break; + case CountryCodeRW: writer->WriteValue(TEXT("RW")); break; + case CountryCodeBL: writer->WriteValue(TEXT("BL")); break; + case CountryCodeSH: writer->WriteValue(TEXT("SH")); break; + case CountryCodeKN: writer->WriteValue(TEXT("KN")); break; + case CountryCodeLC: writer->WriteValue(TEXT("LC")); break; + case CountryCodeMF: writer->WriteValue(TEXT("MF")); break; + case CountryCodePM: writer->WriteValue(TEXT("PM")); break; + case CountryCodeVC: writer->WriteValue(TEXT("VC")); break; + case CountryCodeWS: writer->WriteValue(TEXT("WS")); break; + case CountryCodeSM: writer->WriteValue(TEXT("SM")); break; + case CountryCodeST: writer->WriteValue(TEXT("ST")); break; + case CountryCodeSA: writer->WriteValue(TEXT("SA")); break; + case CountryCodeSN: writer->WriteValue(TEXT("SN")); break; + case CountryCodeRS: writer->WriteValue(TEXT("RS")); break; + case CountryCodeSC: writer->WriteValue(TEXT("SC")); break; + case CountryCodeSL: writer->WriteValue(TEXT("SL")); break; + case CountryCodeSG: writer->WriteValue(TEXT("SG")); break; + case CountryCodeSX: writer->WriteValue(TEXT("SX")); break; + case CountryCodeSK: writer->WriteValue(TEXT("SK")); break; + case CountryCodeSI: writer->WriteValue(TEXT("SI")); break; + case CountryCodeSB: writer->WriteValue(TEXT("SB")); break; + case CountryCodeSO: writer->WriteValue(TEXT("SO")); break; + case CountryCodeZA: writer->WriteValue(TEXT("ZA")); break; + case CountryCodeGS: writer->WriteValue(TEXT("GS")); break; + case CountryCodeSS: writer->WriteValue(TEXT("SS")); break; + case CountryCodeES: writer->WriteValue(TEXT("ES")); break; + case CountryCodeLK: writer->WriteValue(TEXT("LK")); break; + case CountryCodeSD: writer->WriteValue(TEXT("SD")); break; + case CountryCodeSR: writer->WriteValue(TEXT("SR")); break; + case CountryCodeSJ: writer->WriteValue(TEXT("SJ")); break; + case CountryCodeSZ: writer->WriteValue(TEXT("SZ")); break; + case CountryCodeSE: writer->WriteValue(TEXT("SE")); break; + case CountryCodeCH: writer->WriteValue(TEXT("CH")); break; + case CountryCodeSY: writer->WriteValue(TEXT("SY")); break; + case CountryCodeTW: writer->WriteValue(TEXT("TW")); break; + case CountryCodeTJ: writer->WriteValue(TEXT("TJ")); break; + case CountryCodeTZ: writer->WriteValue(TEXT("TZ")); break; + case CountryCodeTH: writer->WriteValue(TEXT("TH")); break; + case CountryCodeTL: writer->WriteValue(TEXT("TL")); break; + case CountryCodeTG: writer->WriteValue(TEXT("TG")); break; + case CountryCodeTK: writer->WriteValue(TEXT("TK")); break; + case CountryCodeTO: writer->WriteValue(TEXT("TO")); break; + case CountryCodeTT: writer->WriteValue(TEXT("TT")); break; + case CountryCodeTN: writer->WriteValue(TEXT("TN")); break; + case CountryCodeTR: writer->WriteValue(TEXT("TR")); break; + case CountryCodeTM: writer->WriteValue(TEXT("TM")); break; + case CountryCodeTC: writer->WriteValue(TEXT("TC")); break; + case CountryCodeTV: writer->WriteValue(TEXT("TV")); break; + case CountryCodeUG: writer->WriteValue(TEXT("UG")); break; + case CountryCodeUA: writer->WriteValue(TEXT("UA")); break; + case CountryCodeAE: writer->WriteValue(TEXT("AE")); break; + case CountryCodeGB: writer->WriteValue(TEXT("GB")); break; + case CountryCodeUS: writer->WriteValue(TEXT("US")); break; + case CountryCodeUM: writer->WriteValue(TEXT("UM")); break; + case CountryCodeUY: writer->WriteValue(TEXT("UY")); break; + case CountryCodeUZ: writer->WriteValue(TEXT("UZ")); break; + case CountryCodeVU: writer->WriteValue(TEXT("VU")); break; + case CountryCodeVE: writer->WriteValue(TEXT("VE")); break; + case CountryCodeVN: writer->WriteValue(TEXT("VN")); break; + case CountryCodeVG: writer->WriteValue(TEXT("VG")); break; + case CountryCodeVI: writer->WriteValue(TEXT("VI")); break; + case CountryCodeWF: writer->WriteValue(TEXT("WF")); break; + case CountryCodeEH: writer->WriteValue(TEXT("EH")); break; + case CountryCodeYE: writer->WriteValue(TEXT("YE")); break; + case CountryCodeZM: writer->WriteValue(TEXT("ZM")); break; + case CountryCodeZW: writer->WriteValue(TEXT("ZW")); break; + } +} + +ClientModels::CountryCode PlayFab::ClientModels::readCountryCodeFromValue(const TSharedPtr& value) +{ + return readCountryCodeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::CountryCode PlayFab::ClientModels::readCountryCodeFromValue(const FString& value) +{ + static TMap _CountryCodeMap; + if (_CountryCodeMap.Num() == 0) + { + // Auto-generate the map on the first use + _CountryCodeMap.Add(TEXT("AF"), CountryCodeAF); + _CountryCodeMap.Add(TEXT("AX"), CountryCodeAX); + _CountryCodeMap.Add(TEXT("AL"), CountryCodeAL); + _CountryCodeMap.Add(TEXT("DZ"), CountryCodeDZ); + _CountryCodeMap.Add(TEXT("AS"), CountryCodeAS); + _CountryCodeMap.Add(TEXT("AD"), CountryCodeAD); + _CountryCodeMap.Add(TEXT("AO"), CountryCodeAO); + _CountryCodeMap.Add(TEXT("AI"), CountryCodeAI); + _CountryCodeMap.Add(TEXT("AQ"), CountryCodeAQ); + _CountryCodeMap.Add(TEXT("AG"), CountryCodeAG); + _CountryCodeMap.Add(TEXT("AR"), CountryCodeAR); + _CountryCodeMap.Add(TEXT("AM"), CountryCodeAM); + _CountryCodeMap.Add(TEXT("AW"), CountryCodeAW); + _CountryCodeMap.Add(TEXT("AU"), CountryCodeAU); + _CountryCodeMap.Add(TEXT("AT"), CountryCodeAT); + _CountryCodeMap.Add(TEXT("AZ"), CountryCodeAZ); + _CountryCodeMap.Add(TEXT("BS"), CountryCodeBS); + _CountryCodeMap.Add(TEXT("BH"), CountryCodeBH); + _CountryCodeMap.Add(TEXT("BD"), CountryCodeBD); + _CountryCodeMap.Add(TEXT("BB"), CountryCodeBB); + _CountryCodeMap.Add(TEXT("BY"), CountryCodeBY); + _CountryCodeMap.Add(TEXT("BE"), CountryCodeBE); + _CountryCodeMap.Add(TEXT("BZ"), CountryCodeBZ); + _CountryCodeMap.Add(TEXT("BJ"), CountryCodeBJ); + _CountryCodeMap.Add(TEXT("BM"), CountryCodeBM); + _CountryCodeMap.Add(TEXT("BT"), CountryCodeBT); + _CountryCodeMap.Add(TEXT("BO"), CountryCodeBO); + _CountryCodeMap.Add(TEXT("BQ"), CountryCodeBQ); + _CountryCodeMap.Add(TEXT("BA"), CountryCodeBA); + _CountryCodeMap.Add(TEXT("BW"), CountryCodeBW); + _CountryCodeMap.Add(TEXT("BV"), CountryCodeBV); + _CountryCodeMap.Add(TEXT("BR"), CountryCodeBR); + _CountryCodeMap.Add(TEXT("IO"), CountryCodeIO); + _CountryCodeMap.Add(TEXT("BN"), CountryCodeBN); + _CountryCodeMap.Add(TEXT("BG"), CountryCodeBG); + _CountryCodeMap.Add(TEXT("BF"), CountryCodeBF); + _CountryCodeMap.Add(TEXT("BI"), CountryCodeBI); + _CountryCodeMap.Add(TEXT("KH"), CountryCodeKH); + _CountryCodeMap.Add(TEXT("CM"), CountryCodeCM); + _CountryCodeMap.Add(TEXT("CA"), CountryCodeCA); + _CountryCodeMap.Add(TEXT("CV"), CountryCodeCV); + _CountryCodeMap.Add(TEXT("KY"), CountryCodeKY); + _CountryCodeMap.Add(TEXT("CF"), CountryCodeCF); + _CountryCodeMap.Add(TEXT("TD"), CountryCodeTD); + _CountryCodeMap.Add(TEXT("CL"), CountryCodeCL); + _CountryCodeMap.Add(TEXT("CN"), CountryCodeCN); + _CountryCodeMap.Add(TEXT("CX"), CountryCodeCX); + _CountryCodeMap.Add(TEXT("CC"), CountryCodeCC); + _CountryCodeMap.Add(TEXT("CO"), CountryCodeCO); + _CountryCodeMap.Add(TEXT("KM"), CountryCodeKM); + _CountryCodeMap.Add(TEXT("CG"), CountryCodeCG); + _CountryCodeMap.Add(TEXT("CD"), CountryCodeCD); + _CountryCodeMap.Add(TEXT("CK"), CountryCodeCK); + _CountryCodeMap.Add(TEXT("CR"), CountryCodeCR); + _CountryCodeMap.Add(TEXT("CI"), CountryCodeCI); + _CountryCodeMap.Add(TEXT("HR"), CountryCodeHR); + _CountryCodeMap.Add(TEXT("CU"), CountryCodeCU); + _CountryCodeMap.Add(TEXT("CW"), CountryCodeCW); + _CountryCodeMap.Add(TEXT("CY"), CountryCodeCY); + _CountryCodeMap.Add(TEXT("CZ"), CountryCodeCZ); + _CountryCodeMap.Add(TEXT("DK"), CountryCodeDK); + _CountryCodeMap.Add(TEXT("DJ"), CountryCodeDJ); + _CountryCodeMap.Add(TEXT("DM"), CountryCodeDM); + _CountryCodeMap.Add(TEXT("DO"), CountryCodeDO); + _CountryCodeMap.Add(TEXT("EC"), CountryCodeEC); + _CountryCodeMap.Add(TEXT("EG"), CountryCodeEG); + _CountryCodeMap.Add(TEXT("SV"), CountryCodeSV); + _CountryCodeMap.Add(TEXT("GQ"), CountryCodeGQ); + _CountryCodeMap.Add(TEXT("ER"), CountryCodeER); + _CountryCodeMap.Add(TEXT("EE"), CountryCodeEE); + _CountryCodeMap.Add(TEXT("ET"), CountryCodeET); + _CountryCodeMap.Add(TEXT("FK"), CountryCodeFK); + _CountryCodeMap.Add(TEXT("FO"), CountryCodeFO); + _CountryCodeMap.Add(TEXT("FJ"), CountryCodeFJ); + _CountryCodeMap.Add(TEXT("FI"), CountryCodeFI); + _CountryCodeMap.Add(TEXT("FR"), CountryCodeFR); + _CountryCodeMap.Add(TEXT("GF"), CountryCodeGF); + _CountryCodeMap.Add(TEXT("PF"), CountryCodePF); + _CountryCodeMap.Add(TEXT("TF"), CountryCodeTF); + _CountryCodeMap.Add(TEXT("GA"), CountryCodeGA); + _CountryCodeMap.Add(TEXT("GM"), CountryCodeGM); + _CountryCodeMap.Add(TEXT("GE"), CountryCodeGE); + _CountryCodeMap.Add(TEXT("DE"), CountryCodeDE); + _CountryCodeMap.Add(TEXT("GH"), CountryCodeGH); + _CountryCodeMap.Add(TEXT("GI"), CountryCodeGI); + _CountryCodeMap.Add(TEXT("GR"), CountryCodeGR); + _CountryCodeMap.Add(TEXT("GL"), CountryCodeGL); + _CountryCodeMap.Add(TEXT("GD"), CountryCodeGD); + _CountryCodeMap.Add(TEXT("GP"), CountryCodeGP); + _CountryCodeMap.Add(TEXT("GU"), CountryCodeGU); + _CountryCodeMap.Add(TEXT("GT"), CountryCodeGT); + _CountryCodeMap.Add(TEXT("GG"), CountryCodeGG); + _CountryCodeMap.Add(TEXT("GN"), CountryCodeGN); + _CountryCodeMap.Add(TEXT("GW"), CountryCodeGW); + _CountryCodeMap.Add(TEXT("GY"), CountryCodeGY); + _CountryCodeMap.Add(TEXT("HT"), CountryCodeHT); + _CountryCodeMap.Add(TEXT("HM"), CountryCodeHM); + _CountryCodeMap.Add(TEXT("VA"), CountryCodeVA); + _CountryCodeMap.Add(TEXT("HN"), CountryCodeHN); + _CountryCodeMap.Add(TEXT("HK"), CountryCodeHK); + _CountryCodeMap.Add(TEXT("HU"), CountryCodeHU); + _CountryCodeMap.Add(TEXT("IS"), CountryCodeIS); + _CountryCodeMap.Add(TEXT("IN"), CountryCodeIN); + _CountryCodeMap.Add(TEXT("ID"), CountryCodeID); + _CountryCodeMap.Add(TEXT("IR"), CountryCodeIR); + _CountryCodeMap.Add(TEXT("IQ"), CountryCodeIQ); + _CountryCodeMap.Add(TEXT("IE"), CountryCodeIE); + _CountryCodeMap.Add(TEXT("IM"), CountryCodeIM); + _CountryCodeMap.Add(TEXT("IL"), CountryCodeIL); + _CountryCodeMap.Add(TEXT("IT"), CountryCodeIT); + _CountryCodeMap.Add(TEXT("JM"), CountryCodeJM); + _CountryCodeMap.Add(TEXT("JP"), CountryCodeJP); + _CountryCodeMap.Add(TEXT("JE"), CountryCodeJE); + _CountryCodeMap.Add(TEXT("JO"), CountryCodeJO); + _CountryCodeMap.Add(TEXT("KZ"), CountryCodeKZ); + _CountryCodeMap.Add(TEXT("KE"), CountryCodeKE); + _CountryCodeMap.Add(TEXT("KI"), CountryCodeKI); + _CountryCodeMap.Add(TEXT("KP"), CountryCodeKP); + _CountryCodeMap.Add(TEXT("KR"), CountryCodeKR); + _CountryCodeMap.Add(TEXT("KW"), CountryCodeKW); + _CountryCodeMap.Add(TEXT("KG"), CountryCodeKG); + _CountryCodeMap.Add(TEXT("LA"), CountryCodeLA); + _CountryCodeMap.Add(TEXT("LV"), CountryCodeLV); + _CountryCodeMap.Add(TEXT("LB"), CountryCodeLB); + _CountryCodeMap.Add(TEXT("LS"), CountryCodeLS); + _CountryCodeMap.Add(TEXT("LR"), CountryCodeLR); + _CountryCodeMap.Add(TEXT("LY"), CountryCodeLY); + _CountryCodeMap.Add(TEXT("LI"), CountryCodeLI); + _CountryCodeMap.Add(TEXT("LT"), CountryCodeLT); + _CountryCodeMap.Add(TEXT("LU"), CountryCodeLU); + _CountryCodeMap.Add(TEXT("MO"), CountryCodeMO); + _CountryCodeMap.Add(TEXT("MK"), CountryCodeMK); + _CountryCodeMap.Add(TEXT("MG"), CountryCodeMG); + _CountryCodeMap.Add(TEXT("MW"), CountryCodeMW); + _CountryCodeMap.Add(TEXT("MY"), CountryCodeMY); + _CountryCodeMap.Add(TEXT("MV"), CountryCodeMV); + _CountryCodeMap.Add(TEXT("ML"), CountryCodeML); + _CountryCodeMap.Add(TEXT("MT"), CountryCodeMT); + _CountryCodeMap.Add(TEXT("MH"), CountryCodeMH); + _CountryCodeMap.Add(TEXT("MQ"), CountryCodeMQ); + _CountryCodeMap.Add(TEXT("MR"), CountryCodeMR); + _CountryCodeMap.Add(TEXT("MU"), CountryCodeMU); + _CountryCodeMap.Add(TEXT("YT"), CountryCodeYT); + _CountryCodeMap.Add(TEXT("MX"), CountryCodeMX); + _CountryCodeMap.Add(TEXT("FM"), CountryCodeFM); + _CountryCodeMap.Add(TEXT("MD"), CountryCodeMD); + _CountryCodeMap.Add(TEXT("MC"), CountryCodeMC); + _CountryCodeMap.Add(TEXT("MN"), CountryCodeMN); + _CountryCodeMap.Add(TEXT("ME"), CountryCodeME); + _CountryCodeMap.Add(TEXT("MS"), CountryCodeMS); + _CountryCodeMap.Add(TEXT("MA"), CountryCodeMA); + _CountryCodeMap.Add(TEXT("MZ"), CountryCodeMZ); + _CountryCodeMap.Add(TEXT("MM"), CountryCodeMM); + _CountryCodeMap.Add(TEXT("NA"), CountryCodeNA); + _CountryCodeMap.Add(TEXT("NR"), CountryCodeNR); + _CountryCodeMap.Add(TEXT("NP"), CountryCodeNP); + _CountryCodeMap.Add(TEXT("NL"), CountryCodeNL); + _CountryCodeMap.Add(TEXT("NC"), CountryCodeNC); + _CountryCodeMap.Add(TEXT("NZ"), CountryCodeNZ); + _CountryCodeMap.Add(TEXT("NI"), CountryCodeNI); + _CountryCodeMap.Add(TEXT("NE"), CountryCodeNE); + _CountryCodeMap.Add(TEXT("NG"), CountryCodeNG); + _CountryCodeMap.Add(TEXT("NU"), CountryCodeNU); + _CountryCodeMap.Add(TEXT("NF"), CountryCodeNF); + _CountryCodeMap.Add(TEXT("MP"), CountryCodeMP); + _CountryCodeMap.Add(TEXT("NO"), CountryCodeNO); + _CountryCodeMap.Add(TEXT("OM"), CountryCodeOM); + _CountryCodeMap.Add(TEXT("PK"), CountryCodePK); + _CountryCodeMap.Add(TEXT("PW"), CountryCodePW); + _CountryCodeMap.Add(TEXT("PS"), CountryCodePS); + _CountryCodeMap.Add(TEXT("PA"), CountryCodePA); + _CountryCodeMap.Add(TEXT("PG"), CountryCodePG); + _CountryCodeMap.Add(TEXT("PY"), CountryCodePY); + _CountryCodeMap.Add(TEXT("PE"), CountryCodePE); + _CountryCodeMap.Add(TEXT("PH"), CountryCodePH); + _CountryCodeMap.Add(TEXT("PN"), CountryCodePN); + _CountryCodeMap.Add(TEXT("PL"), CountryCodePL); + _CountryCodeMap.Add(TEXT("PT"), CountryCodePT); + _CountryCodeMap.Add(TEXT("PR"), CountryCodePR); + _CountryCodeMap.Add(TEXT("QA"), CountryCodeQA); + _CountryCodeMap.Add(TEXT("RE"), CountryCodeRE); + _CountryCodeMap.Add(TEXT("RO"), CountryCodeRO); + _CountryCodeMap.Add(TEXT("RU"), CountryCodeRU); + _CountryCodeMap.Add(TEXT("RW"), CountryCodeRW); + _CountryCodeMap.Add(TEXT("BL"), CountryCodeBL); + _CountryCodeMap.Add(TEXT("SH"), CountryCodeSH); + _CountryCodeMap.Add(TEXT("KN"), CountryCodeKN); + _CountryCodeMap.Add(TEXT("LC"), CountryCodeLC); + _CountryCodeMap.Add(TEXT("MF"), CountryCodeMF); + _CountryCodeMap.Add(TEXT("PM"), CountryCodePM); + _CountryCodeMap.Add(TEXT("VC"), CountryCodeVC); + _CountryCodeMap.Add(TEXT("WS"), CountryCodeWS); + _CountryCodeMap.Add(TEXT("SM"), CountryCodeSM); + _CountryCodeMap.Add(TEXT("ST"), CountryCodeST); + _CountryCodeMap.Add(TEXT("SA"), CountryCodeSA); + _CountryCodeMap.Add(TEXT("SN"), CountryCodeSN); + _CountryCodeMap.Add(TEXT("RS"), CountryCodeRS); + _CountryCodeMap.Add(TEXT("SC"), CountryCodeSC); + _CountryCodeMap.Add(TEXT("SL"), CountryCodeSL); + _CountryCodeMap.Add(TEXT("SG"), CountryCodeSG); + _CountryCodeMap.Add(TEXT("SX"), CountryCodeSX); + _CountryCodeMap.Add(TEXT("SK"), CountryCodeSK); + _CountryCodeMap.Add(TEXT("SI"), CountryCodeSI); + _CountryCodeMap.Add(TEXT("SB"), CountryCodeSB); + _CountryCodeMap.Add(TEXT("SO"), CountryCodeSO); + _CountryCodeMap.Add(TEXT("ZA"), CountryCodeZA); + _CountryCodeMap.Add(TEXT("GS"), CountryCodeGS); + _CountryCodeMap.Add(TEXT("SS"), CountryCodeSS); + _CountryCodeMap.Add(TEXT("ES"), CountryCodeES); + _CountryCodeMap.Add(TEXT("LK"), CountryCodeLK); + _CountryCodeMap.Add(TEXT("SD"), CountryCodeSD); + _CountryCodeMap.Add(TEXT("SR"), CountryCodeSR); + _CountryCodeMap.Add(TEXT("SJ"), CountryCodeSJ); + _CountryCodeMap.Add(TEXT("SZ"), CountryCodeSZ); + _CountryCodeMap.Add(TEXT("SE"), CountryCodeSE); + _CountryCodeMap.Add(TEXT("CH"), CountryCodeCH); + _CountryCodeMap.Add(TEXT("SY"), CountryCodeSY); + _CountryCodeMap.Add(TEXT("TW"), CountryCodeTW); + _CountryCodeMap.Add(TEXT("TJ"), CountryCodeTJ); + _CountryCodeMap.Add(TEXT("TZ"), CountryCodeTZ); + _CountryCodeMap.Add(TEXT("TH"), CountryCodeTH); + _CountryCodeMap.Add(TEXT("TL"), CountryCodeTL); + _CountryCodeMap.Add(TEXT("TG"), CountryCodeTG); + _CountryCodeMap.Add(TEXT("TK"), CountryCodeTK); + _CountryCodeMap.Add(TEXT("TO"), CountryCodeTO); + _CountryCodeMap.Add(TEXT("TT"), CountryCodeTT); + _CountryCodeMap.Add(TEXT("TN"), CountryCodeTN); + _CountryCodeMap.Add(TEXT("TR"), CountryCodeTR); + _CountryCodeMap.Add(TEXT("TM"), CountryCodeTM); + _CountryCodeMap.Add(TEXT("TC"), CountryCodeTC); + _CountryCodeMap.Add(TEXT("TV"), CountryCodeTV); + _CountryCodeMap.Add(TEXT("UG"), CountryCodeUG); + _CountryCodeMap.Add(TEXT("UA"), CountryCodeUA); + _CountryCodeMap.Add(TEXT("AE"), CountryCodeAE); + _CountryCodeMap.Add(TEXT("GB"), CountryCodeGB); + _CountryCodeMap.Add(TEXT("US"), CountryCodeUS); + _CountryCodeMap.Add(TEXT("UM"), CountryCodeUM); + _CountryCodeMap.Add(TEXT("UY"), CountryCodeUY); + _CountryCodeMap.Add(TEXT("UZ"), CountryCodeUZ); + _CountryCodeMap.Add(TEXT("VU"), CountryCodeVU); + _CountryCodeMap.Add(TEXT("VE"), CountryCodeVE); + _CountryCodeMap.Add(TEXT("VN"), CountryCodeVN); + _CountryCodeMap.Add(TEXT("VG"), CountryCodeVG); + _CountryCodeMap.Add(TEXT("VI"), CountryCodeVI); + _CountryCodeMap.Add(TEXT("WF"), CountryCodeWF); + _CountryCodeMap.Add(TEXT("EH"), CountryCodeEH); + _CountryCodeMap.Add(TEXT("YE"), CountryCodeYE); + _CountryCodeMap.Add(TEXT("ZM"), CountryCodeZM); + _CountryCodeMap.Add(TEXT("ZW"), CountryCodeZW); + + } + + if (!value.IsEmpty()) + { + auto output = _CountryCodeMap.Find(value); + if (output != nullptr) + return *output; + } + + return CountryCodeAF; // Basically critical fail +} + +PlayFab::ClientModels::FCreateSharedGroupRequest::~FCreateSharedGroupRequest() +{ + +} + +void PlayFab::ClientModels::FCreateSharedGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SharedGroupId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCreateSharedGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCreateSharedGroupResult::~FCreateSharedGroupResult() +{ + +} + +void PlayFab::ClientModels::FCreateSharedGroupResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SharedGroupId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCreateSharedGroupResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeCurrencyEnumJSON(Currency enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CurrencyAED: writer->WriteValue(TEXT("AED")); break; + case CurrencyAFN: writer->WriteValue(TEXT("AFN")); break; + case CurrencyALL: writer->WriteValue(TEXT("ALL")); break; + case CurrencyAMD: writer->WriteValue(TEXT("AMD")); break; + case CurrencyANG: writer->WriteValue(TEXT("ANG")); break; + case CurrencyAOA: writer->WriteValue(TEXT("AOA")); break; + case CurrencyARS: writer->WriteValue(TEXT("ARS")); break; + case CurrencyAUD: writer->WriteValue(TEXT("AUD")); break; + case CurrencyAWG: writer->WriteValue(TEXT("AWG")); break; + case CurrencyAZN: writer->WriteValue(TEXT("AZN")); break; + case CurrencyBAM: writer->WriteValue(TEXT("BAM")); break; + case CurrencyBBD: writer->WriteValue(TEXT("BBD")); break; + case CurrencyBDT: writer->WriteValue(TEXT("BDT")); break; + case CurrencyBGN: writer->WriteValue(TEXT("BGN")); break; + case CurrencyBHD: writer->WriteValue(TEXT("BHD")); break; + case CurrencyBIF: writer->WriteValue(TEXT("BIF")); break; + case CurrencyBMD: writer->WriteValue(TEXT("BMD")); break; + case CurrencyBND: writer->WriteValue(TEXT("BND")); break; + case CurrencyBOB: writer->WriteValue(TEXT("BOB")); break; + case CurrencyBRL: writer->WriteValue(TEXT("BRL")); break; + case CurrencyBSD: writer->WriteValue(TEXT("BSD")); break; + case CurrencyBTN: writer->WriteValue(TEXT("BTN")); break; + case CurrencyBWP: writer->WriteValue(TEXT("BWP")); break; + case CurrencyBYR: writer->WriteValue(TEXT("BYR")); break; + case CurrencyBZD: writer->WriteValue(TEXT("BZD")); break; + case CurrencyCAD: writer->WriteValue(TEXT("CAD")); break; + case CurrencyCDF: writer->WriteValue(TEXT("CDF")); break; + case CurrencyCHF: writer->WriteValue(TEXT("CHF")); break; + case CurrencyCLP: writer->WriteValue(TEXT("CLP")); break; + case CurrencyCNY: writer->WriteValue(TEXT("CNY")); break; + case CurrencyCOP: writer->WriteValue(TEXT("COP")); break; + case CurrencyCRC: writer->WriteValue(TEXT("CRC")); break; + case CurrencyCUC: writer->WriteValue(TEXT("CUC")); break; + case CurrencyCUP: writer->WriteValue(TEXT("CUP")); break; + case CurrencyCVE: writer->WriteValue(TEXT("CVE")); break; + case CurrencyCZK: writer->WriteValue(TEXT("CZK")); break; + case CurrencyDJF: writer->WriteValue(TEXT("DJF")); break; + case CurrencyDKK: writer->WriteValue(TEXT("DKK")); break; + case CurrencyDOP: writer->WriteValue(TEXT("DOP")); break; + case CurrencyDZD: writer->WriteValue(TEXT("DZD")); break; + case CurrencyEGP: writer->WriteValue(TEXT("EGP")); break; + case CurrencyERN: writer->WriteValue(TEXT("ERN")); break; + case CurrencyETB: writer->WriteValue(TEXT("ETB")); break; + case CurrencyEUR: writer->WriteValue(TEXT("EUR")); break; + case CurrencyFJD: writer->WriteValue(TEXT("FJD")); break; + case CurrencyFKP: writer->WriteValue(TEXT("FKP")); break; + case CurrencyGBP: writer->WriteValue(TEXT("GBP")); break; + case CurrencyGEL: writer->WriteValue(TEXT("GEL")); break; + case CurrencyGGP: writer->WriteValue(TEXT("GGP")); break; + case CurrencyGHS: writer->WriteValue(TEXT("GHS")); break; + case CurrencyGIP: writer->WriteValue(TEXT("GIP")); break; + case CurrencyGMD: writer->WriteValue(TEXT("GMD")); break; + case CurrencyGNF: writer->WriteValue(TEXT("GNF")); break; + case CurrencyGTQ: writer->WriteValue(TEXT("GTQ")); break; + case CurrencyGYD: writer->WriteValue(TEXT("GYD")); break; + case CurrencyHKD: writer->WriteValue(TEXT("HKD")); break; + case CurrencyHNL: writer->WriteValue(TEXT("HNL")); break; + case CurrencyHRK: writer->WriteValue(TEXT("HRK")); break; + case CurrencyHTG: writer->WriteValue(TEXT("HTG")); break; + case CurrencyHUF: writer->WriteValue(TEXT("HUF")); break; + case CurrencyIDR: writer->WriteValue(TEXT("IDR")); break; + case CurrencyILS: writer->WriteValue(TEXT("ILS")); break; + case CurrencyIMP: writer->WriteValue(TEXT("IMP")); break; + case CurrencyINR: writer->WriteValue(TEXT("INR")); break; + case CurrencyIQD: writer->WriteValue(TEXT("IQD")); break; + case CurrencyIRR: writer->WriteValue(TEXT("IRR")); break; + case CurrencyISK: writer->WriteValue(TEXT("ISK")); break; + case CurrencyJEP: writer->WriteValue(TEXT("JEP")); break; + case CurrencyJMD: writer->WriteValue(TEXT("JMD")); break; + case CurrencyJOD: writer->WriteValue(TEXT("JOD")); break; + case CurrencyJPY: writer->WriteValue(TEXT("JPY")); break; + case CurrencyKES: writer->WriteValue(TEXT("KES")); break; + case CurrencyKGS: writer->WriteValue(TEXT("KGS")); break; + case CurrencyKHR: writer->WriteValue(TEXT("KHR")); break; + case CurrencyKMF: writer->WriteValue(TEXT("KMF")); break; + case CurrencyKPW: writer->WriteValue(TEXT("KPW")); break; + case CurrencyKRW: writer->WriteValue(TEXT("KRW")); break; + case CurrencyKWD: writer->WriteValue(TEXT("KWD")); break; + case CurrencyKYD: writer->WriteValue(TEXT("KYD")); break; + case CurrencyKZT: writer->WriteValue(TEXT("KZT")); break; + case CurrencyLAK: writer->WriteValue(TEXT("LAK")); break; + case CurrencyLBP: writer->WriteValue(TEXT("LBP")); break; + case CurrencyLKR: writer->WriteValue(TEXT("LKR")); break; + case CurrencyLRD: writer->WriteValue(TEXT("LRD")); break; + case CurrencyLSL: writer->WriteValue(TEXT("LSL")); break; + case CurrencyLYD: writer->WriteValue(TEXT("LYD")); break; + case CurrencyMAD: writer->WriteValue(TEXT("MAD")); break; + case CurrencyMDL: writer->WriteValue(TEXT("MDL")); break; + case CurrencyMGA: writer->WriteValue(TEXT("MGA")); break; + case CurrencyMKD: writer->WriteValue(TEXT("MKD")); break; + case CurrencyMMK: writer->WriteValue(TEXT("MMK")); break; + case CurrencyMNT: writer->WriteValue(TEXT("MNT")); break; + case CurrencyMOP: writer->WriteValue(TEXT("MOP")); break; + case CurrencyMRO: writer->WriteValue(TEXT("MRO")); break; + case CurrencyMUR: writer->WriteValue(TEXT("MUR")); break; + case CurrencyMVR: writer->WriteValue(TEXT("MVR")); break; + case CurrencyMWK: writer->WriteValue(TEXT("MWK")); break; + case CurrencyMXN: writer->WriteValue(TEXT("MXN")); break; + case CurrencyMYR: writer->WriteValue(TEXT("MYR")); break; + case CurrencyMZN: writer->WriteValue(TEXT("MZN")); break; + case CurrencyNAD: writer->WriteValue(TEXT("NAD")); break; + case CurrencyNGN: writer->WriteValue(TEXT("NGN")); break; + case CurrencyNIO: writer->WriteValue(TEXT("NIO")); break; + case CurrencyNOK: writer->WriteValue(TEXT("NOK")); break; + case CurrencyNPR: writer->WriteValue(TEXT("NPR")); break; + case CurrencyNZD: writer->WriteValue(TEXT("NZD")); break; + case CurrencyOMR: writer->WriteValue(TEXT("OMR")); break; + case CurrencyPAB: writer->WriteValue(TEXT("PAB")); break; + case CurrencyPEN: writer->WriteValue(TEXT("PEN")); break; + case CurrencyPGK: writer->WriteValue(TEXT("PGK")); break; + case CurrencyPHP: writer->WriteValue(TEXT("PHP")); break; + case CurrencyPKR: writer->WriteValue(TEXT("PKR")); break; + case CurrencyPLN: writer->WriteValue(TEXT("PLN")); break; + case CurrencyPYG: writer->WriteValue(TEXT("PYG")); break; + case CurrencyQAR: writer->WriteValue(TEXT("QAR")); break; + case CurrencyRON: writer->WriteValue(TEXT("RON")); break; + case CurrencyRSD: writer->WriteValue(TEXT("RSD")); break; + case CurrencyRUB: writer->WriteValue(TEXT("RUB")); break; + case CurrencyRWF: writer->WriteValue(TEXT("RWF")); break; + case CurrencySAR: writer->WriteValue(TEXT("SAR")); break; + case CurrencySBD: writer->WriteValue(TEXT("SBD")); break; + case CurrencySCR: writer->WriteValue(TEXT("SCR")); break; + case CurrencySDG: writer->WriteValue(TEXT("SDG")); break; + case CurrencySEK: writer->WriteValue(TEXT("SEK")); break; + case CurrencySGD: writer->WriteValue(TEXT("SGD")); break; + case CurrencySHP: writer->WriteValue(TEXT("SHP")); break; + case CurrencySLL: writer->WriteValue(TEXT("SLL")); break; + case CurrencySOS: writer->WriteValue(TEXT("SOS")); break; + case CurrencySPL: writer->WriteValue(TEXT("SPL")); break; + case CurrencySRD: writer->WriteValue(TEXT("SRD")); break; + case CurrencySTD: writer->WriteValue(TEXT("STD")); break; + case CurrencySVC: writer->WriteValue(TEXT("SVC")); break; + case CurrencySYP: writer->WriteValue(TEXT("SYP")); break; + case CurrencySZL: writer->WriteValue(TEXT("SZL")); break; + case CurrencyTHB: writer->WriteValue(TEXT("THB")); break; + case CurrencyTJS: writer->WriteValue(TEXT("TJS")); break; + case CurrencyTMT: writer->WriteValue(TEXT("TMT")); break; + case CurrencyTND: writer->WriteValue(TEXT("TND")); break; + case CurrencyTOP: writer->WriteValue(TEXT("TOP")); break; + case CurrencyTRY: writer->WriteValue(TEXT("TRY")); break; + case CurrencyTTD: writer->WriteValue(TEXT("TTD")); break; + case CurrencyTVD: writer->WriteValue(TEXT("TVD")); break; + case CurrencyTWD: writer->WriteValue(TEXT("TWD")); break; + case CurrencyTZS: writer->WriteValue(TEXT("TZS")); break; + case CurrencyUAH: writer->WriteValue(TEXT("UAH")); break; + case CurrencyUGX: writer->WriteValue(TEXT("UGX")); break; + case CurrencyUSD: writer->WriteValue(TEXT("USD")); break; + case CurrencyUYU: writer->WriteValue(TEXT("UYU")); break; + case CurrencyUZS: writer->WriteValue(TEXT("UZS")); break; + case CurrencyVEF: writer->WriteValue(TEXT("VEF")); break; + case CurrencyVND: writer->WriteValue(TEXT("VND")); break; + case CurrencyVUV: writer->WriteValue(TEXT("VUV")); break; + case CurrencyWST: writer->WriteValue(TEXT("WST")); break; + case CurrencyXAF: writer->WriteValue(TEXT("XAF")); break; + case CurrencyXCD: writer->WriteValue(TEXT("XCD")); break; + case CurrencyXDR: writer->WriteValue(TEXT("XDR")); break; + case CurrencyXOF: writer->WriteValue(TEXT("XOF")); break; + case CurrencyXPF: writer->WriteValue(TEXT("XPF")); break; + case CurrencyYER: writer->WriteValue(TEXT("YER")); break; + case CurrencyZAR: writer->WriteValue(TEXT("ZAR")); break; + case CurrencyZMW: writer->WriteValue(TEXT("ZMW")); break; + case CurrencyZWD: writer->WriteValue(TEXT("ZWD")); break; + } +} + +ClientModels::Currency PlayFab::ClientModels::readCurrencyFromValue(const TSharedPtr& value) +{ + return readCurrencyFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::Currency PlayFab::ClientModels::readCurrencyFromValue(const FString& value) +{ + static TMap _CurrencyMap; + if (_CurrencyMap.Num() == 0) + { + // Auto-generate the map on the first use + _CurrencyMap.Add(TEXT("AED"), CurrencyAED); + _CurrencyMap.Add(TEXT("AFN"), CurrencyAFN); + _CurrencyMap.Add(TEXT("ALL"), CurrencyALL); + _CurrencyMap.Add(TEXT("AMD"), CurrencyAMD); + _CurrencyMap.Add(TEXT("ANG"), CurrencyANG); + _CurrencyMap.Add(TEXT("AOA"), CurrencyAOA); + _CurrencyMap.Add(TEXT("ARS"), CurrencyARS); + _CurrencyMap.Add(TEXT("AUD"), CurrencyAUD); + _CurrencyMap.Add(TEXT("AWG"), CurrencyAWG); + _CurrencyMap.Add(TEXT("AZN"), CurrencyAZN); + _CurrencyMap.Add(TEXT("BAM"), CurrencyBAM); + _CurrencyMap.Add(TEXT("BBD"), CurrencyBBD); + _CurrencyMap.Add(TEXT("BDT"), CurrencyBDT); + _CurrencyMap.Add(TEXT("BGN"), CurrencyBGN); + _CurrencyMap.Add(TEXT("BHD"), CurrencyBHD); + _CurrencyMap.Add(TEXT("BIF"), CurrencyBIF); + _CurrencyMap.Add(TEXT("BMD"), CurrencyBMD); + _CurrencyMap.Add(TEXT("BND"), CurrencyBND); + _CurrencyMap.Add(TEXT("BOB"), CurrencyBOB); + _CurrencyMap.Add(TEXT("BRL"), CurrencyBRL); + _CurrencyMap.Add(TEXT("BSD"), CurrencyBSD); + _CurrencyMap.Add(TEXT("BTN"), CurrencyBTN); + _CurrencyMap.Add(TEXT("BWP"), CurrencyBWP); + _CurrencyMap.Add(TEXT("BYR"), CurrencyBYR); + _CurrencyMap.Add(TEXT("BZD"), CurrencyBZD); + _CurrencyMap.Add(TEXT("CAD"), CurrencyCAD); + _CurrencyMap.Add(TEXT("CDF"), CurrencyCDF); + _CurrencyMap.Add(TEXT("CHF"), CurrencyCHF); + _CurrencyMap.Add(TEXT("CLP"), CurrencyCLP); + _CurrencyMap.Add(TEXT("CNY"), CurrencyCNY); + _CurrencyMap.Add(TEXT("COP"), CurrencyCOP); + _CurrencyMap.Add(TEXT("CRC"), CurrencyCRC); + _CurrencyMap.Add(TEXT("CUC"), CurrencyCUC); + _CurrencyMap.Add(TEXT("CUP"), CurrencyCUP); + _CurrencyMap.Add(TEXT("CVE"), CurrencyCVE); + _CurrencyMap.Add(TEXT("CZK"), CurrencyCZK); + _CurrencyMap.Add(TEXT("DJF"), CurrencyDJF); + _CurrencyMap.Add(TEXT("DKK"), CurrencyDKK); + _CurrencyMap.Add(TEXT("DOP"), CurrencyDOP); + _CurrencyMap.Add(TEXT("DZD"), CurrencyDZD); + _CurrencyMap.Add(TEXT("EGP"), CurrencyEGP); + _CurrencyMap.Add(TEXT("ERN"), CurrencyERN); + _CurrencyMap.Add(TEXT("ETB"), CurrencyETB); + _CurrencyMap.Add(TEXT("EUR"), CurrencyEUR); + _CurrencyMap.Add(TEXT("FJD"), CurrencyFJD); + _CurrencyMap.Add(TEXT("FKP"), CurrencyFKP); + _CurrencyMap.Add(TEXT("GBP"), CurrencyGBP); + _CurrencyMap.Add(TEXT("GEL"), CurrencyGEL); + _CurrencyMap.Add(TEXT("GGP"), CurrencyGGP); + _CurrencyMap.Add(TEXT("GHS"), CurrencyGHS); + _CurrencyMap.Add(TEXT("GIP"), CurrencyGIP); + _CurrencyMap.Add(TEXT("GMD"), CurrencyGMD); + _CurrencyMap.Add(TEXT("GNF"), CurrencyGNF); + _CurrencyMap.Add(TEXT("GTQ"), CurrencyGTQ); + _CurrencyMap.Add(TEXT("GYD"), CurrencyGYD); + _CurrencyMap.Add(TEXT("HKD"), CurrencyHKD); + _CurrencyMap.Add(TEXT("HNL"), CurrencyHNL); + _CurrencyMap.Add(TEXT("HRK"), CurrencyHRK); + _CurrencyMap.Add(TEXT("HTG"), CurrencyHTG); + _CurrencyMap.Add(TEXT("HUF"), CurrencyHUF); + _CurrencyMap.Add(TEXT("IDR"), CurrencyIDR); + _CurrencyMap.Add(TEXT("ILS"), CurrencyILS); + _CurrencyMap.Add(TEXT("IMP"), CurrencyIMP); + _CurrencyMap.Add(TEXT("INR"), CurrencyINR); + _CurrencyMap.Add(TEXT("IQD"), CurrencyIQD); + _CurrencyMap.Add(TEXT("IRR"), CurrencyIRR); + _CurrencyMap.Add(TEXT("ISK"), CurrencyISK); + _CurrencyMap.Add(TEXT("JEP"), CurrencyJEP); + _CurrencyMap.Add(TEXT("JMD"), CurrencyJMD); + _CurrencyMap.Add(TEXT("JOD"), CurrencyJOD); + _CurrencyMap.Add(TEXT("JPY"), CurrencyJPY); + _CurrencyMap.Add(TEXT("KES"), CurrencyKES); + _CurrencyMap.Add(TEXT("KGS"), CurrencyKGS); + _CurrencyMap.Add(TEXT("KHR"), CurrencyKHR); + _CurrencyMap.Add(TEXT("KMF"), CurrencyKMF); + _CurrencyMap.Add(TEXT("KPW"), CurrencyKPW); + _CurrencyMap.Add(TEXT("KRW"), CurrencyKRW); + _CurrencyMap.Add(TEXT("KWD"), CurrencyKWD); + _CurrencyMap.Add(TEXT("KYD"), CurrencyKYD); + _CurrencyMap.Add(TEXT("KZT"), CurrencyKZT); + _CurrencyMap.Add(TEXT("LAK"), CurrencyLAK); + _CurrencyMap.Add(TEXT("LBP"), CurrencyLBP); + _CurrencyMap.Add(TEXT("LKR"), CurrencyLKR); + _CurrencyMap.Add(TEXT("LRD"), CurrencyLRD); + _CurrencyMap.Add(TEXT("LSL"), CurrencyLSL); + _CurrencyMap.Add(TEXT("LYD"), CurrencyLYD); + _CurrencyMap.Add(TEXT("MAD"), CurrencyMAD); + _CurrencyMap.Add(TEXT("MDL"), CurrencyMDL); + _CurrencyMap.Add(TEXT("MGA"), CurrencyMGA); + _CurrencyMap.Add(TEXT("MKD"), CurrencyMKD); + _CurrencyMap.Add(TEXT("MMK"), CurrencyMMK); + _CurrencyMap.Add(TEXT("MNT"), CurrencyMNT); + _CurrencyMap.Add(TEXT("MOP"), CurrencyMOP); + _CurrencyMap.Add(TEXT("MRO"), CurrencyMRO); + _CurrencyMap.Add(TEXT("MUR"), CurrencyMUR); + _CurrencyMap.Add(TEXT("MVR"), CurrencyMVR); + _CurrencyMap.Add(TEXT("MWK"), CurrencyMWK); + _CurrencyMap.Add(TEXT("MXN"), CurrencyMXN); + _CurrencyMap.Add(TEXT("MYR"), CurrencyMYR); + _CurrencyMap.Add(TEXT("MZN"), CurrencyMZN); + _CurrencyMap.Add(TEXT("NAD"), CurrencyNAD); + _CurrencyMap.Add(TEXT("NGN"), CurrencyNGN); + _CurrencyMap.Add(TEXT("NIO"), CurrencyNIO); + _CurrencyMap.Add(TEXT("NOK"), CurrencyNOK); + _CurrencyMap.Add(TEXT("NPR"), CurrencyNPR); + _CurrencyMap.Add(TEXT("NZD"), CurrencyNZD); + _CurrencyMap.Add(TEXT("OMR"), CurrencyOMR); + _CurrencyMap.Add(TEXT("PAB"), CurrencyPAB); + _CurrencyMap.Add(TEXT("PEN"), CurrencyPEN); + _CurrencyMap.Add(TEXT("PGK"), CurrencyPGK); + _CurrencyMap.Add(TEXT("PHP"), CurrencyPHP); + _CurrencyMap.Add(TEXT("PKR"), CurrencyPKR); + _CurrencyMap.Add(TEXT("PLN"), CurrencyPLN); + _CurrencyMap.Add(TEXT("PYG"), CurrencyPYG); + _CurrencyMap.Add(TEXT("QAR"), CurrencyQAR); + _CurrencyMap.Add(TEXT("RON"), CurrencyRON); + _CurrencyMap.Add(TEXT("RSD"), CurrencyRSD); + _CurrencyMap.Add(TEXT("RUB"), CurrencyRUB); + _CurrencyMap.Add(TEXT("RWF"), CurrencyRWF); + _CurrencyMap.Add(TEXT("SAR"), CurrencySAR); + _CurrencyMap.Add(TEXT("SBD"), CurrencySBD); + _CurrencyMap.Add(TEXT("SCR"), CurrencySCR); + _CurrencyMap.Add(TEXT("SDG"), CurrencySDG); + _CurrencyMap.Add(TEXT("SEK"), CurrencySEK); + _CurrencyMap.Add(TEXT("SGD"), CurrencySGD); + _CurrencyMap.Add(TEXT("SHP"), CurrencySHP); + _CurrencyMap.Add(TEXT("SLL"), CurrencySLL); + _CurrencyMap.Add(TEXT("SOS"), CurrencySOS); + _CurrencyMap.Add(TEXT("SPL"), CurrencySPL); + _CurrencyMap.Add(TEXT("SRD"), CurrencySRD); + _CurrencyMap.Add(TEXT("STD"), CurrencySTD); + _CurrencyMap.Add(TEXT("SVC"), CurrencySVC); + _CurrencyMap.Add(TEXT("SYP"), CurrencySYP); + _CurrencyMap.Add(TEXT("SZL"), CurrencySZL); + _CurrencyMap.Add(TEXT("THB"), CurrencyTHB); + _CurrencyMap.Add(TEXT("TJS"), CurrencyTJS); + _CurrencyMap.Add(TEXT("TMT"), CurrencyTMT); + _CurrencyMap.Add(TEXT("TND"), CurrencyTND); + _CurrencyMap.Add(TEXT("TOP"), CurrencyTOP); + _CurrencyMap.Add(TEXT("TRY"), CurrencyTRY); + _CurrencyMap.Add(TEXT("TTD"), CurrencyTTD); + _CurrencyMap.Add(TEXT("TVD"), CurrencyTVD); + _CurrencyMap.Add(TEXT("TWD"), CurrencyTWD); + _CurrencyMap.Add(TEXT("TZS"), CurrencyTZS); + _CurrencyMap.Add(TEXT("UAH"), CurrencyUAH); + _CurrencyMap.Add(TEXT("UGX"), CurrencyUGX); + _CurrencyMap.Add(TEXT("USD"), CurrencyUSD); + _CurrencyMap.Add(TEXT("UYU"), CurrencyUYU); + _CurrencyMap.Add(TEXT("UZS"), CurrencyUZS); + _CurrencyMap.Add(TEXT("VEF"), CurrencyVEF); + _CurrencyMap.Add(TEXT("VND"), CurrencyVND); + _CurrencyMap.Add(TEXT("VUV"), CurrencyVUV); + _CurrencyMap.Add(TEXT("WST"), CurrencyWST); + _CurrencyMap.Add(TEXT("XAF"), CurrencyXAF); + _CurrencyMap.Add(TEXT("XCD"), CurrencyXCD); + _CurrencyMap.Add(TEXT("XDR"), CurrencyXDR); + _CurrencyMap.Add(TEXT("XOF"), CurrencyXOF); + _CurrencyMap.Add(TEXT("XPF"), CurrencyXPF); + _CurrencyMap.Add(TEXT("YER"), CurrencyYER); + _CurrencyMap.Add(TEXT("ZAR"), CurrencyZAR); + _CurrencyMap.Add(TEXT("ZMW"), CurrencyZMW); + _CurrencyMap.Add(TEXT("ZWD"), CurrencyZWD); + + } + + if (!value.IsEmpty()) + { + auto output = _CurrencyMap.Find(value); + if (output != nullptr) + return *output; + } + + return CurrencyAED; // Basically critical fail +} + +void PlayFab::ClientModels::writeRegionEnumJSON(Region enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case RegionUSCentral: writer->WriteValue(TEXT("USCentral")); break; + case RegionUSEast: writer->WriteValue(TEXT("USEast")); break; + case RegionEUWest: writer->WriteValue(TEXT("EUWest")); break; + case RegionSingapore: writer->WriteValue(TEXT("Singapore")); break; + case RegionJapan: writer->WriteValue(TEXT("Japan")); break; + case RegionBrazil: writer->WriteValue(TEXT("Brazil")); break; + case RegionAustralia: writer->WriteValue(TEXT("Australia")); break; + } +} + +ClientModels::Region PlayFab::ClientModels::readRegionFromValue(const TSharedPtr& value) +{ + return readRegionFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::Region PlayFab::ClientModels::readRegionFromValue(const FString& value) +{ + static TMap _RegionMap; + if (_RegionMap.Num() == 0) + { + // Auto-generate the map on the first use + _RegionMap.Add(TEXT("USCentral"), RegionUSCentral); + _RegionMap.Add(TEXT("USEast"), RegionUSEast); + _RegionMap.Add(TEXT("EUWest"), RegionEUWest); + _RegionMap.Add(TEXT("Singapore"), RegionSingapore); + _RegionMap.Add(TEXT("Japan"), RegionJapan); + _RegionMap.Add(TEXT("Brazil"), RegionBrazil); + _RegionMap.Add(TEXT("Australia"), RegionAustralia); + + } + + if (!value.IsEmpty()) + { + auto output = _RegionMap.Find(value); + if (output != nullptr) + return *output; + } + + return RegionUSCentral; // Basically critical fail +} + +PlayFab::ClientModels::FCurrentGamesRequest::~FCurrentGamesRequest() +{ + //if (TagFilter != nullptr) delete TagFilter; + +} + +void PlayFab::ClientModels::FCurrentGamesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BuildVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); } + + if (GameMode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameMode")); writer->WriteValue(GameMode); } + + if (pfRegion.notNull()) { writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); } + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + if (TagFilter.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TagFilter")); TagFilter->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCurrentGamesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TSharedPtr GameModeValue = obj->TryGetField(TEXT("GameMode")); + if (GameModeValue.IsValid() && !GameModeValue->IsNull()) + { + FString TmpValue; + if (GameModeValue->TryGetString(TmpValue)) { GameMode = TmpValue; } + } + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr TagFilterValue = obj->TryGetField(TEXT("TagFilter")); + if (TagFilterValue.IsValid() && !TagFilterValue->IsNull()) + { + TagFilter = MakeShareable(new FCollectionFilter(TagFilterValue->AsObject())); + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeGameInstanceStateEnumJSON(GameInstanceState enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case GameInstanceStateOpen: writer->WriteValue(TEXT("Open")); break; + case GameInstanceStateClosed: writer->WriteValue(TEXT("Closed")); break; + } +} + +ClientModels::GameInstanceState PlayFab::ClientModels::readGameInstanceStateFromValue(const TSharedPtr& value) +{ + return readGameInstanceStateFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::GameInstanceState PlayFab::ClientModels::readGameInstanceStateFromValue(const FString& value) +{ + static TMap _GameInstanceStateMap; + if (_GameInstanceStateMap.Num() == 0) + { + // Auto-generate the map on the first use + _GameInstanceStateMap.Add(TEXT("Open"), GameInstanceStateOpen); + _GameInstanceStateMap.Add(TEXT("Closed"), GameInstanceStateClosed); + + } + + if (!value.IsEmpty()) + { + auto output = _GameInstanceStateMap.Find(value); + if (output != nullptr) + return *output; + } + + return GameInstanceStateOpen; // Basically critical fail +} + +PlayFab::ClientModels::FGameInfo::~FGameInfo() +{ + +} + +void PlayFab::ClientModels::FGameInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BuildVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); } + + if (GameMode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameMode")); writer->WriteValue(GameMode); } + + if (GameServerData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameServerData")); writer->WriteValue(GameServerData); } + + if (GameServerStateEnum.notNull()) { writer->WriteIdentifierPrefix(TEXT("GameServerStateEnum")); writeGameInstanceStateEnumJSON(GameServerStateEnum, writer); } + + if (LastHeartbeat.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastHeartbeat")); writeDatetime(LastHeartbeat, writer); } + + if (LobbyID.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyID")); writer->WriteValue(LobbyID); } + + if (MaxPlayers.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxPlayers")); writer->WriteValue(MaxPlayers); } + + if (PlayerUserIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerUserIds")); + for (const FString& item : PlayerUserIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (pfRegion.notNull()) { writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); } + + writer->WriteIdentifierPrefix(TEXT("RunTime")); writer->WriteValue(static_cast(RunTime)); + + if (ServerHostname.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerHostname")); writer->WriteValue(ServerHostname); } + + if (ServerIPV4Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV4Address")); writer->WriteValue(ServerIPV4Address); } + + if (ServerIPV6Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV6Address")); writer->WriteValue(ServerIPV6Address); } + + if (ServerPort.notNull()) { writer->WriteIdentifierPrefix(TEXT("ServerPort")); writer->WriteValue(ServerPort); } + + if (ServerPublicDNSName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerPublicDNSName")); writer->WriteValue(ServerPublicDNSName); } + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + if (Tags.Num() != 0) + { + writer->WriteObjectStart(TEXT("Tags")); + for (TMap::TConstIterator It(Tags); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGameInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TSharedPtr GameModeValue = obj->TryGetField(TEXT("GameMode")); + if (GameModeValue.IsValid() && !GameModeValue->IsNull()) + { + FString TmpValue; + if (GameModeValue->TryGetString(TmpValue)) { GameMode = TmpValue; } + } + + const TSharedPtr GameServerDataValue = obj->TryGetField(TEXT("GameServerData")); + if (GameServerDataValue.IsValid() && !GameServerDataValue->IsNull()) + { + FString TmpValue; + if (GameServerDataValue->TryGetString(TmpValue)) { GameServerData = TmpValue; } + } + + GameServerStateEnum = readGameInstanceStateFromValue(obj->TryGetField(TEXT("GameServerStateEnum"))); + + const TSharedPtr LastHeartbeatValue = obj->TryGetField(TEXT("LastHeartbeat")); + if (LastHeartbeatValue.IsValid()) + LastHeartbeat = readDatetime(LastHeartbeatValue); + + + const TSharedPtr LobbyIDValue = obj->TryGetField(TEXT("LobbyID")); + if (LobbyIDValue.IsValid() && !LobbyIDValue->IsNull()) + { + FString TmpValue; + if (LobbyIDValue->TryGetString(TmpValue)) { LobbyID = TmpValue; } + } + + const TSharedPtr MaxPlayersValue = obj->TryGetField(TEXT("MaxPlayers")); + if (MaxPlayersValue.IsValid() && !MaxPlayersValue->IsNull()) + { + int32 TmpValue; + if (MaxPlayersValue->TryGetNumber(TmpValue)) { MaxPlayers = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("PlayerUserIds"), PlayerUserIds); + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + const TSharedPtr RunTimeValue = obj->TryGetField(TEXT("RunTime")); + if (RunTimeValue.IsValid() && !RunTimeValue->IsNull()) + { + uint32 TmpValue; + if (RunTimeValue->TryGetNumber(TmpValue)) { RunTime = TmpValue; } + } + + const TSharedPtr ServerHostnameValue = obj->TryGetField(TEXT("ServerHostname")); + if (ServerHostnameValue.IsValid() && !ServerHostnameValue->IsNull()) + { + FString TmpValue; + if (ServerHostnameValue->TryGetString(TmpValue)) { ServerHostname = TmpValue; } + } + + const TSharedPtr ServerIPV4AddressValue = obj->TryGetField(TEXT("ServerIPV4Address")); + if (ServerIPV4AddressValue.IsValid() && !ServerIPV4AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV4AddressValue->TryGetString(TmpValue)) { ServerIPV4Address = TmpValue; } + } + + const TSharedPtr ServerIPV6AddressValue = obj->TryGetField(TEXT("ServerIPV6Address")); + if (ServerIPV6AddressValue.IsValid() && !ServerIPV6AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV6AddressValue->TryGetString(TmpValue)) { ServerIPV6Address = TmpValue; } + } + + const TSharedPtr ServerPortValue = obj->TryGetField(TEXT("ServerPort")); + if (ServerPortValue.IsValid() && !ServerPortValue->IsNull()) + { + int32 TmpValue; + if (ServerPortValue->TryGetNumber(TmpValue)) { ServerPort = TmpValue; } + } + + const TSharedPtr ServerPublicDNSNameValue = obj->TryGetField(TEXT("ServerPublicDNSName")); + if (ServerPublicDNSNameValue.IsValid() && !ServerPublicDNSNameValue->IsNull()) + { + FString TmpValue; + if (ServerPublicDNSNameValue->TryGetString(TmpValue)) { ServerPublicDNSName = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr* TagsObject; + if (obj->TryGetObjectField(TEXT("Tags"), TagsObject)) + { + for (TMap>::TConstIterator It((*TagsObject)->Values); It; ++It) + { + Tags.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCurrentGamesResult::~FCurrentGamesResult() +{ + +} + +void PlayFab::ClientModels::FCurrentGamesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GameCount")); writer->WriteValue(GameCount); + + if (Games.Num() != 0) + { + writer->WriteArrayStart(TEXT("Games")); + for (const FGameInfo& item : Games) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayerCount")); writer->WriteValue(PlayerCount); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCurrentGamesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameCountValue = obj->TryGetField(TEXT("GameCount")); + if (GameCountValue.IsValid() && !GameCountValue->IsNull()) + { + int32 TmpValue; + if (GameCountValue->TryGetNumber(TmpValue)) { GameCount = TmpValue; } + } + + const TArray>&GamesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Games")); + for (int32 Idx = 0; Idx < GamesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GamesArray[Idx]; + Games.Add(FGameInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayerCountValue = obj->TryGetField(TEXT("PlayerCount")); + if (PlayerCountValue.IsValid() && !PlayerCountValue->IsNull()) + { + int32 TmpValue; + if (PlayerCountValue->TryGetNumber(TmpValue)) { PlayerCount = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FDeviceInfoRequest::~FDeviceInfoRequest() +{ + +} + +void PlayFab::ClientModels::FDeviceInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Info.Num() != 0) + { + writer->WriteObjectStart(TEXT("Info")); + for (TMap::TConstIterator It(Info); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FDeviceInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* InfoObject; + if (obj->TryGetObjectField(TEXT("Info"), InfoObject)) + { + for (TMap>::TConstIterator It((*InfoObject)->Values); It; ++It) + { + Info.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FEmptyResponse::~FEmptyResponse() +{ + +} + +void PlayFab::ClientModels::FEmptyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FEmptyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::ClientModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FEntityTokenResponse::~FEntityTokenResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::ClientModels::FEntityTokenResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + if (EntityToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EntityToken")); writer->WriteValue(EntityToken); } + + if (TokenExpiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("TokenExpiration")); writeDatetime(TokenExpiration, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FEntityTokenResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr EntityTokenValue = obj->TryGetField(TEXT("EntityToken")); + if (EntityTokenValue.IsValid() && !EntityTokenValue->IsNull()) + { + FString TmpValue; + if (EntityTokenValue->TryGetString(TmpValue)) { EntityToken = TmpValue; } + } + + const TSharedPtr TokenExpirationValue = obj->TryGetField(TEXT("TokenExpiration")); + if (TokenExpirationValue.IsValid()) + TokenExpiration = readDatetime(TokenExpirationValue); + + + return HasSucceeded; +} + +PlayFab::ClientModels::FExecuteCloudScriptRequest::~FExecuteCloudScriptRequest() +{ + +} + +void PlayFab::ClientModels::FExecuteCloudScriptRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); + + if (FunctionParameter.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionParameter")); FunctionParameter.writeJSON(writer); } + + if (GeneratePlayStreamEvent.notNull()) { writer->WriteIdentifierPrefix(TEXT("GeneratePlayStreamEvent")); writer->WriteValue(GeneratePlayStreamEvent); } + + if (RevisionSelection.notNull()) { writer->WriteIdentifierPrefix(TEXT("RevisionSelection")); writeCloudScriptRevisionOptionEnumJSON(RevisionSelection, writer); } + + if (SpecificRevision.notNull()) { writer->WriteIdentifierPrefix(TEXT("SpecificRevision")); writer->WriteValue(SpecificRevision); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FExecuteCloudScriptRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionParameterValue = obj->TryGetField(TEXT("FunctionParameter")); + if (FunctionParameterValue.IsValid() && !FunctionParameterValue->IsNull()) + { + FunctionParameter = FJsonKeeper(FunctionParameterValue); + } + + const TSharedPtr GeneratePlayStreamEventValue = obj->TryGetField(TEXT("GeneratePlayStreamEvent")); + if (GeneratePlayStreamEventValue.IsValid() && !GeneratePlayStreamEventValue->IsNull()) + { + bool TmpValue; + if (GeneratePlayStreamEventValue->TryGetBool(TmpValue)) { GeneratePlayStreamEvent = TmpValue; } + } + + RevisionSelection = readCloudScriptRevisionOptionFromValue(obj->TryGetField(TEXT("RevisionSelection"))); + + const TSharedPtr SpecificRevisionValue = obj->TryGetField(TEXT("SpecificRevision")); + if (SpecificRevisionValue.IsValid() && !SpecificRevisionValue->IsNull()) + { + int32 TmpValue; + if (SpecificRevisionValue->TryGetNumber(TmpValue)) { SpecificRevision = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FScriptExecutionError::~FScriptExecutionError() +{ + +} + +void PlayFab::ClientModels::FScriptExecutionError::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + if (StackTrace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StackTrace")); writer->WriteValue(StackTrace); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FScriptExecutionError::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + const TSharedPtr StackTraceValue = obj->TryGetField(TEXT("StackTrace")); + if (StackTraceValue.IsValid() && !StackTraceValue->IsNull()) + { + FString TmpValue; + if (StackTraceValue->TryGetString(TmpValue)) { StackTrace = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLogStatement::~FLogStatement() +{ + +} + +void PlayFab::ClientModels::FLogStatement::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.notNull()) { writer->WriteIdentifierPrefix(TEXT("Data")); Data.writeJSON(writer); } + + if (Level.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Level")); writer->WriteValue(Level); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLogStatement::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataValue = obj->TryGetField(TEXT("Data")); + if (DataValue.IsValid() && !DataValue->IsNull()) + { + Data = FJsonKeeper(DataValue); + } + + const TSharedPtr LevelValue = obj->TryGetField(TEXT("Level")); + if (LevelValue.IsValid() && !LevelValue->IsNull()) + { + FString TmpValue; + if (LevelValue->TryGetString(TmpValue)) { Level = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FExecuteCloudScriptResult::~FExecuteCloudScriptResult() +{ + //if (Error != nullptr) delete Error; + +} + +void PlayFab::ClientModels::FExecuteCloudScriptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("APIRequestsIssued")); writer->WriteValue(APIRequestsIssued); + + if (Error.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Error")); Error->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ExecutionTimeSeconds")); writer->WriteValue(ExecutionTimeSeconds); + + if (FunctionName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); } + + if (FunctionResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResult")); FunctionResult.writeJSON(writer); } + + if (FunctionResultTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResultTooLarge")); writer->WriteValue(FunctionResultTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("HttpRequestsIssued")); writer->WriteValue(HttpRequestsIssued); + + if (Logs.Num() != 0) + { + writer->WriteArrayStart(TEXT("Logs")); + for (const FLogStatement& item : Logs) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (LogsTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("LogsTooLarge")); writer->WriteValue(LogsTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("MemoryConsumedBytes")); writer->WriteValue(static_cast(MemoryConsumedBytes)); + + writer->WriteIdentifierPrefix(TEXT("ProcessorTimeSeconds")); writer->WriteValue(ProcessorTimeSeconds); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FExecuteCloudScriptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr APIRequestsIssuedValue = obj->TryGetField(TEXT("APIRequestsIssued")); + if (APIRequestsIssuedValue.IsValid() && !APIRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (APIRequestsIssuedValue->TryGetNumber(TmpValue)) { APIRequestsIssued = TmpValue; } + } + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + Error = MakeShareable(new FScriptExecutionError(ErrorValue->AsObject())); + } + + const TSharedPtr ExecutionTimeSecondsValue = obj->TryGetField(TEXT("ExecutionTimeSeconds")); + if (ExecutionTimeSecondsValue.IsValid() && !ExecutionTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ExecutionTimeSecondsValue->TryGetNumber(TmpValue)) { ExecutionTimeSeconds = TmpValue; } + } + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionResultValue = obj->TryGetField(TEXT("FunctionResult")); + if (FunctionResultValue.IsValid() && !FunctionResultValue->IsNull()) + { + FunctionResult = FJsonKeeper(FunctionResultValue); + } + + const TSharedPtr FunctionResultTooLargeValue = obj->TryGetField(TEXT("FunctionResultTooLarge")); + if (FunctionResultTooLargeValue.IsValid() && !FunctionResultTooLargeValue->IsNull()) + { + bool TmpValue; + if (FunctionResultTooLargeValue->TryGetBool(TmpValue)) { FunctionResultTooLarge = TmpValue; } + } + + const TSharedPtr HttpRequestsIssuedValue = obj->TryGetField(TEXT("HttpRequestsIssued")); + if (HttpRequestsIssuedValue.IsValid() && !HttpRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (HttpRequestsIssuedValue->TryGetNumber(TmpValue)) { HttpRequestsIssued = TmpValue; } + } + + const TArray>&LogsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Logs")); + for (int32 Idx = 0; Idx < LogsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LogsArray[Idx]; + Logs.Add(FLogStatement(CurrentItem->AsObject())); + } + + + const TSharedPtr LogsTooLargeValue = obj->TryGetField(TEXT("LogsTooLarge")); + if (LogsTooLargeValue.IsValid() && !LogsTooLargeValue->IsNull()) + { + bool TmpValue; + if (LogsTooLargeValue->TryGetBool(TmpValue)) { LogsTooLarge = TmpValue; } + } + + const TSharedPtr MemoryConsumedBytesValue = obj->TryGetField(TEXT("MemoryConsumedBytes")); + if (MemoryConsumedBytesValue.IsValid() && !MemoryConsumedBytesValue->IsNull()) + { + uint32 TmpValue; + if (MemoryConsumedBytesValue->TryGetNumber(TmpValue)) { MemoryConsumedBytes = TmpValue; } + } + + const TSharedPtr ProcessorTimeSecondsValue = obj->TryGetField(TEXT("ProcessorTimeSeconds")); + if (ProcessorTimeSecondsValue.IsValid() && !ProcessorTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ProcessorTimeSecondsValue->TryGetNumber(TmpValue)) { ProcessorTimeSeconds = TmpValue; } + } + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FFacebookInstantGamesPlayFabIdPair::~FFacebookInstantGamesPlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FFacebookInstantGamesPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookInstantGamesId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesId")); writer->WriteValue(FacebookInstantGamesId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FFacebookInstantGamesPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesIdValue = obj->TryGetField(TEXT("FacebookInstantGamesId")); + if (FacebookInstantGamesIdValue.IsValid() && !FacebookInstantGamesIdValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesIdValue->TryGetString(TmpValue)) { FacebookInstantGamesId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FFacebookPlayFabIdPair::~FFacebookPlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FFacebookPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookId")); writer->WriteValue(FacebookId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FFacebookPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookIdValue = obj->TryGetField(TEXT("FacebookId")); + if (FacebookIdValue.IsValid() && !FacebookIdValue->IsNull()) + { + FString TmpValue; + if (FacebookIdValue->TryGetString(TmpValue)) { FacebookId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserFacebookInfo::~FUserFacebookInfo() +{ + +} + +void PlayFab::ClientModels::FUserFacebookInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookId")); writer->WriteValue(FacebookId); } + + if (FullName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FullName")); writer->WriteValue(FullName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserFacebookInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookIdValue = obj->TryGetField(TEXT("FacebookId")); + if (FacebookIdValue.IsValid() && !FacebookIdValue->IsNull()) + { + FString TmpValue; + if (FacebookIdValue->TryGetString(TmpValue)) { FacebookId = TmpValue; } + } + + const TSharedPtr FullNameValue = obj->TryGetField(TEXT("FullName")); + if (FullNameValue.IsValid() && !FullNameValue->IsNull()) + { + FString TmpValue; + if (FullNameValue->TryGetString(TmpValue)) { FullName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserGameCenterInfo::~FUserGameCenterInfo() +{ + +} + +void PlayFab::ClientModels::FUserGameCenterInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GameCenterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameCenterId")); writer->WriteValue(GameCenterId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserGameCenterInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameCenterIdValue = obj->TryGetField(TEXT("GameCenterId")); + if (GameCenterIdValue.IsValid() && !GameCenterIdValue->IsNull()) + { + FString TmpValue; + if (GameCenterIdValue->TryGetString(TmpValue)) { GameCenterId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeLoginIdentityProviderEnumJSON(LoginIdentityProvider enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case LoginIdentityProviderUnknown: writer->WriteValue(TEXT("Unknown")); break; + case LoginIdentityProviderPlayFab: writer->WriteValue(TEXT("PlayFab")); break; + case LoginIdentityProviderCustom: writer->WriteValue(TEXT("Custom")); break; + case LoginIdentityProviderGameCenter: writer->WriteValue(TEXT("GameCenter")); break; + case LoginIdentityProviderGooglePlay: writer->WriteValue(TEXT("GooglePlay")); break; + case LoginIdentityProviderSteam: writer->WriteValue(TEXT("Steam")); break; + case LoginIdentityProviderXBoxLive: writer->WriteValue(TEXT("XBoxLive")); break; + case LoginIdentityProviderPSN: writer->WriteValue(TEXT("PSN")); break; + case LoginIdentityProviderKongregate: writer->WriteValue(TEXT("Kongregate")); break; + case LoginIdentityProviderFacebook: writer->WriteValue(TEXT("Facebook")); break; + case LoginIdentityProviderIOSDevice: writer->WriteValue(TEXT("IOSDevice")); break; + case LoginIdentityProviderAndroidDevice: writer->WriteValue(TEXT("AndroidDevice")); break; + case LoginIdentityProviderTwitch: writer->WriteValue(TEXT("Twitch")); break; + case LoginIdentityProviderWindowsHello: writer->WriteValue(TEXT("WindowsHello")); break; + case LoginIdentityProviderGameServer: writer->WriteValue(TEXT("GameServer")); break; + case LoginIdentityProviderCustomServer: writer->WriteValue(TEXT("CustomServer")); break; + case LoginIdentityProviderNintendoSwitch: writer->WriteValue(TEXT("NintendoSwitch")); break; + case LoginIdentityProviderFacebookInstantGames: writer->WriteValue(TEXT("FacebookInstantGames")); break; + case LoginIdentityProviderOpenIdConnect: writer->WriteValue(TEXT("OpenIdConnect")); break; + } +} + +ClientModels::LoginIdentityProvider PlayFab::ClientModels::readLoginIdentityProviderFromValue(const TSharedPtr& value) +{ + return readLoginIdentityProviderFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::LoginIdentityProvider PlayFab::ClientModels::readLoginIdentityProviderFromValue(const FString& value) +{ + static TMap _LoginIdentityProviderMap; + if (_LoginIdentityProviderMap.Num() == 0) + { + // Auto-generate the map on the first use + _LoginIdentityProviderMap.Add(TEXT("Unknown"), LoginIdentityProviderUnknown); + _LoginIdentityProviderMap.Add(TEXT("PlayFab"), LoginIdentityProviderPlayFab); + _LoginIdentityProviderMap.Add(TEXT("Custom"), LoginIdentityProviderCustom); + _LoginIdentityProviderMap.Add(TEXT("GameCenter"), LoginIdentityProviderGameCenter); + _LoginIdentityProviderMap.Add(TEXT("GooglePlay"), LoginIdentityProviderGooglePlay); + _LoginIdentityProviderMap.Add(TEXT("Steam"), LoginIdentityProviderSteam); + _LoginIdentityProviderMap.Add(TEXT("XBoxLive"), LoginIdentityProviderXBoxLive); + _LoginIdentityProviderMap.Add(TEXT("PSN"), LoginIdentityProviderPSN); + _LoginIdentityProviderMap.Add(TEXT("Kongregate"), LoginIdentityProviderKongregate); + _LoginIdentityProviderMap.Add(TEXT("Facebook"), LoginIdentityProviderFacebook); + _LoginIdentityProviderMap.Add(TEXT("IOSDevice"), LoginIdentityProviderIOSDevice); + _LoginIdentityProviderMap.Add(TEXT("AndroidDevice"), LoginIdentityProviderAndroidDevice); + _LoginIdentityProviderMap.Add(TEXT("Twitch"), LoginIdentityProviderTwitch); + _LoginIdentityProviderMap.Add(TEXT("WindowsHello"), LoginIdentityProviderWindowsHello); + _LoginIdentityProviderMap.Add(TEXT("GameServer"), LoginIdentityProviderGameServer); + _LoginIdentityProviderMap.Add(TEXT("CustomServer"), LoginIdentityProviderCustomServer); + _LoginIdentityProviderMap.Add(TEXT("NintendoSwitch"), LoginIdentityProviderNintendoSwitch); + _LoginIdentityProviderMap.Add(TEXT("FacebookInstantGames"), LoginIdentityProviderFacebookInstantGames); + _LoginIdentityProviderMap.Add(TEXT("OpenIdConnect"), LoginIdentityProviderOpenIdConnect); + + } + + if (!value.IsEmpty()) + { + auto output = _LoginIdentityProviderMap.Find(value); + if (output != nullptr) + return *output; + } + + return LoginIdentityProviderUnknown; // Basically critical fail +} + +PlayFab::ClientModels::FLinkedPlatformAccountModel::~FLinkedPlatformAccountModel() +{ + +} + +void PlayFab::ClientModels::FLinkedPlatformAccountModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writeLoginIdentityProviderEnumJSON(Platform, writer); } + + if (PlatformUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlatformUserId")); writer->WriteValue(PlatformUserId); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkedPlatformAccountModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + Platform = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Platform"))); + + const TSharedPtr PlatformUserIdValue = obj->TryGetField(TEXT("PlatformUserId")); + if (PlatformUserIdValue.IsValid() && !PlatformUserIdValue->IsNull()) + { + FString TmpValue; + if (PlatformUserIdValue->TryGetString(TmpValue)) { PlatformUserId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLocationModel::~FLocationModel() +{ + +} + +void PlayFab::ClientModels::FLocationModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (City.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("City")); writer->WriteValue(City); } + + if (pfContinentCode.notNull()) { writer->WriteIdentifierPrefix(TEXT("ContinentCode")); writeContinentCodeEnumJSON(pfContinentCode, writer); } + + if (pfCountryCode.notNull()) { writer->WriteIdentifierPrefix(TEXT("CountryCode")); writeCountryCodeEnumJSON(pfCountryCode, writer); } + + if (Latitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Latitude")); writer->WriteValue(Latitude); } + + if (Longitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Longitude")); writer->WriteValue(Longitude); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLocationModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CityValue = obj->TryGetField(TEXT("City")); + if (CityValue.IsValid() && !CityValue->IsNull()) + { + FString TmpValue; + if (CityValue->TryGetString(TmpValue)) { City = TmpValue; } + } + + pfContinentCode = readContinentCodeFromValue(obj->TryGetField(TEXT("ContinentCode"))); + + pfCountryCode = readCountryCodeFromValue(obj->TryGetField(TEXT("CountryCode"))); + + const TSharedPtr LatitudeValue = obj->TryGetField(TEXT("Latitude")); + if (LatitudeValue.IsValid() && !LatitudeValue->IsNull()) + { + double TmpValue; + if (LatitudeValue->TryGetNumber(TmpValue)) { Latitude = TmpValue; } + } + + const TSharedPtr LongitudeValue = obj->TryGetField(TEXT("Longitude")); + if (LongitudeValue.IsValid() && !LongitudeValue->IsNull()) + { + double TmpValue; + if (LongitudeValue->TryGetNumber(TmpValue)) { Longitude = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeSubscriptionProviderStatusEnumJSON(SubscriptionProviderStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case SubscriptionProviderStatusNoError: writer->WriteValue(TEXT("NoError")); break; + case SubscriptionProviderStatusCancelled: writer->WriteValue(TEXT("Cancelled")); break; + case SubscriptionProviderStatusUnknownError: writer->WriteValue(TEXT("UnknownError")); break; + case SubscriptionProviderStatusBillingError: writer->WriteValue(TEXT("BillingError")); break; + case SubscriptionProviderStatusProductUnavailable: writer->WriteValue(TEXT("ProductUnavailable")); break; + case SubscriptionProviderStatusCustomerDidNotAcceptPriceChange: writer->WriteValue(TEXT("CustomerDidNotAcceptPriceChange")); break; + case SubscriptionProviderStatusFreeTrial: writer->WriteValue(TEXT("FreeTrial")); break; + case SubscriptionProviderStatusPaymentPending: writer->WriteValue(TEXT("PaymentPending")); break; + } +} + +ClientModels::SubscriptionProviderStatus PlayFab::ClientModels::readSubscriptionProviderStatusFromValue(const TSharedPtr& value) +{ + return readSubscriptionProviderStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::SubscriptionProviderStatus PlayFab::ClientModels::readSubscriptionProviderStatusFromValue(const FString& value) +{ + static TMap _SubscriptionProviderStatusMap; + if (_SubscriptionProviderStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _SubscriptionProviderStatusMap.Add(TEXT("NoError"), SubscriptionProviderStatusNoError); + _SubscriptionProviderStatusMap.Add(TEXT("Cancelled"), SubscriptionProviderStatusCancelled); + _SubscriptionProviderStatusMap.Add(TEXT("UnknownError"), SubscriptionProviderStatusUnknownError); + _SubscriptionProviderStatusMap.Add(TEXT("BillingError"), SubscriptionProviderStatusBillingError); + _SubscriptionProviderStatusMap.Add(TEXT("ProductUnavailable"), SubscriptionProviderStatusProductUnavailable); + _SubscriptionProviderStatusMap.Add(TEXT("CustomerDidNotAcceptPriceChange"), SubscriptionProviderStatusCustomerDidNotAcceptPriceChange); + _SubscriptionProviderStatusMap.Add(TEXT("FreeTrial"), SubscriptionProviderStatusFreeTrial); + _SubscriptionProviderStatusMap.Add(TEXT("PaymentPending"), SubscriptionProviderStatusPaymentPending); + + } + + if (!value.IsEmpty()) + { + auto output = _SubscriptionProviderStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return SubscriptionProviderStatusNoError; // Basically critical fail +} + +PlayFab::ClientModels::FSubscriptionModel::~FSubscriptionModel() +{ + +} + +void PlayFab::ClientModels::FSubscriptionModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); + + writer->WriteIdentifierPrefix(TEXT("InitialSubscriptionTime")); writeDatetime(InitialSubscriptionTime, writer); + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeSubscriptionProviderStatusEnumJSON(Status, writer); } + + if (SubscriptionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionId")); writer->WriteValue(SubscriptionId); } + + if (SubscriptionItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionItemId")); writer->WriteValue(SubscriptionItemId); } + + if (SubscriptionProvider.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionProvider")); writer->WriteValue(SubscriptionProvider); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSubscriptionModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr InitialSubscriptionTimeValue = obj->TryGetField(TEXT("InitialSubscriptionTime")); + if (InitialSubscriptionTimeValue.IsValid()) + InitialSubscriptionTime = readDatetime(InitialSubscriptionTimeValue); + + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + Status = readSubscriptionProviderStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr SubscriptionIdValue = obj->TryGetField(TEXT("SubscriptionId")); + if (SubscriptionIdValue.IsValid() && !SubscriptionIdValue->IsNull()) + { + FString TmpValue; + if (SubscriptionIdValue->TryGetString(TmpValue)) { SubscriptionId = TmpValue; } + } + + const TSharedPtr SubscriptionItemIdValue = obj->TryGetField(TEXT("SubscriptionItemId")); + if (SubscriptionItemIdValue.IsValid() && !SubscriptionItemIdValue->IsNull()) + { + FString TmpValue; + if (SubscriptionItemIdValue->TryGetString(TmpValue)) { SubscriptionItemId = TmpValue; } + } + + const TSharedPtr SubscriptionProviderValue = obj->TryGetField(TEXT("SubscriptionProvider")); + if (SubscriptionProviderValue.IsValid() && !SubscriptionProviderValue->IsNull()) + { + FString TmpValue; + if (SubscriptionProviderValue->TryGetString(TmpValue)) { SubscriptionProvider = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FMembershipModel::~FMembershipModel() +{ + +} + +void PlayFab::ClientModels::FMembershipModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + writer->WriteIdentifierPrefix(TEXT("MembershipExpiration")); writeDatetime(MembershipExpiration, writer); + + if (MembershipId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MembershipId")); writer->WriteValue(MembershipId); } + + if (OverrideExpiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("OverrideExpiration")); writeDatetime(OverrideExpiration, writer); } + + if (OverrideIsSet.notNull()) { writer->WriteIdentifierPrefix(TEXT("OverrideIsSet")); writer->WriteValue(OverrideIsSet); } + + if (Subscriptions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Subscriptions")); + for (const FSubscriptionModel& item : Subscriptions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FMembershipModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr MembershipExpirationValue = obj->TryGetField(TEXT("MembershipExpiration")); + if (MembershipExpirationValue.IsValid()) + MembershipExpiration = readDatetime(MembershipExpirationValue); + + + const TSharedPtr MembershipIdValue = obj->TryGetField(TEXT("MembershipId")); + if (MembershipIdValue.IsValid() && !MembershipIdValue->IsNull()) + { + FString TmpValue; + if (MembershipIdValue->TryGetString(TmpValue)) { MembershipId = TmpValue; } + } + + const TSharedPtr OverrideExpirationValue = obj->TryGetField(TEXT("OverrideExpiration")); + if (OverrideExpirationValue.IsValid()) + OverrideExpiration = readDatetime(OverrideExpirationValue); + + + const TSharedPtr OverrideIsSetValue = obj->TryGetField(TEXT("OverrideIsSet")); + if (OverrideIsSetValue.IsValid() && !OverrideIsSetValue->IsNull()) + { + bool TmpValue; + if (OverrideIsSetValue->TryGetBool(TmpValue)) { OverrideIsSet = TmpValue; } + } + + const TArray>&SubscriptionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Subscriptions")); + for (int32 Idx = 0; Idx < SubscriptionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SubscriptionsArray[Idx]; + Subscriptions.Add(FSubscriptionModel(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::ClientModels::writePushNotificationPlatformEnumJSON(PushNotificationPlatform enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case PushNotificationPlatformApplePushNotificationService: writer->WriteValue(TEXT("ApplePushNotificationService")); break; + case PushNotificationPlatformGoogleCloudMessaging: writer->WriteValue(TEXT("GoogleCloudMessaging")); break; + } +} + +ClientModels::PushNotificationPlatform PlayFab::ClientModels::readPushNotificationPlatformFromValue(const TSharedPtr& value) +{ + return readPushNotificationPlatformFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::PushNotificationPlatform PlayFab::ClientModels::readPushNotificationPlatformFromValue(const FString& value) +{ + static TMap _PushNotificationPlatformMap; + if (_PushNotificationPlatformMap.Num() == 0) + { + // Auto-generate the map on the first use + _PushNotificationPlatformMap.Add(TEXT("ApplePushNotificationService"), PushNotificationPlatformApplePushNotificationService); + _PushNotificationPlatformMap.Add(TEXT("GoogleCloudMessaging"), PushNotificationPlatformGoogleCloudMessaging); + + } + + if (!value.IsEmpty()) + { + auto output = _PushNotificationPlatformMap.Find(value); + if (output != nullptr) + return *output; + } + + return PushNotificationPlatformApplePushNotificationService; // Basically critical fail +} + +PlayFab::ClientModels::FPushNotificationRegistrationModel::~FPushNotificationRegistrationModel() +{ + +} + +void PlayFab::ClientModels::FPushNotificationRegistrationModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NotificationEndpointARN.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NotificationEndpointARN")); writer->WriteValue(NotificationEndpointARN); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writePushNotificationPlatformEnumJSON(Platform, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPushNotificationRegistrationModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NotificationEndpointARNValue = obj->TryGetField(TEXT("NotificationEndpointARN")); + if (NotificationEndpointARNValue.IsValid() && !NotificationEndpointARNValue->IsNull()) + { + FString TmpValue; + if (NotificationEndpointARNValue->TryGetString(TmpValue)) { NotificationEndpointARN = TmpValue; } + } + + Platform = readPushNotificationPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::ClientModels::FStatisticModel::~FStatisticModel() +{ + +} + +void PlayFab::ClientModels::FStatisticModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStatisticModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FTagModel::~FTagModel() +{ + +} + +void PlayFab::ClientModels::FTagModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TagValue.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TagValue")); writer->WriteValue(TagValue); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FTagModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TagValueValue = obj->TryGetField(TEXT("TagValue")); + if (TagValueValue.IsValid() && !TagValueValue->IsNull()) + { + FString TmpValue; + if (TagValueValue->TryGetString(TmpValue)) { TagValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FValueToDateModel::~FValueToDateModel() +{ + +} + +void PlayFab::ClientModels::FValueToDateModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Currency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Currency")); writer->WriteValue(Currency); } + + writer->WriteIdentifierPrefix(TEXT("TotalValue")); writer->WriteValue(static_cast(TotalValue)); + + if (TotalValueAsDecimal.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TotalValueAsDecimal")); writer->WriteValue(TotalValueAsDecimal); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValueToDateModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyValue = obj->TryGetField(TEXT("Currency")); + if (CurrencyValue.IsValid() && !CurrencyValue->IsNull()) + { + FString TmpValue; + if (CurrencyValue->TryGetString(TmpValue)) { Currency = TmpValue; } + } + + const TSharedPtr TotalValueValue = obj->TryGetField(TEXT("TotalValue")); + if (TotalValueValue.IsValid() && !TotalValueValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueValue->TryGetNumber(TmpValue)) { TotalValue = TmpValue; } + } + + const TSharedPtr TotalValueAsDecimalValue = obj->TryGetField(TEXT("TotalValueAsDecimal")); + if (TotalValueAsDecimalValue.IsValid() && !TotalValueAsDecimalValue->IsNull()) + { + FString TmpValue; + if (TotalValueAsDecimalValue->TryGetString(TmpValue)) { TotalValueAsDecimal = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPlayerProfileModel::~FPlayerProfileModel() +{ + +} + +void PlayFab::ClientModels::FPlayerProfileModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdCampaignAttributions.Num() != 0) + { + writer->WriteArrayStart(TEXT("AdCampaignAttributions")); + for (const FAdCampaignAttributionModel& item : AdCampaignAttributions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + if (BannedUntil.notNull()) { writer->WriteIdentifierPrefix(TEXT("BannedUntil")); writeDatetime(BannedUntil, writer); } + + if (ContactEmailAddresses.Num() != 0) + { + writer->WriteArrayStart(TEXT("ContactEmailAddresses")); + for (const FContactEmailInfoModel& item : ContactEmailAddresses) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (LinkedAccounts.Num() != 0) + { + writer->WriteArrayStart(TEXT("LinkedAccounts")); + for (const FLinkedPlatformAccountModel& item : LinkedAccounts) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Locations.Num() != 0) + { + writer->WriteArrayStart(TEXT("Locations")); + for (const FLocationModel& item : Locations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Memberships.Num() != 0) + { + writer->WriteArrayStart(TEXT("Memberships")); + for (const FMembershipModel& item : Memberships) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeLoginIdentityProviderEnumJSON(Origination, writer); } + + if (PlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerId")); writer->WriteValue(PlayerId); } + + if (PublisherId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PublisherId")); writer->WriteValue(PublisherId); } + + if (PushNotificationRegistrations.Num() != 0) + { + writer->WriteArrayStart(TEXT("PushNotificationRegistrations")); + for (const FPushNotificationRegistrationModel& item : PushNotificationRegistrations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Statistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticModel& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FTagModel& item : Tags) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + if (TotalValueToDateInUSD.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalValueToDateInUSD")); writer->WriteValue(static_cast(TotalValueToDateInUSD)); } + + if (ValuesToDate.Num() != 0) + { + writer->WriteArrayStart(TEXT("ValuesToDate")); + for (const FValueToDateModel& item : ValuesToDate) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPlayerProfileModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AdCampaignAttributionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AdCampaignAttributions")); + for (int32 Idx = 0; Idx < AdCampaignAttributionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AdCampaignAttributionsArray[Idx]; + AdCampaignAttributions.Add(FAdCampaignAttributionModel(CurrentItem->AsObject())); + } + + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr BannedUntilValue = obj->TryGetField(TEXT("BannedUntil")); + if (BannedUntilValue.IsValid()) + BannedUntil = readDatetime(BannedUntilValue); + + + const TArray>&ContactEmailAddressesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ContactEmailAddresses")); + for (int32 Idx = 0; Idx < ContactEmailAddressesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContactEmailAddressesArray[Idx]; + ContactEmailAddresses.Add(FContactEmailInfoModel(CurrentItem->AsObject())); + } + + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + const TArray>&LinkedAccountsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("LinkedAccounts")); + for (int32 Idx = 0; Idx < LinkedAccountsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LinkedAccountsArray[Idx]; + LinkedAccounts.Add(FLinkedPlatformAccountModel(CurrentItem->AsObject())); + } + + + const TArray>&LocationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Locations")); + for (int32 Idx = 0; Idx < LocationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LocationsArray[Idx]; + Locations.Add(FLocationModel(CurrentItem->AsObject())); + } + + + const TArray>&MembershipsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Memberships")); + for (int32 Idx = 0; Idx < MembershipsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembershipsArray[Idx]; + Memberships.Add(FMembershipModel(CurrentItem->AsObject())); + } + + + Origination = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr PlayerIdValue = obj->TryGetField(TEXT("PlayerId")); + if (PlayerIdValue.IsValid() && !PlayerIdValue->IsNull()) + { + FString TmpValue; + if (PlayerIdValue->TryGetString(TmpValue)) { PlayerId = TmpValue; } + } + + const TSharedPtr PublisherIdValue = obj->TryGetField(TEXT("PublisherId")); + if (PublisherIdValue.IsValid() && !PublisherIdValue->IsNull()) + { + FString TmpValue; + if (PublisherIdValue->TryGetString(TmpValue)) { PublisherId = TmpValue; } + } + + const TArray>&PushNotificationRegistrationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PushNotificationRegistrations")); + for (int32 Idx = 0; Idx < PushNotificationRegistrationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PushNotificationRegistrationsArray[Idx]; + PushNotificationRegistrations.Add(FPushNotificationRegistrationModel(CurrentItem->AsObject())); + } + + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticModel(CurrentItem->AsObject())); + } + + + const TArray>&TagsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Tags")); + for (int32 Idx = 0; Idx < TagsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = TagsArray[Idx]; + Tags.Add(FTagModel(CurrentItem->AsObject())); + } + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr TotalValueToDateInUSDValue = obj->TryGetField(TEXT("TotalValueToDateInUSD")); + if (TotalValueToDateInUSDValue.IsValid() && !TotalValueToDateInUSDValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueToDateInUSDValue->TryGetNumber(TmpValue)) { TotalValueToDateInUSD = TmpValue; } + } + + const TArray>&ValuesToDateArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ValuesToDate")); + for (int32 Idx = 0; Idx < ValuesToDateArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ValuesToDateArray[Idx]; + ValuesToDate.Add(FValueToDateModel(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserPsnInfo::~FUserPsnInfo() +{ + +} + +void PlayFab::ClientModels::FUserPsnInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PsnAccountId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PsnAccountId")); writer->WriteValue(PsnAccountId); } + + if (PsnOnlineId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PsnOnlineId")); writer->WriteValue(PsnOnlineId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserPsnInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PsnAccountIdValue = obj->TryGetField(TEXT("PsnAccountId")); + if (PsnAccountIdValue.IsValid() && !PsnAccountIdValue->IsNull()) + { + FString TmpValue; + if (PsnAccountIdValue->TryGetString(TmpValue)) { PsnAccountId = TmpValue; } + } + + const TSharedPtr PsnOnlineIdValue = obj->TryGetField(TEXT("PsnOnlineId")); + if (PsnOnlineIdValue.IsValid() && !PsnOnlineIdValue->IsNull()) + { + FString TmpValue; + if (PsnOnlineIdValue->TryGetString(TmpValue)) { PsnOnlineId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeTitleActivationStatusEnumJSON(TitleActivationStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case TitleActivationStatusNone: writer->WriteValue(TEXT("None")); break; + case TitleActivationStatusActivatedTitleKey: writer->WriteValue(TEXT("ActivatedTitleKey")); break; + case TitleActivationStatusPendingSteam: writer->WriteValue(TEXT("PendingSteam")); break; + case TitleActivationStatusActivatedSteam: writer->WriteValue(TEXT("ActivatedSteam")); break; + case TitleActivationStatusRevokedSteam: writer->WriteValue(TEXT("RevokedSteam")); break; + } +} + +ClientModels::TitleActivationStatus PlayFab::ClientModels::readTitleActivationStatusFromValue(const TSharedPtr& value) +{ + return readTitleActivationStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::TitleActivationStatus PlayFab::ClientModels::readTitleActivationStatusFromValue(const FString& value) +{ + static TMap _TitleActivationStatusMap; + if (_TitleActivationStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _TitleActivationStatusMap.Add(TEXT("None"), TitleActivationStatusNone); + _TitleActivationStatusMap.Add(TEXT("ActivatedTitleKey"), TitleActivationStatusActivatedTitleKey); + _TitleActivationStatusMap.Add(TEXT("PendingSteam"), TitleActivationStatusPendingSteam); + _TitleActivationStatusMap.Add(TEXT("ActivatedSteam"), TitleActivationStatusActivatedSteam); + _TitleActivationStatusMap.Add(TEXT("RevokedSteam"), TitleActivationStatusRevokedSteam); + + } + + if (!value.IsEmpty()) + { + auto output = _TitleActivationStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return TitleActivationStatusNone; // Basically critical fail +} + +PlayFab::ClientModels::FUserSteamInfo::~FUserSteamInfo() +{ + +} + +void PlayFab::ClientModels::FUserSteamInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SteamActivationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("SteamActivationStatus")); writeTitleActivationStatusEnumJSON(SteamActivationStatus, writer); } + + if (SteamCountry.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamCountry")); writer->WriteValue(SteamCountry); } + + if (SteamCurrency.notNull()) { writer->WriteIdentifierPrefix(TEXT("SteamCurrency")); writeCurrencyEnumJSON(SteamCurrency, writer); } + + if (SteamId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamId")); writer->WriteValue(SteamId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserSteamInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + SteamActivationStatus = readTitleActivationStatusFromValue(obj->TryGetField(TEXT("SteamActivationStatus"))); + + const TSharedPtr SteamCountryValue = obj->TryGetField(TEXT("SteamCountry")); + if (SteamCountryValue.IsValid() && !SteamCountryValue->IsNull()) + { + FString TmpValue; + if (SteamCountryValue->TryGetString(TmpValue)) { SteamCountry = TmpValue; } + } + + SteamCurrency = readCurrencyFromValue(obj->TryGetField(TEXT("SteamCurrency"))); + + const TSharedPtr SteamIdValue = obj->TryGetField(TEXT("SteamId")); + if (SteamIdValue.IsValid() && !SteamIdValue->IsNull()) + { + FString TmpValue; + if (SteamIdValue->TryGetString(TmpValue)) { SteamId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserXboxInfo::~FUserXboxInfo() +{ + +} + +void PlayFab::ClientModels::FUserXboxInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (XboxUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxUserId")); writer->WriteValue(XboxUserId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserXboxInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr XboxUserIdValue = obj->TryGetField(TEXT("XboxUserId")); + if (XboxUserIdValue.IsValid() && !XboxUserIdValue->IsNull()) + { + FString TmpValue; + if (XboxUserIdValue->TryGetString(TmpValue)) { XboxUserId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FFriendInfo::~FFriendInfo() +{ + //if (FacebookInfo != nullptr) delete FacebookInfo; + //if (GameCenterInfo != nullptr) delete GameCenterInfo; + //if (Profile != nullptr) delete Profile; + //if (PSNInfo != nullptr) delete PSNInfo; + //if (SteamInfo != nullptr) delete SteamInfo; + //if (XboxInfo != nullptr) delete XboxInfo; + +} + +void PlayFab::ClientModels::FFriendInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CurrentMatchmakerLobbyId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CurrentMatchmakerLobbyId")); writer->WriteValue(CurrentMatchmakerLobbyId); } + + if (FacebookInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInfo")); FacebookInfo->writeJSON(writer); } + + if (FriendPlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); } + + if (GameCenterInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GameCenterInfo")); GameCenterInfo->writeJSON(writer); } + + if (Profile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Profile")); Profile->writeJSON(writer); } + + if (PSNInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PSNInfo")); PSNInfo->writeJSON(writer); } + + if (SteamInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SteamInfo")); SteamInfo->writeJSON(writer); } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (TitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleDisplayName")); writer->WriteValue(TitleDisplayName); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + if (XboxInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("XboxInfo")); XboxInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FFriendInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrentMatchmakerLobbyIdValue = obj->TryGetField(TEXT("CurrentMatchmakerLobbyId")); + if (CurrentMatchmakerLobbyIdValue.IsValid() && !CurrentMatchmakerLobbyIdValue->IsNull()) + { + FString TmpValue; + if (CurrentMatchmakerLobbyIdValue->TryGetString(TmpValue)) { CurrentMatchmakerLobbyId = TmpValue; } + } + + const TSharedPtr FacebookInfoValue = obj->TryGetField(TEXT("FacebookInfo")); + if (FacebookInfoValue.IsValid() && !FacebookInfoValue->IsNull()) + { + FacebookInfo = MakeShareable(new FUserFacebookInfo(FacebookInfoValue->AsObject())); + } + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + const TSharedPtr GameCenterInfoValue = obj->TryGetField(TEXT("GameCenterInfo")); + if (GameCenterInfoValue.IsValid() && !GameCenterInfoValue->IsNull()) + { + GameCenterInfo = MakeShareable(new FUserGameCenterInfo(GameCenterInfoValue->AsObject())); + } + + const TSharedPtr ProfileValue = obj->TryGetField(TEXT("Profile")); + if (ProfileValue.IsValid() && !ProfileValue->IsNull()) + { + Profile = MakeShareable(new FPlayerProfileModel(ProfileValue->AsObject())); + } + + const TSharedPtr PSNInfoValue = obj->TryGetField(TEXT("PSNInfo")); + if (PSNInfoValue.IsValid() && !PSNInfoValue->IsNull()) + { + PSNInfo = MakeShareable(new FUserPsnInfo(PSNInfoValue->AsObject())); + } + + const TSharedPtr SteamInfoValue = obj->TryGetField(TEXT("SteamInfo")); + if (SteamInfoValue.IsValid() && !SteamInfoValue->IsNull()) + { + SteamInfo = MakeShareable(new FUserSteamInfo(SteamInfoValue->AsObject())); + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr TitleDisplayNameValue = obj->TryGetField(TEXT("TitleDisplayName")); + if (TitleDisplayNameValue.IsValid() && !TitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (TitleDisplayNameValue->TryGetString(TmpValue)) { TitleDisplayName = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + const TSharedPtr XboxInfoValue = obj->TryGetField(TEXT("XboxInfo")); + if (XboxInfoValue.IsValid() && !XboxInfoValue->IsNull()) + { + XboxInfo = MakeShareable(new FUserXboxInfo(XboxInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGameCenterPlayFabIdPair::~FGameCenterPlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FGameCenterPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GameCenterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameCenterId")); writer->WriteValue(GameCenterId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGameCenterPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameCenterIdValue = obj->TryGetField(TEXT("GameCenterId")); + if (GameCenterIdValue.IsValid() && !GameCenterIdValue->IsNull()) + { + FString TmpValue; + if (GameCenterIdValue->TryGetString(TmpValue)) { GameCenterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGameServerRegionsRequest::~FGameServerRegionsRequest() +{ + +} + +void PlayFab::ClientModels::FGameServerRegionsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGameServerRegionsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRegionInfo::~FRegionInfo() +{ + +} + +void PlayFab::ClientModels::FRegionInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Available")); writer->WriteValue(Available); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + if (PingUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PingUrl")); writer->WriteValue(PingUrl); } + + if (pfRegion.notNull()) { writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRegionInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AvailableValue = obj->TryGetField(TEXT("Available")); + if (AvailableValue.IsValid() && !AvailableValue->IsNull()) + { + bool TmpValue; + if (AvailableValue->TryGetBool(TmpValue)) { Available = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr PingUrlValue = obj->TryGetField(TEXT("PingUrl")); + if (PingUrlValue.IsValid() && !PingUrlValue->IsNull()) + { + FString TmpValue; + if (PingUrlValue->TryGetString(TmpValue)) { PingUrl = TmpValue; } + } + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGameServerRegionsResult::~FGameServerRegionsResult() +{ + +} + +void PlayFab::ClientModels::FGameServerRegionsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Regions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Regions")); + for (const FRegionInfo& item : Regions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGameServerRegionsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&RegionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Regions")); + for (int32 Idx = 0; Idx < RegionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = RegionsArray[Idx]; + Regions.Add(FRegionInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGenericPlayFabIdPair::~FGenericPlayFabIdPair() +{ + //if (GenericId != nullptr) delete GenericId; + +} + +void PlayFab::ClientModels::FGenericPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GenericId.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GenericId")); GenericId->writeJSON(writer); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGenericPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GenericIdValue = obj->TryGetField(TEXT("GenericId")); + if (GenericIdValue.IsValid() && !GenericIdValue->IsNull()) + { + GenericId = MakeShareable(new FGenericServiceId(GenericIdValue->AsObject())); + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetAccountInfoRequest::~FGetAccountInfoRequest() +{ + +} + +void PlayFab::ClientModels::FGetAccountInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (TitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleDisplayName")); writer->WriteValue(TitleDisplayName); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetAccountInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TitleDisplayNameValue = obj->TryGetField(TEXT("TitleDisplayName")); + if (TitleDisplayNameValue.IsValid() && !TitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (TitleDisplayNameValue->TryGetString(TmpValue)) { TitleDisplayName = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserAndroidDeviceInfo::~FUserAndroidDeviceInfo() +{ + +} + +void PlayFab::ClientModels::FUserAndroidDeviceInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceId")); writer->WriteValue(AndroidDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserAndroidDeviceInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceIdValue = obj->TryGetField(TEXT("AndroidDeviceId")); + if (AndroidDeviceIdValue.IsValid() && !AndroidDeviceIdValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceIdValue->TryGetString(TmpValue)) { AndroidDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserCustomIdInfo::~FUserCustomIdInfo() +{ + +} + +void PlayFab::ClientModels::FUserCustomIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CustomId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomId")); writer->WriteValue(CustomId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserCustomIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomIdValue = obj->TryGetField(TEXT("CustomId")); + if (CustomIdValue.IsValid() && !CustomIdValue->IsNull()) + { + FString TmpValue; + if (CustomIdValue->TryGetString(TmpValue)) { CustomId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserFacebookInstantGamesIdInfo::~FUserFacebookInstantGamesIdInfo() +{ + +} + +void PlayFab::ClientModels::FUserFacebookInstantGamesIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookInstantGamesId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesId")); writer->WriteValue(FacebookInstantGamesId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserFacebookInstantGamesIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesIdValue = obj->TryGetField(TEXT("FacebookInstantGamesId")); + if (FacebookInstantGamesIdValue.IsValid() && !FacebookInstantGamesIdValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesIdValue->TryGetString(TmpValue)) { FacebookInstantGamesId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserGoogleInfo::~FUserGoogleInfo() +{ + +} + +void PlayFab::ClientModels::FUserGoogleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GoogleEmail.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleEmail")); writer->WriteValue(GoogleEmail); } + + if (GoogleGender.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleGender")); writer->WriteValue(GoogleGender); } + + if (GoogleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleId")); writer->WriteValue(GoogleId); } + + if (GoogleLocale.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleLocale")); writer->WriteValue(GoogleLocale); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserGoogleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GoogleEmailValue = obj->TryGetField(TEXT("GoogleEmail")); + if (GoogleEmailValue.IsValid() && !GoogleEmailValue->IsNull()) + { + FString TmpValue; + if (GoogleEmailValue->TryGetString(TmpValue)) { GoogleEmail = TmpValue; } + } + + const TSharedPtr GoogleGenderValue = obj->TryGetField(TEXT("GoogleGender")); + if (GoogleGenderValue.IsValid() && !GoogleGenderValue->IsNull()) + { + FString TmpValue; + if (GoogleGenderValue->TryGetString(TmpValue)) { GoogleGender = TmpValue; } + } + + const TSharedPtr GoogleIdValue = obj->TryGetField(TEXT("GoogleId")); + if (GoogleIdValue.IsValid() && !GoogleIdValue->IsNull()) + { + FString TmpValue; + if (GoogleIdValue->TryGetString(TmpValue)) { GoogleId = TmpValue; } + } + + const TSharedPtr GoogleLocaleValue = obj->TryGetField(TEXT("GoogleLocale")); + if (GoogleLocaleValue.IsValid() && !GoogleLocaleValue->IsNull()) + { + FString TmpValue; + if (GoogleLocaleValue->TryGetString(TmpValue)) { GoogleLocale = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserIosDeviceInfo::~FUserIosDeviceInfo() +{ + +} + +void PlayFab::ClientModels::FUserIosDeviceInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IosDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IosDeviceId")); writer->WriteValue(IosDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserIosDeviceInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IosDeviceIdValue = obj->TryGetField(TEXT("IosDeviceId")); + if (IosDeviceIdValue.IsValid() && !IosDeviceIdValue->IsNull()) + { + FString TmpValue; + if (IosDeviceIdValue->TryGetString(TmpValue)) { IosDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserKongregateInfo::~FUserKongregateInfo() +{ + +} + +void PlayFab::ClientModels::FUserKongregateInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (KongregateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateId")); writer->WriteValue(KongregateId); } + + if (KongregateName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateName")); writer->WriteValue(KongregateName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserKongregateInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KongregateIdValue = obj->TryGetField(TEXT("KongregateId")); + if (KongregateIdValue.IsValid() && !KongregateIdValue->IsNull()) + { + FString TmpValue; + if (KongregateIdValue->TryGetString(TmpValue)) { KongregateId = TmpValue; } + } + + const TSharedPtr KongregateNameValue = obj->TryGetField(TEXT("KongregateName")); + if (KongregateNameValue.IsValid() && !KongregateNameValue->IsNull()) + { + FString TmpValue; + if (KongregateNameValue->TryGetString(TmpValue)) { KongregateName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserNintendoSwitchDeviceIdInfo::~FUserNintendoSwitchDeviceIdInfo() +{ + +} + +void PlayFab::ClientModels::FUserNintendoSwitchDeviceIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserNintendoSwitchDeviceIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserOpenIdInfo::~FUserOpenIdInfo() +{ + +} + +void PlayFab::ClientModels::FUserOpenIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ConnectionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ConnectionId")); writer->WriteValue(ConnectionId); } + + if (Issuer.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Issuer")); writer->WriteValue(Issuer); } + + if (Subject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Subject")); writer->WriteValue(Subject); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserOpenIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ConnectionIdValue = obj->TryGetField(TEXT("ConnectionId")); + if (ConnectionIdValue.IsValid() && !ConnectionIdValue->IsNull()) + { + FString TmpValue; + if (ConnectionIdValue->TryGetString(TmpValue)) { ConnectionId = TmpValue; } + } + + const TSharedPtr IssuerValue = obj->TryGetField(TEXT("Issuer")); + if (IssuerValue.IsValid() && !IssuerValue->IsNull()) + { + FString TmpValue; + if (IssuerValue->TryGetString(TmpValue)) { Issuer = TmpValue; } + } + + const TSharedPtr SubjectValue = obj->TryGetField(TEXT("Subject")); + if (SubjectValue.IsValid() && !SubjectValue->IsNull()) + { + FString TmpValue; + if (SubjectValue->TryGetString(TmpValue)) { Subject = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserPrivateAccountInfo::~FUserPrivateAccountInfo() +{ + +} + +void PlayFab::ClientModels::FUserPrivateAccountInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserPrivateAccountInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeUserOriginationEnumJSON(UserOrigination enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case UserOriginationOrganic: writer->WriteValue(TEXT("Organic")); break; + case UserOriginationSteam: writer->WriteValue(TEXT("Steam")); break; + case UserOriginationGoogle: writer->WriteValue(TEXT("Google")); break; + case UserOriginationAmazon: writer->WriteValue(TEXT("Amazon")); break; + case UserOriginationFacebook: writer->WriteValue(TEXT("Facebook")); break; + case UserOriginationKongregate: writer->WriteValue(TEXT("Kongregate")); break; + case UserOriginationGamersFirst: writer->WriteValue(TEXT("GamersFirst")); break; + case UserOriginationUnknown: writer->WriteValue(TEXT("Unknown")); break; + case UserOriginationIOS: writer->WriteValue(TEXT("IOS")); break; + case UserOriginationLoadTest: writer->WriteValue(TEXT("LoadTest")); break; + case UserOriginationAndroid: writer->WriteValue(TEXT("Android")); break; + case UserOriginationPSN: writer->WriteValue(TEXT("PSN")); break; + case UserOriginationGameCenter: writer->WriteValue(TEXT("GameCenter")); break; + case UserOriginationCustomId: writer->WriteValue(TEXT("CustomId")); break; + case UserOriginationXboxLive: writer->WriteValue(TEXT("XboxLive")); break; + case UserOriginationParse: writer->WriteValue(TEXT("Parse")); break; + case UserOriginationTwitch: writer->WriteValue(TEXT("Twitch")); break; + case UserOriginationWindowsHello: writer->WriteValue(TEXT("WindowsHello")); break; + case UserOriginationServerCustomId: writer->WriteValue(TEXT("ServerCustomId")); break; + case UserOriginationNintendoSwitchDeviceId: writer->WriteValue(TEXT("NintendoSwitchDeviceId")); break; + case UserOriginationFacebookInstantGamesId: writer->WriteValue(TEXT("FacebookInstantGamesId")); break; + case UserOriginationOpenIdConnect: writer->WriteValue(TEXT("OpenIdConnect")); break; + } +} + +ClientModels::UserOrigination PlayFab::ClientModels::readUserOriginationFromValue(const TSharedPtr& value) +{ + return readUserOriginationFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::UserOrigination PlayFab::ClientModels::readUserOriginationFromValue(const FString& value) +{ + static TMap _UserOriginationMap; + if (_UserOriginationMap.Num() == 0) + { + // Auto-generate the map on the first use + _UserOriginationMap.Add(TEXT("Organic"), UserOriginationOrganic); + _UserOriginationMap.Add(TEXT("Steam"), UserOriginationSteam); + _UserOriginationMap.Add(TEXT("Google"), UserOriginationGoogle); + _UserOriginationMap.Add(TEXT("Amazon"), UserOriginationAmazon); + _UserOriginationMap.Add(TEXT("Facebook"), UserOriginationFacebook); + _UserOriginationMap.Add(TEXT("Kongregate"), UserOriginationKongregate); + _UserOriginationMap.Add(TEXT("GamersFirst"), UserOriginationGamersFirst); + _UserOriginationMap.Add(TEXT("Unknown"), UserOriginationUnknown); + _UserOriginationMap.Add(TEXT("IOS"), UserOriginationIOS); + _UserOriginationMap.Add(TEXT("LoadTest"), UserOriginationLoadTest); + _UserOriginationMap.Add(TEXT("Android"), UserOriginationAndroid); + _UserOriginationMap.Add(TEXT("PSN"), UserOriginationPSN); + _UserOriginationMap.Add(TEXT("GameCenter"), UserOriginationGameCenter); + _UserOriginationMap.Add(TEXT("CustomId"), UserOriginationCustomId); + _UserOriginationMap.Add(TEXT("XboxLive"), UserOriginationXboxLive); + _UserOriginationMap.Add(TEXT("Parse"), UserOriginationParse); + _UserOriginationMap.Add(TEXT("Twitch"), UserOriginationTwitch); + _UserOriginationMap.Add(TEXT("WindowsHello"), UserOriginationWindowsHello); + _UserOriginationMap.Add(TEXT("ServerCustomId"), UserOriginationServerCustomId); + _UserOriginationMap.Add(TEXT("NintendoSwitchDeviceId"), UserOriginationNintendoSwitchDeviceId); + _UserOriginationMap.Add(TEXT("FacebookInstantGamesId"), UserOriginationFacebookInstantGamesId); + _UserOriginationMap.Add(TEXT("OpenIdConnect"), UserOriginationOpenIdConnect); + + } + + if (!value.IsEmpty()) + { + auto output = _UserOriginationMap.Find(value); + if (output != nullptr) + return *output; + } + + return UserOriginationOrganic; // Basically critical fail +} + +PlayFab::ClientModels::FUserTitleInfo::~FUserTitleInfo() +{ + //if (TitlePlayerAccount != nullptr) delete TitlePlayerAccount; + +} + +void PlayFab::ClientModels::FUserTitleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (FirstLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("FirstLogin")); writeDatetime(FirstLogin, writer); } + + if (isBanned.notNull()) { writer->WriteIdentifierPrefix(TEXT("isBanned")); writer->WriteValue(isBanned); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeUserOriginationEnumJSON(Origination, writer); } + + if (TitlePlayerAccount.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TitlePlayerAccount")); TitlePlayerAccount->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserTitleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr FirstLoginValue = obj->TryGetField(TEXT("FirstLogin")); + if (FirstLoginValue.IsValid()) + FirstLogin = readDatetime(FirstLoginValue); + + + const TSharedPtr isBannedValue = obj->TryGetField(TEXT("isBanned")); + if (isBannedValue.IsValid() && !isBannedValue->IsNull()) + { + bool TmpValue; + if (isBannedValue->TryGetBool(TmpValue)) { isBanned = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + Origination = readUserOriginationFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr TitlePlayerAccountValue = obj->TryGetField(TEXT("TitlePlayerAccount")); + if (TitlePlayerAccountValue.IsValid() && !TitlePlayerAccountValue->IsNull()) + { + TitlePlayerAccount = MakeShareable(new FEntityKey(TitlePlayerAccountValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserTwitchInfo::~FUserTwitchInfo() +{ + +} + +void PlayFab::ClientModels::FUserTwitchInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TwitchId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchId")); writer->WriteValue(TwitchId); } + + if (TwitchUserName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchUserName")); writer->WriteValue(TwitchUserName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserTwitchInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TwitchIdValue = obj->TryGetField(TEXT("TwitchId")); + if (TwitchIdValue.IsValid() && !TwitchIdValue->IsNull()) + { + FString TmpValue; + if (TwitchIdValue->TryGetString(TmpValue)) { TwitchId = TmpValue; } + } + + const TSharedPtr TwitchUserNameValue = obj->TryGetField(TEXT("TwitchUserName")); + if (TwitchUserNameValue.IsValid() && !TwitchUserNameValue->IsNull()) + { + FString TmpValue; + if (TwitchUserNameValue->TryGetString(TmpValue)) { TwitchUserName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserWindowsHelloInfo::~FUserWindowsHelloInfo() +{ + +} + +void PlayFab::ClientModels::FUserWindowsHelloInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (WindowsHelloDeviceName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloDeviceName")); writer->WriteValue(WindowsHelloDeviceName); } + + if (WindowsHelloPublicKeyHash.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloPublicKeyHash")); writer->WriteValue(WindowsHelloPublicKeyHash); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserWindowsHelloInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr WindowsHelloDeviceNameValue = obj->TryGetField(TEXT("WindowsHelloDeviceName")); + if (WindowsHelloDeviceNameValue.IsValid() && !WindowsHelloDeviceNameValue->IsNull()) + { + FString TmpValue; + if (WindowsHelloDeviceNameValue->TryGetString(TmpValue)) { WindowsHelloDeviceName = TmpValue; } + } + + const TSharedPtr WindowsHelloPublicKeyHashValue = obj->TryGetField(TEXT("WindowsHelloPublicKeyHash")); + if (WindowsHelloPublicKeyHashValue.IsValid() && !WindowsHelloPublicKeyHashValue->IsNull()) + { + FString TmpValue; + if (WindowsHelloPublicKeyHashValue->TryGetString(TmpValue)) { WindowsHelloPublicKeyHash = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserAccountInfo::~FUserAccountInfo() +{ + //if (AndroidDeviceInfo != nullptr) delete AndroidDeviceInfo; + //if (CustomIdInfo != nullptr) delete CustomIdInfo; + //if (FacebookInfo != nullptr) delete FacebookInfo; + //if (FacebookInstantGamesIdInfo != nullptr) delete FacebookInstantGamesIdInfo; + //if (GameCenterInfo != nullptr) delete GameCenterInfo; + //if (GoogleInfo != nullptr) delete GoogleInfo; + //if (IosDeviceInfo != nullptr) delete IosDeviceInfo; + //if (KongregateInfo != nullptr) delete KongregateInfo; + //if (NintendoSwitchDeviceIdInfo != nullptr) delete NintendoSwitchDeviceIdInfo; + //if (PrivateInfo != nullptr) delete PrivateInfo; + //if (PsnInfo != nullptr) delete PsnInfo; + //if (SteamInfo != nullptr) delete SteamInfo; + //if (TitleInfo != nullptr) delete TitleInfo; + //if (TwitchInfo != nullptr) delete TwitchInfo; + //if (WindowsHelloInfo != nullptr) delete WindowsHelloInfo; + //if (XboxInfo != nullptr) delete XboxInfo; + +} + +void PlayFab::ClientModels::FUserAccountInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceInfo")); AndroidDeviceInfo->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + if (CustomIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("CustomIdInfo")); CustomIdInfo->writeJSON(writer); } + + if (FacebookInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInfo")); FacebookInfo->writeJSON(writer); } + + if (FacebookInstantGamesIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesIdInfo")); FacebookInstantGamesIdInfo->writeJSON(writer); } + + if (GameCenterInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GameCenterInfo")); GameCenterInfo->writeJSON(writer); } + + if (GoogleInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GoogleInfo")); GoogleInfo->writeJSON(writer); } + + if (IosDeviceInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("IosDeviceInfo")); IosDeviceInfo->writeJSON(writer); } + + if (KongregateInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("KongregateInfo")); KongregateInfo->writeJSON(writer); } + + if (NintendoSwitchDeviceIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceIdInfo")); NintendoSwitchDeviceIdInfo->writeJSON(writer); } + + if (OpenIdInfo.Num() != 0) + { + writer->WriteArrayStart(TEXT("OpenIdInfo")); + for (const FUserOpenIdInfo& item : OpenIdInfo) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (PrivateInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PrivateInfo")); PrivateInfo->writeJSON(writer); } + + if (PsnInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PsnInfo")); PsnInfo->writeJSON(writer); } + + if (SteamInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SteamInfo")); SteamInfo->writeJSON(writer); } + + if (TitleInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TitleInfo")); TitleInfo->writeJSON(writer); } + + if (TwitchInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TwitchInfo")); TwitchInfo->writeJSON(writer); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + if (WindowsHelloInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloInfo")); WindowsHelloInfo->writeJSON(writer); } + + if (XboxInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("XboxInfo")); XboxInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserAccountInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceInfoValue = obj->TryGetField(TEXT("AndroidDeviceInfo")); + if (AndroidDeviceInfoValue.IsValid() && !AndroidDeviceInfoValue->IsNull()) + { + AndroidDeviceInfo = MakeShareable(new FUserAndroidDeviceInfo(AndroidDeviceInfoValue->AsObject())); + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr CustomIdInfoValue = obj->TryGetField(TEXT("CustomIdInfo")); + if (CustomIdInfoValue.IsValid() && !CustomIdInfoValue->IsNull()) + { + CustomIdInfo = MakeShareable(new FUserCustomIdInfo(CustomIdInfoValue->AsObject())); + } + + const TSharedPtr FacebookInfoValue = obj->TryGetField(TEXT("FacebookInfo")); + if (FacebookInfoValue.IsValid() && !FacebookInfoValue->IsNull()) + { + FacebookInfo = MakeShareable(new FUserFacebookInfo(FacebookInfoValue->AsObject())); + } + + const TSharedPtr FacebookInstantGamesIdInfoValue = obj->TryGetField(TEXT("FacebookInstantGamesIdInfo")); + if (FacebookInstantGamesIdInfoValue.IsValid() && !FacebookInstantGamesIdInfoValue->IsNull()) + { + FacebookInstantGamesIdInfo = MakeShareable(new FUserFacebookInstantGamesIdInfo(FacebookInstantGamesIdInfoValue->AsObject())); + } + + const TSharedPtr GameCenterInfoValue = obj->TryGetField(TEXT("GameCenterInfo")); + if (GameCenterInfoValue.IsValid() && !GameCenterInfoValue->IsNull()) + { + GameCenterInfo = MakeShareable(new FUserGameCenterInfo(GameCenterInfoValue->AsObject())); + } + + const TSharedPtr GoogleInfoValue = obj->TryGetField(TEXT("GoogleInfo")); + if (GoogleInfoValue.IsValid() && !GoogleInfoValue->IsNull()) + { + GoogleInfo = MakeShareable(new FUserGoogleInfo(GoogleInfoValue->AsObject())); + } + + const TSharedPtr IosDeviceInfoValue = obj->TryGetField(TEXT("IosDeviceInfo")); + if (IosDeviceInfoValue.IsValid() && !IosDeviceInfoValue->IsNull()) + { + IosDeviceInfo = MakeShareable(new FUserIosDeviceInfo(IosDeviceInfoValue->AsObject())); + } + + const TSharedPtr KongregateInfoValue = obj->TryGetField(TEXT("KongregateInfo")); + if (KongregateInfoValue.IsValid() && !KongregateInfoValue->IsNull()) + { + KongregateInfo = MakeShareable(new FUserKongregateInfo(KongregateInfoValue->AsObject())); + } + + const TSharedPtr NintendoSwitchDeviceIdInfoValue = obj->TryGetField(TEXT("NintendoSwitchDeviceIdInfo")); + if (NintendoSwitchDeviceIdInfoValue.IsValid() && !NintendoSwitchDeviceIdInfoValue->IsNull()) + { + NintendoSwitchDeviceIdInfo = MakeShareable(new FUserNintendoSwitchDeviceIdInfo(NintendoSwitchDeviceIdInfoValue->AsObject())); + } + + const TArray>&OpenIdInfoArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("OpenIdInfo")); + for (int32 Idx = 0; Idx < OpenIdInfoArray.Num(); Idx++) + { + TSharedPtr CurrentItem = OpenIdInfoArray[Idx]; + OpenIdInfo.Add(FUserOpenIdInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PrivateInfoValue = obj->TryGetField(TEXT("PrivateInfo")); + if (PrivateInfoValue.IsValid() && !PrivateInfoValue->IsNull()) + { + PrivateInfo = MakeShareable(new FUserPrivateAccountInfo(PrivateInfoValue->AsObject())); + } + + const TSharedPtr PsnInfoValue = obj->TryGetField(TEXT("PsnInfo")); + if (PsnInfoValue.IsValid() && !PsnInfoValue->IsNull()) + { + PsnInfo = MakeShareable(new FUserPsnInfo(PsnInfoValue->AsObject())); + } + + const TSharedPtr SteamInfoValue = obj->TryGetField(TEXT("SteamInfo")); + if (SteamInfoValue.IsValid() && !SteamInfoValue->IsNull()) + { + SteamInfo = MakeShareable(new FUserSteamInfo(SteamInfoValue->AsObject())); + } + + const TSharedPtr TitleInfoValue = obj->TryGetField(TEXT("TitleInfo")); + if (TitleInfoValue.IsValid() && !TitleInfoValue->IsNull()) + { + TitleInfo = MakeShareable(new FUserTitleInfo(TitleInfoValue->AsObject())); + } + + const TSharedPtr TwitchInfoValue = obj->TryGetField(TEXT("TwitchInfo")); + if (TwitchInfoValue.IsValid() && !TwitchInfoValue->IsNull()) + { + TwitchInfo = MakeShareable(new FUserTwitchInfo(TwitchInfoValue->AsObject())); + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + const TSharedPtr WindowsHelloInfoValue = obj->TryGetField(TEXT("WindowsHelloInfo")); + if (WindowsHelloInfoValue.IsValid() && !WindowsHelloInfoValue->IsNull()) + { + WindowsHelloInfo = MakeShareable(new FUserWindowsHelloInfo(WindowsHelloInfoValue->AsObject())); + } + + const TSharedPtr XboxInfoValue = obj->TryGetField(TEXT("XboxInfo")); + if (XboxInfoValue.IsValid() && !XboxInfoValue->IsNull()) + { + XboxInfo = MakeShareable(new FUserXboxInfo(XboxInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetAccountInfoResult::~FGetAccountInfoResult() +{ + //if (AccountInfo != nullptr) delete AccountInfo; + +} + +void PlayFab::ClientModels::FGetAccountInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AccountInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("AccountInfo")); AccountInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetAccountInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccountInfoValue = obj->TryGetField(TEXT("AccountInfo")); + if (AccountInfoValue.IsValid() && !AccountInfoValue->IsNull()) + { + AccountInfo = MakeShareable(new FUserAccountInfo(AccountInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCatalogItemsRequest::~FGetCatalogItemsRequest() +{ + +} + +void PlayFab::ClientModels::FGetCatalogItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCatalogItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCatalogItemsResult::~FGetCatalogItemsResult() +{ + +} + +void PlayFab::ClientModels::FGetCatalogItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Catalog.Num() != 0) + { + writer->WriteArrayStart(TEXT("Catalog")); + for (const FCatalogItem& item : Catalog) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCatalogItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&CatalogArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Catalog")); + for (int32 Idx = 0; Idx < CatalogArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CatalogArray[Idx]; + Catalog.Add(FCatalogItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterDataRequest::~FGetCharacterDataRequest() +{ + +} + +void PlayFab::ClientModels::FGetCharacterDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (IfChangedFromDataVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("IfChangedFromDataVersion")); writer->WriteValue(static_cast(IfChangedFromDataVersion)); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr IfChangedFromDataVersionValue = obj->TryGetField(TEXT("IfChangedFromDataVersion")); + if (IfChangedFromDataVersionValue.IsValid() && !IfChangedFromDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (IfChangedFromDataVersionValue->TryGetNumber(TmpValue)) { IfChangedFromDataVersion = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeUserDataPermissionEnumJSON(UserDataPermission enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case UserDataPermissionPrivate: writer->WriteValue(TEXT("Private")); break; + case UserDataPermissionPublic: writer->WriteValue(TEXT("Public")); break; + } +} + +ClientModels::UserDataPermission PlayFab::ClientModels::readUserDataPermissionFromValue(const TSharedPtr& value) +{ + return readUserDataPermissionFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::UserDataPermission PlayFab::ClientModels::readUserDataPermissionFromValue(const FString& value) +{ + static TMap _UserDataPermissionMap; + if (_UserDataPermissionMap.Num() == 0) + { + // Auto-generate the map on the first use + _UserDataPermissionMap.Add(TEXT("Private"), UserDataPermissionPrivate); + _UserDataPermissionMap.Add(TEXT("Public"), UserDataPermissionPublic); + + } + + if (!value.IsEmpty()) + { + auto output = _UserDataPermissionMap.Find(value); + if (output != nullptr) + return *output; + } + + return UserDataPermissionPrivate; // Basically critical fail +} + +PlayFab::ClientModels::FUserDataRecord::~FUserDataRecord() +{ + +} + +void PlayFab::ClientModels::FUserDataRecord::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LastUpdated")); writeDatetime(LastUpdated, writer); + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserDataRecord::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LastUpdatedValue = obj->TryGetField(TEXT("LastUpdated")); + if (LastUpdatedValue.IsValid()) + LastUpdated = readDatetime(LastUpdatedValue); + + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterDataResult::~FGetCharacterDataResult() +{ + +} + +void PlayFab::ClientModels::FGetCharacterDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterInventoryRequest::~FGetCharacterInventoryRequest() +{ + +} + +void PlayFab::ClientModels::FGetCharacterInventoryRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterInventoryRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FVirtualCurrencyRechargeTime::~FVirtualCurrencyRechargeTime() +{ + +} + +void PlayFab::ClientModels::FVirtualCurrencyRechargeTime::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("RechargeMax")); writer->WriteValue(RechargeMax); + + writer->WriteIdentifierPrefix(TEXT("RechargeTime")); writeDatetime(RechargeTime, writer); + + writer->WriteIdentifierPrefix(TEXT("SecondsToRecharge")); writer->WriteValue(SecondsToRecharge); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FVirtualCurrencyRechargeTime::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RechargeMaxValue = obj->TryGetField(TEXT("RechargeMax")); + if (RechargeMaxValue.IsValid() && !RechargeMaxValue->IsNull()) + { + int32 TmpValue; + if (RechargeMaxValue->TryGetNumber(TmpValue)) { RechargeMax = TmpValue; } + } + + const TSharedPtr RechargeTimeValue = obj->TryGetField(TEXT("RechargeTime")); + if (RechargeTimeValue.IsValid()) + RechargeTime = readDatetime(RechargeTimeValue); + + + const TSharedPtr SecondsToRechargeValue = obj->TryGetField(TEXT("SecondsToRecharge")); + if (SecondsToRechargeValue.IsValid() && !SecondsToRechargeValue->IsNull()) + { + int32 TmpValue; + if (SecondsToRechargeValue->TryGetNumber(TmpValue)) { SecondsToRecharge = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterInventoryResult::~FGetCharacterInventoryResult() +{ + +} + +void PlayFab::ClientModels::FGetCharacterInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(VirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyRechargeTimes"), VirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + VirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterLeaderboardRequest::~FGetCharacterLeaderboardRequest() +{ + +} + +void PlayFab::ClientModels::FGetCharacterLeaderboardRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + if (MaxResultsCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); } + + writer->WriteIdentifierPrefix(TEXT("StartPosition")); writer->WriteValue(StartPosition); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterLeaderboardRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr StartPositionValue = obj->TryGetField(TEXT("StartPosition")); + if (StartPositionValue.IsValid() && !StartPositionValue->IsNull()) + { + int32 TmpValue; + if (StartPositionValue->TryGetNumber(TmpValue)) { StartPosition = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterLeaderboardResult::~FGetCharacterLeaderboardResult() +{ + +} + +void PlayFab::ClientModels::FGetCharacterLeaderboardResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FCharacterLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterLeaderboardResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FCharacterLeaderboardEntry(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterStatisticsRequest::~FGetCharacterStatisticsRequest() +{ + +} + +void PlayFab::ClientModels::FGetCharacterStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterStatisticsResult::~FGetCharacterStatisticsResult() +{ + +} + +void PlayFab::ClientModels::FGetCharacterStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterStatistics.Num() != 0) + { + writer->WriteObjectStart(TEXT("CharacterStatistics")); + for (TMap::TConstIterator It(CharacterStatistics); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* CharacterStatisticsObject; + if (obj->TryGetObjectField(TEXT("CharacterStatistics"), CharacterStatisticsObject)) + { + for (TMap>::TConstIterator It((*CharacterStatisticsObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + CharacterStatistics.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetContentDownloadUrlRequest::~FGetContentDownloadUrlRequest() +{ + +} + +void PlayFab::ClientModels::FGetContentDownloadUrlRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (HttpMethod.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("HttpMethod")); writer->WriteValue(HttpMethod); } + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + if (ThruCDN.notNull()) { writer->WriteIdentifierPrefix(TEXT("ThruCDN")); writer->WriteValue(ThruCDN); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetContentDownloadUrlRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr HttpMethodValue = obj->TryGetField(TEXT("HttpMethod")); + if (HttpMethodValue.IsValid() && !HttpMethodValue->IsNull()) + { + FString TmpValue; + if (HttpMethodValue->TryGetString(TmpValue)) { HttpMethod = TmpValue; } + } + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr ThruCDNValue = obj->TryGetField(TEXT("ThruCDN")); + if (ThruCDNValue.IsValid() && !ThruCDNValue->IsNull()) + { + bool TmpValue; + if (ThruCDNValue->TryGetBool(TmpValue)) { ThruCDN = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetContentDownloadUrlResult::~FGetContentDownloadUrlResult() +{ + +} + +void PlayFab::ClientModels::FGetContentDownloadUrlResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (URL.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("URL")); writer->WriteValue(URL); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetContentDownloadUrlResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr URLValue = obj->TryGetField(TEXT("URL")); + if (URLValue.IsValid() && !URLValue->IsNull()) + { + FString TmpValue; + if (URLValue->TryGetString(TmpValue)) { URL = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPlayerProfileViewConstraints::~FPlayerProfileViewConstraints() +{ + +} + +void PlayFab::ClientModels::FPlayerProfileViewConstraints::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ShowAvatarUrl")); writer->WriteValue(ShowAvatarUrl); + + writer->WriteIdentifierPrefix(TEXT("ShowBannedUntil")); writer->WriteValue(ShowBannedUntil); + + writer->WriteIdentifierPrefix(TEXT("ShowCampaignAttributions")); writer->WriteValue(ShowCampaignAttributions); + + writer->WriteIdentifierPrefix(TEXT("ShowContactEmailAddresses")); writer->WriteValue(ShowContactEmailAddresses); + + writer->WriteIdentifierPrefix(TEXT("ShowCreated")); writer->WriteValue(ShowCreated); + + writer->WriteIdentifierPrefix(TEXT("ShowDisplayName")); writer->WriteValue(ShowDisplayName); + + writer->WriteIdentifierPrefix(TEXT("ShowLastLogin")); writer->WriteValue(ShowLastLogin); + + writer->WriteIdentifierPrefix(TEXT("ShowLinkedAccounts")); writer->WriteValue(ShowLinkedAccounts); + + writer->WriteIdentifierPrefix(TEXT("ShowLocations")); writer->WriteValue(ShowLocations); + + writer->WriteIdentifierPrefix(TEXT("ShowMemberships")); writer->WriteValue(ShowMemberships); + + writer->WriteIdentifierPrefix(TEXT("ShowOrigination")); writer->WriteValue(ShowOrigination); + + writer->WriteIdentifierPrefix(TEXT("ShowPushNotificationRegistrations")); writer->WriteValue(ShowPushNotificationRegistrations); + + writer->WriteIdentifierPrefix(TEXT("ShowStatistics")); writer->WriteValue(ShowStatistics); + + writer->WriteIdentifierPrefix(TEXT("ShowTags")); writer->WriteValue(ShowTags); + + writer->WriteIdentifierPrefix(TEXT("ShowTotalValueToDateInUsd")); writer->WriteValue(ShowTotalValueToDateInUsd); + + writer->WriteIdentifierPrefix(TEXT("ShowValuesToDate")); writer->WriteValue(ShowValuesToDate); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPlayerProfileViewConstraints::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ShowAvatarUrlValue = obj->TryGetField(TEXT("ShowAvatarUrl")); + if (ShowAvatarUrlValue.IsValid() && !ShowAvatarUrlValue->IsNull()) + { + bool TmpValue; + if (ShowAvatarUrlValue->TryGetBool(TmpValue)) { ShowAvatarUrl = TmpValue; } + } + + const TSharedPtr ShowBannedUntilValue = obj->TryGetField(TEXT("ShowBannedUntil")); + if (ShowBannedUntilValue.IsValid() && !ShowBannedUntilValue->IsNull()) + { + bool TmpValue; + if (ShowBannedUntilValue->TryGetBool(TmpValue)) { ShowBannedUntil = TmpValue; } + } + + const TSharedPtr ShowCampaignAttributionsValue = obj->TryGetField(TEXT("ShowCampaignAttributions")); + if (ShowCampaignAttributionsValue.IsValid() && !ShowCampaignAttributionsValue->IsNull()) + { + bool TmpValue; + if (ShowCampaignAttributionsValue->TryGetBool(TmpValue)) { ShowCampaignAttributions = TmpValue; } + } + + const TSharedPtr ShowContactEmailAddressesValue = obj->TryGetField(TEXT("ShowContactEmailAddresses")); + if (ShowContactEmailAddressesValue.IsValid() && !ShowContactEmailAddressesValue->IsNull()) + { + bool TmpValue; + if (ShowContactEmailAddressesValue->TryGetBool(TmpValue)) { ShowContactEmailAddresses = TmpValue; } + } + + const TSharedPtr ShowCreatedValue = obj->TryGetField(TEXT("ShowCreated")); + if (ShowCreatedValue.IsValid() && !ShowCreatedValue->IsNull()) + { + bool TmpValue; + if (ShowCreatedValue->TryGetBool(TmpValue)) { ShowCreated = TmpValue; } + } + + const TSharedPtr ShowDisplayNameValue = obj->TryGetField(TEXT("ShowDisplayName")); + if (ShowDisplayNameValue.IsValid() && !ShowDisplayNameValue->IsNull()) + { + bool TmpValue; + if (ShowDisplayNameValue->TryGetBool(TmpValue)) { ShowDisplayName = TmpValue; } + } + + const TSharedPtr ShowLastLoginValue = obj->TryGetField(TEXT("ShowLastLogin")); + if (ShowLastLoginValue.IsValid() && !ShowLastLoginValue->IsNull()) + { + bool TmpValue; + if (ShowLastLoginValue->TryGetBool(TmpValue)) { ShowLastLogin = TmpValue; } + } + + const TSharedPtr ShowLinkedAccountsValue = obj->TryGetField(TEXT("ShowLinkedAccounts")); + if (ShowLinkedAccountsValue.IsValid() && !ShowLinkedAccountsValue->IsNull()) + { + bool TmpValue; + if (ShowLinkedAccountsValue->TryGetBool(TmpValue)) { ShowLinkedAccounts = TmpValue; } + } + + const TSharedPtr ShowLocationsValue = obj->TryGetField(TEXT("ShowLocations")); + if (ShowLocationsValue.IsValid() && !ShowLocationsValue->IsNull()) + { + bool TmpValue; + if (ShowLocationsValue->TryGetBool(TmpValue)) { ShowLocations = TmpValue; } + } + + const TSharedPtr ShowMembershipsValue = obj->TryGetField(TEXT("ShowMemberships")); + if (ShowMembershipsValue.IsValid() && !ShowMembershipsValue->IsNull()) + { + bool TmpValue; + if (ShowMembershipsValue->TryGetBool(TmpValue)) { ShowMemberships = TmpValue; } + } + + const TSharedPtr ShowOriginationValue = obj->TryGetField(TEXT("ShowOrigination")); + if (ShowOriginationValue.IsValid() && !ShowOriginationValue->IsNull()) + { + bool TmpValue; + if (ShowOriginationValue->TryGetBool(TmpValue)) { ShowOrigination = TmpValue; } + } + + const TSharedPtr ShowPushNotificationRegistrationsValue = obj->TryGetField(TEXT("ShowPushNotificationRegistrations")); + if (ShowPushNotificationRegistrationsValue.IsValid() && !ShowPushNotificationRegistrationsValue->IsNull()) + { + bool TmpValue; + if (ShowPushNotificationRegistrationsValue->TryGetBool(TmpValue)) { ShowPushNotificationRegistrations = TmpValue; } + } + + const TSharedPtr ShowStatisticsValue = obj->TryGetField(TEXT("ShowStatistics")); + if (ShowStatisticsValue.IsValid() && !ShowStatisticsValue->IsNull()) + { + bool TmpValue; + if (ShowStatisticsValue->TryGetBool(TmpValue)) { ShowStatistics = TmpValue; } + } + + const TSharedPtr ShowTagsValue = obj->TryGetField(TEXT("ShowTags")); + if (ShowTagsValue.IsValid() && !ShowTagsValue->IsNull()) + { + bool TmpValue; + if (ShowTagsValue->TryGetBool(TmpValue)) { ShowTags = TmpValue; } + } + + const TSharedPtr ShowTotalValueToDateInUsdValue = obj->TryGetField(TEXT("ShowTotalValueToDateInUsd")); + if (ShowTotalValueToDateInUsdValue.IsValid() && !ShowTotalValueToDateInUsdValue->IsNull()) + { + bool TmpValue; + if (ShowTotalValueToDateInUsdValue->TryGetBool(TmpValue)) { ShowTotalValueToDateInUsd = TmpValue; } + } + + const TSharedPtr ShowValuesToDateValue = obj->TryGetField(TEXT("ShowValuesToDate")); + if (ShowValuesToDateValue.IsValid() && !ShowValuesToDateValue->IsNull()) + { + bool TmpValue; + if (ShowValuesToDateValue->TryGetBool(TmpValue)) { ShowValuesToDate = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetFriendLeaderboardAroundPlayerRequest::~FGetFriendLeaderboardAroundPlayerRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetFriendLeaderboardAroundPlayerRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IncludeFacebookFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeFacebookFriends")); writer->WriteValue(IncludeFacebookFriends); } + + if (IncludeSteamFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeSteamFriends")); writer->WriteValue(IncludeSteamFriends); } + + if (MaxResultsCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + if (XboxToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetFriendLeaderboardAroundPlayerRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IncludeFacebookFriendsValue = obj->TryGetField(TEXT("IncludeFacebookFriends")); + if (IncludeFacebookFriendsValue.IsValid() && !IncludeFacebookFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeFacebookFriendsValue->TryGetBool(TmpValue)) { IncludeFacebookFriends = TmpValue; } + } + + const TSharedPtr IncludeSteamFriendsValue = obj->TryGetField(TEXT("IncludeSteamFriends")); + if (IncludeSteamFriendsValue.IsValid() && !IncludeSteamFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeSteamFriendsValue->TryGetBool(TmpValue)) { IncludeSteamFriends = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPlayerLeaderboardEntry::~FPlayerLeaderboardEntry() +{ + //if (Profile != nullptr) delete Profile; + +} + +void PlayFab::ClientModels::FPlayerLeaderboardEntry::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteIdentifierPrefix(TEXT("Position")); writer->WriteValue(Position); + + if (Profile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Profile")); Profile->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StatValue")); writer->WriteValue(StatValue); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPlayerLeaderboardEntry::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PositionValue = obj->TryGetField(TEXT("Position")); + if (PositionValue.IsValid() && !PositionValue->IsNull()) + { + int32 TmpValue; + if (PositionValue->TryGetNumber(TmpValue)) { Position = TmpValue; } + } + + const TSharedPtr ProfileValue = obj->TryGetField(TEXT("Profile")); + if (ProfileValue.IsValid() && !ProfileValue->IsNull()) + { + Profile = MakeShareable(new FPlayerProfileModel(ProfileValue->AsObject())); + } + + const TSharedPtr StatValueValue = obj->TryGetField(TEXT("StatValue")); + if (StatValueValue.IsValid() && !StatValueValue->IsNull()) + { + int32 TmpValue; + if (StatValueValue->TryGetNumber(TmpValue)) { StatValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetFriendLeaderboardAroundPlayerResult::~FGetFriendLeaderboardAroundPlayerResult() +{ + +} + +void PlayFab::ClientModels::FGetFriendLeaderboardAroundPlayerResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FPlayerLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (NextReset.notNull()) { writer->WriteIdentifierPrefix(TEXT("NextReset")); writeDatetime(NextReset, writer); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetFriendLeaderboardAroundPlayerResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FPlayerLeaderboardEntry(CurrentItem->AsObject())); + } + + + const TSharedPtr NextResetValue = obj->TryGetField(TEXT("NextReset")); + if (NextResetValue.IsValid()) + NextReset = readDatetime(NextResetValue); + + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetFriendLeaderboardRequest::~FGetFriendLeaderboardRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetFriendLeaderboardRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IncludeFacebookFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeFacebookFriends")); writer->WriteValue(IncludeFacebookFriends); } + + if (IncludeSteamFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeSteamFriends")); writer->WriteValue(IncludeSteamFriends); } + + if (MaxResultsCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); } + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StartPosition")); writer->WriteValue(StartPosition); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + if (XboxToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetFriendLeaderboardRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IncludeFacebookFriendsValue = obj->TryGetField(TEXT("IncludeFacebookFriends")); + if (IncludeFacebookFriendsValue.IsValid() && !IncludeFacebookFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeFacebookFriendsValue->TryGetBool(TmpValue)) { IncludeFacebookFriends = TmpValue; } + } + + const TSharedPtr IncludeSteamFriendsValue = obj->TryGetField(TEXT("IncludeSteamFriends")); + if (IncludeSteamFriendsValue.IsValid() && !IncludeSteamFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeSteamFriendsValue->TryGetBool(TmpValue)) { IncludeSteamFriends = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StartPositionValue = obj->TryGetField(TEXT("StartPosition")); + if (StartPositionValue.IsValid() && !StartPositionValue->IsNull()) + { + int32 TmpValue; + if (StartPositionValue->TryGetNumber(TmpValue)) { StartPosition = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetFriendsListRequest::~FGetFriendsListRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetFriendsListRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IncludeFacebookFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeFacebookFriends")); writer->WriteValue(IncludeFacebookFriends); } + + if (IncludeSteamFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeSteamFriends")); writer->WriteValue(IncludeSteamFriends); } + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + if (XboxToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetFriendsListRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IncludeFacebookFriendsValue = obj->TryGetField(TEXT("IncludeFacebookFriends")); + if (IncludeFacebookFriendsValue.IsValid() && !IncludeFacebookFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeFacebookFriendsValue->TryGetBool(TmpValue)) { IncludeFacebookFriends = TmpValue; } + } + + const TSharedPtr IncludeSteamFriendsValue = obj->TryGetField(TEXT("IncludeSteamFriends")); + if (IncludeSteamFriendsValue.IsValid() && !IncludeSteamFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeSteamFriendsValue->TryGetBool(TmpValue)) { IncludeSteamFriends = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetFriendsListResult::~FGetFriendsListResult() +{ + +} + +void PlayFab::ClientModels::FGetFriendsListResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Friends.Num() != 0) + { + writer->WriteArrayStart(TEXT("Friends")); + for (const FFriendInfo& item : Friends) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetFriendsListResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&FriendsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Friends")); + for (int32 Idx = 0; Idx < FriendsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = FriendsArray[Idx]; + Friends.Add(FFriendInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardAroundCharacterRequest::~FGetLeaderboardAroundCharacterRequest() +{ + +} + +void PlayFab::ClientModels::FGetLeaderboardAroundCharacterRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + if (MaxResultsCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); } + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardAroundCharacterRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardAroundCharacterResult::~FGetLeaderboardAroundCharacterResult() +{ + +} + +void PlayFab::ClientModels::FGetLeaderboardAroundCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FCharacterLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardAroundCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FCharacterLeaderboardEntry(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardAroundPlayerRequest::~FGetLeaderboardAroundPlayerRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetLeaderboardAroundPlayerRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (MaxResultsCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardAroundPlayerRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardAroundPlayerResult::~FGetLeaderboardAroundPlayerResult() +{ + +} + +void PlayFab::ClientModels::FGetLeaderboardAroundPlayerResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FPlayerLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (NextReset.notNull()) { writer->WriteIdentifierPrefix(TEXT("NextReset")); writeDatetime(NextReset, writer); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardAroundPlayerResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FPlayerLeaderboardEntry(CurrentItem->AsObject())); + } + + + const TSharedPtr NextResetValue = obj->TryGetField(TEXT("NextReset")); + if (NextResetValue.IsValid()) + NextReset = readDatetime(NextResetValue); + + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardForUsersCharactersRequest::~FGetLeaderboardForUsersCharactersRequest() +{ + +} + +void PlayFab::ClientModels::FGetLeaderboardForUsersCharactersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardForUsersCharactersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardForUsersCharactersResult::~FGetLeaderboardForUsersCharactersResult() +{ + +} + +void PlayFab::ClientModels::FGetLeaderboardForUsersCharactersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FCharacterLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardForUsersCharactersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FCharacterLeaderboardEntry(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardRequest::~FGetLeaderboardRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetLeaderboardRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (MaxResultsCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); } + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StartPosition")); writer->WriteValue(StartPosition); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StartPositionValue = obj->TryGetField(TEXT("StartPosition")); + if (StartPositionValue.IsValid() && !StartPositionValue->IsNull()) + { + int32 TmpValue; + if (StartPositionValue->TryGetNumber(TmpValue)) { StartPosition = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardResult::~FGetLeaderboardResult() +{ + +} + +void PlayFab::ClientModels::FGetLeaderboardResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FPlayerLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (NextReset.notNull()) { writer->WriteIdentifierPrefix(TEXT("NextReset")); writeDatetime(NextReset, writer); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FPlayerLeaderboardEntry(CurrentItem->AsObject())); + } + + + const TSharedPtr NextResetValue = obj->TryGetField(TEXT("NextReset")); + if (NextResetValue.IsValid()) + NextReset = readDatetime(NextResetValue); + + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPaymentTokenRequest::~FGetPaymentTokenRequest() +{ + +} + +void PlayFab::ClientModels::FGetPaymentTokenRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("TokenProvider")); writer->WriteValue(TokenProvider); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPaymentTokenRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TokenProviderValue = obj->TryGetField(TEXT("TokenProvider")); + if (TokenProviderValue.IsValid() && !TokenProviderValue->IsNull()) + { + FString TmpValue; + if (TokenProviderValue->TryGetString(TmpValue)) { TokenProvider = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPaymentTokenResult::~FGetPaymentTokenResult() +{ + +} + +void PlayFab::ClientModels::FGetPaymentTokenResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (OrderId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); } + + if (ProviderToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ProviderToken")); writer->WriteValue(ProviderToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPaymentTokenResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TSharedPtr ProviderTokenValue = obj->TryGetField(TEXT("ProviderToken")); + if (ProviderTokenValue.IsValid() && !ProviderTokenValue->IsNull()) + { + FString TmpValue; + if (ProviderTokenValue->TryGetString(TmpValue)) { ProviderToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPhotonAuthenticationTokenRequest::~FGetPhotonAuthenticationTokenRequest() +{ + +} + +void PlayFab::ClientModels::FGetPhotonAuthenticationTokenRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PhotonApplicationId")); writer->WriteValue(PhotonApplicationId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPhotonAuthenticationTokenRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PhotonApplicationIdValue = obj->TryGetField(TEXT("PhotonApplicationId")); + if (PhotonApplicationIdValue.IsValid() && !PhotonApplicationIdValue->IsNull()) + { + FString TmpValue; + if (PhotonApplicationIdValue->TryGetString(TmpValue)) { PhotonApplicationId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPhotonAuthenticationTokenResult::~FGetPhotonAuthenticationTokenResult() +{ + +} + +void PlayFab::ClientModels::FGetPhotonAuthenticationTokenResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PhotonCustomAuthenticationToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PhotonCustomAuthenticationToken")); writer->WriteValue(PhotonCustomAuthenticationToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPhotonAuthenticationTokenResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PhotonCustomAuthenticationTokenValue = obj->TryGetField(TEXT("PhotonCustomAuthenticationToken")); + if (PhotonCustomAuthenticationTokenValue.IsValid() && !PhotonCustomAuthenticationTokenValue->IsNull()) + { + FString TmpValue; + if (PhotonCustomAuthenticationTokenValue->TryGetString(TmpValue)) { PhotonCustomAuthenticationToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerCombinedInfoRequestParams::~FGetPlayerCombinedInfoRequestParams() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetPlayerCombinedInfoRequestParams::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GetCharacterInventories")); writer->WriteValue(GetCharacterInventories); + + writer->WriteIdentifierPrefix(TEXT("GetCharacterList")); writer->WriteValue(GetCharacterList); + + writer->WriteIdentifierPrefix(TEXT("GetPlayerProfile")); writer->WriteValue(GetPlayerProfile); + + writer->WriteIdentifierPrefix(TEXT("GetPlayerStatistics")); writer->WriteValue(GetPlayerStatistics); + + writer->WriteIdentifierPrefix(TEXT("GetTitleData")); writer->WriteValue(GetTitleData); + + writer->WriteIdentifierPrefix(TEXT("GetUserAccountInfo")); writer->WriteValue(GetUserAccountInfo); + + writer->WriteIdentifierPrefix(TEXT("GetUserData")); writer->WriteValue(GetUserData); + + writer->WriteIdentifierPrefix(TEXT("GetUserInventory")); writer->WriteValue(GetUserInventory); + + writer->WriteIdentifierPrefix(TEXT("GetUserReadOnlyData")); writer->WriteValue(GetUserReadOnlyData); + + writer->WriteIdentifierPrefix(TEXT("GetUserVirtualCurrency")); writer->WriteValue(GetUserVirtualCurrency); + + if (PlayerStatisticNames.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerStatisticNames")); + for (const FString& item : PlayerStatisticNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + if (TitleDataKeys.Num() != 0) + { + writer->WriteArrayStart(TEXT("TitleDataKeys")); + for (const FString& item : TitleDataKeys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (UserDataKeys.Num() != 0) + { + writer->WriteArrayStart(TEXT("UserDataKeys")); + for (const FString& item : UserDataKeys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (UserReadOnlyDataKeys.Num() != 0) + { + writer->WriteArrayStart(TEXT("UserReadOnlyDataKeys")); + for (const FString& item : UserReadOnlyDataKeys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerCombinedInfoRequestParams::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GetCharacterInventoriesValue = obj->TryGetField(TEXT("GetCharacterInventories")); + if (GetCharacterInventoriesValue.IsValid() && !GetCharacterInventoriesValue->IsNull()) + { + bool TmpValue; + if (GetCharacterInventoriesValue->TryGetBool(TmpValue)) { GetCharacterInventories = TmpValue; } + } + + const TSharedPtr GetCharacterListValue = obj->TryGetField(TEXT("GetCharacterList")); + if (GetCharacterListValue.IsValid() && !GetCharacterListValue->IsNull()) + { + bool TmpValue; + if (GetCharacterListValue->TryGetBool(TmpValue)) { GetCharacterList = TmpValue; } + } + + const TSharedPtr GetPlayerProfileValue = obj->TryGetField(TEXT("GetPlayerProfile")); + if (GetPlayerProfileValue.IsValid() && !GetPlayerProfileValue->IsNull()) + { + bool TmpValue; + if (GetPlayerProfileValue->TryGetBool(TmpValue)) { GetPlayerProfile = TmpValue; } + } + + const TSharedPtr GetPlayerStatisticsValue = obj->TryGetField(TEXT("GetPlayerStatistics")); + if (GetPlayerStatisticsValue.IsValid() && !GetPlayerStatisticsValue->IsNull()) + { + bool TmpValue; + if (GetPlayerStatisticsValue->TryGetBool(TmpValue)) { GetPlayerStatistics = TmpValue; } + } + + const TSharedPtr GetTitleDataValue = obj->TryGetField(TEXT("GetTitleData")); + if (GetTitleDataValue.IsValid() && !GetTitleDataValue->IsNull()) + { + bool TmpValue; + if (GetTitleDataValue->TryGetBool(TmpValue)) { GetTitleData = TmpValue; } + } + + const TSharedPtr GetUserAccountInfoValue = obj->TryGetField(TEXT("GetUserAccountInfo")); + if (GetUserAccountInfoValue.IsValid() && !GetUserAccountInfoValue->IsNull()) + { + bool TmpValue; + if (GetUserAccountInfoValue->TryGetBool(TmpValue)) { GetUserAccountInfo = TmpValue; } + } + + const TSharedPtr GetUserDataValue = obj->TryGetField(TEXT("GetUserData")); + if (GetUserDataValue.IsValid() && !GetUserDataValue->IsNull()) + { + bool TmpValue; + if (GetUserDataValue->TryGetBool(TmpValue)) { GetUserData = TmpValue; } + } + + const TSharedPtr GetUserInventoryValue = obj->TryGetField(TEXT("GetUserInventory")); + if (GetUserInventoryValue.IsValid() && !GetUserInventoryValue->IsNull()) + { + bool TmpValue; + if (GetUserInventoryValue->TryGetBool(TmpValue)) { GetUserInventory = TmpValue; } + } + + const TSharedPtr GetUserReadOnlyDataValue = obj->TryGetField(TEXT("GetUserReadOnlyData")); + if (GetUserReadOnlyDataValue.IsValid() && !GetUserReadOnlyDataValue->IsNull()) + { + bool TmpValue; + if (GetUserReadOnlyDataValue->TryGetBool(TmpValue)) { GetUserReadOnlyData = TmpValue; } + } + + const TSharedPtr GetUserVirtualCurrencyValue = obj->TryGetField(TEXT("GetUserVirtualCurrency")); + if (GetUserVirtualCurrencyValue.IsValid() && !GetUserVirtualCurrencyValue->IsNull()) + { + bool TmpValue; + if (GetUserVirtualCurrencyValue->TryGetBool(TmpValue)) { GetUserVirtualCurrency = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("PlayerStatisticNames"), PlayerStatisticNames); + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + obj->TryGetStringArrayField(TEXT("TitleDataKeys"), TitleDataKeys); + + obj->TryGetStringArrayField(TEXT("UserDataKeys"), UserDataKeys); + + obj->TryGetStringArrayField(TEXT("UserReadOnlyDataKeys"), UserReadOnlyDataKeys); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerCombinedInfoRequest::~FGetPlayerCombinedInfoRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayerCombinedInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters.writeJSON(writer); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerCombinedInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject()); + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FStatisticValue::~FStatisticValue() +{ + +} + +void PlayFab::ClientModels::FStatisticValue::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStatisticValue::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerCombinedInfoResultPayload::~FGetPlayerCombinedInfoResultPayload() +{ + //if (AccountInfo != nullptr) delete AccountInfo; + //if (PlayerProfile != nullptr) delete PlayerProfile; + +} + +void PlayFab::ClientModels::FGetPlayerCombinedInfoResultPayload::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AccountInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("AccountInfo")); AccountInfo->writeJSON(writer); } + + if (CharacterInventories.Num() != 0) + { + writer->WriteArrayStart(TEXT("CharacterInventories")); + for (const FCharacterInventory& item : CharacterInventories) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (CharacterList.Num() != 0) + { + writer->WriteArrayStart(TEXT("CharacterList")); + for (const FCharacterResult& item : CharacterList) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayerProfile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PlayerProfile")); PlayerProfile->writeJSON(writer); } + + if (PlayerStatistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerStatistics")); + for (const FStatisticValue& item : PlayerStatistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (TitleData.Num() != 0) + { + writer->WriteObjectStart(TEXT("TitleData")); + for (TMap::TConstIterator It(TitleData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (UserData.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserData")); + for (TMap::TConstIterator It(UserData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("UserDataVersion")); writer->WriteValue(static_cast(UserDataVersion)); + + if (UserInventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("UserInventory")); + for (const FItemInstance& item : UserInventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (UserReadOnlyData.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserReadOnlyData")); + for (TMap::TConstIterator It(UserReadOnlyData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("UserReadOnlyDataVersion")); writer->WriteValue(static_cast(UserReadOnlyDataVersion)); + + if (UserVirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserVirtualCurrency")); + for (TMap::TConstIterator It(UserVirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (UserVirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserVirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(UserVirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerCombinedInfoResultPayload::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccountInfoValue = obj->TryGetField(TEXT("AccountInfo")); + if (AccountInfoValue.IsValid() && !AccountInfoValue->IsNull()) + { + AccountInfo = MakeShareable(new FUserAccountInfo(AccountInfoValue->AsObject())); + } + + const TArray>&CharacterInventoriesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("CharacterInventories")); + for (int32 Idx = 0; Idx < CharacterInventoriesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CharacterInventoriesArray[Idx]; + CharacterInventories.Add(FCharacterInventory(CurrentItem->AsObject())); + } + + + const TArray>&CharacterListArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("CharacterList")); + for (int32 Idx = 0; Idx < CharacterListArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CharacterListArray[Idx]; + CharacterList.Add(FCharacterResult(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayerProfileValue = obj->TryGetField(TEXT("PlayerProfile")); + if (PlayerProfileValue.IsValid() && !PlayerProfileValue->IsNull()) + { + PlayerProfile = MakeShareable(new FPlayerProfileModel(PlayerProfileValue->AsObject())); + } + + const TArray>&PlayerStatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PlayerStatistics")); + for (int32 Idx = 0; Idx < PlayerStatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PlayerStatisticsArray[Idx]; + PlayerStatistics.Add(FStatisticValue(CurrentItem->AsObject())); + } + + + const TSharedPtr* TitleDataObject; + if (obj->TryGetObjectField(TEXT("TitleData"), TitleDataObject)) + { + for (TMap>::TConstIterator It((*TitleDataObject)->Values); It; ++It) + { + TitleData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr* UserDataObject; + if (obj->TryGetObjectField(TEXT("UserData"), UserDataObject)) + { + for (TMap>::TConstIterator It((*UserDataObject)->Values); It; ++It) + { + UserData.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr UserDataVersionValue = obj->TryGetField(TEXT("UserDataVersion")); + if (UserDataVersionValue.IsValid() && !UserDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (UserDataVersionValue->TryGetNumber(TmpValue)) { UserDataVersion = TmpValue; } + } + + const TArray>&UserInventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("UserInventory")); + for (int32 Idx = 0; Idx < UserInventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = UserInventoryArray[Idx]; + UserInventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr* UserReadOnlyDataObject; + if (obj->TryGetObjectField(TEXT("UserReadOnlyData"), UserReadOnlyDataObject)) + { + for (TMap>::TConstIterator It((*UserReadOnlyDataObject)->Values); It; ++It) + { + UserReadOnlyData.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr UserReadOnlyDataVersionValue = obj->TryGetField(TEXT("UserReadOnlyDataVersion")); + if (UserReadOnlyDataVersionValue.IsValid() && !UserReadOnlyDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (UserReadOnlyDataVersionValue->TryGetNumber(TmpValue)) { UserReadOnlyDataVersion = TmpValue; } + } + + const TSharedPtr* UserVirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("UserVirtualCurrency"), UserVirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*UserVirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + UserVirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* UserVirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("UserVirtualCurrencyRechargeTimes"), UserVirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*UserVirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + UserVirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerCombinedInfoResult::~FGetPlayerCombinedInfoResult() +{ + //if (InfoResultPayload != nullptr) delete InfoResultPayload; + +} + +void PlayFab::ClientModels::FGetPlayerCombinedInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (InfoResultPayload.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoResultPayload")); InfoResultPayload->writeJSON(writer); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerCombinedInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr InfoResultPayloadValue = obj->TryGetField(TEXT("InfoResultPayload")); + if (InfoResultPayloadValue.IsValid() && !InfoResultPayloadValue->IsNull()) + { + InfoResultPayload = MakeShareable(new FGetPlayerCombinedInfoResultPayload(InfoResultPayloadValue->AsObject())); + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerProfileRequest::~FGetPlayerProfileRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetPlayerProfileRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerProfileRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerProfileResult::~FGetPlayerProfileResult() +{ + //if (PlayerProfile != nullptr) delete PlayerProfile; + +} + +void PlayFab::ClientModels::FGetPlayerProfileResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayerProfile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PlayerProfile")); PlayerProfile->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerProfileResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayerProfileValue = obj->TryGetField(TEXT("PlayerProfile")); + if (PlayerProfileValue.IsValid() && !PlayerProfileValue->IsNull()) + { + PlayerProfile = MakeShareable(new FPlayerProfileModel(PlayerProfileValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerSegmentsRequest::~FGetPlayerSegmentsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayerSegmentsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerSegmentsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetSegmentResult::~FGetSegmentResult() +{ + +} + +void PlayFab::ClientModels::FGetSegmentResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ABTestParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ABTestParent")); writer->WriteValue(ABTestParent); } + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetSegmentResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ABTestParentValue = obj->TryGetField(TEXT("ABTestParent")); + if (ABTestParentValue.IsValid() && !ABTestParentValue->IsNull()) + { + FString TmpValue; + if (ABTestParentValue->TryGetString(TmpValue)) { ABTestParent = TmpValue; } + } + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerSegmentsResult::~FGetPlayerSegmentsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayerSegmentsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Segments.Num() != 0) + { + writer->WriteArrayStart(TEXT("Segments")); + for (const FGetSegmentResult& item : Segments) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerSegmentsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SegmentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Segments")); + for (int32 Idx = 0; Idx < SegmentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SegmentsArray[Idx]; + Segments.Add(FGetSegmentResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FStatisticNameVersion::~FStatisticNameVersion() +{ + +} + +void PlayFab::ClientModels::FStatisticNameVersion::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStatisticNameVersion::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerStatisticsRequest::~FGetPlayerStatisticsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayerStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticNames.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticNames")); + for (const FString& item : StatisticNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (StatisticNameVersions.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticNameVersions")); + for (const FStatisticNameVersion& item : StatisticNameVersions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("StatisticNames"), StatisticNames); + + const TArray>&StatisticNameVersionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("StatisticNameVersions")); + for (int32 Idx = 0; Idx < StatisticNameVersionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticNameVersionsArray[Idx]; + StatisticNameVersions.Add(FStatisticNameVersion(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerStatisticsResult::~FGetPlayerStatisticsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayerStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Statistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticValue& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticValue(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerStatisticVersionsRequest::~FGetPlayerStatisticVersionsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayerStatisticVersionsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerStatisticVersionsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPlayerStatisticVersion::~FPlayerStatisticVersion() +{ + +} + +void PlayFab::ClientModels::FPlayerStatisticVersion::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ActivationTime")); writeDatetime(ActivationTime, writer); + + if (DeactivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("DeactivationTime")); writeDatetime(DeactivationTime, writer); } + + if (ScheduledActivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("ScheduledActivationTime")); writeDatetime(ScheduledActivationTime, writer); } + + if (ScheduledDeactivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("ScheduledDeactivationTime")); writeDatetime(ScheduledDeactivationTime, writer); } + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPlayerStatisticVersion::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActivationTimeValue = obj->TryGetField(TEXT("ActivationTime")); + if (ActivationTimeValue.IsValid()) + ActivationTime = readDatetime(ActivationTimeValue); + + + const TSharedPtr DeactivationTimeValue = obj->TryGetField(TEXT("DeactivationTime")); + if (DeactivationTimeValue.IsValid()) + DeactivationTime = readDatetime(DeactivationTimeValue); + + + const TSharedPtr ScheduledActivationTimeValue = obj->TryGetField(TEXT("ScheduledActivationTime")); + if (ScheduledActivationTimeValue.IsValid()) + ScheduledActivationTime = readDatetime(ScheduledActivationTimeValue); + + + const TSharedPtr ScheduledDeactivationTimeValue = obj->TryGetField(TEXT("ScheduledDeactivationTime")); + if (ScheduledDeactivationTimeValue.IsValid()) + ScheduledDeactivationTime = readDatetime(ScheduledDeactivationTimeValue); + + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerStatisticVersionsResult::~FGetPlayerStatisticVersionsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayerStatisticVersionsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticVersions.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticVersions")); + for (const FPlayerStatisticVersion& item : StatisticVersions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerStatisticVersionsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&StatisticVersionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("StatisticVersions")); + for (int32 Idx = 0; Idx < StatisticVersionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticVersionsArray[Idx]; + StatisticVersions.Add(FPlayerStatisticVersion(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerTagsRequest::~FGetPlayerTagsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayerTagsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Namespace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Namespace")); writer->WriteValue(Namespace); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerTagsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NamespaceValue = obj->TryGetField(TEXT("Namespace")); + if (NamespaceValue.IsValid() && !NamespaceValue->IsNull()) + { + FString TmpValue; + if (NamespaceValue->TryGetString(TmpValue)) { Namespace = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerTagsResult::~FGetPlayerTagsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayerTagsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerTagsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerTradesRequest::~FGetPlayerTradesRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayerTradesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatusFilter.notNull()) { writer->WriteIdentifierPrefix(TEXT("StatusFilter")); writeTradeStatusEnumJSON(StatusFilter, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerTradesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + StatusFilter = readTradeStatusFromValue(obj->TryGetField(TEXT("StatusFilter"))); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerTradesResponse::~FGetPlayerTradesResponse() +{ + +} + +void PlayFab::ClientModels::FGetPlayerTradesResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AcceptedTrades.Num() != 0) + { + writer->WriteArrayStart(TEXT("AcceptedTrades")); + for (const FTradeInfo& item : AcceptedTrades) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (OpenedTrades.Num() != 0) + { + writer->WriteArrayStart(TEXT("OpenedTrades")); + for (const FTradeInfo& item : OpenedTrades) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerTradesResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AcceptedTradesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AcceptedTrades")); + for (int32 Idx = 0; Idx < AcceptedTradesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AcceptedTradesArray[Idx]; + AcceptedTrades.Add(FTradeInfo(CurrentItem->AsObject())); + } + + + const TArray>&OpenedTradesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("OpenedTrades")); + for (int32 Idx = 0; Idx < OpenedTradesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = OpenedTradesArray[Idx]; + OpenedTrades.Add(FTradeInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromFacebookIDsRequest::~FGetPlayFabIDsFromFacebookIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromFacebookIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("FacebookIDs")); + for (const FString& item : FacebookIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromFacebookIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FacebookIDs"), FacebookIDs); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromFacebookIDsResult::~FGetPlayFabIDsFromFacebookIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromFacebookIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FFacebookPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromFacebookIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FFacebookPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest::~FGetPlayFabIDsFromFacebookInstantGamesIdsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("FacebookInstantGamesIds")); + for (const FString& item : FacebookInstantGamesIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FacebookInstantGamesIds"), FacebookInstantGamesIds); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult::~FGetPlayFabIDsFromFacebookInstantGamesIdsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FFacebookInstantGamesPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FFacebookInstantGamesPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromGameCenterIDsRequest::~FGetPlayFabIDsFromGameCenterIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromGameCenterIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("GameCenterIDs")); + for (const FString& item : GameCenterIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromGameCenterIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("GameCenterIDs"), GameCenterIDs); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromGameCenterIDsResult::~FGetPlayFabIDsFromGameCenterIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromGameCenterIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FGameCenterPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromGameCenterIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FGameCenterPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromGenericIDsRequest::~FGetPlayFabIDsFromGenericIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromGenericIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("GenericIDs")); + for (const FGenericServiceId& item : GenericIDs) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromGenericIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GenericIDsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GenericIDs")); + for (int32 Idx = 0; Idx < GenericIDsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GenericIDsArray[Idx]; + GenericIDs.Add(FGenericServiceId(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromGenericIDsResult::~FGetPlayFabIDsFromGenericIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromGenericIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FGenericPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromGenericIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FGenericPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromGoogleIDsRequest::~FGetPlayFabIDsFromGoogleIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromGoogleIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("GoogleIDs")); + for (const FString& item : GoogleIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromGoogleIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("GoogleIDs"), GoogleIDs); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGooglePlayFabIdPair::~FGooglePlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FGooglePlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GoogleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleId")); writer->WriteValue(GoogleId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGooglePlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GoogleIdValue = obj->TryGetField(TEXT("GoogleId")); + if (GoogleIdValue.IsValid() && !GoogleIdValue->IsNull()) + { + FString TmpValue; + if (GoogleIdValue->TryGetString(TmpValue)) { GoogleId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromGoogleIDsResult::~FGetPlayFabIDsFromGoogleIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromGoogleIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FGooglePlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromGoogleIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FGooglePlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromKongregateIDsRequest::~FGetPlayFabIDsFromKongregateIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromKongregateIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("KongregateIDs")); + for (const FString& item : KongregateIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromKongregateIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("KongregateIDs"), KongregateIDs); + + return HasSucceeded; +} + +PlayFab::ClientModels::FKongregatePlayFabIdPair::~FKongregatePlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FKongregatePlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (KongregateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateId")); writer->WriteValue(KongregateId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FKongregatePlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KongregateIdValue = obj->TryGetField(TEXT("KongregateId")); + if (KongregateIdValue.IsValid() && !KongregateIdValue->IsNull()) + { + FString TmpValue; + if (KongregateIdValue->TryGetString(TmpValue)) { KongregateId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromKongregateIDsResult::~FGetPlayFabIDsFromKongregateIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromKongregateIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FKongregatePlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromKongregateIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FKongregatePlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest::~FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("NintendoSwitchDeviceIds")); + for (const FString& item : NintendoSwitchDeviceIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("NintendoSwitchDeviceIds"), NintendoSwitchDeviceIds); + + return HasSucceeded; +} + +PlayFab::ClientModels::FNintendoSwitchPlayFabIdPair::~FNintendoSwitchPlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FNintendoSwitchPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FNintendoSwitchPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult::~FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FNintendoSwitchPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FNintendoSwitchPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromSteamIDsRequest::~FGetPlayFabIDsFromSteamIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromSteamIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SteamStringIDs.Num() != 0) + { + writer->WriteArrayStart(TEXT("SteamStringIDs")); + for (const FString& item : SteamStringIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromSteamIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("SteamStringIDs"), SteamStringIDs); + + return HasSucceeded; +} + +PlayFab::ClientModels::FSteamPlayFabIdPair::~FSteamPlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FSteamPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (SteamStringId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamStringId")); writer->WriteValue(SteamStringId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSteamPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr SteamStringIdValue = obj->TryGetField(TEXT("SteamStringId")); + if (SteamStringIdValue.IsValid() && !SteamStringIdValue->IsNull()) + { + FString TmpValue; + if (SteamStringIdValue->TryGetString(TmpValue)) { SteamStringId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromSteamIDsResult::~FGetPlayFabIDsFromSteamIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromSteamIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FSteamPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromSteamIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FSteamPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromTwitchIDsRequest::~FGetPlayFabIDsFromTwitchIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromTwitchIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("TwitchIds")); + for (const FString& item : TwitchIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromTwitchIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("TwitchIds"), TwitchIds); + + return HasSucceeded; +} + +PlayFab::ClientModels::FTwitchPlayFabIdPair::~FTwitchPlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FTwitchPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (TwitchId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchId")); writer->WriteValue(TwitchId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FTwitchPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TwitchIdValue = obj->TryGetField(TEXT("TwitchId")); + if (TwitchIdValue.IsValid() && !TwitchIdValue->IsNull()) + { + FString TmpValue; + if (TwitchIdValue->TryGetString(TmpValue)) { TwitchId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromTwitchIDsResult::~FGetPlayFabIDsFromTwitchIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromTwitchIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FTwitchPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromTwitchIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FTwitchPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPublisherDataRequest::~FGetPublisherDataRequest() +{ + +} + +void PlayFab::ClientModels::FGetPublisherDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPublisherDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPublisherDataResult::~FGetPublisherDataResult() +{ + +} + +void PlayFab::ClientModels::FGetPublisherDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPublisherDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPurchaseRequest::~FGetPurchaseRequest() +{ + +} + +void PlayFab::ClientModels::FGetPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPurchaseResult::~FGetPurchaseResult() +{ + +} + +void PlayFab::ClientModels::FGetPurchaseResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (OrderId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); } + + if (PaymentProvider.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PaymentProvider")); writer->WriteValue(PaymentProvider); } + + writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); + + if (TransactionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TransactionId")); writer->WriteValue(TransactionId); } + + if (TransactionStatus.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TransactionStatus")); writer->WriteValue(TransactionStatus); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPurchaseResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TSharedPtr PaymentProviderValue = obj->TryGetField(TEXT("PaymentProvider")); + if (PaymentProviderValue.IsValid() && !PaymentProviderValue->IsNull()) + { + FString TmpValue; + if (PaymentProviderValue->TryGetString(TmpValue)) { PaymentProvider = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr TransactionIdValue = obj->TryGetField(TEXT("TransactionId")); + if (TransactionIdValue.IsValid() && !TransactionIdValue->IsNull()) + { + FString TmpValue; + if (TransactionIdValue->TryGetString(TmpValue)) { TransactionId = TmpValue; } + } + + const TSharedPtr TransactionStatusValue = obj->TryGetField(TEXT("TransactionStatus")); + if (TransactionStatusValue.IsValid() && !TransactionStatusValue->IsNull()) + { + FString TmpValue; + if (TransactionStatusValue->TryGetString(TmpValue)) { TransactionStatus = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetSharedGroupDataRequest::~FGetSharedGroupDataRequest() +{ + +} + +void PlayFab::ClientModels::FGetSharedGroupDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GetMembers.notNull()) { writer->WriteIdentifierPrefix(TEXT("GetMembers")); writer->WriteValue(GetMembers); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetSharedGroupDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GetMembersValue = obj->TryGetField(TEXT("GetMembers")); + if (GetMembersValue.IsValid() && !GetMembersValue->IsNull()) + { + bool TmpValue; + if (GetMembersValue->TryGetBool(TmpValue)) { GetMembers = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FSharedGroupDataRecord::~FSharedGroupDataRecord() +{ + +} + +void PlayFab::ClientModels::FSharedGroupDataRecord::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LastUpdated")); writeDatetime(LastUpdated, writer); + + if (LastUpdatedBy.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LastUpdatedBy")); writer->WriteValue(LastUpdatedBy); } + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSharedGroupDataRecord::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LastUpdatedValue = obj->TryGetField(TEXT("LastUpdated")); + if (LastUpdatedValue.IsValid()) + LastUpdated = readDatetime(LastUpdatedValue); + + + const TSharedPtr LastUpdatedByValue = obj->TryGetField(TEXT("LastUpdatedBy")); + if (LastUpdatedByValue.IsValid() && !LastUpdatedByValue->IsNull()) + { + FString TmpValue; + if (LastUpdatedByValue->TryGetString(TmpValue)) { LastUpdatedBy = TmpValue; } + } + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetSharedGroupDataResult::~FGetSharedGroupDataResult() +{ + +} + +void PlayFab::ClientModels::FGetSharedGroupDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + if (Members.Num() != 0) + { + writer->WriteArrayStart(TEXT("Members")); + for (const FString& item : Members) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetSharedGroupDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FSharedGroupDataRecord(It.Value()->AsObject())); + } + } + + obj->TryGetStringArrayField(TEXT("Members"), Members); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetStoreItemsRequest::~FGetStoreItemsRequest() +{ + +} + +void PlayFab::ClientModels::FGetStoreItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetStoreItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FStoreMarketingModel::~FStoreMarketingModel() +{ + +} + +void PlayFab::ClientModels::FStoreMarketingModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Metadata.notNull()) { writer->WriteIdentifierPrefix(TEXT("Metadata")); Metadata.writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStoreMarketingModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr MetadataValue = obj->TryGetField(TEXT("Metadata")); + if (MetadataValue.IsValid() && !MetadataValue->IsNull()) + { + Metadata = FJsonKeeper(MetadataValue); + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeSourceTypeEnumJSON(SourceType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case SourceTypeAdmin: writer->WriteValue(TEXT("Admin")); break; + case SourceTypeBackEnd: writer->WriteValue(TEXT("BackEnd")); break; + case SourceTypeGameClient: writer->WriteValue(TEXT("GameClient")); break; + case SourceTypeGameServer: writer->WriteValue(TEXT("GameServer")); break; + case SourceTypePartner: writer->WriteValue(TEXT("Partner")); break; + case SourceTypeCustom: writer->WriteValue(TEXT("Custom")); break; + case SourceTypeAPI: writer->WriteValue(TEXT("API")); break; + } +} + +ClientModels::SourceType PlayFab::ClientModels::readSourceTypeFromValue(const TSharedPtr& value) +{ + return readSourceTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::SourceType PlayFab::ClientModels::readSourceTypeFromValue(const FString& value) +{ + static TMap _SourceTypeMap; + if (_SourceTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _SourceTypeMap.Add(TEXT("Admin"), SourceTypeAdmin); + _SourceTypeMap.Add(TEXT("BackEnd"), SourceTypeBackEnd); + _SourceTypeMap.Add(TEXT("GameClient"), SourceTypeGameClient); + _SourceTypeMap.Add(TEXT("GameServer"), SourceTypeGameServer); + _SourceTypeMap.Add(TEXT("Partner"), SourceTypePartner); + _SourceTypeMap.Add(TEXT("Custom"), SourceTypeCustom); + _SourceTypeMap.Add(TEXT("API"), SourceTypeAPI); + + } + + if (!value.IsEmpty()) + { + auto output = _SourceTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return SourceTypeAdmin; // Basically critical fail +} + +PlayFab::ClientModels::FStoreItem::~FStoreItem() +{ + +} + +void PlayFab::ClientModels::FStoreItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CustomData.notNull()) { writer->WriteIdentifierPrefix(TEXT("CustomData")); CustomData.writeJSON(writer); } + + if (DisplayPosition.notNull()) { writer->WriteIdentifierPrefix(TEXT("DisplayPosition")); writer->WriteValue(static_cast(DisplayPosition)); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (RealCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("RealCurrencyPrices")); + for (TMap::TConstIterator It(RealCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyPrices")); + for (TMap::TConstIterator It(VirtualCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStoreItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomDataValue = obj->TryGetField(TEXT("CustomData")); + if (CustomDataValue.IsValid() && !CustomDataValue->IsNull()) + { + CustomData = FJsonKeeper(CustomDataValue); + } + + const TSharedPtr DisplayPositionValue = obj->TryGetField(TEXT("DisplayPosition")); + if (DisplayPositionValue.IsValid() && !DisplayPositionValue->IsNull()) + { + uint32 TmpValue; + if (DisplayPositionValue->TryGetNumber(TmpValue)) { DisplayPosition = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr* RealCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("RealCurrencyPrices"), RealCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*RealCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + RealCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyPrices"), VirtualCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetStoreItemsResult::~FGetStoreItemsResult() +{ + //if (MarketingData != nullptr) delete MarketingData; + +} + +void PlayFab::ClientModels::FGetStoreItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (MarketingData.IsValid()) { writer->WriteIdentifierPrefix(TEXT("MarketingData")); MarketingData->writeJSON(writer); } + + if (Source.notNull()) { writer->WriteIdentifierPrefix(TEXT("Source")); writeSourceTypeEnumJSON(Source, writer); } + + if (Store.Num() != 0) + { + writer->WriteArrayStart(TEXT("Store")); + for (const FStoreItem& item : Store) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (StoreId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetStoreItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr MarketingDataValue = obj->TryGetField(TEXT("MarketingData")); + if (MarketingDataValue.IsValid() && !MarketingDataValue->IsNull()) + { + MarketingData = MakeShareable(new FStoreMarketingModel(MarketingDataValue->AsObject())); + } + + Source = readSourceTypeFromValue(obj->TryGetField(TEXT("Source"))); + + const TArray>&StoreArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Store")); + for (int32 Idx = 0; Idx < StoreArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StoreArray[Idx]; + Store.Add(FStoreItem(CurrentItem->AsObject())); + } + + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTimeRequest::~FGetTimeRequest() +{ + +} + +void PlayFab::ClientModels::FGetTimeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTimeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTimeResult::~FGetTimeResult() +{ + +} + +void PlayFab::ClientModels::FGetTimeResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Time")); writeDatetime(Time, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTimeResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TimeValue = obj->TryGetField(TEXT("Time")); + if (TimeValue.IsValid()) + Time = readDatetime(TimeValue); + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTitleDataRequest::~FGetTitleDataRequest() +{ + +} + +void PlayFab::ClientModels::FGetTitleDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTitleDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTitleDataResult::~FGetTitleDataResult() +{ + +} + +void PlayFab::ClientModels::FGetTitleDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTitleDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTitleNewsRequest::~FGetTitleNewsRequest() +{ + +} + +void PlayFab::ClientModels::FGetTitleNewsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Count.notNull()) { writer->WriteIdentifierPrefix(TEXT("Count")); writer->WriteValue(Count); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTitleNewsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CountValue = obj->TryGetField(TEXT("Count")); + if (CountValue.IsValid() && !CountValue->IsNull()) + { + int32 TmpValue; + if (CountValue->TryGetNumber(TmpValue)) { Count = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FTitleNewsItem::~FTitleNewsItem() +{ + +} + +void PlayFab::ClientModels::FTitleNewsItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Body")); writer->WriteValue(Body); } + + if (NewsId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NewsId")); writer->WriteValue(NewsId); } + + writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); + + if (Title.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Title")); writer->WriteValue(Title); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FTitleNewsItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BodyValue = obj->TryGetField(TEXT("Body")); + if (BodyValue.IsValid() && !BodyValue->IsNull()) + { + FString TmpValue; + if (BodyValue->TryGetString(TmpValue)) { Body = TmpValue; } + } + + const TSharedPtr NewsIdValue = obj->TryGetField(TEXT("NewsId")); + if (NewsIdValue.IsValid() && !NewsIdValue->IsNull()) + { + FString TmpValue; + if (NewsIdValue->TryGetString(TmpValue)) { NewsId = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + const TSharedPtr TitleValue = obj->TryGetField(TEXT("Title")); + if (TitleValue.IsValid() && !TitleValue->IsNull()) + { + FString TmpValue; + if (TitleValue->TryGetString(TmpValue)) { Title = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTitleNewsResult::~FGetTitleNewsResult() +{ + +} + +void PlayFab::ClientModels::FGetTitleNewsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (News.Num() != 0) + { + writer->WriteArrayStart(TEXT("News")); + for (const FTitleNewsItem& item : News) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTitleNewsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&NewsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("News")); + for (int32 Idx = 0; Idx < NewsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = NewsArray[Idx]; + News.Add(FTitleNewsItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTitlePublicKeyRequest::~FGetTitlePublicKeyRequest() +{ + +} + +void PlayFab::ClientModels::FGetTitlePublicKeyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteIdentifierPrefix(TEXT("TitleSharedSecret")); writer->WriteValue(TitleSharedSecret); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTitlePublicKeyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr TitleSharedSecretValue = obj->TryGetField(TEXT("TitleSharedSecret")); + if (TitleSharedSecretValue.IsValid() && !TitleSharedSecretValue->IsNull()) + { + FString TmpValue; + if (TitleSharedSecretValue->TryGetString(TmpValue)) { TitleSharedSecret = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTitlePublicKeyResult::~FGetTitlePublicKeyResult() +{ + +} + +void PlayFab::ClientModels::FGetTitlePublicKeyResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (RSAPublicKey.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RSAPublicKey")); writer->WriteValue(RSAPublicKey); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTitlePublicKeyResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RSAPublicKeyValue = obj->TryGetField(TEXT("RSAPublicKey")); + if (RSAPublicKeyValue.IsValid() && !RSAPublicKeyValue->IsNull()) + { + FString TmpValue; + if (RSAPublicKeyValue->TryGetString(TmpValue)) { RSAPublicKey = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTradeStatusRequest::~FGetTradeStatusRequest() +{ + +} + +void PlayFab::ClientModels::FGetTradeStatusRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("OfferingPlayerId")); writer->WriteValue(OfferingPlayerId); + + writer->WriteIdentifierPrefix(TEXT("TradeId")); writer->WriteValue(TradeId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTradeStatusRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OfferingPlayerIdValue = obj->TryGetField(TEXT("OfferingPlayerId")); + if (OfferingPlayerIdValue.IsValid() && !OfferingPlayerIdValue->IsNull()) + { + FString TmpValue; + if (OfferingPlayerIdValue->TryGetString(TmpValue)) { OfferingPlayerId = TmpValue; } + } + + const TSharedPtr TradeIdValue = obj->TryGetField(TEXT("TradeId")); + if (TradeIdValue.IsValid() && !TradeIdValue->IsNull()) + { + FString TmpValue; + if (TradeIdValue->TryGetString(TmpValue)) { TradeId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTradeStatusResponse::~FGetTradeStatusResponse() +{ + //if (Trade != nullptr) delete Trade; + +} + +void PlayFab::ClientModels::FGetTradeStatusResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Trade.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Trade")); Trade->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTradeStatusResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TradeValue = obj->TryGetField(TEXT("Trade")); + if (TradeValue.IsValid() && !TradeValue->IsNull()) + { + Trade = MakeShareable(new FTradeInfo(TradeValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetUserDataRequest::~FGetUserDataRequest() +{ + +} + +void PlayFab::ClientModels::FGetUserDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IfChangedFromDataVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("IfChangedFromDataVersion")); writer->WriteValue(static_cast(IfChangedFromDataVersion)); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetUserDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IfChangedFromDataVersionValue = obj->TryGetField(TEXT("IfChangedFromDataVersion")); + if (IfChangedFromDataVersionValue.IsValid() && !IfChangedFromDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (IfChangedFromDataVersionValue->TryGetNumber(TmpValue)) { IfChangedFromDataVersion = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetUserDataResult::~FGetUserDataResult() +{ + +} + +void PlayFab::ClientModels::FGetUserDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetUserDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetUserInventoryRequest::~FGetUserInventoryRequest() +{ + +} + +void PlayFab::ClientModels::FGetUserInventoryRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetUserInventoryRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetUserInventoryResult::~FGetUserInventoryResult() +{ + +} + +void PlayFab::ClientModels::FGetUserInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(VirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetUserInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyRechargeTimes"), VirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + VirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetWindowsHelloChallengeRequest::~FGetWindowsHelloChallengeRequest() +{ + +} + +void PlayFab::ClientModels::FGetWindowsHelloChallengeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PublicKeyHint")); writer->WriteValue(PublicKeyHint); + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetWindowsHelloChallengeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PublicKeyHintValue = obj->TryGetField(TEXT("PublicKeyHint")); + if (PublicKeyHintValue.IsValid() && !PublicKeyHintValue->IsNull()) + { + FString TmpValue; + if (PublicKeyHintValue->TryGetString(TmpValue)) { PublicKeyHint = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetWindowsHelloChallengeResponse::~FGetWindowsHelloChallengeResponse() +{ + +} + +void PlayFab::ClientModels::FGetWindowsHelloChallengeResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Challenge.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Challenge")); writer->WriteValue(Challenge); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetWindowsHelloChallengeResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ChallengeValue = obj->TryGetField(TEXT("Challenge")); + if (ChallengeValue.IsValid() && !ChallengeValue->IsNull()) + { + FString TmpValue; + if (ChallengeValue->TryGetString(TmpValue)) { Challenge = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGrantCharacterToUserRequest::~FGrantCharacterToUserRequest() +{ + +} + +void PlayFab::ClientModels::FGrantCharacterToUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("CharacterName")); writer->WriteValue(CharacterName); + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGrantCharacterToUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterNameValue = obj->TryGetField(TEXT("CharacterName")); + if (CharacterNameValue.IsValid() && !CharacterNameValue->IsNull()) + { + FString TmpValue; + if (CharacterNameValue->TryGetString(TmpValue)) { CharacterName = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGrantCharacterToUserResult::~FGrantCharacterToUserResult() +{ + +} + +void PlayFab::ClientModels::FGrantCharacterToUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + writer->WriteIdentifierPrefix(TEXT("Result")); writer->WriteValue(Result); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGrantCharacterToUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr ResultValue = obj->TryGetField(TEXT("Result")); + if (ResultValue.IsValid() && !ResultValue->IsNull()) + { + bool TmpValue; + if (ResultValue->TryGetBool(TmpValue)) { Result = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FItemPurchaseRequest::~FItemPurchaseRequest() +{ + +} + +void PlayFab::ClientModels::FItemPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + writer->WriteIdentifierPrefix(TEXT("Quantity")); writer->WriteValue(static_cast(Quantity)); + + if (UpgradeFromItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("UpgradeFromItems")); + for (const FString& item : UpgradeFromItems) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FItemPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr QuantityValue = obj->TryGetField(TEXT("Quantity")); + if (QuantityValue.IsValid() && !QuantityValue->IsNull()) + { + uint32 TmpValue; + if (QuantityValue->TryGetNumber(TmpValue)) { Quantity = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("UpgradeFromItems"), UpgradeFromItems); + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkAndroidDeviceIDRequest::~FLinkAndroidDeviceIDRequest() +{ + +} + +void PlayFab::ClientModels::FLinkAndroidDeviceIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDevice.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDevice")); writer->WriteValue(AndroidDevice); } + + writer->WriteIdentifierPrefix(TEXT("AndroidDeviceId")); writer->WriteValue(AndroidDeviceId); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + if (OS.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OS")); writer->WriteValue(OS); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkAndroidDeviceIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceValue = obj->TryGetField(TEXT("AndroidDevice")); + if (AndroidDeviceValue.IsValid() && !AndroidDeviceValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceValue->TryGetString(TmpValue)) { AndroidDevice = TmpValue; } + } + + const TSharedPtr AndroidDeviceIdValue = obj->TryGetField(TEXT("AndroidDeviceId")); + if (AndroidDeviceIdValue.IsValid() && !AndroidDeviceIdValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceIdValue->TryGetString(TmpValue)) { AndroidDeviceId = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr OSValue = obj->TryGetField(TEXT("OS")); + if (OSValue.IsValid() && !OSValue->IsNull()) + { + FString TmpValue; + if (OSValue->TryGetString(TmpValue)) { OS = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkAndroidDeviceIDResult::~FLinkAndroidDeviceIDResult() +{ + +} + +void PlayFab::ClientModels::FLinkAndroidDeviceIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkAndroidDeviceIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkCustomIDRequest::~FLinkCustomIDRequest() +{ + +} + +void PlayFab::ClientModels::FLinkCustomIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CustomId")); writer->WriteValue(CustomId); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkCustomIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomIdValue = obj->TryGetField(TEXT("CustomId")); + if (CustomIdValue.IsValid() && !CustomIdValue->IsNull()) + { + FString TmpValue; + if (CustomIdValue->TryGetString(TmpValue)) { CustomId = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkCustomIDResult::~FLinkCustomIDResult() +{ + +} + +void PlayFab::ClientModels::FLinkCustomIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkCustomIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkFacebookAccountRequest::~FLinkFacebookAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkFacebookAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AccessToken")); writer->WriteValue(AccessToken); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkFacebookAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccessTokenValue = obj->TryGetField(TEXT("AccessToken")); + if (AccessTokenValue.IsValid() && !AccessTokenValue->IsNull()) + { + FString TmpValue; + if (AccessTokenValue->TryGetString(TmpValue)) { AccessToken = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkFacebookAccountResult::~FLinkFacebookAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkFacebookAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkFacebookAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkFacebookInstantGamesIdRequest::~FLinkFacebookInstantGamesIdRequest() +{ + +} + +void PlayFab::ClientModels::FLinkFacebookInstantGamesIdRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesSignature")); writer->WriteValue(FacebookInstantGamesSignature); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkFacebookInstantGamesIdRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesSignatureValue = obj->TryGetField(TEXT("FacebookInstantGamesSignature")); + if (FacebookInstantGamesSignatureValue.IsValid() && !FacebookInstantGamesSignatureValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesSignatureValue->TryGetString(TmpValue)) { FacebookInstantGamesSignature = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkFacebookInstantGamesIdResult::~FLinkFacebookInstantGamesIdResult() +{ + +} + +void PlayFab::ClientModels::FLinkFacebookInstantGamesIdResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkFacebookInstantGamesIdResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkGameCenterAccountRequest::~FLinkGameCenterAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkGameCenterAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteIdentifierPrefix(TEXT("GameCenterId")); writer->WriteValue(GameCenterId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkGameCenterAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr GameCenterIdValue = obj->TryGetField(TEXT("GameCenterId")); + if (GameCenterIdValue.IsValid() && !GameCenterIdValue->IsNull()) + { + FString TmpValue; + if (GameCenterIdValue->TryGetString(TmpValue)) { GameCenterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkGameCenterAccountResult::~FLinkGameCenterAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkGameCenterAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkGameCenterAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkGoogleAccountRequest::~FLinkGoogleAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkGoogleAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + if (ServerAuthCode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerAuthCode")); writer->WriteValue(ServerAuthCode); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkGoogleAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr ServerAuthCodeValue = obj->TryGetField(TEXT("ServerAuthCode")); + if (ServerAuthCodeValue.IsValid() && !ServerAuthCodeValue->IsNull()) + { + FString TmpValue; + if (ServerAuthCodeValue->TryGetString(TmpValue)) { ServerAuthCode = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkGoogleAccountResult::~FLinkGoogleAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkGoogleAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkGoogleAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkIOSDeviceIDRequest::~FLinkIOSDeviceIDRequest() +{ + +} + +void PlayFab::ClientModels::FLinkIOSDeviceIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DeviceId")); writer->WriteValue(DeviceId); + + if (DeviceModel.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeviceModel")); writer->WriteValue(DeviceModel); } + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + if (OS.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OS")); writer->WriteValue(OS); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkIOSDeviceIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DeviceIdValue = obj->TryGetField(TEXT("DeviceId")); + if (DeviceIdValue.IsValid() && !DeviceIdValue->IsNull()) + { + FString TmpValue; + if (DeviceIdValue->TryGetString(TmpValue)) { DeviceId = TmpValue; } + } + + const TSharedPtr DeviceModelValue = obj->TryGetField(TEXT("DeviceModel")); + if (DeviceModelValue.IsValid() && !DeviceModelValue->IsNull()) + { + FString TmpValue; + if (DeviceModelValue->TryGetString(TmpValue)) { DeviceModel = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr OSValue = obj->TryGetField(TEXT("OS")); + if (OSValue.IsValid() && !OSValue->IsNull()) + { + FString TmpValue; + if (OSValue->TryGetString(TmpValue)) { OS = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkIOSDeviceIDResult::~FLinkIOSDeviceIDResult() +{ + +} + +void PlayFab::ClientModels::FLinkIOSDeviceIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkIOSDeviceIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkKongregateAccountRequest::~FLinkKongregateAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkKongregateAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AuthTicket")); writer->WriteValue(AuthTicket); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteIdentifierPrefix(TEXT("KongregateId")); writer->WriteValue(KongregateId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkKongregateAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AuthTicketValue = obj->TryGetField(TEXT("AuthTicket")); + if (AuthTicketValue.IsValid() && !AuthTicketValue->IsNull()) + { + FString TmpValue; + if (AuthTicketValue->TryGetString(TmpValue)) { AuthTicket = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr KongregateIdValue = obj->TryGetField(TEXT("KongregateId")); + if (KongregateIdValue.IsValid() && !KongregateIdValue->IsNull()) + { + FString TmpValue; + if (KongregateIdValue->TryGetString(TmpValue)) { KongregateId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkKongregateAccountResult::~FLinkKongregateAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkKongregateAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkKongregateAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkNintendoSwitchDeviceIdRequest::~FLinkNintendoSwitchDeviceIdRequest() +{ + +} + +void PlayFab::ClientModels::FLinkNintendoSwitchDeviceIdRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkNintendoSwitchDeviceIdRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkNintendoSwitchDeviceIdResult::~FLinkNintendoSwitchDeviceIdResult() +{ + +} + +void PlayFab::ClientModels::FLinkNintendoSwitchDeviceIdResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkNintendoSwitchDeviceIdResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkSteamAccountRequest::~FLinkSteamAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkSteamAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteIdentifierPrefix(TEXT("SteamTicket")); writer->WriteValue(SteamTicket); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkSteamAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr SteamTicketValue = obj->TryGetField(TEXT("SteamTicket")); + if (SteamTicketValue.IsValid() && !SteamTicketValue->IsNull()) + { + FString TmpValue; + if (SteamTicketValue->TryGetString(TmpValue)) { SteamTicket = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkSteamAccountResult::~FLinkSteamAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkSteamAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkSteamAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkTwitchAccountRequest::~FLinkTwitchAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkTwitchAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AccessToken")); writer->WriteValue(AccessToken); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkTwitchAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccessTokenValue = obj->TryGetField(TEXT("AccessToken")); + if (AccessTokenValue.IsValid() && !AccessTokenValue->IsNull()) + { + FString TmpValue; + if (AccessTokenValue->TryGetString(TmpValue)) { AccessToken = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkTwitchAccountResult::~FLinkTwitchAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkTwitchAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkTwitchAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkWindowsHelloAccountRequest::~FLinkWindowsHelloAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkWindowsHelloAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DeviceName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeviceName")); writer->WriteValue(DeviceName); } + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteIdentifierPrefix(TEXT("PublicKey")); writer->WriteValue(PublicKey); + + writer->WriteIdentifierPrefix(TEXT("UserName")); writer->WriteValue(UserName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkWindowsHelloAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DeviceNameValue = obj->TryGetField(TEXT("DeviceName")); + if (DeviceNameValue.IsValid() && !DeviceNameValue->IsNull()) + { + FString TmpValue; + if (DeviceNameValue->TryGetString(TmpValue)) { DeviceName = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr PublicKeyValue = obj->TryGetField(TEXT("PublicKey")); + if (PublicKeyValue.IsValid() && !PublicKeyValue->IsNull()) + { + FString TmpValue; + if (PublicKeyValue->TryGetString(TmpValue)) { PublicKey = TmpValue; } + } + + const TSharedPtr UserNameValue = obj->TryGetField(TEXT("UserName")); + if (UserNameValue.IsValid() && !UserNameValue->IsNull()) + { + FString TmpValue; + if (UserNameValue->TryGetString(TmpValue)) { UserName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkWindowsHelloAccountResponse::~FLinkWindowsHelloAccountResponse() +{ + +} + +void PlayFab::ClientModels::FLinkWindowsHelloAccountResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkWindowsHelloAccountResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkXboxAccountRequest::~FLinkXboxAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkXboxAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkXboxAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkXboxAccountResult::~FLinkXboxAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkXboxAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkXboxAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FListUsersCharactersRequest::~FListUsersCharactersRequest() +{ + +} + +void PlayFab::ClientModels::FListUsersCharactersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FListUsersCharactersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FListUsersCharactersResult::~FListUsersCharactersResult() +{ + +} + +void PlayFab::ClientModels::FListUsersCharactersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Characters.Num() != 0) + { + writer->WriteArrayStart(TEXT("Characters")); + for (const FCharacterResult& item : Characters) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FListUsersCharactersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&CharactersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Characters")); + for (int32 Idx = 0; Idx < CharactersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CharactersArray[Idx]; + Characters.Add(FCharacterResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserSettings::~FUserSettings() +{ + +} + +void PlayFab::ClientModels::FUserSettings::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GatherDeviceInfo")); writer->WriteValue(GatherDeviceInfo); + + writer->WriteIdentifierPrefix(TEXT("GatherFocusInfo")); writer->WriteValue(GatherFocusInfo); + + writer->WriteIdentifierPrefix(TEXT("NeedsAttribution")); writer->WriteValue(NeedsAttribution); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserSettings::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GatherDeviceInfoValue = obj->TryGetField(TEXT("GatherDeviceInfo")); + if (GatherDeviceInfoValue.IsValid() && !GatherDeviceInfoValue->IsNull()) + { + bool TmpValue; + if (GatherDeviceInfoValue->TryGetBool(TmpValue)) { GatherDeviceInfo = TmpValue; } + } + + const TSharedPtr GatherFocusInfoValue = obj->TryGetField(TEXT("GatherFocusInfo")); + if (GatherFocusInfoValue.IsValid() && !GatherFocusInfoValue->IsNull()) + { + bool TmpValue; + if (GatherFocusInfoValue->TryGetBool(TmpValue)) { GatherFocusInfo = TmpValue; } + } + + const TSharedPtr NeedsAttributionValue = obj->TryGetField(TEXT("NeedsAttribution")); + if (NeedsAttributionValue.IsValid() && !NeedsAttributionValue->IsNull()) + { + bool TmpValue; + if (NeedsAttributionValue->TryGetBool(TmpValue)) { NeedsAttribution = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginResult::~FLoginResult() +{ + //if (EntityToken != nullptr) delete EntityToken; + //if (InfoResultPayload != nullptr) delete InfoResultPayload; + //if (SettingsForUser != nullptr) delete SettingsForUser; + +} + +void PlayFab::ClientModels::FLoginResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EntityToken.IsValid()) { writer->WriteIdentifierPrefix(TEXT("EntityToken")); EntityToken->writeJSON(writer); } + + if (InfoResultPayload.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoResultPayload")); InfoResultPayload->writeJSON(writer); } + + if (LastLoginTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLoginTime")); writeDatetime(LastLoginTime, writer); } + + writer->WriteIdentifierPrefix(TEXT("NewlyCreated")); writer->WriteValue(NewlyCreated); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (SessionTicket.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SessionTicket")); writer->WriteValue(SessionTicket); } + + if (SettingsForUser.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SettingsForUser")); SettingsForUser->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityTokenValue = obj->TryGetField(TEXT("EntityToken")); + if (EntityTokenValue.IsValid() && !EntityTokenValue->IsNull()) + { + EntityToken = MakeShareable(new FEntityTokenResponse(EntityTokenValue->AsObject())); + } + + const TSharedPtr InfoResultPayloadValue = obj->TryGetField(TEXT("InfoResultPayload")); + if (InfoResultPayloadValue.IsValid() && !InfoResultPayloadValue->IsNull()) + { + InfoResultPayload = MakeShareable(new FGetPlayerCombinedInfoResultPayload(InfoResultPayloadValue->AsObject())); + } + + const TSharedPtr LastLoginTimeValue = obj->TryGetField(TEXT("LastLoginTime")); + if (LastLoginTimeValue.IsValid()) + LastLoginTime = readDatetime(LastLoginTimeValue); + + + const TSharedPtr NewlyCreatedValue = obj->TryGetField(TEXT("NewlyCreated")); + if (NewlyCreatedValue.IsValid() && !NewlyCreatedValue->IsNull()) + { + bool TmpValue; + if (NewlyCreatedValue->TryGetBool(TmpValue)) { NewlyCreated = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr SessionTicketValue = obj->TryGetField(TEXT("SessionTicket")); + if (SessionTicketValue.IsValid() && !SessionTicketValue->IsNull()) + { + FString TmpValue; + if (SessionTicketValue->TryGetString(TmpValue)) { SessionTicket = TmpValue; } + } + + const TSharedPtr SettingsForUserValue = obj->TryGetField(TEXT("SettingsForUser")); + if (SettingsForUserValue.IsValid() && !SettingsForUserValue->IsNull()) + { + SettingsForUser = MakeShareable(new FUserSettings(SettingsForUserValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithAndroidDeviceIDRequest::~FLoginWithAndroidDeviceIDRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithAndroidDeviceIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDevice.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDevice")); writer->WriteValue(AndroidDevice); } + + if (AndroidDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceId")); writer->WriteValue(AndroidDeviceId); } + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (OS.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OS")); writer->WriteValue(OS); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithAndroidDeviceIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceValue = obj->TryGetField(TEXT("AndroidDevice")); + if (AndroidDeviceValue.IsValid() && !AndroidDeviceValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceValue->TryGetString(TmpValue)) { AndroidDevice = TmpValue; } + } + + const TSharedPtr AndroidDeviceIdValue = obj->TryGetField(TEXT("AndroidDeviceId")); + if (AndroidDeviceIdValue.IsValid() && !AndroidDeviceIdValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceIdValue->TryGetString(TmpValue)) { AndroidDeviceId = TmpValue; } + } + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr OSValue = obj->TryGetField(TEXT("OS")); + if (OSValue.IsValid() && !OSValue->IsNull()) + { + FString TmpValue; + if (OSValue->TryGetString(TmpValue)) { OS = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithCustomIDRequest::~FLoginWithCustomIDRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithCustomIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (CustomId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomId")); writer->WriteValue(CustomId); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithCustomIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr CustomIdValue = obj->TryGetField(TEXT("CustomId")); + if (CustomIdValue.IsValid() && !CustomIdValue->IsNull()) + { + FString TmpValue; + if (CustomIdValue->TryGetString(TmpValue)) { CustomId = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithEmailAddressRequest::~FLoginWithEmailAddressRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithEmailAddressRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + writer->WriteIdentifierPrefix(TEXT("Password")); writer->WriteValue(Password); + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithEmailAddressRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PasswordValue = obj->TryGetField(TEXT("Password")); + if (PasswordValue.IsValid() && !PasswordValue->IsNull()) + { + FString TmpValue; + if (PasswordValue->TryGetString(TmpValue)) { Password = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithFacebookInstantGamesIdRequest::~FLoginWithFacebookInstantGamesIdRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithFacebookInstantGamesIdRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesSignature")); writer->WriteValue(FacebookInstantGamesSignature); + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithFacebookInstantGamesIdRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr FacebookInstantGamesSignatureValue = obj->TryGetField(TEXT("FacebookInstantGamesSignature")); + if (FacebookInstantGamesSignatureValue.IsValid() && !FacebookInstantGamesSignatureValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesSignatureValue->TryGetString(TmpValue)) { FacebookInstantGamesSignature = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithFacebookRequest::~FLoginWithFacebookRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithFacebookRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AccessToken")); writer->WriteValue(AccessToken); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithFacebookRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccessTokenValue = obj->TryGetField(TEXT("AccessToken")); + if (AccessTokenValue.IsValid() && !AccessTokenValue->IsNull()) + { + FString TmpValue; + if (AccessTokenValue->TryGetString(TmpValue)) { AccessToken = TmpValue; } + } + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithGameCenterRequest::~FLoginWithGameCenterRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithGameCenterRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerId")); writer->WriteValue(PlayerId); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithGameCenterRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerIdValue = obj->TryGetField(TEXT("PlayerId")); + if (PlayerIdValue.IsValid() && !PlayerIdValue->IsNull()) + { + FString TmpValue; + if (PlayerIdValue->TryGetString(TmpValue)) { PlayerId = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithGoogleAccountRequest::~FLoginWithGoogleAccountRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithGoogleAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + if (ServerAuthCode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerAuthCode")); writer->WriteValue(ServerAuthCode); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithGoogleAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr ServerAuthCodeValue = obj->TryGetField(TEXT("ServerAuthCode")); + if (ServerAuthCodeValue.IsValid() && !ServerAuthCodeValue->IsNull()) + { + FString TmpValue; + if (ServerAuthCodeValue->TryGetString(TmpValue)) { ServerAuthCode = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithIOSDeviceIDRequest::~FLoginWithIOSDeviceIDRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithIOSDeviceIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (DeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeviceId")); writer->WriteValue(DeviceId); } + + if (DeviceModel.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeviceModel")); writer->WriteValue(DeviceModel); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (OS.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OS")); writer->WriteValue(OS); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithIOSDeviceIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr DeviceIdValue = obj->TryGetField(TEXT("DeviceId")); + if (DeviceIdValue.IsValid() && !DeviceIdValue->IsNull()) + { + FString TmpValue; + if (DeviceIdValue->TryGetString(TmpValue)) { DeviceId = TmpValue; } + } + + const TSharedPtr DeviceModelValue = obj->TryGetField(TEXT("DeviceModel")); + if (DeviceModelValue.IsValid() && !DeviceModelValue->IsNull()) + { + FString TmpValue; + if (DeviceModelValue->TryGetString(TmpValue)) { DeviceModel = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr OSValue = obj->TryGetField(TEXT("OS")); + if (OSValue.IsValid() && !OSValue->IsNull()) + { + FString TmpValue; + if (OSValue->TryGetString(TmpValue)) { OS = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithKongregateRequest::~FLoginWithKongregateRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithKongregateRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AuthTicket.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AuthTicket")); writer->WriteValue(AuthTicket); } + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (KongregateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateId")); writer->WriteValue(KongregateId); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithKongregateRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AuthTicketValue = obj->TryGetField(TEXT("AuthTicket")); + if (AuthTicketValue.IsValid() && !AuthTicketValue->IsNull()) + { + FString TmpValue; + if (AuthTicketValue->TryGetString(TmpValue)) { AuthTicket = TmpValue; } + } + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr KongregateIdValue = obj->TryGetField(TEXT("KongregateId")); + if (KongregateIdValue.IsValid() && !KongregateIdValue->IsNull()) + { + FString TmpValue; + if (KongregateIdValue->TryGetString(TmpValue)) { KongregateId = TmpValue; } + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithNintendoSwitchDeviceIdRequest::~FLoginWithNintendoSwitchDeviceIdRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithNintendoSwitchDeviceIdRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithNintendoSwitchDeviceIdRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithPlayFabRequest::~FLoginWithPlayFabRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithPlayFabRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + writer->WriteIdentifierPrefix(TEXT("Password")); writer->WriteValue(Password); + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithPlayFabRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PasswordValue = obj->TryGetField(TEXT("Password")); + if (PasswordValue.IsValid() && !PasswordValue->IsNull()) + { + FString TmpValue; + if (PasswordValue->TryGetString(TmpValue)) { Password = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithSteamRequest::~FLoginWithSteamRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithSteamRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + if (SteamTicket.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamTicket")); writer->WriteValue(SteamTicket); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithSteamRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr SteamTicketValue = obj->TryGetField(TEXT("SteamTicket")); + if (SteamTicketValue.IsValid() && !SteamTicketValue->IsNull()) + { + FString TmpValue; + if (SteamTicketValue->TryGetString(TmpValue)) { SteamTicket = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithTwitchRequest::~FLoginWithTwitchRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithTwitchRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AccessToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AccessToken")); writer->WriteValue(AccessToken); } + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithTwitchRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccessTokenValue = obj->TryGetField(TEXT("AccessToken")); + if (AccessTokenValue.IsValid() && !AccessTokenValue->IsNull()) + { + FString TmpValue; + if (AccessTokenValue->TryGetString(TmpValue)) { AccessToken = TmpValue; } + } + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithWindowsHelloRequest::~FLoginWithWindowsHelloRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithWindowsHelloRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ChallengeSignature")); writer->WriteValue(ChallengeSignature); + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + writer->WriteIdentifierPrefix(TEXT("PublicKeyHint")); writer->WriteValue(PublicKeyHint); + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithWindowsHelloRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ChallengeSignatureValue = obj->TryGetField(TEXT("ChallengeSignature")); + if (ChallengeSignatureValue.IsValid() && !ChallengeSignatureValue->IsNull()) + { + FString TmpValue; + if (ChallengeSignatureValue->TryGetString(TmpValue)) { ChallengeSignature = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PublicKeyHintValue = obj->TryGetField(TEXT("PublicKeyHint")); + if (PublicKeyHintValue.IsValid() && !PublicKeyHintValue->IsNull()) + { + FString TmpValue; + if (PublicKeyHintValue->TryGetString(TmpValue)) { PublicKeyHint = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithXboxRequest::~FLoginWithXboxRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithXboxRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + if (XboxToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithXboxRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FMatchmakeRequest::~FMatchmakeRequest() +{ + //if (TagFilter != nullptr) delete TagFilter; + +} + +void PlayFab::ClientModels::FMatchmakeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BuildVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (GameMode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameMode")); writer->WriteValue(GameMode); } + + if (LobbyId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); } + + if (pfRegion.notNull()) { writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); } + + if (StartNewIfNoneFound.notNull()) { writer->WriteIdentifierPrefix(TEXT("StartNewIfNoneFound")); writer->WriteValue(StartNewIfNoneFound); } + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + if (TagFilter.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TagFilter")); TagFilter->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FMatchmakeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr GameModeValue = obj->TryGetField(TEXT("GameMode")); + if (GameModeValue.IsValid() && !GameModeValue->IsNull()) + { + FString TmpValue; + if (GameModeValue->TryGetString(TmpValue)) { GameMode = TmpValue; } + } + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + const TSharedPtr StartNewIfNoneFoundValue = obj->TryGetField(TEXT("StartNewIfNoneFound")); + if (StartNewIfNoneFoundValue.IsValid() && !StartNewIfNoneFoundValue->IsNull()) + { + bool TmpValue; + if (StartNewIfNoneFoundValue->TryGetBool(TmpValue)) { StartNewIfNoneFound = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr TagFilterValue = obj->TryGetField(TEXT("TagFilter")); + if (TagFilterValue.IsValid() && !TagFilterValue->IsNull()) + { + TagFilter = MakeShareable(new FCollectionFilter(TagFilterValue->AsObject())); + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeMatchmakeStatusEnumJSON(MatchmakeStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case MatchmakeStatusComplete: writer->WriteValue(TEXT("Complete")); break; + case MatchmakeStatusWaiting: writer->WriteValue(TEXT("Waiting")); break; + case MatchmakeStatusGameNotFound: writer->WriteValue(TEXT("GameNotFound")); break; + case MatchmakeStatusNoAvailableSlots: writer->WriteValue(TEXT("NoAvailableSlots")); break; + case MatchmakeStatusSessionClosed: writer->WriteValue(TEXT("SessionClosed")); break; + } +} + +ClientModels::MatchmakeStatus PlayFab::ClientModels::readMatchmakeStatusFromValue(const TSharedPtr& value) +{ + return readMatchmakeStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::MatchmakeStatus PlayFab::ClientModels::readMatchmakeStatusFromValue(const FString& value) +{ + static TMap _MatchmakeStatusMap; + if (_MatchmakeStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _MatchmakeStatusMap.Add(TEXT("Complete"), MatchmakeStatusComplete); + _MatchmakeStatusMap.Add(TEXT("Waiting"), MatchmakeStatusWaiting); + _MatchmakeStatusMap.Add(TEXT("GameNotFound"), MatchmakeStatusGameNotFound); + _MatchmakeStatusMap.Add(TEXT("NoAvailableSlots"), MatchmakeStatusNoAvailableSlots); + _MatchmakeStatusMap.Add(TEXT("SessionClosed"), MatchmakeStatusSessionClosed); + + } + + if (!value.IsEmpty()) + { + auto output = _MatchmakeStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return MatchmakeStatusComplete; // Basically critical fail +} + +PlayFab::ClientModels::FMatchmakeResult::~FMatchmakeResult() +{ + +} + +void PlayFab::ClientModels::FMatchmakeResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Expires.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Expires")); writer->WriteValue(Expires); } + + if (LobbyID.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyID")); writer->WriteValue(LobbyID); } + + if (PollWaitTimeMS.notNull()) { writer->WriteIdentifierPrefix(TEXT("PollWaitTimeMS")); writer->WriteValue(PollWaitTimeMS); } + + if (ServerHostname.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerHostname")); writer->WriteValue(ServerHostname); } + + if (ServerIPV4Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV4Address")); writer->WriteValue(ServerIPV4Address); } + + if (ServerIPV6Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV6Address")); writer->WriteValue(ServerIPV6Address); } + + if (ServerPort.notNull()) { writer->WriteIdentifierPrefix(TEXT("ServerPort")); writer->WriteValue(ServerPort); } + + if (ServerPublicDNSName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerPublicDNSName")); writer->WriteValue(ServerPublicDNSName); } + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeMatchmakeStatusEnumJSON(Status, writer); } + + if (Ticket.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Ticket")); writer->WriteValue(Ticket); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FMatchmakeResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid() && !ExpiresValue->IsNull()) + { + FString TmpValue; + if (ExpiresValue->TryGetString(TmpValue)) { Expires = TmpValue; } + } + + const TSharedPtr LobbyIDValue = obj->TryGetField(TEXT("LobbyID")); + if (LobbyIDValue.IsValid() && !LobbyIDValue->IsNull()) + { + FString TmpValue; + if (LobbyIDValue->TryGetString(TmpValue)) { LobbyID = TmpValue; } + } + + const TSharedPtr PollWaitTimeMSValue = obj->TryGetField(TEXT("PollWaitTimeMS")); + if (PollWaitTimeMSValue.IsValid() && !PollWaitTimeMSValue->IsNull()) + { + int32 TmpValue; + if (PollWaitTimeMSValue->TryGetNumber(TmpValue)) { PollWaitTimeMS = TmpValue; } + } + + const TSharedPtr ServerHostnameValue = obj->TryGetField(TEXT("ServerHostname")); + if (ServerHostnameValue.IsValid() && !ServerHostnameValue->IsNull()) + { + FString TmpValue; + if (ServerHostnameValue->TryGetString(TmpValue)) { ServerHostname = TmpValue; } + } + + const TSharedPtr ServerIPV4AddressValue = obj->TryGetField(TEXT("ServerIPV4Address")); + if (ServerIPV4AddressValue.IsValid() && !ServerIPV4AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV4AddressValue->TryGetString(TmpValue)) { ServerIPV4Address = TmpValue; } + } + + const TSharedPtr ServerIPV6AddressValue = obj->TryGetField(TEXT("ServerIPV6Address")); + if (ServerIPV6AddressValue.IsValid() && !ServerIPV6AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV6AddressValue->TryGetString(TmpValue)) { ServerIPV6Address = TmpValue; } + } + + const TSharedPtr ServerPortValue = obj->TryGetField(TEXT("ServerPort")); + if (ServerPortValue.IsValid() && !ServerPortValue->IsNull()) + { + int32 TmpValue; + if (ServerPortValue->TryGetNumber(TmpValue)) { ServerPort = TmpValue; } + } + + const TSharedPtr ServerPublicDNSNameValue = obj->TryGetField(TEXT("ServerPublicDNSName")); + if (ServerPublicDNSNameValue.IsValid() && !ServerPublicDNSNameValue->IsNull()) + { + FString TmpValue; + if (ServerPublicDNSNameValue->TryGetString(TmpValue)) { ServerPublicDNSName = TmpValue; } + } + + Status = readMatchmakeStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TicketValue = obj->TryGetField(TEXT("Ticket")); + if (TicketValue.IsValid() && !TicketValue->IsNull()) + { + FString TmpValue; + if (TicketValue->TryGetString(TmpValue)) { Ticket = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FModifyUserVirtualCurrencyResult::~FModifyUserVirtualCurrencyResult() +{ + +} + +void PlayFab::ClientModels::FModifyUserVirtualCurrencyResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Balance")); writer->WriteValue(Balance); + + writer->WriteIdentifierPrefix(TEXT("BalanceChange")); writer->WriteValue(BalanceChange); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (VirtualCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FModifyUserVirtualCurrencyResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BalanceValue = obj->TryGetField(TEXT("Balance")); + if (BalanceValue.IsValid() && !BalanceValue->IsNull()) + { + int32 TmpValue; + if (BalanceValue->TryGetNumber(TmpValue)) { Balance = TmpValue; } + } + + const TSharedPtr BalanceChangeValue = obj->TryGetField(TEXT("BalanceChange")); + if (BalanceChangeValue.IsValid() && !BalanceChangeValue->IsNull()) + { + int32 TmpValue; + if (BalanceChangeValue->TryGetNumber(TmpValue)) { BalanceChange = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FOpenTradeRequest::~FOpenTradeRequest() +{ + +} + +void PlayFab::ClientModels::FOpenTradeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AllowedPlayerIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("AllowedPlayerIds")); + for (const FString& item : AllowedPlayerIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (OfferedInventoryInstanceIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("OfferedInventoryInstanceIds")); + for (const FString& item : OfferedInventoryInstanceIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (RequestedCatalogItemIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("RequestedCatalogItemIds")); + for (const FString& item : RequestedCatalogItemIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FOpenTradeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("AllowedPlayerIds"), AllowedPlayerIds); + + obj->TryGetStringArrayField(TEXT("OfferedInventoryInstanceIds"), OfferedInventoryInstanceIds); + + obj->TryGetStringArrayField(TEXT("RequestedCatalogItemIds"), RequestedCatalogItemIds); + + return HasSucceeded; +} + +PlayFab::ClientModels::FOpenTradeResponse::~FOpenTradeResponse() +{ + //if (Trade != nullptr) delete Trade; + +} + +void PlayFab::ClientModels::FOpenTradeResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Trade.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Trade")); Trade->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FOpenTradeResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TradeValue = obj->TryGetField(TEXT("Trade")); + if (TradeValue.IsValid() && !TradeValue->IsNull()) + { + Trade = MakeShareable(new FTradeInfo(TradeValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPayForPurchaseRequest::~FPayForPurchaseRequest() +{ + +} + +void PlayFab::ClientModels::FPayForPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Currency")); writer->WriteValue(Currency); + + writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); + + writer->WriteIdentifierPrefix(TEXT("ProviderName")); writer->WriteValue(ProviderName); + + if (ProviderTransactionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ProviderTransactionId")); writer->WriteValue(ProviderTransactionId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPayForPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyValue = obj->TryGetField(TEXT("Currency")); + if (CurrencyValue.IsValid() && !CurrencyValue->IsNull()) + { + FString TmpValue; + if (CurrencyValue->TryGetString(TmpValue)) { Currency = TmpValue; } + } + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TSharedPtr ProviderNameValue = obj->TryGetField(TEXT("ProviderName")); + if (ProviderNameValue.IsValid() && !ProviderNameValue->IsNull()) + { + FString TmpValue; + if (ProviderNameValue->TryGetString(TmpValue)) { ProviderName = TmpValue; } + } + + const TSharedPtr ProviderTransactionIdValue = obj->TryGetField(TEXT("ProviderTransactionId")); + if (ProviderTransactionIdValue.IsValid() && !ProviderTransactionIdValue->IsNull()) + { + FString TmpValue; + if (ProviderTransactionIdValue->TryGetString(TmpValue)) { ProviderTransactionId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeTransactionStatusEnumJSON(TransactionStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case TransactionStatusCreateCart: writer->WriteValue(TEXT("CreateCart")); break; + case TransactionStatusInit: writer->WriteValue(TEXT("Init")); break; + case TransactionStatusApproved: writer->WriteValue(TEXT("Approved")); break; + case TransactionStatusSucceeded: writer->WriteValue(TEXT("Succeeded")); break; + case TransactionStatusFailedByProvider: writer->WriteValue(TEXT("FailedByProvider")); break; + case TransactionStatusDisputePending: writer->WriteValue(TEXT("DisputePending")); break; + case TransactionStatusRefundPending: writer->WriteValue(TEXT("RefundPending")); break; + case TransactionStatusRefunded: writer->WriteValue(TEXT("Refunded")); break; + case TransactionStatusRefundFailed: writer->WriteValue(TEXT("RefundFailed")); break; + case TransactionStatusChargedBack: writer->WriteValue(TEXT("ChargedBack")); break; + case TransactionStatusFailedByUber: writer->WriteValue(TEXT("FailedByUber")); break; + case TransactionStatusFailedByPlayFab: writer->WriteValue(TEXT("FailedByPlayFab")); break; + case TransactionStatusRevoked: writer->WriteValue(TEXT("Revoked")); break; + case TransactionStatusTradePending: writer->WriteValue(TEXT("TradePending")); break; + case TransactionStatusTraded: writer->WriteValue(TEXT("Traded")); break; + case TransactionStatusUpgraded: writer->WriteValue(TEXT("Upgraded")); break; + case TransactionStatusStackPending: writer->WriteValue(TEXT("StackPending")); break; + case TransactionStatusStacked: writer->WriteValue(TEXT("Stacked")); break; + case TransactionStatusOther: writer->WriteValue(TEXT("Other")); break; + case TransactionStatusFailed: writer->WriteValue(TEXT("Failed")); break; + } +} + +ClientModels::TransactionStatus PlayFab::ClientModels::readTransactionStatusFromValue(const TSharedPtr& value) +{ + return readTransactionStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::TransactionStatus PlayFab::ClientModels::readTransactionStatusFromValue(const FString& value) +{ + static TMap _TransactionStatusMap; + if (_TransactionStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _TransactionStatusMap.Add(TEXT("CreateCart"), TransactionStatusCreateCart); + _TransactionStatusMap.Add(TEXT("Init"), TransactionStatusInit); + _TransactionStatusMap.Add(TEXT("Approved"), TransactionStatusApproved); + _TransactionStatusMap.Add(TEXT("Succeeded"), TransactionStatusSucceeded); + _TransactionStatusMap.Add(TEXT("FailedByProvider"), TransactionStatusFailedByProvider); + _TransactionStatusMap.Add(TEXT("DisputePending"), TransactionStatusDisputePending); + _TransactionStatusMap.Add(TEXT("RefundPending"), TransactionStatusRefundPending); + _TransactionStatusMap.Add(TEXT("Refunded"), TransactionStatusRefunded); + _TransactionStatusMap.Add(TEXT("RefundFailed"), TransactionStatusRefundFailed); + _TransactionStatusMap.Add(TEXT("ChargedBack"), TransactionStatusChargedBack); + _TransactionStatusMap.Add(TEXT("FailedByUber"), TransactionStatusFailedByUber); + _TransactionStatusMap.Add(TEXT("FailedByPlayFab"), TransactionStatusFailedByPlayFab); + _TransactionStatusMap.Add(TEXT("Revoked"), TransactionStatusRevoked); + _TransactionStatusMap.Add(TEXT("TradePending"), TransactionStatusTradePending); + _TransactionStatusMap.Add(TEXT("Traded"), TransactionStatusTraded); + _TransactionStatusMap.Add(TEXT("Upgraded"), TransactionStatusUpgraded); + _TransactionStatusMap.Add(TEXT("StackPending"), TransactionStatusStackPending); + _TransactionStatusMap.Add(TEXT("Stacked"), TransactionStatusStacked); + _TransactionStatusMap.Add(TEXT("Other"), TransactionStatusOther); + _TransactionStatusMap.Add(TEXT("Failed"), TransactionStatusFailed); + + } + + if (!value.IsEmpty()) + { + auto output = _TransactionStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return TransactionStatusCreateCart; // Basically critical fail +} + +PlayFab::ClientModels::FPayForPurchaseResult::~FPayForPurchaseResult() +{ + +} + +void PlayFab::ClientModels::FPayForPurchaseResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CreditApplied")); writer->WriteValue(static_cast(CreditApplied)); + + if (OrderId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); } + + if (ProviderData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ProviderData")); writer->WriteValue(ProviderData); } + + if (ProviderToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ProviderToken")); writer->WriteValue(ProviderToken); } + + if (PurchaseConfirmationPageURL.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PurchaseConfirmationPageURL")); writer->WriteValue(PurchaseConfirmationPageURL); } + + if (PurchaseCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PurchaseCurrency")); writer->WriteValue(PurchaseCurrency); } + + writer->WriteIdentifierPrefix(TEXT("PurchasePrice")); writer->WriteValue(static_cast(PurchasePrice)); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeTransactionStatusEnumJSON(Status, writer); } + + if (VCAmount.Num() != 0) + { + writer->WriteObjectStart(TEXT("VCAmount")); + for (TMap::TConstIterator It(VCAmount); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPayForPurchaseResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreditAppliedValue = obj->TryGetField(TEXT("CreditApplied")); + if (CreditAppliedValue.IsValid() && !CreditAppliedValue->IsNull()) + { + uint32 TmpValue; + if (CreditAppliedValue->TryGetNumber(TmpValue)) { CreditApplied = TmpValue; } + } + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TSharedPtr ProviderDataValue = obj->TryGetField(TEXT("ProviderData")); + if (ProviderDataValue.IsValid() && !ProviderDataValue->IsNull()) + { + FString TmpValue; + if (ProviderDataValue->TryGetString(TmpValue)) { ProviderData = TmpValue; } + } + + const TSharedPtr ProviderTokenValue = obj->TryGetField(TEXT("ProviderToken")); + if (ProviderTokenValue.IsValid() && !ProviderTokenValue->IsNull()) + { + FString TmpValue; + if (ProviderTokenValue->TryGetString(TmpValue)) { ProviderToken = TmpValue; } + } + + const TSharedPtr PurchaseConfirmationPageURLValue = obj->TryGetField(TEXT("PurchaseConfirmationPageURL")); + if (PurchaseConfirmationPageURLValue.IsValid() && !PurchaseConfirmationPageURLValue->IsNull()) + { + FString TmpValue; + if (PurchaseConfirmationPageURLValue->TryGetString(TmpValue)) { PurchaseConfirmationPageURL = TmpValue; } + } + + const TSharedPtr PurchaseCurrencyValue = obj->TryGetField(TEXT("PurchaseCurrency")); + if (PurchaseCurrencyValue.IsValid() && !PurchaseCurrencyValue->IsNull()) + { + FString TmpValue; + if (PurchaseCurrencyValue->TryGetString(TmpValue)) { PurchaseCurrency = TmpValue; } + } + + const TSharedPtr PurchasePriceValue = obj->TryGetField(TEXT("PurchasePrice")); + if (PurchasePriceValue.IsValid() && !PurchasePriceValue->IsNull()) + { + uint32 TmpValue; + if (PurchasePriceValue->TryGetNumber(TmpValue)) { PurchasePrice = TmpValue; } + } + + Status = readTransactionStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr* VCAmountObject; + if (obj->TryGetObjectField(TEXT("VCAmount"), VCAmountObject)) + { + for (TMap>::TConstIterator It((*VCAmountObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VCAmount.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPaymentOption::~FPaymentOption() +{ + +} + +void PlayFab::ClientModels::FPaymentOption::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Currency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Currency")); writer->WriteValue(Currency); } + + writer->WriteIdentifierPrefix(TEXT("Price")); writer->WriteValue(static_cast(Price)); + + if (ProviderName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ProviderName")); writer->WriteValue(ProviderName); } + + writer->WriteIdentifierPrefix(TEXT("StoreCredit")); writer->WriteValue(static_cast(StoreCredit)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPaymentOption::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyValue = obj->TryGetField(TEXT("Currency")); + if (CurrencyValue.IsValid() && !CurrencyValue->IsNull()) + { + FString TmpValue; + if (CurrencyValue->TryGetString(TmpValue)) { Currency = TmpValue; } + } + + const TSharedPtr PriceValue = obj->TryGetField(TEXT("Price")); + if (PriceValue.IsValid() && !PriceValue->IsNull()) + { + uint32 TmpValue; + if (PriceValue->TryGetNumber(TmpValue)) { Price = TmpValue; } + } + + const TSharedPtr ProviderNameValue = obj->TryGetField(TEXT("ProviderName")); + if (ProviderNameValue.IsValid() && !ProviderNameValue->IsNull()) + { + FString TmpValue; + if (ProviderNameValue->TryGetString(TmpValue)) { ProviderName = TmpValue; } + } + + const TSharedPtr StoreCreditValue = obj->TryGetField(TEXT("StoreCredit")); + if (StoreCreditValue.IsValid() && !StoreCreditValue->IsNull()) + { + uint32 TmpValue; + if (StoreCreditValue->TryGetNumber(TmpValue)) { StoreCredit = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPurchaseItemRequest::~FPurchaseItemRequest() +{ + +} + +void PlayFab::ClientModels::FPurchaseItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + writer->WriteIdentifierPrefix(TEXT("Price")); writer->WriteValue(Price); + + if (StoreId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); } + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPurchaseItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr PriceValue = obj->TryGetField(TEXT("Price")); + if (PriceValue.IsValid() && !PriceValue->IsNull()) + { + int32 TmpValue; + if (PriceValue->TryGetNumber(TmpValue)) { Price = TmpValue; } + } + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPurchaseItemResult::~FPurchaseItemResult() +{ + +} + +void PlayFab::ClientModels::FPurchaseItemResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Items.Num() != 0) + { + writer->WriteArrayStart(TEXT("Items")); + for (const FItemInstance& item : Items) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPurchaseItemResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Items")); + for (int32 Idx = 0; Idx < ItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemsArray[Idx]; + Items.Add(FItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FRedeemCouponRequest::~FRedeemCouponRequest() +{ + +} + +void PlayFab::ClientModels::FRedeemCouponRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("CouponCode")); writer->WriteValue(CouponCode); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRedeemCouponRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CouponCodeValue = obj->TryGetField(TEXT("CouponCode")); + if (CouponCodeValue.IsValid() && !CouponCodeValue->IsNull()) + { + FString TmpValue; + if (CouponCodeValue->TryGetString(TmpValue)) { CouponCode = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRedeemCouponResult::~FRedeemCouponResult() +{ + +} + +void PlayFab::ClientModels::FRedeemCouponResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GrantedItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("GrantedItems")); + for (const FItemInstance& item : GrantedItems) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRedeemCouponResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GrantedItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GrantedItems")); + for (int32 Idx = 0; Idx < GrantedItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GrantedItemsArray[Idx]; + GrantedItems.Add(FItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FRegisterForIOSPushNotificationRequest::~FRegisterForIOSPushNotificationRequest() +{ + +} + +void PlayFab::ClientModels::FRegisterForIOSPushNotificationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ConfirmationMessage.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ConfirmationMessage")); writer->WriteValue(ConfirmationMessage); } + + writer->WriteIdentifierPrefix(TEXT("DeviceToken")); writer->WriteValue(DeviceToken); + + if (SendPushNotificationConfirmation.notNull()) { writer->WriteIdentifierPrefix(TEXT("SendPushNotificationConfirmation")); writer->WriteValue(SendPushNotificationConfirmation); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRegisterForIOSPushNotificationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ConfirmationMessageValue = obj->TryGetField(TEXT("ConfirmationMessage")); + if (ConfirmationMessageValue.IsValid() && !ConfirmationMessageValue->IsNull()) + { + FString TmpValue; + if (ConfirmationMessageValue->TryGetString(TmpValue)) { ConfirmationMessage = TmpValue; } + } + + const TSharedPtr DeviceTokenValue = obj->TryGetField(TEXT("DeviceToken")); + if (DeviceTokenValue.IsValid() && !DeviceTokenValue->IsNull()) + { + FString TmpValue; + if (DeviceTokenValue->TryGetString(TmpValue)) { DeviceToken = TmpValue; } + } + + const TSharedPtr SendPushNotificationConfirmationValue = obj->TryGetField(TEXT("SendPushNotificationConfirmation")); + if (SendPushNotificationConfirmationValue.IsValid() && !SendPushNotificationConfirmationValue->IsNull()) + { + bool TmpValue; + if (SendPushNotificationConfirmationValue->TryGetBool(TmpValue)) { SendPushNotificationConfirmation = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRegisterForIOSPushNotificationResult::~FRegisterForIOSPushNotificationResult() +{ + +} + +void PlayFab::ClientModels::FRegisterForIOSPushNotificationResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRegisterForIOSPushNotificationResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FRegisterPlayFabUserRequest::~FRegisterPlayFabUserRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FRegisterPlayFabUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (Password.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Password")); writer->WriteValue(Password); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + if (RequireBothUsernameAndEmail.notNull()) { writer->WriteIdentifierPrefix(TEXT("RequireBothUsernameAndEmail")); writer->WriteValue(RequireBothUsernameAndEmail); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRegisterPlayFabUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PasswordValue = obj->TryGetField(TEXT("Password")); + if (PasswordValue.IsValid() && !PasswordValue->IsNull()) + { + FString TmpValue; + if (PasswordValue->TryGetString(TmpValue)) { Password = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr RequireBothUsernameAndEmailValue = obj->TryGetField(TEXT("RequireBothUsernameAndEmail")); + if (RequireBothUsernameAndEmailValue.IsValid() && !RequireBothUsernameAndEmailValue->IsNull()) + { + bool TmpValue; + if (RequireBothUsernameAndEmailValue->TryGetBool(TmpValue)) { RequireBothUsernameAndEmail = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRegisterPlayFabUserResult::~FRegisterPlayFabUserResult() +{ + //if (EntityToken != nullptr) delete EntityToken; + //if (SettingsForUser != nullptr) delete SettingsForUser; + +} + +void PlayFab::ClientModels::FRegisterPlayFabUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EntityToken.IsValid()) { writer->WriteIdentifierPrefix(TEXT("EntityToken")); EntityToken->writeJSON(writer); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (SessionTicket.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SessionTicket")); writer->WriteValue(SessionTicket); } + + if (SettingsForUser.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SettingsForUser")); SettingsForUser->writeJSON(writer); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRegisterPlayFabUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityTokenValue = obj->TryGetField(TEXT("EntityToken")); + if (EntityTokenValue.IsValid() && !EntityTokenValue->IsNull()) + { + EntityToken = MakeShareable(new FEntityTokenResponse(EntityTokenValue->AsObject())); + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr SessionTicketValue = obj->TryGetField(TEXT("SessionTicket")); + if (SessionTicketValue.IsValid() && !SessionTicketValue->IsNull()) + { + FString TmpValue; + if (SessionTicketValue->TryGetString(TmpValue)) { SessionTicket = TmpValue; } + } + + const TSharedPtr SettingsForUserValue = obj->TryGetField(TEXT("SettingsForUser")); + if (SettingsForUserValue.IsValid() && !SettingsForUserValue->IsNull()) + { + SettingsForUser = MakeShareable(new FUserSettings(SettingsForUserValue->AsObject())); + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRegisterWithWindowsHelloRequest::~FRegisterWithWindowsHelloRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FRegisterWithWindowsHelloRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DeviceName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeviceName")); writer->WriteValue(DeviceName); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + if (PublicKey.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PublicKey")); writer->WriteValue(PublicKey); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + if (UserName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UserName")); writer->WriteValue(UserName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRegisterWithWindowsHelloRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DeviceNameValue = obj->TryGetField(TEXT("DeviceName")); + if (DeviceNameValue.IsValid() && !DeviceNameValue->IsNull()) + { + FString TmpValue; + if (DeviceNameValue->TryGetString(TmpValue)) { DeviceName = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr PublicKeyValue = obj->TryGetField(TEXT("PublicKey")); + if (PublicKeyValue.IsValid() && !PublicKeyValue->IsNull()) + { + FString TmpValue; + if (PublicKeyValue->TryGetString(TmpValue)) { PublicKey = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr UserNameValue = obj->TryGetField(TEXT("UserName")); + if (UserNameValue.IsValid() && !UserNameValue->IsNull()) + { + FString TmpValue; + if (UserNameValue->TryGetString(TmpValue)) { UserName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveContactEmailRequest::~FRemoveContactEmailRequest() +{ + +} + +void PlayFab::ClientModels::FRemoveContactEmailRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveContactEmailRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveContactEmailResult::~FRemoveContactEmailResult() +{ + +} + +void PlayFab::ClientModels::FRemoveContactEmailResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveContactEmailResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveFriendRequest::~FRemoveFriendRequest() +{ + +} + +void PlayFab::ClientModels::FRemoveFriendRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveFriendRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveFriendResult::~FRemoveFriendResult() +{ + +} + +void PlayFab::ClientModels::FRemoveFriendResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveFriendResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveGenericIDRequest::~FRemoveGenericIDRequest() +{ + +} + +void PlayFab::ClientModels::FRemoveGenericIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GenericId")); GenericId.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveGenericIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GenericIdValue = obj->TryGetField(TEXT("GenericId")); + if (GenericIdValue.IsValid() && !GenericIdValue->IsNull()) + { + GenericId = FGenericServiceId(GenericIdValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveGenericIDResult::~FRemoveGenericIDResult() +{ + +} + +void PlayFab::ClientModels::FRemoveGenericIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveGenericIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveSharedGroupMembersRequest::~FRemoveSharedGroupMembersRequest() +{ + +} + +void PlayFab::ClientModels::FRemoveSharedGroupMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("PlayFabIds")); + for (const FString& item : PlayFabIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveSharedGroupMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("PlayFabIds"), PlayFabIds); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveSharedGroupMembersResult::~FRemoveSharedGroupMembersResult() +{ + +} + +void PlayFab::ClientModels::FRemoveSharedGroupMembersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveSharedGroupMembersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FReportPlayerClientRequest::~FReportPlayerClientRequest() +{ + +} + +void PlayFab::ClientModels::FReportPlayerClientRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + writer->WriteIdentifierPrefix(TEXT("ReporteeId")); writer->WriteValue(ReporteeId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FReportPlayerClientRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ReporteeIdValue = obj->TryGetField(TEXT("ReporteeId")); + if (ReporteeIdValue.IsValid() && !ReporteeIdValue->IsNull()) + { + FString TmpValue; + if (ReporteeIdValue->TryGetString(TmpValue)) { ReporteeId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FReportPlayerClientResult::~FReportPlayerClientResult() +{ + +} + +void PlayFab::ClientModels::FReportPlayerClientResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("SubmissionsRemaining")); writer->WriteValue(SubmissionsRemaining); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FReportPlayerClientResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SubmissionsRemainingValue = obj->TryGetField(TEXT("SubmissionsRemaining")); + if (SubmissionsRemainingValue.IsValid() && !SubmissionsRemainingValue->IsNull()) + { + int32 TmpValue; + if (SubmissionsRemainingValue->TryGetNumber(TmpValue)) { SubmissionsRemaining = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRestoreIOSPurchasesRequest::~FRestoreIOSPurchasesRequest() +{ + +} + +void PlayFab::ClientModels::FRestoreIOSPurchasesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ReceiptData")); writer->WriteValue(ReceiptData); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRestoreIOSPurchasesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ReceiptDataValue = obj->TryGetField(TEXT("ReceiptData")); + if (ReceiptDataValue.IsValid() && !ReceiptDataValue->IsNull()) + { + FString TmpValue; + if (ReceiptDataValue->TryGetString(TmpValue)) { ReceiptData = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRestoreIOSPurchasesResult::~FRestoreIOSPurchasesResult() +{ + +} + +void PlayFab::ClientModels::FRestoreIOSPurchasesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRestoreIOSPurchasesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FSendAccountRecoveryEmailRequest::~FSendAccountRecoveryEmailRequest() +{ + +} + +void PlayFab::ClientModels::FSendAccountRecoveryEmailRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); + + if (EmailTemplateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailTemplateId")); writer->WriteValue(EmailTemplateId); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSendAccountRecoveryEmailRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr EmailTemplateIdValue = obj->TryGetField(TEXT("EmailTemplateId")); + if (EmailTemplateIdValue.IsValid() && !EmailTemplateIdValue->IsNull()) + { + FString TmpValue; + if (EmailTemplateIdValue->TryGetString(TmpValue)) { EmailTemplateId = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FSendAccountRecoveryEmailResult::~FSendAccountRecoveryEmailResult() +{ + +} + +void PlayFab::ClientModels::FSendAccountRecoveryEmailResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSendAccountRecoveryEmailResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FSetFriendTagsRequest::~FSetFriendTagsRequest() +{ + +} + +void PlayFab::ClientModels::FSetFriendTagsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); + + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSetFriendTagsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + return HasSucceeded; +} + +PlayFab::ClientModels::FSetFriendTagsResult::~FSetFriendTagsResult() +{ + +} + +void PlayFab::ClientModels::FSetFriendTagsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSetFriendTagsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FSetPlayerSecretRequest::~FSetPlayerSecretRequest() +{ + +} + +void PlayFab::ClientModels::FSetPlayerSecretRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSetPlayerSecretRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FSetPlayerSecretResult::~FSetPlayerSecretResult() +{ + +} + +void PlayFab::ClientModels::FSetPlayerSecretResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSetPlayerSecretResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FStartGameRequest::~FStartGameRequest() +{ + +} + +void PlayFab::ClientModels::FStartGameRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CustomCommandLineData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomCommandLineData")); writer->WriteValue(CustomCommandLineData); } + + writer->WriteIdentifierPrefix(TEXT("GameMode")); writer->WriteValue(GameMode); + + writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStartGameRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CustomCommandLineDataValue = obj->TryGetField(TEXT("CustomCommandLineData")); + if (CustomCommandLineDataValue.IsValid() && !CustomCommandLineDataValue->IsNull()) + { + FString TmpValue; + if (CustomCommandLineDataValue->TryGetString(TmpValue)) { CustomCommandLineData = TmpValue; } + } + + const TSharedPtr GameModeValue = obj->TryGetField(TEXT("GameMode")); + if (GameModeValue.IsValid() && !GameModeValue->IsNull()) + { + FString TmpValue; + if (GameModeValue->TryGetString(TmpValue)) { GameMode = TmpValue; } + } + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FStartGameResult::~FStartGameResult() +{ + +} + +void PlayFab::ClientModels::FStartGameResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Expires.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Expires")); writer->WriteValue(Expires); } + + if (LobbyID.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyID")); writer->WriteValue(LobbyID); } + + if (Password.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Password")); writer->WriteValue(Password); } + + if (ServerHostname.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerHostname")); writer->WriteValue(ServerHostname); } + + if (ServerIPV4Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV4Address")); writer->WriteValue(ServerIPV4Address); } + + if (ServerIPV6Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV6Address")); writer->WriteValue(ServerIPV6Address); } + + if (ServerPort.notNull()) { writer->WriteIdentifierPrefix(TEXT("ServerPort")); writer->WriteValue(ServerPort); } + + if (ServerPublicDNSName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerPublicDNSName")); writer->WriteValue(ServerPublicDNSName); } + + if (Ticket.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Ticket")); writer->WriteValue(Ticket); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStartGameResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid() && !ExpiresValue->IsNull()) + { + FString TmpValue; + if (ExpiresValue->TryGetString(TmpValue)) { Expires = TmpValue; } + } + + const TSharedPtr LobbyIDValue = obj->TryGetField(TEXT("LobbyID")); + if (LobbyIDValue.IsValid() && !LobbyIDValue->IsNull()) + { + FString TmpValue; + if (LobbyIDValue->TryGetString(TmpValue)) { LobbyID = TmpValue; } + } + + const TSharedPtr PasswordValue = obj->TryGetField(TEXT("Password")); + if (PasswordValue.IsValid() && !PasswordValue->IsNull()) + { + FString TmpValue; + if (PasswordValue->TryGetString(TmpValue)) { Password = TmpValue; } + } + + const TSharedPtr ServerHostnameValue = obj->TryGetField(TEXT("ServerHostname")); + if (ServerHostnameValue.IsValid() && !ServerHostnameValue->IsNull()) + { + FString TmpValue; + if (ServerHostnameValue->TryGetString(TmpValue)) { ServerHostname = TmpValue; } + } + + const TSharedPtr ServerIPV4AddressValue = obj->TryGetField(TEXT("ServerIPV4Address")); + if (ServerIPV4AddressValue.IsValid() && !ServerIPV4AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV4AddressValue->TryGetString(TmpValue)) { ServerIPV4Address = TmpValue; } + } + + const TSharedPtr ServerIPV6AddressValue = obj->TryGetField(TEXT("ServerIPV6Address")); + if (ServerIPV6AddressValue.IsValid() && !ServerIPV6AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV6AddressValue->TryGetString(TmpValue)) { ServerIPV6Address = TmpValue; } + } + + const TSharedPtr ServerPortValue = obj->TryGetField(TEXT("ServerPort")); + if (ServerPortValue.IsValid() && !ServerPortValue->IsNull()) + { + int32 TmpValue; + if (ServerPortValue->TryGetNumber(TmpValue)) { ServerPort = TmpValue; } + } + + const TSharedPtr ServerPublicDNSNameValue = obj->TryGetField(TEXT("ServerPublicDNSName")); + if (ServerPublicDNSNameValue.IsValid() && !ServerPublicDNSNameValue->IsNull()) + { + FString TmpValue; + if (ServerPublicDNSNameValue->TryGetString(TmpValue)) { ServerPublicDNSName = TmpValue; } + } + + const TSharedPtr TicketValue = obj->TryGetField(TEXT("Ticket")); + if (TicketValue.IsValid() && !TicketValue->IsNull()) + { + FString TmpValue; + if (TicketValue->TryGetString(TmpValue)) { Ticket = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FStartPurchaseRequest::~FStartPurchaseRequest() +{ + +} + +void PlayFab::ClientModels::FStartPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("Items")); + for (const FItemPurchaseRequest& item : Items) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + if (StoreId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStartPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TArray>&ItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Items")); + for (int32 Idx = 0; Idx < ItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemsArray[Idx]; + Items.Add(FItemPurchaseRequest(CurrentItem->AsObject())); + } + + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FStartPurchaseResult::~FStartPurchaseResult() +{ + +} + +void PlayFab::ClientModels::FStartPurchaseResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Contents.Num() != 0) + { + writer->WriteArrayStart(TEXT("Contents")); + for (const FCartItem& item : Contents) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (OrderId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); } + + if (PaymentOptions.Num() != 0) + { + writer->WriteArrayStart(TEXT("PaymentOptions")); + for (const FPaymentOption& item : PaymentOptions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyBalances.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyBalances")); + for (TMap::TConstIterator It(VirtualCurrencyBalances); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStartPurchaseResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ContentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Contents")); + for (int32 Idx = 0; Idx < ContentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContentsArray[Idx]; + Contents.Add(FCartItem(CurrentItem->AsObject())); + } + + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TArray>&PaymentOptionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PaymentOptions")); + for (int32 Idx = 0; Idx < PaymentOptionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PaymentOptionsArray[Idx]; + PaymentOptions.Add(FPaymentOption(CurrentItem->AsObject())); + } + + + const TSharedPtr* VirtualCurrencyBalancesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyBalances"), VirtualCurrencyBalancesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyBalancesObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyBalances.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FStatisticUpdate::~FStatisticUpdate() +{ + +} + +void PlayFab::ClientModels::FStatisticUpdate::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStatisticUpdate::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FSubtractUserVirtualCurrencyRequest::~FSubtractUserVirtualCurrencyRequest() +{ + +} + +void PlayFab::ClientModels::FSubtractUserVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSubtractUserVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkAndroidDeviceIDRequest::~FUnlinkAndroidDeviceIDRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkAndroidDeviceIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceId")); writer->WriteValue(AndroidDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkAndroidDeviceIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceIdValue = obj->TryGetField(TEXT("AndroidDeviceId")); + if (AndroidDeviceIdValue.IsValid() && !AndroidDeviceIdValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceIdValue->TryGetString(TmpValue)) { AndroidDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkAndroidDeviceIDResult::~FUnlinkAndroidDeviceIDResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkAndroidDeviceIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkAndroidDeviceIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkCustomIDRequest::~FUnlinkCustomIDRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkCustomIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CustomId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomId")); writer->WriteValue(CustomId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkCustomIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomIdValue = obj->TryGetField(TEXT("CustomId")); + if (CustomIdValue.IsValid() && !CustomIdValue->IsNull()) + { + FString TmpValue; + if (CustomIdValue->TryGetString(TmpValue)) { CustomId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkCustomIDResult::~FUnlinkCustomIDResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkCustomIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkCustomIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkFacebookAccountRequest::~FUnlinkFacebookAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkFacebookAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkFacebookAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkFacebookAccountResult::~FUnlinkFacebookAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkFacebookAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkFacebookAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkFacebookInstantGamesIdRequest::~FUnlinkFacebookInstantGamesIdRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkFacebookInstantGamesIdRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookInstantGamesId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesId")); writer->WriteValue(FacebookInstantGamesId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkFacebookInstantGamesIdRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesIdValue = obj->TryGetField(TEXT("FacebookInstantGamesId")); + if (FacebookInstantGamesIdValue.IsValid() && !FacebookInstantGamesIdValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesIdValue->TryGetString(TmpValue)) { FacebookInstantGamesId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkFacebookInstantGamesIdResult::~FUnlinkFacebookInstantGamesIdResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkFacebookInstantGamesIdResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkFacebookInstantGamesIdResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkGameCenterAccountRequest::~FUnlinkGameCenterAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkGameCenterAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkGameCenterAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkGameCenterAccountResult::~FUnlinkGameCenterAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkGameCenterAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkGameCenterAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkGoogleAccountRequest::~FUnlinkGoogleAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkGoogleAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkGoogleAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkGoogleAccountResult::~FUnlinkGoogleAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkGoogleAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkGoogleAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkIOSDeviceIDRequest::~FUnlinkIOSDeviceIDRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkIOSDeviceIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeviceId")); writer->WriteValue(DeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkIOSDeviceIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DeviceIdValue = obj->TryGetField(TEXT("DeviceId")); + if (DeviceIdValue.IsValid() && !DeviceIdValue->IsNull()) + { + FString TmpValue; + if (DeviceIdValue->TryGetString(TmpValue)) { DeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkIOSDeviceIDResult::~FUnlinkIOSDeviceIDResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkIOSDeviceIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkIOSDeviceIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkKongregateAccountRequest::~FUnlinkKongregateAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkKongregateAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkKongregateAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkKongregateAccountResult::~FUnlinkKongregateAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkKongregateAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkKongregateAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkNintendoSwitchDeviceIdRequest::~FUnlinkNintendoSwitchDeviceIdRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkNintendoSwitchDeviceIdRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkNintendoSwitchDeviceIdRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkNintendoSwitchDeviceIdResult::~FUnlinkNintendoSwitchDeviceIdResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkNintendoSwitchDeviceIdResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkNintendoSwitchDeviceIdResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkSteamAccountRequest::~FUnlinkSteamAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkSteamAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkSteamAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkSteamAccountResult::~FUnlinkSteamAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkSteamAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkSteamAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkTwitchAccountRequest::~FUnlinkTwitchAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkTwitchAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkTwitchAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkTwitchAccountResult::~FUnlinkTwitchAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkTwitchAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkTwitchAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkWindowsHelloAccountRequest::~FUnlinkWindowsHelloAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkWindowsHelloAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PublicKeyHint")); writer->WriteValue(PublicKeyHint); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkWindowsHelloAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PublicKeyHintValue = obj->TryGetField(TEXT("PublicKeyHint")); + if (PublicKeyHintValue.IsValid() && !PublicKeyHintValue->IsNull()) + { + FString TmpValue; + if (PublicKeyHintValue->TryGetString(TmpValue)) { PublicKeyHint = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkWindowsHelloAccountResponse::~FUnlinkWindowsHelloAccountResponse() +{ + +} + +void PlayFab::ClientModels::FUnlinkWindowsHelloAccountResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkWindowsHelloAccountResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkXboxAccountRequest::~FUnlinkXboxAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkXboxAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkXboxAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkXboxAccountResult::~FUnlinkXboxAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkXboxAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkXboxAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlockContainerInstanceRequest::~FUnlockContainerInstanceRequest() +{ + +} + +void PlayFab::ClientModels::FUnlockContainerInstanceRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ContainerItemInstanceId")); writer->WriteValue(ContainerItemInstanceId); + + if (KeyItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KeyItemInstanceId")); writer->WriteValue(KeyItemInstanceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlockContainerInstanceRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ContainerItemInstanceIdValue = obj->TryGetField(TEXT("ContainerItemInstanceId")); + if (ContainerItemInstanceIdValue.IsValid() && !ContainerItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ContainerItemInstanceIdValue->TryGetString(TmpValue)) { ContainerItemInstanceId = TmpValue; } + } + + const TSharedPtr KeyItemInstanceIdValue = obj->TryGetField(TEXT("KeyItemInstanceId")); + if (KeyItemInstanceIdValue.IsValid() && !KeyItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (KeyItemInstanceIdValue->TryGetString(TmpValue)) { KeyItemInstanceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlockContainerItemRequest::~FUnlockContainerItemRequest() +{ + +} + +void PlayFab::ClientModels::FUnlockContainerItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ContainerItemId")); writer->WriteValue(ContainerItemId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlockContainerItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ContainerItemIdValue = obj->TryGetField(TEXT("ContainerItemId")); + if (ContainerItemIdValue.IsValid() && !ContainerItemIdValue->IsNull()) + { + FString TmpValue; + if (ContainerItemIdValue->TryGetString(TmpValue)) { ContainerItemId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlockContainerItemResult::~FUnlockContainerItemResult() +{ + +} + +void PlayFab::ClientModels::FUnlockContainerItemResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GrantedItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("GrantedItems")); + for (const FItemInstance& item : GrantedItems) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (UnlockedItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnlockedItemInstanceId")); writer->WriteValue(UnlockedItemInstanceId); } + + if (UnlockedWithItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnlockedWithItemInstanceId")); writer->WriteValue(UnlockedWithItemInstanceId); } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlockContainerItemResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GrantedItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GrantedItems")); + for (int32 Idx = 0; Idx < GrantedItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GrantedItemsArray[Idx]; + GrantedItems.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr UnlockedItemInstanceIdValue = obj->TryGetField(TEXT("UnlockedItemInstanceId")); + if (UnlockedItemInstanceIdValue.IsValid() && !UnlockedItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (UnlockedItemInstanceIdValue->TryGetString(TmpValue)) { UnlockedItemInstanceId = TmpValue; } + } + + const TSharedPtr UnlockedWithItemInstanceIdValue = obj->TryGetField(TEXT("UnlockedWithItemInstanceId")); + if (UnlockedWithItemInstanceIdValue.IsValid() && !UnlockedWithItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (UnlockedWithItemInstanceIdValue->TryGetString(TmpValue)) { UnlockedWithItemInstanceId = TmpValue; } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateAvatarUrlRequest::~FUpdateAvatarUrlRequest() +{ + +} + +void PlayFab::ClientModels::FUpdateAvatarUrlRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ImageUrl")); writer->WriteValue(ImageUrl); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateAvatarUrlRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ImageUrlValue = obj->TryGetField(TEXT("ImageUrl")); + if (ImageUrlValue.IsValid() && !ImageUrlValue->IsNull()) + { + FString TmpValue; + if (ImageUrlValue->TryGetString(TmpValue)) { ImageUrl = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateCharacterDataRequest::~FUpdateCharacterDataRequest() +{ + +} + +void PlayFab::ClientModels::FUpdateCharacterDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateCharacterDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateCharacterDataResult::~FUpdateCharacterDataResult() +{ + +} + +void PlayFab::ClientModels::FUpdateCharacterDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateCharacterDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateCharacterStatisticsRequest::~FUpdateCharacterStatisticsRequest() +{ + +} + +void PlayFab::ClientModels::FUpdateCharacterStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (CharacterStatistics.Num() != 0) + { + writer->WriteObjectStart(TEXT("CharacterStatistics")); + for (TMap::TConstIterator It(CharacterStatistics); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateCharacterStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* CharacterStatisticsObject; + if (obj->TryGetObjectField(TEXT("CharacterStatistics"), CharacterStatisticsObject)) + { + for (TMap>::TConstIterator It((*CharacterStatisticsObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + CharacterStatistics.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateCharacterStatisticsResult::~FUpdateCharacterStatisticsResult() +{ + +} + +void PlayFab::ClientModels::FUpdateCharacterStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateCharacterStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdatePlayerStatisticsRequest::~FUpdatePlayerStatisticsRequest() +{ + +} + +void PlayFab::ClientModels::FUpdatePlayerStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticUpdate& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdatePlayerStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticUpdate(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdatePlayerStatisticsResult::~FUpdatePlayerStatisticsResult() +{ + +} + +void PlayFab::ClientModels::FUpdatePlayerStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdatePlayerStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateSharedGroupDataRequest::~FUpdateSharedGroupDataRequest() +{ + +} + +void PlayFab::ClientModels::FUpdateSharedGroupDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateSharedGroupDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateSharedGroupDataResult::~FUpdateSharedGroupDataResult() +{ + +} + +void PlayFab::ClientModels::FUpdateSharedGroupDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateSharedGroupDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateUserDataRequest::~FUpdateUserDataRequest() +{ + +} + +void PlayFab::ClientModels::FUpdateUserDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateUserDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateUserDataResult::~FUpdateUserDataResult() +{ + +} + +void PlayFab::ClientModels::FUpdateUserDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateUserDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateUserTitleDisplayNameRequest::~FUpdateUserTitleDisplayNameRequest() +{ + +} + +void PlayFab::ClientModels::FUpdateUserTitleDisplayNameRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateUserTitleDisplayNameRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateUserTitleDisplayNameResult::~FUpdateUserTitleDisplayNameResult() +{ + +} + +void PlayFab::ClientModels::FUpdateUserTitleDisplayNameResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateUserTitleDisplayNameResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateAmazonReceiptRequest::~FValidateAmazonReceiptRequest() +{ + +} + +void PlayFab::ClientModels::FValidateAmazonReceiptRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("CurrencyCode")); writer->WriteValue(CurrencyCode); + + writer->WriteIdentifierPrefix(TEXT("PurchasePrice")); writer->WriteValue(PurchasePrice); + + writer->WriteIdentifierPrefix(TEXT("ReceiptId")); writer->WriteValue(ReceiptId); + + writer->WriteIdentifierPrefix(TEXT("UserId")); writer->WriteValue(UserId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateAmazonReceiptRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CurrencyCodeValue = obj->TryGetField(TEXT("CurrencyCode")); + if (CurrencyCodeValue.IsValid() && !CurrencyCodeValue->IsNull()) + { + FString TmpValue; + if (CurrencyCodeValue->TryGetString(TmpValue)) { CurrencyCode = TmpValue; } + } + + const TSharedPtr PurchasePriceValue = obj->TryGetField(TEXT("PurchasePrice")); + if (PurchasePriceValue.IsValid() && !PurchasePriceValue->IsNull()) + { + int32 TmpValue; + if (PurchasePriceValue->TryGetNumber(TmpValue)) { PurchasePrice = TmpValue; } + } + + const TSharedPtr ReceiptIdValue = obj->TryGetField(TEXT("ReceiptId")); + if (ReceiptIdValue.IsValid() && !ReceiptIdValue->IsNull()) + { + FString TmpValue; + if (ReceiptIdValue->TryGetString(TmpValue)) { ReceiptId = TmpValue; } + } + + const TSharedPtr UserIdValue = obj->TryGetField(TEXT("UserId")); + if (UserIdValue.IsValid() && !UserIdValue->IsNull()) + { + FString TmpValue; + if (UserIdValue->TryGetString(TmpValue)) { UserId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateAmazonReceiptResult::~FValidateAmazonReceiptResult() +{ + +} + +void PlayFab::ClientModels::FValidateAmazonReceiptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateAmazonReceiptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateGooglePlayPurchaseRequest::~FValidateGooglePlayPurchaseRequest() +{ + +} + +void PlayFab::ClientModels::FValidateGooglePlayPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CurrencyCode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CurrencyCode")); writer->WriteValue(CurrencyCode); } + + if (PurchasePrice.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchasePrice")); writer->WriteValue(static_cast(PurchasePrice)); } + + writer->WriteIdentifierPrefix(TEXT("ReceiptJson")); writer->WriteValue(ReceiptJson); + + writer->WriteIdentifierPrefix(TEXT("Signature")); writer->WriteValue(Signature); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateGooglePlayPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyCodeValue = obj->TryGetField(TEXT("CurrencyCode")); + if (CurrencyCodeValue.IsValid() && !CurrencyCodeValue->IsNull()) + { + FString TmpValue; + if (CurrencyCodeValue->TryGetString(TmpValue)) { CurrencyCode = TmpValue; } + } + + const TSharedPtr PurchasePriceValue = obj->TryGetField(TEXT("PurchasePrice")); + if (PurchasePriceValue.IsValid() && !PurchasePriceValue->IsNull()) + { + uint32 TmpValue; + if (PurchasePriceValue->TryGetNumber(TmpValue)) { PurchasePrice = TmpValue; } + } + + const TSharedPtr ReceiptJsonValue = obj->TryGetField(TEXT("ReceiptJson")); + if (ReceiptJsonValue.IsValid() && !ReceiptJsonValue->IsNull()) + { + FString TmpValue; + if (ReceiptJsonValue->TryGetString(TmpValue)) { ReceiptJson = TmpValue; } + } + + const TSharedPtr SignatureValue = obj->TryGetField(TEXT("Signature")); + if (SignatureValue.IsValid() && !SignatureValue->IsNull()) + { + FString TmpValue; + if (SignatureValue->TryGetString(TmpValue)) { Signature = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateGooglePlayPurchaseResult::~FValidateGooglePlayPurchaseResult() +{ + +} + +void PlayFab::ClientModels::FValidateGooglePlayPurchaseResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateGooglePlayPurchaseResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateIOSReceiptRequest::~FValidateIOSReceiptRequest() +{ + +} + +void PlayFab::ClientModels::FValidateIOSReceiptRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CurrencyCode")); writer->WriteValue(CurrencyCode); + + writer->WriteIdentifierPrefix(TEXT("PurchasePrice")); writer->WriteValue(PurchasePrice); + + writer->WriteIdentifierPrefix(TEXT("ReceiptData")); writer->WriteValue(ReceiptData); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateIOSReceiptRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyCodeValue = obj->TryGetField(TEXT("CurrencyCode")); + if (CurrencyCodeValue.IsValid() && !CurrencyCodeValue->IsNull()) + { + FString TmpValue; + if (CurrencyCodeValue->TryGetString(TmpValue)) { CurrencyCode = TmpValue; } + } + + const TSharedPtr PurchasePriceValue = obj->TryGetField(TEXT("PurchasePrice")); + if (PurchasePriceValue.IsValid() && !PurchasePriceValue->IsNull()) + { + int32 TmpValue; + if (PurchasePriceValue->TryGetNumber(TmpValue)) { PurchasePrice = TmpValue; } + } + + const TSharedPtr ReceiptDataValue = obj->TryGetField(TEXT("ReceiptData")); + if (ReceiptDataValue.IsValid() && !ReceiptDataValue->IsNull()) + { + FString TmpValue; + if (ReceiptDataValue->TryGetString(TmpValue)) { ReceiptData = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateIOSReceiptResult::~FValidateIOSReceiptResult() +{ + +} + +void PlayFab::ClientModels::FValidateIOSReceiptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateIOSReceiptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateWindowsReceiptRequest::~FValidateWindowsReceiptRequest() +{ + +} + +void PlayFab::ClientModels::FValidateWindowsReceiptRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("CurrencyCode")); writer->WriteValue(CurrencyCode); + + writer->WriteIdentifierPrefix(TEXT("PurchasePrice")); writer->WriteValue(static_cast(PurchasePrice)); + + writer->WriteIdentifierPrefix(TEXT("Receipt")); writer->WriteValue(Receipt); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateWindowsReceiptRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CurrencyCodeValue = obj->TryGetField(TEXT("CurrencyCode")); + if (CurrencyCodeValue.IsValid() && !CurrencyCodeValue->IsNull()) + { + FString TmpValue; + if (CurrencyCodeValue->TryGetString(TmpValue)) { CurrencyCode = TmpValue; } + } + + const TSharedPtr PurchasePriceValue = obj->TryGetField(TEXT("PurchasePrice")); + if (PurchasePriceValue.IsValid() && !PurchasePriceValue->IsNull()) + { + uint32 TmpValue; + if (PurchasePriceValue->TryGetNumber(TmpValue)) { PurchasePrice = TmpValue; } + } + + const TSharedPtr ReceiptValue = obj->TryGetField(TEXT("Receipt")); + if (ReceiptValue.IsValid() && !ReceiptValue->IsNull()) + { + FString TmpValue; + if (ReceiptValue->TryGetString(TmpValue)) { Receipt = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateWindowsReceiptResult::~FValidateWindowsReceiptResult() +{ + +} + +void PlayFab::ClientModels::FValidateWindowsReceiptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateWindowsReceiptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FWriteClientCharacterEventRequest::~FWriteClientCharacterEventRequest() +{ + +} + +void PlayFab::ClientModels::FWriteClientCharacterEventRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.Num() != 0) + { + writer->WriteObjectStart(TEXT("Body")); + for (TMap::TConstIterator It(Body); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("EventName")); writer->WriteValue(EventName); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FWriteClientCharacterEventRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* BodyObject; + if (obj->TryGetObjectField(TEXT("Body"), BodyObject)) + { + for (TMap>::TConstIterator It((*BodyObject)->Values); It; ++It) + { + Body.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr EventNameValue = obj->TryGetField(TEXT("EventName")); + if (EventNameValue.IsValid() && !EventNameValue->IsNull()) + { + FString TmpValue; + if (EventNameValue->TryGetString(TmpValue)) { EventName = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + +PlayFab::ClientModels::FWriteClientPlayerEventRequest::~FWriteClientPlayerEventRequest() +{ + +} + +void PlayFab::ClientModels::FWriteClientPlayerEventRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.Num() != 0) + { + writer->WriteObjectStart(TEXT("Body")); + for (TMap::TConstIterator It(Body); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("EventName")); writer->WriteValue(EventName); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FWriteClientPlayerEventRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* BodyObject; + if (obj->TryGetObjectField(TEXT("Body"), BodyObject)) + { + for (TMap>::TConstIterator It((*BodyObject)->Values); It; ++It) + { + Body.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + const TSharedPtr EventNameValue = obj->TryGetField(TEXT("EventName")); + if (EventNameValue.IsValid() && !EventNameValue->IsNull()) + { + FString TmpValue; + if (EventNameValue->TryGetString(TmpValue)) { EventName = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + +PlayFab::ClientModels::FWriteEventResponse::~FWriteEventResponse() +{ + +} + +void PlayFab::ClientModels::FWriteEventResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EventId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EventId")); writer->WriteValue(EventId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FWriteEventResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EventIdValue = obj->TryGetField(TEXT("EventId")); + if (EventIdValue.IsValid() && !EventIdValue->IsNull()) + { + FString TmpValue; + if (EventIdValue->TryGetString(TmpValue)) { EventId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FWriteTitleEventRequest::~FWriteTitleEventRequest() +{ + +} + +void PlayFab::ClientModels::FWriteTitleEventRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.Num() != 0) + { + writer->WriteObjectStart(TEXT("Body")); + for (TMap::TConstIterator It(Body); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("EventName")); writer->WriteValue(EventName); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FWriteTitleEventRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* BodyObject; + if (obj->TryGetObjectField(TEXT("Body"), BodyObject)) + { + for (TMap>::TConstIterator It((*BodyObject)->Values); It; ++It) + { + Body.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + const TSharedPtr EventNameValue = obj->TryGetField(TEXT("EventName")); + if (EventNameValue.IsValid() && !EventNameValue->IsNull()) + { + FString TmpValue; + if (EventNameValue->TryGetString(TmpValue)) { EventName = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabCloudScriptAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabCloudScriptAPI.cpp new file mode 100644 index 000000000..0b29d4df0 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabCloudScriptAPI.cpp @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabCloudScriptAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::CloudScriptModels; + +UPlayFabCloudScriptAPI::UPlayFabCloudScriptAPI() {} + +UPlayFabCloudScriptAPI::~UPlayFabCloudScriptAPI() {} + +int UPlayFabCloudScriptAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabCloudScriptAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabCloudScriptAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabCloudScriptAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabCloudScriptAPI::ExecuteEntityCloudScript( + CloudScriptModels::FExecuteEntityCloudScriptRequest& request, + const FExecuteEntityCloudScriptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/CloudScript/ExecuteEntityCloudScript")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabCloudScriptAPI::OnExecuteEntityCloudScriptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabCloudScriptAPI::OnExecuteEntityCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExecuteEntityCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + CloudScriptModels::FExecuteCloudScriptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabCloudScriptDataModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabCloudScriptDataModels.cpp new file mode 100644 index 000000000..e16b18e20 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabCloudScriptDataModels.cpp @@ -0,0 +1,380 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabCloudScriptDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::CloudScriptModels; + +void PlayFab::CloudScriptModels::writeCloudScriptRevisionOptionEnumJSON(CloudScriptRevisionOption enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CloudScriptRevisionOptionLive: writer->WriteValue(TEXT("Live")); break; + case CloudScriptRevisionOptionLatest: writer->WriteValue(TEXT("Latest")); break; + case CloudScriptRevisionOptionSpecific: writer->WriteValue(TEXT("Specific")); break; + } +} + +CloudScriptModels::CloudScriptRevisionOption PlayFab::CloudScriptModels::readCloudScriptRevisionOptionFromValue(const TSharedPtr& value) +{ + return readCloudScriptRevisionOptionFromValue(value.IsValid() ? value->AsString() : ""); +} + +CloudScriptModels::CloudScriptRevisionOption PlayFab::CloudScriptModels::readCloudScriptRevisionOptionFromValue(const FString& value) +{ + static TMap _CloudScriptRevisionOptionMap; + if (_CloudScriptRevisionOptionMap.Num() == 0) + { + // Auto-generate the map on the first use + _CloudScriptRevisionOptionMap.Add(TEXT("Live"), CloudScriptRevisionOptionLive); + _CloudScriptRevisionOptionMap.Add(TEXT("Latest"), CloudScriptRevisionOptionLatest); + _CloudScriptRevisionOptionMap.Add(TEXT("Specific"), CloudScriptRevisionOptionSpecific); + + } + + if (!value.IsEmpty()) + { + auto output = _CloudScriptRevisionOptionMap.Find(value); + if (output != nullptr) + return *output; + } + + return CloudScriptRevisionOptionLive; // Basically critical fail +} + +PlayFab::CloudScriptModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::CloudScriptModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::CloudScriptModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::CloudScriptModels::FScriptExecutionError::~FScriptExecutionError() +{ + +} + +void PlayFab::CloudScriptModels::FScriptExecutionError::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + if (StackTrace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StackTrace")); writer->WriteValue(StackTrace); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::CloudScriptModels::FScriptExecutionError::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + const TSharedPtr StackTraceValue = obj->TryGetField(TEXT("StackTrace")); + if (StackTraceValue.IsValid() && !StackTraceValue->IsNull()) + { + FString TmpValue; + if (StackTraceValue->TryGetString(TmpValue)) { StackTrace = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::CloudScriptModels::FLogStatement::~FLogStatement() +{ + +} + +void PlayFab::CloudScriptModels::FLogStatement::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.notNull()) { writer->WriteIdentifierPrefix(TEXT("Data")); Data.writeJSON(writer); } + + if (Level.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Level")); writer->WriteValue(Level); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::CloudScriptModels::FLogStatement::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataValue = obj->TryGetField(TEXT("Data")); + if (DataValue.IsValid() && !DataValue->IsNull()) + { + Data = FJsonKeeper(DataValue); + } + + const TSharedPtr LevelValue = obj->TryGetField(TEXT("Level")); + if (LevelValue.IsValid() && !LevelValue->IsNull()) + { + FString TmpValue; + if (LevelValue->TryGetString(TmpValue)) { Level = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::CloudScriptModels::FExecuteCloudScriptResult::~FExecuteCloudScriptResult() +{ + //if (Error != nullptr) delete Error; + +} + +void PlayFab::CloudScriptModels::FExecuteCloudScriptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("APIRequestsIssued")); writer->WriteValue(APIRequestsIssued); + + if (Error.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Error")); Error->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ExecutionTimeSeconds")); writer->WriteValue(ExecutionTimeSeconds); + + if (FunctionName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); } + + if (FunctionResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResult")); FunctionResult.writeJSON(writer); } + + if (FunctionResultTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResultTooLarge")); writer->WriteValue(FunctionResultTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("HttpRequestsIssued")); writer->WriteValue(HttpRequestsIssued); + + if (Logs.Num() != 0) + { + writer->WriteArrayStart(TEXT("Logs")); + for (const FLogStatement& item : Logs) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (LogsTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("LogsTooLarge")); writer->WriteValue(LogsTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("MemoryConsumedBytes")); writer->WriteValue(static_cast(MemoryConsumedBytes)); + + writer->WriteIdentifierPrefix(TEXT("ProcessorTimeSeconds")); writer->WriteValue(ProcessorTimeSeconds); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteObjectEnd(); +} + +bool PlayFab::CloudScriptModels::FExecuteCloudScriptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr APIRequestsIssuedValue = obj->TryGetField(TEXT("APIRequestsIssued")); + if (APIRequestsIssuedValue.IsValid() && !APIRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (APIRequestsIssuedValue->TryGetNumber(TmpValue)) { APIRequestsIssued = TmpValue; } + } + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + Error = MakeShareable(new FScriptExecutionError(ErrorValue->AsObject())); + } + + const TSharedPtr ExecutionTimeSecondsValue = obj->TryGetField(TEXT("ExecutionTimeSeconds")); + if (ExecutionTimeSecondsValue.IsValid() && !ExecutionTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ExecutionTimeSecondsValue->TryGetNumber(TmpValue)) { ExecutionTimeSeconds = TmpValue; } + } + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionResultValue = obj->TryGetField(TEXT("FunctionResult")); + if (FunctionResultValue.IsValid() && !FunctionResultValue->IsNull()) + { + FunctionResult = FJsonKeeper(FunctionResultValue); + } + + const TSharedPtr FunctionResultTooLargeValue = obj->TryGetField(TEXT("FunctionResultTooLarge")); + if (FunctionResultTooLargeValue.IsValid() && !FunctionResultTooLargeValue->IsNull()) + { + bool TmpValue; + if (FunctionResultTooLargeValue->TryGetBool(TmpValue)) { FunctionResultTooLarge = TmpValue; } + } + + const TSharedPtr HttpRequestsIssuedValue = obj->TryGetField(TEXT("HttpRequestsIssued")); + if (HttpRequestsIssuedValue.IsValid() && !HttpRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (HttpRequestsIssuedValue->TryGetNumber(TmpValue)) { HttpRequestsIssued = TmpValue; } + } + + const TArray>&LogsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Logs")); + for (int32 Idx = 0; Idx < LogsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LogsArray[Idx]; + Logs.Add(FLogStatement(CurrentItem->AsObject())); + } + + + const TSharedPtr LogsTooLargeValue = obj->TryGetField(TEXT("LogsTooLarge")); + if (LogsTooLargeValue.IsValid() && !LogsTooLargeValue->IsNull()) + { + bool TmpValue; + if (LogsTooLargeValue->TryGetBool(TmpValue)) { LogsTooLarge = TmpValue; } + } + + const TSharedPtr MemoryConsumedBytesValue = obj->TryGetField(TEXT("MemoryConsumedBytes")); + if (MemoryConsumedBytesValue.IsValid() && !MemoryConsumedBytesValue->IsNull()) + { + uint32 TmpValue; + if (MemoryConsumedBytesValue->TryGetNumber(TmpValue)) { MemoryConsumedBytes = TmpValue; } + } + + const TSharedPtr ProcessorTimeSecondsValue = obj->TryGetField(TEXT("ProcessorTimeSeconds")); + if (ProcessorTimeSecondsValue.IsValid() && !ProcessorTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ProcessorTimeSecondsValue->TryGetNumber(TmpValue)) { ProcessorTimeSeconds = TmpValue; } + } + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::CloudScriptModels::FExecuteEntityCloudScriptRequest::~FExecuteEntityCloudScriptRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::CloudScriptModels::FExecuteEntityCloudScriptRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); + + if (FunctionParameter.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionParameter")); FunctionParameter.writeJSON(writer); } + + if (GeneratePlayStreamEvent.notNull()) { writer->WriteIdentifierPrefix(TEXT("GeneratePlayStreamEvent")); writer->WriteValue(GeneratePlayStreamEvent); } + + if (RevisionSelection.notNull()) { writer->WriteIdentifierPrefix(TEXT("RevisionSelection")); writeCloudScriptRevisionOptionEnumJSON(RevisionSelection, writer); } + + if (SpecificRevision.notNull()) { writer->WriteIdentifierPrefix(TEXT("SpecificRevision")); writer->WriteValue(SpecificRevision); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::CloudScriptModels::FExecuteEntityCloudScriptRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionParameterValue = obj->TryGetField(TEXT("FunctionParameter")); + if (FunctionParameterValue.IsValid() && !FunctionParameterValue->IsNull()) + { + FunctionParameter = FJsonKeeper(FunctionParameterValue); + } + + const TSharedPtr GeneratePlayStreamEventValue = obj->TryGetField(TEXT("GeneratePlayStreamEvent")); + if (GeneratePlayStreamEventValue.IsValid() && !GeneratePlayStreamEventValue->IsNull()) + { + bool TmpValue; + if (GeneratePlayStreamEventValue->TryGetBool(TmpValue)) { GeneratePlayStreamEvent = TmpValue; } + } + + RevisionSelection = readCloudScriptRevisionOptionFromValue(obj->TryGetField(TEXT("RevisionSelection"))); + + const TSharedPtr SpecificRevisionValue = obj->TryGetField(TEXT("SpecificRevision")); + if (SpecificRevisionValue.IsValid() && !SpecificRevisionValue->IsNull()) + { + int32 TmpValue; + if (SpecificRevisionValue->TryGetNumber(TmpValue)) { SpecificRevision = TmpValue; } + } + + return HasSucceeded; +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabDataAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabDataAPI.cpp new file mode 100644 index 000000000..8f8fc07dd --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabDataAPI.cpp @@ -0,0 +1,227 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabDataAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::DataModels; + +UPlayFabDataAPI::UPlayFabDataAPI() {} + +UPlayFabDataAPI::~UPlayFabDataAPI() {} + +int UPlayFabDataAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabDataAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabDataAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabDataAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabDataAPI::AbortFileUploads( + DataModels::FAbortFileUploadsRequest& request, + const FAbortFileUploadsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/File/AbortFileUploads")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnAbortFileUploadsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnAbortFileUploadsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAbortFileUploadsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FAbortFileUploadsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabDataAPI::DeleteFiles( + DataModels::FDeleteFilesRequest& request, + const FDeleteFilesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/File/DeleteFiles")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnDeleteFilesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnDeleteFilesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteFilesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FDeleteFilesResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabDataAPI::FinalizeFileUploads( + DataModels::FFinalizeFileUploadsRequest& request, + const FFinalizeFileUploadsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/File/FinalizeFileUploads")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnFinalizeFileUploadsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnFinalizeFileUploadsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFinalizeFileUploadsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FFinalizeFileUploadsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabDataAPI::GetFiles( + DataModels::FGetFilesRequest& request, + const FGetFilesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/File/GetFiles")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnGetFilesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnGetFilesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFilesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FGetFilesResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabDataAPI::GetObjects( + DataModels::FGetObjectsRequest& request, + const FGetObjectsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Object/GetObjects")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnGetObjectsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnGetObjectsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetObjectsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FGetObjectsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabDataAPI::InitiateFileUploads( + DataModels::FInitiateFileUploadsRequest& request, + const FInitiateFileUploadsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/File/InitiateFileUploads")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnInitiateFileUploadsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnInitiateFileUploadsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FInitiateFileUploadsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FInitiateFileUploadsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabDataAPI::SetObjects( + DataModels::FSetObjectsRequest& request, + const FSetObjectsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Object/SetObjects")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnSetObjectsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnSetObjectsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetObjectsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FSetObjectsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabDataDataModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabDataDataModels.cpp new file mode 100644 index 000000000..78eac7787 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabDataDataModels.cpp @@ -0,0 +1,953 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabDataDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::DataModels; + +PlayFab::DataModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::DataModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FAbortFileUploadsRequest::~FAbortFileUploadsRequest() +{ + +} + +void PlayFab::DataModels::FAbortFileUploadsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteArrayStart(TEXT("FileNames")); + for (const FString& item : FileNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + if (ProfileVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FAbortFileUploadsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FileNames"), FileNames); + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FAbortFileUploadsResponse::~FAbortFileUploadsResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::DataModels::FAbortFileUploadsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FAbortFileUploadsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FDeleteFilesRequest::~FDeleteFilesRequest() +{ + +} + +void PlayFab::DataModels::FDeleteFilesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteArrayStart(TEXT("FileNames")); + for (const FString& item : FileNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + if (ProfileVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FDeleteFilesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FileNames"), FileNames); + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FDeleteFilesResponse::~FDeleteFilesResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::DataModels::FDeleteFilesResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FDeleteFilesResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FFinalizeFileUploadsRequest::~FFinalizeFileUploadsRequest() +{ + +} + +void PlayFab::DataModels::FFinalizeFileUploadsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteArrayStart(TEXT("FileNames")); + for (const FString& item : FileNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FFinalizeFileUploadsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FileNames"), FileNames); + + return HasSucceeded; +} + +PlayFab::DataModels::FGetFileMetadata::~FGetFileMetadata() +{ + +} + +void PlayFab::DataModels::FGetFileMetadata::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Checksum.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Checksum")); writer->WriteValue(Checksum); } + + if (DownloadUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DownloadUrl")); writer->WriteValue(DownloadUrl); } + + if (FileName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FileName")); writer->WriteValue(FileName); } + + writer->WriteIdentifierPrefix(TEXT("LastModified")); writeDatetime(LastModified, writer); + + writer->WriteIdentifierPrefix(TEXT("Size")); writer->WriteValue(Size); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FGetFileMetadata::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ChecksumValue = obj->TryGetField(TEXT("Checksum")); + if (ChecksumValue.IsValid() && !ChecksumValue->IsNull()) + { + FString TmpValue; + if (ChecksumValue->TryGetString(TmpValue)) { Checksum = TmpValue; } + } + + const TSharedPtr DownloadUrlValue = obj->TryGetField(TEXT("DownloadUrl")); + if (DownloadUrlValue.IsValid() && !DownloadUrlValue->IsNull()) + { + FString TmpValue; + if (DownloadUrlValue->TryGetString(TmpValue)) { DownloadUrl = TmpValue; } + } + + const TSharedPtr FileNameValue = obj->TryGetField(TEXT("FileName")); + if (FileNameValue.IsValid() && !FileNameValue->IsNull()) + { + FString TmpValue; + if (FileNameValue->TryGetString(TmpValue)) { FileName = TmpValue; } + } + + const TSharedPtr LastModifiedValue = obj->TryGetField(TEXT("LastModified")); + if (LastModifiedValue.IsValid()) + LastModified = readDatetime(LastModifiedValue); + + + const TSharedPtr SizeValue = obj->TryGetField(TEXT("Size")); + if (SizeValue.IsValid() && !SizeValue->IsNull()) + { + int32 TmpValue; + if (SizeValue->TryGetNumber(TmpValue)) { Size = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FFinalizeFileUploadsResponse::~FFinalizeFileUploadsResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::DataModels::FFinalizeFileUploadsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + if (Metadata.Num() != 0) + { + writer->WriteObjectStart(TEXT("Metadata")); + for (TMap::TConstIterator It(Metadata); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FFinalizeFileUploadsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr* MetadataObject; + if (obj->TryGetObjectField(TEXT("Metadata"), MetadataObject)) + { + for (TMap>::TConstIterator It((*MetadataObject)->Values); It; ++It) + { + Metadata.Add(It.Key(), FGetFileMetadata(It.Value()->AsObject())); + } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FGetFilesRequest::~FGetFilesRequest() +{ + +} + +void PlayFab::DataModels::FGetFilesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FGetFilesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::DataModels::FGetFilesResponse::~FGetFilesResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::DataModels::FGetFilesResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + if (Metadata.Num() != 0) + { + writer->WriteObjectStart(TEXT("Metadata")); + for (TMap::TConstIterator It(Metadata); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FGetFilesResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr* MetadataObject; + if (obj->TryGetObjectField(TEXT("Metadata"), MetadataObject)) + { + for (TMap>::TConstIterator It((*MetadataObject)->Values); It; ++It) + { + Metadata.Add(It.Key(), FGetFileMetadata(It.Value()->AsObject())); + } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FGetObjectsRequest::~FGetObjectsRequest() +{ + +} + +void PlayFab::DataModels::FGetObjectsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + if (EscapeObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("EscapeObject")); writer->WriteValue(EscapeObject); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FGetObjectsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr EscapeObjectValue = obj->TryGetField(TEXT("EscapeObject")); + if (EscapeObjectValue.IsValid() && !EscapeObjectValue->IsNull()) + { + bool TmpValue; + if (EscapeObjectValue->TryGetBool(TmpValue)) { EscapeObject = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FObjectResult::~FObjectResult() +{ + +} + +void PlayFab::DataModels::FObjectResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DataObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("DataObject")); DataObject.writeJSON(writer); } + + if (EscapedDataObject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EscapedDataObject")); writer->WriteValue(EscapedDataObject); } + + if (ObjectName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ObjectName")); writer->WriteValue(ObjectName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FObjectResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataObjectValue = obj->TryGetField(TEXT("DataObject")); + if (DataObjectValue.IsValid() && !DataObjectValue->IsNull()) + { + DataObject = FJsonKeeper(DataObjectValue); + } + + const TSharedPtr EscapedDataObjectValue = obj->TryGetField(TEXT("EscapedDataObject")); + if (EscapedDataObjectValue.IsValid() && !EscapedDataObjectValue->IsNull()) + { + FString TmpValue; + if (EscapedDataObjectValue->TryGetString(TmpValue)) { EscapedDataObject = TmpValue; } + } + + const TSharedPtr ObjectNameValue = obj->TryGetField(TEXT("ObjectName")); + if (ObjectNameValue.IsValid() && !ObjectNameValue->IsNull()) + { + FString TmpValue; + if (ObjectNameValue->TryGetString(TmpValue)) { ObjectName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FGetObjectsResponse::~FGetObjectsResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::DataModels::FGetObjectsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + if (Objects.Num() != 0) + { + writer->WriteObjectStart(TEXT("Objects")); + for (TMap::TConstIterator It(Objects); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FGetObjectsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr* ObjectsObject; + if (obj->TryGetObjectField(TEXT("Objects"), ObjectsObject)) + { + for (TMap>::TConstIterator It((*ObjectsObject)->Values); It; ++It) + { + Objects.Add(It.Key(), FObjectResult(It.Value()->AsObject())); + } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FInitiateFileUploadMetadata::~FInitiateFileUploadMetadata() +{ + +} + +void PlayFab::DataModels::FInitiateFileUploadMetadata::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FileName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FileName")); writer->WriteValue(FileName); } + + if (UploadUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UploadUrl")); writer->WriteValue(UploadUrl); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FInitiateFileUploadMetadata::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FileNameValue = obj->TryGetField(TEXT("FileName")); + if (FileNameValue.IsValid() && !FileNameValue->IsNull()) + { + FString TmpValue; + if (FileNameValue->TryGetString(TmpValue)) { FileName = TmpValue; } + } + + const TSharedPtr UploadUrlValue = obj->TryGetField(TEXT("UploadUrl")); + if (UploadUrlValue.IsValid() && !UploadUrlValue->IsNull()) + { + FString TmpValue; + if (UploadUrlValue->TryGetString(TmpValue)) { UploadUrl = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FInitiateFileUploadsRequest::~FInitiateFileUploadsRequest() +{ + +} + +void PlayFab::DataModels::FInitiateFileUploadsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteArrayStart(TEXT("FileNames")); + for (const FString& item : FileNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + if (ProfileVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FInitiateFileUploadsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FileNames"), FileNames); + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FInitiateFileUploadsResponse::~FInitiateFileUploadsResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::DataModels::FInitiateFileUploadsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (UploadDetails.Num() != 0) + { + writer->WriteArrayStart(TEXT("UploadDetails")); + for (const FInitiateFileUploadMetadata& item : UploadDetails) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FInitiateFileUploadsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + const TArray>&UploadDetailsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("UploadDetails")); + for (int32 Idx = 0; Idx < UploadDetailsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = UploadDetailsArray[Idx]; + UploadDetails.Add(FInitiateFileUploadMetadata(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::DataModels::writeOperationTypesEnumJSON(OperationTypes enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case OperationTypesCreated: writer->WriteValue(TEXT("Created")); break; + case OperationTypesUpdated: writer->WriteValue(TEXT("Updated")); break; + case OperationTypesDeleted: writer->WriteValue(TEXT("Deleted")); break; + case OperationTypesNone: writer->WriteValue(TEXT("None")); break; + } +} + +DataModels::OperationTypes PlayFab::DataModels::readOperationTypesFromValue(const TSharedPtr& value) +{ + return readOperationTypesFromValue(value.IsValid() ? value->AsString() : ""); +} + +DataModels::OperationTypes PlayFab::DataModels::readOperationTypesFromValue(const FString& value) +{ + static TMap _OperationTypesMap; + if (_OperationTypesMap.Num() == 0) + { + // Auto-generate the map on the first use + _OperationTypesMap.Add(TEXT("Created"), OperationTypesCreated); + _OperationTypesMap.Add(TEXT("Updated"), OperationTypesUpdated); + _OperationTypesMap.Add(TEXT("Deleted"), OperationTypesDeleted); + _OperationTypesMap.Add(TEXT("None"), OperationTypesNone); + + } + + if (!value.IsEmpty()) + { + auto output = _OperationTypesMap.Find(value); + if (output != nullptr) + return *output; + } + + return OperationTypesCreated; // Basically critical fail +} + +PlayFab::DataModels::FSetObject::~FSetObject() +{ + +} + +void PlayFab::DataModels::FSetObject::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DataObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("DataObject")); DataObject.writeJSON(writer); } + + if (DeleteObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("DeleteObject")); writer->WriteValue(DeleteObject); } + + if (EscapedDataObject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EscapedDataObject")); writer->WriteValue(EscapedDataObject); } + + writer->WriteIdentifierPrefix(TEXT("ObjectName")); writer->WriteValue(ObjectName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FSetObject::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataObjectValue = obj->TryGetField(TEXT("DataObject")); + if (DataObjectValue.IsValid() && !DataObjectValue->IsNull()) + { + DataObject = FJsonKeeper(DataObjectValue); + } + + const TSharedPtr DeleteObjectValue = obj->TryGetField(TEXT("DeleteObject")); + if (DeleteObjectValue.IsValid() && !DeleteObjectValue->IsNull()) + { + bool TmpValue; + if (DeleteObjectValue->TryGetBool(TmpValue)) { DeleteObject = TmpValue; } + } + + const TSharedPtr EscapedDataObjectValue = obj->TryGetField(TEXT("EscapedDataObject")); + if (EscapedDataObjectValue.IsValid() && !EscapedDataObjectValue->IsNull()) + { + FString TmpValue; + if (EscapedDataObjectValue->TryGetString(TmpValue)) { EscapedDataObject = TmpValue; } + } + + const TSharedPtr ObjectNameValue = obj->TryGetField(TEXT("ObjectName")); + if (ObjectNameValue.IsValid() && !ObjectNameValue->IsNull()) + { + FString TmpValue; + if (ObjectNameValue->TryGetString(TmpValue)) { ObjectName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FSetObjectInfo::~FSetObjectInfo() +{ + +} + +void PlayFab::DataModels::FSetObjectInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ObjectName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ObjectName")); writer->WriteValue(ObjectName); } + + if (OperationReason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OperationReason")); writer->WriteValue(OperationReason); } + + if (SetResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("SetResult")); writeOperationTypesEnumJSON(SetResult, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FSetObjectInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ObjectNameValue = obj->TryGetField(TEXT("ObjectName")); + if (ObjectNameValue.IsValid() && !ObjectNameValue->IsNull()) + { + FString TmpValue; + if (ObjectNameValue->TryGetString(TmpValue)) { ObjectName = TmpValue; } + } + + const TSharedPtr OperationReasonValue = obj->TryGetField(TEXT("OperationReason")); + if (OperationReasonValue.IsValid() && !OperationReasonValue->IsNull()) + { + FString TmpValue; + if (OperationReasonValue->TryGetString(TmpValue)) { OperationReason = TmpValue; } + } + + SetResult = readOperationTypesFromValue(obj->TryGetField(TEXT("SetResult"))); + + return HasSucceeded; +} + +PlayFab::DataModels::FSetObjectsRequest::~FSetObjectsRequest() +{ + +} + +void PlayFab::DataModels::FSetObjectsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + if (ExpectedProfileVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("ExpectedProfileVersion")); writer->WriteValue(ExpectedProfileVersion); } + + writer->WriteArrayStart(TEXT("Objects")); + for (const FSetObject& item : Objects) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FSetObjectsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr ExpectedProfileVersionValue = obj->TryGetField(TEXT("ExpectedProfileVersion")); + if (ExpectedProfileVersionValue.IsValid() && !ExpectedProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ExpectedProfileVersionValue->TryGetNumber(TmpValue)) { ExpectedProfileVersion = TmpValue; } + } + + const TArray>&ObjectsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Objects")); + for (int32 Idx = 0; Idx < ObjectsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ObjectsArray[Idx]; + Objects.Add(FSetObject(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::DataModels::FSetObjectsResponse::~FSetObjectsResponse() +{ + +} + +void PlayFab::DataModels::FSetObjectsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (SetResults.Num() != 0) + { + writer->WriteArrayStart(TEXT("SetResults")); + for (const FSetObjectInfo& item : SetResults) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FSetObjectsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + const TArray>&SetResultsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("SetResults")); + for (int32 Idx = 0; Idx < SetResultsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SetResultsArray[Idx]; + SetResults.Add(FSetObjectInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabEventsAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabEventsAPI.cpp new file mode 100644 index 000000000..86c4825d5 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabEventsAPI.cpp @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabEventsAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::EventsModels; + +UPlayFabEventsAPI::UPlayFabEventsAPI() {} + +UPlayFabEventsAPI::~UPlayFabEventsAPI() {} + +int UPlayFabEventsAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabEventsAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabEventsAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabEventsAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabEventsAPI::WriteEvents( + EventsModels::FWriteEventsRequest& request, + const FWriteEventsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Event/WriteEvents")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabEventsAPI::OnWriteEventsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabEventsAPI::OnWriteEventsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteEventsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + EventsModels::FWriteEventsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabEventsDataModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabEventsDataModels.cpp new file mode 100644 index 000000000..61c9680f3 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabEventsDataModels.cpp @@ -0,0 +1,191 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabEventsDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::EventsModels; + +PlayFab::EventsModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::EventsModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::EventsModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::EventsModels::FEventContents::~FEventContents() +{ + +} + +void PlayFab::EventsModels::FEventContents::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("EventNamespace")); writer->WriteValue(EventNamespace); + + writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); + + if (OriginalId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OriginalId")); writer->WriteValue(OriginalId); } + + if (OriginalTimestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("OriginalTimestamp")); writeDatetime(OriginalTimestamp, writer); } + + if (Payload.notNull()) { writer->WriteIdentifierPrefix(TEXT("Payload")); Payload.writeJSON(writer); } + + if (PayloadJSON.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PayloadJSON")); writer->WriteValue(PayloadJSON); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::EventsModels::FEventContents::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr EventNamespaceValue = obj->TryGetField(TEXT("EventNamespace")); + if (EventNamespaceValue.IsValid() && !EventNamespaceValue->IsNull()) + { + FString TmpValue; + if (EventNamespaceValue->TryGetString(TmpValue)) { EventNamespace = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr OriginalIdValue = obj->TryGetField(TEXT("OriginalId")); + if (OriginalIdValue.IsValid() && !OriginalIdValue->IsNull()) + { + FString TmpValue; + if (OriginalIdValue->TryGetString(TmpValue)) { OriginalId = TmpValue; } + } + + const TSharedPtr OriginalTimestampValue = obj->TryGetField(TEXT("OriginalTimestamp")); + if (OriginalTimestampValue.IsValid()) + OriginalTimestamp = readDatetime(OriginalTimestampValue); + + + const TSharedPtr PayloadValue = obj->TryGetField(TEXT("Payload")); + if (PayloadValue.IsValid() && !PayloadValue->IsNull()) + { + Payload = FJsonKeeper(PayloadValue); + } + + const TSharedPtr PayloadJSONValue = obj->TryGetField(TEXT("PayloadJSON")); + if (PayloadJSONValue.IsValid() && !PayloadJSONValue->IsNull()) + { + FString TmpValue; + if (PayloadJSONValue->TryGetString(TmpValue)) { PayloadJSON = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::EventsModels::FWriteEventsRequest::~FWriteEventsRequest() +{ + +} + +void PlayFab::EventsModels::FWriteEventsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Events")); + for (const FEventContents& item : Events) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::EventsModels::FWriteEventsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&EventsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Events")); + for (int32 Idx = 0; Idx < EventsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = EventsArray[Idx]; + Events.Add(FEventContents(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::EventsModels::FWriteEventsResponse::~FWriteEventsResponse() +{ + +} + +void PlayFab::EventsModels::FWriteEventsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AssignedEventIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("AssignedEventIds")); + for (const FString& item : AssignedEventIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::EventsModels::FWriteEventsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("AssignedEventIds"), AssignedEventIds); + + return HasSucceeded; +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabGroupsAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabGroupsAPI.cpp new file mode 100644 index 000000000..4e63b376b --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabGroupsAPI.cpp @@ -0,0 +1,713 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabGroupsAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::GroupsModels; + +UPlayFabGroupsAPI::UPlayFabGroupsAPI() {} + +UPlayFabGroupsAPI::~UPlayFabGroupsAPI() {} + +int UPlayFabGroupsAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabGroupsAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabGroupsAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabGroupsAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabGroupsAPI::AcceptGroupApplication( + GroupsModels::FAcceptGroupApplicationRequest& request, + const FAcceptGroupApplicationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/AcceptGroupApplication")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnAcceptGroupApplicationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnAcceptGroupApplicationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAcceptGroupApplicationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::AcceptGroupInvitation( + GroupsModels::FAcceptGroupInvitationRequest& request, + const FAcceptGroupInvitationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/AcceptGroupInvitation")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnAcceptGroupInvitationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnAcceptGroupInvitationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAcceptGroupInvitationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::AddMembers( + GroupsModels::FAddMembersRequest& request, + const FAddMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/AddMembers")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnAddMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnAddMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ApplyToGroup( + GroupsModels::FApplyToGroupRequest& request, + const FApplyToGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ApplyToGroup")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnApplyToGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnApplyToGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FApplyToGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FApplyToGroupResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::BlockEntity( + GroupsModels::FBlockEntityRequest& request, + const FBlockEntityDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/BlockEntity")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnBlockEntityResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnBlockEntityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FBlockEntityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ChangeMemberRole( + GroupsModels::FChangeMemberRoleRequest& request, + const FChangeMemberRoleDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ChangeMemberRole")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnChangeMemberRoleResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnChangeMemberRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FChangeMemberRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::CreateGroup( + GroupsModels::FCreateGroupRequest& request, + const FCreateGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/CreateGroup")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnCreateGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnCreateGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FCreateGroupResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::CreateRole( + GroupsModels::FCreateGroupRoleRequest& request, + const FCreateRoleDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/CreateRole")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnCreateRoleResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnCreateRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FCreateGroupRoleResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::DeleteGroup( + GroupsModels::FDeleteGroupRequest& request, + const FDeleteGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/DeleteGroup")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnDeleteGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnDeleteGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::DeleteRole( + GroupsModels::FDeleteRoleRequest& request, + const FDeleteRoleDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/DeleteRole")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnDeleteRoleResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnDeleteRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::GetGroup( + GroupsModels::FGetGroupRequest& request, + const FGetGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/GetGroup")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnGetGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnGetGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FGetGroupResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::InviteToGroup( + GroupsModels::FInviteToGroupRequest& request, + const FInviteToGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/InviteToGroup")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnInviteToGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnInviteToGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FInviteToGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FInviteToGroupResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::IsMember( + GroupsModels::FIsMemberRequest& request, + const FIsMemberDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/IsMember")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnIsMemberResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnIsMemberResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FIsMemberDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FIsMemberResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ListGroupApplications( + GroupsModels::FListGroupApplicationsRequest& request, + const FListGroupApplicationsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ListGroupApplications")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnListGroupApplicationsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnListGroupApplicationsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupApplicationsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FListGroupApplicationsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ListGroupBlocks( + GroupsModels::FListGroupBlocksRequest& request, + const FListGroupBlocksDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ListGroupBlocks")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnListGroupBlocksResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnListGroupBlocksResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupBlocksDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FListGroupBlocksResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ListGroupInvitations( + GroupsModels::FListGroupInvitationsRequest& request, + const FListGroupInvitationsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ListGroupInvitations")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnListGroupInvitationsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnListGroupInvitationsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupInvitationsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FListGroupInvitationsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ListGroupMembers( + GroupsModels::FListGroupMembersRequest& request, + const FListGroupMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ListGroupMembers")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnListGroupMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnListGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FListGroupMembersResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ListMembership( + GroupsModels::FListMembershipRequest& request, + const FListMembershipDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ListMembership")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnListMembershipResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnListMembershipResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMembershipDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FListMembershipResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ListMembershipOpportunities( + GroupsModels::FListMembershipOpportunitiesRequest& request, + const FListMembershipOpportunitiesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ListMembershipOpportunities")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnListMembershipOpportunitiesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnListMembershipOpportunitiesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMembershipOpportunitiesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FListMembershipOpportunitiesResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::RemoveGroupApplication( + GroupsModels::FRemoveGroupApplicationRequest& request, + const FRemoveGroupApplicationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/RemoveGroupApplication")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnRemoveGroupApplicationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnRemoveGroupApplicationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveGroupApplicationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::RemoveGroupInvitation( + GroupsModels::FRemoveGroupInvitationRequest& request, + const FRemoveGroupInvitationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/RemoveGroupInvitation")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnRemoveGroupInvitationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnRemoveGroupInvitationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveGroupInvitationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::RemoveMembers( + GroupsModels::FRemoveMembersRequest& request, + const FRemoveMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/RemoveMembers")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnRemoveMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnRemoveMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::UnblockEntity( + GroupsModels::FUnblockEntityRequest& request, + const FUnblockEntityDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/UnblockEntity")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnUnblockEntityResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnUnblockEntityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnblockEntityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::UpdateGroup( + GroupsModels::FUpdateGroupRequest& request, + const FUpdateGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/UpdateGroup")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnUpdateGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnUpdateGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FUpdateGroupResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::UpdateRole( + GroupsModels::FUpdateGroupRoleRequest& request, + const FUpdateRoleDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/UpdateRole")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnUpdateRoleResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnUpdateRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FUpdateGroupRoleResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabGroupsDataModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabGroupsDataModels.cpp new file mode 100644 index 000000000..bf56e6c33 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabGroupsDataModels.cpp @@ -0,0 +1,2103 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabGroupsDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::GroupsModels; + +PlayFab::GroupsModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::GroupsModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FAcceptGroupApplicationRequest::~FAcceptGroupApplicationRequest() +{ + +} + +void PlayFab::GroupsModels::FAcceptGroupApplicationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FAcceptGroupApplicationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FAcceptGroupInvitationRequest::~FAcceptGroupInvitationRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::GroupsModels::FAcceptGroupInvitationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FAcceptGroupInvitationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FAddMembersRequest::~FAddMembersRequest() +{ + +} + +void PlayFab::GroupsModels::FAddMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteArrayStart(TEXT("Members")); + for (const FEntityKey& item : Members) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FAddMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TArray>&MembersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Members")); + for (int32 Idx = 0; Idx < MembersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembersArray[Idx]; + Members.Add(FEntityKey(CurrentItem->AsObject())); + } + + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FApplyToGroupRequest::~FApplyToGroupRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::GroupsModels::FApplyToGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AutoAcceptOutstandingInvite.notNull()) { writer->WriteIdentifierPrefix(TEXT("AutoAcceptOutstandingInvite")); writer->WriteValue(AutoAcceptOutstandingInvite); } + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FApplyToGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AutoAcceptOutstandingInviteValue = obj->TryGetField(TEXT("AutoAcceptOutstandingInvite")); + if (AutoAcceptOutstandingInviteValue.IsValid() && !AutoAcceptOutstandingInviteValue->IsNull()) + { + bool TmpValue; + if (AutoAcceptOutstandingInviteValue->TryGetBool(TmpValue)) { AutoAcceptOutstandingInvite = TmpValue; } + } + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FEntityWithLineage::~FEntityWithLineage() +{ + //if (Key != nullptr) delete Key; + +} + +void PlayFab::GroupsModels::FEntityWithLineage::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Key.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Key")); Key->writeJSON(writer); } + + if (Lineage.Num() != 0) + { + writer->WriteObjectStart(TEXT("Lineage")); + for (TMap::TConstIterator It(Lineage); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FEntityWithLineage::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + Key = MakeShareable(new FEntityKey(KeyValue->AsObject())); + } + + const TSharedPtr* LineageObject; + if (obj->TryGetObjectField(TEXT("Lineage"), LineageObject)) + { + for (TMap>::TConstIterator It((*LineageObject)->Values); It; ++It) + { + Lineage.Add(It.Key(), FEntityKey(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FApplyToGroupResponse::~FApplyToGroupResponse() +{ + //if (Entity != nullptr) delete Entity; + //if (Group != nullptr) delete Group; + +} + +void PlayFab::GroupsModels::FApplyToGroupResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); + + if (Group.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Group")); Group->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FApplyToGroupResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityWithLineage(EntityValue->AsObject())); + } + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = MakeShareable(new FEntityKey(GroupValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FBlockEntityRequest::~FBlockEntityRequest() +{ + +} + +void PlayFab::GroupsModels::FBlockEntityRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FBlockEntityRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FChangeMemberRoleRequest::~FChangeMemberRoleRequest() +{ + +} + +void PlayFab::GroupsModels::FChangeMemberRoleRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DestinationRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DestinationRoleId")); writer->WriteValue(DestinationRoleId); } + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteArrayStart(TEXT("Members")); + for (const FEntityKey& item : Members) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("OriginRoleId")); writer->WriteValue(OriginRoleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FChangeMemberRoleRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DestinationRoleIdValue = obj->TryGetField(TEXT("DestinationRoleId")); + if (DestinationRoleIdValue.IsValid() && !DestinationRoleIdValue->IsNull()) + { + FString TmpValue; + if (DestinationRoleIdValue->TryGetString(TmpValue)) { DestinationRoleId = TmpValue; } + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TArray>&MembersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Members")); + for (int32 Idx = 0; Idx < MembersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembersArray[Idx]; + Members.Add(FEntityKey(CurrentItem->AsObject())); + } + + + const TSharedPtr OriginRoleIdValue = obj->TryGetField(TEXT("OriginRoleId")); + if (OriginRoleIdValue.IsValid() && !OriginRoleIdValue->IsNull()) + { + FString TmpValue; + if (OriginRoleIdValue->TryGetString(TmpValue)) { OriginRoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FCreateGroupRequest::~FCreateGroupRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::GroupsModels::FCreateGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("GroupName")); writer->WriteValue(GroupName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FCreateGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr GroupNameValue = obj->TryGetField(TEXT("GroupName")); + if (GroupNameValue.IsValid() && !GroupNameValue->IsNull()) + { + FString TmpValue; + if (GroupNameValue->TryGetString(TmpValue)) { GroupName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FCreateGroupResponse::~FCreateGroupResponse() +{ + +} + +void PlayFab::GroupsModels::FCreateGroupResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdminRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AdminRoleId")); writer->WriteValue(AdminRoleId); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (GroupName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GroupName")); writer->WriteValue(GroupName); } + + if (MemberRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MemberRoleId")); writer->WriteValue(MemberRoleId); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (Roles.Num() != 0) + { + writer->WriteObjectStart(TEXT("Roles")); + for (TMap::TConstIterator It(Roles); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FCreateGroupResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AdminRoleIdValue = obj->TryGetField(TEXT("AdminRoleId")); + if (AdminRoleIdValue.IsValid() && !AdminRoleIdValue->IsNull()) + { + FString TmpValue; + if (AdminRoleIdValue->TryGetString(TmpValue)) { AdminRoleId = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr GroupNameValue = obj->TryGetField(TEXT("GroupName")); + if (GroupNameValue.IsValid() && !GroupNameValue->IsNull()) + { + FString TmpValue; + if (GroupNameValue->TryGetString(TmpValue)) { GroupName = TmpValue; } + } + + const TSharedPtr MemberRoleIdValue = obj->TryGetField(TEXT("MemberRoleId")); + if (MemberRoleIdValue.IsValid() && !MemberRoleIdValue->IsNull()) + { + FString TmpValue; + if (MemberRoleIdValue->TryGetString(TmpValue)) { MemberRoleId = TmpValue; } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + const TSharedPtr* RolesObject; + if (obj->TryGetObjectField(TEXT("Roles"), RolesObject)) + { + for (TMap>::TConstIterator It((*RolesObject)->Values); It; ++It) + { + Roles.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FCreateGroupRoleRequest::~FCreateGroupRoleRequest() +{ + +} + +void PlayFab::GroupsModels::FCreateGroupRoleRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); + + writer->WriteIdentifierPrefix(TEXT("RoleName")); writer->WriteValue(RoleName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FCreateGroupRoleRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + const TSharedPtr RoleNameValue = obj->TryGetField(TEXT("RoleName")); + if (RoleNameValue.IsValid() && !RoleNameValue->IsNull()) + { + FString TmpValue; + if (RoleNameValue->TryGetString(TmpValue)) { RoleName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FCreateGroupRoleResponse::~FCreateGroupRoleResponse() +{ + +} + +void PlayFab::GroupsModels::FCreateGroupRoleResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + if (RoleName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleName")); writer->WriteValue(RoleName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FCreateGroupRoleResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + const TSharedPtr RoleNameValue = obj->TryGetField(TEXT("RoleName")); + if (RoleNameValue.IsValid() && !RoleNameValue->IsNull()) + { + FString TmpValue; + if (RoleNameValue->TryGetString(TmpValue)) { RoleName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FDeleteGroupRequest::~FDeleteGroupRequest() +{ + +} + +void PlayFab::GroupsModels::FDeleteGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FDeleteGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FDeleteRoleRequest::~FDeleteRoleRequest() +{ + +} + +void PlayFab::GroupsModels::FDeleteRoleRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FDeleteRoleRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FEmptyResponse::~FEmptyResponse() +{ + +} + +void PlayFab::GroupsModels::FEmptyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FEmptyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::GroupsModels::FEntityMemberRole::~FEntityMemberRole() +{ + +} + +void PlayFab::GroupsModels::FEntityMemberRole::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Members.Num() != 0) + { + writer->WriteArrayStart(TEXT("Members")); + for (const FEntityWithLineage& item : Members) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + if (RoleName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleName")); writer->WriteValue(RoleName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FEntityMemberRole::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&MembersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Members")); + for (int32 Idx = 0; Idx < MembersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembersArray[Idx]; + Members.Add(FEntityWithLineage(CurrentItem->AsObject())); + } + + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + const TSharedPtr RoleNameValue = obj->TryGetField(TEXT("RoleName")); + if (RoleNameValue.IsValid() && !RoleNameValue->IsNull()) + { + FString TmpValue; + if (RoleNameValue->TryGetString(TmpValue)) { RoleName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGetGroupRequest::~FGetGroupRequest() +{ + //if (Group != nullptr) delete Group; + +} + +void PlayFab::GroupsModels::FGetGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Group.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Group")); Group->writeJSON(writer); } + + if (GroupName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GroupName")); writer->WriteValue(GroupName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGetGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = MakeShareable(new FEntityKey(GroupValue->AsObject())); + } + + const TSharedPtr GroupNameValue = obj->TryGetField(TEXT("GroupName")); + if (GroupNameValue.IsValid() && !GroupNameValue->IsNull()) + { + FString TmpValue; + if (GroupNameValue->TryGetString(TmpValue)) { GroupName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGetGroupResponse::~FGetGroupResponse() +{ + +} + +void PlayFab::GroupsModels::FGetGroupResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdminRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AdminRoleId")); writer->WriteValue(AdminRoleId); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (GroupName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GroupName")); writer->WriteValue(GroupName); } + + if (MemberRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MemberRoleId")); writer->WriteValue(MemberRoleId); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (Roles.Num() != 0) + { + writer->WriteObjectStart(TEXT("Roles")); + for (TMap::TConstIterator It(Roles); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGetGroupResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AdminRoleIdValue = obj->TryGetField(TEXT("AdminRoleId")); + if (AdminRoleIdValue.IsValid() && !AdminRoleIdValue->IsNull()) + { + FString TmpValue; + if (AdminRoleIdValue->TryGetString(TmpValue)) { AdminRoleId = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr GroupNameValue = obj->TryGetField(TEXT("GroupName")); + if (GroupNameValue.IsValid() && !GroupNameValue->IsNull()) + { + FString TmpValue; + if (GroupNameValue->TryGetString(TmpValue)) { GroupName = TmpValue; } + } + + const TSharedPtr MemberRoleIdValue = obj->TryGetField(TEXT("MemberRoleId")); + if (MemberRoleIdValue.IsValid() && !MemberRoleIdValue->IsNull()) + { + FString TmpValue; + if (MemberRoleIdValue->TryGetString(TmpValue)) { MemberRoleId = TmpValue; } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + const TSharedPtr* RolesObject; + if (obj->TryGetObjectField(TEXT("Roles"), RolesObject)) + { + for (TMap>::TConstIterator It((*RolesObject)->Values); It; ++It) + { + Roles.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGroupApplication::~FGroupApplication() +{ + //if (Entity != nullptr) delete Entity; + //if (Group != nullptr) delete Group; + +} + +void PlayFab::GroupsModels::FGroupApplication::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); + + if (Group.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Group")); Group->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGroupApplication::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityWithLineage(EntityValue->AsObject())); + } + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = MakeShareable(new FEntityKey(GroupValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGroupBlock::~FGroupBlock() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::GroupsModels::FGroupBlock::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGroupBlock::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityWithLineage(EntityValue->AsObject())); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGroupInvitation::~FGroupInvitation() +{ + //if (Group != nullptr) delete Group; + //if (InvitedByEntity != nullptr) delete InvitedByEntity; + //if (InvitedEntity != nullptr) delete InvitedEntity; + +} + +void PlayFab::GroupsModels::FGroupInvitation::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); + + if (Group.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Group")); Group->writeJSON(writer); } + + if (InvitedByEntity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InvitedByEntity")); InvitedByEntity->writeJSON(writer); } + + if (InvitedEntity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InvitedEntity")); InvitedEntity->writeJSON(writer); } + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGroupInvitation::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = MakeShareable(new FEntityKey(GroupValue->AsObject())); + } + + const TSharedPtr InvitedByEntityValue = obj->TryGetField(TEXT("InvitedByEntity")); + if (InvitedByEntityValue.IsValid() && !InvitedByEntityValue->IsNull()) + { + InvitedByEntity = MakeShareable(new FEntityWithLineage(InvitedByEntityValue->AsObject())); + } + + const TSharedPtr InvitedEntityValue = obj->TryGetField(TEXT("InvitedEntity")); + if (InvitedEntityValue.IsValid() && !InvitedEntityValue->IsNull()) + { + InvitedEntity = MakeShareable(new FEntityWithLineage(InvitedEntityValue->AsObject())); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGroupRole::~FGroupRole() +{ + +} + +void PlayFab::GroupsModels::FGroupRole::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + if (RoleName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleName")); writer->WriteValue(RoleName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGroupRole::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + const TSharedPtr RoleNameValue = obj->TryGetField(TEXT("RoleName")); + if (RoleNameValue.IsValid() && !RoleNameValue->IsNull()) + { + FString TmpValue; + if (RoleNameValue->TryGetString(TmpValue)) { RoleName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGroupWithRoles::~FGroupWithRoles() +{ + //if (Group != nullptr) delete Group; + +} + +void PlayFab::GroupsModels::FGroupWithRoles::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Group.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Group")); Group->writeJSON(writer); } + + if (GroupName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GroupName")); writer->WriteValue(GroupName); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (Roles.Num() != 0) + { + writer->WriteArrayStart(TEXT("Roles")); + for (const FGroupRole& item : Roles) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGroupWithRoles::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = MakeShareable(new FEntityKey(GroupValue->AsObject())); + } + + const TSharedPtr GroupNameValue = obj->TryGetField(TEXT("GroupName")); + if (GroupNameValue.IsValid() && !GroupNameValue->IsNull()) + { + FString TmpValue; + if (GroupNameValue->TryGetString(TmpValue)) { GroupName = TmpValue; } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + const TArray>&RolesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Roles")); + for (int32 Idx = 0; Idx < RolesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = RolesArray[Idx]; + Roles.Add(FGroupRole(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::GroupsModels::FInviteToGroupRequest::~FInviteToGroupRequest() +{ + +} + +void PlayFab::GroupsModels::FInviteToGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AutoAcceptOutstandingApplication.notNull()) { writer->WriteIdentifierPrefix(TEXT("AutoAcceptOutstandingApplication")); writer->WriteValue(AutoAcceptOutstandingApplication); } + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FInviteToGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AutoAcceptOutstandingApplicationValue = obj->TryGetField(TEXT("AutoAcceptOutstandingApplication")); + if (AutoAcceptOutstandingApplicationValue.IsValid() && !AutoAcceptOutstandingApplicationValue->IsNull()) + { + bool TmpValue; + if (AutoAcceptOutstandingApplicationValue->TryGetBool(TmpValue)) { AutoAcceptOutstandingApplication = TmpValue; } + } + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FInviteToGroupResponse::~FInviteToGroupResponse() +{ + //if (Group != nullptr) delete Group; + //if (InvitedByEntity != nullptr) delete InvitedByEntity; + //if (InvitedEntity != nullptr) delete InvitedEntity; + +} + +void PlayFab::GroupsModels::FInviteToGroupResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); + + if (Group.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Group")); Group->writeJSON(writer); } + + if (InvitedByEntity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InvitedByEntity")); InvitedByEntity->writeJSON(writer); } + + if (InvitedEntity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InvitedEntity")); InvitedEntity->writeJSON(writer); } + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FInviteToGroupResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = MakeShareable(new FEntityKey(GroupValue->AsObject())); + } + + const TSharedPtr InvitedByEntityValue = obj->TryGetField(TEXT("InvitedByEntity")); + if (InvitedByEntityValue.IsValid() && !InvitedByEntityValue->IsNull()) + { + InvitedByEntity = MakeShareable(new FEntityWithLineage(InvitedByEntityValue->AsObject())); + } + + const TSharedPtr InvitedEntityValue = obj->TryGetField(TEXT("InvitedEntity")); + if (InvitedEntityValue.IsValid() && !InvitedEntityValue->IsNull()) + { + InvitedEntity = MakeShareable(new FEntityWithLineage(InvitedEntityValue->AsObject())); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FIsMemberRequest::~FIsMemberRequest() +{ + +} + +void PlayFab::GroupsModels::FIsMemberRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FIsMemberRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FIsMemberResponse::~FIsMemberResponse() +{ + +} + +void PlayFab::GroupsModels::FIsMemberResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("IsMember")); writer->WriteValue(IsMember); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FIsMemberResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IsMemberValue = obj->TryGetField(TEXT("IsMember")); + if (IsMemberValue.IsValid() && !IsMemberValue->IsNull()) + { + bool TmpValue; + if (IsMemberValue->TryGetBool(TmpValue)) { IsMember = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupApplicationsRequest::~FListGroupApplicationsRequest() +{ + +} + +void PlayFab::GroupsModels::FListGroupApplicationsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupApplicationsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupApplicationsResponse::~FListGroupApplicationsResponse() +{ + +} + +void PlayFab::GroupsModels::FListGroupApplicationsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Applications.Num() != 0) + { + writer->WriteArrayStart(TEXT("Applications")); + for (const FGroupApplication& item : Applications) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupApplicationsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ApplicationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Applications")); + for (int32 Idx = 0; Idx < ApplicationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ApplicationsArray[Idx]; + Applications.Add(FGroupApplication(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupBlocksRequest::~FListGroupBlocksRequest() +{ + +} + +void PlayFab::GroupsModels::FListGroupBlocksRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupBlocksRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupBlocksResponse::~FListGroupBlocksResponse() +{ + +} + +void PlayFab::GroupsModels::FListGroupBlocksResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BlockedEntities.Num() != 0) + { + writer->WriteArrayStart(TEXT("BlockedEntities")); + for (const FGroupBlock& item : BlockedEntities) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupBlocksResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BlockedEntitiesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BlockedEntities")); + for (int32 Idx = 0; Idx < BlockedEntitiesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BlockedEntitiesArray[Idx]; + BlockedEntities.Add(FGroupBlock(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupInvitationsRequest::~FListGroupInvitationsRequest() +{ + +} + +void PlayFab::GroupsModels::FListGroupInvitationsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupInvitationsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupInvitationsResponse::~FListGroupInvitationsResponse() +{ + +} + +void PlayFab::GroupsModels::FListGroupInvitationsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Invitations.Num() != 0) + { + writer->WriteArrayStart(TEXT("Invitations")); + for (const FGroupInvitation& item : Invitations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupInvitationsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&InvitationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Invitations")); + for (int32 Idx = 0; Idx < InvitationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InvitationsArray[Idx]; + Invitations.Add(FGroupInvitation(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupMembersRequest::~FListGroupMembersRequest() +{ + +} + +void PlayFab::GroupsModels::FListGroupMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupMembersResponse::~FListGroupMembersResponse() +{ + +} + +void PlayFab::GroupsModels::FListGroupMembersResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Members.Num() != 0) + { + writer->WriteArrayStart(TEXT("Members")); + for (const FEntityMemberRole& item : Members) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupMembersResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&MembersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Members")); + for (int32 Idx = 0; Idx < MembersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembersArray[Idx]; + Members.Add(FEntityMemberRole(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListMembershipOpportunitiesRequest::~FListMembershipOpportunitiesRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::GroupsModels::FListMembershipOpportunitiesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListMembershipOpportunitiesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListMembershipOpportunitiesResponse::~FListMembershipOpportunitiesResponse() +{ + +} + +void PlayFab::GroupsModels::FListMembershipOpportunitiesResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Applications.Num() != 0) + { + writer->WriteArrayStart(TEXT("Applications")); + for (const FGroupApplication& item : Applications) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Invitations.Num() != 0) + { + writer->WriteArrayStart(TEXT("Invitations")); + for (const FGroupInvitation& item : Invitations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListMembershipOpportunitiesResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ApplicationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Applications")); + for (int32 Idx = 0; Idx < ApplicationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ApplicationsArray[Idx]; + Applications.Add(FGroupApplication(CurrentItem->AsObject())); + } + + + const TArray>&InvitationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Invitations")); + for (int32 Idx = 0; Idx < InvitationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InvitationsArray[Idx]; + Invitations.Add(FGroupInvitation(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListMembershipRequest::~FListMembershipRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::GroupsModels::FListMembershipRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListMembershipRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListMembershipResponse::~FListMembershipResponse() +{ + +} + +void PlayFab::GroupsModels::FListMembershipResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Groups.Num() != 0) + { + writer->WriteArrayStart(TEXT("Groups")); + for (const FGroupWithRoles& item : Groups) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListMembershipResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GroupsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Groups")); + for (int32 Idx = 0; Idx < GroupsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GroupsArray[Idx]; + Groups.Add(FGroupWithRoles(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::GroupsModels::writeOperationTypesEnumJSON(OperationTypes enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case OperationTypesCreated: writer->WriteValue(TEXT("Created")); break; + case OperationTypesUpdated: writer->WriteValue(TEXT("Updated")); break; + case OperationTypesDeleted: writer->WriteValue(TEXT("Deleted")); break; + case OperationTypesNone: writer->WriteValue(TEXT("None")); break; + } +} + +GroupsModels::OperationTypes PlayFab::GroupsModels::readOperationTypesFromValue(const TSharedPtr& value) +{ + return readOperationTypesFromValue(value.IsValid() ? value->AsString() : ""); +} + +GroupsModels::OperationTypes PlayFab::GroupsModels::readOperationTypesFromValue(const FString& value) +{ + static TMap _OperationTypesMap; + if (_OperationTypesMap.Num() == 0) + { + // Auto-generate the map on the first use + _OperationTypesMap.Add(TEXT("Created"), OperationTypesCreated); + _OperationTypesMap.Add(TEXT("Updated"), OperationTypesUpdated); + _OperationTypesMap.Add(TEXT("Deleted"), OperationTypesDeleted); + _OperationTypesMap.Add(TEXT("None"), OperationTypesNone); + + } + + if (!value.IsEmpty()) + { + auto output = _OperationTypesMap.Find(value); + if (output != nullptr) + return *output; + } + + return OperationTypesCreated; // Basically critical fail +} + +PlayFab::GroupsModels::FRemoveGroupApplicationRequest::~FRemoveGroupApplicationRequest() +{ + +} + +void PlayFab::GroupsModels::FRemoveGroupApplicationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FRemoveGroupApplicationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FRemoveGroupInvitationRequest::~FRemoveGroupInvitationRequest() +{ + +} + +void PlayFab::GroupsModels::FRemoveGroupInvitationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FRemoveGroupInvitationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FRemoveMembersRequest::~FRemoveMembersRequest() +{ + +} + +void PlayFab::GroupsModels::FRemoveMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteArrayStart(TEXT("Members")); + for (const FEntityKey& item : Members) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FRemoveMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TArray>&MembersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Members")); + for (int32 Idx = 0; Idx < MembersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembersArray[Idx]; + Members.Add(FEntityKey(CurrentItem->AsObject())); + } + + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FUnblockEntityRequest::~FUnblockEntityRequest() +{ + +} + +void PlayFab::GroupsModels::FUnblockEntityRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FUnblockEntityRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FUpdateGroupRequest::~FUpdateGroupRequest() +{ + +} + +void PlayFab::GroupsModels::FUpdateGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdminRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AdminRoleId")); writer->WriteValue(AdminRoleId); } + + if (ExpectedProfileVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("ExpectedProfileVersion")); writer->WriteValue(ExpectedProfileVersion); } + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (GroupName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GroupName")); writer->WriteValue(GroupName); } + + if (MemberRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MemberRoleId")); writer->WriteValue(MemberRoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FUpdateGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AdminRoleIdValue = obj->TryGetField(TEXT("AdminRoleId")); + if (AdminRoleIdValue.IsValid() && !AdminRoleIdValue->IsNull()) + { + FString TmpValue; + if (AdminRoleIdValue->TryGetString(TmpValue)) { AdminRoleId = TmpValue; } + } + + const TSharedPtr ExpectedProfileVersionValue = obj->TryGetField(TEXT("ExpectedProfileVersion")); + if (ExpectedProfileVersionValue.IsValid() && !ExpectedProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ExpectedProfileVersionValue->TryGetNumber(TmpValue)) { ExpectedProfileVersion = TmpValue; } + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr GroupNameValue = obj->TryGetField(TEXT("GroupName")); + if (GroupNameValue.IsValid() && !GroupNameValue->IsNull()) + { + FString TmpValue; + if (GroupNameValue->TryGetString(TmpValue)) { GroupName = TmpValue; } + } + + const TSharedPtr MemberRoleIdValue = obj->TryGetField(TEXT("MemberRoleId")); + if (MemberRoleIdValue.IsValid() && !MemberRoleIdValue->IsNull()) + { + FString TmpValue; + if (MemberRoleIdValue->TryGetString(TmpValue)) { MemberRoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FUpdateGroupResponse::~FUpdateGroupResponse() +{ + +} + +void PlayFab::GroupsModels::FUpdateGroupResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (OperationReason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OperationReason")); writer->WriteValue(OperationReason); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (SetResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("SetResult")); writeOperationTypesEnumJSON(SetResult, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FUpdateGroupResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OperationReasonValue = obj->TryGetField(TEXT("OperationReason")); + if (OperationReasonValue.IsValid() && !OperationReasonValue->IsNull()) + { + FString TmpValue; + if (OperationReasonValue->TryGetString(TmpValue)) { OperationReason = TmpValue; } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + SetResult = readOperationTypesFromValue(obj->TryGetField(TEXT("SetResult"))); + + return HasSucceeded; +} + +PlayFab::GroupsModels::FUpdateGroupRoleRequest::~FUpdateGroupRoleRequest() +{ + +} + +void PlayFab::GroupsModels::FUpdateGroupRoleRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ExpectedProfileVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("ExpectedProfileVersion")); writer->WriteValue(ExpectedProfileVersion); } + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteIdentifierPrefix(TEXT("RoleName")); writer->WriteValue(RoleName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FUpdateGroupRoleRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpectedProfileVersionValue = obj->TryGetField(TEXT("ExpectedProfileVersion")); + if (ExpectedProfileVersionValue.IsValid() && !ExpectedProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ExpectedProfileVersionValue->TryGetNumber(TmpValue)) { ExpectedProfileVersion = TmpValue; } + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + const TSharedPtr RoleNameValue = obj->TryGetField(TEXT("RoleName")); + if (RoleNameValue.IsValid() && !RoleNameValue->IsNull()) + { + FString TmpValue; + if (RoleNameValue->TryGetString(TmpValue)) { RoleName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FUpdateGroupRoleResponse::~FUpdateGroupRoleResponse() +{ + +} + +void PlayFab::GroupsModels::FUpdateGroupRoleResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (OperationReason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OperationReason")); writer->WriteValue(OperationReason); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (SetResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("SetResult")); writeOperationTypesEnumJSON(SetResult, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FUpdateGroupRoleResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OperationReasonValue = obj->TryGetField(TEXT("OperationReason")); + if (OperationReasonValue.IsValid() && !OperationReasonValue->IsNull()) + { + FString TmpValue; + if (OperationReasonValue->TryGetString(TmpValue)) { OperationReason = TmpValue; } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + SetResult = readOperationTypesFromValue(obj->TryGetField(TEXT("SetResult"))); + + return HasSucceeded; +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabJsonHelpers.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabJsonHelpers.cpp new file mode 100644 index 000000000..037b1dcb0 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabJsonHelpers.cpp @@ -0,0 +1,139 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFabJsonHelpers.h" +#include "Json.h" + +using namespace PlayFab; + +static TArray< TSharedPtr > EmptyArray; + +const TArray< TSharedPtr >& FPlayFabJsonHelpers::ReadArray(TSharedPtr Item, const FString& Key) +{ + if (Item->HasTypedField(Key)) + { + return Item->GetArrayField(Key); + } + return EmptyArray; +} + + +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const bool Value) +// { +// writer->WriteValue(Identifier, Value); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const double Value) +// { +// writer->WriteValue(Identifier, Value); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const int32 Value) +// { +// writer->WriteValue(Identifier, Value); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const uint32 Value) +// { +// writer->WriteValue(Identifier, static_cast(Value)); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const int64 Value) +// { +// writer->WriteValue(Identifier, Value); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const uint64 Value) +// { +// writer->WriteValue(Identifier, Value); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const FString& Value) +// { +// writer->WriteValue(Identifier, Value); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const TCHAR* Value) +// { +// writer->WriteValue(Identifier, Value); +// } + +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const time_t Value) +// { +// +// } + +bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, double& OutNumber) +{ + return obj->TryGetNumberField(FieldName, OutNumber); +} + +bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, int32& OutNumber) +{ + return obj->TryGetNumberField(FieldName, OutNumber); +} + +bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, uint32& OutNumber) +{ + return obj->TryGetNumberField(FieldName, OutNumber); +} + +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalBool& OutNumber) +// { +// bool tmp; +// if (obj->TryGetBoolField(FieldName, tmp)) +// { +// OutNumber = tmp; +// } +// return true; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalUint16& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalInt16& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalUint32& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalInt32& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalUint64& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalInt64& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalFloat& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalDouble& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalTime& OutNumber) +// { +// return false; +// } + + + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabLocalizationAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabLocalizationAPI.cpp new file mode 100644 index 000000000..e1060545e --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabLocalizationAPI.cpp @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabLocalizationAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::LocalizationModels; + +UPlayFabLocalizationAPI::UPlayFabLocalizationAPI() {} + +UPlayFabLocalizationAPI::~UPlayFabLocalizationAPI() {} + +int UPlayFabLocalizationAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabLocalizationAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabLocalizationAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabLocalizationAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabLocalizationAPI::GetLanguageList( + + const FGetLanguageListDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Locale/GetLanguageList")), TEXT("{}"), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabLocalizationAPI::OnGetLanguageListResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabLocalizationAPI::OnGetLanguageListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLanguageListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + LocalizationModels::FGetLanguageListResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabLocalizationDataModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabLocalizationDataModels.cpp new file mode 100644 index 000000000..2c773d7c2 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabLocalizationDataModels.cpp @@ -0,0 +1,62 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabLocalizationDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::LocalizationModels; + +PlayFab::LocalizationModels::FGetLanguageListRequest::~FGetLanguageListRequest() +{ + +} + +void PlayFab::LocalizationModels::FGetLanguageListRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::LocalizationModels::FGetLanguageListRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::LocalizationModels::FGetLanguageListResponse::~FGetLanguageListResponse() +{ + +} + +void PlayFab::LocalizationModels::FGetLanguageListResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (LanguageList.Num() != 0) + { + writer->WriteArrayStart(TEXT("LanguageList")); + for (const FString& item : LanguageList) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::LocalizationModels::FGetLanguageListResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("LanguageList"), LanguageList); + + return HasSucceeded; +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabMatchmakerAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabMatchmakerAPI.cpp new file mode 100644 index 000000000..23abe4731 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabMatchmakerAPI.cpp @@ -0,0 +1,173 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabMatchmakerAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::MatchmakerModels; + +UPlayFabMatchmakerAPI::UPlayFabMatchmakerAPI() {} + +UPlayFabMatchmakerAPI::~UPlayFabMatchmakerAPI() {} + +int UPlayFabMatchmakerAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabMatchmakerAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabMatchmakerAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabMatchmakerAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabMatchmakerAPI::AuthUser( + MatchmakerModels::FAuthUserRequest& request, + const FAuthUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Matchmaker/AuthUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabMatchmakerAPI::OnAuthUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabMatchmakerAPI::OnAuthUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAuthUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + MatchmakerModels::FAuthUserResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabMatchmakerAPI::PlayerJoined( + MatchmakerModels::FPlayerJoinedRequest& request, + const FPlayerJoinedDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Matchmaker/PlayerJoined")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabMatchmakerAPI::OnPlayerJoinedResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabMatchmakerAPI::OnPlayerJoinedResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPlayerJoinedDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + MatchmakerModels::FPlayerJoinedResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabMatchmakerAPI::PlayerLeft( + MatchmakerModels::FPlayerLeftRequest& request, + const FPlayerLeftDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Matchmaker/PlayerLeft")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabMatchmakerAPI::OnPlayerLeftResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabMatchmakerAPI::OnPlayerLeftResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPlayerLeftDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + MatchmakerModels::FPlayerLeftResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabMatchmakerAPI::StartGame( + MatchmakerModels::FStartGameRequest& request, + const FStartGameDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Matchmaker/StartGame")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabMatchmakerAPI::OnStartGameResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabMatchmakerAPI::OnStartGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FStartGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + MatchmakerModels::FStartGameResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabMatchmakerAPI::UserInfo( + MatchmakerModels::FUserInfoRequest& request, + const FUserInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Matchmaker/UserInfo")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabMatchmakerAPI::OnUserInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabMatchmakerAPI::OnUserInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUserInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + MatchmakerModels::FUserInfoResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabMatchmakerDataModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabMatchmakerDataModels.cpp new file mode 100644 index 000000000..5358efc97 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabMatchmakerDataModels.cpp @@ -0,0 +1,734 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabMatchmakerDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::MatchmakerModels; + +PlayFab::MatchmakerModels::FAuthUserRequest::~FAuthUserRequest() +{ + +} + +void PlayFab::MatchmakerModels::FAuthUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AuthorizationTicket")); writer->WriteValue(AuthorizationTicket); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FAuthUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AuthorizationTicketValue = obj->TryGetField(TEXT("AuthorizationTicket")); + if (AuthorizationTicketValue.IsValid() && !AuthorizationTicketValue->IsNull()) + { + FString TmpValue; + if (AuthorizationTicketValue->TryGetString(TmpValue)) { AuthorizationTicket = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FAuthUserResponse::~FAuthUserResponse() +{ + +} + +void PlayFab::MatchmakerModels::FAuthUserResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Authorized")); writer->WriteValue(Authorized); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FAuthUserResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AuthorizedValue = obj->TryGetField(TEXT("Authorized")); + if (AuthorizedValue.IsValid() && !AuthorizedValue->IsNull()) + { + bool TmpValue; + if (AuthorizedValue->TryGetBool(TmpValue)) { Authorized = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FItemInstance::~FItemInstance() +{ + +} + +void PlayFab::MatchmakerModels::FItemInstance::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (BundleContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundleContents")); + for (const FString& item : BundleContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundleParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BundleParent")); writer->WriteValue(BundleParent); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CustomData.Num() != 0) + { + writer->WriteObjectStart(TEXT("CustomData")); + for (TMap::TConstIterator It(CustomData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Expiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (PurchaseDate.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); } + + if (RemainingUses.notNull()) { writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); } + + if (UnitCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnitCurrency")); writer->WriteValue(UnitCurrency); } + + writer->WriteIdentifierPrefix(TEXT("UnitPrice")); writer->WriteValue(static_cast(UnitPrice)); + + if (UsesIncrementedBy.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsesIncrementedBy")); writer->WriteValue(UsesIncrementedBy); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FItemInstance::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("BundleContents"), BundleContents); + + const TSharedPtr BundleParentValue = obj->TryGetField(TEXT("BundleParent")); + if (BundleParentValue.IsValid() && !BundleParentValue->IsNull()) + { + FString TmpValue; + if (BundleParentValue->TryGetString(TmpValue)) { BundleParent = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr* CustomDataObject; + if (obj->TryGetObjectField(TEXT("CustomData"), CustomDataObject)) + { + for (TMap>::TConstIterator It((*CustomDataObject)->Values); It; ++It) + { + CustomData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + const TSharedPtr UnitCurrencyValue = obj->TryGetField(TEXT("UnitCurrency")); + if (UnitCurrencyValue.IsValid() && !UnitCurrencyValue->IsNull()) + { + FString TmpValue; + if (UnitCurrencyValue->TryGetString(TmpValue)) { UnitCurrency = TmpValue; } + } + + const TSharedPtr UnitPriceValue = obj->TryGetField(TEXT("UnitPrice")); + if (UnitPriceValue.IsValid() && !UnitPriceValue->IsNull()) + { + uint32 TmpValue; + if (UnitPriceValue->TryGetNumber(TmpValue)) { UnitPrice = TmpValue; } + } + + const TSharedPtr UsesIncrementedByValue = obj->TryGetField(TEXT("UsesIncrementedBy")); + if (UsesIncrementedByValue.IsValid() && !UsesIncrementedByValue->IsNull()) + { + int32 TmpValue; + if (UsesIncrementedByValue->TryGetNumber(TmpValue)) { UsesIncrementedBy = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FPlayerJoinedRequest::~FPlayerJoinedRequest() +{ + +} + +void PlayFab::MatchmakerModels::FPlayerJoinedRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FPlayerJoinedRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FPlayerJoinedResponse::~FPlayerJoinedResponse() +{ + +} + +void PlayFab::MatchmakerModels::FPlayerJoinedResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FPlayerJoinedResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FPlayerLeftRequest::~FPlayerLeftRequest() +{ + +} + +void PlayFab::MatchmakerModels::FPlayerLeftRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FPlayerLeftRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FPlayerLeftResponse::~FPlayerLeftResponse() +{ + +} + +void PlayFab::MatchmakerModels::FPlayerLeftResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FPlayerLeftResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +void PlayFab::MatchmakerModels::writeRegionEnumJSON(Region enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case RegionUSCentral: writer->WriteValue(TEXT("USCentral")); break; + case RegionUSEast: writer->WriteValue(TEXT("USEast")); break; + case RegionEUWest: writer->WriteValue(TEXT("EUWest")); break; + case RegionSingapore: writer->WriteValue(TEXT("Singapore")); break; + case RegionJapan: writer->WriteValue(TEXT("Japan")); break; + case RegionBrazil: writer->WriteValue(TEXT("Brazil")); break; + case RegionAustralia: writer->WriteValue(TEXT("Australia")); break; + } +} + +MatchmakerModels::Region PlayFab::MatchmakerModels::readRegionFromValue(const TSharedPtr& value) +{ + return readRegionFromValue(value.IsValid() ? value->AsString() : ""); +} + +MatchmakerModels::Region PlayFab::MatchmakerModels::readRegionFromValue(const FString& value) +{ + static TMap _RegionMap; + if (_RegionMap.Num() == 0) + { + // Auto-generate the map on the first use + _RegionMap.Add(TEXT("USCentral"), RegionUSCentral); + _RegionMap.Add(TEXT("USEast"), RegionUSEast); + _RegionMap.Add(TEXT("EUWest"), RegionEUWest); + _RegionMap.Add(TEXT("Singapore"), RegionSingapore); + _RegionMap.Add(TEXT("Japan"), RegionJapan); + _RegionMap.Add(TEXT("Brazil"), RegionBrazil); + _RegionMap.Add(TEXT("Australia"), RegionAustralia); + + } + + if (!value.IsEmpty()) + { + auto output = _RegionMap.Find(value); + if (output != nullptr) + return *output; + } + + return RegionUSCentral; // Basically critical fail +} + +PlayFab::MatchmakerModels::FStartGameRequest::~FStartGameRequest() +{ + +} + +void PlayFab::MatchmakerModels::FStartGameRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Build")); writer->WriteValue(Build); + + if (CustomCommandLineData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomCommandLineData")); writer->WriteValue(CustomCommandLineData); } + + writer->WriteIdentifierPrefix(TEXT("ExternalMatchmakerEventEndpoint")); writer->WriteValue(ExternalMatchmakerEventEndpoint); + + writer->WriteIdentifierPrefix(TEXT("GameMode")); writer->WriteValue(GameMode); + + writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FStartGameRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildValue = obj->TryGetField(TEXT("Build")); + if (BuildValue.IsValid() && !BuildValue->IsNull()) + { + FString TmpValue; + if (BuildValue->TryGetString(TmpValue)) { Build = TmpValue; } + } + + const TSharedPtr CustomCommandLineDataValue = obj->TryGetField(TEXT("CustomCommandLineData")); + if (CustomCommandLineDataValue.IsValid() && !CustomCommandLineDataValue->IsNull()) + { + FString TmpValue; + if (CustomCommandLineDataValue->TryGetString(TmpValue)) { CustomCommandLineData = TmpValue; } + } + + const TSharedPtr ExternalMatchmakerEventEndpointValue = obj->TryGetField(TEXT("ExternalMatchmakerEventEndpoint")); + if (ExternalMatchmakerEventEndpointValue.IsValid() && !ExternalMatchmakerEventEndpointValue->IsNull()) + { + FString TmpValue; + if (ExternalMatchmakerEventEndpointValue->TryGetString(TmpValue)) { ExternalMatchmakerEventEndpoint = TmpValue; } + } + + const TSharedPtr GameModeValue = obj->TryGetField(TEXT("GameMode")); + if (GameModeValue.IsValid() && !GameModeValue->IsNull()) + { + FString TmpValue; + if (GameModeValue->TryGetString(TmpValue)) { GameMode = TmpValue; } + } + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FStartGameResponse::~FStartGameResponse() +{ + +} + +void PlayFab::MatchmakerModels::FStartGameResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GameID.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameID")); writer->WriteValue(GameID); } + + if (ServerHostname.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerHostname")); writer->WriteValue(ServerHostname); } + + if (ServerIPV4Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV4Address")); writer->WriteValue(ServerIPV4Address); } + + if (ServerIPV6Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV6Address")); writer->WriteValue(ServerIPV6Address); } + + writer->WriteIdentifierPrefix(TEXT("ServerPort")); writer->WriteValue(static_cast(ServerPort)); + + if (ServerPublicDNSName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerPublicDNSName")); writer->WriteValue(ServerPublicDNSName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FStartGameResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameIDValue = obj->TryGetField(TEXT("GameID")); + if (GameIDValue.IsValid() && !GameIDValue->IsNull()) + { + FString TmpValue; + if (GameIDValue->TryGetString(TmpValue)) { GameID = TmpValue; } + } + + const TSharedPtr ServerHostnameValue = obj->TryGetField(TEXT("ServerHostname")); + if (ServerHostnameValue.IsValid() && !ServerHostnameValue->IsNull()) + { + FString TmpValue; + if (ServerHostnameValue->TryGetString(TmpValue)) { ServerHostname = TmpValue; } + } + + const TSharedPtr ServerIPV4AddressValue = obj->TryGetField(TEXT("ServerIPV4Address")); + if (ServerIPV4AddressValue.IsValid() && !ServerIPV4AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV4AddressValue->TryGetString(TmpValue)) { ServerIPV4Address = TmpValue; } + } + + const TSharedPtr ServerIPV6AddressValue = obj->TryGetField(TEXT("ServerIPV6Address")); + if (ServerIPV6AddressValue.IsValid() && !ServerIPV6AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV6AddressValue->TryGetString(TmpValue)) { ServerIPV6Address = TmpValue; } + } + + const TSharedPtr ServerPortValue = obj->TryGetField(TEXT("ServerPort")); + if (ServerPortValue.IsValid() && !ServerPortValue->IsNull()) + { + uint32 TmpValue; + if (ServerPortValue->TryGetNumber(TmpValue)) { ServerPort = TmpValue; } + } + + const TSharedPtr ServerPublicDNSNameValue = obj->TryGetField(TEXT("ServerPublicDNSName")); + if (ServerPublicDNSNameValue.IsValid() && !ServerPublicDNSNameValue->IsNull()) + { + FString TmpValue; + if (ServerPublicDNSNameValue->TryGetString(TmpValue)) { ServerPublicDNSName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FUserInfoRequest::~FUserInfoRequest() +{ + +} + +void PlayFab::MatchmakerModels::FUserInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("MinCatalogVersion")); writer->WriteValue(MinCatalogVersion); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FUserInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MinCatalogVersionValue = obj->TryGetField(TEXT("MinCatalogVersion")); + if (MinCatalogVersionValue.IsValid() && !MinCatalogVersionValue->IsNull()) + { + int32 TmpValue; + if (MinCatalogVersionValue->TryGetNumber(TmpValue)) { MinCatalogVersion = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FVirtualCurrencyRechargeTime::~FVirtualCurrencyRechargeTime() +{ + +} + +void PlayFab::MatchmakerModels::FVirtualCurrencyRechargeTime::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("RechargeMax")); writer->WriteValue(RechargeMax); + + writer->WriteIdentifierPrefix(TEXT("RechargeTime")); writeDatetime(RechargeTime, writer); + + writer->WriteIdentifierPrefix(TEXT("SecondsToRecharge")); writer->WriteValue(SecondsToRecharge); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FVirtualCurrencyRechargeTime::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RechargeMaxValue = obj->TryGetField(TEXT("RechargeMax")); + if (RechargeMaxValue.IsValid() && !RechargeMaxValue->IsNull()) + { + int32 TmpValue; + if (RechargeMaxValue->TryGetNumber(TmpValue)) { RechargeMax = TmpValue; } + } + + const TSharedPtr RechargeTimeValue = obj->TryGetField(TEXT("RechargeTime")); + if (RechargeTimeValue.IsValid()) + RechargeTime = readDatetime(RechargeTimeValue); + + + const TSharedPtr SecondsToRechargeValue = obj->TryGetField(TEXT("SecondsToRecharge")); + if (SecondsToRechargeValue.IsValid() && !SecondsToRechargeValue->IsNull()) + { + int32 TmpValue; + if (SecondsToRechargeValue->TryGetNumber(TmpValue)) { SecondsToRecharge = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FUserInfoResponse::~FUserInfoResponse() +{ + +} + +void PlayFab::MatchmakerModels::FUserInfoResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("IsDeveloper")); writer->WriteValue(IsDeveloper); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (SteamId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamId")); writer->WriteValue(SteamId); } + + if (TitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleDisplayName")); writer->WriteValue(TitleDisplayName); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(VirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FUserInfoResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr IsDeveloperValue = obj->TryGetField(TEXT("IsDeveloper")); + if (IsDeveloperValue.IsValid() && !IsDeveloperValue->IsNull()) + { + bool TmpValue; + if (IsDeveloperValue->TryGetBool(TmpValue)) { IsDeveloper = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr SteamIdValue = obj->TryGetField(TEXT("SteamId")); + if (SteamIdValue.IsValid() && !SteamIdValue->IsNull()) + { + FString TmpValue; + if (SteamIdValue->TryGetString(TmpValue)) { SteamId = TmpValue; } + } + + const TSharedPtr TitleDisplayNameValue = obj->TryGetField(TEXT("TitleDisplayName")); + if (TitleDisplayNameValue.IsValid() && !TitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (TitleDisplayNameValue->TryGetString(TmpValue)) { TitleDisplayName = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyRechargeTimes"), VirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + VirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabProfilesAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabProfilesAPI.cpp new file mode 100644 index 000000000..e4607aba6 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabProfilesAPI.cpp @@ -0,0 +1,200 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabProfilesAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::ProfilesModels; + +UPlayFabProfilesAPI::UPlayFabProfilesAPI() {} + +UPlayFabProfilesAPI::~UPlayFabProfilesAPI() {} + +int UPlayFabProfilesAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabProfilesAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabProfilesAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabProfilesAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabProfilesAPI::GetGlobalPolicy( + + const FGetGlobalPolicyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Profile/GetGlobalPolicy")), TEXT("{}"), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabProfilesAPI::OnGetGlobalPolicyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::OnGetGlobalPolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetGlobalPolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ProfilesModels::FGetGlobalPolicyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabProfilesAPI::GetProfile( + ProfilesModels::FGetEntityProfileRequest& request, + const FGetProfileDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Profile/GetProfile")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabProfilesAPI::OnGetProfileResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::OnGetProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ProfilesModels::FGetEntityProfileResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabProfilesAPI::GetProfiles( + ProfilesModels::FGetEntityProfilesRequest& request, + const FGetProfilesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Profile/GetProfiles")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabProfilesAPI::OnGetProfilesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::OnGetProfilesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetProfilesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ProfilesModels::FGetEntityProfilesResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabProfilesAPI::SetGlobalPolicy( + ProfilesModels::FSetGlobalPolicyRequest& request, + const FSetGlobalPolicyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Profile/SetGlobalPolicy")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabProfilesAPI::OnSetGlobalPolicyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::OnSetGlobalPolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGlobalPolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ProfilesModels::FSetGlobalPolicyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabProfilesAPI::SetProfileLanguage( + ProfilesModels::FSetProfileLanguageRequest& request, + const FSetProfileLanguageDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Profile/SetProfileLanguage")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabProfilesAPI::OnSetProfileLanguageResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::OnSetProfileLanguageResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetProfileLanguageDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ProfilesModels::FSetProfileLanguageResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabProfilesAPI::SetProfilePolicy( + ProfilesModels::FSetEntityProfilePolicyRequest& request, + const FSetProfilePolicyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Profile/SetProfilePolicy")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabProfilesAPI::OnSetProfilePolicyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::OnSetProfilePolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetProfilePolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ProfilesModels::FSetEntityProfilePolicyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabProfilesDataModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabProfilesDataModels.cpp new file mode 100644 index 000000000..8c04052a6 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabProfilesDataModels.cpp @@ -0,0 +1,812 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabProfilesDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::ProfilesModels; + +void PlayFab::ProfilesModels::writeEffectTypeEnumJSON(EffectType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case EffectTypeAllow: writer->WriteValue(TEXT("Allow")); break; + case EffectTypeDeny: writer->WriteValue(TEXT("Deny")); break; + } +} + +ProfilesModels::EffectType PlayFab::ProfilesModels::readEffectTypeFromValue(const TSharedPtr& value) +{ + return readEffectTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ProfilesModels::EffectType PlayFab::ProfilesModels::readEffectTypeFromValue(const FString& value) +{ + static TMap _EffectTypeMap; + if (_EffectTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _EffectTypeMap.Add(TEXT("Allow"), EffectTypeAllow); + _EffectTypeMap.Add(TEXT("Deny"), EffectTypeDeny); + + } + + if (!value.IsEmpty()) + { + auto output = _EffectTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return EffectTypeAllow; // Basically critical fail +} + +PlayFab::ProfilesModels::FEntityDataObject::~FEntityDataObject() +{ + +} + +void PlayFab::ProfilesModels::FEntityDataObject::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DataObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("DataObject")); DataObject.writeJSON(writer); } + + if (EscapedDataObject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EscapedDataObject")); writer->WriteValue(EscapedDataObject); } + + if (ObjectName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ObjectName")); writer->WriteValue(ObjectName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FEntityDataObject::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataObjectValue = obj->TryGetField(TEXT("DataObject")); + if (DataObjectValue.IsValid() && !DataObjectValue->IsNull()) + { + DataObject = FJsonKeeper(DataObjectValue); + } + + const TSharedPtr EscapedDataObjectValue = obj->TryGetField(TEXT("EscapedDataObject")); + if (EscapedDataObjectValue.IsValid() && !EscapedDataObjectValue->IsNull()) + { + FString TmpValue; + if (EscapedDataObjectValue->TryGetString(TmpValue)) { EscapedDataObject = TmpValue; } + } + + const TSharedPtr ObjectNameValue = obj->TryGetField(TEXT("ObjectName")); + if (ObjectNameValue.IsValid() && !ObjectNameValue->IsNull()) + { + FString TmpValue; + if (ObjectNameValue->TryGetString(TmpValue)) { ObjectName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::ProfilesModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FEntityPermissionStatement::~FEntityPermissionStatement() +{ + +} + +void PlayFab::ProfilesModels::FEntityPermissionStatement::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Action")); writer->WriteValue(Action); + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + if (Condition.notNull()) { writer->WriteIdentifierPrefix(TEXT("Condition")); Condition.writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Effect")); writeEffectTypeEnumJSON(Effect, writer); + + writer->WriteIdentifierPrefix(TEXT("Principal")); Principal.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Resource")); writer->WriteValue(Resource); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FEntityPermissionStatement::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActionValue = obj->TryGetField(TEXT("Action")); + if (ActionValue.IsValid() && !ActionValue->IsNull()) + { + FString TmpValue; + if (ActionValue->TryGetString(TmpValue)) { Action = TmpValue; } + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ConditionValue = obj->TryGetField(TEXT("Condition")); + if (ConditionValue.IsValid() && !ConditionValue->IsNull()) + { + Condition = FJsonKeeper(ConditionValue); + } + + Effect = readEffectTypeFromValue(obj->TryGetField(TEXT("Effect"))); + + const TSharedPtr PrincipalValue = obj->TryGetField(TEXT("Principal")); + if (PrincipalValue.IsValid() && !PrincipalValue->IsNull()) + { + Principal = FJsonKeeper(PrincipalValue); + } + + const TSharedPtr ResourceValue = obj->TryGetField(TEXT("Resource")); + if (ResourceValue.IsValid() && !ResourceValue->IsNull()) + { + FString TmpValue; + if (ResourceValue->TryGetString(TmpValue)) { Resource = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FEntityProfileFileMetadata::~FEntityProfileFileMetadata() +{ + +} + +void PlayFab::ProfilesModels::FEntityProfileFileMetadata::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Checksum.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Checksum")); writer->WriteValue(Checksum); } + + if (FileName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FileName")); writer->WriteValue(FileName); } + + writer->WriteIdentifierPrefix(TEXT("LastModified")); writeDatetime(LastModified, writer); + + writer->WriteIdentifierPrefix(TEXT("Size")); writer->WriteValue(Size); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FEntityProfileFileMetadata::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ChecksumValue = obj->TryGetField(TEXT("Checksum")); + if (ChecksumValue.IsValid() && !ChecksumValue->IsNull()) + { + FString TmpValue; + if (ChecksumValue->TryGetString(TmpValue)) { Checksum = TmpValue; } + } + + const TSharedPtr FileNameValue = obj->TryGetField(TEXT("FileName")); + if (FileNameValue.IsValid() && !FileNameValue->IsNull()) + { + FString TmpValue; + if (FileNameValue->TryGetString(TmpValue)) { FileName = TmpValue; } + } + + const TSharedPtr LastModifiedValue = obj->TryGetField(TEXT("LastModified")); + if (LastModifiedValue.IsValid()) + LastModified = readDatetime(LastModifiedValue); + + + const TSharedPtr SizeValue = obj->TryGetField(TEXT("Size")); + if (SizeValue.IsValid() && !SizeValue->IsNull()) + { + int32 TmpValue; + if (SizeValue->TryGetNumber(TmpValue)) { Size = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FEntityProfileBody::~FEntityProfileBody() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::ProfilesModels::FEntityProfileBody::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + if (EntityChain.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EntityChain")); writer->WriteValue(EntityChain); } + + if (Files.Num() != 0) + { + writer->WriteObjectStart(TEXT("Files")); + for (TMap::TConstIterator It(Files); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + if (Language.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Language")); writer->WriteValue(Language); } + + if (Objects.Num() != 0) + { + writer->WriteObjectStart(TEXT("Objects")); + for (TMap::TConstIterator It(Objects); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + if (Permissions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Permissions")); + for (const FEntityPermissionStatement& item : Permissions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("VersionNumber")); writer->WriteValue(VersionNumber); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FEntityProfileBody::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr EntityChainValue = obj->TryGetField(TEXT("EntityChain")); + if (EntityChainValue.IsValid() && !EntityChainValue->IsNull()) + { + FString TmpValue; + if (EntityChainValue->TryGetString(TmpValue)) { EntityChain = TmpValue; } + } + + const TSharedPtr* FilesObject; + if (obj->TryGetObjectField(TEXT("Files"), FilesObject)) + { + for (TMap>::TConstIterator It((*FilesObject)->Values); It; ++It) + { + Files.Add(It.Key(), FEntityProfileFileMetadata(It.Value()->AsObject())); + } + } + + const TSharedPtr LanguageValue = obj->TryGetField(TEXT("Language")); + if (LanguageValue.IsValid() && !LanguageValue->IsNull()) + { + FString TmpValue; + if (LanguageValue->TryGetString(TmpValue)) { Language = TmpValue; } + } + + const TSharedPtr* ObjectsObject; + if (obj->TryGetObjectField(TEXT("Objects"), ObjectsObject)) + { + for (TMap>::TConstIterator It((*ObjectsObject)->Values); It; ++It) + { + Objects.Add(It.Key(), FEntityDataObject(It.Value()->AsObject())); + } + } + + const TArray>&PermissionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Permissions")); + for (int32 Idx = 0; Idx < PermissionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PermissionsArray[Idx]; + Permissions.Add(FEntityPermissionStatement(CurrentItem->AsObject())); + } + + + const TSharedPtr VersionNumberValue = obj->TryGetField(TEXT("VersionNumber")); + if (VersionNumberValue.IsValid() && !VersionNumberValue->IsNull()) + { + int32 TmpValue; + if (VersionNumberValue->TryGetNumber(TmpValue)) { VersionNumber = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FGetEntityProfileRequest::~FGetEntityProfileRequest() +{ + +} + +void PlayFab::ProfilesModels::FGetEntityProfileRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DataAsObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("DataAsObject")); writer->WriteValue(DataAsObject); } + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FGetEntityProfileRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataAsObjectValue = obj->TryGetField(TEXT("DataAsObject")); + if (DataAsObjectValue.IsValid() && !DataAsObjectValue->IsNull()) + { + bool TmpValue; + if (DataAsObjectValue->TryGetBool(TmpValue)) { DataAsObject = TmpValue; } + } + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FGetEntityProfileResponse::~FGetEntityProfileResponse() +{ + //if (Profile != nullptr) delete Profile; + +} + +void PlayFab::ProfilesModels::FGetEntityProfileResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Profile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Profile")); Profile->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FGetEntityProfileResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ProfileValue = obj->TryGetField(TEXT("Profile")); + if (ProfileValue.IsValid() && !ProfileValue->IsNull()) + { + Profile = MakeShareable(new FEntityProfileBody(ProfileValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FGetEntityProfilesRequest::~FGetEntityProfilesRequest() +{ + +} + +void PlayFab::ProfilesModels::FGetEntityProfilesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DataAsObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("DataAsObject")); writer->WriteValue(DataAsObject); } + + writer->WriteArrayStart(TEXT("Entities")); + for (const FEntityKey& item : Entities) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FGetEntityProfilesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataAsObjectValue = obj->TryGetField(TEXT("DataAsObject")); + if (DataAsObjectValue.IsValid() && !DataAsObjectValue->IsNull()) + { + bool TmpValue; + if (DataAsObjectValue->TryGetBool(TmpValue)) { DataAsObject = TmpValue; } + } + + const TArray>&EntitiesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Entities")); + for (int32 Idx = 0; Idx < EntitiesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = EntitiesArray[Idx]; + Entities.Add(FEntityKey(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FGetEntityProfilesResponse::~FGetEntityProfilesResponse() +{ + +} + +void PlayFab::ProfilesModels::FGetEntityProfilesResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Profiles.Num() != 0) + { + writer->WriteArrayStart(TEXT("Profiles")); + for (const FEntityProfileBody& item : Profiles) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FGetEntityProfilesResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ProfilesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Profiles")); + for (int32 Idx = 0; Idx < ProfilesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ProfilesArray[Idx]; + Profiles.Add(FEntityProfileBody(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FGetGlobalPolicyRequest::~FGetGlobalPolicyRequest() +{ + +} + +void PlayFab::ProfilesModels::FGetGlobalPolicyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FGetGlobalPolicyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FGetGlobalPolicyResponse::~FGetGlobalPolicyResponse() +{ + +} + +void PlayFab::ProfilesModels::FGetGlobalPolicyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Permissions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Permissions")); + for (const FEntityPermissionStatement& item : Permissions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FGetGlobalPolicyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&PermissionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Permissions")); + for (int32 Idx = 0; Idx < PermissionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PermissionsArray[Idx]; + Permissions.Add(FEntityPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::ProfilesModels::writeOperationTypesEnumJSON(OperationTypes enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case OperationTypesCreated: writer->WriteValue(TEXT("Created")); break; + case OperationTypesUpdated: writer->WriteValue(TEXT("Updated")); break; + case OperationTypesDeleted: writer->WriteValue(TEXT("Deleted")); break; + case OperationTypesNone: writer->WriteValue(TEXT("None")); break; + } +} + +ProfilesModels::OperationTypes PlayFab::ProfilesModels::readOperationTypesFromValue(const TSharedPtr& value) +{ + return readOperationTypesFromValue(value.IsValid() ? value->AsString() : ""); +} + +ProfilesModels::OperationTypes PlayFab::ProfilesModels::readOperationTypesFromValue(const FString& value) +{ + static TMap _OperationTypesMap; + if (_OperationTypesMap.Num() == 0) + { + // Auto-generate the map on the first use + _OperationTypesMap.Add(TEXT("Created"), OperationTypesCreated); + _OperationTypesMap.Add(TEXT("Updated"), OperationTypesUpdated); + _OperationTypesMap.Add(TEXT("Deleted"), OperationTypesDeleted); + _OperationTypesMap.Add(TEXT("None"), OperationTypesNone); + + } + + if (!value.IsEmpty()) + { + auto output = _OperationTypesMap.Find(value); + if (output != nullptr) + return *output; + } + + return OperationTypesCreated; // Basically critical fail +} + +PlayFab::ProfilesModels::FSetEntityProfilePolicyRequest::~FSetEntityProfilePolicyRequest() +{ + +} + +void PlayFab::ProfilesModels::FSetEntityProfilePolicyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + if (Statements.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statements")); + for (const FEntityPermissionStatement& item : Statements) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FSetEntityProfilePolicyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TArray>&StatementsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statements")); + for (int32 Idx = 0; Idx < StatementsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatementsArray[Idx]; + Statements.Add(FEntityPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FSetEntityProfilePolicyResponse::~FSetEntityProfilePolicyResponse() +{ + +} + +void PlayFab::ProfilesModels::FSetEntityProfilePolicyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Permissions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Permissions")); + for (const FEntityPermissionStatement& item : Permissions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FSetEntityProfilePolicyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&PermissionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Permissions")); + for (int32 Idx = 0; Idx < PermissionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PermissionsArray[Idx]; + Permissions.Add(FEntityPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FSetGlobalPolicyRequest::~FSetGlobalPolicyRequest() +{ + +} + +void PlayFab::ProfilesModels::FSetGlobalPolicyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Permissions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Permissions")); + for (const FEntityPermissionStatement& item : Permissions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FSetGlobalPolicyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&PermissionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Permissions")); + for (int32 Idx = 0; Idx < PermissionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PermissionsArray[Idx]; + Permissions.Add(FEntityPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FSetGlobalPolicyResponse::~FSetGlobalPolicyResponse() +{ + +} + +void PlayFab::ProfilesModels::FSetGlobalPolicyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FSetGlobalPolicyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FSetProfileLanguageRequest::~FSetProfileLanguageRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::ProfilesModels::FSetProfileLanguageRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ExpectedVersion")); writer->WriteValue(ExpectedVersion); + + if (Language.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Language")); writer->WriteValue(Language); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FSetProfileLanguageRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr ExpectedVersionValue = obj->TryGetField(TEXT("ExpectedVersion")); + if (ExpectedVersionValue.IsValid() && !ExpectedVersionValue->IsNull()) + { + int32 TmpValue; + if (ExpectedVersionValue->TryGetNumber(TmpValue)) { ExpectedVersion = TmpValue; } + } + + const TSharedPtr LanguageValue = obj->TryGetField(TEXT("Language")); + if (LanguageValue.IsValid() && !LanguageValue->IsNull()) + { + FString TmpValue; + if (LanguageValue->TryGetString(TmpValue)) { Language = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FSetProfileLanguageResponse::~FSetProfileLanguageResponse() +{ + +} + +void PlayFab::ProfilesModels::FSetProfileLanguageResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (OperationResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("OperationResult")); writeOperationTypesEnumJSON(OperationResult, writer); } + + if (VersionNumber.notNull()) { writer->WriteIdentifierPrefix(TEXT("VersionNumber")); writer->WriteValue(VersionNumber); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FSetProfileLanguageResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + OperationResult = readOperationTypesFromValue(obj->TryGetField(TEXT("OperationResult"))); + + const TSharedPtr VersionNumberValue = obj->TryGetField(TEXT("VersionNumber")); + if (VersionNumberValue.IsValid() && !VersionNumberValue->IsNull()) + { + int32 TmpValue; + if (VersionNumberValue->TryGetNumber(TmpValue)) { VersionNumber = TmpValue; } + } + + return HasSucceeded; +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabResultHandler.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabResultHandler.cpp new file mode 100644 index 000000000..7f44b99bf --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabResultHandler.cpp @@ -0,0 +1,115 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFabResultHandler.h" +#include "PlayFabSettings.h" +#include "PlayFab.h" + +using namespace PlayFab; + +int PlayFabRequestHandler::pendingCalls = 0; + +int PlayFabRequestHandler::GetPendingCalls() +{ + return PlayFabRequestHandler::pendingCalls; +} + +TSharedRef PlayFabRequestHandler::SendRequest(const FString& url, const FString& callBody, const FString& authKey, const FString& authValue) +{ + if (PlayFabSettings::GetTitleId().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must define a titleID before making API Calls.")); + } + PlayFabRequestHandler::pendingCalls += 1; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetVerb(TEXT("POST")); + HttpRequest->SetURL(url); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), PlayFabSettings::versionString); + + if (authKey != TEXT("")) + HttpRequest->SetHeader(authKey, authValue); + + HttpRequest->SetContentAsString(callBody); + return HttpRequest; +} + +bool PlayFabRequestHandler::DecodeRequest(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, PlayFab::FPlayFabBaseModel& OutResult, PlayFab::FPlayFabError& OutError) +{ + PlayFabRequestHandler::pendingCalls -= 1; + + FString ResponseStr, ErrorStr; + if (bSucceeded && HttpResponse.IsValid()) + { + if (EHttpResponseCodes::IsOk(HttpResponse->GetResponseCode())) + { + // Create the Json parser + ResponseStr = HttpResponse->GetContentAsString(); + TSharedPtr JsonObject; + TSharedRef > JsonReader = TJsonReaderFactory<>::Create(ResponseStr); + + if (FJsonSerializer::Deserialize(JsonReader, JsonObject) && JsonObject.IsValid()) + { + if (PlayFabRequestHandler::DecodeError(JsonObject, OutError)) + { + return false; + } + + const TSharedPtr* DataJsonObject; + if (JsonObject->TryGetObjectField(TEXT("data"), DataJsonObject)) + { + return OutResult.readFromValue(*DataJsonObject); + } + } + } + else + { + // Create the Json parser + ResponseStr = HttpResponse->GetContentAsString(); + TSharedPtr JsonObject; + TSharedRef > JsonReader = TJsonReaderFactory<>::Create(ResponseStr); + + if (FJsonSerializer::Deserialize(JsonReader, JsonObject) && JsonObject.IsValid()) + { + if (PlayFabRequestHandler::DecodeError(JsonObject, OutError)) + { + return false; + } + } + } + } + + // If we get here, we failed to connect meaningfully to the server - Assume a timeout + OutError.HttpCode = 408; + OutError.ErrorCode = PlayFabErrorConnectionTimeout; + // For text returns, use the non-json response if possible, else default to no response + OutError.ErrorName = OutError.ErrorMessage = OutError.HttpStatus = TEXT("Request Timeout or null response"); + + return false; +} + +bool PlayFabRequestHandler::DecodeError(TSharedPtr JsonObject, PlayFab::FPlayFabError& OutError) +{ + // check if returned json indicates an error + if (JsonObject->HasField(TEXT("errorCode"))) + { + // deserialize the FPlayFabError object + JsonObject->TryGetNumberField(TEXT("errorCode"), OutError.ErrorCode); + JsonObject->TryGetNumberField(TEXT("code"), OutError.HttpCode); + JsonObject->TryGetStringField(TEXT("status"), OutError.HttpStatus); + JsonObject->TryGetStringField(TEXT("error"), OutError.ErrorName); + JsonObject->TryGetStringField(TEXT("errorMessage"), OutError.ErrorMessage); + + // TODO: handle error details properly + //"errorDetails" + + // TODO: handle global error delegate here + + // We encountered no errors parsing the error + return true; + } + + return false; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabServerAPI.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabServerAPI.cpp new file mode 100644 index 000000000..a612d5517 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabServerAPI.cpp @@ -0,0 +1,3089 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabServerAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::ServerModels; + +UPlayFabServerAPI::UPlayFabServerAPI() {} + +UPlayFabServerAPI::~UPlayFabServerAPI() {} + +int UPlayFabServerAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabServerAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabServerAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabServerAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabServerAPI::AddCharacterVirtualCurrency( + ServerModels::FAddCharacterVirtualCurrencyRequest& request, + const FAddCharacterVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AddCharacterVirtualCurrency")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAddCharacterVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAddCharacterVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddCharacterVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FModifyCharacterVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::AddFriend( + ServerModels::FAddFriendRequest& request, + const FAddFriendDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AddFriend")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAddFriendResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAddFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::AddPlayerTag( + ServerModels::FAddPlayerTagRequest& request, + const FAddPlayerTagDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AddPlayerTag")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAddPlayerTagResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAddPlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddPlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FAddPlayerTagResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::AddSharedGroupMembers( + ServerModels::FAddSharedGroupMembersRequest& request, + const FAddSharedGroupMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AddSharedGroupMembers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAddSharedGroupMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAddSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FAddSharedGroupMembersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::AddUserVirtualCurrency( + ServerModels::FAddUserVirtualCurrencyRequest& request, + const FAddUserVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AddUserVirtualCurrency")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAddUserVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAddUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FModifyUserVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::AuthenticateSessionTicket( + ServerModels::FAuthenticateSessionTicketRequest& request, + const FAuthenticateSessionTicketDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AuthenticateSessionTicket")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAuthenticateSessionTicketResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAuthenticateSessionTicketResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAuthenticateSessionTicketDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FAuthenticateSessionTicketResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::AwardSteamAchievement( + ServerModels::FAwardSteamAchievementRequest& request, + const FAwardSteamAchievementDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AwardSteamAchievement")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAwardSteamAchievementResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAwardSteamAchievementResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAwardSteamAchievementDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FAwardSteamAchievementResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::BanUsers( + ServerModels::FBanUsersRequest& request, + const FBanUsersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/BanUsers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnBanUsersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnBanUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FBanUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FBanUsersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::ConsumeItem( + ServerModels::FConsumeItemRequest& request, + const FConsumeItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/ConsumeItem")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnConsumeItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnConsumeItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConsumeItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FConsumeItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::CreateSharedGroup( + ServerModels::FCreateSharedGroupRequest& request, + const FCreateSharedGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/CreateSharedGroup")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnCreateSharedGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnCreateSharedGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateSharedGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FCreateSharedGroupResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::DeleteCharacterFromUser( + ServerModels::FDeleteCharacterFromUserRequest& request, + const FDeleteCharacterFromUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/DeleteCharacterFromUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnDeleteCharacterFromUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnDeleteCharacterFromUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteCharacterFromUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FDeleteCharacterFromUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::DeleteSharedGroup( + ServerModels::FDeleteSharedGroupRequest& request, + const FDeleteSharedGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/DeleteSharedGroup")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnDeleteSharedGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnDeleteSharedGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteSharedGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::DeleteUsers( + ServerModels::FDeleteUsersRequest& request, + const FDeleteUsersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/DeleteUsers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnDeleteUsersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnDeleteUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FDeleteUsersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::DeregisterGame( + ServerModels::FDeregisterGameRequest& request, + const FDeregisterGameDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/DeregisterGame")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnDeregisterGameResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnDeregisterGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeregisterGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FDeregisterGameResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::EvaluateRandomResultTable( + ServerModels::FEvaluateRandomResultTableRequest& request, + const FEvaluateRandomResultTableDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/EvaluateRandomResultTable")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnEvaluateRandomResultTableResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnEvaluateRandomResultTableResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FEvaluateRandomResultTableDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEvaluateRandomResultTableResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::ExecuteCloudScript( + ServerModels::FExecuteCloudScriptServerRequest& request, + const FExecuteCloudScriptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/ExecuteCloudScript")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnExecuteCloudScriptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnExecuteCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExecuteCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FExecuteCloudScriptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetAllSegments( + + const FGetAllSegmentsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetAllSegments")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetAllSegmentsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetAllSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetAllSegmentsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetAllUsersCharacters( + ServerModels::FListUsersCharactersRequest& request, + const FGetAllUsersCharactersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetAllUsersCharacters")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetAllUsersCharactersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetAllUsersCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllUsersCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FListUsersCharactersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCatalogItems( + ServerModels::FGetCatalogItemsRequest& request, + const FGetCatalogItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCatalogItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCatalogItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCatalogItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCharacterData( + ServerModels::FGetCharacterDataRequest& request, + const FGetCharacterDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCharacterData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCharacterDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCharacterInternalData( + ServerModels::FGetCharacterDataRequest& request, + const FGetCharacterInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCharacterInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCharacterInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCharacterInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCharacterInventory( + ServerModels::FGetCharacterInventoryRequest& request, + const FGetCharacterInventoryDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCharacterInventory")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCharacterInventoryResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCharacterInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCharacterInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCharacterLeaderboard( + ServerModels::FGetCharacterLeaderboardRequest& request, + const FGetCharacterLeaderboardDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCharacterLeaderboard")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCharacterLeaderboardResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCharacterLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCharacterLeaderboardResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCharacterReadOnlyData( + ServerModels::FGetCharacterDataRequest& request, + const FGetCharacterReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCharacterReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCharacterReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCharacterReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCharacterStatistics( + ServerModels::FGetCharacterStatisticsRequest& request, + const FGetCharacterStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCharacterStatistics")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCharacterStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCharacterStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetContentDownloadUrl( + ServerModels::FGetContentDownloadUrlRequest& request, + const FGetContentDownloadUrlDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetContentDownloadUrl")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetContentDownloadUrlResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetContentDownloadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentDownloadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetContentDownloadUrlResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetFriendLeaderboard( + ServerModels::FGetFriendLeaderboardRequest& request, + const FGetFriendLeaderboardDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetFriendLeaderboard")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetFriendLeaderboardResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetFriendLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetLeaderboardResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetFriendsList( + ServerModels::FGetFriendsListRequest& request, + const FGetFriendsListDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetFriendsList")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetFriendsListResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetFriendsListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendsListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetFriendsListResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetLeaderboard( + ServerModels::FGetLeaderboardRequest& request, + const FGetLeaderboardDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetLeaderboard")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetLeaderboardResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetLeaderboardResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetLeaderboardAroundCharacter( + ServerModels::FGetLeaderboardAroundCharacterRequest& request, + const FGetLeaderboardAroundCharacterDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetLeaderboardAroundCharacter")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetLeaderboardAroundCharacterResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetLeaderboardAroundCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetLeaderboardAroundCharacterResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetLeaderboardAroundUser( + ServerModels::FGetLeaderboardAroundUserRequest& request, + const FGetLeaderboardAroundUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetLeaderboardAroundUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetLeaderboardAroundUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetLeaderboardAroundUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetLeaderboardAroundUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetLeaderboardForUserCharacters( + ServerModels::FGetLeaderboardForUsersCharactersRequest& request, + const FGetLeaderboardForUserCharactersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetLeaderboardForUserCharacters")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetLeaderboardForUserCharactersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetLeaderboardForUserCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardForUserCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetLeaderboardForUsersCharactersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayerCombinedInfo( + ServerModels::FGetPlayerCombinedInfoRequest& request, + const FGetPlayerCombinedInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayerCombinedInfo")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayerCombinedInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayerCombinedInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerCombinedInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayerCombinedInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayerProfile( + ServerModels::FGetPlayerProfileRequest& request, + const FGetPlayerProfileDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayerProfile")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayerProfileResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayerProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayerProfileResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayerSegments( + ServerModels::FGetPlayersSegmentsRequest& request, + const FGetPlayerSegmentsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayerSegments")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayerSegmentsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayerSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayerSegmentsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayersInSegment( + ServerModels::FGetPlayersInSegmentRequest& request, + const FGetPlayersInSegmentDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayersInSegment")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayersInSegmentResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayersInSegmentResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayersInSegmentDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayersInSegmentResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayerStatistics( + ServerModels::FGetPlayerStatisticsRequest& request, + const FGetPlayerStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayerStatistics")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayerStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayerStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayerStatisticVersions( + ServerModels::FGetPlayerStatisticVersionsRequest& request, + const FGetPlayerStatisticVersionsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayerStatisticVersions")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayerStatisticVersionsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayerStatisticVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayerStatisticVersionsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayerTags( + ServerModels::FGetPlayerTagsRequest& request, + const FGetPlayerTagsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayerTags")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayerTagsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayerTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayerTagsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayFabIDsFromFacebookIDs( + ServerModels::FGetPlayFabIDsFromFacebookIDsRequest& request, + const FGetPlayFabIDsFromFacebookIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayFabIDsFromFacebookIDs")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayFabIDsFromFacebookIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayFabIDsFromFacebookIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayFabIDsFromFacebookIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayFabIDsFromFacebookInstantGamesIds( + ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest& request, + const FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayFabIDsFromFacebookInstantGamesIds")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayFabIDsFromFacebookInstantGamesIdsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayFabIDsFromFacebookInstantGamesIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayFabIDsFromNintendoSwitchDeviceIds( + ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& request, + const FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayFabIDsFromNintendoSwitchDeviceIds")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayFabIDsFromSteamIDs( + ServerModels::FGetPlayFabIDsFromSteamIDsRequest& request, + const FGetPlayFabIDsFromSteamIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayFabIDsFromSteamIDs")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayFabIDsFromSteamIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayFabIDsFromSteamIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromSteamIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayFabIDsFromSteamIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPublisherData( + ServerModels::FGetPublisherDataRequest& request, + const FGetPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPublisherDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetRandomResultTables( + ServerModels::FGetRandomResultTablesRequest& request, + const FGetRandomResultTablesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetRandomResultTables")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetRandomResultTablesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetRandomResultTablesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetRandomResultTablesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetRandomResultTablesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetSharedGroupData( + ServerModels::FGetSharedGroupDataRequest& request, + const FGetSharedGroupDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetSharedGroupData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetSharedGroupDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetSharedGroupDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetTime( + + const FGetTimeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetTime")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetTimeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetTimeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTimeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetTimeResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetTitleData( + ServerModels::FGetTitleDataRequest& request, + const FGetTitleDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetTitleData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetTitleDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetTitleInternalData( + ServerModels::FGetTitleDataRequest& request, + const FGetTitleInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetTitleInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetTitleInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetTitleNews( + ServerModels::FGetTitleNewsRequest& request, + const FGetTitleNewsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetTitleNews")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetTitleNewsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetTitleNewsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleNewsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetTitleNewsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserAccountInfo( + ServerModels::FGetUserAccountInfoRequest& request, + const FGetUserAccountInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserAccountInfo")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserAccountInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserAccountInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserAccountInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserAccountInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserBans( + ServerModels::FGetUserBansRequest& request, + const FGetUserBansDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserBans")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserBansResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserBansResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserData( + ServerModels::FGetUserDataRequest& request, + const FGetUserDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserInternalData( + ServerModels::FGetUserDataRequest& request, + const FGetUserInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserInventory( + ServerModels::FGetUserInventoryRequest& request, + const FGetUserInventoryDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserInventory")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserInventoryResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserPublisherData( + ServerModels::FGetUserDataRequest& request, + const FGetUserPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserPublisherInternalData( + ServerModels::FGetUserDataRequest& request, + const FGetUserPublisherInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserPublisherInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserPublisherInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserPublisherReadOnlyData( + ServerModels::FGetUserDataRequest& request, + const FGetUserPublisherReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserPublisherReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserPublisherReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserReadOnlyData( + ServerModels::FGetUserDataRequest& request, + const FGetUserReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GrantCharacterToUser( + ServerModels::FGrantCharacterToUserRequest& request, + const FGrantCharacterToUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GrantCharacterToUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGrantCharacterToUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGrantCharacterToUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantCharacterToUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGrantCharacterToUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GrantItemsToCharacter( + ServerModels::FGrantItemsToCharacterRequest& request, + const FGrantItemsToCharacterDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GrantItemsToCharacter")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGrantItemsToCharacterResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGrantItemsToCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGrantItemsToCharacterResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GrantItemsToUser( + ServerModels::FGrantItemsToUserRequest& request, + const FGrantItemsToUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GrantItemsToUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGrantItemsToUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGrantItemsToUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGrantItemsToUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GrantItemsToUsers( + ServerModels::FGrantItemsToUsersRequest& request, + const FGrantItemsToUsersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GrantItemsToUsers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGrantItemsToUsersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGrantItemsToUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGrantItemsToUsersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::ModifyItemUses( + ServerModels::FModifyItemUsesRequest& request, + const FModifyItemUsesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/ModifyItemUses")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnModifyItemUsesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnModifyItemUsesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FModifyItemUsesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FModifyItemUsesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::MoveItemToCharacterFromCharacter( + ServerModels::FMoveItemToCharacterFromCharacterRequest& request, + const FMoveItemToCharacterFromCharacterDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/MoveItemToCharacterFromCharacter")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnMoveItemToCharacterFromCharacterResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnMoveItemToCharacterFromCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveItemToCharacterFromCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FMoveItemToCharacterFromCharacterResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::MoveItemToCharacterFromUser( + ServerModels::FMoveItemToCharacterFromUserRequest& request, + const FMoveItemToCharacterFromUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/MoveItemToCharacterFromUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnMoveItemToCharacterFromUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnMoveItemToCharacterFromUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveItemToCharacterFromUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FMoveItemToCharacterFromUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::MoveItemToUserFromCharacter( + ServerModels::FMoveItemToUserFromCharacterRequest& request, + const FMoveItemToUserFromCharacterDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/MoveItemToUserFromCharacter")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnMoveItemToUserFromCharacterResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnMoveItemToUserFromCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveItemToUserFromCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FMoveItemToUserFromCharacterResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::NotifyMatchmakerPlayerLeft( + ServerModels::FNotifyMatchmakerPlayerLeftRequest& request, + const FNotifyMatchmakerPlayerLeftDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/NotifyMatchmakerPlayerLeft")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnNotifyMatchmakerPlayerLeftResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnNotifyMatchmakerPlayerLeftResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FNotifyMatchmakerPlayerLeftDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FNotifyMatchmakerPlayerLeftResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RedeemCoupon( + ServerModels::FRedeemCouponRequest& request, + const FRedeemCouponDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RedeemCoupon")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRedeemCouponResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRedeemCouponResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRedeemCouponDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRedeemCouponResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RedeemMatchmakerTicket( + ServerModels::FRedeemMatchmakerTicketRequest& request, + const FRedeemMatchmakerTicketDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RedeemMatchmakerTicket")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRedeemMatchmakerTicketResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRedeemMatchmakerTicketResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRedeemMatchmakerTicketDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRedeemMatchmakerTicketResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RefreshGameServerInstanceHeartbeat( + ServerModels::FRefreshGameServerInstanceHeartbeatRequest& request, + const FRefreshGameServerInstanceHeartbeatDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RefreshGameServerInstanceHeartbeat")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRefreshGameServerInstanceHeartbeatResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRefreshGameServerInstanceHeartbeatResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefreshGameServerInstanceHeartbeatDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRefreshGameServerInstanceHeartbeatResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RegisterGame( + ServerModels::FRegisterGameRequest& request, + const FRegisterGameDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RegisterGame")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRegisterGameResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRegisterGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRegisterGameResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RemoveFriend( + ServerModels::FRemoveFriendRequest& request, + const FRemoveFriendDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RemoveFriend")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRemoveFriendResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRemoveFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RemovePlayerTag( + ServerModels::FRemovePlayerTagRequest& request, + const FRemovePlayerTagDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RemovePlayerTag")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRemovePlayerTagResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRemovePlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemovePlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRemovePlayerTagResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RemoveSharedGroupMembers( + ServerModels::FRemoveSharedGroupMembersRequest& request, + const FRemoveSharedGroupMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RemoveSharedGroupMembers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRemoveSharedGroupMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRemoveSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRemoveSharedGroupMembersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::ReportPlayer( + ServerModels::FReportPlayerServerRequest& request, + const FReportPlayerDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/ReportPlayer")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnReportPlayerResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnReportPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FReportPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FReportPlayerServerResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RevokeAllBansForUser( + ServerModels::FRevokeAllBansForUserRequest& request, + const FRevokeAllBansForUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RevokeAllBansForUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRevokeAllBansForUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRevokeAllBansForUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeAllBansForUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRevokeAllBansForUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RevokeBans( + ServerModels::FRevokeBansRequest& request, + const FRevokeBansDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RevokeBans")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRevokeBansResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRevokeBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRevokeBansResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RevokeInventoryItem( + ServerModels::FRevokeInventoryItemRequest& request, + const FRevokeInventoryItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RevokeInventoryItem")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRevokeInventoryItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRevokeInventoryItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRevokeInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RevokeInventoryItems( + ServerModels::FRevokeInventoryItemsRequest& request, + const FRevokeInventoryItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RevokeInventoryItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRevokeInventoryItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRevokeInventoryItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRevokeInventoryItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SendCustomAccountRecoveryEmail( + ServerModels::FSendCustomAccountRecoveryEmailRequest& request, + const FSendCustomAccountRecoveryEmailDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SendCustomAccountRecoveryEmail")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSendCustomAccountRecoveryEmailResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSendCustomAccountRecoveryEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendCustomAccountRecoveryEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSendCustomAccountRecoveryEmailResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SendEmailFromTemplate( + ServerModels::FSendEmailFromTemplateRequest& request, + const FSendEmailFromTemplateDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SendEmailFromTemplate")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSendEmailFromTemplateResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSendEmailFromTemplateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendEmailFromTemplateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSendEmailFromTemplateResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SendPushNotification( + ServerModels::FSendPushNotificationRequest& request, + const FSendPushNotificationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SendPushNotification")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSendPushNotificationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSendPushNotificationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendPushNotificationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSendPushNotificationResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetFriendTags( + ServerModels::FSetFriendTagsRequest& request, + const FSetFriendTagsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetFriendTags")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetFriendTagsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetFriendTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetFriendTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetGameServerInstanceData( + ServerModels::FSetGameServerInstanceDataRequest& request, + const FSetGameServerInstanceDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetGameServerInstanceData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetGameServerInstanceDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetGameServerInstanceDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGameServerInstanceDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetGameServerInstanceDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetGameServerInstanceState( + ServerModels::FSetGameServerInstanceStateRequest& request, + const FSetGameServerInstanceStateDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetGameServerInstanceState")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetGameServerInstanceStateResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetGameServerInstanceStateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGameServerInstanceStateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetGameServerInstanceStateResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetGameServerInstanceTags( + ServerModels::FSetGameServerInstanceTagsRequest& request, + const FSetGameServerInstanceTagsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetGameServerInstanceTags")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetGameServerInstanceTagsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetGameServerInstanceTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGameServerInstanceTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetGameServerInstanceTagsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetPlayerSecret( + ServerModels::FSetPlayerSecretRequest& request, + const FSetPlayerSecretDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetPlayerSecret")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetPlayerSecretResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetPlayerSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPlayerSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetPlayerSecretResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetPublisherData( + ServerModels::FSetPublisherDataRequest& request, + const FSetPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetPublisherDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetTitleData( + ServerModels::FSetTitleDataRequest& request, + const FSetTitleDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetTitleData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetTitleDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetTitleInternalData( + ServerModels::FSetTitleDataRequest& request, + const FSetTitleInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetTitleInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetTitleInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SubtractCharacterVirtualCurrency( + ServerModels::FSubtractCharacterVirtualCurrencyRequest& request, + const FSubtractCharacterVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SubtractCharacterVirtualCurrency")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSubtractCharacterVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSubtractCharacterVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractCharacterVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FModifyCharacterVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SubtractUserVirtualCurrency( + ServerModels::FSubtractUserVirtualCurrencyRequest& request, + const FSubtractUserVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SubtractUserVirtualCurrency")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSubtractUserVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSubtractUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FModifyUserVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UnlockContainerInstance( + ServerModels::FUnlockContainerInstanceRequest& request, + const FUnlockContainerInstanceDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UnlockContainerInstance")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUnlockContainerInstanceResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUnlockContainerInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUnlockContainerItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UnlockContainerItem( + ServerModels::FUnlockContainerItemRequest& request, + const FUnlockContainerItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UnlockContainerItem")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUnlockContainerItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUnlockContainerItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUnlockContainerItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateAvatarUrl( + ServerModels::FUpdateAvatarUrlRequest& request, + const FUpdateAvatarUrlDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateAvatarUrl")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateAvatarUrlResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateAvatarUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateAvatarUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateBans( + ServerModels::FUpdateBansRequest& request, + const FUpdateBansDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateBans")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateBansResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateBansResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateCharacterData( + ServerModels::FUpdateCharacterDataRequest& request, + const FUpdateCharacterDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateCharacterData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateCharacterDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateCharacterInternalData( + ServerModels::FUpdateCharacterDataRequest& request, + const FUpdateCharacterInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateCharacterInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateCharacterInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateCharacterInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateCharacterReadOnlyData( + ServerModels::FUpdateCharacterDataRequest& request, + const FUpdateCharacterReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateCharacterReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateCharacterReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateCharacterReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateCharacterStatistics( + ServerModels::FUpdateCharacterStatisticsRequest& request, + const FUpdateCharacterStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateCharacterStatistics")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateCharacterStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateCharacterStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdatePlayerStatistics( + ServerModels::FUpdatePlayerStatisticsRequest& request, + const FUpdatePlayerStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdatePlayerStatistics")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdatePlayerStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdatePlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdatePlayerStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateSharedGroupData( + ServerModels::FUpdateSharedGroupDataRequest& request, + const FUpdateSharedGroupDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateSharedGroupData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateSharedGroupDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateSharedGroupDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserData( + ServerModels::FUpdateUserDataRequest& request, + const FUpdateUserDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserInternalData( + ServerModels::FUpdateUserInternalDataRequest& request, + const FUpdateUserInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserInventoryItemCustomData( + ServerModels::FUpdateUserInventoryItemDataRequest& request, + const FUpdateUserInventoryItemCustomDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserInventoryItemCustomData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserInventoryItemCustomDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserInventoryItemCustomDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserInventoryItemCustomDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserPublisherData( + ServerModels::FUpdateUserDataRequest& request, + const FUpdateUserPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserPublisherInternalData( + ServerModels::FUpdateUserInternalDataRequest& request, + const FUpdateUserPublisherInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserPublisherInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserPublisherInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserPublisherReadOnlyData( + ServerModels::FUpdateUserDataRequest& request, + const FUpdateUserPublisherReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserPublisherReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserPublisherReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserReadOnlyData( + ServerModels::FUpdateUserDataRequest& request, + const FUpdateUserReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::WriteCharacterEvent( + ServerModels::FWriteServerCharacterEventRequest& request, + const FWriteCharacterEventDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/WriteCharacterEvent")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnWriteCharacterEventResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnWriteCharacterEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteCharacterEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FWriteEventResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::WritePlayerEvent( + ServerModels::FWriteServerPlayerEventRequest& request, + const FWritePlayerEventDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/WritePlayerEvent")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnWritePlayerEventResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnWritePlayerEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWritePlayerEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FWriteEventResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::WriteTitleEvent( + ServerModels::FWriteTitleEventRequest& request, + const FWriteTitleEventDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/WriteTitleEvent")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnWriteTitleEventResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnWriteTitleEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteTitleEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FWriteEventResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabServerDataModels.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabServerDataModels.cpp new file mode 100644 index 000000000..be7b4c049 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabServerDataModels.cpp @@ -0,0 +1,14037 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabServerDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::ServerModels; + +PlayFab::ServerModels::FAdCampaignAttribution::~FAdCampaignAttribution() +{ + +} + +void PlayFab::ServerModels::FAdCampaignAttribution::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AttributedAt")); writeDatetime(AttributedAt, writer); + + if (CampaignId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CampaignId")); writer->WriteValue(CampaignId); } + + if (Platform.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Platform")); writer->WriteValue(Platform); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAdCampaignAttribution::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AttributedAtValue = obj->TryGetField(TEXT("AttributedAt")); + if (AttributedAtValue.IsValid()) + AttributedAt = readDatetime(AttributedAtValue); + + + const TSharedPtr CampaignIdValue = obj->TryGetField(TEXT("CampaignId")); + if (CampaignIdValue.IsValid() && !CampaignIdValue->IsNull()) + { + FString TmpValue; + if (CampaignIdValue->TryGetString(TmpValue)) { CampaignId = TmpValue; } + } + + const TSharedPtr PlatformValue = obj->TryGetField(TEXT("Platform")); + if (PlatformValue.IsValid() && !PlatformValue->IsNull()) + { + FString TmpValue; + if (PlatformValue->TryGetString(TmpValue)) { Platform = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAdCampaignAttributionModel::~FAdCampaignAttributionModel() +{ + +} + +void PlayFab::ServerModels::FAdCampaignAttributionModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AttributedAt")); writeDatetime(AttributedAt, writer); + + if (CampaignId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CampaignId")); writer->WriteValue(CampaignId); } + + if (Platform.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Platform")); writer->WriteValue(Platform); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAdCampaignAttributionModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AttributedAtValue = obj->TryGetField(TEXT("AttributedAt")); + if (AttributedAtValue.IsValid()) + AttributedAt = readDatetime(AttributedAtValue); + + + const TSharedPtr CampaignIdValue = obj->TryGetField(TEXT("CampaignId")); + if (CampaignIdValue.IsValid() && !CampaignIdValue->IsNull()) + { + FString TmpValue; + if (CampaignIdValue->TryGetString(TmpValue)) { CampaignId = TmpValue; } + } + + const TSharedPtr PlatformValue = obj->TryGetField(TEXT("Platform")); + if (PlatformValue.IsValid() && !PlatformValue->IsNull()) + { + FString TmpValue; + if (PlatformValue->TryGetString(TmpValue)) { Platform = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddCharacterVirtualCurrencyRequest::~FAddCharacterVirtualCurrencyRequest() +{ + +} + +void PlayFab::ServerModels::FAddCharacterVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddCharacterVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddFriendRequest::~FAddFriendRequest() +{ + +} + +void PlayFab::ServerModels::FAddFriendRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FriendEmail.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendEmail")); writer->WriteValue(FriendEmail); } + + if (FriendPlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); } + + if (FriendTitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendTitleDisplayName")); writer->WriteValue(FriendTitleDisplayName); } + + if (FriendUsername.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendUsername")); writer->WriteValue(FriendUsername); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddFriendRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendEmailValue = obj->TryGetField(TEXT("FriendEmail")); + if (FriendEmailValue.IsValid() && !FriendEmailValue->IsNull()) + { + FString TmpValue; + if (FriendEmailValue->TryGetString(TmpValue)) { FriendEmail = TmpValue; } + } + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + const TSharedPtr FriendTitleDisplayNameValue = obj->TryGetField(TEXT("FriendTitleDisplayName")); + if (FriendTitleDisplayNameValue.IsValid() && !FriendTitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (FriendTitleDisplayNameValue->TryGetString(TmpValue)) { FriendTitleDisplayName = TmpValue; } + } + + const TSharedPtr FriendUsernameValue = obj->TryGetField(TEXT("FriendUsername")); + if (FriendUsernameValue.IsValid() && !FriendUsernameValue->IsNull()) + { + FString TmpValue; + if (FriendUsernameValue->TryGetString(TmpValue)) { FriendUsername = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddPlayerTagRequest::~FAddPlayerTagRequest() +{ + +} + +void PlayFab::ServerModels::FAddPlayerTagRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("TagName")); writer->WriteValue(TagName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddPlayerTagRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TagNameValue = obj->TryGetField(TEXT("TagName")); + if (TagNameValue.IsValid() && !TagNameValue->IsNull()) + { + FString TmpValue; + if (TagNameValue->TryGetString(TmpValue)) { TagName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddPlayerTagResult::~FAddPlayerTagResult() +{ + +} + +void PlayFab::ServerModels::FAddPlayerTagResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddPlayerTagResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddSharedGroupMembersRequest::~FAddSharedGroupMembersRequest() +{ + +} + +void PlayFab::ServerModels::FAddSharedGroupMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("PlayFabIds")); + for (const FString& item : PlayFabIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddSharedGroupMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("PlayFabIds"), PlayFabIds); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddSharedGroupMembersResult::~FAddSharedGroupMembersResult() +{ + +} + +void PlayFab::ServerModels::FAddSharedGroupMembersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddSharedGroupMembersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddUserVirtualCurrencyRequest::~FAddUserVirtualCurrencyRequest() +{ + +} + +void PlayFab::ServerModels::FAddUserVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddUserVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writePushNotificationPlatformEnumJSON(PushNotificationPlatform enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case PushNotificationPlatformApplePushNotificationService: writer->WriteValue(TEXT("ApplePushNotificationService")); break; + case PushNotificationPlatformGoogleCloudMessaging: writer->WriteValue(TEXT("GoogleCloudMessaging")); break; + } +} + +ServerModels::PushNotificationPlatform PlayFab::ServerModels::readPushNotificationPlatformFromValue(const TSharedPtr& value) +{ + return readPushNotificationPlatformFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::PushNotificationPlatform PlayFab::ServerModels::readPushNotificationPlatformFromValue(const FString& value) +{ + static TMap _PushNotificationPlatformMap; + if (_PushNotificationPlatformMap.Num() == 0) + { + // Auto-generate the map on the first use + _PushNotificationPlatformMap.Add(TEXT("ApplePushNotificationService"), PushNotificationPlatformApplePushNotificationService); + _PushNotificationPlatformMap.Add(TEXT("GoogleCloudMessaging"), PushNotificationPlatformGoogleCloudMessaging); + + } + + if (!value.IsEmpty()) + { + auto output = _PushNotificationPlatformMap.Find(value); + if (output != nullptr) + return *output; + } + + return PushNotificationPlatformApplePushNotificationService; // Basically critical fail +} + +PlayFab::ServerModels::FAdvancedPushPlatformMsg::~FAdvancedPushPlatformMsg() +{ + +} + +void PlayFab::ServerModels::FAdvancedPushPlatformMsg::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Json")); writer->WriteValue(Json); + + writer->WriteIdentifierPrefix(TEXT("Platform")); writePushNotificationPlatformEnumJSON(Platform, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAdvancedPushPlatformMsg::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr JsonValue = obj->TryGetField(TEXT("Json")); + if (JsonValue.IsValid() && !JsonValue->IsNull()) + { + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) { Json = TmpValue; } + } + + Platform = readPushNotificationPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::ServerModels::FAuthenticateSessionTicketRequest::~FAuthenticateSessionTicketRequest() +{ + +} + +void PlayFab::ServerModels::FAuthenticateSessionTicketRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("SessionTicket")); writer->WriteValue(SessionTicket); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAuthenticateSessionTicketRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SessionTicketValue = obj->TryGetField(TEXT("SessionTicket")); + if (SessionTicketValue.IsValid() && !SessionTicketValue->IsNull()) + { + FString TmpValue; + if (SessionTicketValue->TryGetString(TmpValue)) { SessionTicket = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserAndroidDeviceInfo::~FUserAndroidDeviceInfo() +{ + +} + +void PlayFab::ServerModels::FUserAndroidDeviceInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceId")); writer->WriteValue(AndroidDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserAndroidDeviceInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceIdValue = obj->TryGetField(TEXT("AndroidDeviceId")); + if (AndroidDeviceIdValue.IsValid() && !AndroidDeviceIdValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceIdValue->TryGetString(TmpValue)) { AndroidDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserCustomIdInfo::~FUserCustomIdInfo() +{ + +} + +void PlayFab::ServerModels::FUserCustomIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CustomId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomId")); writer->WriteValue(CustomId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserCustomIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomIdValue = obj->TryGetField(TEXT("CustomId")); + if (CustomIdValue.IsValid() && !CustomIdValue->IsNull()) + { + FString TmpValue; + if (CustomIdValue->TryGetString(TmpValue)) { CustomId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserFacebookInfo::~FUserFacebookInfo() +{ + +} + +void PlayFab::ServerModels::FUserFacebookInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookId")); writer->WriteValue(FacebookId); } + + if (FullName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FullName")); writer->WriteValue(FullName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserFacebookInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookIdValue = obj->TryGetField(TEXT("FacebookId")); + if (FacebookIdValue.IsValid() && !FacebookIdValue->IsNull()) + { + FString TmpValue; + if (FacebookIdValue->TryGetString(TmpValue)) { FacebookId = TmpValue; } + } + + const TSharedPtr FullNameValue = obj->TryGetField(TEXT("FullName")); + if (FullNameValue.IsValid() && !FullNameValue->IsNull()) + { + FString TmpValue; + if (FullNameValue->TryGetString(TmpValue)) { FullName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserFacebookInstantGamesIdInfo::~FUserFacebookInstantGamesIdInfo() +{ + +} + +void PlayFab::ServerModels::FUserFacebookInstantGamesIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookInstantGamesId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesId")); writer->WriteValue(FacebookInstantGamesId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserFacebookInstantGamesIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesIdValue = obj->TryGetField(TEXT("FacebookInstantGamesId")); + if (FacebookInstantGamesIdValue.IsValid() && !FacebookInstantGamesIdValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesIdValue->TryGetString(TmpValue)) { FacebookInstantGamesId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserGameCenterInfo::~FUserGameCenterInfo() +{ + +} + +void PlayFab::ServerModels::FUserGameCenterInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GameCenterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameCenterId")); writer->WriteValue(GameCenterId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserGameCenterInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameCenterIdValue = obj->TryGetField(TEXT("GameCenterId")); + if (GameCenterIdValue.IsValid() && !GameCenterIdValue->IsNull()) + { + FString TmpValue; + if (GameCenterIdValue->TryGetString(TmpValue)) { GameCenterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserGoogleInfo::~FUserGoogleInfo() +{ + +} + +void PlayFab::ServerModels::FUserGoogleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GoogleEmail.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleEmail")); writer->WriteValue(GoogleEmail); } + + if (GoogleGender.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleGender")); writer->WriteValue(GoogleGender); } + + if (GoogleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleId")); writer->WriteValue(GoogleId); } + + if (GoogleLocale.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleLocale")); writer->WriteValue(GoogleLocale); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserGoogleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GoogleEmailValue = obj->TryGetField(TEXT("GoogleEmail")); + if (GoogleEmailValue.IsValid() && !GoogleEmailValue->IsNull()) + { + FString TmpValue; + if (GoogleEmailValue->TryGetString(TmpValue)) { GoogleEmail = TmpValue; } + } + + const TSharedPtr GoogleGenderValue = obj->TryGetField(TEXT("GoogleGender")); + if (GoogleGenderValue.IsValid() && !GoogleGenderValue->IsNull()) + { + FString TmpValue; + if (GoogleGenderValue->TryGetString(TmpValue)) { GoogleGender = TmpValue; } + } + + const TSharedPtr GoogleIdValue = obj->TryGetField(TEXT("GoogleId")); + if (GoogleIdValue.IsValid() && !GoogleIdValue->IsNull()) + { + FString TmpValue; + if (GoogleIdValue->TryGetString(TmpValue)) { GoogleId = TmpValue; } + } + + const TSharedPtr GoogleLocaleValue = obj->TryGetField(TEXT("GoogleLocale")); + if (GoogleLocaleValue.IsValid() && !GoogleLocaleValue->IsNull()) + { + FString TmpValue; + if (GoogleLocaleValue->TryGetString(TmpValue)) { GoogleLocale = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserIosDeviceInfo::~FUserIosDeviceInfo() +{ + +} + +void PlayFab::ServerModels::FUserIosDeviceInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IosDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IosDeviceId")); writer->WriteValue(IosDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserIosDeviceInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IosDeviceIdValue = obj->TryGetField(TEXT("IosDeviceId")); + if (IosDeviceIdValue.IsValid() && !IosDeviceIdValue->IsNull()) + { + FString TmpValue; + if (IosDeviceIdValue->TryGetString(TmpValue)) { IosDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserKongregateInfo::~FUserKongregateInfo() +{ + +} + +void PlayFab::ServerModels::FUserKongregateInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (KongregateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateId")); writer->WriteValue(KongregateId); } + + if (KongregateName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateName")); writer->WriteValue(KongregateName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserKongregateInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KongregateIdValue = obj->TryGetField(TEXT("KongregateId")); + if (KongregateIdValue.IsValid() && !KongregateIdValue->IsNull()) + { + FString TmpValue; + if (KongregateIdValue->TryGetString(TmpValue)) { KongregateId = TmpValue; } + } + + const TSharedPtr KongregateNameValue = obj->TryGetField(TEXT("KongregateName")); + if (KongregateNameValue.IsValid() && !KongregateNameValue->IsNull()) + { + FString TmpValue; + if (KongregateNameValue->TryGetString(TmpValue)) { KongregateName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserNintendoSwitchDeviceIdInfo::~FUserNintendoSwitchDeviceIdInfo() +{ + +} + +void PlayFab::ServerModels::FUserNintendoSwitchDeviceIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserNintendoSwitchDeviceIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserOpenIdInfo::~FUserOpenIdInfo() +{ + +} + +void PlayFab::ServerModels::FUserOpenIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ConnectionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ConnectionId")); writer->WriteValue(ConnectionId); } + + if (Issuer.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Issuer")); writer->WriteValue(Issuer); } + + if (Subject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Subject")); writer->WriteValue(Subject); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserOpenIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ConnectionIdValue = obj->TryGetField(TEXT("ConnectionId")); + if (ConnectionIdValue.IsValid() && !ConnectionIdValue->IsNull()) + { + FString TmpValue; + if (ConnectionIdValue->TryGetString(TmpValue)) { ConnectionId = TmpValue; } + } + + const TSharedPtr IssuerValue = obj->TryGetField(TEXT("Issuer")); + if (IssuerValue.IsValid() && !IssuerValue->IsNull()) + { + FString TmpValue; + if (IssuerValue->TryGetString(TmpValue)) { Issuer = TmpValue; } + } + + const TSharedPtr SubjectValue = obj->TryGetField(TEXT("Subject")); + if (SubjectValue.IsValid() && !SubjectValue->IsNull()) + { + FString TmpValue; + if (SubjectValue->TryGetString(TmpValue)) { Subject = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserPrivateAccountInfo::~FUserPrivateAccountInfo() +{ + +} + +void PlayFab::ServerModels::FUserPrivateAccountInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserPrivateAccountInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserPsnInfo::~FUserPsnInfo() +{ + +} + +void PlayFab::ServerModels::FUserPsnInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PsnAccountId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PsnAccountId")); writer->WriteValue(PsnAccountId); } + + if (PsnOnlineId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PsnOnlineId")); writer->WriteValue(PsnOnlineId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserPsnInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PsnAccountIdValue = obj->TryGetField(TEXT("PsnAccountId")); + if (PsnAccountIdValue.IsValid() && !PsnAccountIdValue->IsNull()) + { + FString TmpValue; + if (PsnAccountIdValue->TryGetString(TmpValue)) { PsnAccountId = TmpValue; } + } + + const TSharedPtr PsnOnlineIdValue = obj->TryGetField(TEXT("PsnOnlineId")); + if (PsnOnlineIdValue.IsValid() && !PsnOnlineIdValue->IsNull()) + { + FString TmpValue; + if (PsnOnlineIdValue->TryGetString(TmpValue)) { PsnOnlineId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeTitleActivationStatusEnumJSON(TitleActivationStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case TitleActivationStatusNone: writer->WriteValue(TEXT("None")); break; + case TitleActivationStatusActivatedTitleKey: writer->WriteValue(TEXT("ActivatedTitleKey")); break; + case TitleActivationStatusPendingSteam: writer->WriteValue(TEXT("PendingSteam")); break; + case TitleActivationStatusActivatedSteam: writer->WriteValue(TEXT("ActivatedSteam")); break; + case TitleActivationStatusRevokedSteam: writer->WriteValue(TEXT("RevokedSteam")); break; + } +} + +ServerModels::TitleActivationStatus PlayFab::ServerModels::readTitleActivationStatusFromValue(const TSharedPtr& value) +{ + return readTitleActivationStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::TitleActivationStatus PlayFab::ServerModels::readTitleActivationStatusFromValue(const FString& value) +{ + static TMap _TitleActivationStatusMap; + if (_TitleActivationStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _TitleActivationStatusMap.Add(TEXT("None"), TitleActivationStatusNone); + _TitleActivationStatusMap.Add(TEXT("ActivatedTitleKey"), TitleActivationStatusActivatedTitleKey); + _TitleActivationStatusMap.Add(TEXT("PendingSteam"), TitleActivationStatusPendingSteam); + _TitleActivationStatusMap.Add(TEXT("ActivatedSteam"), TitleActivationStatusActivatedSteam); + _TitleActivationStatusMap.Add(TEXT("RevokedSteam"), TitleActivationStatusRevokedSteam); + + } + + if (!value.IsEmpty()) + { + auto output = _TitleActivationStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return TitleActivationStatusNone; // Basically critical fail +} + +void PlayFab::ServerModels::writeCurrencyEnumJSON(Currency enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CurrencyAED: writer->WriteValue(TEXT("AED")); break; + case CurrencyAFN: writer->WriteValue(TEXT("AFN")); break; + case CurrencyALL: writer->WriteValue(TEXT("ALL")); break; + case CurrencyAMD: writer->WriteValue(TEXT("AMD")); break; + case CurrencyANG: writer->WriteValue(TEXT("ANG")); break; + case CurrencyAOA: writer->WriteValue(TEXT("AOA")); break; + case CurrencyARS: writer->WriteValue(TEXT("ARS")); break; + case CurrencyAUD: writer->WriteValue(TEXT("AUD")); break; + case CurrencyAWG: writer->WriteValue(TEXT("AWG")); break; + case CurrencyAZN: writer->WriteValue(TEXT("AZN")); break; + case CurrencyBAM: writer->WriteValue(TEXT("BAM")); break; + case CurrencyBBD: writer->WriteValue(TEXT("BBD")); break; + case CurrencyBDT: writer->WriteValue(TEXT("BDT")); break; + case CurrencyBGN: writer->WriteValue(TEXT("BGN")); break; + case CurrencyBHD: writer->WriteValue(TEXT("BHD")); break; + case CurrencyBIF: writer->WriteValue(TEXT("BIF")); break; + case CurrencyBMD: writer->WriteValue(TEXT("BMD")); break; + case CurrencyBND: writer->WriteValue(TEXT("BND")); break; + case CurrencyBOB: writer->WriteValue(TEXT("BOB")); break; + case CurrencyBRL: writer->WriteValue(TEXT("BRL")); break; + case CurrencyBSD: writer->WriteValue(TEXT("BSD")); break; + case CurrencyBTN: writer->WriteValue(TEXT("BTN")); break; + case CurrencyBWP: writer->WriteValue(TEXT("BWP")); break; + case CurrencyBYR: writer->WriteValue(TEXT("BYR")); break; + case CurrencyBZD: writer->WriteValue(TEXT("BZD")); break; + case CurrencyCAD: writer->WriteValue(TEXT("CAD")); break; + case CurrencyCDF: writer->WriteValue(TEXT("CDF")); break; + case CurrencyCHF: writer->WriteValue(TEXT("CHF")); break; + case CurrencyCLP: writer->WriteValue(TEXT("CLP")); break; + case CurrencyCNY: writer->WriteValue(TEXT("CNY")); break; + case CurrencyCOP: writer->WriteValue(TEXT("COP")); break; + case CurrencyCRC: writer->WriteValue(TEXT("CRC")); break; + case CurrencyCUC: writer->WriteValue(TEXT("CUC")); break; + case CurrencyCUP: writer->WriteValue(TEXT("CUP")); break; + case CurrencyCVE: writer->WriteValue(TEXT("CVE")); break; + case CurrencyCZK: writer->WriteValue(TEXT("CZK")); break; + case CurrencyDJF: writer->WriteValue(TEXT("DJF")); break; + case CurrencyDKK: writer->WriteValue(TEXT("DKK")); break; + case CurrencyDOP: writer->WriteValue(TEXT("DOP")); break; + case CurrencyDZD: writer->WriteValue(TEXT("DZD")); break; + case CurrencyEGP: writer->WriteValue(TEXT("EGP")); break; + case CurrencyERN: writer->WriteValue(TEXT("ERN")); break; + case CurrencyETB: writer->WriteValue(TEXT("ETB")); break; + case CurrencyEUR: writer->WriteValue(TEXT("EUR")); break; + case CurrencyFJD: writer->WriteValue(TEXT("FJD")); break; + case CurrencyFKP: writer->WriteValue(TEXT("FKP")); break; + case CurrencyGBP: writer->WriteValue(TEXT("GBP")); break; + case CurrencyGEL: writer->WriteValue(TEXT("GEL")); break; + case CurrencyGGP: writer->WriteValue(TEXT("GGP")); break; + case CurrencyGHS: writer->WriteValue(TEXT("GHS")); break; + case CurrencyGIP: writer->WriteValue(TEXT("GIP")); break; + case CurrencyGMD: writer->WriteValue(TEXT("GMD")); break; + case CurrencyGNF: writer->WriteValue(TEXT("GNF")); break; + case CurrencyGTQ: writer->WriteValue(TEXT("GTQ")); break; + case CurrencyGYD: writer->WriteValue(TEXT("GYD")); break; + case CurrencyHKD: writer->WriteValue(TEXT("HKD")); break; + case CurrencyHNL: writer->WriteValue(TEXT("HNL")); break; + case CurrencyHRK: writer->WriteValue(TEXT("HRK")); break; + case CurrencyHTG: writer->WriteValue(TEXT("HTG")); break; + case CurrencyHUF: writer->WriteValue(TEXT("HUF")); break; + case CurrencyIDR: writer->WriteValue(TEXT("IDR")); break; + case CurrencyILS: writer->WriteValue(TEXT("ILS")); break; + case CurrencyIMP: writer->WriteValue(TEXT("IMP")); break; + case CurrencyINR: writer->WriteValue(TEXT("INR")); break; + case CurrencyIQD: writer->WriteValue(TEXT("IQD")); break; + case CurrencyIRR: writer->WriteValue(TEXT("IRR")); break; + case CurrencyISK: writer->WriteValue(TEXT("ISK")); break; + case CurrencyJEP: writer->WriteValue(TEXT("JEP")); break; + case CurrencyJMD: writer->WriteValue(TEXT("JMD")); break; + case CurrencyJOD: writer->WriteValue(TEXT("JOD")); break; + case CurrencyJPY: writer->WriteValue(TEXT("JPY")); break; + case CurrencyKES: writer->WriteValue(TEXT("KES")); break; + case CurrencyKGS: writer->WriteValue(TEXT("KGS")); break; + case CurrencyKHR: writer->WriteValue(TEXT("KHR")); break; + case CurrencyKMF: writer->WriteValue(TEXT("KMF")); break; + case CurrencyKPW: writer->WriteValue(TEXT("KPW")); break; + case CurrencyKRW: writer->WriteValue(TEXT("KRW")); break; + case CurrencyKWD: writer->WriteValue(TEXT("KWD")); break; + case CurrencyKYD: writer->WriteValue(TEXT("KYD")); break; + case CurrencyKZT: writer->WriteValue(TEXT("KZT")); break; + case CurrencyLAK: writer->WriteValue(TEXT("LAK")); break; + case CurrencyLBP: writer->WriteValue(TEXT("LBP")); break; + case CurrencyLKR: writer->WriteValue(TEXT("LKR")); break; + case CurrencyLRD: writer->WriteValue(TEXT("LRD")); break; + case CurrencyLSL: writer->WriteValue(TEXT("LSL")); break; + case CurrencyLYD: writer->WriteValue(TEXT("LYD")); break; + case CurrencyMAD: writer->WriteValue(TEXT("MAD")); break; + case CurrencyMDL: writer->WriteValue(TEXT("MDL")); break; + case CurrencyMGA: writer->WriteValue(TEXT("MGA")); break; + case CurrencyMKD: writer->WriteValue(TEXT("MKD")); break; + case CurrencyMMK: writer->WriteValue(TEXT("MMK")); break; + case CurrencyMNT: writer->WriteValue(TEXT("MNT")); break; + case CurrencyMOP: writer->WriteValue(TEXT("MOP")); break; + case CurrencyMRO: writer->WriteValue(TEXT("MRO")); break; + case CurrencyMUR: writer->WriteValue(TEXT("MUR")); break; + case CurrencyMVR: writer->WriteValue(TEXT("MVR")); break; + case CurrencyMWK: writer->WriteValue(TEXT("MWK")); break; + case CurrencyMXN: writer->WriteValue(TEXT("MXN")); break; + case CurrencyMYR: writer->WriteValue(TEXT("MYR")); break; + case CurrencyMZN: writer->WriteValue(TEXT("MZN")); break; + case CurrencyNAD: writer->WriteValue(TEXT("NAD")); break; + case CurrencyNGN: writer->WriteValue(TEXT("NGN")); break; + case CurrencyNIO: writer->WriteValue(TEXT("NIO")); break; + case CurrencyNOK: writer->WriteValue(TEXT("NOK")); break; + case CurrencyNPR: writer->WriteValue(TEXT("NPR")); break; + case CurrencyNZD: writer->WriteValue(TEXT("NZD")); break; + case CurrencyOMR: writer->WriteValue(TEXT("OMR")); break; + case CurrencyPAB: writer->WriteValue(TEXT("PAB")); break; + case CurrencyPEN: writer->WriteValue(TEXT("PEN")); break; + case CurrencyPGK: writer->WriteValue(TEXT("PGK")); break; + case CurrencyPHP: writer->WriteValue(TEXT("PHP")); break; + case CurrencyPKR: writer->WriteValue(TEXT("PKR")); break; + case CurrencyPLN: writer->WriteValue(TEXT("PLN")); break; + case CurrencyPYG: writer->WriteValue(TEXT("PYG")); break; + case CurrencyQAR: writer->WriteValue(TEXT("QAR")); break; + case CurrencyRON: writer->WriteValue(TEXT("RON")); break; + case CurrencyRSD: writer->WriteValue(TEXT("RSD")); break; + case CurrencyRUB: writer->WriteValue(TEXT("RUB")); break; + case CurrencyRWF: writer->WriteValue(TEXT("RWF")); break; + case CurrencySAR: writer->WriteValue(TEXT("SAR")); break; + case CurrencySBD: writer->WriteValue(TEXT("SBD")); break; + case CurrencySCR: writer->WriteValue(TEXT("SCR")); break; + case CurrencySDG: writer->WriteValue(TEXT("SDG")); break; + case CurrencySEK: writer->WriteValue(TEXT("SEK")); break; + case CurrencySGD: writer->WriteValue(TEXT("SGD")); break; + case CurrencySHP: writer->WriteValue(TEXT("SHP")); break; + case CurrencySLL: writer->WriteValue(TEXT("SLL")); break; + case CurrencySOS: writer->WriteValue(TEXT("SOS")); break; + case CurrencySPL: writer->WriteValue(TEXT("SPL")); break; + case CurrencySRD: writer->WriteValue(TEXT("SRD")); break; + case CurrencySTD: writer->WriteValue(TEXT("STD")); break; + case CurrencySVC: writer->WriteValue(TEXT("SVC")); break; + case CurrencySYP: writer->WriteValue(TEXT("SYP")); break; + case CurrencySZL: writer->WriteValue(TEXT("SZL")); break; + case CurrencyTHB: writer->WriteValue(TEXT("THB")); break; + case CurrencyTJS: writer->WriteValue(TEXT("TJS")); break; + case CurrencyTMT: writer->WriteValue(TEXT("TMT")); break; + case CurrencyTND: writer->WriteValue(TEXT("TND")); break; + case CurrencyTOP: writer->WriteValue(TEXT("TOP")); break; + case CurrencyTRY: writer->WriteValue(TEXT("TRY")); break; + case CurrencyTTD: writer->WriteValue(TEXT("TTD")); break; + case CurrencyTVD: writer->WriteValue(TEXT("TVD")); break; + case CurrencyTWD: writer->WriteValue(TEXT("TWD")); break; + case CurrencyTZS: writer->WriteValue(TEXT("TZS")); break; + case CurrencyUAH: writer->WriteValue(TEXT("UAH")); break; + case CurrencyUGX: writer->WriteValue(TEXT("UGX")); break; + case CurrencyUSD: writer->WriteValue(TEXT("USD")); break; + case CurrencyUYU: writer->WriteValue(TEXT("UYU")); break; + case CurrencyUZS: writer->WriteValue(TEXT("UZS")); break; + case CurrencyVEF: writer->WriteValue(TEXT("VEF")); break; + case CurrencyVND: writer->WriteValue(TEXT("VND")); break; + case CurrencyVUV: writer->WriteValue(TEXT("VUV")); break; + case CurrencyWST: writer->WriteValue(TEXT("WST")); break; + case CurrencyXAF: writer->WriteValue(TEXT("XAF")); break; + case CurrencyXCD: writer->WriteValue(TEXT("XCD")); break; + case CurrencyXDR: writer->WriteValue(TEXT("XDR")); break; + case CurrencyXOF: writer->WriteValue(TEXT("XOF")); break; + case CurrencyXPF: writer->WriteValue(TEXT("XPF")); break; + case CurrencyYER: writer->WriteValue(TEXT("YER")); break; + case CurrencyZAR: writer->WriteValue(TEXT("ZAR")); break; + case CurrencyZMW: writer->WriteValue(TEXT("ZMW")); break; + case CurrencyZWD: writer->WriteValue(TEXT("ZWD")); break; + } +} + +ServerModels::Currency PlayFab::ServerModels::readCurrencyFromValue(const TSharedPtr& value) +{ + return readCurrencyFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::Currency PlayFab::ServerModels::readCurrencyFromValue(const FString& value) +{ + static TMap _CurrencyMap; + if (_CurrencyMap.Num() == 0) + { + // Auto-generate the map on the first use + _CurrencyMap.Add(TEXT("AED"), CurrencyAED); + _CurrencyMap.Add(TEXT("AFN"), CurrencyAFN); + _CurrencyMap.Add(TEXT("ALL"), CurrencyALL); + _CurrencyMap.Add(TEXT("AMD"), CurrencyAMD); + _CurrencyMap.Add(TEXT("ANG"), CurrencyANG); + _CurrencyMap.Add(TEXT("AOA"), CurrencyAOA); + _CurrencyMap.Add(TEXT("ARS"), CurrencyARS); + _CurrencyMap.Add(TEXT("AUD"), CurrencyAUD); + _CurrencyMap.Add(TEXT("AWG"), CurrencyAWG); + _CurrencyMap.Add(TEXT("AZN"), CurrencyAZN); + _CurrencyMap.Add(TEXT("BAM"), CurrencyBAM); + _CurrencyMap.Add(TEXT("BBD"), CurrencyBBD); + _CurrencyMap.Add(TEXT("BDT"), CurrencyBDT); + _CurrencyMap.Add(TEXT("BGN"), CurrencyBGN); + _CurrencyMap.Add(TEXT("BHD"), CurrencyBHD); + _CurrencyMap.Add(TEXT("BIF"), CurrencyBIF); + _CurrencyMap.Add(TEXT("BMD"), CurrencyBMD); + _CurrencyMap.Add(TEXT("BND"), CurrencyBND); + _CurrencyMap.Add(TEXT("BOB"), CurrencyBOB); + _CurrencyMap.Add(TEXT("BRL"), CurrencyBRL); + _CurrencyMap.Add(TEXT("BSD"), CurrencyBSD); + _CurrencyMap.Add(TEXT("BTN"), CurrencyBTN); + _CurrencyMap.Add(TEXT("BWP"), CurrencyBWP); + _CurrencyMap.Add(TEXT("BYR"), CurrencyBYR); + _CurrencyMap.Add(TEXT("BZD"), CurrencyBZD); + _CurrencyMap.Add(TEXT("CAD"), CurrencyCAD); + _CurrencyMap.Add(TEXT("CDF"), CurrencyCDF); + _CurrencyMap.Add(TEXT("CHF"), CurrencyCHF); + _CurrencyMap.Add(TEXT("CLP"), CurrencyCLP); + _CurrencyMap.Add(TEXT("CNY"), CurrencyCNY); + _CurrencyMap.Add(TEXT("COP"), CurrencyCOP); + _CurrencyMap.Add(TEXT("CRC"), CurrencyCRC); + _CurrencyMap.Add(TEXT("CUC"), CurrencyCUC); + _CurrencyMap.Add(TEXT("CUP"), CurrencyCUP); + _CurrencyMap.Add(TEXT("CVE"), CurrencyCVE); + _CurrencyMap.Add(TEXT("CZK"), CurrencyCZK); + _CurrencyMap.Add(TEXT("DJF"), CurrencyDJF); + _CurrencyMap.Add(TEXT("DKK"), CurrencyDKK); + _CurrencyMap.Add(TEXT("DOP"), CurrencyDOP); + _CurrencyMap.Add(TEXT("DZD"), CurrencyDZD); + _CurrencyMap.Add(TEXT("EGP"), CurrencyEGP); + _CurrencyMap.Add(TEXT("ERN"), CurrencyERN); + _CurrencyMap.Add(TEXT("ETB"), CurrencyETB); + _CurrencyMap.Add(TEXT("EUR"), CurrencyEUR); + _CurrencyMap.Add(TEXT("FJD"), CurrencyFJD); + _CurrencyMap.Add(TEXT("FKP"), CurrencyFKP); + _CurrencyMap.Add(TEXT("GBP"), CurrencyGBP); + _CurrencyMap.Add(TEXT("GEL"), CurrencyGEL); + _CurrencyMap.Add(TEXT("GGP"), CurrencyGGP); + _CurrencyMap.Add(TEXT("GHS"), CurrencyGHS); + _CurrencyMap.Add(TEXT("GIP"), CurrencyGIP); + _CurrencyMap.Add(TEXT("GMD"), CurrencyGMD); + _CurrencyMap.Add(TEXT("GNF"), CurrencyGNF); + _CurrencyMap.Add(TEXT("GTQ"), CurrencyGTQ); + _CurrencyMap.Add(TEXT("GYD"), CurrencyGYD); + _CurrencyMap.Add(TEXT("HKD"), CurrencyHKD); + _CurrencyMap.Add(TEXT("HNL"), CurrencyHNL); + _CurrencyMap.Add(TEXT("HRK"), CurrencyHRK); + _CurrencyMap.Add(TEXT("HTG"), CurrencyHTG); + _CurrencyMap.Add(TEXT("HUF"), CurrencyHUF); + _CurrencyMap.Add(TEXT("IDR"), CurrencyIDR); + _CurrencyMap.Add(TEXT("ILS"), CurrencyILS); + _CurrencyMap.Add(TEXT("IMP"), CurrencyIMP); + _CurrencyMap.Add(TEXT("INR"), CurrencyINR); + _CurrencyMap.Add(TEXT("IQD"), CurrencyIQD); + _CurrencyMap.Add(TEXT("IRR"), CurrencyIRR); + _CurrencyMap.Add(TEXT("ISK"), CurrencyISK); + _CurrencyMap.Add(TEXT("JEP"), CurrencyJEP); + _CurrencyMap.Add(TEXT("JMD"), CurrencyJMD); + _CurrencyMap.Add(TEXT("JOD"), CurrencyJOD); + _CurrencyMap.Add(TEXT("JPY"), CurrencyJPY); + _CurrencyMap.Add(TEXT("KES"), CurrencyKES); + _CurrencyMap.Add(TEXT("KGS"), CurrencyKGS); + _CurrencyMap.Add(TEXT("KHR"), CurrencyKHR); + _CurrencyMap.Add(TEXT("KMF"), CurrencyKMF); + _CurrencyMap.Add(TEXT("KPW"), CurrencyKPW); + _CurrencyMap.Add(TEXT("KRW"), CurrencyKRW); + _CurrencyMap.Add(TEXT("KWD"), CurrencyKWD); + _CurrencyMap.Add(TEXT("KYD"), CurrencyKYD); + _CurrencyMap.Add(TEXT("KZT"), CurrencyKZT); + _CurrencyMap.Add(TEXT("LAK"), CurrencyLAK); + _CurrencyMap.Add(TEXT("LBP"), CurrencyLBP); + _CurrencyMap.Add(TEXT("LKR"), CurrencyLKR); + _CurrencyMap.Add(TEXT("LRD"), CurrencyLRD); + _CurrencyMap.Add(TEXT("LSL"), CurrencyLSL); + _CurrencyMap.Add(TEXT("LYD"), CurrencyLYD); + _CurrencyMap.Add(TEXT("MAD"), CurrencyMAD); + _CurrencyMap.Add(TEXT("MDL"), CurrencyMDL); + _CurrencyMap.Add(TEXT("MGA"), CurrencyMGA); + _CurrencyMap.Add(TEXT("MKD"), CurrencyMKD); + _CurrencyMap.Add(TEXT("MMK"), CurrencyMMK); + _CurrencyMap.Add(TEXT("MNT"), CurrencyMNT); + _CurrencyMap.Add(TEXT("MOP"), CurrencyMOP); + _CurrencyMap.Add(TEXT("MRO"), CurrencyMRO); + _CurrencyMap.Add(TEXT("MUR"), CurrencyMUR); + _CurrencyMap.Add(TEXT("MVR"), CurrencyMVR); + _CurrencyMap.Add(TEXT("MWK"), CurrencyMWK); + _CurrencyMap.Add(TEXT("MXN"), CurrencyMXN); + _CurrencyMap.Add(TEXT("MYR"), CurrencyMYR); + _CurrencyMap.Add(TEXT("MZN"), CurrencyMZN); + _CurrencyMap.Add(TEXT("NAD"), CurrencyNAD); + _CurrencyMap.Add(TEXT("NGN"), CurrencyNGN); + _CurrencyMap.Add(TEXT("NIO"), CurrencyNIO); + _CurrencyMap.Add(TEXT("NOK"), CurrencyNOK); + _CurrencyMap.Add(TEXT("NPR"), CurrencyNPR); + _CurrencyMap.Add(TEXT("NZD"), CurrencyNZD); + _CurrencyMap.Add(TEXT("OMR"), CurrencyOMR); + _CurrencyMap.Add(TEXT("PAB"), CurrencyPAB); + _CurrencyMap.Add(TEXT("PEN"), CurrencyPEN); + _CurrencyMap.Add(TEXT("PGK"), CurrencyPGK); + _CurrencyMap.Add(TEXT("PHP"), CurrencyPHP); + _CurrencyMap.Add(TEXT("PKR"), CurrencyPKR); + _CurrencyMap.Add(TEXT("PLN"), CurrencyPLN); + _CurrencyMap.Add(TEXT("PYG"), CurrencyPYG); + _CurrencyMap.Add(TEXT("QAR"), CurrencyQAR); + _CurrencyMap.Add(TEXT("RON"), CurrencyRON); + _CurrencyMap.Add(TEXT("RSD"), CurrencyRSD); + _CurrencyMap.Add(TEXT("RUB"), CurrencyRUB); + _CurrencyMap.Add(TEXT("RWF"), CurrencyRWF); + _CurrencyMap.Add(TEXT("SAR"), CurrencySAR); + _CurrencyMap.Add(TEXT("SBD"), CurrencySBD); + _CurrencyMap.Add(TEXT("SCR"), CurrencySCR); + _CurrencyMap.Add(TEXT("SDG"), CurrencySDG); + _CurrencyMap.Add(TEXT("SEK"), CurrencySEK); + _CurrencyMap.Add(TEXT("SGD"), CurrencySGD); + _CurrencyMap.Add(TEXT("SHP"), CurrencySHP); + _CurrencyMap.Add(TEXT("SLL"), CurrencySLL); + _CurrencyMap.Add(TEXT("SOS"), CurrencySOS); + _CurrencyMap.Add(TEXT("SPL"), CurrencySPL); + _CurrencyMap.Add(TEXT("SRD"), CurrencySRD); + _CurrencyMap.Add(TEXT("STD"), CurrencySTD); + _CurrencyMap.Add(TEXT("SVC"), CurrencySVC); + _CurrencyMap.Add(TEXT("SYP"), CurrencySYP); + _CurrencyMap.Add(TEXT("SZL"), CurrencySZL); + _CurrencyMap.Add(TEXT("THB"), CurrencyTHB); + _CurrencyMap.Add(TEXT("TJS"), CurrencyTJS); + _CurrencyMap.Add(TEXT("TMT"), CurrencyTMT); + _CurrencyMap.Add(TEXT("TND"), CurrencyTND); + _CurrencyMap.Add(TEXT("TOP"), CurrencyTOP); + _CurrencyMap.Add(TEXT("TRY"), CurrencyTRY); + _CurrencyMap.Add(TEXT("TTD"), CurrencyTTD); + _CurrencyMap.Add(TEXT("TVD"), CurrencyTVD); + _CurrencyMap.Add(TEXT("TWD"), CurrencyTWD); + _CurrencyMap.Add(TEXT("TZS"), CurrencyTZS); + _CurrencyMap.Add(TEXT("UAH"), CurrencyUAH); + _CurrencyMap.Add(TEXT("UGX"), CurrencyUGX); + _CurrencyMap.Add(TEXT("USD"), CurrencyUSD); + _CurrencyMap.Add(TEXT("UYU"), CurrencyUYU); + _CurrencyMap.Add(TEXT("UZS"), CurrencyUZS); + _CurrencyMap.Add(TEXT("VEF"), CurrencyVEF); + _CurrencyMap.Add(TEXT("VND"), CurrencyVND); + _CurrencyMap.Add(TEXT("VUV"), CurrencyVUV); + _CurrencyMap.Add(TEXT("WST"), CurrencyWST); + _CurrencyMap.Add(TEXT("XAF"), CurrencyXAF); + _CurrencyMap.Add(TEXT("XCD"), CurrencyXCD); + _CurrencyMap.Add(TEXT("XDR"), CurrencyXDR); + _CurrencyMap.Add(TEXT("XOF"), CurrencyXOF); + _CurrencyMap.Add(TEXT("XPF"), CurrencyXPF); + _CurrencyMap.Add(TEXT("YER"), CurrencyYER); + _CurrencyMap.Add(TEXT("ZAR"), CurrencyZAR); + _CurrencyMap.Add(TEXT("ZMW"), CurrencyZMW); + _CurrencyMap.Add(TEXT("ZWD"), CurrencyZWD); + + } + + if (!value.IsEmpty()) + { + auto output = _CurrencyMap.Find(value); + if (output != nullptr) + return *output; + } + + return CurrencyAED; // Basically critical fail +} + +PlayFab::ServerModels::FUserSteamInfo::~FUserSteamInfo() +{ + +} + +void PlayFab::ServerModels::FUserSteamInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SteamActivationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("SteamActivationStatus")); writeTitleActivationStatusEnumJSON(SteamActivationStatus, writer); } + + if (SteamCountry.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamCountry")); writer->WriteValue(SteamCountry); } + + if (SteamCurrency.notNull()) { writer->WriteIdentifierPrefix(TEXT("SteamCurrency")); writeCurrencyEnumJSON(SteamCurrency, writer); } + + if (SteamId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamId")); writer->WriteValue(SteamId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserSteamInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + SteamActivationStatus = readTitleActivationStatusFromValue(obj->TryGetField(TEXT("SteamActivationStatus"))); + + const TSharedPtr SteamCountryValue = obj->TryGetField(TEXT("SteamCountry")); + if (SteamCountryValue.IsValid() && !SteamCountryValue->IsNull()) + { + FString TmpValue; + if (SteamCountryValue->TryGetString(TmpValue)) { SteamCountry = TmpValue; } + } + + SteamCurrency = readCurrencyFromValue(obj->TryGetField(TEXT("SteamCurrency"))); + + const TSharedPtr SteamIdValue = obj->TryGetField(TEXT("SteamId")); + if (SteamIdValue.IsValid() && !SteamIdValue->IsNull()) + { + FString TmpValue; + if (SteamIdValue->TryGetString(TmpValue)) { SteamId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeUserOriginationEnumJSON(UserOrigination enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case UserOriginationOrganic: writer->WriteValue(TEXT("Organic")); break; + case UserOriginationSteam: writer->WriteValue(TEXT("Steam")); break; + case UserOriginationGoogle: writer->WriteValue(TEXT("Google")); break; + case UserOriginationAmazon: writer->WriteValue(TEXT("Amazon")); break; + case UserOriginationFacebook: writer->WriteValue(TEXT("Facebook")); break; + case UserOriginationKongregate: writer->WriteValue(TEXT("Kongregate")); break; + case UserOriginationGamersFirst: writer->WriteValue(TEXT("GamersFirst")); break; + case UserOriginationUnknown: writer->WriteValue(TEXT("Unknown")); break; + case UserOriginationIOS: writer->WriteValue(TEXT("IOS")); break; + case UserOriginationLoadTest: writer->WriteValue(TEXT("LoadTest")); break; + case UserOriginationAndroid: writer->WriteValue(TEXT("Android")); break; + case UserOriginationPSN: writer->WriteValue(TEXT("PSN")); break; + case UserOriginationGameCenter: writer->WriteValue(TEXT("GameCenter")); break; + case UserOriginationCustomId: writer->WriteValue(TEXT("CustomId")); break; + case UserOriginationXboxLive: writer->WriteValue(TEXT("XboxLive")); break; + case UserOriginationParse: writer->WriteValue(TEXT("Parse")); break; + case UserOriginationTwitch: writer->WriteValue(TEXT("Twitch")); break; + case UserOriginationWindowsHello: writer->WriteValue(TEXT("WindowsHello")); break; + case UserOriginationServerCustomId: writer->WriteValue(TEXT("ServerCustomId")); break; + case UserOriginationNintendoSwitchDeviceId: writer->WriteValue(TEXT("NintendoSwitchDeviceId")); break; + case UserOriginationFacebookInstantGamesId: writer->WriteValue(TEXT("FacebookInstantGamesId")); break; + case UserOriginationOpenIdConnect: writer->WriteValue(TEXT("OpenIdConnect")); break; + } +} + +ServerModels::UserOrigination PlayFab::ServerModels::readUserOriginationFromValue(const TSharedPtr& value) +{ + return readUserOriginationFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::UserOrigination PlayFab::ServerModels::readUserOriginationFromValue(const FString& value) +{ + static TMap _UserOriginationMap; + if (_UserOriginationMap.Num() == 0) + { + // Auto-generate the map on the first use + _UserOriginationMap.Add(TEXT("Organic"), UserOriginationOrganic); + _UserOriginationMap.Add(TEXT("Steam"), UserOriginationSteam); + _UserOriginationMap.Add(TEXT("Google"), UserOriginationGoogle); + _UserOriginationMap.Add(TEXT("Amazon"), UserOriginationAmazon); + _UserOriginationMap.Add(TEXT("Facebook"), UserOriginationFacebook); + _UserOriginationMap.Add(TEXT("Kongregate"), UserOriginationKongregate); + _UserOriginationMap.Add(TEXT("GamersFirst"), UserOriginationGamersFirst); + _UserOriginationMap.Add(TEXT("Unknown"), UserOriginationUnknown); + _UserOriginationMap.Add(TEXT("IOS"), UserOriginationIOS); + _UserOriginationMap.Add(TEXT("LoadTest"), UserOriginationLoadTest); + _UserOriginationMap.Add(TEXT("Android"), UserOriginationAndroid); + _UserOriginationMap.Add(TEXT("PSN"), UserOriginationPSN); + _UserOriginationMap.Add(TEXT("GameCenter"), UserOriginationGameCenter); + _UserOriginationMap.Add(TEXT("CustomId"), UserOriginationCustomId); + _UserOriginationMap.Add(TEXT("XboxLive"), UserOriginationXboxLive); + _UserOriginationMap.Add(TEXT("Parse"), UserOriginationParse); + _UserOriginationMap.Add(TEXT("Twitch"), UserOriginationTwitch); + _UserOriginationMap.Add(TEXT("WindowsHello"), UserOriginationWindowsHello); + _UserOriginationMap.Add(TEXT("ServerCustomId"), UserOriginationServerCustomId); + _UserOriginationMap.Add(TEXT("NintendoSwitchDeviceId"), UserOriginationNintendoSwitchDeviceId); + _UserOriginationMap.Add(TEXT("FacebookInstantGamesId"), UserOriginationFacebookInstantGamesId); + _UserOriginationMap.Add(TEXT("OpenIdConnect"), UserOriginationOpenIdConnect); + + } + + if (!value.IsEmpty()) + { + auto output = _UserOriginationMap.Find(value); + if (output != nullptr) + return *output; + } + + return UserOriginationOrganic; // Basically critical fail +} + +PlayFab::ServerModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::ServerModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserTitleInfo::~FUserTitleInfo() +{ + //if (TitlePlayerAccount != nullptr) delete TitlePlayerAccount; + +} + +void PlayFab::ServerModels::FUserTitleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (FirstLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("FirstLogin")); writeDatetime(FirstLogin, writer); } + + if (isBanned.notNull()) { writer->WriteIdentifierPrefix(TEXT("isBanned")); writer->WriteValue(isBanned); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeUserOriginationEnumJSON(Origination, writer); } + + if (TitlePlayerAccount.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TitlePlayerAccount")); TitlePlayerAccount->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserTitleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr FirstLoginValue = obj->TryGetField(TEXT("FirstLogin")); + if (FirstLoginValue.IsValid()) + FirstLogin = readDatetime(FirstLoginValue); + + + const TSharedPtr isBannedValue = obj->TryGetField(TEXT("isBanned")); + if (isBannedValue.IsValid() && !isBannedValue->IsNull()) + { + bool TmpValue; + if (isBannedValue->TryGetBool(TmpValue)) { isBanned = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + Origination = readUserOriginationFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr TitlePlayerAccountValue = obj->TryGetField(TEXT("TitlePlayerAccount")); + if (TitlePlayerAccountValue.IsValid() && !TitlePlayerAccountValue->IsNull()) + { + TitlePlayerAccount = MakeShareable(new FEntityKey(TitlePlayerAccountValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserTwitchInfo::~FUserTwitchInfo() +{ + +} + +void PlayFab::ServerModels::FUserTwitchInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TwitchId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchId")); writer->WriteValue(TwitchId); } + + if (TwitchUserName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchUserName")); writer->WriteValue(TwitchUserName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserTwitchInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TwitchIdValue = obj->TryGetField(TEXT("TwitchId")); + if (TwitchIdValue.IsValid() && !TwitchIdValue->IsNull()) + { + FString TmpValue; + if (TwitchIdValue->TryGetString(TmpValue)) { TwitchId = TmpValue; } + } + + const TSharedPtr TwitchUserNameValue = obj->TryGetField(TEXT("TwitchUserName")); + if (TwitchUserNameValue.IsValid() && !TwitchUserNameValue->IsNull()) + { + FString TmpValue; + if (TwitchUserNameValue->TryGetString(TmpValue)) { TwitchUserName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserWindowsHelloInfo::~FUserWindowsHelloInfo() +{ + +} + +void PlayFab::ServerModels::FUserWindowsHelloInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (WindowsHelloDeviceName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloDeviceName")); writer->WriteValue(WindowsHelloDeviceName); } + + if (WindowsHelloPublicKeyHash.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloPublicKeyHash")); writer->WriteValue(WindowsHelloPublicKeyHash); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserWindowsHelloInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr WindowsHelloDeviceNameValue = obj->TryGetField(TEXT("WindowsHelloDeviceName")); + if (WindowsHelloDeviceNameValue.IsValid() && !WindowsHelloDeviceNameValue->IsNull()) + { + FString TmpValue; + if (WindowsHelloDeviceNameValue->TryGetString(TmpValue)) { WindowsHelloDeviceName = TmpValue; } + } + + const TSharedPtr WindowsHelloPublicKeyHashValue = obj->TryGetField(TEXT("WindowsHelloPublicKeyHash")); + if (WindowsHelloPublicKeyHashValue.IsValid() && !WindowsHelloPublicKeyHashValue->IsNull()) + { + FString TmpValue; + if (WindowsHelloPublicKeyHashValue->TryGetString(TmpValue)) { WindowsHelloPublicKeyHash = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserXboxInfo::~FUserXboxInfo() +{ + +} + +void PlayFab::ServerModels::FUserXboxInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (XboxUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxUserId")); writer->WriteValue(XboxUserId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserXboxInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr XboxUserIdValue = obj->TryGetField(TEXT("XboxUserId")); + if (XboxUserIdValue.IsValid() && !XboxUserIdValue->IsNull()) + { + FString TmpValue; + if (XboxUserIdValue->TryGetString(TmpValue)) { XboxUserId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserAccountInfo::~FUserAccountInfo() +{ + //if (AndroidDeviceInfo != nullptr) delete AndroidDeviceInfo; + //if (CustomIdInfo != nullptr) delete CustomIdInfo; + //if (FacebookInfo != nullptr) delete FacebookInfo; + //if (FacebookInstantGamesIdInfo != nullptr) delete FacebookInstantGamesIdInfo; + //if (GameCenterInfo != nullptr) delete GameCenterInfo; + //if (GoogleInfo != nullptr) delete GoogleInfo; + //if (IosDeviceInfo != nullptr) delete IosDeviceInfo; + //if (KongregateInfo != nullptr) delete KongregateInfo; + //if (NintendoSwitchDeviceIdInfo != nullptr) delete NintendoSwitchDeviceIdInfo; + //if (PrivateInfo != nullptr) delete PrivateInfo; + //if (PsnInfo != nullptr) delete PsnInfo; + //if (SteamInfo != nullptr) delete SteamInfo; + //if (TitleInfo != nullptr) delete TitleInfo; + //if (TwitchInfo != nullptr) delete TwitchInfo; + //if (WindowsHelloInfo != nullptr) delete WindowsHelloInfo; + //if (XboxInfo != nullptr) delete XboxInfo; + +} + +void PlayFab::ServerModels::FUserAccountInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceInfo")); AndroidDeviceInfo->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + if (CustomIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("CustomIdInfo")); CustomIdInfo->writeJSON(writer); } + + if (FacebookInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInfo")); FacebookInfo->writeJSON(writer); } + + if (FacebookInstantGamesIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesIdInfo")); FacebookInstantGamesIdInfo->writeJSON(writer); } + + if (GameCenterInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GameCenterInfo")); GameCenterInfo->writeJSON(writer); } + + if (GoogleInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GoogleInfo")); GoogleInfo->writeJSON(writer); } + + if (IosDeviceInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("IosDeviceInfo")); IosDeviceInfo->writeJSON(writer); } + + if (KongregateInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("KongregateInfo")); KongregateInfo->writeJSON(writer); } + + if (NintendoSwitchDeviceIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceIdInfo")); NintendoSwitchDeviceIdInfo->writeJSON(writer); } + + if (OpenIdInfo.Num() != 0) + { + writer->WriteArrayStart(TEXT("OpenIdInfo")); + for (const FUserOpenIdInfo& item : OpenIdInfo) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (PrivateInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PrivateInfo")); PrivateInfo->writeJSON(writer); } + + if (PsnInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PsnInfo")); PsnInfo->writeJSON(writer); } + + if (SteamInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SteamInfo")); SteamInfo->writeJSON(writer); } + + if (TitleInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TitleInfo")); TitleInfo->writeJSON(writer); } + + if (TwitchInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TwitchInfo")); TwitchInfo->writeJSON(writer); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + if (WindowsHelloInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloInfo")); WindowsHelloInfo->writeJSON(writer); } + + if (XboxInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("XboxInfo")); XboxInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserAccountInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceInfoValue = obj->TryGetField(TEXT("AndroidDeviceInfo")); + if (AndroidDeviceInfoValue.IsValid() && !AndroidDeviceInfoValue->IsNull()) + { + AndroidDeviceInfo = MakeShareable(new FUserAndroidDeviceInfo(AndroidDeviceInfoValue->AsObject())); + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr CustomIdInfoValue = obj->TryGetField(TEXT("CustomIdInfo")); + if (CustomIdInfoValue.IsValid() && !CustomIdInfoValue->IsNull()) + { + CustomIdInfo = MakeShareable(new FUserCustomIdInfo(CustomIdInfoValue->AsObject())); + } + + const TSharedPtr FacebookInfoValue = obj->TryGetField(TEXT("FacebookInfo")); + if (FacebookInfoValue.IsValid() && !FacebookInfoValue->IsNull()) + { + FacebookInfo = MakeShareable(new FUserFacebookInfo(FacebookInfoValue->AsObject())); + } + + const TSharedPtr FacebookInstantGamesIdInfoValue = obj->TryGetField(TEXT("FacebookInstantGamesIdInfo")); + if (FacebookInstantGamesIdInfoValue.IsValid() && !FacebookInstantGamesIdInfoValue->IsNull()) + { + FacebookInstantGamesIdInfo = MakeShareable(new FUserFacebookInstantGamesIdInfo(FacebookInstantGamesIdInfoValue->AsObject())); + } + + const TSharedPtr GameCenterInfoValue = obj->TryGetField(TEXT("GameCenterInfo")); + if (GameCenterInfoValue.IsValid() && !GameCenterInfoValue->IsNull()) + { + GameCenterInfo = MakeShareable(new FUserGameCenterInfo(GameCenterInfoValue->AsObject())); + } + + const TSharedPtr GoogleInfoValue = obj->TryGetField(TEXT("GoogleInfo")); + if (GoogleInfoValue.IsValid() && !GoogleInfoValue->IsNull()) + { + GoogleInfo = MakeShareable(new FUserGoogleInfo(GoogleInfoValue->AsObject())); + } + + const TSharedPtr IosDeviceInfoValue = obj->TryGetField(TEXT("IosDeviceInfo")); + if (IosDeviceInfoValue.IsValid() && !IosDeviceInfoValue->IsNull()) + { + IosDeviceInfo = MakeShareable(new FUserIosDeviceInfo(IosDeviceInfoValue->AsObject())); + } + + const TSharedPtr KongregateInfoValue = obj->TryGetField(TEXT("KongregateInfo")); + if (KongregateInfoValue.IsValid() && !KongregateInfoValue->IsNull()) + { + KongregateInfo = MakeShareable(new FUserKongregateInfo(KongregateInfoValue->AsObject())); + } + + const TSharedPtr NintendoSwitchDeviceIdInfoValue = obj->TryGetField(TEXT("NintendoSwitchDeviceIdInfo")); + if (NintendoSwitchDeviceIdInfoValue.IsValid() && !NintendoSwitchDeviceIdInfoValue->IsNull()) + { + NintendoSwitchDeviceIdInfo = MakeShareable(new FUserNintendoSwitchDeviceIdInfo(NintendoSwitchDeviceIdInfoValue->AsObject())); + } + + const TArray>&OpenIdInfoArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("OpenIdInfo")); + for (int32 Idx = 0; Idx < OpenIdInfoArray.Num(); Idx++) + { + TSharedPtr CurrentItem = OpenIdInfoArray[Idx]; + OpenIdInfo.Add(FUserOpenIdInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PrivateInfoValue = obj->TryGetField(TEXT("PrivateInfo")); + if (PrivateInfoValue.IsValid() && !PrivateInfoValue->IsNull()) + { + PrivateInfo = MakeShareable(new FUserPrivateAccountInfo(PrivateInfoValue->AsObject())); + } + + const TSharedPtr PsnInfoValue = obj->TryGetField(TEXT("PsnInfo")); + if (PsnInfoValue.IsValid() && !PsnInfoValue->IsNull()) + { + PsnInfo = MakeShareable(new FUserPsnInfo(PsnInfoValue->AsObject())); + } + + const TSharedPtr SteamInfoValue = obj->TryGetField(TEXT("SteamInfo")); + if (SteamInfoValue.IsValid() && !SteamInfoValue->IsNull()) + { + SteamInfo = MakeShareable(new FUserSteamInfo(SteamInfoValue->AsObject())); + } + + const TSharedPtr TitleInfoValue = obj->TryGetField(TEXT("TitleInfo")); + if (TitleInfoValue.IsValid() && !TitleInfoValue->IsNull()) + { + TitleInfo = MakeShareable(new FUserTitleInfo(TitleInfoValue->AsObject())); + } + + const TSharedPtr TwitchInfoValue = obj->TryGetField(TEXT("TwitchInfo")); + if (TwitchInfoValue.IsValid() && !TwitchInfoValue->IsNull()) + { + TwitchInfo = MakeShareable(new FUserTwitchInfo(TwitchInfoValue->AsObject())); + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + const TSharedPtr WindowsHelloInfoValue = obj->TryGetField(TEXT("WindowsHelloInfo")); + if (WindowsHelloInfoValue.IsValid() && !WindowsHelloInfoValue->IsNull()) + { + WindowsHelloInfo = MakeShareable(new FUserWindowsHelloInfo(WindowsHelloInfoValue->AsObject())); + } + + const TSharedPtr XboxInfoValue = obj->TryGetField(TEXT("XboxInfo")); + if (XboxInfoValue.IsValid() && !XboxInfoValue->IsNull()) + { + XboxInfo = MakeShareable(new FUserXboxInfo(XboxInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAuthenticateSessionTicketResult::~FAuthenticateSessionTicketResult() +{ + //if (UserInfo != nullptr) delete UserInfo; + +} + +void PlayFab::ServerModels::FAuthenticateSessionTicketResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (UserInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("UserInfo")); UserInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAuthenticateSessionTicketResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UserInfoValue = obj->TryGetField(TEXT("UserInfo")); + if (UserInfoValue.IsValid() && !UserInfoValue->IsNull()) + { + UserInfo = MakeShareable(new FUserAccountInfo(UserInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAwardSteamAchievementItem::~FAwardSteamAchievementItem() +{ + +} + +void PlayFab::ServerModels::FAwardSteamAchievementItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AchievementName")); writer->WriteValue(AchievementName); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("Result")); writer->WriteValue(Result); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAwardSteamAchievementItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AchievementNameValue = obj->TryGetField(TEXT("AchievementName")); + if (AchievementNameValue.IsValid() && !AchievementNameValue->IsNull()) + { + FString TmpValue; + if (AchievementNameValue->TryGetString(TmpValue)) { AchievementName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ResultValue = obj->TryGetField(TEXT("Result")); + if (ResultValue.IsValid() && !ResultValue->IsNull()) + { + bool TmpValue; + if (ResultValue->TryGetBool(TmpValue)) { Result = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAwardSteamAchievementRequest::~FAwardSteamAchievementRequest() +{ + +} + +void PlayFab::ServerModels::FAwardSteamAchievementRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Achievements")); + for (const FAwardSteamAchievementItem& item : Achievements) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAwardSteamAchievementRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AchievementsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Achievements")); + for (int32 Idx = 0; Idx < AchievementsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AchievementsArray[Idx]; + Achievements.Add(FAwardSteamAchievementItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FAwardSteamAchievementResult::~FAwardSteamAchievementResult() +{ + +} + +void PlayFab::ServerModels::FAwardSteamAchievementResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AchievementResults.Num() != 0) + { + writer->WriteArrayStart(TEXT("AchievementResults")); + for (const FAwardSteamAchievementItem& item : AchievementResults) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAwardSteamAchievementResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AchievementResultsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AchievementResults")); + for (int32 Idx = 0; Idx < AchievementResultsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AchievementResultsArray[Idx]; + AchievementResults.Add(FAwardSteamAchievementItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FBanInfo::~FBanInfo() +{ + +} + +void PlayFab::ServerModels::FBanInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Active")); writer->WriteValue(Active); + + if (BanId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BanId")); writer->WriteValue(BanId); } + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (Expires.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); } + + if (IPAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IPAddress")); writer->WriteValue(IPAddress); } + + if (MACAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MACAddress")); writer->WriteValue(MACAddress); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FBanInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActiveValue = obj->TryGetField(TEXT("Active")); + if (ActiveValue.IsValid() && !ActiveValue->IsNull()) + { + bool TmpValue; + if (ActiveValue->TryGetBool(TmpValue)) { Active = TmpValue; } + } + + const TSharedPtr BanIdValue = obj->TryGetField(TEXT("BanId")); + if (BanIdValue.IsValid() && !BanIdValue->IsNull()) + { + FString TmpValue; + if (BanIdValue->TryGetString(TmpValue)) { BanId = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr IPAddressValue = obj->TryGetField(TEXT("IPAddress")); + if (IPAddressValue.IsValid() && !IPAddressValue->IsNull()) + { + FString TmpValue; + if (IPAddressValue->TryGetString(TmpValue)) { IPAddress = TmpValue; } + } + + const TSharedPtr MACAddressValue = obj->TryGetField(TEXT("MACAddress")); + if (MACAddressValue.IsValid() && !MACAddressValue->IsNull()) + { + FString TmpValue; + if (MACAddressValue->TryGetString(TmpValue)) { MACAddress = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FBanRequest::~FBanRequest() +{ + +} + +void PlayFab::ServerModels::FBanRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DurationInHours.notNull()) { writer->WriteIdentifierPrefix(TEXT("DurationInHours")); writer->WriteValue(static_cast(DurationInHours)); } + + if (IPAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IPAddress")); writer->WriteValue(IPAddress); } + + if (MACAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MACAddress")); writer->WriteValue(MACAddress); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FBanRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DurationInHoursValue = obj->TryGetField(TEXT("DurationInHours")); + if (DurationInHoursValue.IsValid() && !DurationInHoursValue->IsNull()) + { + uint32 TmpValue; + if (DurationInHoursValue->TryGetNumber(TmpValue)) { DurationInHours = TmpValue; } + } + + const TSharedPtr IPAddressValue = obj->TryGetField(TEXT("IPAddress")); + if (IPAddressValue.IsValid() && !IPAddressValue->IsNull()) + { + FString TmpValue; + if (IPAddressValue->TryGetString(TmpValue)) { IPAddress = TmpValue; } + } + + const TSharedPtr MACAddressValue = obj->TryGetField(TEXT("MACAddress")); + if (MACAddressValue.IsValid() && !MACAddressValue->IsNull()) + { + FString TmpValue; + if (MACAddressValue->TryGetString(TmpValue)) { MACAddress = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FBanUsersRequest::~FBanUsersRequest() +{ + +} + +void PlayFab::ServerModels::FBanUsersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Bans")); + for (const FBanRequest& item : Bans) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FBanUsersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BansArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Bans")); + for (int32 Idx = 0; Idx < BansArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BansArray[Idx]; + Bans.Add(FBanRequest(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FBanUsersResult::~FBanUsersResult() +{ + +} + +void PlayFab::ServerModels::FBanUsersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FBanUsersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FCatalogItemBundleInfo::~FCatalogItemBundleInfo() +{ + +} + +void PlayFab::ServerModels::FCatalogItemBundleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BundledItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundledItems")); + for (const FString& item : BundledItems) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundledResultTables.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundledResultTables")); + for (const FString& item : BundledResultTables) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundledVirtualCurrencies.Num() != 0) + { + writer->WriteObjectStart(TEXT("BundledVirtualCurrencies")); + for (TMap::TConstIterator It(BundledVirtualCurrencies); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCatalogItemBundleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("BundledItems"), BundledItems); + + obj->TryGetStringArrayField(TEXT("BundledResultTables"), BundledResultTables); + + const TSharedPtr* BundledVirtualCurrenciesObject; + if (obj->TryGetObjectField(TEXT("BundledVirtualCurrencies"), BundledVirtualCurrenciesObject)) + { + for (TMap>::TConstIterator It((*BundledVirtualCurrenciesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + BundledVirtualCurrencies.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FCatalogItemConsumableInfo::~FCatalogItemConsumableInfo() +{ + +} + +void PlayFab::ServerModels::FCatalogItemConsumableInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (UsageCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsageCount")); writer->WriteValue(static_cast(UsageCount)); } + + if (UsagePeriod.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsagePeriod")); writer->WriteValue(static_cast(UsagePeriod)); } + + if (UsagePeriodGroup.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UsagePeriodGroup")); writer->WriteValue(UsagePeriodGroup); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCatalogItemConsumableInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UsageCountValue = obj->TryGetField(TEXT("UsageCount")); + if (UsageCountValue.IsValid() && !UsageCountValue->IsNull()) + { + uint32 TmpValue; + if (UsageCountValue->TryGetNumber(TmpValue)) { UsageCount = TmpValue; } + } + + const TSharedPtr UsagePeriodValue = obj->TryGetField(TEXT("UsagePeriod")); + if (UsagePeriodValue.IsValid() && !UsagePeriodValue->IsNull()) + { + uint32 TmpValue; + if (UsagePeriodValue->TryGetNumber(TmpValue)) { UsagePeriod = TmpValue; } + } + + const TSharedPtr UsagePeriodGroupValue = obj->TryGetField(TEXT("UsagePeriodGroup")); + if (UsagePeriodGroupValue.IsValid() && !UsagePeriodGroupValue->IsNull()) + { + FString TmpValue; + if (UsagePeriodGroupValue->TryGetString(TmpValue)) { UsagePeriodGroup = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FCatalogItemContainerInfo::~FCatalogItemContainerInfo() +{ + +} + +void PlayFab::ServerModels::FCatalogItemContainerInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemContents")); + for (const FString& item : ItemContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (KeyItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KeyItemId")); writer->WriteValue(KeyItemId); } + + if (ResultTableContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("ResultTableContents")); + for (const FString& item : ResultTableContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyContents.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyContents")); + for (TMap::TConstIterator It(VirtualCurrencyContents); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCatalogItemContainerInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("ItemContents"), ItemContents); + + const TSharedPtr KeyItemIdValue = obj->TryGetField(TEXT("KeyItemId")); + if (KeyItemIdValue.IsValid() && !KeyItemIdValue->IsNull()) + { + FString TmpValue; + if (KeyItemIdValue->TryGetString(TmpValue)) { KeyItemId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("ResultTableContents"), ResultTableContents); + + const TSharedPtr* VirtualCurrencyContentsObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyContents"), VirtualCurrencyContentsObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyContentsObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyContents.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FCatalogItem::~FCatalogItem() +{ + //if (Bundle != nullptr) delete Bundle; + //if (Consumable != nullptr) delete Consumable; + //if (Container != nullptr) delete Container; + +} + +void PlayFab::ServerModels::FCatalogItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Bundle.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Bundle")); Bundle->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("CanBecomeCharacter")); writer->WriteValue(CanBecomeCharacter); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (Consumable.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Consumable")); Consumable->writeJSON(writer); } + + if (Container.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Container")); Container->writeJSON(writer); } + + if (CustomData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomData")); writer->WriteValue(CustomData); } + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + writer->WriteIdentifierPrefix(TEXT("InitialLimitedEditionCount")); writer->WriteValue(InitialLimitedEditionCount); + + writer->WriteIdentifierPrefix(TEXT("IsLimitedEdition")); writer->WriteValue(IsLimitedEdition); + + writer->WriteIdentifierPrefix(TEXT("IsStackable")); writer->WriteValue(IsStackable); + + writer->WriteIdentifierPrefix(TEXT("IsTradable")); writer->WriteValue(IsTradable); + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (ItemImageUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemImageUrl")); writer->WriteValue(ItemImageUrl); } + + if (RealCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("RealCurrencyPrices")); + for (TMap::TConstIterator It(RealCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyPrices")); + for (TMap::TConstIterator It(VirtualCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCatalogItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BundleValue = obj->TryGetField(TEXT("Bundle")); + if (BundleValue.IsValid() && !BundleValue->IsNull()) + { + Bundle = MakeShareable(new FCatalogItemBundleInfo(BundleValue->AsObject())); + } + + const TSharedPtr CanBecomeCharacterValue = obj->TryGetField(TEXT("CanBecomeCharacter")); + if (CanBecomeCharacterValue.IsValid() && !CanBecomeCharacterValue->IsNull()) + { + bool TmpValue; + if (CanBecomeCharacterValue->TryGetBool(TmpValue)) { CanBecomeCharacter = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr ConsumableValue = obj->TryGetField(TEXT("Consumable")); + if (ConsumableValue.IsValid() && !ConsumableValue->IsNull()) + { + Consumable = MakeShareable(new FCatalogItemConsumableInfo(ConsumableValue->AsObject())); + } + + const TSharedPtr ContainerValue = obj->TryGetField(TEXT("Container")); + if (ContainerValue.IsValid() && !ContainerValue->IsNull()) + { + Container = MakeShareable(new FCatalogItemContainerInfo(ContainerValue->AsObject())); + } + + const TSharedPtr CustomDataValue = obj->TryGetField(TEXT("CustomData")); + if (CustomDataValue.IsValid() && !CustomDataValue->IsNull()) + { + FString TmpValue; + if (CustomDataValue->TryGetString(TmpValue)) { CustomData = TmpValue; } + } + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr InitialLimitedEditionCountValue = obj->TryGetField(TEXT("InitialLimitedEditionCount")); + if (InitialLimitedEditionCountValue.IsValid() && !InitialLimitedEditionCountValue->IsNull()) + { + int32 TmpValue; + if (InitialLimitedEditionCountValue->TryGetNumber(TmpValue)) { InitialLimitedEditionCount = TmpValue; } + } + + const TSharedPtr IsLimitedEditionValue = obj->TryGetField(TEXT("IsLimitedEdition")); + if (IsLimitedEditionValue.IsValid() && !IsLimitedEditionValue->IsNull()) + { + bool TmpValue; + if (IsLimitedEditionValue->TryGetBool(TmpValue)) { IsLimitedEdition = TmpValue; } + } + + const TSharedPtr IsStackableValue = obj->TryGetField(TEXT("IsStackable")); + if (IsStackableValue.IsValid() && !IsStackableValue->IsNull()) + { + bool TmpValue; + if (IsStackableValue->TryGetBool(TmpValue)) { IsStackable = TmpValue; } + } + + const TSharedPtr IsTradableValue = obj->TryGetField(TEXT("IsTradable")); + if (IsTradableValue.IsValid() && !IsTradableValue->IsNull()) + { + bool TmpValue; + if (IsTradableValue->TryGetBool(TmpValue)) { IsTradable = TmpValue; } + } + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemImageUrlValue = obj->TryGetField(TEXT("ItemImageUrl")); + if (ItemImageUrlValue.IsValid() && !ItemImageUrlValue->IsNull()) + { + FString TmpValue; + if (ItemImageUrlValue->TryGetString(TmpValue)) { ItemImageUrl = TmpValue; } + } + + const TSharedPtr* RealCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("RealCurrencyPrices"), RealCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*RealCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + RealCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr* VirtualCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyPrices"), VirtualCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FItemInstance::~FItemInstance() +{ + +} + +void PlayFab::ServerModels::FItemInstance::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (BundleContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundleContents")); + for (const FString& item : BundleContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundleParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BundleParent")); writer->WriteValue(BundleParent); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CustomData.Num() != 0) + { + writer->WriteObjectStart(TEXT("CustomData")); + for (TMap::TConstIterator It(CustomData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Expiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (PurchaseDate.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); } + + if (RemainingUses.notNull()) { writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); } + + if (UnitCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnitCurrency")); writer->WriteValue(UnitCurrency); } + + writer->WriteIdentifierPrefix(TEXT("UnitPrice")); writer->WriteValue(static_cast(UnitPrice)); + + if (UsesIncrementedBy.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsesIncrementedBy")); writer->WriteValue(UsesIncrementedBy); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FItemInstance::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("BundleContents"), BundleContents); + + const TSharedPtr BundleParentValue = obj->TryGetField(TEXT("BundleParent")); + if (BundleParentValue.IsValid() && !BundleParentValue->IsNull()) + { + FString TmpValue; + if (BundleParentValue->TryGetString(TmpValue)) { BundleParent = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr* CustomDataObject; + if (obj->TryGetObjectField(TEXT("CustomData"), CustomDataObject)) + { + for (TMap>::TConstIterator It((*CustomDataObject)->Values); It; ++It) + { + CustomData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + const TSharedPtr UnitCurrencyValue = obj->TryGetField(TEXT("UnitCurrency")); + if (UnitCurrencyValue.IsValid() && !UnitCurrencyValue->IsNull()) + { + FString TmpValue; + if (UnitCurrencyValue->TryGetString(TmpValue)) { UnitCurrency = TmpValue; } + } + + const TSharedPtr UnitPriceValue = obj->TryGetField(TEXT("UnitPrice")); + if (UnitPriceValue.IsValid() && !UnitPriceValue->IsNull()) + { + uint32 TmpValue; + if (UnitPriceValue->TryGetNumber(TmpValue)) { UnitPrice = TmpValue; } + } + + const TSharedPtr UsesIncrementedByValue = obj->TryGetField(TEXT("UsesIncrementedBy")); + if (UsesIncrementedByValue.IsValid() && !UsesIncrementedByValue->IsNull()) + { + int32 TmpValue; + if (UsesIncrementedByValue->TryGetNumber(TmpValue)) { UsesIncrementedBy = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FCharacterInventory::~FCharacterInventory() +{ + +} + +void PlayFab::ServerModels::FCharacterInventory::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCharacterInventory::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FCharacterLeaderboardEntry::~FCharacterLeaderboardEntry() +{ + +} + +void PlayFab::ServerModels::FCharacterLeaderboardEntry::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CharacterName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterName")); writer->WriteValue(CharacterName); } + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteIdentifierPrefix(TEXT("Position")); writer->WriteValue(Position); + + writer->WriteIdentifierPrefix(TEXT("StatValue")); writer->WriteValue(StatValue); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCharacterLeaderboardEntry::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterNameValue = obj->TryGetField(TEXT("CharacterName")); + if (CharacterNameValue.IsValid() && !CharacterNameValue->IsNull()) + { + FString TmpValue; + if (CharacterNameValue->TryGetString(TmpValue)) { CharacterName = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PositionValue = obj->TryGetField(TEXT("Position")); + if (PositionValue.IsValid() && !PositionValue->IsNull()) + { + int32 TmpValue; + if (PositionValue->TryGetNumber(TmpValue)) { Position = TmpValue; } + } + + const TSharedPtr StatValueValue = obj->TryGetField(TEXT("StatValue")); + if (StatValueValue.IsValid() && !StatValueValue->IsNull()) + { + int32 TmpValue; + if (StatValueValue->TryGetNumber(TmpValue)) { StatValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FCharacterResult::~FCharacterResult() +{ + +} + +void PlayFab::ServerModels::FCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CharacterName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterName")); writer->WriteValue(CharacterName); } + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterNameValue = obj->TryGetField(TEXT("CharacterName")); + if (CharacterNameValue.IsValid() && !CharacterNameValue->IsNull()) + { + FString TmpValue; + if (CharacterNameValue->TryGetString(TmpValue)) { CharacterName = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeCloudScriptRevisionOptionEnumJSON(CloudScriptRevisionOption enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CloudScriptRevisionOptionLive: writer->WriteValue(TEXT("Live")); break; + case CloudScriptRevisionOptionLatest: writer->WriteValue(TEXT("Latest")); break; + case CloudScriptRevisionOptionSpecific: writer->WriteValue(TEXT("Specific")); break; + } +} + +ServerModels::CloudScriptRevisionOption PlayFab::ServerModels::readCloudScriptRevisionOptionFromValue(const TSharedPtr& value) +{ + return readCloudScriptRevisionOptionFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::CloudScriptRevisionOption PlayFab::ServerModels::readCloudScriptRevisionOptionFromValue(const FString& value) +{ + static TMap _CloudScriptRevisionOptionMap; + if (_CloudScriptRevisionOptionMap.Num() == 0) + { + // Auto-generate the map on the first use + _CloudScriptRevisionOptionMap.Add(TEXT("Live"), CloudScriptRevisionOptionLive); + _CloudScriptRevisionOptionMap.Add(TEXT("Latest"), CloudScriptRevisionOptionLatest); + _CloudScriptRevisionOptionMap.Add(TEXT("Specific"), CloudScriptRevisionOptionSpecific); + + } + + if (!value.IsEmpty()) + { + auto output = _CloudScriptRevisionOptionMap.Find(value); + if (output != nullptr) + return *output; + } + + return CloudScriptRevisionOptionLive; // Basically critical fail +} + +PlayFab::ServerModels::FConsumeItemRequest::~FConsumeItemRequest() +{ + +} + +void PlayFab::ServerModels::FConsumeItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ConsumeCount")); writer->WriteValue(ConsumeCount); + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FConsumeItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ConsumeCountValue = obj->TryGetField(TEXT("ConsumeCount")); + if (ConsumeCountValue.IsValid() && !ConsumeCountValue->IsNull()) + { + int32 TmpValue; + if (ConsumeCountValue->TryGetNumber(TmpValue)) { ConsumeCount = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FConsumeItemResult::~FConsumeItemResult() +{ + +} + +void PlayFab::ServerModels::FConsumeItemResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FConsumeItemResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeEmailVerificationStatusEnumJSON(EmailVerificationStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case EmailVerificationStatusUnverified: writer->WriteValue(TEXT("Unverified")); break; + case EmailVerificationStatusPending: writer->WriteValue(TEXT("Pending")); break; + case EmailVerificationStatusConfirmed: writer->WriteValue(TEXT("Confirmed")); break; + } +} + +ServerModels::EmailVerificationStatus PlayFab::ServerModels::readEmailVerificationStatusFromValue(const TSharedPtr& value) +{ + return readEmailVerificationStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::EmailVerificationStatus PlayFab::ServerModels::readEmailVerificationStatusFromValue(const FString& value) +{ + static TMap _EmailVerificationStatusMap; + if (_EmailVerificationStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _EmailVerificationStatusMap.Add(TEXT("Unverified"), EmailVerificationStatusUnverified); + _EmailVerificationStatusMap.Add(TEXT("Pending"), EmailVerificationStatusPending); + _EmailVerificationStatusMap.Add(TEXT("Confirmed"), EmailVerificationStatusConfirmed); + + } + + if (!value.IsEmpty()) + { + auto output = _EmailVerificationStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return EmailVerificationStatusUnverified; // Basically critical fail +} + +PlayFab::ServerModels::FContactEmailInfo::~FContactEmailInfo() +{ + +} + +void PlayFab::ServerModels::FContactEmailInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EmailAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailAddress")); writer->WriteValue(EmailAddress); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + if (VerificationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("VerificationStatus")); writeEmailVerificationStatusEnumJSON(VerificationStatus, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FContactEmailInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailAddressValue = obj->TryGetField(TEXT("EmailAddress")); + if (EmailAddressValue.IsValid() && !EmailAddressValue->IsNull()) + { + FString TmpValue; + if (EmailAddressValue->TryGetString(TmpValue)) { EmailAddress = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + VerificationStatus = readEmailVerificationStatusFromValue(obj->TryGetField(TEXT("VerificationStatus"))); + + return HasSucceeded; +} + +PlayFab::ServerModels::FContactEmailInfoModel::~FContactEmailInfoModel() +{ + +} + +void PlayFab::ServerModels::FContactEmailInfoModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EmailAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailAddress")); writer->WriteValue(EmailAddress); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + if (VerificationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("VerificationStatus")); writeEmailVerificationStatusEnumJSON(VerificationStatus, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FContactEmailInfoModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailAddressValue = obj->TryGetField(TEXT("EmailAddress")); + if (EmailAddressValue.IsValid() && !EmailAddressValue->IsNull()) + { + FString TmpValue; + if (EmailAddressValue->TryGetString(TmpValue)) { EmailAddress = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + VerificationStatus = readEmailVerificationStatusFromValue(obj->TryGetField(TEXT("VerificationStatus"))); + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeContinentCodeEnumJSON(ContinentCode enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ContinentCodeAF: writer->WriteValue(TEXT("AF")); break; + case ContinentCodeAN: writer->WriteValue(TEXT("AN")); break; + case ContinentCodeAS: writer->WriteValue(TEXT("AS")); break; + case ContinentCodeEU: writer->WriteValue(TEXT("EU")); break; + case ContinentCodeNA: writer->WriteValue(TEXT("NA")); break; + case ContinentCodeOC: writer->WriteValue(TEXT("OC")); break; + case ContinentCodeSA: writer->WriteValue(TEXT("SA")); break; + } +} + +ServerModels::ContinentCode PlayFab::ServerModels::readContinentCodeFromValue(const TSharedPtr& value) +{ + return readContinentCodeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::ContinentCode PlayFab::ServerModels::readContinentCodeFromValue(const FString& value) +{ + static TMap _ContinentCodeMap; + if (_ContinentCodeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ContinentCodeMap.Add(TEXT("AF"), ContinentCodeAF); + _ContinentCodeMap.Add(TEXT("AN"), ContinentCodeAN); + _ContinentCodeMap.Add(TEXT("AS"), ContinentCodeAS); + _ContinentCodeMap.Add(TEXT("EU"), ContinentCodeEU); + _ContinentCodeMap.Add(TEXT("NA"), ContinentCodeNA); + _ContinentCodeMap.Add(TEXT("OC"), ContinentCodeOC); + _ContinentCodeMap.Add(TEXT("SA"), ContinentCodeSA); + + } + + if (!value.IsEmpty()) + { + auto output = _ContinentCodeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ContinentCodeAF; // Basically critical fail +} + +void PlayFab::ServerModels::writeCountryCodeEnumJSON(CountryCode enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CountryCodeAF: writer->WriteValue(TEXT("AF")); break; + case CountryCodeAX: writer->WriteValue(TEXT("AX")); break; + case CountryCodeAL: writer->WriteValue(TEXT("AL")); break; + case CountryCodeDZ: writer->WriteValue(TEXT("DZ")); break; + case CountryCodeAS: writer->WriteValue(TEXT("AS")); break; + case CountryCodeAD: writer->WriteValue(TEXT("AD")); break; + case CountryCodeAO: writer->WriteValue(TEXT("AO")); break; + case CountryCodeAI: writer->WriteValue(TEXT("AI")); break; + case CountryCodeAQ: writer->WriteValue(TEXT("AQ")); break; + case CountryCodeAG: writer->WriteValue(TEXT("AG")); break; + case CountryCodeAR: writer->WriteValue(TEXT("AR")); break; + case CountryCodeAM: writer->WriteValue(TEXT("AM")); break; + case CountryCodeAW: writer->WriteValue(TEXT("AW")); break; + case CountryCodeAU: writer->WriteValue(TEXT("AU")); break; + case CountryCodeAT: writer->WriteValue(TEXT("AT")); break; + case CountryCodeAZ: writer->WriteValue(TEXT("AZ")); break; + case CountryCodeBS: writer->WriteValue(TEXT("BS")); break; + case CountryCodeBH: writer->WriteValue(TEXT("BH")); break; + case CountryCodeBD: writer->WriteValue(TEXT("BD")); break; + case CountryCodeBB: writer->WriteValue(TEXT("BB")); break; + case CountryCodeBY: writer->WriteValue(TEXT("BY")); break; + case CountryCodeBE: writer->WriteValue(TEXT("BE")); break; + case CountryCodeBZ: writer->WriteValue(TEXT("BZ")); break; + case CountryCodeBJ: writer->WriteValue(TEXT("BJ")); break; + case CountryCodeBM: writer->WriteValue(TEXT("BM")); break; + case CountryCodeBT: writer->WriteValue(TEXT("BT")); break; + case CountryCodeBO: writer->WriteValue(TEXT("BO")); break; + case CountryCodeBQ: writer->WriteValue(TEXT("BQ")); break; + case CountryCodeBA: writer->WriteValue(TEXT("BA")); break; + case CountryCodeBW: writer->WriteValue(TEXT("BW")); break; + case CountryCodeBV: writer->WriteValue(TEXT("BV")); break; + case CountryCodeBR: writer->WriteValue(TEXT("BR")); break; + case CountryCodeIO: writer->WriteValue(TEXT("IO")); break; + case CountryCodeBN: writer->WriteValue(TEXT("BN")); break; + case CountryCodeBG: writer->WriteValue(TEXT("BG")); break; + case CountryCodeBF: writer->WriteValue(TEXT("BF")); break; + case CountryCodeBI: writer->WriteValue(TEXT("BI")); break; + case CountryCodeKH: writer->WriteValue(TEXT("KH")); break; + case CountryCodeCM: writer->WriteValue(TEXT("CM")); break; + case CountryCodeCA: writer->WriteValue(TEXT("CA")); break; + case CountryCodeCV: writer->WriteValue(TEXT("CV")); break; + case CountryCodeKY: writer->WriteValue(TEXT("KY")); break; + case CountryCodeCF: writer->WriteValue(TEXT("CF")); break; + case CountryCodeTD: writer->WriteValue(TEXT("TD")); break; + case CountryCodeCL: writer->WriteValue(TEXT("CL")); break; + case CountryCodeCN: writer->WriteValue(TEXT("CN")); break; + case CountryCodeCX: writer->WriteValue(TEXT("CX")); break; + case CountryCodeCC: writer->WriteValue(TEXT("CC")); break; + case CountryCodeCO: writer->WriteValue(TEXT("CO")); break; + case CountryCodeKM: writer->WriteValue(TEXT("KM")); break; + case CountryCodeCG: writer->WriteValue(TEXT("CG")); break; + case CountryCodeCD: writer->WriteValue(TEXT("CD")); break; + case CountryCodeCK: writer->WriteValue(TEXT("CK")); break; + case CountryCodeCR: writer->WriteValue(TEXT("CR")); break; + case CountryCodeCI: writer->WriteValue(TEXT("CI")); break; + case CountryCodeHR: writer->WriteValue(TEXT("HR")); break; + case CountryCodeCU: writer->WriteValue(TEXT("CU")); break; + case CountryCodeCW: writer->WriteValue(TEXT("CW")); break; + case CountryCodeCY: writer->WriteValue(TEXT("CY")); break; + case CountryCodeCZ: writer->WriteValue(TEXT("CZ")); break; + case CountryCodeDK: writer->WriteValue(TEXT("DK")); break; + case CountryCodeDJ: writer->WriteValue(TEXT("DJ")); break; + case CountryCodeDM: writer->WriteValue(TEXT("DM")); break; + case CountryCodeDO: writer->WriteValue(TEXT("DO")); break; + case CountryCodeEC: writer->WriteValue(TEXT("EC")); break; + case CountryCodeEG: writer->WriteValue(TEXT("EG")); break; + case CountryCodeSV: writer->WriteValue(TEXT("SV")); break; + case CountryCodeGQ: writer->WriteValue(TEXT("GQ")); break; + case CountryCodeER: writer->WriteValue(TEXT("ER")); break; + case CountryCodeEE: writer->WriteValue(TEXT("EE")); break; + case CountryCodeET: writer->WriteValue(TEXT("ET")); break; + case CountryCodeFK: writer->WriteValue(TEXT("FK")); break; + case CountryCodeFO: writer->WriteValue(TEXT("FO")); break; + case CountryCodeFJ: writer->WriteValue(TEXT("FJ")); break; + case CountryCodeFI: writer->WriteValue(TEXT("FI")); break; + case CountryCodeFR: writer->WriteValue(TEXT("FR")); break; + case CountryCodeGF: writer->WriteValue(TEXT("GF")); break; + case CountryCodePF: writer->WriteValue(TEXT("PF")); break; + case CountryCodeTF: writer->WriteValue(TEXT("TF")); break; + case CountryCodeGA: writer->WriteValue(TEXT("GA")); break; + case CountryCodeGM: writer->WriteValue(TEXT("GM")); break; + case CountryCodeGE: writer->WriteValue(TEXT("GE")); break; + case CountryCodeDE: writer->WriteValue(TEXT("DE")); break; + case CountryCodeGH: writer->WriteValue(TEXT("GH")); break; + case CountryCodeGI: writer->WriteValue(TEXT("GI")); break; + case CountryCodeGR: writer->WriteValue(TEXT("GR")); break; + case CountryCodeGL: writer->WriteValue(TEXT("GL")); break; + case CountryCodeGD: writer->WriteValue(TEXT("GD")); break; + case CountryCodeGP: writer->WriteValue(TEXT("GP")); break; + case CountryCodeGU: writer->WriteValue(TEXT("GU")); break; + case CountryCodeGT: writer->WriteValue(TEXT("GT")); break; + case CountryCodeGG: writer->WriteValue(TEXT("GG")); break; + case CountryCodeGN: writer->WriteValue(TEXT("GN")); break; + case CountryCodeGW: writer->WriteValue(TEXT("GW")); break; + case CountryCodeGY: writer->WriteValue(TEXT("GY")); break; + case CountryCodeHT: writer->WriteValue(TEXT("HT")); break; + case CountryCodeHM: writer->WriteValue(TEXT("HM")); break; + case CountryCodeVA: writer->WriteValue(TEXT("VA")); break; + case CountryCodeHN: writer->WriteValue(TEXT("HN")); break; + case CountryCodeHK: writer->WriteValue(TEXT("HK")); break; + case CountryCodeHU: writer->WriteValue(TEXT("HU")); break; + case CountryCodeIS: writer->WriteValue(TEXT("IS")); break; + case CountryCodeIN: writer->WriteValue(TEXT("IN")); break; + case CountryCodeID: writer->WriteValue(TEXT("ID")); break; + case CountryCodeIR: writer->WriteValue(TEXT("IR")); break; + case CountryCodeIQ: writer->WriteValue(TEXT("IQ")); break; + case CountryCodeIE: writer->WriteValue(TEXT("IE")); break; + case CountryCodeIM: writer->WriteValue(TEXT("IM")); break; + case CountryCodeIL: writer->WriteValue(TEXT("IL")); break; + case CountryCodeIT: writer->WriteValue(TEXT("IT")); break; + case CountryCodeJM: writer->WriteValue(TEXT("JM")); break; + case CountryCodeJP: writer->WriteValue(TEXT("JP")); break; + case CountryCodeJE: writer->WriteValue(TEXT("JE")); break; + case CountryCodeJO: writer->WriteValue(TEXT("JO")); break; + case CountryCodeKZ: writer->WriteValue(TEXT("KZ")); break; + case CountryCodeKE: writer->WriteValue(TEXT("KE")); break; + case CountryCodeKI: writer->WriteValue(TEXT("KI")); break; + case CountryCodeKP: writer->WriteValue(TEXT("KP")); break; + case CountryCodeKR: writer->WriteValue(TEXT("KR")); break; + case CountryCodeKW: writer->WriteValue(TEXT("KW")); break; + case CountryCodeKG: writer->WriteValue(TEXT("KG")); break; + case CountryCodeLA: writer->WriteValue(TEXT("LA")); break; + case CountryCodeLV: writer->WriteValue(TEXT("LV")); break; + case CountryCodeLB: writer->WriteValue(TEXT("LB")); break; + case CountryCodeLS: writer->WriteValue(TEXT("LS")); break; + case CountryCodeLR: writer->WriteValue(TEXT("LR")); break; + case CountryCodeLY: writer->WriteValue(TEXT("LY")); break; + case CountryCodeLI: writer->WriteValue(TEXT("LI")); break; + case CountryCodeLT: writer->WriteValue(TEXT("LT")); break; + case CountryCodeLU: writer->WriteValue(TEXT("LU")); break; + case CountryCodeMO: writer->WriteValue(TEXT("MO")); break; + case CountryCodeMK: writer->WriteValue(TEXT("MK")); break; + case CountryCodeMG: writer->WriteValue(TEXT("MG")); break; + case CountryCodeMW: writer->WriteValue(TEXT("MW")); break; + case CountryCodeMY: writer->WriteValue(TEXT("MY")); break; + case CountryCodeMV: writer->WriteValue(TEXT("MV")); break; + case CountryCodeML: writer->WriteValue(TEXT("ML")); break; + case CountryCodeMT: writer->WriteValue(TEXT("MT")); break; + case CountryCodeMH: writer->WriteValue(TEXT("MH")); break; + case CountryCodeMQ: writer->WriteValue(TEXT("MQ")); break; + case CountryCodeMR: writer->WriteValue(TEXT("MR")); break; + case CountryCodeMU: writer->WriteValue(TEXT("MU")); break; + case CountryCodeYT: writer->WriteValue(TEXT("YT")); break; + case CountryCodeMX: writer->WriteValue(TEXT("MX")); break; + case CountryCodeFM: writer->WriteValue(TEXT("FM")); break; + case CountryCodeMD: writer->WriteValue(TEXT("MD")); break; + case CountryCodeMC: writer->WriteValue(TEXT("MC")); break; + case CountryCodeMN: writer->WriteValue(TEXT("MN")); break; + case CountryCodeME: writer->WriteValue(TEXT("ME")); break; + case CountryCodeMS: writer->WriteValue(TEXT("MS")); break; + case CountryCodeMA: writer->WriteValue(TEXT("MA")); break; + case CountryCodeMZ: writer->WriteValue(TEXT("MZ")); break; + case CountryCodeMM: writer->WriteValue(TEXT("MM")); break; + case CountryCodeNA: writer->WriteValue(TEXT("NA")); break; + case CountryCodeNR: writer->WriteValue(TEXT("NR")); break; + case CountryCodeNP: writer->WriteValue(TEXT("NP")); break; + case CountryCodeNL: writer->WriteValue(TEXT("NL")); break; + case CountryCodeNC: writer->WriteValue(TEXT("NC")); break; + case CountryCodeNZ: writer->WriteValue(TEXT("NZ")); break; + case CountryCodeNI: writer->WriteValue(TEXT("NI")); break; + case CountryCodeNE: writer->WriteValue(TEXT("NE")); break; + case CountryCodeNG: writer->WriteValue(TEXT("NG")); break; + case CountryCodeNU: writer->WriteValue(TEXT("NU")); break; + case CountryCodeNF: writer->WriteValue(TEXT("NF")); break; + case CountryCodeMP: writer->WriteValue(TEXT("MP")); break; + case CountryCodeNO: writer->WriteValue(TEXT("NO")); break; + case CountryCodeOM: writer->WriteValue(TEXT("OM")); break; + case CountryCodePK: writer->WriteValue(TEXT("PK")); break; + case CountryCodePW: writer->WriteValue(TEXT("PW")); break; + case CountryCodePS: writer->WriteValue(TEXT("PS")); break; + case CountryCodePA: writer->WriteValue(TEXT("PA")); break; + case CountryCodePG: writer->WriteValue(TEXT("PG")); break; + case CountryCodePY: writer->WriteValue(TEXT("PY")); break; + case CountryCodePE: writer->WriteValue(TEXT("PE")); break; + case CountryCodePH: writer->WriteValue(TEXT("PH")); break; + case CountryCodePN: writer->WriteValue(TEXT("PN")); break; + case CountryCodePL: writer->WriteValue(TEXT("PL")); break; + case CountryCodePT: writer->WriteValue(TEXT("PT")); break; + case CountryCodePR: writer->WriteValue(TEXT("PR")); break; + case CountryCodeQA: writer->WriteValue(TEXT("QA")); break; + case CountryCodeRE: writer->WriteValue(TEXT("RE")); break; + case CountryCodeRO: writer->WriteValue(TEXT("RO")); break; + case CountryCodeRU: writer->WriteValue(TEXT("RU")); break; + case CountryCodeRW: writer->WriteValue(TEXT("RW")); break; + case CountryCodeBL: writer->WriteValue(TEXT("BL")); break; + case CountryCodeSH: writer->WriteValue(TEXT("SH")); break; + case CountryCodeKN: writer->WriteValue(TEXT("KN")); break; + case CountryCodeLC: writer->WriteValue(TEXT("LC")); break; + case CountryCodeMF: writer->WriteValue(TEXT("MF")); break; + case CountryCodePM: writer->WriteValue(TEXT("PM")); break; + case CountryCodeVC: writer->WriteValue(TEXT("VC")); break; + case CountryCodeWS: writer->WriteValue(TEXT("WS")); break; + case CountryCodeSM: writer->WriteValue(TEXT("SM")); break; + case CountryCodeST: writer->WriteValue(TEXT("ST")); break; + case CountryCodeSA: writer->WriteValue(TEXT("SA")); break; + case CountryCodeSN: writer->WriteValue(TEXT("SN")); break; + case CountryCodeRS: writer->WriteValue(TEXT("RS")); break; + case CountryCodeSC: writer->WriteValue(TEXT("SC")); break; + case CountryCodeSL: writer->WriteValue(TEXT("SL")); break; + case CountryCodeSG: writer->WriteValue(TEXT("SG")); break; + case CountryCodeSX: writer->WriteValue(TEXT("SX")); break; + case CountryCodeSK: writer->WriteValue(TEXT("SK")); break; + case CountryCodeSI: writer->WriteValue(TEXT("SI")); break; + case CountryCodeSB: writer->WriteValue(TEXT("SB")); break; + case CountryCodeSO: writer->WriteValue(TEXT("SO")); break; + case CountryCodeZA: writer->WriteValue(TEXT("ZA")); break; + case CountryCodeGS: writer->WriteValue(TEXT("GS")); break; + case CountryCodeSS: writer->WriteValue(TEXT("SS")); break; + case CountryCodeES: writer->WriteValue(TEXT("ES")); break; + case CountryCodeLK: writer->WriteValue(TEXT("LK")); break; + case CountryCodeSD: writer->WriteValue(TEXT("SD")); break; + case CountryCodeSR: writer->WriteValue(TEXT("SR")); break; + case CountryCodeSJ: writer->WriteValue(TEXT("SJ")); break; + case CountryCodeSZ: writer->WriteValue(TEXT("SZ")); break; + case CountryCodeSE: writer->WriteValue(TEXT("SE")); break; + case CountryCodeCH: writer->WriteValue(TEXT("CH")); break; + case CountryCodeSY: writer->WriteValue(TEXT("SY")); break; + case CountryCodeTW: writer->WriteValue(TEXT("TW")); break; + case CountryCodeTJ: writer->WriteValue(TEXT("TJ")); break; + case CountryCodeTZ: writer->WriteValue(TEXT("TZ")); break; + case CountryCodeTH: writer->WriteValue(TEXT("TH")); break; + case CountryCodeTL: writer->WriteValue(TEXT("TL")); break; + case CountryCodeTG: writer->WriteValue(TEXT("TG")); break; + case CountryCodeTK: writer->WriteValue(TEXT("TK")); break; + case CountryCodeTO: writer->WriteValue(TEXT("TO")); break; + case CountryCodeTT: writer->WriteValue(TEXT("TT")); break; + case CountryCodeTN: writer->WriteValue(TEXT("TN")); break; + case CountryCodeTR: writer->WriteValue(TEXT("TR")); break; + case CountryCodeTM: writer->WriteValue(TEXT("TM")); break; + case CountryCodeTC: writer->WriteValue(TEXT("TC")); break; + case CountryCodeTV: writer->WriteValue(TEXT("TV")); break; + case CountryCodeUG: writer->WriteValue(TEXT("UG")); break; + case CountryCodeUA: writer->WriteValue(TEXT("UA")); break; + case CountryCodeAE: writer->WriteValue(TEXT("AE")); break; + case CountryCodeGB: writer->WriteValue(TEXT("GB")); break; + case CountryCodeUS: writer->WriteValue(TEXT("US")); break; + case CountryCodeUM: writer->WriteValue(TEXT("UM")); break; + case CountryCodeUY: writer->WriteValue(TEXT("UY")); break; + case CountryCodeUZ: writer->WriteValue(TEXT("UZ")); break; + case CountryCodeVU: writer->WriteValue(TEXT("VU")); break; + case CountryCodeVE: writer->WriteValue(TEXT("VE")); break; + case CountryCodeVN: writer->WriteValue(TEXT("VN")); break; + case CountryCodeVG: writer->WriteValue(TEXT("VG")); break; + case CountryCodeVI: writer->WriteValue(TEXT("VI")); break; + case CountryCodeWF: writer->WriteValue(TEXT("WF")); break; + case CountryCodeEH: writer->WriteValue(TEXT("EH")); break; + case CountryCodeYE: writer->WriteValue(TEXT("YE")); break; + case CountryCodeZM: writer->WriteValue(TEXT("ZM")); break; + case CountryCodeZW: writer->WriteValue(TEXT("ZW")); break; + } +} + +ServerModels::CountryCode PlayFab::ServerModels::readCountryCodeFromValue(const TSharedPtr& value) +{ + return readCountryCodeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::CountryCode PlayFab::ServerModels::readCountryCodeFromValue(const FString& value) +{ + static TMap _CountryCodeMap; + if (_CountryCodeMap.Num() == 0) + { + // Auto-generate the map on the first use + _CountryCodeMap.Add(TEXT("AF"), CountryCodeAF); + _CountryCodeMap.Add(TEXT("AX"), CountryCodeAX); + _CountryCodeMap.Add(TEXT("AL"), CountryCodeAL); + _CountryCodeMap.Add(TEXT("DZ"), CountryCodeDZ); + _CountryCodeMap.Add(TEXT("AS"), CountryCodeAS); + _CountryCodeMap.Add(TEXT("AD"), CountryCodeAD); + _CountryCodeMap.Add(TEXT("AO"), CountryCodeAO); + _CountryCodeMap.Add(TEXT("AI"), CountryCodeAI); + _CountryCodeMap.Add(TEXT("AQ"), CountryCodeAQ); + _CountryCodeMap.Add(TEXT("AG"), CountryCodeAG); + _CountryCodeMap.Add(TEXT("AR"), CountryCodeAR); + _CountryCodeMap.Add(TEXT("AM"), CountryCodeAM); + _CountryCodeMap.Add(TEXT("AW"), CountryCodeAW); + _CountryCodeMap.Add(TEXT("AU"), CountryCodeAU); + _CountryCodeMap.Add(TEXT("AT"), CountryCodeAT); + _CountryCodeMap.Add(TEXT("AZ"), CountryCodeAZ); + _CountryCodeMap.Add(TEXT("BS"), CountryCodeBS); + _CountryCodeMap.Add(TEXT("BH"), CountryCodeBH); + _CountryCodeMap.Add(TEXT("BD"), CountryCodeBD); + _CountryCodeMap.Add(TEXT("BB"), CountryCodeBB); + _CountryCodeMap.Add(TEXT("BY"), CountryCodeBY); + _CountryCodeMap.Add(TEXT("BE"), CountryCodeBE); + _CountryCodeMap.Add(TEXT("BZ"), CountryCodeBZ); + _CountryCodeMap.Add(TEXT("BJ"), CountryCodeBJ); + _CountryCodeMap.Add(TEXT("BM"), CountryCodeBM); + _CountryCodeMap.Add(TEXT("BT"), CountryCodeBT); + _CountryCodeMap.Add(TEXT("BO"), CountryCodeBO); + _CountryCodeMap.Add(TEXT("BQ"), CountryCodeBQ); + _CountryCodeMap.Add(TEXT("BA"), CountryCodeBA); + _CountryCodeMap.Add(TEXT("BW"), CountryCodeBW); + _CountryCodeMap.Add(TEXT("BV"), CountryCodeBV); + _CountryCodeMap.Add(TEXT("BR"), CountryCodeBR); + _CountryCodeMap.Add(TEXT("IO"), CountryCodeIO); + _CountryCodeMap.Add(TEXT("BN"), CountryCodeBN); + _CountryCodeMap.Add(TEXT("BG"), CountryCodeBG); + _CountryCodeMap.Add(TEXT("BF"), CountryCodeBF); + _CountryCodeMap.Add(TEXT("BI"), CountryCodeBI); + _CountryCodeMap.Add(TEXT("KH"), CountryCodeKH); + _CountryCodeMap.Add(TEXT("CM"), CountryCodeCM); + _CountryCodeMap.Add(TEXT("CA"), CountryCodeCA); + _CountryCodeMap.Add(TEXT("CV"), CountryCodeCV); + _CountryCodeMap.Add(TEXT("KY"), CountryCodeKY); + _CountryCodeMap.Add(TEXT("CF"), CountryCodeCF); + _CountryCodeMap.Add(TEXT("TD"), CountryCodeTD); + _CountryCodeMap.Add(TEXT("CL"), CountryCodeCL); + _CountryCodeMap.Add(TEXT("CN"), CountryCodeCN); + _CountryCodeMap.Add(TEXT("CX"), CountryCodeCX); + _CountryCodeMap.Add(TEXT("CC"), CountryCodeCC); + _CountryCodeMap.Add(TEXT("CO"), CountryCodeCO); + _CountryCodeMap.Add(TEXT("KM"), CountryCodeKM); + _CountryCodeMap.Add(TEXT("CG"), CountryCodeCG); + _CountryCodeMap.Add(TEXT("CD"), CountryCodeCD); + _CountryCodeMap.Add(TEXT("CK"), CountryCodeCK); + _CountryCodeMap.Add(TEXT("CR"), CountryCodeCR); + _CountryCodeMap.Add(TEXT("CI"), CountryCodeCI); + _CountryCodeMap.Add(TEXT("HR"), CountryCodeHR); + _CountryCodeMap.Add(TEXT("CU"), CountryCodeCU); + _CountryCodeMap.Add(TEXT("CW"), CountryCodeCW); + _CountryCodeMap.Add(TEXT("CY"), CountryCodeCY); + _CountryCodeMap.Add(TEXT("CZ"), CountryCodeCZ); + _CountryCodeMap.Add(TEXT("DK"), CountryCodeDK); + _CountryCodeMap.Add(TEXT("DJ"), CountryCodeDJ); + _CountryCodeMap.Add(TEXT("DM"), CountryCodeDM); + _CountryCodeMap.Add(TEXT("DO"), CountryCodeDO); + _CountryCodeMap.Add(TEXT("EC"), CountryCodeEC); + _CountryCodeMap.Add(TEXT("EG"), CountryCodeEG); + _CountryCodeMap.Add(TEXT("SV"), CountryCodeSV); + _CountryCodeMap.Add(TEXT("GQ"), CountryCodeGQ); + _CountryCodeMap.Add(TEXT("ER"), CountryCodeER); + _CountryCodeMap.Add(TEXT("EE"), CountryCodeEE); + _CountryCodeMap.Add(TEXT("ET"), CountryCodeET); + _CountryCodeMap.Add(TEXT("FK"), CountryCodeFK); + _CountryCodeMap.Add(TEXT("FO"), CountryCodeFO); + _CountryCodeMap.Add(TEXT("FJ"), CountryCodeFJ); + _CountryCodeMap.Add(TEXT("FI"), CountryCodeFI); + _CountryCodeMap.Add(TEXT("FR"), CountryCodeFR); + _CountryCodeMap.Add(TEXT("GF"), CountryCodeGF); + _CountryCodeMap.Add(TEXT("PF"), CountryCodePF); + _CountryCodeMap.Add(TEXT("TF"), CountryCodeTF); + _CountryCodeMap.Add(TEXT("GA"), CountryCodeGA); + _CountryCodeMap.Add(TEXT("GM"), CountryCodeGM); + _CountryCodeMap.Add(TEXT("GE"), CountryCodeGE); + _CountryCodeMap.Add(TEXT("DE"), CountryCodeDE); + _CountryCodeMap.Add(TEXT("GH"), CountryCodeGH); + _CountryCodeMap.Add(TEXT("GI"), CountryCodeGI); + _CountryCodeMap.Add(TEXT("GR"), CountryCodeGR); + _CountryCodeMap.Add(TEXT("GL"), CountryCodeGL); + _CountryCodeMap.Add(TEXT("GD"), CountryCodeGD); + _CountryCodeMap.Add(TEXT("GP"), CountryCodeGP); + _CountryCodeMap.Add(TEXT("GU"), CountryCodeGU); + _CountryCodeMap.Add(TEXT("GT"), CountryCodeGT); + _CountryCodeMap.Add(TEXT("GG"), CountryCodeGG); + _CountryCodeMap.Add(TEXT("GN"), CountryCodeGN); + _CountryCodeMap.Add(TEXT("GW"), CountryCodeGW); + _CountryCodeMap.Add(TEXT("GY"), CountryCodeGY); + _CountryCodeMap.Add(TEXT("HT"), CountryCodeHT); + _CountryCodeMap.Add(TEXT("HM"), CountryCodeHM); + _CountryCodeMap.Add(TEXT("VA"), CountryCodeVA); + _CountryCodeMap.Add(TEXT("HN"), CountryCodeHN); + _CountryCodeMap.Add(TEXT("HK"), CountryCodeHK); + _CountryCodeMap.Add(TEXT("HU"), CountryCodeHU); + _CountryCodeMap.Add(TEXT("IS"), CountryCodeIS); + _CountryCodeMap.Add(TEXT("IN"), CountryCodeIN); + _CountryCodeMap.Add(TEXT("ID"), CountryCodeID); + _CountryCodeMap.Add(TEXT("IR"), CountryCodeIR); + _CountryCodeMap.Add(TEXT("IQ"), CountryCodeIQ); + _CountryCodeMap.Add(TEXT("IE"), CountryCodeIE); + _CountryCodeMap.Add(TEXT("IM"), CountryCodeIM); + _CountryCodeMap.Add(TEXT("IL"), CountryCodeIL); + _CountryCodeMap.Add(TEXT("IT"), CountryCodeIT); + _CountryCodeMap.Add(TEXT("JM"), CountryCodeJM); + _CountryCodeMap.Add(TEXT("JP"), CountryCodeJP); + _CountryCodeMap.Add(TEXT("JE"), CountryCodeJE); + _CountryCodeMap.Add(TEXT("JO"), CountryCodeJO); + _CountryCodeMap.Add(TEXT("KZ"), CountryCodeKZ); + _CountryCodeMap.Add(TEXT("KE"), CountryCodeKE); + _CountryCodeMap.Add(TEXT("KI"), CountryCodeKI); + _CountryCodeMap.Add(TEXT("KP"), CountryCodeKP); + _CountryCodeMap.Add(TEXT("KR"), CountryCodeKR); + _CountryCodeMap.Add(TEXT("KW"), CountryCodeKW); + _CountryCodeMap.Add(TEXT("KG"), CountryCodeKG); + _CountryCodeMap.Add(TEXT("LA"), CountryCodeLA); + _CountryCodeMap.Add(TEXT("LV"), CountryCodeLV); + _CountryCodeMap.Add(TEXT("LB"), CountryCodeLB); + _CountryCodeMap.Add(TEXT("LS"), CountryCodeLS); + _CountryCodeMap.Add(TEXT("LR"), CountryCodeLR); + _CountryCodeMap.Add(TEXT("LY"), CountryCodeLY); + _CountryCodeMap.Add(TEXT("LI"), CountryCodeLI); + _CountryCodeMap.Add(TEXT("LT"), CountryCodeLT); + _CountryCodeMap.Add(TEXT("LU"), CountryCodeLU); + _CountryCodeMap.Add(TEXT("MO"), CountryCodeMO); + _CountryCodeMap.Add(TEXT("MK"), CountryCodeMK); + _CountryCodeMap.Add(TEXT("MG"), CountryCodeMG); + _CountryCodeMap.Add(TEXT("MW"), CountryCodeMW); + _CountryCodeMap.Add(TEXT("MY"), CountryCodeMY); + _CountryCodeMap.Add(TEXT("MV"), CountryCodeMV); + _CountryCodeMap.Add(TEXT("ML"), CountryCodeML); + _CountryCodeMap.Add(TEXT("MT"), CountryCodeMT); + _CountryCodeMap.Add(TEXT("MH"), CountryCodeMH); + _CountryCodeMap.Add(TEXT("MQ"), CountryCodeMQ); + _CountryCodeMap.Add(TEXT("MR"), CountryCodeMR); + _CountryCodeMap.Add(TEXT("MU"), CountryCodeMU); + _CountryCodeMap.Add(TEXT("YT"), CountryCodeYT); + _CountryCodeMap.Add(TEXT("MX"), CountryCodeMX); + _CountryCodeMap.Add(TEXT("FM"), CountryCodeFM); + _CountryCodeMap.Add(TEXT("MD"), CountryCodeMD); + _CountryCodeMap.Add(TEXT("MC"), CountryCodeMC); + _CountryCodeMap.Add(TEXT("MN"), CountryCodeMN); + _CountryCodeMap.Add(TEXT("ME"), CountryCodeME); + _CountryCodeMap.Add(TEXT("MS"), CountryCodeMS); + _CountryCodeMap.Add(TEXT("MA"), CountryCodeMA); + _CountryCodeMap.Add(TEXT("MZ"), CountryCodeMZ); + _CountryCodeMap.Add(TEXT("MM"), CountryCodeMM); + _CountryCodeMap.Add(TEXT("NA"), CountryCodeNA); + _CountryCodeMap.Add(TEXT("NR"), CountryCodeNR); + _CountryCodeMap.Add(TEXT("NP"), CountryCodeNP); + _CountryCodeMap.Add(TEXT("NL"), CountryCodeNL); + _CountryCodeMap.Add(TEXT("NC"), CountryCodeNC); + _CountryCodeMap.Add(TEXT("NZ"), CountryCodeNZ); + _CountryCodeMap.Add(TEXT("NI"), CountryCodeNI); + _CountryCodeMap.Add(TEXT("NE"), CountryCodeNE); + _CountryCodeMap.Add(TEXT("NG"), CountryCodeNG); + _CountryCodeMap.Add(TEXT("NU"), CountryCodeNU); + _CountryCodeMap.Add(TEXT("NF"), CountryCodeNF); + _CountryCodeMap.Add(TEXT("MP"), CountryCodeMP); + _CountryCodeMap.Add(TEXT("NO"), CountryCodeNO); + _CountryCodeMap.Add(TEXT("OM"), CountryCodeOM); + _CountryCodeMap.Add(TEXT("PK"), CountryCodePK); + _CountryCodeMap.Add(TEXT("PW"), CountryCodePW); + _CountryCodeMap.Add(TEXT("PS"), CountryCodePS); + _CountryCodeMap.Add(TEXT("PA"), CountryCodePA); + _CountryCodeMap.Add(TEXT("PG"), CountryCodePG); + _CountryCodeMap.Add(TEXT("PY"), CountryCodePY); + _CountryCodeMap.Add(TEXT("PE"), CountryCodePE); + _CountryCodeMap.Add(TEXT("PH"), CountryCodePH); + _CountryCodeMap.Add(TEXT("PN"), CountryCodePN); + _CountryCodeMap.Add(TEXT("PL"), CountryCodePL); + _CountryCodeMap.Add(TEXT("PT"), CountryCodePT); + _CountryCodeMap.Add(TEXT("PR"), CountryCodePR); + _CountryCodeMap.Add(TEXT("QA"), CountryCodeQA); + _CountryCodeMap.Add(TEXT("RE"), CountryCodeRE); + _CountryCodeMap.Add(TEXT("RO"), CountryCodeRO); + _CountryCodeMap.Add(TEXT("RU"), CountryCodeRU); + _CountryCodeMap.Add(TEXT("RW"), CountryCodeRW); + _CountryCodeMap.Add(TEXT("BL"), CountryCodeBL); + _CountryCodeMap.Add(TEXT("SH"), CountryCodeSH); + _CountryCodeMap.Add(TEXT("KN"), CountryCodeKN); + _CountryCodeMap.Add(TEXT("LC"), CountryCodeLC); + _CountryCodeMap.Add(TEXT("MF"), CountryCodeMF); + _CountryCodeMap.Add(TEXT("PM"), CountryCodePM); + _CountryCodeMap.Add(TEXT("VC"), CountryCodeVC); + _CountryCodeMap.Add(TEXT("WS"), CountryCodeWS); + _CountryCodeMap.Add(TEXT("SM"), CountryCodeSM); + _CountryCodeMap.Add(TEXT("ST"), CountryCodeST); + _CountryCodeMap.Add(TEXT("SA"), CountryCodeSA); + _CountryCodeMap.Add(TEXT("SN"), CountryCodeSN); + _CountryCodeMap.Add(TEXT("RS"), CountryCodeRS); + _CountryCodeMap.Add(TEXT("SC"), CountryCodeSC); + _CountryCodeMap.Add(TEXT("SL"), CountryCodeSL); + _CountryCodeMap.Add(TEXT("SG"), CountryCodeSG); + _CountryCodeMap.Add(TEXT("SX"), CountryCodeSX); + _CountryCodeMap.Add(TEXT("SK"), CountryCodeSK); + _CountryCodeMap.Add(TEXT("SI"), CountryCodeSI); + _CountryCodeMap.Add(TEXT("SB"), CountryCodeSB); + _CountryCodeMap.Add(TEXT("SO"), CountryCodeSO); + _CountryCodeMap.Add(TEXT("ZA"), CountryCodeZA); + _CountryCodeMap.Add(TEXT("GS"), CountryCodeGS); + _CountryCodeMap.Add(TEXT("SS"), CountryCodeSS); + _CountryCodeMap.Add(TEXT("ES"), CountryCodeES); + _CountryCodeMap.Add(TEXT("LK"), CountryCodeLK); + _CountryCodeMap.Add(TEXT("SD"), CountryCodeSD); + _CountryCodeMap.Add(TEXT("SR"), CountryCodeSR); + _CountryCodeMap.Add(TEXT("SJ"), CountryCodeSJ); + _CountryCodeMap.Add(TEXT("SZ"), CountryCodeSZ); + _CountryCodeMap.Add(TEXT("SE"), CountryCodeSE); + _CountryCodeMap.Add(TEXT("CH"), CountryCodeCH); + _CountryCodeMap.Add(TEXT("SY"), CountryCodeSY); + _CountryCodeMap.Add(TEXT("TW"), CountryCodeTW); + _CountryCodeMap.Add(TEXT("TJ"), CountryCodeTJ); + _CountryCodeMap.Add(TEXT("TZ"), CountryCodeTZ); + _CountryCodeMap.Add(TEXT("TH"), CountryCodeTH); + _CountryCodeMap.Add(TEXT("TL"), CountryCodeTL); + _CountryCodeMap.Add(TEXT("TG"), CountryCodeTG); + _CountryCodeMap.Add(TEXT("TK"), CountryCodeTK); + _CountryCodeMap.Add(TEXT("TO"), CountryCodeTO); + _CountryCodeMap.Add(TEXT("TT"), CountryCodeTT); + _CountryCodeMap.Add(TEXT("TN"), CountryCodeTN); + _CountryCodeMap.Add(TEXT("TR"), CountryCodeTR); + _CountryCodeMap.Add(TEXT("TM"), CountryCodeTM); + _CountryCodeMap.Add(TEXT("TC"), CountryCodeTC); + _CountryCodeMap.Add(TEXT("TV"), CountryCodeTV); + _CountryCodeMap.Add(TEXT("UG"), CountryCodeUG); + _CountryCodeMap.Add(TEXT("UA"), CountryCodeUA); + _CountryCodeMap.Add(TEXT("AE"), CountryCodeAE); + _CountryCodeMap.Add(TEXT("GB"), CountryCodeGB); + _CountryCodeMap.Add(TEXT("US"), CountryCodeUS); + _CountryCodeMap.Add(TEXT("UM"), CountryCodeUM); + _CountryCodeMap.Add(TEXT("UY"), CountryCodeUY); + _CountryCodeMap.Add(TEXT("UZ"), CountryCodeUZ); + _CountryCodeMap.Add(TEXT("VU"), CountryCodeVU); + _CountryCodeMap.Add(TEXT("VE"), CountryCodeVE); + _CountryCodeMap.Add(TEXT("VN"), CountryCodeVN); + _CountryCodeMap.Add(TEXT("VG"), CountryCodeVG); + _CountryCodeMap.Add(TEXT("VI"), CountryCodeVI); + _CountryCodeMap.Add(TEXT("WF"), CountryCodeWF); + _CountryCodeMap.Add(TEXT("EH"), CountryCodeEH); + _CountryCodeMap.Add(TEXT("YE"), CountryCodeYE); + _CountryCodeMap.Add(TEXT("ZM"), CountryCodeZM); + _CountryCodeMap.Add(TEXT("ZW"), CountryCodeZW); + + } + + if (!value.IsEmpty()) + { + auto output = _CountryCodeMap.Find(value); + if (output != nullptr) + return *output; + } + + return CountryCodeAF; // Basically critical fail +} + +PlayFab::ServerModels::FCreateSharedGroupRequest::~FCreateSharedGroupRequest() +{ + +} + +void PlayFab::ServerModels::FCreateSharedGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SharedGroupId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCreateSharedGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FCreateSharedGroupResult::~FCreateSharedGroupResult() +{ + +} + +void PlayFab::ServerModels::FCreateSharedGroupResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SharedGroupId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCreateSharedGroupResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeleteCharacterFromUserRequest::~FDeleteCharacterFromUserRequest() +{ + +} + +void PlayFab::ServerModels::FDeleteCharacterFromUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("SaveCharacterInventory")); writer->WriteValue(SaveCharacterInventory); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeleteCharacterFromUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr SaveCharacterInventoryValue = obj->TryGetField(TEXT("SaveCharacterInventory")); + if (SaveCharacterInventoryValue.IsValid() && !SaveCharacterInventoryValue->IsNull()) + { + bool TmpValue; + if (SaveCharacterInventoryValue->TryGetBool(TmpValue)) { SaveCharacterInventory = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeleteCharacterFromUserResult::~FDeleteCharacterFromUserResult() +{ + +} + +void PlayFab::ServerModels::FDeleteCharacterFromUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeleteCharacterFromUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeleteSharedGroupRequest::~FDeleteSharedGroupRequest() +{ + +} + +void PlayFab::ServerModels::FDeleteSharedGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeleteSharedGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeleteUsersRequest::~FDeleteUsersRequest() +{ + +} + +void PlayFab::ServerModels::FDeleteUsersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("PlayFabIds")); + for (const FString& item : PlayFabIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeleteUsersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("PlayFabIds"), PlayFabIds); + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeleteUsersResult::~FDeleteUsersResult() +{ + +} + +void PlayFab::ServerModels::FDeleteUsersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeleteUsersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeregisterGameRequest::~FDeregisterGameRequest() +{ + +} + +void PlayFab::ServerModels::FDeregisterGameRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeregisterGameRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeregisterGameResponse::~FDeregisterGameResponse() +{ + +} + +void PlayFab::ServerModels::FDeregisterGameResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeregisterGameResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FEmptyResponse::~FEmptyResponse() +{ + +} + +void PlayFab::ServerModels::FEmptyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FEmptyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FEvaluateRandomResultTableRequest::~FEvaluateRandomResultTableRequest() +{ + +} + +void PlayFab::ServerModels::FEvaluateRandomResultTableRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("TableId")); writer->WriteValue(TableId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FEvaluateRandomResultTableRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr TableIdValue = obj->TryGetField(TEXT("TableId")); + if (TableIdValue.IsValid() && !TableIdValue->IsNull()) + { + FString TmpValue; + if (TableIdValue->TryGetString(TmpValue)) { TableId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FEvaluateRandomResultTableResult::~FEvaluateRandomResultTableResult() +{ + +} + +void PlayFab::ServerModels::FEvaluateRandomResultTableResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ResultItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ResultItemId")); writer->WriteValue(ResultItemId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FEvaluateRandomResultTableResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ResultItemIdValue = obj->TryGetField(TEXT("ResultItemId")); + if (ResultItemIdValue.IsValid() && !ResultItemIdValue->IsNull()) + { + FString TmpValue; + if (ResultItemIdValue->TryGetString(TmpValue)) { ResultItemId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FScriptExecutionError::~FScriptExecutionError() +{ + +} + +void PlayFab::ServerModels::FScriptExecutionError::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + if (StackTrace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StackTrace")); writer->WriteValue(StackTrace); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FScriptExecutionError::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + const TSharedPtr StackTraceValue = obj->TryGetField(TEXT("StackTrace")); + if (StackTraceValue.IsValid() && !StackTraceValue->IsNull()) + { + FString TmpValue; + if (StackTraceValue->TryGetString(TmpValue)) { StackTrace = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FLogStatement::~FLogStatement() +{ + +} + +void PlayFab::ServerModels::FLogStatement::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.notNull()) { writer->WriteIdentifierPrefix(TEXT("Data")); Data.writeJSON(writer); } + + if (Level.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Level")); writer->WriteValue(Level); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FLogStatement::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataValue = obj->TryGetField(TEXT("Data")); + if (DataValue.IsValid() && !DataValue->IsNull()) + { + Data = FJsonKeeper(DataValue); + } + + const TSharedPtr LevelValue = obj->TryGetField(TEXT("Level")); + if (LevelValue.IsValid() && !LevelValue->IsNull()) + { + FString TmpValue; + if (LevelValue->TryGetString(TmpValue)) { Level = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FExecuteCloudScriptResult::~FExecuteCloudScriptResult() +{ + //if (Error != nullptr) delete Error; + +} + +void PlayFab::ServerModels::FExecuteCloudScriptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("APIRequestsIssued")); writer->WriteValue(APIRequestsIssued); + + if (Error.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Error")); Error->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ExecutionTimeSeconds")); writer->WriteValue(ExecutionTimeSeconds); + + if (FunctionName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); } + + if (FunctionResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResult")); FunctionResult.writeJSON(writer); } + + if (FunctionResultTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResultTooLarge")); writer->WriteValue(FunctionResultTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("HttpRequestsIssued")); writer->WriteValue(HttpRequestsIssued); + + if (Logs.Num() != 0) + { + writer->WriteArrayStart(TEXT("Logs")); + for (const FLogStatement& item : Logs) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (LogsTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("LogsTooLarge")); writer->WriteValue(LogsTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("MemoryConsumedBytes")); writer->WriteValue(static_cast(MemoryConsumedBytes)); + + writer->WriteIdentifierPrefix(TEXT("ProcessorTimeSeconds")); writer->WriteValue(ProcessorTimeSeconds); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FExecuteCloudScriptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr APIRequestsIssuedValue = obj->TryGetField(TEXT("APIRequestsIssued")); + if (APIRequestsIssuedValue.IsValid() && !APIRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (APIRequestsIssuedValue->TryGetNumber(TmpValue)) { APIRequestsIssued = TmpValue; } + } + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + Error = MakeShareable(new FScriptExecutionError(ErrorValue->AsObject())); + } + + const TSharedPtr ExecutionTimeSecondsValue = obj->TryGetField(TEXT("ExecutionTimeSeconds")); + if (ExecutionTimeSecondsValue.IsValid() && !ExecutionTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ExecutionTimeSecondsValue->TryGetNumber(TmpValue)) { ExecutionTimeSeconds = TmpValue; } + } + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionResultValue = obj->TryGetField(TEXT("FunctionResult")); + if (FunctionResultValue.IsValid() && !FunctionResultValue->IsNull()) + { + FunctionResult = FJsonKeeper(FunctionResultValue); + } + + const TSharedPtr FunctionResultTooLargeValue = obj->TryGetField(TEXT("FunctionResultTooLarge")); + if (FunctionResultTooLargeValue.IsValid() && !FunctionResultTooLargeValue->IsNull()) + { + bool TmpValue; + if (FunctionResultTooLargeValue->TryGetBool(TmpValue)) { FunctionResultTooLarge = TmpValue; } + } + + const TSharedPtr HttpRequestsIssuedValue = obj->TryGetField(TEXT("HttpRequestsIssued")); + if (HttpRequestsIssuedValue.IsValid() && !HttpRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (HttpRequestsIssuedValue->TryGetNumber(TmpValue)) { HttpRequestsIssued = TmpValue; } + } + + const TArray>&LogsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Logs")); + for (int32 Idx = 0; Idx < LogsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LogsArray[Idx]; + Logs.Add(FLogStatement(CurrentItem->AsObject())); + } + + + const TSharedPtr LogsTooLargeValue = obj->TryGetField(TEXT("LogsTooLarge")); + if (LogsTooLargeValue.IsValid() && !LogsTooLargeValue->IsNull()) + { + bool TmpValue; + if (LogsTooLargeValue->TryGetBool(TmpValue)) { LogsTooLarge = TmpValue; } + } + + const TSharedPtr MemoryConsumedBytesValue = obj->TryGetField(TEXT("MemoryConsumedBytes")); + if (MemoryConsumedBytesValue.IsValid() && !MemoryConsumedBytesValue->IsNull()) + { + uint32 TmpValue; + if (MemoryConsumedBytesValue->TryGetNumber(TmpValue)) { MemoryConsumedBytes = TmpValue; } + } + + const TSharedPtr ProcessorTimeSecondsValue = obj->TryGetField(TEXT("ProcessorTimeSeconds")); + if (ProcessorTimeSecondsValue.IsValid() && !ProcessorTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ProcessorTimeSecondsValue->TryGetNumber(TmpValue)) { ProcessorTimeSeconds = TmpValue; } + } + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FExecuteCloudScriptServerRequest::~FExecuteCloudScriptServerRequest() +{ + +} + +void PlayFab::ServerModels::FExecuteCloudScriptServerRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); + + if (FunctionParameter.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionParameter")); FunctionParameter.writeJSON(writer); } + + if (GeneratePlayStreamEvent.notNull()) { writer->WriteIdentifierPrefix(TEXT("GeneratePlayStreamEvent")); writer->WriteValue(GeneratePlayStreamEvent); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (RevisionSelection.notNull()) { writer->WriteIdentifierPrefix(TEXT("RevisionSelection")); writeCloudScriptRevisionOptionEnumJSON(RevisionSelection, writer); } + + if (SpecificRevision.notNull()) { writer->WriteIdentifierPrefix(TEXT("SpecificRevision")); writer->WriteValue(SpecificRevision); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FExecuteCloudScriptServerRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionParameterValue = obj->TryGetField(TEXT("FunctionParameter")); + if (FunctionParameterValue.IsValid() && !FunctionParameterValue->IsNull()) + { + FunctionParameter = FJsonKeeper(FunctionParameterValue); + } + + const TSharedPtr GeneratePlayStreamEventValue = obj->TryGetField(TEXT("GeneratePlayStreamEvent")); + if (GeneratePlayStreamEventValue.IsValid() && !GeneratePlayStreamEventValue->IsNull()) + { + bool TmpValue; + if (GeneratePlayStreamEventValue->TryGetBool(TmpValue)) { GeneratePlayStreamEvent = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + RevisionSelection = readCloudScriptRevisionOptionFromValue(obj->TryGetField(TEXT("RevisionSelection"))); + + const TSharedPtr SpecificRevisionValue = obj->TryGetField(TEXT("SpecificRevision")); + if (SpecificRevisionValue.IsValid() && !SpecificRevisionValue->IsNull()) + { + int32 TmpValue; + if (SpecificRevisionValue->TryGetNumber(TmpValue)) { SpecificRevision = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FFacebookInstantGamesPlayFabIdPair::~FFacebookInstantGamesPlayFabIdPair() +{ + +} + +void PlayFab::ServerModels::FFacebookInstantGamesPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookInstantGamesId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesId")); writer->WriteValue(FacebookInstantGamesId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FFacebookInstantGamesPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesIdValue = obj->TryGetField(TEXT("FacebookInstantGamesId")); + if (FacebookInstantGamesIdValue.IsValid() && !FacebookInstantGamesIdValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesIdValue->TryGetString(TmpValue)) { FacebookInstantGamesId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FFacebookPlayFabIdPair::~FFacebookPlayFabIdPair() +{ + +} + +void PlayFab::ServerModels::FFacebookPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookId")); writer->WriteValue(FacebookId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FFacebookPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookIdValue = obj->TryGetField(TEXT("FacebookId")); + if (FacebookIdValue.IsValid() && !FacebookIdValue->IsNull()) + { + FString TmpValue; + if (FacebookIdValue->TryGetString(TmpValue)) { FacebookId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeLoginIdentityProviderEnumJSON(LoginIdentityProvider enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case LoginIdentityProviderUnknown: writer->WriteValue(TEXT("Unknown")); break; + case LoginIdentityProviderPlayFab: writer->WriteValue(TEXT("PlayFab")); break; + case LoginIdentityProviderCustom: writer->WriteValue(TEXT("Custom")); break; + case LoginIdentityProviderGameCenter: writer->WriteValue(TEXT("GameCenter")); break; + case LoginIdentityProviderGooglePlay: writer->WriteValue(TEXT("GooglePlay")); break; + case LoginIdentityProviderSteam: writer->WriteValue(TEXT("Steam")); break; + case LoginIdentityProviderXBoxLive: writer->WriteValue(TEXT("XBoxLive")); break; + case LoginIdentityProviderPSN: writer->WriteValue(TEXT("PSN")); break; + case LoginIdentityProviderKongregate: writer->WriteValue(TEXT("Kongregate")); break; + case LoginIdentityProviderFacebook: writer->WriteValue(TEXT("Facebook")); break; + case LoginIdentityProviderIOSDevice: writer->WriteValue(TEXT("IOSDevice")); break; + case LoginIdentityProviderAndroidDevice: writer->WriteValue(TEXT("AndroidDevice")); break; + case LoginIdentityProviderTwitch: writer->WriteValue(TEXT("Twitch")); break; + case LoginIdentityProviderWindowsHello: writer->WriteValue(TEXT("WindowsHello")); break; + case LoginIdentityProviderGameServer: writer->WriteValue(TEXT("GameServer")); break; + case LoginIdentityProviderCustomServer: writer->WriteValue(TEXT("CustomServer")); break; + case LoginIdentityProviderNintendoSwitch: writer->WriteValue(TEXT("NintendoSwitch")); break; + case LoginIdentityProviderFacebookInstantGames: writer->WriteValue(TEXT("FacebookInstantGames")); break; + case LoginIdentityProviderOpenIdConnect: writer->WriteValue(TEXT("OpenIdConnect")); break; + } +} + +ServerModels::LoginIdentityProvider PlayFab::ServerModels::readLoginIdentityProviderFromValue(const TSharedPtr& value) +{ + return readLoginIdentityProviderFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::LoginIdentityProvider PlayFab::ServerModels::readLoginIdentityProviderFromValue(const FString& value) +{ + static TMap _LoginIdentityProviderMap; + if (_LoginIdentityProviderMap.Num() == 0) + { + // Auto-generate the map on the first use + _LoginIdentityProviderMap.Add(TEXT("Unknown"), LoginIdentityProviderUnknown); + _LoginIdentityProviderMap.Add(TEXT("PlayFab"), LoginIdentityProviderPlayFab); + _LoginIdentityProviderMap.Add(TEXT("Custom"), LoginIdentityProviderCustom); + _LoginIdentityProviderMap.Add(TEXT("GameCenter"), LoginIdentityProviderGameCenter); + _LoginIdentityProviderMap.Add(TEXT("GooglePlay"), LoginIdentityProviderGooglePlay); + _LoginIdentityProviderMap.Add(TEXT("Steam"), LoginIdentityProviderSteam); + _LoginIdentityProviderMap.Add(TEXT("XBoxLive"), LoginIdentityProviderXBoxLive); + _LoginIdentityProviderMap.Add(TEXT("PSN"), LoginIdentityProviderPSN); + _LoginIdentityProviderMap.Add(TEXT("Kongregate"), LoginIdentityProviderKongregate); + _LoginIdentityProviderMap.Add(TEXT("Facebook"), LoginIdentityProviderFacebook); + _LoginIdentityProviderMap.Add(TEXT("IOSDevice"), LoginIdentityProviderIOSDevice); + _LoginIdentityProviderMap.Add(TEXT("AndroidDevice"), LoginIdentityProviderAndroidDevice); + _LoginIdentityProviderMap.Add(TEXT("Twitch"), LoginIdentityProviderTwitch); + _LoginIdentityProviderMap.Add(TEXT("WindowsHello"), LoginIdentityProviderWindowsHello); + _LoginIdentityProviderMap.Add(TEXT("GameServer"), LoginIdentityProviderGameServer); + _LoginIdentityProviderMap.Add(TEXT("CustomServer"), LoginIdentityProviderCustomServer); + _LoginIdentityProviderMap.Add(TEXT("NintendoSwitch"), LoginIdentityProviderNintendoSwitch); + _LoginIdentityProviderMap.Add(TEXT("FacebookInstantGames"), LoginIdentityProviderFacebookInstantGames); + _LoginIdentityProviderMap.Add(TEXT("OpenIdConnect"), LoginIdentityProviderOpenIdConnect); + + } + + if (!value.IsEmpty()) + { + auto output = _LoginIdentityProviderMap.Find(value); + if (output != nullptr) + return *output; + } + + return LoginIdentityProviderUnknown; // Basically critical fail +} + +PlayFab::ServerModels::FLinkedPlatformAccountModel::~FLinkedPlatformAccountModel() +{ + +} + +void PlayFab::ServerModels::FLinkedPlatformAccountModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writeLoginIdentityProviderEnumJSON(Platform, writer); } + + if (PlatformUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlatformUserId")); writer->WriteValue(PlatformUserId); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FLinkedPlatformAccountModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + Platform = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Platform"))); + + const TSharedPtr PlatformUserIdValue = obj->TryGetField(TEXT("PlatformUserId")); + if (PlatformUserIdValue.IsValid() && !PlatformUserIdValue->IsNull()) + { + FString TmpValue; + if (PlatformUserIdValue->TryGetString(TmpValue)) { PlatformUserId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FLocationModel::~FLocationModel() +{ + +} + +void PlayFab::ServerModels::FLocationModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (City.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("City")); writer->WriteValue(City); } + + if (pfContinentCode.notNull()) { writer->WriteIdentifierPrefix(TEXT("ContinentCode")); writeContinentCodeEnumJSON(pfContinentCode, writer); } + + if (pfCountryCode.notNull()) { writer->WriteIdentifierPrefix(TEXT("CountryCode")); writeCountryCodeEnumJSON(pfCountryCode, writer); } + + if (Latitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Latitude")); writer->WriteValue(Latitude); } + + if (Longitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Longitude")); writer->WriteValue(Longitude); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FLocationModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CityValue = obj->TryGetField(TEXT("City")); + if (CityValue.IsValid() && !CityValue->IsNull()) + { + FString TmpValue; + if (CityValue->TryGetString(TmpValue)) { City = TmpValue; } + } + + pfContinentCode = readContinentCodeFromValue(obj->TryGetField(TEXT("ContinentCode"))); + + pfCountryCode = readCountryCodeFromValue(obj->TryGetField(TEXT("CountryCode"))); + + const TSharedPtr LatitudeValue = obj->TryGetField(TEXT("Latitude")); + if (LatitudeValue.IsValid() && !LatitudeValue->IsNull()) + { + double TmpValue; + if (LatitudeValue->TryGetNumber(TmpValue)) { Latitude = TmpValue; } + } + + const TSharedPtr LongitudeValue = obj->TryGetField(TEXT("Longitude")); + if (LongitudeValue.IsValid() && !LongitudeValue->IsNull()) + { + double TmpValue; + if (LongitudeValue->TryGetNumber(TmpValue)) { Longitude = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeSubscriptionProviderStatusEnumJSON(SubscriptionProviderStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case SubscriptionProviderStatusNoError: writer->WriteValue(TEXT("NoError")); break; + case SubscriptionProviderStatusCancelled: writer->WriteValue(TEXT("Cancelled")); break; + case SubscriptionProviderStatusUnknownError: writer->WriteValue(TEXT("UnknownError")); break; + case SubscriptionProviderStatusBillingError: writer->WriteValue(TEXT("BillingError")); break; + case SubscriptionProviderStatusProductUnavailable: writer->WriteValue(TEXT("ProductUnavailable")); break; + case SubscriptionProviderStatusCustomerDidNotAcceptPriceChange: writer->WriteValue(TEXT("CustomerDidNotAcceptPriceChange")); break; + case SubscriptionProviderStatusFreeTrial: writer->WriteValue(TEXT("FreeTrial")); break; + case SubscriptionProviderStatusPaymentPending: writer->WriteValue(TEXT("PaymentPending")); break; + } +} + +ServerModels::SubscriptionProviderStatus PlayFab::ServerModels::readSubscriptionProviderStatusFromValue(const TSharedPtr& value) +{ + return readSubscriptionProviderStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::SubscriptionProviderStatus PlayFab::ServerModels::readSubscriptionProviderStatusFromValue(const FString& value) +{ + static TMap _SubscriptionProviderStatusMap; + if (_SubscriptionProviderStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _SubscriptionProviderStatusMap.Add(TEXT("NoError"), SubscriptionProviderStatusNoError); + _SubscriptionProviderStatusMap.Add(TEXT("Cancelled"), SubscriptionProviderStatusCancelled); + _SubscriptionProviderStatusMap.Add(TEXT("UnknownError"), SubscriptionProviderStatusUnknownError); + _SubscriptionProviderStatusMap.Add(TEXT("BillingError"), SubscriptionProviderStatusBillingError); + _SubscriptionProviderStatusMap.Add(TEXT("ProductUnavailable"), SubscriptionProviderStatusProductUnavailable); + _SubscriptionProviderStatusMap.Add(TEXT("CustomerDidNotAcceptPriceChange"), SubscriptionProviderStatusCustomerDidNotAcceptPriceChange); + _SubscriptionProviderStatusMap.Add(TEXT("FreeTrial"), SubscriptionProviderStatusFreeTrial); + _SubscriptionProviderStatusMap.Add(TEXT("PaymentPending"), SubscriptionProviderStatusPaymentPending); + + } + + if (!value.IsEmpty()) + { + auto output = _SubscriptionProviderStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return SubscriptionProviderStatusNoError; // Basically critical fail +} + +PlayFab::ServerModels::FSubscriptionModel::~FSubscriptionModel() +{ + +} + +void PlayFab::ServerModels::FSubscriptionModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); + + writer->WriteIdentifierPrefix(TEXT("InitialSubscriptionTime")); writeDatetime(InitialSubscriptionTime, writer); + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeSubscriptionProviderStatusEnumJSON(Status, writer); } + + if (SubscriptionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionId")); writer->WriteValue(SubscriptionId); } + + if (SubscriptionItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionItemId")); writer->WriteValue(SubscriptionItemId); } + + if (SubscriptionProvider.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionProvider")); writer->WriteValue(SubscriptionProvider); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSubscriptionModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr InitialSubscriptionTimeValue = obj->TryGetField(TEXT("InitialSubscriptionTime")); + if (InitialSubscriptionTimeValue.IsValid()) + InitialSubscriptionTime = readDatetime(InitialSubscriptionTimeValue); + + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + Status = readSubscriptionProviderStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr SubscriptionIdValue = obj->TryGetField(TEXT("SubscriptionId")); + if (SubscriptionIdValue.IsValid() && !SubscriptionIdValue->IsNull()) + { + FString TmpValue; + if (SubscriptionIdValue->TryGetString(TmpValue)) { SubscriptionId = TmpValue; } + } + + const TSharedPtr SubscriptionItemIdValue = obj->TryGetField(TEXT("SubscriptionItemId")); + if (SubscriptionItemIdValue.IsValid() && !SubscriptionItemIdValue->IsNull()) + { + FString TmpValue; + if (SubscriptionItemIdValue->TryGetString(TmpValue)) { SubscriptionItemId = TmpValue; } + } + + const TSharedPtr SubscriptionProviderValue = obj->TryGetField(TEXT("SubscriptionProvider")); + if (SubscriptionProviderValue.IsValid() && !SubscriptionProviderValue->IsNull()) + { + FString TmpValue; + if (SubscriptionProviderValue->TryGetString(TmpValue)) { SubscriptionProvider = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FMembershipModel::~FMembershipModel() +{ + +} + +void PlayFab::ServerModels::FMembershipModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + writer->WriteIdentifierPrefix(TEXT("MembershipExpiration")); writeDatetime(MembershipExpiration, writer); + + if (MembershipId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MembershipId")); writer->WriteValue(MembershipId); } + + if (OverrideExpiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("OverrideExpiration")); writeDatetime(OverrideExpiration, writer); } + + if (OverrideIsSet.notNull()) { writer->WriteIdentifierPrefix(TEXT("OverrideIsSet")); writer->WriteValue(OverrideIsSet); } + + if (Subscriptions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Subscriptions")); + for (const FSubscriptionModel& item : Subscriptions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMembershipModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr MembershipExpirationValue = obj->TryGetField(TEXT("MembershipExpiration")); + if (MembershipExpirationValue.IsValid()) + MembershipExpiration = readDatetime(MembershipExpirationValue); + + + const TSharedPtr MembershipIdValue = obj->TryGetField(TEXT("MembershipId")); + if (MembershipIdValue.IsValid() && !MembershipIdValue->IsNull()) + { + FString TmpValue; + if (MembershipIdValue->TryGetString(TmpValue)) { MembershipId = TmpValue; } + } + + const TSharedPtr OverrideExpirationValue = obj->TryGetField(TEXT("OverrideExpiration")); + if (OverrideExpirationValue.IsValid()) + OverrideExpiration = readDatetime(OverrideExpirationValue); + + + const TSharedPtr OverrideIsSetValue = obj->TryGetField(TEXT("OverrideIsSet")); + if (OverrideIsSetValue.IsValid() && !OverrideIsSetValue->IsNull()) + { + bool TmpValue; + if (OverrideIsSetValue->TryGetBool(TmpValue)) { OverrideIsSet = TmpValue; } + } + + const TArray>&SubscriptionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Subscriptions")); + for (int32 Idx = 0; Idx < SubscriptionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SubscriptionsArray[Idx]; + Subscriptions.Add(FSubscriptionModel(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FPushNotificationRegistrationModel::~FPushNotificationRegistrationModel() +{ + +} + +void PlayFab::ServerModels::FPushNotificationRegistrationModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NotificationEndpointARN.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NotificationEndpointARN")); writer->WriteValue(NotificationEndpointARN); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writePushNotificationPlatformEnumJSON(Platform, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPushNotificationRegistrationModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NotificationEndpointARNValue = obj->TryGetField(TEXT("NotificationEndpointARN")); + if (NotificationEndpointARNValue.IsValid() && !NotificationEndpointARNValue->IsNull()) + { + FString TmpValue; + if (NotificationEndpointARNValue->TryGetString(TmpValue)) { NotificationEndpointARN = TmpValue; } + } + + Platform = readPushNotificationPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::ServerModels::FStatisticModel::~FStatisticModel() +{ + +} + +void PlayFab::ServerModels::FStatisticModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FStatisticModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FTagModel::~FTagModel() +{ + +} + +void PlayFab::ServerModels::FTagModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TagValue.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TagValue")); writer->WriteValue(TagValue); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FTagModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TagValueValue = obj->TryGetField(TEXT("TagValue")); + if (TagValueValue.IsValid() && !TagValueValue->IsNull()) + { + FString TmpValue; + if (TagValueValue->TryGetString(TmpValue)) { TagValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FValueToDateModel::~FValueToDateModel() +{ + +} + +void PlayFab::ServerModels::FValueToDateModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Currency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Currency")); writer->WriteValue(Currency); } + + writer->WriteIdentifierPrefix(TEXT("TotalValue")); writer->WriteValue(static_cast(TotalValue)); + + if (TotalValueAsDecimal.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TotalValueAsDecimal")); writer->WriteValue(TotalValueAsDecimal); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FValueToDateModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyValue = obj->TryGetField(TEXT("Currency")); + if (CurrencyValue.IsValid() && !CurrencyValue->IsNull()) + { + FString TmpValue; + if (CurrencyValue->TryGetString(TmpValue)) { Currency = TmpValue; } + } + + const TSharedPtr TotalValueValue = obj->TryGetField(TEXT("TotalValue")); + if (TotalValueValue.IsValid() && !TotalValueValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueValue->TryGetNumber(TmpValue)) { TotalValue = TmpValue; } + } + + const TSharedPtr TotalValueAsDecimalValue = obj->TryGetField(TEXT("TotalValueAsDecimal")); + if (TotalValueAsDecimalValue.IsValid() && !TotalValueAsDecimalValue->IsNull()) + { + FString TmpValue; + if (TotalValueAsDecimalValue->TryGetString(TmpValue)) { TotalValueAsDecimal = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerProfileModel::~FPlayerProfileModel() +{ + +} + +void PlayFab::ServerModels::FPlayerProfileModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdCampaignAttributions.Num() != 0) + { + writer->WriteArrayStart(TEXT("AdCampaignAttributions")); + for (const FAdCampaignAttributionModel& item : AdCampaignAttributions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + if (BannedUntil.notNull()) { writer->WriteIdentifierPrefix(TEXT("BannedUntil")); writeDatetime(BannedUntil, writer); } + + if (ContactEmailAddresses.Num() != 0) + { + writer->WriteArrayStart(TEXT("ContactEmailAddresses")); + for (const FContactEmailInfoModel& item : ContactEmailAddresses) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (LinkedAccounts.Num() != 0) + { + writer->WriteArrayStart(TEXT("LinkedAccounts")); + for (const FLinkedPlatformAccountModel& item : LinkedAccounts) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Locations.Num() != 0) + { + writer->WriteArrayStart(TEXT("Locations")); + for (const FLocationModel& item : Locations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Memberships.Num() != 0) + { + writer->WriteArrayStart(TEXT("Memberships")); + for (const FMembershipModel& item : Memberships) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeLoginIdentityProviderEnumJSON(Origination, writer); } + + if (PlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerId")); writer->WriteValue(PlayerId); } + + if (PublisherId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PublisherId")); writer->WriteValue(PublisherId); } + + if (PushNotificationRegistrations.Num() != 0) + { + writer->WriteArrayStart(TEXT("PushNotificationRegistrations")); + for (const FPushNotificationRegistrationModel& item : PushNotificationRegistrations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Statistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticModel& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FTagModel& item : Tags) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + if (TotalValueToDateInUSD.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalValueToDateInUSD")); writer->WriteValue(static_cast(TotalValueToDateInUSD)); } + + if (ValuesToDate.Num() != 0) + { + writer->WriteArrayStart(TEXT("ValuesToDate")); + for (const FValueToDateModel& item : ValuesToDate) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerProfileModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AdCampaignAttributionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AdCampaignAttributions")); + for (int32 Idx = 0; Idx < AdCampaignAttributionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AdCampaignAttributionsArray[Idx]; + AdCampaignAttributions.Add(FAdCampaignAttributionModel(CurrentItem->AsObject())); + } + + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr BannedUntilValue = obj->TryGetField(TEXT("BannedUntil")); + if (BannedUntilValue.IsValid()) + BannedUntil = readDatetime(BannedUntilValue); + + + const TArray>&ContactEmailAddressesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ContactEmailAddresses")); + for (int32 Idx = 0; Idx < ContactEmailAddressesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContactEmailAddressesArray[Idx]; + ContactEmailAddresses.Add(FContactEmailInfoModel(CurrentItem->AsObject())); + } + + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + const TArray>&LinkedAccountsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("LinkedAccounts")); + for (int32 Idx = 0; Idx < LinkedAccountsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LinkedAccountsArray[Idx]; + LinkedAccounts.Add(FLinkedPlatformAccountModel(CurrentItem->AsObject())); + } + + + const TArray>&LocationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Locations")); + for (int32 Idx = 0; Idx < LocationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LocationsArray[Idx]; + Locations.Add(FLocationModel(CurrentItem->AsObject())); + } + + + const TArray>&MembershipsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Memberships")); + for (int32 Idx = 0; Idx < MembershipsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembershipsArray[Idx]; + Memberships.Add(FMembershipModel(CurrentItem->AsObject())); + } + + + Origination = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr PlayerIdValue = obj->TryGetField(TEXT("PlayerId")); + if (PlayerIdValue.IsValid() && !PlayerIdValue->IsNull()) + { + FString TmpValue; + if (PlayerIdValue->TryGetString(TmpValue)) { PlayerId = TmpValue; } + } + + const TSharedPtr PublisherIdValue = obj->TryGetField(TEXT("PublisherId")); + if (PublisherIdValue.IsValid() && !PublisherIdValue->IsNull()) + { + FString TmpValue; + if (PublisherIdValue->TryGetString(TmpValue)) { PublisherId = TmpValue; } + } + + const TArray>&PushNotificationRegistrationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PushNotificationRegistrations")); + for (int32 Idx = 0; Idx < PushNotificationRegistrationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PushNotificationRegistrationsArray[Idx]; + PushNotificationRegistrations.Add(FPushNotificationRegistrationModel(CurrentItem->AsObject())); + } + + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticModel(CurrentItem->AsObject())); + } + + + const TArray>&TagsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Tags")); + for (int32 Idx = 0; Idx < TagsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = TagsArray[Idx]; + Tags.Add(FTagModel(CurrentItem->AsObject())); + } + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr TotalValueToDateInUSDValue = obj->TryGetField(TEXT("TotalValueToDateInUSD")); + if (TotalValueToDateInUSDValue.IsValid() && !TotalValueToDateInUSDValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueToDateInUSDValue->TryGetNumber(TmpValue)) { TotalValueToDateInUSD = TmpValue; } + } + + const TArray>&ValuesToDateArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ValuesToDate")); + for (int32 Idx = 0; Idx < ValuesToDateArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ValuesToDateArray[Idx]; + ValuesToDate.Add(FValueToDateModel(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FFriendInfo::~FFriendInfo() +{ + //if (FacebookInfo != nullptr) delete FacebookInfo; + //if (GameCenterInfo != nullptr) delete GameCenterInfo; + //if (Profile != nullptr) delete Profile; + //if (PSNInfo != nullptr) delete PSNInfo; + //if (SteamInfo != nullptr) delete SteamInfo; + //if (XboxInfo != nullptr) delete XboxInfo; + +} + +void PlayFab::ServerModels::FFriendInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CurrentMatchmakerLobbyId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CurrentMatchmakerLobbyId")); writer->WriteValue(CurrentMatchmakerLobbyId); } + + if (FacebookInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInfo")); FacebookInfo->writeJSON(writer); } + + if (FriendPlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); } + + if (GameCenterInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GameCenterInfo")); GameCenterInfo->writeJSON(writer); } + + if (Profile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Profile")); Profile->writeJSON(writer); } + + if (PSNInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PSNInfo")); PSNInfo->writeJSON(writer); } + + if (SteamInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SteamInfo")); SteamInfo->writeJSON(writer); } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (TitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleDisplayName")); writer->WriteValue(TitleDisplayName); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + if (XboxInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("XboxInfo")); XboxInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FFriendInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrentMatchmakerLobbyIdValue = obj->TryGetField(TEXT("CurrentMatchmakerLobbyId")); + if (CurrentMatchmakerLobbyIdValue.IsValid() && !CurrentMatchmakerLobbyIdValue->IsNull()) + { + FString TmpValue; + if (CurrentMatchmakerLobbyIdValue->TryGetString(TmpValue)) { CurrentMatchmakerLobbyId = TmpValue; } + } + + const TSharedPtr FacebookInfoValue = obj->TryGetField(TEXT("FacebookInfo")); + if (FacebookInfoValue.IsValid() && !FacebookInfoValue->IsNull()) + { + FacebookInfo = MakeShareable(new FUserFacebookInfo(FacebookInfoValue->AsObject())); + } + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + const TSharedPtr GameCenterInfoValue = obj->TryGetField(TEXT("GameCenterInfo")); + if (GameCenterInfoValue.IsValid() && !GameCenterInfoValue->IsNull()) + { + GameCenterInfo = MakeShareable(new FUserGameCenterInfo(GameCenterInfoValue->AsObject())); + } + + const TSharedPtr ProfileValue = obj->TryGetField(TEXT("Profile")); + if (ProfileValue.IsValid() && !ProfileValue->IsNull()) + { + Profile = MakeShareable(new FPlayerProfileModel(ProfileValue->AsObject())); + } + + const TSharedPtr PSNInfoValue = obj->TryGetField(TEXT("PSNInfo")); + if (PSNInfoValue.IsValid() && !PSNInfoValue->IsNull()) + { + PSNInfo = MakeShareable(new FUserPsnInfo(PSNInfoValue->AsObject())); + } + + const TSharedPtr SteamInfoValue = obj->TryGetField(TEXT("SteamInfo")); + if (SteamInfoValue.IsValid() && !SteamInfoValue->IsNull()) + { + SteamInfo = MakeShareable(new FUserSteamInfo(SteamInfoValue->AsObject())); + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr TitleDisplayNameValue = obj->TryGetField(TEXT("TitleDisplayName")); + if (TitleDisplayNameValue.IsValid() && !TitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (TitleDisplayNameValue->TryGetString(TmpValue)) { TitleDisplayName = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + const TSharedPtr XboxInfoValue = obj->TryGetField(TEXT("XboxInfo")); + if (XboxInfoValue.IsValid() && !XboxInfoValue->IsNull()) + { + XboxInfo = MakeShareable(new FUserXboxInfo(XboxInfoValue->AsObject())); + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeGameInstanceStateEnumJSON(GameInstanceState enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case GameInstanceStateOpen: writer->WriteValue(TEXT("Open")); break; + case GameInstanceStateClosed: writer->WriteValue(TEXT("Closed")); break; + } +} + +ServerModels::GameInstanceState PlayFab::ServerModels::readGameInstanceStateFromValue(const TSharedPtr& value) +{ + return readGameInstanceStateFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::GameInstanceState PlayFab::ServerModels::readGameInstanceStateFromValue(const FString& value) +{ + static TMap _GameInstanceStateMap; + if (_GameInstanceStateMap.Num() == 0) + { + // Auto-generate the map on the first use + _GameInstanceStateMap.Add(TEXT("Open"), GameInstanceStateOpen); + _GameInstanceStateMap.Add(TEXT("Closed"), GameInstanceStateClosed); + + } + + if (!value.IsEmpty()) + { + auto output = _GameInstanceStateMap.Find(value); + if (output != nullptr) + return *output; + } + + return GameInstanceStateOpen; // Basically critical fail +} + +PlayFab::ServerModels::FGetAllSegmentsRequest::~FGetAllSegmentsRequest() +{ + +} + +void PlayFab::ServerModels::FGetAllSegmentsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetAllSegmentsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetSegmentResult::~FGetSegmentResult() +{ + +} + +void PlayFab::ServerModels::FGetSegmentResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ABTestParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ABTestParent")); writer->WriteValue(ABTestParent); } + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetSegmentResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ABTestParentValue = obj->TryGetField(TEXT("ABTestParent")); + if (ABTestParentValue.IsValid() && !ABTestParentValue->IsNull()) + { + FString TmpValue; + if (ABTestParentValue->TryGetString(TmpValue)) { ABTestParent = TmpValue; } + } + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetAllSegmentsResult::~FGetAllSegmentsResult() +{ + +} + +void PlayFab::ServerModels::FGetAllSegmentsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Segments.Num() != 0) + { + writer->WriteArrayStart(TEXT("Segments")); + for (const FGetSegmentResult& item : Segments) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetAllSegmentsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SegmentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Segments")); + for (int32 Idx = 0; Idx < SegmentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SegmentsArray[Idx]; + Segments.Add(FGetSegmentResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCatalogItemsRequest::~FGetCatalogItemsRequest() +{ + +} + +void PlayFab::ServerModels::FGetCatalogItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCatalogItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCatalogItemsResult::~FGetCatalogItemsResult() +{ + +} + +void PlayFab::ServerModels::FGetCatalogItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Catalog.Num() != 0) + { + writer->WriteArrayStart(TEXT("Catalog")); + for (const FCatalogItem& item : Catalog) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCatalogItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&CatalogArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Catalog")); + for (int32 Idx = 0; Idx < CatalogArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CatalogArray[Idx]; + Catalog.Add(FCatalogItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterDataRequest::~FGetCharacterDataRequest() +{ + +} + +void PlayFab::ServerModels::FGetCharacterDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (IfChangedFromDataVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("IfChangedFromDataVersion")); writer->WriteValue(static_cast(IfChangedFromDataVersion)); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr IfChangedFromDataVersionValue = obj->TryGetField(TEXT("IfChangedFromDataVersion")); + if (IfChangedFromDataVersionValue.IsValid() && !IfChangedFromDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (IfChangedFromDataVersionValue->TryGetNumber(TmpValue)) { IfChangedFromDataVersion = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeUserDataPermissionEnumJSON(UserDataPermission enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case UserDataPermissionPrivate: writer->WriteValue(TEXT("Private")); break; + case UserDataPermissionPublic: writer->WriteValue(TEXT("Public")); break; + } +} + +ServerModels::UserDataPermission PlayFab::ServerModels::readUserDataPermissionFromValue(const TSharedPtr& value) +{ + return readUserDataPermissionFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::UserDataPermission PlayFab::ServerModels::readUserDataPermissionFromValue(const FString& value) +{ + static TMap _UserDataPermissionMap; + if (_UserDataPermissionMap.Num() == 0) + { + // Auto-generate the map on the first use + _UserDataPermissionMap.Add(TEXT("Private"), UserDataPermissionPrivate); + _UserDataPermissionMap.Add(TEXT("Public"), UserDataPermissionPublic); + + } + + if (!value.IsEmpty()) + { + auto output = _UserDataPermissionMap.Find(value); + if (output != nullptr) + return *output; + } + + return UserDataPermissionPrivate; // Basically critical fail +} + +PlayFab::ServerModels::FUserDataRecord::~FUserDataRecord() +{ + +} + +void PlayFab::ServerModels::FUserDataRecord::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LastUpdated")); writeDatetime(LastUpdated, writer); + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserDataRecord::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LastUpdatedValue = obj->TryGetField(TEXT("LastUpdated")); + if (LastUpdatedValue.IsValid()) + LastUpdated = readDatetime(LastUpdatedValue); + + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterDataResult::~FGetCharacterDataResult() +{ + +} + +void PlayFab::ServerModels::FGetCharacterDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterInventoryRequest::~FGetCharacterInventoryRequest() +{ + +} + +void PlayFab::ServerModels::FGetCharacterInventoryRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterInventoryRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FVirtualCurrencyRechargeTime::~FVirtualCurrencyRechargeTime() +{ + +} + +void PlayFab::ServerModels::FVirtualCurrencyRechargeTime::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("RechargeMax")); writer->WriteValue(RechargeMax); + + writer->WriteIdentifierPrefix(TEXT("RechargeTime")); writeDatetime(RechargeTime, writer); + + writer->WriteIdentifierPrefix(TEXT("SecondsToRecharge")); writer->WriteValue(SecondsToRecharge); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FVirtualCurrencyRechargeTime::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RechargeMaxValue = obj->TryGetField(TEXT("RechargeMax")); + if (RechargeMaxValue.IsValid() && !RechargeMaxValue->IsNull()) + { + int32 TmpValue; + if (RechargeMaxValue->TryGetNumber(TmpValue)) { RechargeMax = TmpValue; } + } + + const TSharedPtr RechargeTimeValue = obj->TryGetField(TEXT("RechargeTime")); + if (RechargeTimeValue.IsValid()) + RechargeTime = readDatetime(RechargeTimeValue); + + + const TSharedPtr SecondsToRechargeValue = obj->TryGetField(TEXT("SecondsToRecharge")); + if (SecondsToRechargeValue.IsValid() && !SecondsToRechargeValue->IsNull()) + { + int32 TmpValue; + if (SecondsToRechargeValue->TryGetNumber(TmpValue)) { SecondsToRecharge = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterInventoryResult::~FGetCharacterInventoryResult() +{ + +} + +void PlayFab::ServerModels::FGetCharacterInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(VirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyRechargeTimes"), VirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + VirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterLeaderboardRequest::~FGetCharacterLeaderboardRequest() +{ + +} + +void PlayFab::ServerModels::FGetCharacterLeaderboardRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + writer->WriteIdentifierPrefix(TEXT("StartPosition")); writer->WriteValue(StartPosition); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterLeaderboardRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr StartPositionValue = obj->TryGetField(TEXT("StartPosition")); + if (StartPositionValue.IsValid() && !StartPositionValue->IsNull()) + { + int32 TmpValue; + if (StartPositionValue->TryGetNumber(TmpValue)) { StartPosition = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterLeaderboardResult::~FGetCharacterLeaderboardResult() +{ + +} + +void PlayFab::ServerModels::FGetCharacterLeaderboardResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FCharacterLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterLeaderboardResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FCharacterLeaderboardEntry(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterStatisticsRequest::~FGetCharacterStatisticsRequest() +{ + +} + +void PlayFab::ServerModels::FGetCharacterStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterStatisticsResult::~FGetCharacterStatisticsResult() +{ + +} + +void PlayFab::ServerModels::FGetCharacterStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CharacterStatistics.Num() != 0) + { + writer->WriteObjectStart(TEXT("CharacterStatistics")); + for (TMap::TConstIterator It(CharacterStatistics); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* CharacterStatisticsObject; + if (obj->TryGetObjectField(TEXT("CharacterStatistics"), CharacterStatisticsObject)) + { + for (TMap>::TConstIterator It((*CharacterStatisticsObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + CharacterStatistics.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetContentDownloadUrlRequest::~FGetContentDownloadUrlRequest() +{ + +} + +void PlayFab::ServerModels::FGetContentDownloadUrlRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (HttpMethod.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("HttpMethod")); writer->WriteValue(HttpMethod); } + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + if (ThruCDN.notNull()) { writer->WriteIdentifierPrefix(TEXT("ThruCDN")); writer->WriteValue(ThruCDN); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetContentDownloadUrlRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr HttpMethodValue = obj->TryGetField(TEXT("HttpMethod")); + if (HttpMethodValue.IsValid() && !HttpMethodValue->IsNull()) + { + FString TmpValue; + if (HttpMethodValue->TryGetString(TmpValue)) { HttpMethod = TmpValue; } + } + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr ThruCDNValue = obj->TryGetField(TEXT("ThruCDN")); + if (ThruCDNValue.IsValid() && !ThruCDNValue->IsNull()) + { + bool TmpValue; + if (ThruCDNValue->TryGetBool(TmpValue)) { ThruCDN = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetContentDownloadUrlResult::~FGetContentDownloadUrlResult() +{ + +} + +void PlayFab::ServerModels::FGetContentDownloadUrlResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (URL.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("URL")); writer->WriteValue(URL); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetContentDownloadUrlResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr URLValue = obj->TryGetField(TEXT("URL")); + if (URLValue.IsValid() && !URLValue->IsNull()) + { + FString TmpValue; + if (URLValue->TryGetString(TmpValue)) { URL = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerProfileViewConstraints::~FPlayerProfileViewConstraints() +{ + +} + +void PlayFab::ServerModels::FPlayerProfileViewConstraints::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ShowAvatarUrl")); writer->WriteValue(ShowAvatarUrl); + + writer->WriteIdentifierPrefix(TEXT("ShowBannedUntil")); writer->WriteValue(ShowBannedUntil); + + writer->WriteIdentifierPrefix(TEXT("ShowCampaignAttributions")); writer->WriteValue(ShowCampaignAttributions); + + writer->WriteIdentifierPrefix(TEXT("ShowContactEmailAddresses")); writer->WriteValue(ShowContactEmailAddresses); + + writer->WriteIdentifierPrefix(TEXT("ShowCreated")); writer->WriteValue(ShowCreated); + + writer->WriteIdentifierPrefix(TEXT("ShowDisplayName")); writer->WriteValue(ShowDisplayName); + + writer->WriteIdentifierPrefix(TEXT("ShowLastLogin")); writer->WriteValue(ShowLastLogin); + + writer->WriteIdentifierPrefix(TEXT("ShowLinkedAccounts")); writer->WriteValue(ShowLinkedAccounts); + + writer->WriteIdentifierPrefix(TEXT("ShowLocations")); writer->WriteValue(ShowLocations); + + writer->WriteIdentifierPrefix(TEXT("ShowMemberships")); writer->WriteValue(ShowMemberships); + + writer->WriteIdentifierPrefix(TEXT("ShowOrigination")); writer->WriteValue(ShowOrigination); + + writer->WriteIdentifierPrefix(TEXT("ShowPushNotificationRegistrations")); writer->WriteValue(ShowPushNotificationRegistrations); + + writer->WriteIdentifierPrefix(TEXT("ShowStatistics")); writer->WriteValue(ShowStatistics); + + writer->WriteIdentifierPrefix(TEXT("ShowTags")); writer->WriteValue(ShowTags); + + writer->WriteIdentifierPrefix(TEXT("ShowTotalValueToDateInUsd")); writer->WriteValue(ShowTotalValueToDateInUsd); + + writer->WriteIdentifierPrefix(TEXT("ShowValuesToDate")); writer->WriteValue(ShowValuesToDate); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerProfileViewConstraints::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ShowAvatarUrlValue = obj->TryGetField(TEXT("ShowAvatarUrl")); + if (ShowAvatarUrlValue.IsValid() && !ShowAvatarUrlValue->IsNull()) + { + bool TmpValue; + if (ShowAvatarUrlValue->TryGetBool(TmpValue)) { ShowAvatarUrl = TmpValue; } + } + + const TSharedPtr ShowBannedUntilValue = obj->TryGetField(TEXT("ShowBannedUntil")); + if (ShowBannedUntilValue.IsValid() && !ShowBannedUntilValue->IsNull()) + { + bool TmpValue; + if (ShowBannedUntilValue->TryGetBool(TmpValue)) { ShowBannedUntil = TmpValue; } + } + + const TSharedPtr ShowCampaignAttributionsValue = obj->TryGetField(TEXT("ShowCampaignAttributions")); + if (ShowCampaignAttributionsValue.IsValid() && !ShowCampaignAttributionsValue->IsNull()) + { + bool TmpValue; + if (ShowCampaignAttributionsValue->TryGetBool(TmpValue)) { ShowCampaignAttributions = TmpValue; } + } + + const TSharedPtr ShowContactEmailAddressesValue = obj->TryGetField(TEXT("ShowContactEmailAddresses")); + if (ShowContactEmailAddressesValue.IsValid() && !ShowContactEmailAddressesValue->IsNull()) + { + bool TmpValue; + if (ShowContactEmailAddressesValue->TryGetBool(TmpValue)) { ShowContactEmailAddresses = TmpValue; } + } + + const TSharedPtr ShowCreatedValue = obj->TryGetField(TEXT("ShowCreated")); + if (ShowCreatedValue.IsValid() && !ShowCreatedValue->IsNull()) + { + bool TmpValue; + if (ShowCreatedValue->TryGetBool(TmpValue)) { ShowCreated = TmpValue; } + } + + const TSharedPtr ShowDisplayNameValue = obj->TryGetField(TEXT("ShowDisplayName")); + if (ShowDisplayNameValue.IsValid() && !ShowDisplayNameValue->IsNull()) + { + bool TmpValue; + if (ShowDisplayNameValue->TryGetBool(TmpValue)) { ShowDisplayName = TmpValue; } + } + + const TSharedPtr ShowLastLoginValue = obj->TryGetField(TEXT("ShowLastLogin")); + if (ShowLastLoginValue.IsValid() && !ShowLastLoginValue->IsNull()) + { + bool TmpValue; + if (ShowLastLoginValue->TryGetBool(TmpValue)) { ShowLastLogin = TmpValue; } + } + + const TSharedPtr ShowLinkedAccountsValue = obj->TryGetField(TEXT("ShowLinkedAccounts")); + if (ShowLinkedAccountsValue.IsValid() && !ShowLinkedAccountsValue->IsNull()) + { + bool TmpValue; + if (ShowLinkedAccountsValue->TryGetBool(TmpValue)) { ShowLinkedAccounts = TmpValue; } + } + + const TSharedPtr ShowLocationsValue = obj->TryGetField(TEXT("ShowLocations")); + if (ShowLocationsValue.IsValid() && !ShowLocationsValue->IsNull()) + { + bool TmpValue; + if (ShowLocationsValue->TryGetBool(TmpValue)) { ShowLocations = TmpValue; } + } + + const TSharedPtr ShowMembershipsValue = obj->TryGetField(TEXT("ShowMemberships")); + if (ShowMembershipsValue.IsValid() && !ShowMembershipsValue->IsNull()) + { + bool TmpValue; + if (ShowMembershipsValue->TryGetBool(TmpValue)) { ShowMemberships = TmpValue; } + } + + const TSharedPtr ShowOriginationValue = obj->TryGetField(TEXT("ShowOrigination")); + if (ShowOriginationValue.IsValid() && !ShowOriginationValue->IsNull()) + { + bool TmpValue; + if (ShowOriginationValue->TryGetBool(TmpValue)) { ShowOrigination = TmpValue; } + } + + const TSharedPtr ShowPushNotificationRegistrationsValue = obj->TryGetField(TEXT("ShowPushNotificationRegistrations")); + if (ShowPushNotificationRegistrationsValue.IsValid() && !ShowPushNotificationRegistrationsValue->IsNull()) + { + bool TmpValue; + if (ShowPushNotificationRegistrationsValue->TryGetBool(TmpValue)) { ShowPushNotificationRegistrations = TmpValue; } + } + + const TSharedPtr ShowStatisticsValue = obj->TryGetField(TEXT("ShowStatistics")); + if (ShowStatisticsValue.IsValid() && !ShowStatisticsValue->IsNull()) + { + bool TmpValue; + if (ShowStatisticsValue->TryGetBool(TmpValue)) { ShowStatistics = TmpValue; } + } + + const TSharedPtr ShowTagsValue = obj->TryGetField(TEXT("ShowTags")); + if (ShowTagsValue.IsValid() && !ShowTagsValue->IsNull()) + { + bool TmpValue; + if (ShowTagsValue->TryGetBool(TmpValue)) { ShowTags = TmpValue; } + } + + const TSharedPtr ShowTotalValueToDateInUsdValue = obj->TryGetField(TEXT("ShowTotalValueToDateInUsd")); + if (ShowTotalValueToDateInUsdValue.IsValid() && !ShowTotalValueToDateInUsdValue->IsNull()) + { + bool TmpValue; + if (ShowTotalValueToDateInUsdValue->TryGetBool(TmpValue)) { ShowTotalValueToDateInUsd = TmpValue; } + } + + const TSharedPtr ShowValuesToDateValue = obj->TryGetField(TEXT("ShowValuesToDate")); + if (ShowValuesToDateValue.IsValid() && !ShowValuesToDateValue->IsNull()) + { + bool TmpValue; + if (ShowValuesToDateValue->TryGetBool(TmpValue)) { ShowValuesToDate = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetFriendLeaderboardRequest::~FGetFriendLeaderboardRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ServerModels::FGetFriendLeaderboardRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IncludeFacebookFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeFacebookFriends")); writer->WriteValue(IncludeFacebookFriends); } + + if (IncludeSteamFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeSteamFriends")); writer->WriteValue(IncludeSteamFriends); } + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StartPosition")); writer->WriteValue(StartPosition); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + if (XboxToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetFriendLeaderboardRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IncludeFacebookFriendsValue = obj->TryGetField(TEXT("IncludeFacebookFriends")); + if (IncludeFacebookFriendsValue.IsValid() && !IncludeFacebookFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeFacebookFriendsValue->TryGetBool(TmpValue)) { IncludeFacebookFriends = TmpValue; } + } + + const TSharedPtr IncludeSteamFriendsValue = obj->TryGetField(TEXT("IncludeSteamFriends")); + if (IncludeSteamFriendsValue.IsValid() && !IncludeSteamFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeSteamFriendsValue->TryGetBool(TmpValue)) { IncludeSteamFriends = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StartPositionValue = obj->TryGetField(TEXT("StartPosition")); + if (StartPositionValue.IsValid() && !StartPositionValue->IsNull()) + { + int32 TmpValue; + if (StartPositionValue->TryGetNumber(TmpValue)) { StartPosition = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetFriendsListRequest::~FGetFriendsListRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ServerModels::FGetFriendsListRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IncludeFacebookFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeFacebookFriends")); writer->WriteValue(IncludeFacebookFriends); } + + if (IncludeSteamFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeSteamFriends")); writer->WriteValue(IncludeSteamFriends); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + if (XboxToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetFriendsListRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IncludeFacebookFriendsValue = obj->TryGetField(TEXT("IncludeFacebookFriends")); + if (IncludeFacebookFriendsValue.IsValid() && !IncludeFacebookFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeFacebookFriendsValue->TryGetBool(TmpValue)) { IncludeFacebookFriends = TmpValue; } + } + + const TSharedPtr IncludeSteamFriendsValue = obj->TryGetField(TEXT("IncludeSteamFriends")); + if (IncludeSteamFriendsValue.IsValid() && !IncludeSteamFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeSteamFriendsValue->TryGetBool(TmpValue)) { IncludeSteamFriends = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetFriendsListResult::~FGetFriendsListResult() +{ + +} + +void PlayFab::ServerModels::FGetFriendsListResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Friends.Num() != 0) + { + writer->WriteArrayStart(TEXT("Friends")); + for (const FFriendInfo& item : Friends) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetFriendsListResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&FriendsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Friends")); + for (int32 Idx = 0; Idx < FriendsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = FriendsArray[Idx]; + Friends.Add(FFriendInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardAroundCharacterRequest::~FGetLeaderboardAroundCharacterRequest() +{ + +} + +void PlayFab::ServerModels::FGetLeaderboardAroundCharacterRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardAroundCharacterRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardAroundCharacterResult::~FGetLeaderboardAroundCharacterResult() +{ + +} + +void PlayFab::ServerModels::FGetLeaderboardAroundCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FCharacterLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardAroundCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FCharacterLeaderboardEntry(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardAroundUserRequest::~FGetLeaderboardAroundUserRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ServerModels::FGetLeaderboardAroundUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardAroundUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerLeaderboardEntry::~FPlayerLeaderboardEntry() +{ + //if (Profile != nullptr) delete Profile; + +} + +void PlayFab::ServerModels::FPlayerLeaderboardEntry::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteIdentifierPrefix(TEXT("Position")); writer->WriteValue(Position); + + if (Profile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Profile")); Profile->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StatValue")); writer->WriteValue(StatValue); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerLeaderboardEntry::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PositionValue = obj->TryGetField(TEXT("Position")); + if (PositionValue.IsValid() && !PositionValue->IsNull()) + { + int32 TmpValue; + if (PositionValue->TryGetNumber(TmpValue)) { Position = TmpValue; } + } + + const TSharedPtr ProfileValue = obj->TryGetField(TEXT("Profile")); + if (ProfileValue.IsValid() && !ProfileValue->IsNull()) + { + Profile = MakeShareable(new FPlayerProfileModel(ProfileValue->AsObject())); + } + + const TSharedPtr StatValueValue = obj->TryGetField(TEXT("StatValue")); + if (StatValueValue.IsValid() && !StatValueValue->IsNull()) + { + int32 TmpValue; + if (StatValueValue->TryGetNumber(TmpValue)) { StatValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardAroundUserResult::~FGetLeaderboardAroundUserResult() +{ + +} + +void PlayFab::ServerModels::FGetLeaderboardAroundUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FPlayerLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (NextReset.notNull()) { writer->WriteIdentifierPrefix(TEXT("NextReset")); writeDatetime(NextReset, writer); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardAroundUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FPlayerLeaderboardEntry(CurrentItem->AsObject())); + } + + + const TSharedPtr NextResetValue = obj->TryGetField(TEXT("NextReset")); + if (NextResetValue.IsValid()) + NextReset = readDatetime(NextResetValue); + + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardForUsersCharactersRequest::~FGetLeaderboardForUsersCharactersRequest() +{ + +} + +void PlayFab::ServerModels::FGetLeaderboardForUsersCharactersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardForUsersCharactersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardForUsersCharactersResult::~FGetLeaderboardForUsersCharactersResult() +{ + +} + +void PlayFab::ServerModels::FGetLeaderboardForUsersCharactersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FCharacterLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardForUsersCharactersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FCharacterLeaderboardEntry(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardRequest::~FGetLeaderboardRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ServerModels::FGetLeaderboardRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StartPosition")); writer->WriteValue(StartPosition); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StartPositionValue = obj->TryGetField(TEXT("StartPosition")); + if (StartPositionValue.IsValid() && !StartPositionValue->IsNull()) + { + int32 TmpValue; + if (StartPositionValue->TryGetNumber(TmpValue)) { StartPosition = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardResult::~FGetLeaderboardResult() +{ + +} + +void PlayFab::ServerModels::FGetLeaderboardResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FPlayerLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (NextReset.notNull()) { writer->WriteIdentifierPrefix(TEXT("NextReset")); writeDatetime(NextReset, writer); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FPlayerLeaderboardEntry(CurrentItem->AsObject())); + } + + + const TSharedPtr NextResetValue = obj->TryGetField(TEXT("NextReset")); + if (NextResetValue.IsValid()) + NextReset = readDatetime(NextResetValue); + + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerCombinedInfoRequestParams::~FGetPlayerCombinedInfoRequestParams() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ServerModels::FGetPlayerCombinedInfoRequestParams::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GetCharacterInventories")); writer->WriteValue(GetCharacterInventories); + + writer->WriteIdentifierPrefix(TEXT("GetCharacterList")); writer->WriteValue(GetCharacterList); + + writer->WriteIdentifierPrefix(TEXT("GetPlayerProfile")); writer->WriteValue(GetPlayerProfile); + + writer->WriteIdentifierPrefix(TEXT("GetPlayerStatistics")); writer->WriteValue(GetPlayerStatistics); + + writer->WriteIdentifierPrefix(TEXT("GetTitleData")); writer->WriteValue(GetTitleData); + + writer->WriteIdentifierPrefix(TEXT("GetUserAccountInfo")); writer->WriteValue(GetUserAccountInfo); + + writer->WriteIdentifierPrefix(TEXT("GetUserData")); writer->WriteValue(GetUserData); + + writer->WriteIdentifierPrefix(TEXT("GetUserInventory")); writer->WriteValue(GetUserInventory); + + writer->WriteIdentifierPrefix(TEXT("GetUserReadOnlyData")); writer->WriteValue(GetUserReadOnlyData); + + writer->WriteIdentifierPrefix(TEXT("GetUserVirtualCurrency")); writer->WriteValue(GetUserVirtualCurrency); + + if (PlayerStatisticNames.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerStatisticNames")); + for (const FString& item : PlayerStatisticNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + if (TitleDataKeys.Num() != 0) + { + writer->WriteArrayStart(TEXT("TitleDataKeys")); + for (const FString& item : TitleDataKeys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (UserDataKeys.Num() != 0) + { + writer->WriteArrayStart(TEXT("UserDataKeys")); + for (const FString& item : UserDataKeys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (UserReadOnlyDataKeys.Num() != 0) + { + writer->WriteArrayStart(TEXT("UserReadOnlyDataKeys")); + for (const FString& item : UserReadOnlyDataKeys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerCombinedInfoRequestParams::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GetCharacterInventoriesValue = obj->TryGetField(TEXT("GetCharacterInventories")); + if (GetCharacterInventoriesValue.IsValid() && !GetCharacterInventoriesValue->IsNull()) + { + bool TmpValue; + if (GetCharacterInventoriesValue->TryGetBool(TmpValue)) { GetCharacterInventories = TmpValue; } + } + + const TSharedPtr GetCharacterListValue = obj->TryGetField(TEXT("GetCharacterList")); + if (GetCharacterListValue.IsValid() && !GetCharacterListValue->IsNull()) + { + bool TmpValue; + if (GetCharacterListValue->TryGetBool(TmpValue)) { GetCharacterList = TmpValue; } + } + + const TSharedPtr GetPlayerProfileValue = obj->TryGetField(TEXT("GetPlayerProfile")); + if (GetPlayerProfileValue.IsValid() && !GetPlayerProfileValue->IsNull()) + { + bool TmpValue; + if (GetPlayerProfileValue->TryGetBool(TmpValue)) { GetPlayerProfile = TmpValue; } + } + + const TSharedPtr GetPlayerStatisticsValue = obj->TryGetField(TEXT("GetPlayerStatistics")); + if (GetPlayerStatisticsValue.IsValid() && !GetPlayerStatisticsValue->IsNull()) + { + bool TmpValue; + if (GetPlayerStatisticsValue->TryGetBool(TmpValue)) { GetPlayerStatistics = TmpValue; } + } + + const TSharedPtr GetTitleDataValue = obj->TryGetField(TEXT("GetTitleData")); + if (GetTitleDataValue.IsValid() && !GetTitleDataValue->IsNull()) + { + bool TmpValue; + if (GetTitleDataValue->TryGetBool(TmpValue)) { GetTitleData = TmpValue; } + } + + const TSharedPtr GetUserAccountInfoValue = obj->TryGetField(TEXT("GetUserAccountInfo")); + if (GetUserAccountInfoValue.IsValid() && !GetUserAccountInfoValue->IsNull()) + { + bool TmpValue; + if (GetUserAccountInfoValue->TryGetBool(TmpValue)) { GetUserAccountInfo = TmpValue; } + } + + const TSharedPtr GetUserDataValue = obj->TryGetField(TEXT("GetUserData")); + if (GetUserDataValue.IsValid() && !GetUserDataValue->IsNull()) + { + bool TmpValue; + if (GetUserDataValue->TryGetBool(TmpValue)) { GetUserData = TmpValue; } + } + + const TSharedPtr GetUserInventoryValue = obj->TryGetField(TEXT("GetUserInventory")); + if (GetUserInventoryValue.IsValid() && !GetUserInventoryValue->IsNull()) + { + bool TmpValue; + if (GetUserInventoryValue->TryGetBool(TmpValue)) { GetUserInventory = TmpValue; } + } + + const TSharedPtr GetUserReadOnlyDataValue = obj->TryGetField(TEXT("GetUserReadOnlyData")); + if (GetUserReadOnlyDataValue.IsValid() && !GetUserReadOnlyDataValue->IsNull()) + { + bool TmpValue; + if (GetUserReadOnlyDataValue->TryGetBool(TmpValue)) { GetUserReadOnlyData = TmpValue; } + } + + const TSharedPtr GetUserVirtualCurrencyValue = obj->TryGetField(TEXT("GetUserVirtualCurrency")); + if (GetUserVirtualCurrencyValue.IsValid() && !GetUserVirtualCurrencyValue->IsNull()) + { + bool TmpValue; + if (GetUserVirtualCurrencyValue->TryGetBool(TmpValue)) { GetUserVirtualCurrency = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("PlayerStatisticNames"), PlayerStatisticNames); + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + obj->TryGetStringArrayField(TEXT("TitleDataKeys"), TitleDataKeys); + + obj->TryGetStringArrayField(TEXT("UserDataKeys"), UserDataKeys); + + obj->TryGetStringArrayField(TEXT("UserReadOnlyDataKeys"), UserReadOnlyDataKeys); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerCombinedInfoRequest::~FGetPlayerCombinedInfoRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayerCombinedInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerCombinedInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject()); + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FStatisticValue::~FStatisticValue() +{ + +} + +void PlayFab::ServerModels::FStatisticValue::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FStatisticValue::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerCombinedInfoResultPayload::~FGetPlayerCombinedInfoResultPayload() +{ + //if (AccountInfo != nullptr) delete AccountInfo; + //if (PlayerProfile != nullptr) delete PlayerProfile; + +} + +void PlayFab::ServerModels::FGetPlayerCombinedInfoResultPayload::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AccountInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("AccountInfo")); AccountInfo->writeJSON(writer); } + + if (CharacterInventories.Num() != 0) + { + writer->WriteArrayStart(TEXT("CharacterInventories")); + for (const FCharacterInventory& item : CharacterInventories) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (CharacterList.Num() != 0) + { + writer->WriteArrayStart(TEXT("CharacterList")); + for (const FCharacterResult& item : CharacterList) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayerProfile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PlayerProfile")); PlayerProfile->writeJSON(writer); } + + if (PlayerStatistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerStatistics")); + for (const FStatisticValue& item : PlayerStatistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (TitleData.Num() != 0) + { + writer->WriteObjectStart(TEXT("TitleData")); + for (TMap::TConstIterator It(TitleData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (UserData.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserData")); + for (TMap::TConstIterator It(UserData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("UserDataVersion")); writer->WriteValue(static_cast(UserDataVersion)); + + if (UserInventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("UserInventory")); + for (const FItemInstance& item : UserInventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (UserReadOnlyData.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserReadOnlyData")); + for (TMap::TConstIterator It(UserReadOnlyData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("UserReadOnlyDataVersion")); writer->WriteValue(static_cast(UserReadOnlyDataVersion)); + + if (UserVirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserVirtualCurrency")); + for (TMap::TConstIterator It(UserVirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (UserVirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserVirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(UserVirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerCombinedInfoResultPayload::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccountInfoValue = obj->TryGetField(TEXT("AccountInfo")); + if (AccountInfoValue.IsValid() && !AccountInfoValue->IsNull()) + { + AccountInfo = MakeShareable(new FUserAccountInfo(AccountInfoValue->AsObject())); + } + + const TArray>&CharacterInventoriesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("CharacterInventories")); + for (int32 Idx = 0; Idx < CharacterInventoriesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CharacterInventoriesArray[Idx]; + CharacterInventories.Add(FCharacterInventory(CurrentItem->AsObject())); + } + + + const TArray>&CharacterListArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("CharacterList")); + for (int32 Idx = 0; Idx < CharacterListArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CharacterListArray[Idx]; + CharacterList.Add(FCharacterResult(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayerProfileValue = obj->TryGetField(TEXT("PlayerProfile")); + if (PlayerProfileValue.IsValid() && !PlayerProfileValue->IsNull()) + { + PlayerProfile = MakeShareable(new FPlayerProfileModel(PlayerProfileValue->AsObject())); + } + + const TArray>&PlayerStatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PlayerStatistics")); + for (int32 Idx = 0; Idx < PlayerStatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PlayerStatisticsArray[Idx]; + PlayerStatistics.Add(FStatisticValue(CurrentItem->AsObject())); + } + + + const TSharedPtr* TitleDataObject; + if (obj->TryGetObjectField(TEXT("TitleData"), TitleDataObject)) + { + for (TMap>::TConstIterator It((*TitleDataObject)->Values); It; ++It) + { + TitleData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr* UserDataObject; + if (obj->TryGetObjectField(TEXT("UserData"), UserDataObject)) + { + for (TMap>::TConstIterator It((*UserDataObject)->Values); It; ++It) + { + UserData.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr UserDataVersionValue = obj->TryGetField(TEXT("UserDataVersion")); + if (UserDataVersionValue.IsValid() && !UserDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (UserDataVersionValue->TryGetNumber(TmpValue)) { UserDataVersion = TmpValue; } + } + + const TArray>&UserInventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("UserInventory")); + for (int32 Idx = 0; Idx < UserInventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = UserInventoryArray[Idx]; + UserInventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr* UserReadOnlyDataObject; + if (obj->TryGetObjectField(TEXT("UserReadOnlyData"), UserReadOnlyDataObject)) + { + for (TMap>::TConstIterator It((*UserReadOnlyDataObject)->Values); It; ++It) + { + UserReadOnlyData.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr UserReadOnlyDataVersionValue = obj->TryGetField(TEXT("UserReadOnlyDataVersion")); + if (UserReadOnlyDataVersionValue.IsValid() && !UserReadOnlyDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (UserReadOnlyDataVersionValue->TryGetNumber(TmpValue)) { UserReadOnlyDataVersion = TmpValue; } + } + + const TSharedPtr* UserVirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("UserVirtualCurrency"), UserVirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*UserVirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + UserVirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* UserVirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("UserVirtualCurrencyRechargeTimes"), UserVirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*UserVirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + UserVirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerCombinedInfoResult::~FGetPlayerCombinedInfoResult() +{ + //if (InfoResultPayload != nullptr) delete InfoResultPayload; + +} + +void PlayFab::ServerModels::FGetPlayerCombinedInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (InfoResultPayload.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoResultPayload")); InfoResultPayload->writeJSON(writer); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerCombinedInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr InfoResultPayloadValue = obj->TryGetField(TEXT("InfoResultPayload")); + if (InfoResultPayloadValue.IsValid() && !InfoResultPayloadValue->IsNull()) + { + InfoResultPayload = MakeShareable(new FGetPlayerCombinedInfoResultPayload(InfoResultPayloadValue->AsObject())); + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerProfileRequest::~FGetPlayerProfileRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ServerModels::FGetPlayerProfileRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerProfileRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerProfileResult::~FGetPlayerProfileResult() +{ + //if (PlayerProfile != nullptr) delete PlayerProfile; + +} + +void PlayFab::ServerModels::FGetPlayerProfileResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayerProfile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PlayerProfile")); PlayerProfile->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerProfileResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayerProfileValue = obj->TryGetField(TEXT("PlayerProfile")); + if (PlayerProfileValue.IsValid() && !PlayerProfileValue->IsNull()) + { + PlayerProfile = MakeShareable(new FPlayerProfileModel(PlayerProfileValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerSegmentsResult::~FGetPlayerSegmentsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayerSegmentsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Segments.Num() != 0) + { + writer->WriteArrayStart(TEXT("Segments")); + for (const FGetSegmentResult& item : Segments) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerSegmentsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SegmentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Segments")); + for (int32 Idx = 0; Idx < SegmentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SegmentsArray[Idx]; + Segments.Add(FGetSegmentResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayersInSegmentRequest::~FGetPlayersInSegmentRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayersInSegmentRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ContinuationToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ContinuationToken")); writer->WriteValue(ContinuationToken); } + + if (MaxBatchSize.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxBatchSize")); writer->WriteValue(static_cast(MaxBatchSize)); } + + if (SecondsToLive.notNull()) { writer->WriteIdentifierPrefix(TEXT("SecondsToLive")); writer->WriteValue(static_cast(SecondsToLive)); } + + writer->WriteIdentifierPrefix(TEXT("SegmentId")); writer->WriteValue(SegmentId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayersInSegmentRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ContinuationTokenValue = obj->TryGetField(TEXT("ContinuationToken")); + if (ContinuationTokenValue.IsValid() && !ContinuationTokenValue->IsNull()) + { + FString TmpValue; + if (ContinuationTokenValue->TryGetString(TmpValue)) { ContinuationToken = TmpValue; } + } + + const TSharedPtr MaxBatchSizeValue = obj->TryGetField(TEXT("MaxBatchSize")); + if (MaxBatchSizeValue.IsValid() && !MaxBatchSizeValue->IsNull()) + { + uint32 TmpValue; + if (MaxBatchSizeValue->TryGetNumber(TmpValue)) { MaxBatchSize = TmpValue; } + } + + const TSharedPtr SecondsToLiveValue = obj->TryGetField(TEXT("SecondsToLive")); + if (SecondsToLiveValue.IsValid() && !SecondsToLiveValue->IsNull()) + { + uint32 TmpValue; + if (SecondsToLiveValue->TryGetNumber(TmpValue)) { SecondsToLive = TmpValue; } + } + + const TSharedPtr SegmentIdValue = obj->TryGetField(TEXT("SegmentId")); + if (SegmentIdValue.IsValid() && !SegmentIdValue->IsNull()) + { + FString TmpValue; + if (SegmentIdValue->TryGetString(TmpValue)) { SegmentId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerLinkedAccount::~FPlayerLinkedAccount() +{ + +} + +void PlayFab::ServerModels::FPlayerLinkedAccount::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writeLoginIdentityProviderEnumJSON(Platform, writer); } + + if (PlatformUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlatformUserId")); writer->WriteValue(PlatformUserId); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerLinkedAccount::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + Platform = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Platform"))); + + const TSharedPtr PlatformUserIdValue = obj->TryGetField(TEXT("PlatformUserId")); + if (PlatformUserIdValue.IsValid() && !PlatformUserIdValue->IsNull()) + { + FString TmpValue; + if (PlatformUserIdValue->TryGetString(TmpValue)) { PlatformUserId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerLocation::~FPlayerLocation() +{ + +} + +void PlayFab::ServerModels::FPlayerLocation::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (City.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("City")); writer->WriteValue(City); } + + writer->WriteIdentifierPrefix(TEXT("ContinentCode")); writeContinentCodeEnumJSON(pfContinentCode, writer); + + writer->WriteIdentifierPrefix(TEXT("CountryCode")); writeCountryCodeEnumJSON(pfCountryCode, writer); + + if (Latitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Latitude")); writer->WriteValue(Latitude); } + + if (Longitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Longitude")); writer->WriteValue(Longitude); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerLocation::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CityValue = obj->TryGetField(TEXT("City")); + if (CityValue.IsValid() && !CityValue->IsNull()) + { + FString TmpValue; + if (CityValue->TryGetString(TmpValue)) { City = TmpValue; } + } + + pfContinentCode = readContinentCodeFromValue(obj->TryGetField(TEXT("ContinentCode"))); + + pfCountryCode = readCountryCodeFromValue(obj->TryGetField(TEXT("CountryCode"))); + + const TSharedPtr LatitudeValue = obj->TryGetField(TEXT("Latitude")); + if (LatitudeValue.IsValid() && !LatitudeValue->IsNull()) + { + double TmpValue; + if (LatitudeValue->TryGetNumber(TmpValue)) { Latitude = TmpValue; } + } + + const TSharedPtr LongitudeValue = obj->TryGetField(TEXT("Longitude")); + if (LongitudeValue.IsValid() && !LongitudeValue->IsNull()) + { + double TmpValue; + if (LongitudeValue->TryGetNumber(TmpValue)) { Longitude = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerStatistic::~FPlayerStatistic() +{ + +} + +void PlayFab::ServerModels::FPlayerStatistic::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Id.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteIdentifierPrefix(TEXT("StatisticValue")); writer->WriteValue(StatisticValue); + + writer->WriteIdentifierPrefix(TEXT("StatisticVersion")); writer->WriteValue(StatisticVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerStatistic::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr StatisticValueValue = obj->TryGetField(TEXT("StatisticValue")); + if (StatisticValueValue.IsValid() && !StatisticValueValue->IsNull()) + { + int32 TmpValue; + if (StatisticValueValue->TryGetNumber(TmpValue)) { StatisticValue = TmpValue; } + } + + const TSharedPtr StatisticVersionValue = obj->TryGetField(TEXT("StatisticVersion")); + if (StatisticVersionValue.IsValid() && !StatisticVersionValue->IsNull()) + { + int32 TmpValue; + if (StatisticVersionValue->TryGetNumber(TmpValue)) { StatisticVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPushNotificationRegistration::~FPushNotificationRegistration() +{ + +} + +void PlayFab::ServerModels::FPushNotificationRegistration::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NotificationEndpointARN.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NotificationEndpointARN")); writer->WriteValue(NotificationEndpointARN); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writePushNotificationPlatformEnumJSON(Platform, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPushNotificationRegistration::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NotificationEndpointARNValue = obj->TryGetField(TEXT("NotificationEndpointARN")); + if (NotificationEndpointARNValue.IsValid() && !NotificationEndpointARNValue->IsNull()) + { + FString TmpValue; + if (NotificationEndpointARNValue->TryGetString(TmpValue)) { NotificationEndpointARN = TmpValue; } + } + + Platform = readPushNotificationPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerProfile::~FPlayerProfile() +{ + +} + +void PlayFab::ServerModels::FPlayerProfile::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdCampaignAttributions.Num() != 0) + { + writer->WriteArrayStart(TEXT("AdCampaignAttributions")); + for (const FAdCampaignAttribution& item : AdCampaignAttributions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + if (BannedUntil.notNull()) { writer->WriteIdentifierPrefix(TEXT("BannedUntil")); writeDatetime(BannedUntil, writer); } + + if (ContactEmailAddresses.Num() != 0) + { + writer->WriteArrayStart(TEXT("ContactEmailAddresses")); + for (const FContactEmailInfo& item : ContactEmailAddresses) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (LinkedAccounts.Num() != 0) + { + writer->WriteArrayStart(TEXT("LinkedAccounts")); + for (const FPlayerLinkedAccount& item : LinkedAccounts) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Locations.Num() != 0) + { + writer->WriteObjectStart(TEXT("Locations")); + for (TMap::TConstIterator It(Locations); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeLoginIdentityProviderEnumJSON(Origination, writer); } + + if (PlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerId")); writer->WriteValue(PlayerId); } + + if (PlayerStatistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerStatistics")); + for (const FPlayerStatistic& item : PlayerStatistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PublisherId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PublisherId")); writer->WriteValue(PublisherId); } + + if (PushNotificationRegistrations.Num() != 0) + { + writer->WriteArrayStart(TEXT("PushNotificationRegistrations")); + for (const FPushNotificationRegistration& item : PushNotificationRegistrations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Statistics.Num() != 0) + { + writer->WriteObjectStart(TEXT("Statistics")); + for (TMap::TConstIterator It(Statistics); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + if (TotalValueToDateInUSD.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalValueToDateInUSD")); writer->WriteValue(static_cast(TotalValueToDateInUSD)); } + + if (ValuesToDate.Num() != 0) + { + writer->WriteObjectStart(TEXT("ValuesToDate")); + for (TMap::TConstIterator It(ValuesToDate); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyBalances.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyBalances")); + for (TMap::TConstIterator It(VirtualCurrencyBalances); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerProfile::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AdCampaignAttributionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AdCampaignAttributions")); + for (int32 Idx = 0; Idx < AdCampaignAttributionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AdCampaignAttributionsArray[Idx]; + AdCampaignAttributions.Add(FAdCampaignAttribution(CurrentItem->AsObject())); + } + + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr BannedUntilValue = obj->TryGetField(TEXT("BannedUntil")); + if (BannedUntilValue.IsValid()) + BannedUntil = readDatetime(BannedUntilValue); + + + const TArray>&ContactEmailAddressesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ContactEmailAddresses")); + for (int32 Idx = 0; Idx < ContactEmailAddressesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContactEmailAddressesArray[Idx]; + ContactEmailAddresses.Add(FContactEmailInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + const TArray>&LinkedAccountsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("LinkedAccounts")); + for (int32 Idx = 0; Idx < LinkedAccountsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LinkedAccountsArray[Idx]; + LinkedAccounts.Add(FPlayerLinkedAccount(CurrentItem->AsObject())); + } + + + const TSharedPtr* LocationsObject; + if (obj->TryGetObjectField(TEXT("Locations"), LocationsObject)) + { + for (TMap>::TConstIterator It((*LocationsObject)->Values); It; ++It) + { + Locations.Add(It.Key(), FPlayerLocation(It.Value()->AsObject())); + } + } + + Origination = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr PlayerIdValue = obj->TryGetField(TEXT("PlayerId")); + if (PlayerIdValue.IsValid() && !PlayerIdValue->IsNull()) + { + FString TmpValue; + if (PlayerIdValue->TryGetString(TmpValue)) { PlayerId = TmpValue; } + } + + const TArray>&PlayerStatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PlayerStatistics")); + for (int32 Idx = 0; Idx < PlayerStatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PlayerStatisticsArray[Idx]; + PlayerStatistics.Add(FPlayerStatistic(CurrentItem->AsObject())); + } + + + const TSharedPtr PublisherIdValue = obj->TryGetField(TEXT("PublisherId")); + if (PublisherIdValue.IsValid() && !PublisherIdValue->IsNull()) + { + FString TmpValue; + if (PublisherIdValue->TryGetString(TmpValue)) { PublisherId = TmpValue; } + } + + const TArray>&PushNotificationRegistrationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PushNotificationRegistrations")); + for (int32 Idx = 0; Idx < PushNotificationRegistrationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PushNotificationRegistrationsArray[Idx]; + PushNotificationRegistrations.Add(FPushNotificationRegistration(CurrentItem->AsObject())); + } + + + const TSharedPtr* StatisticsObject; + if (obj->TryGetObjectField(TEXT("Statistics"), StatisticsObject)) + { + for (TMap>::TConstIterator It((*StatisticsObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + Statistics.Add(It.Key(), TmpValue); + } + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr TotalValueToDateInUSDValue = obj->TryGetField(TEXT("TotalValueToDateInUSD")); + if (TotalValueToDateInUSDValue.IsValid() && !TotalValueToDateInUSDValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueToDateInUSDValue->TryGetNumber(TmpValue)) { TotalValueToDateInUSD = TmpValue; } + } + + const TSharedPtr* ValuesToDateObject; + if (obj->TryGetObjectField(TEXT("ValuesToDate"), ValuesToDateObject)) + { + for (TMap>::TConstIterator It((*ValuesToDateObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + ValuesToDate.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyBalancesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyBalances"), VirtualCurrencyBalancesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyBalancesObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyBalances.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayersInSegmentResult::~FGetPlayersInSegmentResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayersInSegmentResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ContinuationToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ContinuationToken")); writer->WriteValue(ContinuationToken); } + + if (PlayerProfiles.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerProfiles")); + for (const FPlayerProfile& item : PlayerProfiles) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("ProfilesInSegment")); writer->WriteValue(ProfilesInSegment); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayersInSegmentResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ContinuationTokenValue = obj->TryGetField(TEXT("ContinuationToken")); + if (ContinuationTokenValue.IsValid() && !ContinuationTokenValue->IsNull()) + { + FString TmpValue; + if (ContinuationTokenValue->TryGetString(TmpValue)) { ContinuationToken = TmpValue; } + } + + const TArray>&PlayerProfilesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PlayerProfiles")); + for (int32 Idx = 0; Idx < PlayerProfilesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PlayerProfilesArray[Idx]; + PlayerProfiles.Add(FPlayerProfile(CurrentItem->AsObject())); + } + + + const TSharedPtr ProfilesInSegmentValue = obj->TryGetField(TEXT("ProfilesInSegment")); + if (ProfilesInSegmentValue.IsValid() && !ProfilesInSegmentValue->IsNull()) + { + int32 TmpValue; + if (ProfilesInSegmentValue->TryGetNumber(TmpValue)) { ProfilesInSegment = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayersSegmentsRequest::~FGetPlayersSegmentsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayersSegmentsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayersSegmentsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FStatisticNameVersion::~FStatisticNameVersion() +{ + +} + +void PlayFab::ServerModels::FStatisticNameVersion::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FStatisticNameVersion::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerStatisticsRequest::~FGetPlayerStatisticsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayerStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (StatisticNames.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticNames")); + for (const FString& item : StatisticNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (StatisticNameVersions.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticNameVersions")); + for (const FStatisticNameVersion& item : StatisticNameVersions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("StatisticNames"), StatisticNames); + + const TArray>&StatisticNameVersionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("StatisticNameVersions")); + for (int32 Idx = 0; Idx < StatisticNameVersionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticNameVersionsArray[Idx]; + StatisticNameVersions.Add(FStatisticNameVersion(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerStatisticsResult::~FGetPlayerStatisticsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayerStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (Statistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticValue& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticValue(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerStatisticVersionsRequest::~FGetPlayerStatisticVersionsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayerStatisticVersionsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerStatisticVersionsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerStatisticVersion::~FPlayerStatisticVersion() +{ + +} + +void PlayFab::ServerModels::FPlayerStatisticVersion::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ActivationTime")); writeDatetime(ActivationTime, writer); + + if (DeactivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("DeactivationTime")); writeDatetime(DeactivationTime, writer); } + + if (ScheduledActivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("ScheduledActivationTime")); writeDatetime(ScheduledActivationTime, writer); } + + if (ScheduledDeactivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("ScheduledDeactivationTime")); writeDatetime(ScheduledDeactivationTime, writer); } + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerStatisticVersion::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActivationTimeValue = obj->TryGetField(TEXT("ActivationTime")); + if (ActivationTimeValue.IsValid()) + ActivationTime = readDatetime(ActivationTimeValue); + + + const TSharedPtr DeactivationTimeValue = obj->TryGetField(TEXT("DeactivationTime")); + if (DeactivationTimeValue.IsValid()) + DeactivationTime = readDatetime(DeactivationTimeValue); + + + const TSharedPtr ScheduledActivationTimeValue = obj->TryGetField(TEXT("ScheduledActivationTime")); + if (ScheduledActivationTimeValue.IsValid()) + ScheduledActivationTime = readDatetime(ScheduledActivationTimeValue); + + + const TSharedPtr ScheduledDeactivationTimeValue = obj->TryGetField(TEXT("ScheduledDeactivationTime")); + if (ScheduledDeactivationTimeValue.IsValid()) + ScheduledDeactivationTime = readDatetime(ScheduledDeactivationTimeValue); + + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerStatisticVersionsResult::~FGetPlayerStatisticVersionsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayerStatisticVersionsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticVersions.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticVersions")); + for (const FPlayerStatisticVersion& item : StatisticVersions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerStatisticVersionsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&StatisticVersionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("StatisticVersions")); + for (int32 Idx = 0; Idx < StatisticVersionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticVersionsArray[Idx]; + StatisticVersions.Add(FPlayerStatisticVersion(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerTagsRequest::~FGetPlayerTagsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayerTagsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Namespace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Namespace")); writer->WriteValue(Namespace); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerTagsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NamespaceValue = obj->TryGetField(TEXT("Namespace")); + if (NamespaceValue.IsValid() && !NamespaceValue->IsNull()) + { + FString TmpValue; + if (NamespaceValue->TryGetString(TmpValue)) { Namespace = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerTagsResult::~FGetPlayerTagsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayerTagsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerTagsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromFacebookIDsRequest::~FGetPlayFabIDsFromFacebookIDsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromFacebookIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("FacebookIDs")); + for (const FString& item : FacebookIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromFacebookIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FacebookIDs"), FacebookIDs); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromFacebookIDsResult::~FGetPlayFabIDsFromFacebookIDsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromFacebookIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FFacebookPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromFacebookIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FFacebookPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest::~FGetPlayFabIDsFromFacebookInstantGamesIdsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("FacebookInstantGamesIds")); + for (const FString& item : FacebookInstantGamesIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FacebookInstantGamesIds"), FacebookInstantGamesIds); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult::~FGetPlayFabIDsFromFacebookInstantGamesIdsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FFacebookInstantGamesPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FFacebookInstantGamesPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest::~FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("NintendoSwitchDeviceIds")); + for (const FString& item : NintendoSwitchDeviceIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("NintendoSwitchDeviceIds"), NintendoSwitchDeviceIds); + + return HasSucceeded; +} + +PlayFab::ServerModels::FNintendoSwitchPlayFabIdPair::~FNintendoSwitchPlayFabIdPair() +{ + +} + +void PlayFab::ServerModels::FNintendoSwitchPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FNintendoSwitchPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult::~FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FNintendoSwitchPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FNintendoSwitchPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromSteamIDsRequest::~FGetPlayFabIDsFromSteamIDsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromSteamIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SteamStringIDs.Num() != 0) + { + writer->WriteArrayStart(TEXT("SteamStringIDs")); + for (const FString& item : SteamStringIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromSteamIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("SteamStringIDs"), SteamStringIDs); + + return HasSucceeded; +} + +PlayFab::ServerModels::FSteamPlayFabIdPair::~FSteamPlayFabIdPair() +{ + +} + +void PlayFab::ServerModels::FSteamPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (SteamStringId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamStringId")); writer->WriteValue(SteamStringId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSteamPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr SteamStringIdValue = obj->TryGetField(TEXT("SteamStringId")); + if (SteamStringIdValue.IsValid() && !SteamStringIdValue->IsNull()) + { + FString TmpValue; + if (SteamStringIdValue->TryGetString(TmpValue)) { SteamStringId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromSteamIDsResult::~FGetPlayFabIDsFromSteamIDsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromSteamIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FSteamPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromSteamIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FSteamPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPublisherDataRequest::~FGetPublisherDataRequest() +{ + +} + +void PlayFab::ServerModels::FGetPublisherDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPublisherDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPublisherDataResult::~FGetPublisherDataResult() +{ + +} + +void PlayFab::ServerModels::FGetPublisherDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPublisherDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetRandomResultTablesRequest::~FGetRandomResultTablesRequest() +{ + +} + +void PlayFab::ServerModels::FGetRandomResultTablesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("TableIDs")); + for (const FString& item : TableIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetRandomResultTablesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("TableIDs"), TableIDs); + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeResultTableNodeTypeEnumJSON(ResultTableNodeType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ResultTableNodeTypeItemId: writer->WriteValue(TEXT("ItemId")); break; + case ResultTableNodeTypeTableId: writer->WriteValue(TEXT("TableId")); break; + } +} + +ServerModels::ResultTableNodeType PlayFab::ServerModels::readResultTableNodeTypeFromValue(const TSharedPtr& value) +{ + return readResultTableNodeTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::ResultTableNodeType PlayFab::ServerModels::readResultTableNodeTypeFromValue(const FString& value) +{ + static TMap _ResultTableNodeTypeMap; + if (_ResultTableNodeTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ResultTableNodeTypeMap.Add(TEXT("ItemId"), ResultTableNodeTypeItemId); + _ResultTableNodeTypeMap.Add(TEXT("TableId"), ResultTableNodeTypeTableId); + + } + + if (!value.IsEmpty()) + { + auto output = _ResultTableNodeTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ResultTableNodeTypeItemId; // Basically critical fail +} + +PlayFab::ServerModels::FResultTableNode::~FResultTableNode() +{ + +} + +void PlayFab::ServerModels::FResultTableNode::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ResultItem")); writer->WriteValue(ResultItem); + + writer->WriteIdentifierPrefix(TEXT("ResultItemType")); writeResultTableNodeTypeEnumJSON(ResultItemType, writer); + + writer->WriteIdentifierPrefix(TEXT("Weight")); writer->WriteValue(Weight); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FResultTableNode::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ResultItemValue = obj->TryGetField(TEXT("ResultItem")); + if (ResultItemValue.IsValid() && !ResultItemValue->IsNull()) + { + FString TmpValue; + if (ResultItemValue->TryGetString(TmpValue)) { ResultItem = TmpValue; } + } + + ResultItemType = readResultTableNodeTypeFromValue(obj->TryGetField(TEXT("ResultItemType"))); + + const TSharedPtr WeightValue = obj->TryGetField(TEXT("Weight")); + if (WeightValue.IsValid() && !WeightValue->IsNull()) + { + int32 TmpValue; + if (WeightValue->TryGetNumber(TmpValue)) { Weight = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRandomResultTableListing::~FRandomResultTableListing() +{ + +} + +void PlayFab::ServerModels::FRandomResultTableListing::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("Nodes")); + for (const FResultTableNode& item : Nodes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("TableId")); writer->WriteValue(TableId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRandomResultTableListing::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TArray>&NodesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Nodes")); + for (int32 Idx = 0; Idx < NodesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = NodesArray[Idx]; + Nodes.Add(FResultTableNode(CurrentItem->AsObject())); + } + + + const TSharedPtr TableIdValue = obj->TryGetField(TEXT("TableId")); + if (TableIdValue.IsValid() && !TableIdValue->IsNull()) + { + FString TmpValue; + if (TableIdValue->TryGetString(TmpValue)) { TableId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetRandomResultTablesResult::~FGetRandomResultTablesResult() +{ + +} + +void PlayFab::ServerModels::FGetRandomResultTablesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Tables.Num() != 0) + { + writer->WriteObjectStart(TEXT("Tables")); + for (TMap::TConstIterator It(Tables); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetRandomResultTablesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* TablesObject; + if (obj->TryGetObjectField(TEXT("Tables"), TablesObject)) + { + for (TMap>::TConstIterator It((*TablesObject)->Values); It; ++It) + { + Tables.Add(It.Key(), FRandomResultTableListing(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetSharedGroupDataRequest::~FGetSharedGroupDataRequest() +{ + +} + +void PlayFab::ServerModels::FGetSharedGroupDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GetMembers.notNull()) { writer->WriteIdentifierPrefix(TEXT("GetMembers")); writer->WriteValue(GetMembers); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetSharedGroupDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GetMembersValue = obj->TryGetField(TEXT("GetMembers")); + if (GetMembersValue.IsValid() && !GetMembersValue->IsNull()) + { + bool TmpValue; + if (GetMembersValue->TryGetBool(TmpValue)) { GetMembers = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSharedGroupDataRecord::~FSharedGroupDataRecord() +{ + +} + +void PlayFab::ServerModels::FSharedGroupDataRecord::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LastUpdated")); writeDatetime(LastUpdated, writer); + + if (LastUpdatedBy.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LastUpdatedBy")); writer->WriteValue(LastUpdatedBy); } + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSharedGroupDataRecord::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LastUpdatedValue = obj->TryGetField(TEXT("LastUpdated")); + if (LastUpdatedValue.IsValid()) + LastUpdated = readDatetime(LastUpdatedValue); + + + const TSharedPtr LastUpdatedByValue = obj->TryGetField(TEXT("LastUpdatedBy")); + if (LastUpdatedByValue.IsValid() && !LastUpdatedByValue->IsNull()) + { + FString TmpValue; + if (LastUpdatedByValue->TryGetString(TmpValue)) { LastUpdatedBy = TmpValue; } + } + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetSharedGroupDataResult::~FGetSharedGroupDataResult() +{ + +} + +void PlayFab::ServerModels::FGetSharedGroupDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + if (Members.Num() != 0) + { + writer->WriteArrayStart(TEXT("Members")); + for (const FString& item : Members) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetSharedGroupDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FSharedGroupDataRecord(It.Value()->AsObject())); + } + } + + obj->TryGetStringArrayField(TEXT("Members"), Members); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetTimeRequest::~FGetTimeRequest() +{ + +} + +void PlayFab::ServerModels::FGetTimeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetTimeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetTimeResult::~FGetTimeResult() +{ + +} + +void PlayFab::ServerModels::FGetTimeResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Time")); writeDatetime(Time, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetTimeResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TimeValue = obj->TryGetField(TEXT("Time")); + if (TimeValue.IsValid()) + Time = readDatetime(TimeValue); + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetTitleDataRequest::~FGetTitleDataRequest() +{ + +} + +void PlayFab::ServerModels::FGetTitleDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetTitleDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetTitleDataResult::~FGetTitleDataResult() +{ + +} + +void PlayFab::ServerModels::FGetTitleDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetTitleDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetTitleNewsRequest::~FGetTitleNewsRequest() +{ + +} + +void PlayFab::ServerModels::FGetTitleNewsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Count.notNull()) { writer->WriteIdentifierPrefix(TEXT("Count")); writer->WriteValue(Count); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetTitleNewsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CountValue = obj->TryGetField(TEXT("Count")); + if (CountValue.IsValid() && !CountValue->IsNull()) + { + int32 TmpValue; + if (CountValue->TryGetNumber(TmpValue)) { Count = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FTitleNewsItem::~FTitleNewsItem() +{ + +} + +void PlayFab::ServerModels::FTitleNewsItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Body")); writer->WriteValue(Body); } + + if (NewsId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NewsId")); writer->WriteValue(NewsId); } + + writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); + + if (Title.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Title")); writer->WriteValue(Title); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FTitleNewsItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BodyValue = obj->TryGetField(TEXT("Body")); + if (BodyValue.IsValid() && !BodyValue->IsNull()) + { + FString TmpValue; + if (BodyValue->TryGetString(TmpValue)) { Body = TmpValue; } + } + + const TSharedPtr NewsIdValue = obj->TryGetField(TEXT("NewsId")); + if (NewsIdValue.IsValid() && !NewsIdValue->IsNull()) + { + FString TmpValue; + if (NewsIdValue->TryGetString(TmpValue)) { NewsId = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + const TSharedPtr TitleValue = obj->TryGetField(TEXT("Title")); + if (TitleValue.IsValid() && !TitleValue->IsNull()) + { + FString TmpValue; + if (TitleValue->TryGetString(TmpValue)) { Title = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetTitleNewsResult::~FGetTitleNewsResult() +{ + +} + +void PlayFab::ServerModels::FGetTitleNewsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (News.Num() != 0) + { + writer->WriteArrayStart(TEXT("News")); + for (const FTitleNewsItem& item : News) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetTitleNewsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&NewsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("News")); + for (int32 Idx = 0; Idx < NewsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = NewsArray[Idx]; + News.Add(FTitleNewsItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserAccountInfoRequest::~FGetUserAccountInfoRequest() +{ + +} + +void PlayFab::ServerModels::FGetUserAccountInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserAccountInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserAccountInfoResult::~FGetUserAccountInfoResult() +{ + //if (UserInfo != nullptr) delete UserInfo; + +} + +void PlayFab::ServerModels::FGetUserAccountInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (UserInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("UserInfo")); UserInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserAccountInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UserInfoValue = obj->TryGetField(TEXT("UserInfo")); + if (UserInfoValue.IsValid() && !UserInfoValue->IsNull()) + { + UserInfo = MakeShareable(new FUserAccountInfo(UserInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserBansRequest::~FGetUserBansRequest() +{ + +} + +void PlayFab::ServerModels::FGetUserBansRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserBansRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserBansResult::~FGetUserBansResult() +{ + +} + +void PlayFab::ServerModels::FGetUserBansResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserBansResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserDataRequest::~FGetUserDataRequest() +{ + +} + +void PlayFab::ServerModels::FGetUserDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IfChangedFromDataVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("IfChangedFromDataVersion")); writer->WriteValue(static_cast(IfChangedFromDataVersion)); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IfChangedFromDataVersionValue = obj->TryGetField(TEXT("IfChangedFromDataVersion")); + if (IfChangedFromDataVersionValue.IsValid() && !IfChangedFromDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (IfChangedFromDataVersionValue->TryGetNumber(TmpValue)) { IfChangedFromDataVersion = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserDataResult::~FGetUserDataResult() +{ + +} + +void PlayFab::ServerModels::FGetUserDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserInventoryRequest::~FGetUserInventoryRequest() +{ + +} + +void PlayFab::ServerModels::FGetUserInventoryRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserInventoryRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserInventoryResult::~FGetUserInventoryResult() +{ + +} + +void PlayFab::ServerModels::FGetUserInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(VirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyRechargeTimes"), VirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + VirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantCharacterToUserRequest::~FGrantCharacterToUserRequest() +{ + +} + +void PlayFab::ServerModels::FGrantCharacterToUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterName")); writer->WriteValue(CharacterName); + + writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantCharacterToUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterNameValue = obj->TryGetField(TEXT("CharacterName")); + if (CharacterNameValue.IsValid() && !CharacterNameValue->IsNull()) + { + FString TmpValue; + if (CharacterNameValue->TryGetString(TmpValue)) { CharacterName = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantCharacterToUserResult::~FGrantCharacterToUserResult() +{ + +} + +void PlayFab::ServerModels::FGrantCharacterToUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantCharacterToUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantedItemInstance::~FGrantedItemInstance() +{ + +} + +void PlayFab::ServerModels::FGrantedItemInstance::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (BundleContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundleContents")); + for (const FString& item : BundleContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundleParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BundleParent")); writer->WriteValue(BundleParent); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CustomData.Num() != 0) + { + writer->WriteObjectStart(TEXT("CustomData")); + for (TMap::TConstIterator It(CustomData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Expiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (PurchaseDate.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); } + + if (RemainingUses.notNull()) { writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); } + + writer->WriteIdentifierPrefix(TEXT("Result")); writer->WriteValue(Result); + + if (UnitCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnitCurrency")); writer->WriteValue(UnitCurrency); } + + writer->WriteIdentifierPrefix(TEXT("UnitPrice")); writer->WriteValue(static_cast(UnitPrice)); + + if (UsesIncrementedBy.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsesIncrementedBy")); writer->WriteValue(UsesIncrementedBy); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantedItemInstance::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("BundleContents"), BundleContents); + + const TSharedPtr BundleParentValue = obj->TryGetField(TEXT("BundleParent")); + if (BundleParentValue.IsValid() && !BundleParentValue->IsNull()) + { + FString TmpValue; + if (BundleParentValue->TryGetString(TmpValue)) { BundleParent = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* CustomDataObject; + if (obj->TryGetObjectField(TEXT("CustomData"), CustomDataObject)) + { + for (TMap>::TConstIterator It((*CustomDataObject)->Values); It; ++It) + { + CustomData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + const TSharedPtr ResultValue = obj->TryGetField(TEXT("Result")); + if (ResultValue.IsValid() && !ResultValue->IsNull()) + { + bool TmpValue; + if (ResultValue->TryGetBool(TmpValue)) { Result = TmpValue; } + } + + const TSharedPtr UnitCurrencyValue = obj->TryGetField(TEXT("UnitCurrency")); + if (UnitCurrencyValue.IsValid() && !UnitCurrencyValue->IsNull()) + { + FString TmpValue; + if (UnitCurrencyValue->TryGetString(TmpValue)) { UnitCurrency = TmpValue; } + } + + const TSharedPtr UnitPriceValue = obj->TryGetField(TEXT("UnitPrice")); + if (UnitPriceValue.IsValid() && !UnitPriceValue->IsNull()) + { + uint32 TmpValue; + if (UnitPriceValue->TryGetNumber(TmpValue)) { UnitPrice = TmpValue; } + } + + const TSharedPtr UsesIncrementedByValue = obj->TryGetField(TEXT("UsesIncrementedBy")); + if (UsesIncrementedByValue.IsValid() && !UsesIncrementedByValue->IsNull()) + { + int32 TmpValue; + if (UsesIncrementedByValue->TryGetNumber(TmpValue)) { UsesIncrementedBy = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantItemsToCharacterRequest::~FGrantItemsToCharacterRequest() +{ + +} + +void PlayFab::ServerModels::FGrantItemsToCharacterRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (ItemIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemIds")); + for (const FString& item : ItemIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantItemsToCharacterRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("ItemIds"), ItemIds); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantItemsToCharacterResult::~FGrantItemsToCharacterResult() +{ + +} + +void PlayFab::ServerModels::FGrantItemsToCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemGrantResults.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemGrantResults")); + for (const FGrantedItemInstance& item : ItemGrantResults) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantItemsToCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemGrantResultsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ItemGrantResults")); + for (int32 Idx = 0; Idx < ItemGrantResultsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemGrantResultsArray[Idx]; + ItemGrantResults.Add(FGrantedItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantItemsToUserRequest::~FGrantItemsToUserRequest() +{ + +} + +void PlayFab::ServerModels::FGrantItemsToUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("ItemIds")); + for (const FString& item : ItemIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantItemsToUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("ItemIds"), ItemIds); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantItemsToUserResult::~FGrantItemsToUserResult() +{ + +} + +void PlayFab::ServerModels::FGrantItemsToUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemGrantResults.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemGrantResults")); + for (const FGrantedItemInstance& item : ItemGrantResults) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantItemsToUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemGrantResultsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ItemGrantResults")); + for (int32 Idx = 0; Idx < ItemGrantResultsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemGrantResultsArray[Idx]; + ItemGrantResults.Add(FGrantedItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FItemGrant::~FItemGrant() +{ + +} + +void PlayFab::ServerModels::FItemGrant::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FItemGrant::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantItemsToUsersRequest::~FGrantItemsToUsersRequest() +{ + +} + +void PlayFab::ServerModels::FGrantItemsToUsersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("ItemGrants")); + for (const FItemGrant& item : ItemGrants) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantItemsToUsersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TArray>&ItemGrantsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ItemGrants")); + for (int32 Idx = 0; Idx < ItemGrantsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemGrantsArray[Idx]; + ItemGrants.Add(FItemGrant(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantItemsToUsersResult::~FGrantItemsToUsersResult() +{ + +} + +void PlayFab::ServerModels::FGrantItemsToUsersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemGrantResults.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemGrantResults")); + for (const FGrantedItemInstance& item : ItemGrantResults) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantItemsToUsersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemGrantResultsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ItemGrantResults")); + for (int32 Idx = 0; Idx < ItemGrantResultsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemGrantResultsArray[Idx]; + ItemGrantResults.Add(FGrantedItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FListUsersCharactersRequest::~FListUsersCharactersRequest() +{ + +} + +void PlayFab::ServerModels::FListUsersCharactersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FListUsersCharactersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FListUsersCharactersResult::~FListUsersCharactersResult() +{ + +} + +void PlayFab::ServerModels::FListUsersCharactersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Characters.Num() != 0) + { + writer->WriteArrayStart(TEXT("Characters")); + for (const FCharacterResult& item : Characters) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FListUsersCharactersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&CharactersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Characters")); + for (int32 Idx = 0; Idx < CharactersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CharactersArray[Idx]; + Characters.Add(FCharacterResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FModifyCharacterVirtualCurrencyResult::~FModifyCharacterVirtualCurrencyResult() +{ + +} + +void PlayFab::ServerModels::FModifyCharacterVirtualCurrencyResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Balance")); writer->WriteValue(Balance); + + if (VirtualCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FModifyCharacterVirtualCurrencyResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BalanceValue = obj->TryGetField(TEXT("Balance")); + if (BalanceValue.IsValid() && !BalanceValue->IsNull()) + { + int32 TmpValue; + if (BalanceValue->TryGetNumber(TmpValue)) { Balance = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FModifyItemUsesRequest::~FModifyItemUsesRequest() +{ + +} + +void PlayFab::ServerModels::FModifyItemUsesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("UsesToAdd")); writer->WriteValue(UsesToAdd); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FModifyItemUsesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr UsesToAddValue = obj->TryGetField(TEXT("UsesToAdd")); + if (UsesToAddValue.IsValid() && !UsesToAddValue->IsNull()) + { + int32 TmpValue; + if (UsesToAddValue->TryGetNumber(TmpValue)) { UsesToAdd = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FModifyItemUsesResult::~FModifyItemUsesResult() +{ + +} + +void PlayFab::ServerModels::FModifyItemUsesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FModifyItemUsesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FModifyUserVirtualCurrencyResult::~FModifyUserVirtualCurrencyResult() +{ + +} + +void PlayFab::ServerModels::FModifyUserVirtualCurrencyResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Balance")); writer->WriteValue(Balance); + + writer->WriteIdentifierPrefix(TEXT("BalanceChange")); writer->WriteValue(BalanceChange); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (VirtualCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FModifyUserVirtualCurrencyResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BalanceValue = obj->TryGetField(TEXT("Balance")); + if (BalanceValue.IsValid() && !BalanceValue->IsNull()) + { + int32 TmpValue; + if (BalanceValue->TryGetNumber(TmpValue)) { Balance = TmpValue; } + } + + const TSharedPtr BalanceChangeValue = obj->TryGetField(TEXT("BalanceChange")); + if (BalanceChangeValue.IsValid() && !BalanceChangeValue->IsNull()) + { + int32 TmpValue; + if (BalanceChangeValue->TryGetNumber(TmpValue)) { BalanceChange = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FMoveItemToCharacterFromCharacterRequest::~FMoveItemToCharacterFromCharacterRequest() +{ + +} + +void PlayFab::ServerModels::FMoveItemToCharacterFromCharacterRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GivingCharacterId")); writer->WriteValue(GivingCharacterId); + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("ReceivingCharacterId")); writer->WriteValue(ReceivingCharacterId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMoveItemToCharacterFromCharacterRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GivingCharacterIdValue = obj->TryGetField(TEXT("GivingCharacterId")); + if (GivingCharacterIdValue.IsValid() && !GivingCharacterIdValue->IsNull()) + { + FString TmpValue; + if (GivingCharacterIdValue->TryGetString(TmpValue)) { GivingCharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReceivingCharacterIdValue = obj->TryGetField(TEXT("ReceivingCharacterId")); + if (ReceivingCharacterIdValue.IsValid() && !ReceivingCharacterIdValue->IsNull()) + { + FString TmpValue; + if (ReceivingCharacterIdValue->TryGetString(TmpValue)) { ReceivingCharacterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FMoveItemToCharacterFromCharacterResult::~FMoveItemToCharacterFromCharacterResult() +{ + +} + +void PlayFab::ServerModels::FMoveItemToCharacterFromCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMoveItemToCharacterFromCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FMoveItemToCharacterFromUserRequest::~FMoveItemToCharacterFromUserRequest() +{ + +} + +void PlayFab::ServerModels::FMoveItemToCharacterFromUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMoveItemToCharacterFromUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FMoveItemToCharacterFromUserResult::~FMoveItemToCharacterFromUserResult() +{ + +} + +void PlayFab::ServerModels::FMoveItemToCharacterFromUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMoveItemToCharacterFromUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FMoveItemToUserFromCharacterRequest::~FMoveItemToUserFromCharacterRequest() +{ + +} + +void PlayFab::ServerModels::FMoveItemToUserFromCharacterRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMoveItemToUserFromCharacterRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FMoveItemToUserFromCharacterResult::~FMoveItemToUserFromCharacterResult() +{ + +} + +void PlayFab::ServerModels::FMoveItemToUserFromCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMoveItemToUserFromCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FNotifyMatchmakerPlayerLeftRequest::~FNotifyMatchmakerPlayerLeftRequest() +{ + +} + +void PlayFab::ServerModels::FNotifyMatchmakerPlayerLeftRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FNotifyMatchmakerPlayerLeftRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writePlayerConnectionStateEnumJSON(PlayerConnectionState enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case PlayerConnectionStateUnassigned: writer->WriteValue(TEXT("Unassigned")); break; + case PlayerConnectionStateConnecting: writer->WriteValue(TEXT("Connecting")); break; + case PlayerConnectionStateParticipating: writer->WriteValue(TEXT("Participating")); break; + case PlayerConnectionStateParticipated: writer->WriteValue(TEXT("Participated")); break; + } +} + +ServerModels::PlayerConnectionState PlayFab::ServerModels::readPlayerConnectionStateFromValue(const TSharedPtr& value) +{ + return readPlayerConnectionStateFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::PlayerConnectionState PlayFab::ServerModels::readPlayerConnectionStateFromValue(const FString& value) +{ + static TMap _PlayerConnectionStateMap; + if (_PlayerConnectionStateMap.Num() == 0) + { + // Auto-generate the map on the first use + _PlayerConnectionStateMap.Add(TEXT("Unassigned"), PlayerConnectionStateUnassigned); + _PlayerConnectionStateMap.Add(TEXT("Connecting"), PlayerConnectionStateConnecting); + _PlayerConnectionStateMap.Add(TEXT("Participating"), PlayerConnectionStateParticipating); + _PlayerConnectionStateMap.Add(TEXT("Participated"), PlayerConnectionStateParticipated); + + } + + if (!value.IsEmpty()) + { + auto output = _PlayerConnectionStateMap.Find(value); + if (output != nullptr) + return *output; + } + + return PlayerConnectionStateUnassigned; // Basically critical fail +} + +PlayFab::ServerModels::FNotifyMatchmakerPlayerLeftResult::~FNotifyMatchmakerPlayerLeftResult() +{ + +} + +void PlayFab::ServerModels::FNotifyMatchmakerPlayerLeftResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayerState.notNull()) { writer->WriteIdentifierPrefix(TEXT("PlayerState")); writePlayerConnectionStateEnumJSON(PlayerState, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FNotifyMatchmakerPlayerLeftResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + PlayerState = readPlayerConnectionStateFromValue(obj->TryGetField(TEXT("PlayerState"))); + + return HasSucceeded; +} + +PlayFab::ServerModels::FPushNotificationPackage::~FPushNotificationPackage() +{ + +} + +void PlayFab::ServerModels::FPushNotificationPackage::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Badge")); writer->WriteValue(Badge); + + if (CustomData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomData")); writer->WriteValue(CustomData); } + + if (Icon.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Icon")); writer->WriteValue(Icon); } + + writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); + + if (Sound.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Sound")); writer->WriteValue(Sound); } + + writer->WriteIdentifierPrefix(TEXT("Title")); writer->WriteValue(Title); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPushNotificationPackage::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BadgeValue = obj->TryGetField(TEXT("Badge")); + if (BadgeValue.IsValid() && !BadgeValue->IsNull()) + { + int32 TmpValue; + if (BadgeValue->TryGetNumber(TmpValue)) { Badge = TmpValue; } + } + + const TSharedPtr CustomDataValue = obj->TryGetField(TEXT("CustomData")); + if (CustomDataValue.IsValid() && !CustomDataValue->IsNull()) + { + FString TmpValue; + if (CustomDataValue->TryGetString(TmpValue)) { CustomData = TmpValue; } + } + + const TSharedPtr IconValue = obj->TryGetField(TEXT("Icon")); + if (IconValue.IsValid() && !IconValue->IsNull()) + { + FString TmpValue; + if (IconValue->TryGetString(TmpValue)) { Icon = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + const TSharedPtr SoundValue = obj->TryGetField(TEXT("Sound")); + if (SoundValue.IsValid() && !SoundValue->IsNull()) + { + FString TmpValue; + if (SoundValue->TryGetString(TmpValue)) { Sound = TmpValue; } + } + + const TSharedPtr TitleValue = obj->TryGetField(TEXT("Title")); + if (TitleValue.IsValid() && !TitleValue->IsNull()) + { + FString TmpValue; + if (TitleValue->TryGetString(TmpValue)) { Title = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRedeemCouponRequest::~FRedeemCouponRequest() +{ + +} + +void PlayFab::ServerModels::FRedeemCouponRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("CouponCode")); writer->WriteValue(CouponCode); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRedeemCouponRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CouponCodeValue = obj->TryGetField(TEXT("CouponCode")); + if (CouponCodeValue.IsValid() && !CouponCodeValue->IsNull()) + { + FString TmpValue; + if (CouponCodeValue->TryGetString(TmpValue)) { CouponCode = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRedeemCouponResult::~FRedeemCouponResult() +{ + +} + +void PlayFab::ServerModels::FRedeemCouponResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GrantedItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("GrantedItems")); + for (const FItemInstance& item : GrantedItems) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRedeemCouponResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GrantedItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GrantedItems")); + for (int32 Idx = 0; Idx < GrantedItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GrantedItemsArray[Idx]; + GrantedItems.Add(FItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FRedeemMatchmakerTicketRequest::~FRedeemMatchmakerTicketRequest() +{ + +} + +void PlayFab::ServerModels::FRedeemMatchmakerTicketRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteIdentifierPrefix(TEXT("Ticket")); writer->WriteValue(Ticket); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRedeemMatchmakerTicketRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + const TSharedPtr TicketValue = obj->TryGetField(TEXT("Ticket")); + if (TicketValue.IsValid() && !TicketValue->IsNull()) + { + FString TmpValue; + if (TicketValue->TryGetString(TmpValue)) { Ticket = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRedeemMatchmakerTicketResult::~FRedeemMatchmakerTicketResult() +{ + //if (UserInfo != nullptr) delete UserInfo; + +} + +void PlayFab::ServerModels::FRedeemMatchmakerTicketResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + writer->WriteIdentifierPrefix(TEXT("TicketIsValid")); writer->WriteValue(TicketIsValid); + + if (UserInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("UserInfo")); UserInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRedeemMatchmakerTicketResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr TicketIsValidValue = obj->TryGetField(TEXT("TicketIsValid")); + if (TicketIsValidValue.IsValid() && !TicketIsValidValue->IsNull()) + { + bool TmpValue; + if (TicketIsValidValue->TryGetBool(TmpValue)) { TicketIsValid = TmpValue; } + } + + const TSharedPtr UserInfoValue = obj->TryGetField(TEXT("UserInfo")); + if (UserInfoValue.IsValid() && !UserInfoValue->IsNull()) + { + UserInfo = MakeShareable(new FUserAccountInfo(UserInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRefreshGameServerInstanceHeartbeatRequest::~FRefreshGameServerInstanceHeartbeatRequest() +{ + +} + +void PlayFab::ServerModels::FRefreshGameServerInstanceHeartbeatRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRefreshGameServerInstanceHeartbeatRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRefreshGameServerInstanceHeartbeatResult::~FRefreshGameServerInstanceHeartbeatResult() +{ + +} + +void PlayFab::ServerModels::FRefreshGameServerInstanceHeartbeatResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRefreshGameServerInstanceHeartbeatResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeRegionEnumJSON(Region enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case RegionUSCentral: writer->WriteValue(TEXT("USCentral")); break; + case RegionUSEast: writer->WriteValue(TEXT("USEast")); break; + case RegionEUWest: writer->WriteValue(TEXT("EUWest")); break; + case RegionSingapore: writer->WriteValue(TEXT("Singapore")); break; + case RegionJapan: writer->WriteValue(TEXT("Japan")); break; + case RegionBrazil: writer->WriteValue(TEXT("Brazil")); break; + case RegionAustralia: writer->WriteValue(TEXT("Australia")); break; + } +} + +ServerModels::Region PlayFab::ServerModels::readRegionFromValue(const TSharedPtr& value) +{ + return readRegionFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::Region PlayFab::ServerModels::readRegionFromValue(const FString& value) +{ + static TMap _RegionMap; + if (_RegionMap.Num() == 0) + { + // Auto-generate the map on the first use + _RegionMap.Add(TEXT("USCentral"), RegionUSCentral); + _RegionMap.Add(TEXT("USEast"), RegionUSEast); + _RegionMap.Add(TEXT("EUWest"), RegionEUWest); + _RegionMap.Add(TEXT("Singapore"), RegionSingapore); + _RegionMap.Add(TEXT("Japan"), RegionJapan); + _RegionMap.Add(TEXT("Brazil"), RegionBrazil); + _RegionMap.Add(TEXT("Australia"), RegionAustralia); + + } + + if (!value.IsEmpty()) + { + auto output = _RegionMap.Find(value); + if (output != nullptr) + return *output; + } + + return RegionUSCentral; // Basically critical fail +} + +PlayFab::ServerModels::FRegisterGameRequest::~FRegisterGameRequest() +{ + +} + +void PlayFab::ServerModels::FRegisterGameRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Build")); writer->WriteValue(Build); + + writer->WriteIdentifierPrefix(TEXT("GameMode")); writer->WriteValue(GameMode); + + if (LobbyId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); } + + writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); + + if (ServerHost.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerHost")); writer->WriteValue(ServerHost); } + + if (ServerIPV4Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV4Address")); writer->WriteValue(ServerIPV4Address); } + + if (ServerIPV6Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV6Address")); writer->WriteValue(ServerIPV6Address); } + + writer->WriteIdentifierPrefix(TEXT("ServerPort")); writer->WriteValue(ServerPort); + + if (ServerPublicDNSName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerPublicDNSName")); writer->WriteValue(ServerPublicDNSName); } + + if (Tags.Num() != 0) + { + writer->WriteObjectStart(TEXT("Tags")); + for (TMap::TConstIterator It(Tags); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRegisterGameRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildValue = obj->TryGetField(TEXT("Build")); + if (BuildValue.IsValid() && !BuildValue->IsNull()) + { + FString TmpValue; + if (BuildValue->TryGetString(TmpValue)) { Build = TmpValue; } + } + + const TSharedPtr GameModeValue = obj->TryGetField(TEXT("GameMode")); + if (GameModeValue.IsValid() && !GameModeValue->IsNull()) + { + FString TmpValue; + if (GameModeValue->TryGetString(TmpValue)) { GameMode = TmpValue; } + } + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + const TSharedPtr ServerHostValue = obj->TryGetField(TEXT("ServerHost")); + if (ServerHostValue.IsValid() && !ServerHostValue->IsNull()) + { + FString TmpValue; + if (ServerHostValue->TryGetString(TmpValue)) { ServerHost = TmpValue; } + } + + const TSharedPtr ServerIPV4AddressValue = obj->TryGetField(TEXT("ServerIPV4Address")); + if (ServerIPV4AddressValue.IsValid() && !ServerIPV4AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV4AddressValue->TryGetString(TmpValue)) { ServerIPV4Address = TmpValue; } + } + + const TSharedPtr ServerIPV6AddressValue = obj->TryGetField(TEXT("ServerIPV6Address")); + if (ServerIPV6AddressValue.IsValid() && !ServerIPV6AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV6AddressValue->TryGetString(TmpValue)) { ServerIPV6Address = TmpValue; } + } + + const TSharedPtr ServerPortValue = obj->TryGetField(TEXT("ServerPort")); + if (ServerPortValue.IsValid() && !ServerPortValue->IsNull()) + { + FString TmpValue; + if (ServerPortValue->TryGetString(TmpValue)) { ServerPort = TmpValue; } + } + + const TSharedPtr ServerPublicDNSNameValue = obj->TryGetField(TEXT("ServerPublicDNSName")); + if (ServerPublicDNSNameValue.IsValid() && !ServerPublicDNSNameValue->IsNull()) + { + FString TmpValue; + if (ServerPublicDNSNameValue->TryGetString(TmpValue)) { ServerPublicDNSName = TmpValue; } + } + + const TSharedPtr* TagsObject; + if (obj->TryGetObjectField(TEXT("Tags"), TagsObject)) + { + for (TMap>::TConstIterator It((*TagsObject)->Values); It; ++It) + { + Tags.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRegisterGameResponse::~FRegisterGameResponse() +{ + +} + +void PlayFab::ServerModels::FRegisterGameResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (LobbyId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRegisterGameResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRemoveFriendRequest::~FRemoveFriendRequest() +{ + +} + +void PlayFab::ServerModels::FRemoveFriendRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRemoveFriendRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRemovePlayerTagRequest::~FRemovePlayerTagRequest() +{ + +} + +void PlayFab::ServerModels::FRemovePlayerTagRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("TagName")); writer->WriteValue(TagName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRemovePlayerTagRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TagNameValue = obj->TryGetField(TEXT("TagName")); + if (TagNameValue.IsValid() && !TagNameValue->IsNull()) + { + FString TmpValue; + if (TagNameValue->TryGetString(TmpValue)) { TagName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRemovePlayerTagResult::~FRemovePlayerTagResult() +{ + +} + +void PlayFab::ServerModels::FRemovePlayerTagResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRemovePlayerTagResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FRemoveSharedGroupMembersRequest::~FRemoveSharedGroupMembersRequest() +{ + +} + +void PlayFab::ServerModels::FRemoveSharedGroupMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("PlayFabIds")); + for (const FString& item : PlayFabIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRemoveSharedGroupMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("PlayFabIds"), PlayFabIds); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRemoveSharedGroupMembersResult::~FRemoveSharedGroupMembersResult() +{ + +} + +void PlayFab::ServerModels::FRemoveSharedGroupMembersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRemoveSharedGroupMembersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FReportPlayerServerRequest::~FReportPlayerServerRequest() +{ + +} + +void PlayFab::ServerModels::FReportPlayerServerRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + writer->WriteIdentifierPrefix(TEXT("ReporteeId")); writer->WriteValue(ReporteeId); + + writer->WriteIdentifierPrefix(TEXT("ReporterId")); writer->WriteValue(ReporterId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FReportPlayerServerRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ReporteeIdValue = obj->TryGetField(TEXT("ReporteeId")); + if (ReporteeIdValue.IsValid() && !ReporteeIdValue->IsNull()) + { + FString TmpValue; + if (ReporteeIdValue->TryGetString(TmpValue)) { ReporteeId = TmpValue; } + } + + const TSharedPtr ReporterIdValue = obj->TryGetField(TEXT("ReporterId")); + if (ReporterIdValue.IsValid() && !ReporterIdValue->IsNull()) + { + FString TmpValue; + if (ReporterIdValue->TryGetString(TmpValue)) { ReporterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FReportPlayerServerResult::~FReportPlayerServerResult() +{ + +} + +void PlayFab::ServerModels::FReportPlayerServerResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("SubmissionsRemaining")); writer->WriteValue(SubmissionsRemaining); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FReportPlayerServerResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SubmissionsRemainingValue = obj->TryGetField(TEXT("SubmissionsRemaining")); + if (SubmissionsRemainingValue.IsValid() && !SubmissionsRemainingValue->IsNull()) + { + int32 TmpValue; + if (SubmissionsRemainingValue->TryGetNumber(TmpValue)) { SubmissionsRemaining = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeAllBansForUserRequest::~FRevokeAllBansForUserRequest() +{ + +} + +void PlayFab::ServerModels::FRevokeAllBansForUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeAllBansForUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeAllBansForUserResult::~FRevokeAllBansForUserResult() +{ + +} + +void PlayFab::ServerModels::FRevokeAllBansForUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeAllBansForUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeBansRequest::~FRevokeBansRequest() +{ + +} + +void PlayFab::ServerModels::FRevokeBansRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("BanIds")); + for (const FString& item : BanIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeBansRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("BanIds"), BanIds); + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeBansResult::~FRevokeBansResult() +{ + +} + +void PlayFab::ServerModels::FRevokeBansResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeBansResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeInventoryItem::~FRevokeInventoryItem() +{ + +} + +void PlayFab::ServerModels::FRevokeInventoryItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeInventoryItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeInventoryItemRequest::~FRevokeInventoryItemRequest() +{ + +} + +void PlayFab::ServerModels::FRevokeInventoryItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeInventoryItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeInventoryItemsRequest::~FRevokeInventoryItemsRequest() +{ + +} + +void PlayFab::ServerModels::FRevokeInventoryItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Items")); + for (const FRevokeInventoryItem& item : Items) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeInventoryItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Items")); + for (int32 Idx = 0; Idx < ItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemsArray[Idx]; + Items.Add(FRevokeInventoryItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeItemError::~FRevokeItemError() +{ + //if (Item != nullptr) delete Item; + +} + +void PlayFab::ServerModels::FRevokeItemError::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + if (Item.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Item")); Item->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeItemError::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr ItemValue = obj->TryGetField(TEXT("Item")); + if (ItemValue.IsValid() && !ItemValue->IsNull()) + { + Item = MakeShareable(new FRevokeInventoryItem(ItemValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeInventoryItemsResult::~FRevokeInventoryItemsResult() +{ + +} + +void PlayFab::ServerModels::FRevokeInventoryItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Errors.Num() != 0) + { + writer->WriteArrayStart(TEXT("Errors")); + for (const FRevokeItemError& item : Errors) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeInventoryItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ErrorsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Errors")); + for (int32 Idx = 0; Idx < ErrorsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ErrorsArray[Idx]; + Errors.Add(FRevokeItemError(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeInventoryResult::~FRevokeInventoryResult() +{ + +} + +void PlayFab::ServerModels::FRevokeInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSendCustomAccountRecoveryEmailRequest::~FSendCustomAccountRecoveryEmailRequest() +{ + +} + +void PlayFab::ServerModels::FSendCustomAccountRecoveryEmailRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + writer->WriteIdentifierPrefix(TEXT("EmailTemplateId")); writer->WriteValue(EmailTemplateId); + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSendCustomAccountRecoveryEmailRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr EmailTemplateIdValue = obj->TryGetField(TEXT("EmailTemplateId")); + if (EmailTemplateIdValue.IsValid() && !EmailTemplateIdValue->IsNull()) + { + FString TmpValue; + if (EmailTemplateIdValue->TryGetString(TmpValue)) { EmailTemplateId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSendCustomAccountRecoveryEmailResult::~FSendCustomAccountRecoveryEmailResult() +{ + +} + +void PlayFab::ServerModels::FSendCustomAccountRecoveryEmailResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSendCustomAccountRecoveryEmailResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSendEmailFromTemplateRequest::~FSendEmailFromTemplateRequest() +{ + +} + +void PlayFab::ServerModels::FSendEmailFromTemplateRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("EmailTemplateId")); writer->WriteValue(EmailTemplateId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSendEmailFromTemplateRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailTemplateIdValue = obj->TryGetField(TEXT("EmailTemplateId")); + if (EmailTemplateIdValue.IsValid() && !EmailTemplateIdValue->IsNull()) + { + FString TmpValue; + if (EmailTemplateIdValue->TryGetString(TmpValue)) { EmailTemplateId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSendEmailFromTemplateResult::~FSendEmailFromTemplateResult() +{ + +} + +void PlayFab::ServerModels::FSendEmailFromTemplateResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSendEmailFromTemplateResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSendPushNotificationRequest::~FSendPushNotificationRequest() +{ + //if (Package != nullptr) delete Package; + +} + +void PlayFab::ServerModels::FSendPushNotificationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdvancedPlatformDelivery.Num() != 0) + { + writer->WriteArrayStart(TEXT("AdvancedPlatformDelivery")); + for (const FAdvancedPushPlatformMsg& item : AdvancedPlatformDelivery) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + if (Package.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Package")); Package->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Recipient")); writer->WriteValue(Recipient); + + if (Subject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Subject")); writer->WriteValue(Subject); } + + if (TargetPlatforms.Num() != 0) + { + writer->WriteArrayStart(TEXT("TargetPlatforms")); + for (const PushNotificationPlatform& item : TargetPlatforms) + writePushNotificationPlatformEnumJSON(item, writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSendPushNotificationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AdvancedPlatformDeliveryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AdvancedPlatformDelivery")); + for (int32 Idx = 0; Idx < AdvancedPlatformDeliveryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AdvancedPlatformDeliveryArray[Idx]; + AdvancedPlatformDelivery.Add(FAdvancedPushPlatformMsg(CurrentItem->AsObject())); + } + + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + const TSharedPtr PackageValue = obj->TryGetField(TEXT("Package")); + if (PackageValue.IsValid() && !PackageValue->IsNull()) + { + Package = MakeShareable(new FPushNotificationPackage(PackageValue->AsObject())); + } + + const TSharedPtr RecipientValue = obj->TryGetField(TEXT("Recipient")); + if (RecipientValue.IsValid() && !RecipientValue->IsNull()) + { + FString TmpValue; + if (RecipientValue->TryGetString(TmpValue)) { Recipient = TmpValue; } + } + + const TSharedPtr SubjectValue = obj->TryGetField(TEXT("Subject")); + if (SubjectValue.IsValid() && !SubjectValue->IsNull()) + { + FString TmpValue; + if (SubjectValue->TryGetString(TmpValue)) { Subject = TmpValue; } + } + + const TArray>&TargetPlatformsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("TargetPlatforms")); + for (int32 Idx = 0; Idx < TargetPlatformsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = TargetPlatformsArray[Idx]; + TargetPlatforms.Add(readPushNotificationPlatformFromValue(CurrentItem)); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FSendPushNotificationResult::~FSendPushNotificationResult() +{ + +} + +void PlayFab::ServerModels::FSendPushNotificationResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSendPushNotificationResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetFriendTagsRequest::~FSetFriendTagsRequest() +{ + +} + +void PlayFab::ServerModels::FSetFriendTagsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetFriendTagsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetGameServerInstanceDataRequest::~FSetGameServerInstanceDataRequest() +{ + +} + +void PlayFab::ServerModels::FSetGameServerInstanceDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GameServerData")); writer->WriteValue(GameServerData); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetGameServerInstanceDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameServerDataValue = obj->TryGetField(TEXT("GameServerData")); + if (GameServerDataValue.IsValid() && !GameServerDataValue->IsNull()) + { + FString TmpValue; + if (GameServerDataValue->TryGetString(TmpValue)) { GameServerData = TmpValue; } + } + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetGameServerInstanceDataResult::~FSetGameServerInstanceDataResult() +{ + +} + +void PlayFab::ServerModels::FSetGameServerInstanceDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetGameServerInstanceDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetGameServerInstanceStateRequest::~FSetGameServerInstanceStateRequest() +{ + +} + +void PlayFab::ServerModels::FSetGameServerInstanceStateRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteIdentifierPrefix(TEXT("State")); writeGameInstanceStateEnumJSON(State, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetGameServerInstanceStateRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + State = readGameInstanceStateFromValue(obj->TryGetField(TEXT("State"))); + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetGameServerInstanceStateResult::~FSetGameServerInstanceStateResult() +{ + +} + +void PlayFab::ServerModels::FSetGameServerInstanceStateResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetGameServerInstanceStateResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetGameServerInstanceTagsRequest::~FSetGameServerInstanceTagsRequest() +{ + +} + +void PlayFab::ServerModels::FSetGameServerInstanceTagsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteObjectStart(TEXT("Tags")); + for (TMap::TConstIterator It(Tags); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetGameServerInstanceTagsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + const TSharedPtr* TagsObject; + if (obj->TryGetObjectField(TEXT("Tags"), TagsObject)) + { + for (TMap>::TConstIterator It((*TagsObject)->Values); It; ++It) + { + Tags.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetGameServerInstanceTagsResult::~FSetGameServerInstanceTagsResult() +{ + +} + +void PlayFab::ServerModels::FSetGameServerInstanceTagsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetGameServerInstanceTagsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetPlayerSecretRequest::~FSetPlayerSecretRequest() +{ + +} + +void PlayFab::ServerModels::FSetPlayerSecretRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetPlayerSecretRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetPlayerSecretResult::~FSetPlayerSecretResult() +{ + +} + +void PlayFab::ServerModels::FSetPlayerSecretResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetPlayerSecretResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetPublisherDataRequest::~FSetPublisherDataRequest() +{ + +} + +void PlayFab::ServerModels::FSetPublisherDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetPublisherDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetPublisherDataResult::~FSetPublisherDataResult() +{ + +} + +void PlayFab::ServerModels::FSetPublisherDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetPublisherDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetTitleDataRequest::~FSetTitleDataRequest() +{ + +} + +void PlayFab::ServerModels::FSetTitleDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetTitleDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetTitleDataResult::~FSetTitleDataResult() +{ + +} + +void PlayFab::ServerModels::FSetTitleDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetTitleDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FStatisticUpdate::~FStatisticUpdate() +{ + +} + +void PlayFab::ServerModels::FStatisticUpdate::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FStatisticUpdate::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSubtractCharacterVirtualCurrencyRequest::~FSubtractCharacterVirtualCurrencyRequest() +{ + +} + +void PlayFab::ServerModels::FSubtractCharacterVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSubtractCharacterVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSubtractUserVirtualCurrencyRequest::~FSubtractUserVirtualCurrencyRequest() +{ + +} + +void PlayFab::ServerModels::FSubtractUserVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSubtractUserVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUnlockContainerInstanceRequest::~FUnlockContainerInstanceRequest() +{ + +} + +void PlayFab::ServerModels::FUnlockContainerInstanceRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ContainerItemInstanceId")); writer->WriteValue(ContainerItemInstanceId); + + if (KeyItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KeyItemInstanceId")); writer->WriteValue(KeyItemInstanceId); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUnlockContainerInstanceRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ContainerItemInstanceIdValue = obj->TryGetField(TEXT("ContainerItemInstanceId")); + if (ContainerItemInstanceIdValue.IsValid() && !ContainerItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ContainerItemInstanceIdValue->TryGetString(TmpValue)) { ContainerItemInstanceId = TmpValue; } + } + + const TSharedPtr KeyItemInstanceIdValue = obj->TryGetField(TEXT("KeyItemInstanceId")); + if (KeyItemInstanceIdValue.IsValid() && !KeyItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (KeyItemInstanceIdValue->TryGetString(TmpValue)) { KeyItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUnlockContainerItemRequest::~FUnlockContainerItemRequest() +{ + +} + +void PlayFab::ServerModels::FUnlockContainerItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ContainerItemId")); writer->WriteValue(ContainerItemId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUnlockContainerItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ContainerItemIdValue = obj->TryGetField(TEXT("ContainerItemId")); + if (ContainerItemIdValue.IsValid() && !ContainerItemIdValue->IsNull()) + { + FString TmpValue; + if (ContainerItemIdValue->TryGetString(TmpValue)) { ContainerItemId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUnlockContainerItemResult::~FUnlockContainerItemResult() +{ + +} + +void PlayFab::ServerModels::FUnlockContainerItemResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GrantedItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("GrantedItems")); + for (const FItemInstance& item : GrantedItems) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (UnlockedItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnlockedItemInstanceId")); writer->WriteValue(UnlockedItemInstanceId); } + + if (UnlockedWithItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnlockedWithItemInstanceId")); writer->WriteValue(UnlockedWithItemInstanceId); } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUnlockContainerItemResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GrantedItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GrantedItems")); + for (int32 Idx = 0; Idx < GrantedItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GrantedItemsArray[Idx]; + GrantedItems.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr UnlockedItemInstanceIdValue = obj->TryGetField(TEXT("UnlockedItemInstanceId")); + if (UnlockedItemInstanceIdValue.IsValid() && !UnlockedItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (UnlockedItemInstanceIdValue->TryGetString(TmpValue)) { UnlockedItemInstanceId = TmpValue; } + } + + const TSharedPtr UnlockedWithItemInstanceIdValue = obj->TryGetField(TEXT("UnlockedWithItemInstanceId")); + if (UnlockedWithItemInstanceIdValue.IsValid() && !UnlockedWithItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (UnlockedWithItemInstanceIdValue->TryGetString(TmpValue)) { UnlockedWithItemInstanceId = TmpValue; } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateAvatarUrlRequest::~FUpdateAvatarUrlRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateAvatarUrlRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ImageUrl")); writer->WriteValue(ImageUrl); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateAvatarUrlRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ImageUrlValue = obj->TryGetField(TEXT("ImageUrl")); + if (ImageUrlValue.IsValid() && !ImageUrlValue->IsNull()) + { + FString TmpValue; + if (ImageUrlValue->TryGetString(TmpValue)) { ImageUrl = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateBanRequest::~FUpdateBanRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateBanRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Active.notNull()) { writer->WriteIdentifierPrefix(TEXT("Active")); writer->WriteValue(Active); } + + writer->WriteIdentifierPrefix(TEXT("BanId")); writer->WriteValue(BanId); + + if (Expires.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); } + + if (IPAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IPAddress")); writer->WriteValue(IPAddress); } + + if (MACAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MACAddress")); writer->WriteValue(MACAddress); } + + if (Permanent.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permanent")); writer->WriteValue(Permanent); } + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateBanRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActiveValue = obj->TryGetField(TEXT("Active")); + if (ActiveValue.IsValid() && !ActiveValue->IsNull()) + { + bool TmpValue; + if (ActiveValue->TryGetBool(TmpValue)) { Active = TmpValue; } + } + + const TSharedPtr BanIdValue = obj->TryGetField(TEXT("BanId")); + if (BanIdValue.IsValid() && !BanIdValue->IsNull()) + { + FString TmpValue; + if (BanIdValue->TryGetString(TmpValue)) { BanId = TmpValue; } + } + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr IPAddressValue = obj->TryGetField(TEXT("IPAddress")); + if (IPAddressValue.IsValid() && !IPAddressValue->IsNull()) + { + FString TmpValue; + if (IPAddressValue->TryGetString(TmpValue)) { IPAddress = TmpValue; } + } + + const TSharedPtr MACAddressValue = obj->TryGetField(TEXT("MACAddress")); + if (MACAddressValue.IsValid() && !MACAddressValue->IsNull()) + { + FString TmpValue; + if (MACAddressValue->TryGetString(TmpValue)) { MACAddress = TmpValue; } + } + + const TSharedPtr PermanentValue = obj->TryGetField(TEXT("Permanent")); + if (PermanentValue.IsValid() && !PermanentValue->IsNull()) + { + bool TmpValue; + if (PermanentValue->TryGetBool(TmpValue)) { Permanent = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateBansRequest::~FUpdateBansRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateBansRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Bans")); + for (const FUpdateBanRequest& item : Bans) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateBansRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BansArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Bans")); + for (int32 Idx = 0; Idx < BansArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BansArray[Idx]; + Bans.Add(FUpdateBanRequest(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateBansResult::~FUpdateBansResult() +{ + +} + +void PlayFab::ServerModels::FUpdateBansResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateBansResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateCharacterDataRequest::~FUpdateCharacterDataRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateCharacterDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateCharacterDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateCharacterDataResult::~FUpdateCharacterDataResult() +{ + +} + +void PlayFab::ServerModels::FUpdateCharacterDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateCharacterDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateCharacterStatisticsRequest::~FUpdateCharacterStatisticsRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateCharacterStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (CharacterStatistics.Num() != 0) + { + writer->WriteObjectStart(TEXT("CharacterStatistics")); + for (TMap::TConstIterator It(CharacterStatistics); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateCharacterStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* CharacterStatisticsObject; + if (obj->TryGetObjectField(TEXT("CharacterStatistics"), CharacterStatisticsObject)) + { + for (TMap>::TConstIterator It((*CharacterStatisticsObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + CharacterStatistics.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateCharacterStatisticsResult::~FUpdateCharacterStatisticsResult() +{ + +} + +void PlayFab::ServerModels::FUpdateCharacterStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateCharacterStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdatePlayerStatisticsRequest::~FUpdatePlayerStatisticsRequest() +{ + +} + +void PlayFab::ServerModels::FUpdatePlayerStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ForceUpdate.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceUpdate")); writer->WriteValue(ForceUpdate); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticUpdate& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdatePlayerStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ForceUpdateValue = obj->TryGetField(TEXT("ForceUpdate")); + if (ForceUpdateValue.IsValid() && !ForceUpdateValue->IsNull()) + { + bool TmpValue; + if (ForceUpdateValue->TryGetBool(TmpValue)) { ForceUpdate = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticUpdate(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdatePlayerStatisticsResult::~FUpdatePlayerStatisticsResult() +{ + +} + +void PlayFab::ServerModels::FUpdatePlayerStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdatePlayerStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateSharedGroupDataRequest::~FUpdateSharedGroupDataRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateSharedGroupDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateSharedGroupDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateSharedGroupDataResult::~FUpdateSharedGroupDataResult() +{ + +} + +void PlayFab::ServerModels::FUpdateSharedGroupDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateSharedGroupDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateUserDataRequest::~FUpdateUserDataRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateUserDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateUserDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateUserDataResult::~FUpdateUserDataResult() +{ + +} + +void PlayFab::ServerModels::FUpdateUserDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateUserDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateUserInternalDataRequest::~FUpdateUserInternalDataRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateUserInternalDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateUserInternalDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateUserInventoryItemDataRequest::~FUpdateUserInventoryItemDataRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateUserInventoryItemDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateUserInventoryItemDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FWriteEventResponse::~FWriteEventResponse() +{ + +} + +void PlayFab::ServerModels::FWriteEventResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EventId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EventId")); writer->WriteValue(EventId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FWriteEventResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EventIdValue = obj->TryGetField(TEXT("EventId")); + if (EventIdValue.IsValid() && !EventIdValue->IsNull()) + { + FString TmpValue; + if (EventIdValue->TryGetString(TmpValue)) { EventId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FWriteServerCharacterEventRequest::~FWriteServerCharacterEventRequest() +{ + +} + +void PlayFab::ServerModels::FWriteServerCharacterEventRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.Num() != 0) + { + writer->WriteObjectStart(TEXT("Body")); + for (TMap::TConstIterator It(Body); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("EventName")); writer->WriteValue(EventName); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FWriteServerCharacterEventRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* BodyObject; + if (obj->TryGetObjectField(TEXT("Body"), BodyObject)) + { + for (TMap>::TConstIterator It((*BodyObject)->Values); It; ++It) + { + Body.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr EventNameValue = obj->TryGetField(TEXT("EventName")); + if (EventNameValue.IsValid() && !EventNameValue->IsNull()) + { + FString TmpValue; + if (EventNameValue->TryGetString(TmpValue)) { EventName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + +PlayFab::ServerModels::FWriteServerPlayerEventRequest::~FWriteServerPlayerEventRequest() +{ + +} + +void PlayFab::ServerModels::FWriteServerPlayerEventRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.Num() != 0) + { + writer->WriteObjectStart(TEXT("Body")); + for (TMap::TConstIterator It(Body); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("EventName")); writer->WriteValue(EventName); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FWriteServerPlayerEventRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* BodyObject; + if (obj->TryGetObjectField(TEXT("Body"), BodyObject)) + { + for (TMap>::TConstIterator It((*BodyObject)->Values); It; ++It) + { + Body.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + const TSharedPtr EventNameValue = obj->TryGetField(TEXT("EventName")); + if (EventNameValue.IsValid() && !EventNameValue->IsNull()) + { + FString TmpValue; + if (EventNameValue->TryGetString(TmpValue)) { EventName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + +PlayFab::ServerModels::FWriteTitleEventRequest::~FWriteTitleEventRequest() +{ + +} + +void PlayFab::ServerModels::FWriteTitleEventRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.Num() != 0) + { + writer->WriteObjectStart(TEXT("Body")); + for (TMap::TConstIterator It(Body); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("EventName")); writer->WriteValue(EventName); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FWriteTitleEventRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* BodyObject; + if (obj->TryGetObjectField(TEXT("Body"), BodyObject)) + { + for (TMap>::TConstIterator It((*BodyObject)->Values); It; ++It) + { + Body.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + const TSharedPtr EventNameValue = obj->TryGetField(TEXT("EventName")); + if (EventNameValue.IsValid() && !EventNameValue->IsNull()) + { + FString TmpValue; + if (EventNameValue->TryGetString(TmpValue)) { EventName = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabSettings.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabSettings.cpp new file mode 100644 index 000000000..14c92e81a --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabSettings.cpp @@ -0,0 +1,97 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFabSettings.h" +#include "PlayFabCommon.h" + +namespace PlayFab +{ + const FString PlayFabSettings::sdkVersion = IPlayFabCommonModuleInterface::Get().GetSdkVersion(); + const FString PlayFabSettings::buildIdentifier = IPlayFabCommonModuleInterface::Get().GetBuildIdentifier(); + const FString PlayFabSettings::versionString = IPlayFabCommonModuleInterface::Get().GetVersionString(); + + const FString PlayFabSettings::AD_TYPE_IDFA = IPlayFabCommonModuleInterface::Get().GetAD_TYPE_IDFA(); + const FString PlayFabSettings::AD_TYPE_ANDROID_ID = IPlayFabCommonModuleInterface::Get().GetAD_TYPE_ANDROID_ID(); + + // Getters + FString PlayFabSettings::GetServerURL() + { + return IPlayFabCommonModuleInterface::Get().GetServerURL(); + } + FString PlayFabSettings::GetProductionEnvironmentURL() + { + return IPlayFabCommonModuleInterface::Get().GetProductionEnvironmentURL(); + } + FString PlayFabSettings::GetTitleId() + { + return IPlayFabCommonModuleInterface::Get().GetTitleId(); + } + FString PlayFabSettings::GetClientSessionTicket() + { + return IPlayFabCommonModuleInterface::Get().GetClientSessionTicket(); + } + FString PlayFabSettings::GetDeveloperSecretKey() + { + return IPlayFabCommonModuleInterface::Get().GetDeveloperSecretKey(); + } + FString PlayFabSettings::GetEntityToken() + { + return IPlayFabCommonModuleInterface::Get().GetEntityToken(); + } + FString PlayFabSettings::GetAdvertisingIdType() + { + return IPlayFabCommonModuleInterface::Get().GetAdvertisingIdType(); + } + FString PlayFabSettings::GetAdvertisingIdValue() + { + return IPlayFabCommonModuleInterface::Get().GetAdvertisingIdValue(); + } + bool PlayFabSettings::GetDisableAdvertising() + { + return IPlayFabCommonModuleInterface::Get().GetDisableAdvertising(); + } + FString PlayFabSettings::GetUrl(const FString& callPath) + { + return IPlayFabCommonModuleInterface::Get().GetUrl(callPath); + } + + // Setters + void PlayFabSettings::SetServerURL(const FString& serverURL) + { + IPlayFabCommonModuleInterface::Get().SetServerURL(serverURL); + } + void PlayFabSettings::SetProductionEnvironmentURL(const FString& productionEnvironmentURL) + { + IPlayFabCommonModuleInterface::Get().SetProductionEnvironmentURL(productionEnvironmentURL); + } + void PlayFabSettings::SetTitleId(const FString& titleId) + { + IPlayFabCommonModuleInterface::Get().SetTitleId(titleId); + } + void PlayFabSettings::SetClientSessionTicket(const FString& clientSessionTicket) + { + IPlayFabCommonModuleInterface::Get().SetClientSessionTicket(clientSessionTicket); + } + void PlayFabSettings::SetDeveloperSecretKey(const FString& developerSecretKey) + { + IPlayFabCommonModuleInterface::Get().SetDeveloperSecretKey(developerSecretKey); + } + void PlayFabSettings::SetEntityToken(const FString& entityToken) + { + IPlayFabCommonModuleInterface::Get().SetEntityToken(entityToken); + } + void PlayFabSettings::SetAdvertisingIdType(const FString& advertisingIdType) + { + IPlayFabCommonModuleInterface::Get().SetAdvertisingIdType(advertisingIdType); + } + void PlayFabSettings::SetAdvertisingIdValue(const FString& advertisingIdValue) + { + IPlayFabCommonModuleInterface::Get().SetAdvertisingIdValue(advertisingIdValue); + } + void PlayFabSettings::SetDisableAdvertising(bool disableAdvertising) + { + IPlayFabCommonModuleInterface::Get().SetDisableAdvertising(disableAdvertising); + } +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/PlayFab.cpp b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/PlayFab.cpp new file mode 100644 index 000000000..b8c1bb817 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Private/PlayFab.cpp @@ -0,0 +1,82 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFab.h" + +#include "PlayFabSettings.h" + +// Api's +#include "Core/PlayFabAdminAPI.h" +#include "Core/PlayFabClientAPI.h" +#include "Core/PlayFabMatchmakerAPI.h" +#include "Core/PlayFabServerAPI.h" +#include "Core/PlayFabAuthenticationAPI.h" +#include "Core/PlayFabCloudScriptAPI.h" +#include "Core/PlayFabDataAPI.h" +#include "Core/PlayFabEventsAPI.h" +#include "Core/PlayFabGroupsAPI.h" +#include "Core/PlayFabLocalizationAPI.h" +#include "Core/PlayFabProfilesAPI.h" + +DEFINE_LOG_CATEGORY(LogPlayFab); + +class FPlayFabModule : public IPlayFabModuleInterface +{ + /** IModuleInterface implementation */ + virtual void StartupModule() override; + virtual void ShutdownModule() override; + + FString GetTitleId() const override { return PlayFab::PlayFabSettings::GetTitleId(); }; + + PlayFabAdminPtr GetAdminAPI() const override { return AdminAPI; }; + PlayFabClientPtr GetClientAPI() const override { return ClientAPI; }; + PlayFabMatchmakerPtr GetMatchmakerAPI() const override { return MatchmakerAPI; }; + PlayFabServerPtr GetServerAPI() const override { return ServerAPI; }; + PlayFabAuthenticationPtr GetAuthenticationAPI() const override { return AuthenticationAPI; }; + PlayFabCloudScriptPtr GetCloudScriptAPI() const override { return CloudScriptAPI; }; + PlayFabDataPtr GetDataAPI() const override { return DataAPI; }; + PlayFabEventsPtr GetEventsAPI() const override { return EventsAPI; }; + PlayFabGroupsPtr GetGroupsAPI() const override { return GroupsAPI; }; + PlayFabLocalizationPtr GetLocalizationAPI() const override { return LocalizationAPI; }; + PlayFabProfilesPtr GetProfilesAPI() const override { return ProfilesAPI; }; + + PlayFabAdminPtr AdminAPI; + PlayFabClientPtr ClientAPI; + PlayFabMatchmakerPtr MatchmakerAPI; + PlayFabServerPtr ServerAPI; + PlayFabAuthenticationPtr AuthenticationAPI; + PlayFabCloudScriptPtr CloudScriptAPI; + PlayFabDataPtr DataAPI; + PlayFabEventsPtr EventsAPI; + PlayFabGroupsPtr GroupsAPI; + PlayFabLocalizationPtr LocalizationAPI; + PlayFabProfilesPtr ProfilesAPI; + + +}; + +void FPlayFabModule::StartupModule() +{ + // create the API + + AdminAPI = MakeShareable(new PlayFab::UPlayFabAdminAPI()); + ClientAPI = MakeShareable(new PlayFab::UPlayFabClientAPI()); + MatchmakerAPI = MakeShareable(new PlayFab::UPlayFabMatchmakerAPI()); + ServerAPI = MakeShareable(new PlayFab::UPlayFabServerAPI()); + AuthenticationAPI = MakeShareable(new PlayFab::UPlayFabAuthenticationAPI()); + CloudScriptAPI = MakeShareable(new PlayFab::UPlayFabCloudScriptAPI()); + DataAPI = MakeShareable(new PlayFab::UPlayFabDataAPI()); + EventsAPI = MakeShareable(new PlayFab::UPlayFabEventsAPI()); + GroupsAPI = MakeShareable(new PlayFab::UPlayFabGroupsAPI()); + LocalizationAPI = MakeShareable(new PlayFab::UPlayFabLocalizationAPI()); + ProfilesAPI = MakeShareable(new PlayFab::UPlayFabProfilesAPI()); +} + +void FPlayFabModule::ShutdownModule() +{ + +} + +IMPLEMENT_MODULE(FPlayFabModule, PlayFabCpp) diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAdminAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAdminAPI.h new file mode 100644 index 000000000..9230e8add --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAdminAPI.h @@ -0,0 +1,735 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabAdminDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabAdminAPI + { + public: + DECLARE_DELEGATE_OneParam(FAbortTaskInstanceDelegate, const AdminModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FAddNewsDelegate, const AdminModels::FAddNewsResult&); + DECLARE_DELEGATE_OneParam(FAddPlayerTagDelegate, const AdminModels::FAddPlayerTagResult&); + DECLARE_DELEGATE_OneParam(FAddServerBuildDelegate, const AdminModels::FAddServerBuildResult&); + DECLARE_DELEGATE_OneParam(FAddUserVirtualCurrencyDelegate, const AdminModels::FModifyUserVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FAddVirtualCurrencyTypesDelegate, const AdminModels::FBlankResult&); + DECLARE_DELEGATE_OneParam(FBanUsersDelegate, const AdminModels::FBanUsersResult&); + DECLARE_DELEGATE_OneParam(FCheckLimitedEditionItemAvailabilityDelegate, const AdminModels::FCheckLimitedEditionItemAvailabilityResult&); + DECLARE_DELEGATE_OneParam(FCreateActionsOnPlayersInSegmentTaskDelegate, const AdminModels::FCreateTaskResult&); + DECLARE_DELEGATE_OneParam(FCreateCloudScriptTaskDelegate, const AdminModels::FCreateTaskResult&); + DECLARE_DELEGATE_OneParam(FCreatePlayerSharedSecretDelegate, const AdminModels::FCreatePlayerSharedSecretResult&); + DECLARE_DELEGATE_OneParam(FCreatePlayerStatisticDefinitionDelegate, const AdminModels::FCreatePlayerStatisticDefinitionResult&); + DECLARE_DELEGATE_OneParam(FDeleteContentDelegate, const AdminModels::FBlankResult&); + DECLARE_DELEGATE_OneParam(FDeleteMasterPlayerAccountDelegate, const AdminModels::FDeleteMasterPlayerAccountResult&); + DECLARE_DELEGATE_OneParam(FDeletePlayerDelegate, const AdminModels::FDeletePlayerResult&); + DECLARE_DELEGATE_OneParam(FDeletePlayerSharedSecretDelegate, const AdminModels::FDeletePlayerSharedSecretResult&); + DECLARE_DELEGATE_OneParam(FDeleteStoreDelegate, const AdminModels::FDeleteStoreResult&); + DECLARE_DELEGATE_OneParam(FDeleteTaskDelegate, const AdminModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FDeleteTitleDelegate, const AdminModels::FDeleteTitleResult&); + DECLARE_DELEGATE_OneParam(FExportMasterPlayerDataDelegate, const AdminModels::FExportMasterPlayerDataResult&); + DECLARE_DELEGATE_OneParam(FGetActionsOnPlayersInSegmentTaskInstanceDelegate, const AdminModels::FGetActionsOnPlayersInSegmentTaskInstanceResult&); + DECLARE_DELEGATE_OneParam(FGetAllSegmentsDelegate, const AdminModels::FGetAllSegmentsResult&); + DECLARE_DELEGATE_OneParam(FGetCatalogItemsDelegate, const AdminModels::FGetCatalogItemsResult&); + DECLARE_DELEGATE_OneParam(FGetCloudScriptRevisionDelegate, const AdminModels::FGetCloudScriptRevisionResult&); + DECLARE_DELEGATE_OneParam(FGetCloudScriptTaskInstanceDelegate, const AdminModels::FGetCloudScriptTaskInstanceResult&); + DECLARE_DELEGATE_OneParam(FGetCloudScriptVersionsDelegate, const AdminModels::FGetCloudScriptVersionsResult&); + DECLARE_DELEGATE_OneParam(FGetContentListDelegate, const AdminModels::FGetContentListResult&); + DECLARE_DELEGATE_OneParam(FGetContentUploadUrlDelegate, const AdminModels::FGetContentUploadUrlResult&); + DECLARE_DELEGATE_OneParam(FGetDataReportDelegate, const AdminModels::FGetDataReportResult&); + DECLARE_DELEGATE_OneParam(FGetMatchmakerGameInfoDelegate, const AdminModels::FGetMatchmakerGameInfoResult&); + DECLARE_DELEGATE_OneParam(FGetMatchmakerGameModesDelegate, const AdminModels::FGetMatchmakerGameModesResult&); + DECLARE_DELEGATE_OneParam(FGetPlayedTitleListDelegate, const AdminModels::FGetPlayedTitleListResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerIdFromAuthTokenDelegate, const AdminModels::FGetPlayerIdFromAuthTokenResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerProfileDelegate, const AdminModels::FGetPlayerProfileResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerSegmentsDelegate, const AdminModels::FGetPlayerSegmentsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerSharedSecretsDelegate, const AdminModels::FGetPlayerSharedSecretsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayersInSegmentDelegate, const AdminModels::FGetPlayersInSegmentResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerStatisticDefinitionsDelegate, const AdminModels::FGetPlayerStatisticDefinitionsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerStatisticVersionsDelegate, const AdminModels::FGetPlayerStatisticVersionsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerTagsDelegate, const AdminModels::FGetPlayerTagsResult&); + DECLARE_DELEGATE_OneParam(FGetPolicyDelegate, const AdminModels::FGetPolicyResponse&); + DECLARE_DELEGATE_OneParam(FGetPublisherDataDelegate, const AdminModels::FGetPublisherDataResult&); + DECLARE_DELEGATE_OneParam(FGetRandomResultTablesDelegate, const AdminModels::FGetRandomResultTablesResult&); + DECLARE_DELEGATE_OneParam(FGetServerBuildInfoDelegate, const AdminModels::FGetServerBuildInfoResult&); + DECLARE_DELEGATE_OneParam(FGetServerBuildUploadUrlDelegate, const AdminModels::FGetServerBuildUploadURLResult&); + DECLARE_DELEGATE_OneParam(FGetStoreItemsDelegate, const AdminModels::FGetStoreItemsResult&); + DECLARE_DELEGATE_OneParam(FGetTaskInstancesDelegate, const AdminModels::FGetTaskInstancesResult&); + DECLARE_DELEGATE_OneParam(FGetTasksDelegate, const AdminModels::FGetTasksResult&); + DECLARE_DELEGATE_OneParam(FGetTitleDataDelegate, const AdminModels::FGetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FGetTitleInternalDataDelegate, const AdminModels::FGetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserAccountInfoDelegate, const AdminModels::FLookupUserAccountInfoResult&); + DECLARE_DELEGATE_OneParam(FGetUserBansDelegate, const AdminModels::FGetUserBansResult&); + DECLARE_DELEGATE_OneParam(FGetUserDataDelegate, const AdminModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserInternalDataDelegate, const AdminModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserInventoryDelegate, const AdminModels::FGetUserInventoryResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherDataDelegate, const AdminModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherInternalDataDelegate, const AdminModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherReadOnlyDataDelegate, const AdminModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserReadOnlyDataDelegate, const AdminModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGrantItemsToUsersDelegate, const AdminModels::FGrantItemsToUsersResult&); + DECLARE_DELEGATE_OneParam(FIncrementLimitedEditionItemAvailabilityDelegate, const AdminModels::FIncrementLimitedEditionItemAvailabilityResult&); + DECLARE_DELEGATE_OneParam(FIncrementPlayerStatisticVersionDelegate, const AdminModels::FIncrementPlayerStatisticVersionResult&); + DECLARE_DELEGATE_OneParam(FListServerBuildsDelegate, const AdminModels::FListBuildsResult&); + DECLARE_DELEGATE_OneParam(FListVirtualCurrencyTypesDelegate, const AdminModels::FListVirtualCurrencyTypesResult&); + DECLARE_DELEGATE_OneParam(FModifyMatchmakerGameModesDelegate, const AdminModels::FModifyMatchmakerGameModesResult&); + DECLARE_DELEGATE_OneParam(FModifyServerBuildDelegate, const AdminModels::FModifyServerBuildResult&); + DECLARE_DELEGATE_OneParam(FRefundPurchaseDelegate, const AdminModels::FRefundPurchaseResponse&); + DECLARE_DELEGATE_OneParam(FRemovePlayerTagDelegate, const AdminModels::FRemovePlayerTagResult&); + DECLARE_DELEGATE_OneParam(FRemoveServerBuildDelegate, const AdminModels::FRemoveServerBuildResult&); + DECLARE_DELEGATE_OneParam(FRemoveVirtualCurrencyTypesDelegate, const AdminModels::FBlankResult&); + DECLARE_DELEGATE_OneParam(FResetCharacterStatisticsDelegate, const AdminModels::FResetCharacterStatisticsResult&); + DECLARE_DELEGATE_OneParam(FResetPasswordDelegate, const AdminModels::FResetPasswordResult&); + DECLARE_DELEGATE_OneParam(FResetUserStatisticsDelegate, const AdminModels::FResetUserStatisticsResult&); + DECLARE_DELEGATE_OneParam(FResolvePurchaseDisputeDelegate, const AdminModels::FResolvePurchaseDisputeResponse&); + DECLARE_DELEGATE_OneParam(FRevokeAllBansForUserDelegate, const AdminModels::FRevokeAllBansForUserResult&); + DECLARE_DELEGATE_OneParam(FRevokeBansDelegate, const AdminModels::FRevokeBansResult&); + DECLARE_DELEGATE_OneParam(FRevokeInventoryItemDelegate, const AdminModels::FRevokeInventoryResult&); + DECLARE_DELEGATE_OneParam(FRevokeInventoryItemsDelegate, const AdminModels::FRevokeInventoryItemsResult&); + DECLARE_DELEGATE_OneParam(FRunTaskDelegate, const AdminModels::FRunTaskResult&); + DECLARE_DELEGATE_OneParam(FSendAccountRecoveryEmailDelegate, const AdminModels::FSendAccountRecoveryEmailResult&); + DECLARE_DELEGATE_OneParam(FSetCatalogItemsDelegate, const AdminModels::FUpdateCatalogItemsResult&); + DECLARE_DELEGATE_OneParam(FSetPlayerSecretDelegate, const AdminModels::FSetPlayerSecretResult&); + DECLARE_DELEGATE_OneParam(FSetPublishedRevisionDelegate, const AdminModels::FSetPublishedRevisionResult&); + DECLARE_DELEGATE_OneParam(FSetPublisherDataDelegate, const AdminModels::FSetPublisherDataResult&); + DECLARE_DELEGATE_OneParam(FSetStoreItemsDelegate, const AdminModels::FUpdateStoreItemsResult&); + DECLARE_DELEGATE_OneParam(FSetTitleDataDelegate, const AdminModels::FSetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FSetTitleInternalDataDelegate, const AdminModels::FSetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FSetupPushNotificationDelegate, const AdminModels::FSetupPushNotificationResult&); + DECLARE_DELEGATE_OneParam(FSubtractUserVirtualCurrencyDelegate, const AdminModels::FModifyUserVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FUpdateBansDelegate, const AdminModels::FUpdateBansResult&); + DECLARE_DELEGATE_OneParam(FUpdateCatalogItemsDelegate, const AdminModels::FUpdateCatalogItemsResult&); + DECLARE_DELEGATE_OneParam(FUpdateCloudScriptDelegate, const AdminModels::FUpdateCloudScriptResult&); + DECLARE_DELEGATE_OneParam(FUpdatePlayerSharedSecretDelegate, const AdminModels::FUpdatePlayerSharedSecretResult&); + DECLARE_DELEGATE_OneParam(FUpdatePlayerStatisticDefinitionDelegate, const AdminModels::FUpdatePlayerStatisticDefinitionResult&); + DECLARE_DELEGATE_OneParam(FUpdatePolicyDelegate, const AdminModels::FUpdatePolicyResponse&); + DECLARE_DELEGATE_OneParam(FUpdateRandomResultTablesDelegate, const AdminModels::FUpdateRandomResultTablesResult&); + DECLARE_DELEGATE_OneParam(FUpdateStoreItemsDelegate, const AdminModels::FUpdateStoreItemsResult&); + DECLARE_DELEGATE_OneParam(FUpdateTaskDelegate, const AdminModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FUpdateUserDataDelegate, const AdminModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserInternalDataDelegate, const AdminModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherDataDelegate, const AdminModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherInternalDataDelegate, const AdminModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherReadOnlyDataDelegate, const AdminModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserReadOnlyDataDelegate, const AdminModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserTitleDisplayNameDelegate, const AdminModels::FUpdateUserTitleDisplayNameResult&); + + UPlayFabAdminAPI(); + ~UPlayFabAdminAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Abort an ongoing task instance. + * If the task instance has already completed, there will be no-op. + */ + bool AbortTaskInstance(AdminModels::FAbortTaskInstanceRequest& request, const FAbortTaskInstanceDelegate& SuccessDelegate = FAbortTaskInstanceDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Adds a new news item to the title's news feed + bool AddNews(AdminModels::FAddNewsRequest& request, const FAddNewsDelegate& SuccessDelegate = FAddNewsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + * This API will trigger a player_tag_added event and add a tag with the given TagName and PlayFabID to the corresponding player profile. TagName can be used for segmentation and it is limited to 256 characters. Also there is a limit on the number of tags a title can have. + */ + bool AddPlayerTag(AdminModels::FAddPlayerTagRequest& request, const FAddPlayerTagDelegate& SuccessDelegate = FAddPlayerTagDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the game server executable specified (previously uploaded - see GetServerBuildUploadUrl) to the set of those a + * client is permitted to request in a call to StartGame + */ + bool AddServerBuild(AdminModels::FAddServerBuildRequest& request, const FAddServerBuildDelegate& SuccessDelegate = FAddServerBuildDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Increments the specified virtual currency by the stated amount + bool AddUserVirtualCurrency(AdminModels::FAddUserVirtualCurrencyRequest& request, const FAddUserVirtualCurrencyDelegate& SuccessDelegate = FAddUserVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds one or more virtual currencies to the set defined for the title. Virtual Currencies have a maximum value of + * 2,147,483,647 when granted to a player. Any value over that will be discarded. + * This operation is additive. Any new currencies defined in the array will be added to the set of those available for the title, while any CurrencyCode identifiers matching existing ones in the game will be overwritten with the new values. + */ + bool AddVirtualCurrencyTypes(AdminModels::FAddVirtualCurrencyTypesRequest& request, const FAddVirtualCurrencyTypesDelegate& SuccessDelegate = FAddVirtualCurrencyTypesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + * The existence of each user will not be verified. When banning by IP or MAC address, multiple players may be affected, so use this feature with caution. Returns information about the new bans. + */ + bool BanUsers(AdminModels::FBanUsersRequest& request, const FBanUsersDelegate& SuccessDelegate = FBanUsersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Checks the global count for the limited edition item. + * This returns the total number of these items available. + */ + bool CheckLimitedEditionItemAvailability(AdminModels::FCheckLimitedEditionItemAvailabilityRequest& request, const FCheckLimitedEditionItemAvailabilityDelegate& SuccessDelegate = FCheckLimitedEditionItemAvailabilityDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Create an ActionsOnPlayersInSegment task, which iterates through all players in a segment to execute action. + * Task name is unique within a title. Using a task name that's already taken will cause a name conflict error. Too many create-task requests within a short time will cause a create conflict error. + */ + bool CreateActionsOnPlayersInSegmentTask(AdminModels::FCreateActionsOnPlayerSegmentTaskRequest& request, const FCreateActionsOnPlayersInSegmentTaskDelegate& SuccessDelegate = FCreateActionsOnPlayersInSegmentTaskDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Create a CloudScript task, which can run a CloudScript on a schedule. + * Task name is unique within a title. Using a task name that's already taken will cause a name conflict error. Too many create-task requests within a short time will cause a create conflict error. + */ + bool CreateCloudScriptTask(AdminModels::FCreateCloudScriptTaskRequest& request, const FCreateCloudScriptTaskDelegate& SuccessDelegate = FCreateCloudScriptTaskDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates a new Player Shared Secret Key. It may take up to 5 minutes for this key to become generally available after + * this API returns. + * Player Shared Secret Keys are used for the call to Client/GetTitlePublicKey, which exchanges the shared secret for an RSA CSP blob to be used to encrypt the payload of account creation requests when that API requires a signature header. + */ + bool CreatePlayerSharedSecret(AdminModels::FCreatePlayerSharedSecretRequest& request, const FCreatePlayerSharedSecretDelegate& SuccessDelegate = FCreatePlayerSharedSecretDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds a new player statistic configuration to the title, optionally allowing the developer to specify a reset interval + * and an aggregation method. + * Statistics are numeric values, with each statistic in the title also generating a leaderboard. The ResetInterval enables automatically resetting leaderboards on a specified interval. Upon reset, the statistic updates to a new version with no values (effectively removing all players from the leaderboard). The previous version's statistic values are also archived for retrieval, if needed (see GetPlayerStatisticVersions). Statistics not created via a call to CreatePlayerStatisticDefinition by default have a VersionChangeInterval of Never, meaning they do not reset on a schedule, but they can be set to do so via a call to UpdatePlayerStatisticDefinition. Once a statistic has been reset (sometimes referred to as versioned or incremented), the now-previous version can still be written to for up a short, pre-defined period (currently 10 seconds), to prevent issues with levels completing around the time of the reset. Also, once reset, the historical statistics for players in the title may be retrieved using the URL specified in the version information (GetPlayerStatisticVersions). The AggregationMethod determines what action is taken when a new statistic value is submitted - always update with the new value (Last), use the highest of the old and new values (Max), use the smallest (Min), or add them together (Sum). + */ + bool CreatePlayerStatisticDefinition(AdminModels::FCreatePlayerStatisticDefinitionRequest& request, const FCreatePlayerStatisticDefinitionDelegate& SuccessDelegate = FCreatePlayerStatisticDefinitionDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Delete a content file from the title. When deleting a file that does not exist, it returns success. + bool DeleteContent(AdminModels::FDeleteContentRequest& request, const FDeleteContentDelegate& SuccessDelegate = FDeleteContentDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes a master player account entirely from all titles and deletes all associated data + * Deletes all data associated with the master player account, including data from all titles the player has played, such as statistics, custom data, inventory, purchases, virtual currency balances, characters, group memberships, publisher data, credential data, account linkages, friends list and PlayStream event history. Removes the player from all leaderboards and player search indexes. Note, this API queues the player for deletion and returns a receipt immediately. Record the receipt ID for future reference. It may take some time before all player data is fully deleted. Upon completion of the deletion, an email will be sent to the notification email address configured for the title confirming the deletion. Until the player data is fully deleted, attempts to recreate the player with the same user account in the same title will fail with the 'AccountDeleted' error. It is highly recommended to know the impact of the deletion by calling GetPlayedTitleList, before calling this API. + */ + bool DeleteMasterPlayerAccount(AdminModels::FDeleteMasterPlayerAccountRequest& request, const FDeleteMasterPlayerAccountDelegate& SuccessDelegate = FDeleteMasterPlayerAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes a user's player account from a title and deletes all associated data + * Deletes all data associated with the player, including statistics, custom data, inventory, purchases, virtual currency balances, characters and shared group memberships. Removes the player from all leaderboards and player search indexes. Does not delete PlayStream event history associated with the player. Does not delete the publisher user account that created the player in the title nor associated data such as username, password, email address, account linkages, or friends list. Note, this API queues the player for deletion and returns immediately. It may take several minutes or more before all player data is fully deleted. Until the player data is fully deleted, attempts to recreate the player with the same user account in the same title will fail with the 'AccountDeleted' error. + */ + bool DeletePlayer(AdminModels::FDeletePlayerRequest& request, const FDeletePlayerDelegate& SuccessDelegate = FDeletePlayerDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes an existing Player Shared Secret Key. It may take up to 5 minutes for this delete to be reflected after this API + * returns. + * Player Shared Secret Keys are used for the call to Client/GetTitlePublicKey, which exchanges the shared secret for an RSA CSP blob to be used to encrypt the payload of account creation requests when that API requires a signature header. + */ + bool DeletePlayerSharedSecret(AdminModels::FDeletePlayerSharedSecretRequest& request, const FDeletePlayerSharedSecretDelegate& SuccessDelegate = FDeletePlayerSharedSecretDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes an existing virtual item store + * This non-reversible operation will permanently delete the requested store. + */ + bool DeleteStore(AdminModels::FDeleteStoreRequest& request, const FDeleteStoreDelegate& SuccessDelegate = FDeleteStoreDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Delete a task. + * After a task is deleted, for tracking purposes, the task instances belonging to this task will still remain. They will become orphaned and does not belongs to any task. Executions of any in-progress task instances will continue. If the task specified does not exist, the deletion is considered a success. + */ + bool DeleteTask(AdminModels::FDeleteTaskRequest& request, const FDeleteTaskDelegate& SuccessDelegate = FDeleteTaskDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Permanently deletes a title and all associated configuration + * Deletes all data associated with the title, including catalog, virtual currencies, leaderboard statistics, Cloud Script revisions, segment definitions, event rules, tasks, add-ons, secret keys, data encryption keys, and permission policies. Removes the title from its studio and removes all associated developer roles and permissions. Does not delete PlayStream event history associated with the title. Note, this API queues the title for deletion and returns immediately. It may take several hours or more before all title data is fully deleted. All player accounts in the title must be deleted before deleting the title. If any player accounts exist, the API will return a 'TitleContainsUserAccounts' error. Until the title data is fully deleted, attempts to call APIs with the title will fail with the 'TitleDeleted' error. + */ + + bool DeleteTitle(const FDeleteTitleDelegate& SuccessDelegate = FDeleteTitleDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Exports all associated data of a master player account + * Exports all data associated with the master player account, including data from all titles the player has played, such as statistics, custom data, inventory, purchases, virtual currency balances, characters, group memberships, publisher data, credential data, account linkages, friends list and PlayStream event history. Note, this API queues the player for export and returns a receipt immediately. Record the receipt ID for future reference. It may take some time before the export is available for download. Upon completion of the export, an email containing the URL to download the export dump will be sent to the notification email address configured for the title. + */ + bool ExportMasterPlayerData(AdminModels::FExportMasterPlayerDataRequest& request, const FExportMasterPlayerDataDelegate& SuccessDelegate = FExportMasterPlayerDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Get information about a ActionsOnPlayersInSegment task instance. + * The result includes detail information that's specific to an ActionsOnPlayersInSegment task. To get a list of task instances with generic basic information, use GetTaskInstances. + */ + bool GetActionsOnPlayersInSegmentTaskInstance(AdminModels::FGetTaskInstanceRequest& request, const FGetActionsOnPlayersInSegmentTaskInstanceDelegate& SuccessDelegate = FGetActionsOnPlayersInSegmentTaskInstanceDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as + * GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. + * Request has no paramaters. + */ + + bool GetAllSegments(const FGetAllSegmentsDelegate& SuccessDelegate = FGetAllSegmentsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the specified version of the title's catalog of virtual goods, including all defined properties + bool GetCatalogItems(AdminModels::FGetCatalogItemsRequest& request, const FGetCatalogItemsDelegate& SuccessDelegate = FGetCatalogItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Gets the contents and information of a specific Cloud Script revision. + bool GetCloudScriptRevision(AdminModels::FGetCloudScriptRevisionRequest& request, const FGetCloudScriptRevisionDelegate& SuccessDelegate = FGetCloudScriptRevisionDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Get detail information about a CloudScript task instance. + * The result includes detail information that's specific to a CloudScript tasks. To get a list of task instances with generic basic information, use GetTaskInstances. + */ + bool GetCloudScriptTaskInstance(AdminModels::FGetTaskInstanceRequest& request, const FGetCloudScriptTaskInstanceDelegate& SuccessDelegate = FGetCloudScriptTaskInstanceDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all the current cloud script versions. For each version, information about the current published and latest + * revisions is also listed. + */ + + bool GetCloudScriptVersions(const FGetCloudScriptVersionsDelegate& SuccessDelegate = FGetCloudScriptVersionsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // List all contents of the title and get statistics such as size + bool GetContentList(AdminModels::FGetContentListRequest& request, const FGetContentListDelegate& SuccessDelegate = FGetContentListDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the pre-signed URL for uploading a content file. A subsequent HTTP PUT to the returned URL uploads the + * content. Also, please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN + * rates apply. + */ + bool GetContentUploadUrl(AdminModels::FGetContentUploadUrlRequest& request, const FGetContentUploadUrlDelegate& SuccessDelegate = FGetContentUploadUrlDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves a download URL for the requested report + * Gets the download URL for the requested report data (in CSV form). The reports available through this API call are those available in the Game Manager, in the Analytics->Reports tab. + */ + bool GetDataReport(AdminModels::FGetDataReportRequest& request, const FGetDataReportDelegate& SuccessDelegate = FGetDataReportDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the details for a specific completed session, including links to standard out and standard error logs + bool GetMatchmakerGameInfo(AdminModels::FGetMatchmakerGameInfoRequest& request, const FGetMatchmakerGameInfoDelegate& SuccessDelegate = FGetMatchmakerGameInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the details of defined game modes for the specified game server executable + * These details are used by the PlayFab matchmaking service to determine if an existing Game Server Instance has room for additional users, and by the PlayFab game server management service to determine when a new Game Server Host should be created in order to prevent excess load on existing Hosts. + */ + bool GetMatchmakerGameModes(AdminModels::FGetMatchmakerGameModesRequest& request, const FGetMatchmakerGameModesDelegate& SuccessDelegate = FGetMatchmakerGameModesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Get the list of titles that the player has played + * Useful for identifying titles of which the player's data will be deleted by DeleteMasterPlayer. + */ + bool GetPlayedTitleList(AdminModels::FGetPlayedTitleListRequest& request, const FGetPlayedTitleListDelegate& SuccessDelegate = FGetPlayedTitleListDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Gets a player's ID from an auth token. + * Gets a player ID from an auth token. The token expires after 30 minutes and cannot be used to look up a player when expired. + */ + bool GetPlayerIdFromAuthToken(AdminModels::FGetPlayerIdFromAuthTokenRequest& request, const FGetPlayerIdFromAuthTokenDelegate& SuccessDelegate = FGetPlayerIdFromAuthTokenDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the player's profile + * This API allows for access to details regarding a user in the PlayFab service, usually for purposes of customer support. Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool GetPlayerProfile(AdminModels::FGetPlayerProfileRequest& request, const FGetPlayerProfileDelegate& SuccessDelegate = FGetPlayerProfileDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // List all segments that a player currently belongs to at this moment in time. + bool GetPlayerSegments(AdminModels::FGetPlayersSegmentsRequest& request, const FGetPlayerSegmentsDelegate& SuccessDelegate = FGetPlayerSegmentsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Returns all Player Shared Secret Keys including disabled and expired. + * Player Shared Secret Keys are used for the call to Client/GetTitlePublicKey, which exchanges the shared secret for an RSA CSP blob to be used to encrypt the payload of account creation requests when that API requires a signature header. + */ + + bool GetPlayerSharedSecrets(const FGetPlayerSharedSecretsDelegate& SuccessDelegate = FGetPlayerSharedSecretsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match + * the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span + * on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected + * in the results. AB Test segments are currently not supported by this operation. + * Initial request must contain at least a Segment ID. Subsequent requests must contain the Segment ID as well as the Continuation Token. Failure to send the Continuation Token will result in a new player segment list being generated. Each time the Continuation Token is passed in the length of the Total Seconds to Live is refreshed. If too much time passes between requests to the point that a subsequent request is past the Total Seconds to Live an error will be returned and paging will be terminated. This API is resource intensive and should not be used in scenarios which might generate high request volumes. Only one request to this API at a time should be made per title. Concurrent requests to the API may be rejected with the APIConcurrentRequestLimitExceeded error. + */ + bool GetPlayersInSegment(AdminModels::FGetPlayersInSegmentRequest& request, const FGetPlayersInSegmentDelegate& SuccessDelegate = FGetPlayersInSegmentDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the configuration information for all player statistics defined in the title, regardless of whether they have + * a reset interval. + */ + + bool GetPlayerStatisticDefinitions(const FGetPlayerStatisticDefinitionsDelegate& SuccessDelegate = FGetPlayerStatisticDefinitionsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the information on the available versions of the specified statistic. + bool GetPlayerStatisticVersions(AdminModels::FGetPlayerStatisticVersionsRequest& request, const FGetPlayerStatisticVersionsDelegate& SuccessDelegate = FGetPlayerStatisticVersionsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Get all tags with a given Namespace (optional) from a player profile. + * This API will return a list of canonical tags which includes both namespace and tag's name. If namespace is not provided, the result is a list of all canonical tags. TagName can be used for segmentation and Namespace is limited to 128 characters. + */ + bool GetPlayerTags(AdminModels::FGetPlayerTagsRequest& request, const FGetPlayerTagsDelegate& SuccessDelegate = FGetPlayerTagsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Gets the requested policy. + * Views the requested policy. Today, the only supported policy is 'ApiPolicy'. + */ + bool GetPolicy(AdminModels::FGetPolicyRequest& request, const FGetPolicyDelegate& SuccessDelegate = FGetPolicyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom publisher settings + * This API is designed to return publisher-specific values which can be read, but not written to, by the client. This data is shared across all titles assigned to a particular publisher, and can be used for cross-game coordination. Only titles assigned to a publisher can use this API. For more information email devrel@playfab.com. This AdminAPI call for getting title data guarantees no delay in between update and retrieval of newly set data. + */ + bool GetPublisherData(AdminModels::FGetPublisherDataRequest& request, const FGetPublisherDataDelegate& SuccessDelegate = FGetPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the random drop table configuration for the title + bool GetRandomResultTables(AdminModels::FGetRandomResultTablesRequest& request, const FGetRandomResultTablesDelegate& SuccessDelegate = FGetRandomResultTablesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the build details for the specified game server executable + bool GetServerBuildInfo(AdminModels::FGetServerBuildInfoRequest& request, const FGetServerBuildInfoDelegate& SuccessDelegate = FGetServerBuildInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the pre-authorized URL for uploading a game server package containing a build (does not enable the build for + * use - see AddServerBuild) + */ + bool GetServerBuildUploadUrl(AdminModels::FGetServerBuildUploadURLRequest& request, const FGetServerBuildUploadUrlDelegate& SuccessDelegate = FGetServerBuildUploadUrlDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the set of items defined for the specified store, including all prices defined + * A store contains an array of references to items defined in the catalog, along with the prices for the item, in both real world and virtual currencies. These prices act as an override to any prices defined in the catalog. In this way, the base definitions of the items may be defined in the catalog, with all associated properties, while the pricing can be set for each store, as needed. This allows for subsets of goods to be defined for different purposes (in order to simplify showing some, but not all catalog items to users, based upon different characteristics), along with unique prices. Note that all prices defined in the catalog and store definitions for the item are considered valid, and that a compromised client can be made to send a request for an item based upon any of these definitions. If no price is specified in the store for an item, the price set in the catalog should be displayed to the user. + */ + bool GetStoreItems(AdminModels::FGetStoreItemsRequest& request, const FGetStoreItemsDelegate& SuccessDelegate = FGetStoreItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Query for task instances by task, status, or time range. + * Only the most recent 100 task instances are returned, ordered by start time descending. The results are generic basic information for task instances. To get detail information specific to each task type, use Get*TaskInstance based on its corresponding task type. + */ + bool GetTaskInstances(AdminModels::FGetTaskInstancesRequest& request, const FGetTaskInstancesDelegate& SuccessDelegate = FGetTaskInstancesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Get definition information on a specified task or all tasks within a title. + bool GetTasks(AdminModels::FGetTasksRequest& request, const FGetTasksDelegate& SuccessDelegate = FGetTasksDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom title settings which can be read by the client + * This API method is designed to return title specific values which can be read by the client. For example, a developer could choose to store values which modify the user experience, such as enemy spawn rates, weapon strengths, movement speeds, etc. This allows a developer to update the title without the need to create,test, and ship a new build. Note that due to caching, there may up to a minute delay in between updating title data and a query returning the newest value. + */ + bool GetTitleData(AdminModels::FGetTitleDataRequest& request, const FGetTitleDataDelegate& SuccessDelegate = FGetTitleDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom title settings which cannot be read by the client + * This API method is designed to return title specific values which are accessible only by the server. These values can be used to tweak settings used by game servers and Cloud Scripts without the need to update and re-deploy. Note that due to caching, there may up to a minute delay in between updating title data and this query returning the newest value. + */ + bool GetTitleInternalData(AdminModels::FGetTitleDataRequest& request, const FGetTitleInternalDataDelegate& SuccessDelegate = FGetTitleInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the relevant details for a specified user, based upon a match against a supplied unique identifier + * This API allows for access to details regarding a user in the PlayFab service, usually for purposes of customer support. Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool GetUserAccountInfo(AdminModels::FLookupUserAccountInfoRequest& request, const FGetUserAccountInfoDelegate& SuccessDelegate = FGetUserAccountInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Gets all bans for a user. + * Get all bans for a user, including inactive and expired bans. + */ + bool GetUserBans(AdminModels::FGetUserBansRequest& request, const FGetUserBansDelegate& SuccessDelegate = FGetUserBansDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserData(AdminModels::FGetUserDataRequest& request, const FGetUserDataDelegate& SuccessDelegate = FGetUserDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which cannot be accessed by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserInternalData(AdminModels::FGetUserDataRequest& request, const FGetUserInternalDataDelegate& SuccessDelegate = FGetUserInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the specified user's current inventory of virtual goods + * All items currently in the user inventory will be returned, irrespective of how they were acquired (via purchasing, grants, coupons, etc.). Items that are expired, fully consumed, or are no longer valid are not considered to be in the user's current inventory, and so will not be not included. + */ + bool GetUserInventory(AdminModels::FGetUserInventoryRequest& request, const FGetUserInventoryDelegate& SuccessDelegate = FGetUserInventoryDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherData(AdminModels::FGetUserDataRequest& request, const FGetUserPublisherDataDelegate& SuccessDelegate = FGetUserPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which cannot be accessed by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherInternalData(AdminModels::FGetUserDataRequest& request, const FGetUserPublisherInternalDataDelegate& SuccessDelegate = FGetUserPublisherInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherReadOnlyData(AdminModels::FGetUserDataRequest& request, const FGetUserPublisherReadOnlyDataDelegate& SuccessDelegate = FGetUserPublisherReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserReadOnlyData(AdminModels::FGetUserDataRequest& request, const FGetUserReadOnlyDataDelegate& SuccessDelegate = FGetUserReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the specified items to the specified user inventories + * This function directly adds inventory items to user inventories. As a result of this operations, the user will not be charged any transaction fee, regardless of the inventory item catalog definition. Please note that the processing time for inventory grants and purchases increases fractionally the more items are in the inventory, and the more items are in the grant/purchase operation. + */ + bool GrantItemsToUsers(AdminModels::FGrantItemsToUsersRequest& request, const FGrantItemsToUsersDelegate& SuccessDelegate = FGrantItemsToUsersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Increases the global count for the given scarce resource. + * This operation will increment the global counter for the number of these items available. This number cannot be decremented, except by actual grants. + */ + bool IncrementLimitedEditionItemAvailability(AdminModels::FIncrementLimitedEditionItemAvailabilityRequest& request, const FIncrementLimitedEditionItemAvailabilityDelegate& SuccessDelegate = FIncrementLimitedEditionItemAvailabilityDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Resets the indicated statistic, removing all player entries for it and backing up the old values. + * Statistics are numeric values, with each statistic in the title also generating a leaderboard. When this call is made on a given statistic, this forces a reset of that statistic. Upon reset, the statistic updates to a new version with no values (effectively removing all players from the leaderboard). The previous version's statistic values are also archived for retrieval, if needed (see GetPlayerStatisticVersions). Statistics not created via a call to CreatePlayerStatisticDefinition by default have a VersionChangeInterval of Never, meaning they do not reset on a schedule, but they can be set to do so via a call to UpdatePlayerStatisticDefinition. Once a statistic has been reset (sometimes referred to as versioned or incremented), the now-previous version can still be written to for up a short, pre-defined period (currently 10 seconds), to prevent issues with levels completing around the time of the reset. Also, once reset, the historical statistics for players in the title may be retrieved using the URL specified in the version information (GetPlayerStatisticVersions). + */ + bool IncrementPlayerStatisticVersion(AdminModels::FIncrementPlayerStatisticVersionRequest& request, const FIncrementPlayerStatisticVersionDelegate& SuccessDelegate = FIncrementPlayerStatisticVersionDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the build details for all game server executables which are currently defined for the title + + bool ListServerBuilds(const FListServerBuildsDelegate& SuccessDelegate = FListServerBuildsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retuns the list of all defined virtual currencies for the title + + bool ListVirtualCurrencyTypes(const FListVirtualCurrencyTypesDelegate& SuccessDelegate = FListVirtualCurrencyTypesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the game server mode details for the specified game server executable + * These details are used by the PlayFab matchmaking service to determine if an existing Game Server Instance has room for additional users, and by the PlayFab game server management service to determine when a new Game Server Host should be created in order to prevent excess load on existing Hosts. This operation is not additive. Using it will cause the game mode definition for the game server executable in question to be created from scratch. If there is an existing game server mode definition for the given BuildVersion, it will be deleted and replaced with the data specified in this call. + */ + bool ModifyMatchmakerGameModes(AdminModels::FModifyMatchmakerGameModesRequest& request, const FModifyMatchmakerGameModesDelegate& SuccessDelegate = FModifyMatchmakerGameModesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Updates the build details for the specified game server executable + bool ModifyServerBuild(AdminModels::FModifyServerBuildRequest& request, const FModifyServerBuildDelegate& SuccessDelegate = FModifyServerBuildDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Attempts to process an order refund through the original real money payment provider. + bool RefundPurchase(AdminModels::FRefundPurchaseRequest& request, const FRefundPurchaseDelegate& SuccessDelegate = FRefundPurchaseDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + * This API will trigger a player_tag_removed event and remove a tag with the given TagName and PlayFabID from the corresponding player profile. TagName can be used for segmentation and it is limited to 256 characters + */ + bool RemovePlayerTag(AdminModels::FRemovePlayerTagRequest& request, const FRemovePlayerTagDelegate& SuccessDelegate = FRemovePlayerTagDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes the game server executable specified from the set of those a client is permitted to request in a call to + * StartGame + */ + bool RemoveServerBuild(AdminModels::FRemoveServerBuildRequest& request, const FRemoveServerBuildDelegate& SuccessDelegate = FRemoveServerBuildDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes one or more virtual currencies from the set defined for the title. + * Virtual currencies to be removed cannot have entries in any catalog nor store for the title. Note that this operation will not remove player balances for the removed currencies; if a deleted currency is recreated at any point, user balances will be in an undefined state. + */ + bool RemoveVirtualCurrencyTypes(AdminModels::FRemoveVirtualCurrencyTypesRequest& request, const FRemoveVirtualCurrencyTypesDelegate& SuccessDelegate = FRemoveVirtualCurrencyTypesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Completely removes all statistics for the specified character, for the current game + * Note that this action cannot be un-done. All statistics for this character will be deleted, removing the user from all leaderboards for the game. + */ + bool ResetCharacterStatistics(AdminModels::FResetCharacterStatisticsRequest& request, const FResetCharacterStatisticsDelegate& SuccessDelegate = FResetCharacterStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Reset a player's password for a given title. + * Resets a player's password taking in a new password based and validating the user based off of a token sent to the playerto their email. The token expires after 30 minutes. + */ + bool ResetPassword(AdminModels::FResetPasswordRequest& request, const FResetPasswordDelegate& SuccessDelegate = FResetPasswordDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Completely removes all statistics for the specified user, for the current game + * Note that this action cannot be un-done. All statistics for this user will be deleted, removing the user from all leaderboards for the game. + */ + bool ResetUserStatistics(AdminModels::FResetUserStatisticsRequest& request, const FResetUserStatisticsDelegate& SuccessDelegate = FResetUserStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Attempts to resolve a dispute with the original order's payment provider. + bool ResolvePurchaseDispute(AdminModels::FResolvePurchaseDisputeRequest& request, const FResolvePurchaseDisputeDelegate& SuccessDelegate = FResolvePurchaseDisputeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revoke all active bans for a user. + * Setting the active state of all non-expired bans for a user to Inactive. Expired bans with an Active state will be ignored, however. Returns information about applied updates only. + */ + bool RevokeAllBansForUser(AdminModels::FRevokeAllBansForUserRequest& request, const FRevokeAllBansForUserDelegate& SuccessDelegate = FRevokeAllBansForUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revoke all active bans specified with BanId. + * Setting the active state of all bans requested to Inactive regardless of whether that ban has already expired. BanIds that do not exist will be skipped. Returns information about applied updates only. + */ + bool RevokeBans(AdminModels::FRevokeBansRequest& request, const FRevokeBansDelegate& SuccessDelegate = FRevokeBansDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revokes access to an item in a user's inventory + * In cases where the inventory item in question is a "crate", and the items it contained have already been dispensed, this will not revoke access or otherwise remove the items which were dispensed. + */ + bool RevokeInventoryItem(AdminModels::FRevokeInventoryItemRequest& request, const FRevokeInventoryItemDelegate& SuccessDelegate = FRevokeInventoryItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revokes access for up to 25 items across multiple users and characters. + * In cases where the inventory item in question is a "crate", and the items it contained have already been dispensed, this will not revoke access or otherwise remove the items which were dispensed. + */ + bool RevokeInventoryItems(AdminModels::FRevokeInventoryItemsRequest& request, const FRevokeInventoryItemsDelegate& SuccessDelegate = FRevokeInventoryItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Run a task immediately regardless of its schedule. + * The returned task instance ID can be used to query for task execution status. + */ + bool RunTask(AdminModels::FRunTaskRequest& request, const FRunTaskDelegate& SuccessDelegate = FRunTaskDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to + * change the password.If an account recovery email template ID is provided, an email using the custom email template will + * be used. + * If the account in question is a "temporary" account (for example, one that was created via a call to LoginFromIOSDeviceID), thisfunction will have no effect. Only PlayFab accounts which have valid email addresses will be able to receive a password reset email using this API. + */ + bool SendAccountRecoveryEmail(AdminModels::FSendAccountRecoveryEmailRequest& request, const FSendAccountRecoveryEmailDelegate& SuccessDelegate = FSendAccountRecoveryEmailDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates the catalog configuration of all virtual goods for the specified catalog version + * This operation is not additive. Using it will cause the indicated catalog version to be created from scratch. If there is an existing catalog with the version number in question, it will be deleted and replaced with only the items specified in this call. + */ + bool SetCatalogItems(AdminModels::FUpdateCatalogItemsRequest& request, const FSetCatalogItemsDelegate& SuccessDelegate = FSetCatalogItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets or resets the player's secret. Player secrets are used to sign API requests. + * APIs that require signatures require that the player have a configured Player Secret Key that is used to sign all requests. Players that don't have a secret will be blocked from making API calls until it is configured. To create a signature header add a SHA256 hashed string containing UTF8 encoded JSON body as it will be sent to the server, the current time in UTC formatted to ISO 8601, and the players secret formatted as 'body.date.secret'. Place the resulting hash into the header X-PlayFab-Signature, along with a header X-PlayFab-Timestamp of the same UTC timestamp used in the signature. + */ + bool SetPlayerSecret(AdminModels::FSetPlayerSecretRequest& request, const FSetPlayerSecretDelegate& SuccessDelegate = FSetPlayerSecretDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Sets the currently published revision of a title Cloud Script + bool SetPublishedRevision(AdminModels::FSetPublishedRevisionRequest& request, const FSetPublishedRevisionDelegate& SuccessDelegate = FSetPublishedRevisionDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the key-value store of custom publisher settings + * This API is designed to store publisher-specific values which can be read, but not written to, by the client. This data is shared across all titles assigned to a particular publisher, and can be used for cross-game coordination. Only titles assigned to a publisher can use this API. This operation is additive. If a Key does not exist in the current dataset, it will be added with the specified Value. If it already exists, the Value for that key will be overwritten with the new Value. For more information email devrel@playfab.com + */ + bool SetPublisherData(AdminModels::FSetPublisherDataRequest& request, const FSetPublisherDataDelegate& SuccessDelegate = FSetPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets all the items in one virtual store + * This operation is not additive. Using it will cause the indicated virtual store to be created from scratch. If there is an existing store with the same storeId, it will be deleted and replaced with only the items specified in this call. A store contains an array of references to items defined inthe catalog, along with the prices for the item, in both real world and virtual currencies. These prices act as an override to any prices defined in the catalog. In this way, the base definitions of the items may be defined in the catalog, with all associated properties, while the pricing can be set for each store, as needed. This allows for subsets of goods to be defined for different purposes (in order to simplify showing some, but not all catalog items to users, based upon different characteristics), along with unique prices. Note that all prices defined in the catalog and store definitions for the item are considered valid, and that a compromised client can be made to send a request for an item based upon any of these definitions. If no price is specified in the store for an item, the price set in the catalog should be displayed to the user. + */ + bool SetStoreItems(AdminModels::FUpdateStoreItemsRequest& request, const FSetStoreItemsDelegate& SuccessDelegate = FSetStoreItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates and updates the key-value store of custom title settings which can be read by the client + * This API method is designed to store title specific values which can be read by the client. For example, a developer could choose to store values which modify the user experience, such as enemy spawn rates, weapon strengths, movement speeds, etc. This allows a developer to update the title without the need to create, test, and ship a new build. This operation is additive. If a Key does not exist in the current dataset, it will be added with the specified Value. If it already exists, the Value for that key will be overwritten with the new Value. + */ + bool SetTitleData(AdminModels::FSetTitleDataRequest& request, const FSetTitleDataDelegate& SuccessDelegate = FSetTitleDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the key-value store of custom title settings which cannot be read by the client + * This API method is designed to store title specific values which are accessible only by the server. These values can be used to tweak settings used by game servers and Cloud Scripts without the need to update and re-deploy. This operation is additive. If a Key does not exist in the current dataset, it will be added with the specified Value. If it already exists, the Value for that key will be overwritten with the new Value. + */ + bool SetTitleInternalData(AdminModels::FSetTitleDataRequest& request, const FSetTitleInternalDataDelegate& SuccessDelegate = FSetTitleInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets the Amazon Resource Name (ARN) for iOS and Android push notifications. Documentation on the exact restrictions can + * be found at: http://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformApplication.html. Currently, Amazon device + * Messaging is not supported. + * When using the Apple Push Notification service (APNS) or the development version (APNS_SANDBOX), the APNS Private Key should be used as the Credential in this call. With Google Cloud Messaging (GCM), the Android API Key should be used. The current ARN (if one exists) can be overwritten by setting the OverwriteOldARN boolean to true. + */ + bool SetupPushNotification(AdminModels::FSetupPushNotificationRequest& request, const FSetupPushNotificationDelegate& SuccessDelegate = FSetupPushNotificationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Decrements the specified virtual currency by the stated amount + bool SubtractUserVirtualCurrency(AdminModels::FSubtractUserVirtualCurrencyRequest& request, const FSubtractUserVirtualCurrencyDelegate& SuccessDelegate = FSubtractUserVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates information of a list of existing bans specified with Ban Ids. + * For each ban, only updates the values that are set. Leave any value to null for no change. If a ban could not be found, the rest are still applied. Returns information about applied updates only. + */ + bool UpdateBans(AdminModels::FUpdateBansRequest& request, const FUpdateBansDelegate& SuccessDelegate = FUpdateBansDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the catalog configuration for virtual goods in the specified catalog version + * This operation is additive. Items with ItemId values not currently in the catalog will be added, while those with ItemId values matching items currently in the catalog will overwrite those items with the given values. + */ + bool UpdateCatalogItems(AdminModels::FUpdateCatalogItemsRequest& request, const FUpdateCatalogItemsDelegate& SuccessDelegate = FUpdateCatalogItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates a new Cloud Script revision and uploads source code to it. Note that at this time, only one file should be + * submitted in the revision. + */ + bool UpdateCloudScript(AdminModels::FUpdateCloudScriptRequest& request, const FUpdateCloudScriptDelegate& SuccessDelegate = FUpdateCloudScriptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates a existing Player Shared Secret Key. It may take up to 5 minutes for this update to become generally available + * after this API returns. + * Player Shared Secret Keys are used for the call to Client/GetTitlePublicKey, which exchanges the shared secret for an RSA CSP blob to be used to encrypt the payload of account creation requests when that API requires a signature header. + */ + bool UpdatePlayerSharedSecret(AdminModels::FUpdatePlayerSharedSecretRequest& request, const FUpdatePlayerSharedSecretDelegate& SuccessDelegate = FUpdatePlayerSharedSecretDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates a player statistic configuration for the title, optionally allowing the developer to specify a reset interval. + * Statistics are numeric values, with each statistic in the title also generating a leaderboard. The ResetInterval enables automatically resetting leaderboards on a specified interval. Upon reset, the statistic updates to a new version with no values (effectively removing all players from the leaderboard). The previous version's statistic values are also archived for retrieval, if needed (see GetPlayerStatisticVersions). Statistics not created via a call to CreatePlayerStatisticDefinition by default have a VersionChangeInterval of Never, meaning they do not reset on a schedule, but they can be set to do so via a call to UpdatePlayerStatisticDefinition. Once a statistic has been reset (sometimes referred to as versioned or incremented), the now-previous version can still be written to for up a short, pre-defined period (currently 10 seconds), to prevent issues with levels completing around the time of the reset. Also, once reset, the historical statistics for players in the title may be retrieved using the URL specified in the version information (GetPlayerStatisticVersions). The AggregationMethod determines what action is taken when a new statistic value is submitted - always update with the new value (Last), use the highest of the old and new values (Max), use the smallest (Min), or add them together (Sum). + */ + bool UpdatePlayerStatisticDefinition(AdminModels::FUpdatePlayerStatisticDefinitionRequest& request, const FUpdatePlayerStatisticDefinitionDelegate& SuccessDelegate = FUpdatePlayerStatisticDefinitionDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Changes a policy for a title + * Updates permissions for your title. Policies affect what is allowed to happen on your title. Your policy is a collection of statements that, together, govern particular area for your title. Today, the only allowed policy is called 'ApiPolicy' and it governs what calls players are allowed to make. + */ + bool UpdatePolicy(AdminModels::FUpdatePolicyRequest& request, const FUpdatePolicyDelegate& SuccessDelegate = FUpdatePolicyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the random drop table configuration for the title + * This operation is additive. Tables with TableId values not currently defined will be added, while those with TableId values matching Tables currently in the catalog will be overwritten with the given values. + */ + bool UpdateRandomResultTables(AdminModels::FUpdateRandomResultTablesRequest& request, const FUpdateRandomResultTablesDelegate& SuccessDelegate = FUpdateRandomResultTablesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates an existing virtual item store with new or modified items + * This operation is additive. Items with ItemId values not currently in the store will be added, while those with ItemId values matching items currently in the catalog will overwrite those items with the given values. A store contains an array of references to items defined in the catalog, along with the prices for the item, in both real world and virtual currencies. These prices act as an override to any prices defined in the catalog. In this way, the base definitions of the items may be defined in the catalog, with all associated properties, while the pricing can be set for each store, as needed. This allows for subsets of goods to be defined for different purposes (in order to simplify showing some, but not all catalog items to users, based upon different characteristics), along with unique prices. Note that all prices defined in the catalog and store definitions for the item are considered valid, and that a compromised client can be made to send a request for an item based upon any of these definitions. If no price is specified in the store for an item, the price set in the catalog should be displayed to the user. + */ + bool UpdateStoreItems(AdminModels::FUpdateStoreItemsRequest& request, const FUpdateStoreItemsDelegate& SuccessDelegate = FUpdateStoreItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Update an existing task. + * Note that when calling this API, all properties of the task have to be provided, including properties that you do not want to change. Parameters not specified would be set to default value. If the task name in the update request is new, a task rename operation will be executed before updating other fields of the task. WARNING: Renaming of a task may break logics where the task name is used as an identifier. + */ + bool UpdateTask(AdminModels::FUpdateTaskRequest& request, const FUpdateTaskDelegate& SuccessDelegate = FUpdateTaskDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user which is readable and writable by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserData(AdminModels::FUpdateUserDataRequest& request, const FUpdateUserDataDelegate& SuccessDelegate = FUpdateUserDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user which cannot be accessed by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserInternalData(AdminModels::FUpdateUserInternalDataRequest& request, const FUpdateUserInternalDataDelegate& SuccessDelegate = FUpdateUserInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the publisher-specific custom data for the user which is readable and writable by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. Note that in the example call provided, title-specific data is used, as there may be a need to share this across titles (in sequels, for example). + */ + bool UpdateUserPublisherData(AdminModels::FUpdateUserDataRequest& request, const FUpdateUserPublisherDataDelegate& SuccessDelegate = FUpdateUserPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the publisher-specific custom data for the user which cannot be accessed by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. Note that in the example call provided, title-specific data is used, as there may be a need to share this across titles (in sequels, for example). + */ + bool UpdateUserPublisherInternalData(AdminModels::FUpdateUserInternalDataRequest& request, const FUpdateUserPublisherInternalDataDelegate& SuccessDelegate = FUpdateUserPublisherInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the publisher-specific custom data for the user which can only be read by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. Note that in the example call provided, title-specific data is used, as there may be a need to share this across titles (in sequels, for example). + */ + bool UpdateUserPublisherReadOnlyData(AdminModels::FUpdateUserDataRequest& request, const FUpdateUserPublisherReadOnlyDataDelegate& SuccessDelegate = FUpdateUserPublisherReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user which can only be read by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserReadOnlyData(AdminModels::FUpdateUserDataRequest& request, const FUpdateUserReadOnlyDataDelegate& SuccessDelegate = FUpdateUserReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title specific display name for a user + * In addition to the PlayFab username, titles can make use of a DisplayName which is also a unique identifier, but specific to the title. This allows for unique names which more closely match the theme or genre of a title, for example. This API enables changing that name, whether due to a customer request, an offensive name choice, etc. + */ + bool UpdateUserTitleDisplayName(AdminModels::FUpdateUserTitleDisplayNameRequest& request, const FUpdateUserTitleDisplayNameDelegate& SuccessDelegate = FUpdateUserTitleDisplayNameDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnAbortTaskInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAbortTaskInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddNewsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddNewsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddPlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddPlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddServerBuildResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddServerBuildDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddVirtualCurrencyTypesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddVirtualCurrencyTypesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnBanUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FBanUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCheckLimitedEditionItemAvailabilityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCheckLimitedEditionItemAvailabilityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreateActionsOnPlayersInSegmentTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateActionsOnPlayersInSegmentTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreateCloudScriptTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateCloudScriptTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreatePlayerSharedSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreatePlayerSharedSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreatePlayerStatisticDefinitionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreatePlayerStatisticDefinitionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteContentResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteContentDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteMasterPlayerAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteMasterPlayerAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeletePlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeletePlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeletePlayerSharedSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeletePlayerSharedSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteStoreResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteStoreDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteTitleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteTitleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnExportMasterPlayerDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExportMasterPlayerDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetActionsOnPlayersInSegmentTaskInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetActionsOnPlayersInSegmentTaskInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetAllSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCloudScriptRevisionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCloudScriptRevisionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCloudScriptTaskInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCloudScriptTaskInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCloudScriptVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCloudScriptVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetContentListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetContentUploadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentUploadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetDataReportResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetDataReportDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetMatchmakerGameInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetMatchmakerGameInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetMatchmakerGameModesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetMatchmakerGameModesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayedTitleListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayedTitleListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerIdFromAuthTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerIdFromAuthTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerSharedSecretsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSharedSecretsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayersInSegmentResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayersInSegmentDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerStatisticDefinitionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticDefinitionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerStatisticVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetRandomResultTablesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetRandomResultTablesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetServerBuildInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetServerBuildInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetServerBuildUploadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetServerBuildUploadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTaskInstancesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTaskInstancesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTasksResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTasksDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserAccountInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserAccountInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGrantItemsToUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnIncrementLimitedEditionItemAvailabilityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FIncrementLimitedEditionItemAvailabilityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnIncrementPlayerStatisticVersionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FIncrementPlayerStatisticVersionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListServerBuildsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListServerBuildsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListVirtualCurrencyTypesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListVirtualCurrencyTypesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnModifyMatchmakerGameModesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FModifyMatchmakerGameModesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnModifyServerBuildResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FModifyServerBuildDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRefundPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefundPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemovePlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemovePlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveServerBuildResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveServerBuildDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveVirtualCurrencyTypesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveVirtualCurrencyTypesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnResetCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResetCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnResetPasswordResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResetPasswordDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnResetUserStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResetUserStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnResolvePurchaseDisputeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResolvePurchaseDisputeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeAllBansForUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeAllBansForUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeInventoryItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeInventoryItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRunTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRunTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSendAccountRecoveryEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendAccountRecoveryEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetPlayerSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPlayerSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetPublishedRevisionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPublishedRevisionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetupPushNotificationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetupPushNotificationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSubtractUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdatePlayerSharedSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerSharedSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdatePlayerStatisticDefinitionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerStatisticDefinitionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdatePolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateRandomResultTablesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateRandomResultTablesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserTitleDisplayNameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserTitleDisplayNameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAdminDataModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAdminDataModels.h new file mode 100644 index 000000000..9b86bef0a --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAdminDataModels.h @@ -0,0 +1,9719 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace AdminModels +{ + + struct PLAYFABCPP_API FAbortTaskInstanceRequest : public FPlayFabBaseModel + { + // ID of a task instance that is being aborted. + FString TaskInstanceId; + + FAbortTaskInstanceRequest() : + FPlayFabBaseModel(), + TaskInstanceId() + {} + + FAbortTaskInstanceRequest(const FAbortTaskInstanceRequest& src) : + FPlayFabBaseModel(), + TaskInstanceId(src.TaskInstanceId) + {} + + FAbortTaskInstanceRequest(const TSharedPtr& obj) : FAbortTaskInstanceRequest() + { + readFromValue(obj); + } + + ~FAbortTaskInstanceRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FActionsOnPlayersInSegmentTaskParameter : public FPlayFabBaseModel + { + // ID of the action to perform on each player in segment. + FString ActionId; + + // ID of the segment to perform actions on. + FString SegmentId; + + FActionsOnPlayersInSegmentTaskParameter() : + FPlayFabBaseModel(), + ActionId(), + SegmentId() + {} + + FActionsOnPlayersInSegmentTaskParameter(const FActionsOnPlayersInSegmentTaskParameter& src) : + FPlayFabBaseModel(), + ActionId(src.ActionId), + SegmentId(src.SegmentId) + {} + + FActionsOnPlayersInSegmentTaskParameter(const TSharedPtr& obj) : FActionsOnPlayersInSegmentTaskParameter() + { + readFromValue(obj); + } + + ~FActionsOnPlayersInSegmentTaskParameter(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum TaskInstanceStatus + { + TaskInstanceStatusSucceeded, + TaskInstanceStatusStarting, + TaskInstanceStatusInProgress, + TaskInstanceStatusFailed, + TaskInstanceStatusAborted, + TaskInstanceStatusPending + }; + + PLAYFABCPP_API void writeTaskInstanceStatusEnumJSON(TaskInstanceStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API TaskInstanceStatus readTaskInstanceStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API TaskInstanceStatus readTaskInstanceStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FNameIdentifier : public FPlayFabBaseModel + { + // [optional] Id Identifier, if present + FString Id; + + // [optional] Name Identifier, if present + FString Name; + + FNameIdentifier() : + FPlayFabBaseModel(), + Id(), + Name() + {} + + FNameIdentifier(const FNameIdentifier& src) : + FPlayFabBaseModel(), + Id(src.Id), + Name(src.Name) + {} + + FNameIdentifier(const TSharedPtr& obj) : FNameIdentifier() + { + readFromValue(obj); + } + + ~FNameIdentifier(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FActionsOnPlayersInSegmentTaskSummary : public FPlayFabBaseModel + { + // [optional] UTC timestamp when the task completed. + Boxed CompletedAt; + + // [optional] Error message for last processing attempt, if an error occured. + FString ErrorMessage; + + // [optional] Flag indicating if the error was fatal, if false job will be retried. + Boxed ErrorWasFatal; + + // [optional] Estimated time remaining in seconds. + Boxed EstimatedSecondsRemaining; + + // [optional] Progress represented as percentage. + Boxed PercentComplete; + + // [optional] If manually scheduled, ID of user who scheduled the task. + FString ScheduledByUserId; + + // UTC timestamp when the task started. + FDateTime StartedAt; + + // [optional] Current status of the task instance. + Boxed Status; + + // [optional] Identifier of the task this instance belongs to. + TSharedPtr TaskIdentifier; + + // [optional] ID of the task instance. + FString TaskInstanceId; + + // [optional] Total players in segment when task was started. + Boxed TotalPlayersInSegment; + + // [optional] Total number of players that have had the actions applied to. + Boxed TotalPlayersProcessed; + + FActionsOnPlayersInSegmentTaskSummary() : + FPlayFabBaseModel(), + CompletedAt(), + ErrorMessage(), + ErrorWasFatal(), + EstimatedSecondsRemaining(), + PercentComplete(), + ScheduledByUserId(), + StartedAt(0), + Status(), + TaskIdentifier(nullptr), + TaskInstanceId(), + TotalPlayersInSegment(), + TotalPlayersProcessed() + {} + + FActionsOnPlayersInSegmentTaskSummary(const FActionsOnPlayersInSegmentTaskSummary& src) : + FPlayFabBaseModel(), + CompletedAt(src.CompletedAt), + ErrorMessage(src.ErrorMessage), + ErrorWasFatal(src.ErrorWasFatal), + EstimatedSecondsRemaining(src.EstimatedSecondsRemaining), + PercentComplete(src.PercentComplete), + ScheduledByUserId(src.ScheduledByUserId), + StartedAt(src.StartedAt), + Status(src.Status), + TaskIdentifier(src.TaskIdentifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.TaskIdentifier)) : nullptr), + TaskInstanceId(src.TaskInstanceId), + TotalPlayersInSegment(src.TotalPlayersInSegment), + TotalPlayersProcessed(src.TotalPlayersProcessed) + {} + + FActionsOnPlayersInSegmentTaskSummary(const TSharedPtr& obj) : FActionsOnPlayersInSegmentTaskSummary() + { + readFromValue(obj); + } + + ~FActionsOnPlayersInSegmentTaskSummary(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAdCampaignAttribution : public FPlayFabBaseModel + { + // UTC time stamp of attribution + FDateTime AttributedAt; + + // [optional] Attribution campaign identifier + FString CampaignId; + + // [optional] Attribution network name + FString Platform; + + FAdCampaignAttribution() : + FPlayFabBaseModel(), + AttributedAt(0), + CampaignId(), + Platform() + {} + + FAdCampaignAttribution(const FAdCampaignAttribution& src) : + FPlayFabBaseModel(), + AttributedAt(src.AttributedAt), + CampaignId(src.CampaignId), + Platform(src.Platform) + {} + + FAdCampaignAttribution(const TSharedPtr& obj) : FAdCampaignAttribution() + { + readFromValue(obj); + } + + ~FAdCampaignAttribution(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAdCampaignAttributionModel : public FPlayFabBaseModel + { + // UTC time stamp of attribution + FDateTime AttributedAt; + + // [optional] Attribution campaign identifier + FString CampaignId; + + // [optional] Attribution network name + FString Platform; + + FAdCampaignAttributionModel() : + FPlayFabBaseModel(), + AttributedAt(0), + CampaignId(), + Platform() + {} + + FAdCampaignAttributionModel(const FAdCampaignAttributionModel& src) : + FPlayFabBaseModel(), + AttributedAt(src.AttributedAt), + CampaignId(src.CampaignId), + Platform(src.Platform) + {} + + FAdCampaignAttributionModel(const TSharedPtr& obj) : FAdCampaignAttributionModel() + { + readFromValue(obj); + } + + ~FAdCampaignAttributionModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddNewsRequest : public FPlayFabBaseModel + { + // Body text of the news + FString Body; + + // [optional] Time this news was published. If not set, defaults to now. + Boxed Timestamp; + + // Title (headline) of the news item + FString Title; + + FAddNewsRequest() : + FPlayFabBaseModel(), + Body(), + Timestamp(), + Title() + {} + + FAddNewsRequest(const FAddNewsRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + Timestamp(src.Timestamp), + Title(src.Title) + {} + + FAddNewsRequest(const TSharedPtr& obj) : FAddNewsRequest() + { + readFromValue(obj); + } + + ~FAddNewsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddNewsResult : public FPlayFabBaseModel + { + // [optional] Unique id of the new news item + FString NewsId; + + FAddNewsResult() : + FPlayFabBaseModel(), + NewsId() + {} + + FAddNewsResult(const FAddNewsResult& src) : + FPlayFabBaseModel(), + NewsId(src.NewsId) + {} + + FAddNewsResult(const TSharedPtr& obj) : FAddNewsResult() + { + readFromValue(obj); + } + + ~FAddNewsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddPlayerTagRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique tag for player profile. + FString TagName; + + FAddPlayerTagRequest() : + FPlayFabBaseModel(), + PlayFabId(), + TagName() + {} + + FAddPlayerTagRequest(const FAddPlayerTagRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + TagName(src.TagName) + {} + + FAddPlayerTagRequest(const TSharedPtr& obj) : FAddPlayerTagRequest() + { + readFromValue(obj); + } + + ~FAddPlayerTagRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddPlayerTagResult : public FPlayFabBaseModel + { + FAddPlayerTagResult() : + FPlayFabBaseModel() + {} + + FAddPlayerTagResult(const FAddPlayerTagResult& src) : + FPlayFabBaseModel() + {} + + FAddPlayerTagResult(const TSharedPtr& obj) : FAddPlayerTagResult() + { + readFromValue(obj); + } + + ~FAddPlayerTagResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum Region + { + RegionUSCentral, + RegionUSEast, + RegionEUWest, + RegionSingapore, + RegionJapan, + RegionBrazil, + RegionAustralia + }; + + PLAYFABCPP_API void writeRegionEnumJSON(Region enumVal, JsonWriter& writer); + PLAYFABCPP_API Region readRegionFromValue(const TSharedPtr& value); + PLAYFABCPP_API Region readRegionFromValue(const FString& value); + + struct PLAYFABCPP_API FAddServerBuildRequest : public FPlayFabBaseModel + { + // [optional] server host regions in which this build should be running and available + TArray ActiveRegions; + // unique identifier for the build executable + FString BuildId; + + // [optional] appended to the end of the command line when starting game servers + FString CommandLineTemplate; + + // [optional] developer comment(s) for this build + FString Comment; + + // [optional] path to the game server executable. Defaults to gameserver.exe + FString ExecutablePath; + + // maximum number of game server instances that can run on a single host machine + int32 MaxGamesPerHost; + + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + int32 MinFreeGameSlots; + + FAddServerBuildRequest() : + FPlayFabBaseModel(), + ActiveRegions(), + BuildId(), + CommandLineTemplate(), + Comment(), + ExecutablePath(), + MaxGamesPerHost(0), + MinFreeGameSlots(0) + {} + + FAddServerBuildRequest(const FAddServerBuildRequest& src) : + FPlayFabBaseModel(), + ActiveRegions(src.ActiveRegions), + BuildId(src.BuildId), + CommandLineTemplate(src.CommandLineTemplate), + Comment(src.Comment), + ExecutablePath(src.ExecutablePath), + MaxGamesPerHost(src.MaxGamesPerHost), + MinFreeGameSlots(src.MinFreeGameSlots) + {} + + FAddServerBuildRequest(const TSharedPtr& obj) : FAddServerBuildRequest() + { + readFromValue(obj); + } + + ~FAddServerBuildRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum GameBuildStatus + { + GameBuildStatusAvailable, + GameBuildStatusValidating, + GameBuildStatusInvalidBuildPackage, + GameBuildStatusProcessing, + GameBuildStatusFailedToProcess + }; + + PLAYFABCPP_API void writeGameBuildStatusEnumJSON(GameBuildStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API GameBuildStatus readGameBuildStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API GameBuildStatus readGameBuildStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FAddServerBuildResult : public FPlayFabBaseModel + { + // [optional] array of regions where this build can used, when it is active + TArray ActiveRegions; + // [optional] unique identifier for this build executable + FString BuildId; + + // [optional] appended to the end of the command line when starting game servers + FString CommandLineTemplate; + + // [optional] developer comment(s) for this build + FString Comment; + + // [optional] path to the game server executable. Defaults to gameserver.exe + FString ExecutablePath; + + // maximum number of game server instances that can run on a single host machine + int32 MaxGamesPerHost; + + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + int32 MinFreeGameSlots; + + // [optional] the current status of the build validation and processing steps + Boxed Status; + + // time this build was last modified (or uploaded, if this build has never been modified) + FDateTime Timestamp; + + /** + * [optional] Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FAddServerBuildResult() : + FPlayFabBaseModel(), + ActiveRegions(), + BuildId(), + CommandLineTemplate(), + Comment(), + ExecutablePath(), + MaxGamesPerHost(0), + MinFreeGameSlots(0), + Status(), + Timestamp(0), + TitleId() + {} + + FAddServerBuildResult(const FAddServerBuildResult& src) : + FPlayFabBaseModel(), + ActiveRegions(src.ActiveRegions), + BuildId(src.BuildId), + CommandLineTemplate(src.CommandLineTemplate), + Comment(src.Comment), + ExecutablePath(src.ExecutablePath), + MaxGamesPerHost(src.MaxGamesPerHost), + MinFreeGameSlots(src.MinFreeGameSlots), + Status(src.Status), + Timestamp(src.Timestamp), + TitleId(src.TitleId) + {} + + FAddServerBuildResult(const TSharedPtr& obj) : FAddServerBuildResult() + { + readFromValue(obj); + } + + ~FAddServerBuildResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddUserVirtualCurrencyRequest : public FPlayFabBaseModel + { + /** + * Amount to be added to the user balance of the specified virtual currency. Maximum VC balance is Int32 (2,147,483,647). + * Any increase over this value will be discarded. + */ + int32 Amount; + + // PlayFab unique identifier of the user whose virtual currency balance is to be increased. + FString PlayFabId; + + // Name of the virtual currency which is to be incremented. + FString VirtualCurrency; + + FAddUserVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + PlayFabId(), + VirtualCurrency() + {} + + FAddUserVirtualCurrencyRequest(const FAddUserVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FAddUserVirtualCurrencyRequest(const TSharedPtr& obj) : FAddUserVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FAddUserVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FVirtualCurrencyData : public FPlayFabBaseModel + { + // unique two-character identifier for this currency type (e.g.: "CC") + FString CurrencyCode; + + // [optional] friendly name to show in the developer portal, reports, etc. + FString DisplayName; + + // [optional] amount to automatically grant users upon first login to the title + Boxed InitialDeposit; + + // [optional] maximum amount to which the currency will recharge (cannot exceed MaxAmount, but can be less) + Boxed RechargeMax; + + // [optional] rate at which the currency automatically be added to over time, in units per day (24 hours) + Boxed RechargeRate; + + FVirtualCurrencyData() : + FPlayFabBaseModel(), + CurrencyCode(), + DisplayName(), + InitialDeposit(), + RechargeMax(), + RechargeRate() + {} + + FVirtualCurrencyData(const FVirtualCurrencyData& src) : + FPlayFabBaseModel(), + CurrencyCode(src.CurrencyCode), + DisplayName(src.DisplayName), + InitialDeposit(src.InitialDeposit), + RechargeMax(src.RechargeMax), + RechargeRate(src.RechargeRate) + {} + + FVirtualCurrencyData(const TSharedPtr& obj) : FVirtualCurrencyData() + { + readFromValue(obj); + } + + ~FVirtualCurrencyData(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddVirtualCurrencyTypesRequest : public FPlayFabBaseModel + { + /** + * List of virtual currencies and their initial deposits (the amount a user is granted when signing in for the first time) + * to the title + */ + TArray VirtualCurrencies; + FAddVirtualCurrencyTypesRequest() : + FPlayFabBaseModel(), + VirtualCurrencies() + {} + + FAddVirtualCurrencyTypesRequest(const FAddVirtualCurrencyTypesRequest& src) : + FPlayFabBaseModel(), + VirtualCurrencies(src.VirtualCurrencies) + {} + + FAddVirtualCurrencyTypesRequest(const TSharedPtr& obj) : FAddVirtualCurrencyTypesRequest() + { + readFromValue(obj); + } + + ~FAddVirtualCurrencyTypesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum Conditionals + { + ConditionalsAny, + ConditionalsTrue, + ConditionalsFalse + }; + + PLAYFABCPP_API void writeConditionalsEnumJSON(Conditionals enumVal, JsonWriter& writer); + PLAYFABCPP_API Conditionals readConditionalsFromValue(const TSharedPtr& value); + PLAYFABCPP_API Conditionals readConditionalsFromValue(const FString& value); + + struct PLAYFABCPP_API FApiCondition : public FPlayFabBaseModel + { + // [optional] Require that API calls contain an RSA encrypted payload or signed headers. + Boxed HasSignatureOrEncryption; + + FApiCondition() : + FPlayFabBaseModel(), + HasSignatureOrEncryption() + {} + + FApiCondition(const FApiCondition& src) : + FPlayFabBaseModel(), + HasSignatureOrEncryption(src.HasSignatureOrEncryption) + {} + + FApiCondition(const TSharedPtr& obj) : FApiCondition() + { + readFromValue(obj); + } + + ~FApiCondition(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum AuthTokenType + { + AuthTokenTypeEmail + }; + + PLAYFABCPP_API void writeAuthTokenTypeEnumJSON(AuthTokenType enumVal, JsonWriter& writer); + PLAYFABCPP_API AuthTokenType readAuthTokenTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API AuthTokenType readAuthTokenTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FBanInfo : public FPlayFabBaseModel + { + // The active state of this ban. Expired bans may still have this value set to true but they will have no effect. + bool Active; + + // [optional] The unique Ban Id associated with this ban. + FString BanId; + + // [optional] The time when this ban was applied. + Boxed Created; + + // [optional] The time when this ban expires. Permanent bans do not have expiration date. + Boxed Expires; + + // [optional] The IP address on which the ban was applied. May affect multiple players. + FString IPAddress; + + // [optional] The MAC address on which the ban was applied. May affect multiple players. + FString MACAddress; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] The reason why this ban was applied. + FString Reason; + + FBanInfo() : + FPlayFabBaseModel(), + Active(false), + BanId(), + Created(), + Expires(), + IPAddress(), + MACAddress(), + PlayFabId(), + Reason() + {} + + FBanInfo(const FBanInfo& src) : + FPlayFabBaseModel(), + Active(src.Active), + BanId(src.BanId), + Created(src.Created), + Expires(src.Expires), + IPAddress(src.IPAddress), + MACAddress(src.MACAddress), + PlayFabId(src.PlayFabId), + Reason(src.Reason) + {} + + FBanInfo(const TSharedPtr& obj) : FBanInfo() + { + readFromValue(obj); + } + + ~FBanInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanRequest : public FPlayFabBaseModel + { + // [optional] The duration in hours for the ban. Leave this blank for a permanent ban. + Boxed DurationInHours; + + // [optional] IP address to be banned. May affect multiple players. + FString IPAddress; + + // [optional] MAC address to be banned. May affect multiple players. + FString MACAddress; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] The reason for this ban. Maximum 140 characters. + FString Reason; + + FBanRequest() : + FPlayFabBaseModel(), + DurationInHours(), + IPAddress(), + MACAddress(), + PlayFabId(), + Reason() + {} + + FBanRequest(const FBanRequest& src) : + FPlayFabBaseModel(), + DurationInHours(src.DurationInHours), + IPAddress(src.IPAddress), + MACAddress(src.MACAddress), + PlayFabId(src.PlayFabId), + Reason(src.Reason) + {} + + FBanRequest(const TSharedPtr& obj) : FBanRequest() + { + readFromValue(obj); + } + + ~FBanRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanUsersRequest : public FPlayFabBaseModel + { + // List of ban requests to be applied. Maximum 100. + TArray Bans; + FBanUsersRequest() : + FPlayFabBaseModel(), + Bans() + {} + + FBanUsersRequest(const FBanUsersRequest& src) : + FPlayFabBaseModel(), + Bans(src.Bans) + {} + + FBanUsersRequest(const TSharedPtr& obj) : FBanUsersRequest() + { + readFromValue(obj); + } + + ~FBanUsersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanUsersResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were applied + TArray BanData; + FBanUsersResult() : + FPlayFabBaseModel(), + BanData() + {} + + FBanUsersResult(const FBanUsersResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FBanUsersResult(const TSharedPtr& obj) : FBanUsersResult() + { + readFromValue(obj); + } + + ~FBanUsersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBlankResult : public FPlayFabBaseModel + { + FBlankResult() : + FPlayFabBaseModel() + {} + + FBlankResult(const FBlankResult& src) : + FPlayFabBaseModel() + {} + + FBlankResult(const TSharedPtr& obj) : FBlankResult() + { + readFromValue(obj); + } + + ~FBlankResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemBundleInfo : public FPlayFabBaseModel + { + // [optional] unique ItemId values for all items which will be added to the player inventory when the bundle is added + TArray BundledItems; + /** + * [optional] unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and + * add the relevant items to the player inventory when the bundle is added) + */ + TArray BundledResultTables; + // [optional] virtual currency types and balances which will be added to the player inventory when the bundle is added + TMap BundledVirtualCurrencies; + FCatalogItemBundleInfo() : + FPlayFabBaseModel(), + BundledItems(), + BundledResultTables(), + BundledVirtualCurrencies() + {} + + FCatalogItemBundleInfo(const FCatalogItemBundleInfo& src) : + FPlayFabBaseModel(), + BundledItems(src.BundledItems), + BundledResultTables(src.BundledResultTables), + BundledVirtualCurrencies(src.BundledVirtualCurrencies) + {} + + FCatalogItemBundleInfo(const TSharedPtr& obj) : FCatalogItemBundleInfo() + { + readFromValue(obj); + } + + ~FCatalogItemBundleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemConsumableInfo : public FPlayFabBaseModel + { + // [optional] number of times this object can be used, after which it will be removed from the player inventory + Boxed UsageCount; + + /** + * [optional] duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed + * (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on + * this item's details have completed) + */ + Boxed UsagePeriod; + + /** + * [optional] all inventory item instances in the player inventory sharing a non-null UsagePeriodGroup have their UsagePeriod values + * added together, and share the result - when that period has elapsed, all the items in the group will be removed + */ + FString UsagePeriodGroup; + + FCatalogItemConsumableInfo() : + FPlayFabBaseModel(), + UsageCount(), + UsagePeriod(), + UsagePeriodGroup() + {} + + FCatalogItemConsumableInfo(const FCatalogItemConsumableInfo& src) : + FPlayFabBaseModel(), + UsageCount(src.UsageCount), + UsagePeriod(src.UsagePeriod), + UsagePeriodGroup(src.UsagePeriodGroup) + {} + + FCatalogItemConsumableInfo(const TSharedPtr& obj) : FCatalogItemConsumableInfo() + { + readFromValue(obj); + } + + ~FCatalogItemConsumableInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemContainerInfo : public FPlayFabBaseModel + { + // [optional] unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked + TArray ItemContents; + /** + * [optional] ItemId for the catalog item used to unlock the container, if any (if not specified, a call to UnlockContainerItem will + * open the container, adding the contents to the player inventory and currency balances) + */ + FString KeyItemId; + + /** + * [optional] unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables + * will be resolved and add the relevant items to the player inventory) + */ + TArray ResultTableContents; + // [optional] virtual currency types and balances which will be added to the player inventory when the container is unlocked + TMap VirtualCurrencyContents; + FCatalogItemContainerInfo() : + FPlayFabBaseModel(), + ItemContents(), + KeyItemId(), + ResultTableContents(), + VirtualCurrencyContents() + {} + + FCatalogItemContainerInfo(const FCatalogItemContainerInfo& src) : + FPlayFabBaseModel(), + ItemContents(src.ItemContents), + KeyItemId(src.KeyItemId), + ResultTableContents(src.ResultTableContents), + VirtualCurrencyContents(src.VirtualCurrencyContents) + {} + + FCatalogItemContainerInfo(const TSharedPtr& obj) : FCatalogItemContainerInfo() + { + readFromValue(obj); + } + + ~FCatalogItemContainerInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItem : public FPlayFabBaseModel + { + /** + * [optional] defines the bundle properties for the item - bundles are items which contain other items, including random drop tables + * and virtual currencies + */ + TSharedPtr Bundle; + + // if true, then an item instance of this type can be used to grant a character to a user. + bool CanBecomeCharacter; + + // [optional] catalog version for this item + FString CatalogVersion; + + // [optional] defines the consumable properties (number of uses, timeout) for the item + TSharedPtr Consumable; + + /** + * [optional] defines the container properties for the item - what items it contains, including random drop tables and virtual + * currencies, and what item (if any) is required to open it via the UnlockContainerItem API + */ + TSharedPtr Container; + + // [optional] game specific custom data + FString CustomData; + + // [optional] text description of item, to show in-game + FString Description; + + // [optional] text name for the item, to show in-game + FString DisplayName; + + /** + * If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited + * edition item, this value determines the total number of instances to allocate for the title. Once this limit has been + * reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of + * false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less + * than zero, it will be ignored. + */ + int32 InitialLimitedEditionCount; + + // BETA: If true, then only a fixed number can ever be granted. + bool IsLimitedEdition; + + /** + * if true, then only one item instance of this type will exist and its remaininguses will be incremented instead. + * RemainingUses will cap out at Int32.Max (2,147,483,647). All subsequent increases will be discarded + */ + bool IsStackable; + + // if true, then an item instance of this type can be traded between players using the trading APIs + bool IsTradable; + + // [optional] class to which the item belongs + FString ItemClass; + + // unique identifier for this item + FString ItemId; + + /** + * [optional] URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP + * URL. + */ + FString ItemImageUrl; + + // [optional] override prices for this item for specific currencies + TMap RealCurrencyPrices; + // [optional] list of item tags + TArray Tags; + // [optional] price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + TMap VirtualCurrencyPrices; + FCatalogItem() : + FPlayFabBaseModel(), + Bundle(nullptr), + CanBecomeCharacter(false), + CatalogVersion(), + Consumable(nullptr), + Container(nullptr), + CustomData(), + Description(), + DisplayName(), + InitialLimitedEditionCount(0), + IsLimitedEdition(false), + IsStackable(false), + IsTradable(false), + ItemClass(), + ItemId(), + ItemImageUrl(), + RealCurrencyPrices(), + Tags(), + VirtualCurrencyPrices() + {} + + FCatalogItem(const FCatalogItem& src) : + FPlayFabBaseModel(), + Bundle(src.Bundle.IsValid() ? MakeShareable(new FCatalogItemBundleInfo(*src.Bundle)) : nullptr), + CanBecomeCharacter(src.CanBecomeCharacter), + CatalogVersion(src.CatalogVersion), + Consumable(src.Consumable.IsValid() ? MakeShareable(new FCatalogItemConsumableInfo(*src.Consumable)) : nullptr), + Container(src.Container.IsValid() ? MakeShareable(new FCatalogItemContainerInfo(*src.Container)) : nullptr), + CustomData(src.CustomData), + Description(src.Description), + DisplayName(src.DisplayName), + InitialLimitedEditionCount(src.InitialLimitedEditionCount), + IsLimitedEdition(src.IsLimitedEdition), + IsStackable(src.IsStackable), + IsTradable(src.IsTradable), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemImageUrl(src.ItemImageUrl), + RealCurrencyPrices(src.RealCurrencyPrices), + Tags(src.Tags), + VirtualCurrencyPrices(src.VirtualCurrencyPrices) + {} + + FCatalogItem(const TSharedPtr& obj) : FCatalogItem() + { + readFromValue(obj); + } + + ~FCatalogItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCheckLimitedEditionItemAvailabilityRequest : public FPlayFabBaseModel + { + // [optional] Which catalog is being updated. If null, uses the default catalog. + FString CatalogVersion; + + // The item to check for. + FString ItemId; + + FCheckLimitedEditionItemAvailabilityRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + ItemId() + {} + + FCheckLimitedEditionItemAvailabilityRequest(const FCheckLimitedEditionItemAvailabilityRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + ItemId(src.ItemId) + {} + + FCheckLimitedEditionItemAvailabilityRequest(const TSharedPtr& obj) : FCheckLimitedEditionItemAvailabilityRequest() + { + readFromValue(obj); + } + + ~FCheckLimitedEditionItemAvailabilityRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCheckLimitedEditionItemAvailabilityResult : public FPlayFabBaseModel + { + // The amount of the specified resource remaining. + int32 Amount; + + FCheckLimitedEditionItemAvailabilityResult() : + FPlayFabBaseModel(), + Amount(0) + {} + + FCheckLimitedEditionItemAvailabilityResult(const FCheckLimitedEditionItemAvailabilityResult& src) : + FPlayFabBaseModel(), + Amount(src.Amount) + {} + + FCheckLimitedEditionItemAvailabilityResult(const TSharedPtr& obj) : FCheckLimitedEditionItemAvailabilityResult() + { + readFromValue(obj); + } + + ~FCheckLimitedEditionItemAvailabilityResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCloudScriptFile : public FPlayFabBaseModel + { + // Contents of the Cloud Script javascript. Must be string-escaped javascript. + FString FileContents; + + /** + * Name of the javascript file. These names are not used internally by the server, they are only for developer + * organizational purposes. + */ + FString Filename; + + FCloudScriptFile() : + FPlayFabBaseModel(), + FileContents(), + Filename() + {} + + FCloudScriptFile(const FCloudScriptFile& src) : + FPlayFabBaseModel(), + FileContents(src.FileContents), + Filename(src.Filename) + {} + + FCloudScriptFile(const TSharedPtr& obj) : FCloudScriptFile() + { + readFromValue(obj); + } + + ~FCloudScriptFile(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCloudScriptTaskParameter : public FPlayFabBaseModel + { + // [optional] Argument to pass to the CloudScript function. + FJsonKeeper Argument; + + // [optional] Name of the CloudScript function to execute. + FString FunctionName; + + FCloudScriptTaskParameter() : + FPlayFabBaseModel(), + Argument(), + FunctionName() + {} + + FCloudScriptTaskParameter(const FCloudScriptTaskParameter& src) : + FPlayFabBaseModel(), + Argument(src.Argument), + FunctionName(src.FunctionName) + {} + + FCloudScriptTaskParameter(const TSharedPtr& obj) : FCloudScriptTaskParameter() + { + readFromValue(obj); + } + + ~FCloudScriptTaskParameter(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FScriptExecutionError : public FPlayFabBaseModel + { + /** + * [optional] Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, + * CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError + */ + FString Error; + + // [optional] Details about the error + FString Message; + + // [optional] Point during the execution of the script at which the error occurred, if any + FString StackTrace; + + FScriptExecutionError() : + FPlayFabBaseModel(), + Error(), + Message(), + StackTrace() + {} + + FScriptExecutionError(const FScriptExecutionError& src) : + FPlayFabBaseModel(), + Error(src.Error), + Message(src.Message), + StackTrace(src.StackTrace) + {} + + FScriptExecutionError(const TSharedPtr& obj) : FScriptExecutionError() + { + readFromValue(obj); + } + + ~FScriptExecutionError(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLogStatement : public FPlayFabBaseModel + { + // [optional] Optional object accompanying the message as contextual information + FJsonKeeper Data; + + // [optional] 'Debug', 'Info', or 'Error' + FString Level; + + // [optional] undefined + FString Message; + + FLogStatement() : + FPlayFabBaseModel(), + Data(), + Level(), + Message() + {} + + FLogStatement(const FLogStatement& src) : + FPlayFabBaseModel(), + Data(src.Data), + Level(src.Level), + Message(src.Message) + {} + + FLogStatement(const TSharedPtr& obj) : FLogStatement() + { + readFromValue(obj); + } + + ~FLogStatement(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteCloudScriptResult : public FPlayFabBaseModel + { + // Number of PlayFab API requests issued by the CloudScript function + int32 APIRequestsIssued; + + // [optional] Information about the error, if any, that occurred during execution + TSharedPtr Error; + + double ExecutionTimeSeconds; + + // [optional] The name of the function that executed + FString FunctionName; + + // [optional] The object returned from the CloudScript function, if any + FJsonKeeper FunctionResult; + + /** + * [optional] Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + Boxed FunctionResultTooLarge; + + // Number of external HTTP requests issued by the CloudScript function + int32 HttpRequestsIssued; + + /** + * [optional] Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + TArray Logs; + /** + * [optional] Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + Boxed LogsTooLarge; + + uint32 MemoryConsumedBytes; + + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + double ProcessorTimeSeconds; + + // The revision of the CloudScript that executed + int32 Revision; + + FExecuteCloudScriptResult() : + FPlayFabBaseModel(), + APIRequestsIssued(0), + Error(nullptr), + ExecutionTimeSeconds(0), + FunctionName(), + FunctionResult(), + FunctionResultTooLarge(), + HttpRequestsIssued(0), + Logs(), + LogsTooLarge(), + MemoryConsumedBytes(0), + ProcessorTimeSeconds(0), + Revision(0) + {} + + FExecuteCloudScriptResult(const FExecuteCloudScriptResult& src) : + FPlayFabBaseModel(), + APIRequestsIssued(src.APIRequestsIssued), + Error(src.Error.IsValid() ? MakeShareable(new FScriptExecutionError(*src.Error)) : nullptr), + ExecutionTimeSeconds(src.ExecutionTimeSeconds), + FunctionName(src.FunctionName), + FunctionResult(src.FunctionResult), + FunctionResultTooLarge(src.FunctionResultTooLarge), + HttpRequestsIssued(src.HttpRequestsIssued), + Logs(src.Logs), + LogsTooLarge(src.LogsTooLarge), + MemoryConsumedBytes(src.MemoryConsumedBytes), + ProcessorTimeSeconds(src.ProcessorTimeSeconds), + Revision(src.Revision) + {} + + FExecuteCloudScriptResult(const TSharedPtr& obj) : FExecuteCloudScriptResult() + { + readFromValue(obj); + } + + ~FExecuteCloudScriptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCloudScriptTaskSummary : public FPlayFabBaseModel + { + // [optional] UTC timestamp when the task completed. + Boxed CompletedAt; + + // [optional] Estimated time remaining in seconds. + Boxed EstimatedSecondsRemaining; + + // [optional] Progress represented as percentage. + Boxed PercentComplete; + + // [optional] Result of CloudScript execution + TSharedPtr Result; + + // [optional] If manually scheduled, ID of user who scheduled the task. + FString ScheduledByUserId; + + // UTC timestamp when the task started. + FDateTime StartedAt; + + // [optional] Current status of the task instance. + Boxed Status; + + // [optional] Identifier of the task this instance belongs to. + TSharedPtr TaskIdentifier; + + // [optional] ID of the task instance. + FString TaskInstanceId; + + FCloudScriptTaskSummary() : + FPlayFabBaseModel(), + CompletedAt(), + EstimatedSecondsRemaining(), + PercentComplete(), + Result(nullptr), + ScheduledByUserId(), + StartedAt(0), + Status(), + TaskIdentifier(nullptr), + TaskInstanceId() + {} + + FCloudScriptTaskSummary(const FCloudScriptTaskSummary& src) : + FPlayFabBaseModel(), + CompletedAt(src.CompletedAt), + EstimatedSecondsRemaining(src.EstimatedSecondsRemaining), + PercentComplete(src.PercentComplete), + Result(src.Result.IsValid() ? MakeShareable(new FExecuteCloudScriptResult(*src.Result)) : nullptr), + ScheduledByUserId(src.ScheduledByUserId), + StartedAt(src.StartedAt), + Status(src.Status), + TaskIdentifier(src.TaskIdentifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.TaskIdentifier)) : nullptr), + TaskInstanceId(src.TaskInstanceId) + {} + + FCloudScriptTaskSummary(const TSharedPtr& obj) : FCloudScriptTaskSummary() + { + readFromValue(obj); + } + + ~FCloudScriptTaskSummary(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCloudScriptVersionStatus : public FPlayFabBaseModel + { + // Most recent revision for this Cloud Script version + int32 LatestRevision; + + // Published code revision for this Cloud Script version + int32 PublishedRevision; + + // Version number + int32 Version; + + FCloudScriptVersionStatus() : + FPlayFabBaseModel(), + LatestRevision(0), + PublishedRevision(0), + Version(0) + {} + + FCloudScriptVersionStatus(const FCloudScriptVersionStatus& src) : + FPlayFabBaseModel(), + LatestRevision(src.LatestRevision), + PublishedRevision(src.PublishedRevision), + Version(src.Version) + {} + + FCloudScriptVersionStatus(const TSharedPtr& obj) : FCloudScriptVersionStatus() + { + readFromValue(obj); + } + + ~FCloudScriptVersionStatus(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum EmailVerificationStatus + { + EmailVerificationStatusUnverified, + EmailVerificationStatusPending, + EmailVerificationStatusConfirmed + }; + + PLAYFABCPP_API void writeEmailVerificationStatusEnumJSON(EmailVerificationStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API EmailVerificationStatus readEmailVerificationStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API EmailVerificationStatus readEmailVerificationStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FContactEmailInfo : public FPlayFabBaseModel + { + // [optional] The email address + FString EmailAddress; + + // [optional] The name of the email info data + FString Name; + + // [optional] The verification status of the email + Boxed VerificationStatus; + + FContactEmailInfo() : + FPlayFabBaseModel(), + EmailAddress(), + Name(), + VerificationStatus() + {} + + FContactEmailInfo(const FContactEmailInfo& src) : + FPlayFabBaseModel(), + EmailAddress(src.EmailAddress), + Name(src.Name), + VerificationStatus(src.VerificationStatus) + {} + + FContactEmailInfo(const TSharedPtr& obj) : FContactEmailInfo() + { + readFromValue(obj); + } + + ~FContactEmailInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FContactEmailInfoModel : public FPlayFabBaseModel + { + // [optional] The email address + FString EmailAddress; + + // [optional] The name of the email info data + FString Name; + + // [optional] The verification status of the email + Boxed VerificationStatus; + + FContactEmailInfoModel() : + FPlayFabBaseModel(), + EmailAddress(), + Name(), + VerificationStatus() + {} + + FContactEmailInfoModel(const FContactEmailInfoModel& src) : + FPlayFabBaseModel(), + EmailAddress(src.EmailAddress), + Name(src.Name), + VerificationStatus(src.VerificationStatus) + {} + + FContactEmailInfoModel(const TSharedPtr& obj) : FContactEmailInfoModel() + { + readFromValue(obj); + } + + ~FContactEmailInfoModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FContentInfo : public FPlayFabBaseModel + { + // [optional] Key of the content + FString Key; + + // Last modified time + FDateTime LastModified; + + // Size of the content in bytes + uint32 Size; + + FContentInfo() : + FPlayFabBaseModel(), + Key(), + LastModified(0), + Size(0) + {} + + FContentInfo(const FContentInfo& src) : + FPlayFabBaseModel(), + Key(src.Key), + LastModified(src.LastModified), + Size(src.Size) + {} + + FContentInfo(const TSharedPtr& obj) : FContentInfo() + { + readFromValue(obj); + } + + ~FContentInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ContinentCode + { + ContinentCodeAF, + ContinentCodeAN, + ContinentCodeAS, + ContinentCodeEU, + ContinentCodeNA, + ContinentCodeOC, + ContinentCodeSA + }; + + PLAYFABCPP_API void writeContinentCodeEnumJSON(ContinentCode enumVal, JsonWriter& writer); + PLAYFABCPP_API ContinentCode readContinentCodeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ContinentCode readContinentCodeFromValue(const FString& value); + + enum CountryCode + { + CountryCodeAF, + CountryCodeAX, + CountryCodeAL, + CountryCodeDZ, + CountryCodeAS, + CountryCodeAD, + CountryCodeAO, + CountryCodeAI, + CountryCodeAQ, + CountryCodeAG, + CountryCodeAR, + CountryCodeAM, + CountryCodeAW, + CountryCodeAU, + CountryCodeAT, + CountryCodeAZ, + CountryCodeBS, + CountryCodeBH, + CountryCodeBD, + CountryCodeBB, + CountryCodeBY, + CountryCodeBE, + CountryCodeBZ, + CountryCodeBJ, + CountryCodeBM, + CountryCodeBT, + CountryCodeBO, + CountryCodeBQ, + CountryCodeBA, + CountryCodeBW, + CountryCodeBV, + CountryCodeBR, + CountryCodeIO, + CountryCodeBN, + CountryCodeBG, + CountryCodeBF, + CountryCodeBI, + CountryCodeKH, + CountryCodeCM, + CountryCodeCA, + CountryCodeCV, + CountryCodeKY, + CountryCodeCF, + CountryCodeTD, + CountryCodeCL, + CountryCodeCN, + CountryCodeCX, + CountryCodeCC, + CountryCodeCO, + CountryCodeKM, + CountryCodeCG, + CountryCodeCD, + CountryCodeCK, + CountryCodeCR, + CountryCodeCI, + CountryCodeHR, + CountryCodeCU, + CountryCodeCW, + CountryCodeCY, + CountryCodeCZ, + CountryCodeDK, + CountryCodeDJ, + CountryCodeDM, + CountryCodeDO, + CountryCodeEC, + CountryCodeEG, + CountryCodeSV, + CountryCodeGQ, + CountryCodeER, + CountryCodeEE, + CountryCodeET, + CountryCodeFK, + CountryCodeFO, + CountryCodeFJ, + CountryCodeFI, + CountryCodeFR, + CountryCodeGF, + CountryCodePF, + CountryCodeTF, + CountryCodeGA, + CountryCodeGM, + CountryCodeGE, + CountryCodeDE, + CountryCodeGH, + CountryCodeGI, + CountryCodeGR, + CountryCodeGL, + CountryCodeGD, + CountryCodeGP, + CountryCodeGU, + CountryCodeGT, + CountryCodeGG, + CountryCodeGN, + CountryCodeGW, + CountryCodeGY, + CountryCodeHT, + CountryCodeHM, + CountryCodeVA, + CountryCodeHN, + CountryCodeHK, + CountryCodeHU, + CountryCodeIS, + CountryCodeIN, + CountryCodeID, + CountryCodeIR, + CountryCodeIQ, + CountryCodeIE, + CountryCodeIM, + CountryCodeIL, + CountryCodeIT, + CountryCodeJM, + CountryCodeJP, + CountryCodeJE, + CountryCodeJO, + CountryCodeKZ, + CountryCodeKE, + CountryCodeKI, + CountryCodeKP, + CountryCodeKR, + CountryCodeKW, + CountryCodeKG, + CountryCodeLA, + CountryCodeLV, + CountryCodeLB, + CountryCodeLS, + CountryCodeLR, + CountryCodeLY, + CountryCodeLI, + CountryCodeLT, + CountryCodeLU, + CountryCodeMO, + CountryCodeMK, + CountryCodeMG, + CountryCodeMW, + CountryCodeMY, + CountryCodeMV, + CountryCodeML, + CountryCodeMT, + CountryCodeMH, + CountryCodeMQ, + CountryCodeMR, + CountryCodeMU, + CountryCodeYT, + CountryCodeMX, + CountryCodeFM, + CountryCodeMD, + CountryCodeMC, + CountryCodeMN, + CountryCodeME, + CountryCodeMS, + CountryCodeMA, + CountryCodeMZ, + CountryCodeMM, + CountryCodeNA, + CountryCodeNR, + CountryCodeNP, + CountryCodeNL, + CountryCodeNC, + CountryCodeNZ, + CountryCodeNI, + CountryCodeNE, + CountryCodeNG, + CountryCodeNU, + CountryCodeNF, + CountryCodeMP, + CountryCodeNO, + CountryCodeOM, + CountryCodePK, + CountryCodePW, + CountryCodePS, + CountryCodePA, + CountryCodePG, + CountryCodePY, + CountryCodePE, + CountryCodePH, + CountryCodePN, + CountryCodePL, + CountryCodePT, + CountryCodePR, + CountryCodeQA, + CountryCodeRE, + CountryCodeRO, + CountryCodeRU, + CountryCodeRW, + CountryCodeBL, + CountryCodeSH, + CountryCodeKN, + CountryCodeLC, + CountryCodeMF, + CountryCodePM, + CountryCodeVC, + CountryCodeWS, + CountryCodeSM, + CountryCodeST, + CountryCodeSA, + CountryCodeSN, + CountryCodeRS, + CountryCodeSC, + CountryCodeSL, + CountryCodeSG, + CountryCodeSX, + CountryCodeSK, + CountryCodeSI, + CountryCodeSB, + CountryCodeSO, + CountryCodeZA, + CountryCodeGS, + CountryCodeSS, + CountryCodeES, + CountryCodeLK, + CountryCodeSD, + CountryCodeSR, + CountryCodeSJ, + CountryCodeSZ, + CountryCodeSE, + CountryCodeCH, + CountryCodeSY, + CountryCodeTW, + CountryCodeTJ, + CountryCodeTZ, + CountryCodeTH, + CountryCodeTL, + CountryCodeTG, + CountryCodeTK, + CountryCodeTO, + CountryCodeTT, + CountryCodeTN, + CountryCodeTR, + CountryCodeTM, + CountryCodeTC, + CountryCodeTV, + CountryCodeUG, + CountryCodeUA, + CountryCodeAE, + CountryCodeGB, + CountryCodeUS, + CountryCodeUM, + CountryCodeUY, + CountryCodeUZ, + CountryCodeVU, + CountryCodeVE, + CountryCodeVN, + CountryCodeVG, + CountryCodeVI, + CountryCodeWF, + CountryCodeEH, + CountryCodeYE, + CountryCodeZM, + CountryCodeZW + }; + + PLAYFABCPP_API void writeCountryCodeEnumJSON(CountryCode enumVal, JsonWriter& writer); + PLAYFABCPP_API CountryCode readCountryCodeFromValue(const TSharedPtr& value); + PLAYFABCPP_API CountryCode readCountryCodeFromValue(const FString& value); + + struct PLAYFABCPP_API FCreateActionsOnPlayerSegmentTaskRequest : public FPlayFabBaseModel + { + // [optional] Description the task + FString Description; + + // Whether the schedule is active. Inactive schedule will not trigger task execution. + bool IsActive; + + // Name of the task. This is a unique identifier for tasks in the title. + FString Name; + + // Task details related to segment and action + FActionsOnPlayersInSegmentTaskParameter Parameter; + + // [optional] Cron expression for the run schedule of the task. The expression should be in UTC. + FString Schedule; + + FCreateActionsOnPlayerSegmentTaskRequest() : + FPlayFabBaseModel(), + Description(), + IsActive(false), + Name(), + Parameter(), + Schedule() + {} + + FCreateActionsOnPlayerSegmentTaskRequest(const FCreateActionsOnPlayerSegmentTaskRequest& src) : + FPlayFabBaseModel(), + Description(src.Description), + IsActive(src.IsActive), + Name(src.Name), + Parameter(src.Parameter), + Schedule(src.Schedule) + {} + + FCreateActionsOnPlayerSegmentTaskRequest(const TSharedPtr& obj) : FCreateActionsOnPlayerSegmentTaskRequest() + { + readFromValue(obj); + } + + ~FCreateActionsOnPlayerSegmentTaskRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateCloudScriptTaskRequest : public FPlayFabBaseModel + { + // [optional] Description the task + FString Description; + + // Whether the schedule is active. Inactive schedule will not trigger task execution. + bool IsActive; + + // Name of the task. This is a unique identifier for tasks in the title. + FString Name; + + // Task details related to CloudScript + FCloudScriptTaskParameter Parameter; + + // [optional] Cron expression for the run schedule of the task. The expression should be in UTC. + FString Schedule; + + FCreateCloudScriptTaskRequest() : + FPlayFabBaseModel(), + Description(), + IsActive(false), + Name(), + Parameter(), + Schedule() + {} + + FCreateCloudScriptTaskRequest(const FCreateCloudScriptTaskRequest& src) : + FPlayFabBaseModel(), + Description(src.Description), + IsActive(src.IsActive), + Name(src.Name), + Parameter(src.Parameter), + Schedule(src.Schedule) + {} + + FCreateCloudScriptTaskRequest(const TSharedPtr& obj) : FCreateCloudScriptTaskRequest() + { + readFromValue(obj); + } + + ~FCreateCloudScriptTaskRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreatePlayerSharedSecretRequest : public FPlayFabBaseModel + { + // [optional] Friendly name for this key + FString FriendlyName; + + FCreatePlayerSharedSecretRequest() : + FPlayFabBaseModel(), + FriendlyName() + {} + + FCreatePlayerSharedSecretRequest(const FCreatePlayerSharedSecretRequest& src) : + FPlayFabBaseModel(), + FriendlyName(src.FriendlyName) + {} + + FCreatePlayerSharedSecretRequest(const TSharedPtr& obj) : FCreatePlayerSharedSecretRequest() + { + readFromValue(obj); + } + + ~FCreatePlayerSharedSecretRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreatePlayerSharedSecretResult : public FPlayFabBaseModel + { + // [optional] The player shared secret to use when calling Client/GetTitlePublicKey + FString SecretKey; + + FCreatePlayerSharedSecretResult() : + FPlayFabBaseModel(), + SecretKey() + {} + + FCreatePlayerSharedSecretResult(const FCreatePlayerSharedSecretResult& src) : + FPlayFabBaseModel(), + SecretKey(src.SecretKey) + {} + + FCreatePlayerSharedSecretResult(const TSharedPtr& obj) : FCreatePlayerSharedSecretResult() + { + readFromValue(obj); + } + + ~FCreatePlayerSharedSecretResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum StatisticAggregationMethod + { + StatisticAggregationMethodLast, + StatisticAggregationMethodMin, + StatisticAggregationMethodMax, + StatisticAggregationMethodSum + }; + + PLAYFABCPP_API void writeStatisticAggregationMethodEnumJSON(StatisticAggregationMethod enumVal, JsonWriter& writer); + PLAYFABCPP_API StatisticAggregationMethod readStatisticAggregationMethodFromValue(const TSharedPtr& value); + PLAYFABCPP_API StatisticAggregationMethod readStatisticAggregationMethodFromValue(const FString& value); + + enum StatisticResetIntervalOption + { + StatisticResetIntervalOptionNever, + StatisticResetIntervalOptionHour, + StatisticResetIntervalOptionDay, + StatisticResetIntervalOptionWeek, + StatisticResetIntervalOptionMonth + }; + + PLAYFABCPP_API void writeStatisticResetIntervalOptionEnumJSON(StatisticResetIntervalOption enumVal, JsonWriter& writer); + PLAYFABCPP_API StatisticResetIntervalOption readStatisticResetIntervalOptionFromValue(const TSharedPtr& value); + PLAYFABCPP_API StatisticResetIntervalOption readStatisticResetIntervalOptionFromValue(const FString& value); + + struct PLAYFABCPP_API FCreatePlayerStatisticDefinitionRequest : public FPlayFabBaseModel + { + // [optional] the aggregation method to use in updating the statistic (defaults to last) + Boxed AggregationMethod; + + // unique name of the statistic + FString StatisticName; + + // [optional] interval at which the values of the statistic for all players are reset (resets begin at the next interval boundary) + Boxed VersionChangeInterval; + + FCreatePlayerStatisticDefinitionRequest() : + FPlayFabBaseModel(), + AggregationMethod(), + StatisticName(), + VersionChangeInterval() + {} + + FCreatePlayerStatisticDefinitionRequest(const FCreatePlayerStatisticDefinitionRequest& src) : + FPlayFabBaseModel(), + AggregationMethod(src.AggregationMethod), + StatisticName(src.StatisticName), + VersionChangeInterval(src.VersionChangeInterval) + {} + + FCreatePlayerStatisticDefinitionRequest(const TSharedPtr& obj) : FCreatePlayerStatisticDefinitionRequest() + { + readFromValue(obj); + } + + ~FCreatePlayerStatisticDefinitionRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerStatisticDefinition : public FPlayFabBaseModel + { + // [optional] the aggregation method to use in updating the statistic (defaults to last) + Boxed AggregationMethod; + + // current active version of the statistic, incremented each time the statistic resets + uint32 CurrentVersion; + + // [optional] unique name of the statistic + FString StatisticName; + + // [optional] interval at which the values of the statistic for all players are reset automatically + Boxed VersionChangeInterval; + + FPlayerStatisticDefinition() : + FPlayFabBaseModel(), + AggregationMethod(), + CurrentVersion(0), + StatisticName(), + VersionChangeInterval() + {} + + FPlayerStatisticDefinition(const FPlayerStatisticDefinition& src) : + FPlayFabBaseModel(), + AggregationMethod(src.AggregationMethod), + CurrentVersion(src.CurrentVersion), + StatisticName(src.StatisticName), + VersionChangeInterval(src.VersionChangeInterval) + {} + + FPlayerStatisticDefinition(const TSharedPtr& obj) : FPlayerStatisticDefinition() + { + readFromValue(obj); + } + + ~FPlayerStatisticDefinition(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreatePlayerStatisticDefinitionResult : public FPlayFabBaseModel + { + // [optional] created statistic definition + TSharedPtr Statistic; + + FCreatePlayerStatisticDefinitionResult() : + FPlayFabBaseModel(), + Statistic(nullptr) + {} + + FCreatePlayerStatisticDefinitionResult(const FCreatePlayerStatisticDefinitionResult& src) : + FPlayFabBaseModel(), + Statistic(src.Statistic.IsValid() ? MakeShareable(new FPlayerStatisticDefinition(*src.Statistic)) : nullptr) + {} + + FCreatePlayerStatisticDefinitionResult(const TSharedPtr& obj) : FCreatePlayerStatisticDefinitionResult() + { + readFromValue(obj); + } + + ~FCreatePlayerStatisticDefinitionResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateTaskResult : public FPlayFabBaseModel + { + // [optional] ID of the task + FString TaskId; + + FCreateTaskResult() : + FPlayFabBaseModel(), + TaskId() + {} + + FCreateTaskResult(const FCreateTaskResult& src) : + FPlayFabBaseModel(), + TaskId(src.TaskId) + {} + + FCreateTaskResult(const TSharedPtr& obj) : FCreateTaskResult() + { + readFromValue(obj); + } + + ~FCreateTaskResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum Currency + { + CurrencyAED, + CurrencyAFN, + CurrencyALL, + CurrencyAMD, + CurrencyANG, + CurrencyAOA, + CurrencyARS, + CurrencyAUD, + CurrencyAWG, + CurrencyAZN, + CurrencyBAM, + CurrencyBBD, + CurrencyBDT, + CurrencyBGN, + CurrencyBHD, + CurrencyBIF, + CurrencyBMD, + CurrencyBND, + CurrencyBOB, + CurrencyBRL, + CurrencyBSD, + CurrencyBTN, + CurrencyBWP, + CurrencyBYR, + CurrencyBZD, + CurrencyCAD, + CurrencyCDF, + CurrencyCHF, + CurrencyCLP, + CurrencyCNY, + CurrencyCOP, + CurrencyCRC, + CurrencyCUC, + CurrencyCUP, + CurrencyCVE, + CurrencyCZK, + CurrencyDJF, + CurrencyDKK, + CurrencyDOP, + CurrencyDZD, + CurrencyEGP, + CurrencyERN, + CurrencyETB, + CurrencyEUR, + CurrencyFJD, + CurrencyFKP, + CurrencyGBP, + CurrencyGEL, + CurrencyGGP, + CurrencyGHS, + CurrencyGIP, + CurrencyGMD, + CurrencyGNF, + CurrencyGTQ, + CurrencyGYD, + CurrencyHKD, + CurrencyHNL, + CurrencyHRK, + CurrencyHTG, + CurrencyHUF, + CurrencyIDR, + CurrencyILS, + CurrencyIMP, + CurrencyINR, + CurrencyIQD, + CurrencyIRR, + CurrencyISK, + CurrencyJEP, + CurrencyJMD, + CurrencyJOD, + CurrencyJPY, + CurrencyKES, + CurrencyKGS, + CurrencyKHR, + CurrencyKMF, + CurrencyKPW, + CurrencyKRW, + CurrencyKWD, + CurrencyKYD, + CurrencyKZT, + CurrencyLAK, + CurrencyLBP, + CurrencyLKR, + CurrencyLRD, + CurrencyLSL, + CurrencyLYD, + CurrencyMAD, + CurrencyMDL, + CurrencyMGA, + CurrencyMKD, + CurrencyMMK, + CurrencyMNT, + CurrencyMOP, + CurrencyMRO, + CurrencyMUR, + CurrencyMVR, + CurrencyMWK, + CurrencyMXN, + CurrencyMYR, + CurrencyMZN, + CurrencyNAD, + CurrencyNGN, + CurrencyNIO, + CurrencyNOK, + CurrencyNPR, + CurrencyNZD, + CurrencyOMR, + CurrencyPAB, + CurrencyPEN, + CurrencyPGK, + CurrencyPHP, + CurrencyPKR, + CurrencyPLN, + CurrencyPYG, + CurrencyQAR, + CurrencyRON, + CurrencyRSD, + CurrencyRUB, + CurrencyRWF, + CurrencySAR, + CurrencySBD, + CurrencySCR, + CurrencySDG, + CurrencySEK, + CurrencySGD, + CurrencySHP, + CurrencySLL, + CurrencySOS, + CurrencySPL, + CurrencySRD, + CurrencySTD, + CurrencySVC, + CurrencySYP, + CurrencySZL, + CurrencyTHB, + CurrencyTJS, + CurrencyTMT, + CurrencyTND, + CurrencyTOP, + CurrencyTRY, + CurrencyTTD, + CurrencyTVD, + CurrencyTWD, + CurrencyTZS, + CurrencyUAH, + CurrencyUGX, + CurrencyUSD, + CurrencyUYU, + CurrencyUZS, + CurrencyVEF, + CurrencyVND, + CurrencyVUV, + CurrencyWST, + CurrencyXAF, + CurrencyXCD, + CurrencyXDR, + CurrencyXOF, + CurrencyXPF, + CurrencyYER, + CurrencyZAR, + CurrencyZMW, + CurrencyZWD + }; + + PLAYFABCPP_API void writeCurrencyEnumJSON(Currency enumVal, JsonWriter& writer); + PLAYFABCPP_API Currency readCurrencyFromValue(const TSharedPtr& value); + PLAYFABCPP_API Currency readCurrencyFromValue(const FString& value); + + struct PLAYFABCPP_API FDeleteContentRequest : public FPlayFabBaseModel + { + // Key of the content item to be deleted + FString Key; + + FDeleteContentRequest() : + FPlayFabBaseModel(), + Key() + {} + + FDeleteContentRequest(const FDeleteContentRequest& src) : + FPlayFabBaseModel(), + Key(src.Key) + {} + + FDeleteContentRequest(const TSharedPtr& obj) : FDeleteContentRequest() + { + readFromValue(obj); + } + + ~FDeleteContentRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteMasterPlayerAccountRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FDeleteMasterPlayerAccountRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FDeleteMasterPlayerAccountRequest(const FDeleteMasterPlayerAccountRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FDeleteMasterPlayerAccountRequest(const TSharedPtr& obj) : FDeleteMasterPlayerAccountRequest() + { + readFromValue(obj); + } + + ~FDeleteMasterPlayerAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteMasterPlayerAccountResult : public FPlayFabBaseModel + { + /** + * [optional] A notification email with this job receipt Id will be sent to the title notification email address when deletion is + * complete. + */ + FString JobReceiptId; + + // [optional] List of titles from which the player's data will be deleted. + TArray TitleIds; + FDeleteMasterPlayerAccountResult() : + FPlayFabBaseModel(), + JobReceiptId(), + TitleIds() + {} + + FDeleteMasterPlayerAccountResult(const FDeleteMasterPlayerAccountResult& src) : + FPlayFabBaseModel(), + JobReceiptId(src.JobReceiptId), + TitleIds(src.TitleIds) + {} + + FDeleteMasterPlayerAccountResult(const TSharedPtr& obj) : FDeleteMasterPlayerAccountResult() + { + readFromValue(obj); + } + + ~FDeleteMasterPlayerAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeletePlayerRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FDeletePlayerRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FDeletePlayerRequest(const FDeletePlayerRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FDeletePlayerRequest(const TSharedPtr& obj) : FDeletePlayerRequest() + { + readFromValue(obj); + } + + ~FDeletePlayerRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeletePlayerResult : public FPlayFabBaseModel + { + FDeletePlayerResult() : + FPlayFabBaseModel() + {} + + FDeletePlayerResult(const FDeletePlayerResult& src) : + FPlayFabBaseModel() + {} + + FDeletePlayerResult(const TSharedPtr& obj) : FDeletePlayerResult() + { + readFromValue(obj); + } + + ~FDeletePlayerResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeletePlayerSharedSecretRequest : public FPlayFabBaseModel + { + // [optional] The shared secret key to delete + FString SecretKey; + + FDeletePlayerSharedSecretRequest() : + FPlayFabBaseModel(), + SecretKey() + {} + + FDeletePlayerSharedSecretRequest(const FDeletePlayerSharedSecretRequest& src) : + FPlayFabBaseModel(), + SecretKey(src.SecretKey) + {} + + FDeletePlayerSharedSecretRequest(const TSharedPtr& obj) : FDeletePlayerSharedSecretRequest() + { + readFromValue(obj); + } + + ~FDeletePlayerSharedSecretRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeletePlayerSharedSecretResult : public FPlayFabBaseModel + { + FDeletePlayerSharedSecretResult() : + FPlayFabBaseModel() + {} + + FDeletePlayerSharedSecretResult(const FDeletePlayerSharedSecretResult& src) : + FPlayFabBaseModel() + {} + + FDeletePlayerSharedSecretResult(const TSharedPtr& obj) : FDeletePlayerSharedSecretResult() + { + readFromValue(obj); + } + + ~FDeletePlayerSharedSecretResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteStoreRequest : public FPlayFabBaseModel + { + // [optional] catalog version of the store to delete. If null, uses the default catalog. + FString CatalogVersion; + + // unqiue identifier for the store which is to be deleted + FString StoreId; + + FDeleteStoreRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + StoreId() + {} + + FDeleteStoreRequest(const FDeleteStoreRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + StoreId(src.StoreId) + {} + + FDeleteStoreRequest(const TSharedPtr& obj) : FDeleteStoreRequest() + { + readFromValue(obj); + } + + ~FDeleteStoreRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteStoreResult : public FPlayFabBaseModel + { + FDeleteStoreResult() : + FPlayFabBaseModel() + {} + + FDeleteStoreResult(const FDeleteStoreResult& src) : + FPlayFabBaseModel() + {} + + FDeleteStoreResult(const TSharedPtr& obj) : FDeleteStoreResult() + { + readFromValue(obj); + } + + ~FDeleteStoreResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteTaskRequest : public FPlayFabBaseModel + { + // [optional] Specify either the task ID or the name of task to be deleted. + TSharedPtr Identifier; + + FDeleteTaskRequest() : + FPlayFabBaseModel(), + Identifier(nullptr) + {} + + FDeleteTaskRequest(const FDeleteTaskRequest& src) : + FPlayFabBaseModel(), + Identifier(src.Identifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.Identifier)) : nullptr) + {} + + FDeleteTaskRequest(const TSharedPtr& obj) : FDeleteTaskRequest() + { + readFromValue(obj); + } + + ~FDeleteTaskRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteTitleRequest : public FPlayFabBaseModel + { + FDeleteTitleRequest() : + FPlayFabBaseModel() + {} + + FDeleteTitleRequest(const FDeleteTitleRequest& src) : + FPlayFabBaseModel() + {} + + FDeleteTitleRequest(const TSharedPtr& obj) : FDeleteTitleRequest() + { + readFromValue(obj); + } + + ~FDeleteTitleRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteTitleResult : public FPlayFabBaseModel + { + FDeleteTitleResult() : + FPlayFabBaseModel() + {} + + FDeleteTitleResult(const FDeleteTitleResult& src) : + FPlayFabBaseModel() + {} + + FDeleteTitleResult(const TSharedPtr& obj) : FDeleteTitleResult() + { + readFromValue(obj); + } + + ~FDeleteTitleResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum EffectType + { + EffectTypeAllow, + EffectTypeDeny + }; + + PLAYFABCPP_API void writeEffectTypeEnumJSON(EffectType enumVal, JsonWriter& writer); + PLAYFABCPP_API EffectType readEffectTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API EffectType readEffectTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FEmptyResponse : public FPlayFabBaseModel + { + FEmptyResponse() : + FPlayFabBaseModel() + {} + + FEmptyResponse(const FEmptyResponse& src) : + FPlayFabBaseModel() + {} + + FEmptyResponse(const TSharedPtr& obj) : FEmptyResponse() + { + readFromValue(obj); + } + + ~FEmptyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExportMasterPlayerDataRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FExportMasterPlayerDataRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FExportMasterPlayerDataRequest(const FExportMasterPlayerDataRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FExportMasterPlayerDataRequest(const TSharedPtr& obj) : FExportMasterPlayerDataRequest() + { + readFromValue(obj); + } + + ~FExportMasterPlayerDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExportMasterPlayerDataResult : public FPlayFabBaseModel + { + /** + * [optional] An email with this job receipt Id containing the export download link will be sent to the title notification email + * address when the export is complete. + */ + FString JobReceiptId; + + FExportMasterPlayerDataResult() : + FPlayFabBaseModel(), + JobReceiptId() + {} + + FExportMasterPlayerDataResult(const FExportMasterPlayerDataResult& src) : + FPlayFabBaseModel(), + JobReceiptId(src.JobReceiptId) + {} + + FExportMasterPlayerDataResult(const TSharedPtr& obj) : FExportMasterPlayerDataResult() + { + readFromValue(obj); + } + + ~FExportMasterPlayerDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGameModeInfo : public FPlayFabBaseModel + { + // specific game mode type + FString Gamemode; + + // maximum user count a specific Game Server Instance can support + uint32 MaxPlayerCount; + + // minimum user count required for this Game Server Instance to continue (usually 1) + uint32 MinPlayerCount; + + // [optional] whether to start as an open session, meaning that players can matchmake into it (defaults to true) + Boxed StartOpen; + + FGameModeInfo() : + FPlayFabBaseModel(), + Gamemode(), + MaxPlayerCount(0), + MinPlayerCount(0), + StartOpen() + {} + + FGameModeInfo(const FGameModeInfo& src) : + FPlayFabBaseModel(), + Gamemode(src.Gamemode), + MaxPlayerCount(src.MaxPlayerCount), + MinPlayerCount(src.MinPlayerCount), + StartOpen(src.StartOpen) + {} + + FGameModeInfo(const TSharedPtr& obj) : FGameModeInfo() + { + readFromValue(obj); + } + + ~FGameModeInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetActionsOnPlayersInSegmentTaskInstanceResult : public FPlayFabBaseModel + { + // [optional] Parameter of this task instance + TSharedPtr Parameter; + + // [optional] Status summary of the actions-on-players-in-segment task instance + TSharedPtr Summary; + + FGetActionsOnPlayersInSegmentTaskInstanceResult() : + FPlayFabBaseModel(), + Parameter(nullptr), + Summary(nullptr) + {} + + FGetActionsOnPlayersInSegmentTaskInstanceResult(const FGetActionsOnPlayersInSegmentTaskInstanceResult& src) : + FPlayFabBaseModel(), + Parameter(src.Parameter.IsValid() ? MakeShareable(new FActionsOnPlayersInSegmentTaskParameter(*src.Parameter)) : nullptr), + Summary(src.Summary.IsValid() ? MakeShareable(new FActionsOnPlayersInSegmentTaskSummary(*src.Summary)) : nullptr) + {} + + FGetActionsOnPlayersInSegmentTaskInstanceResult(const TSharedPtr& obj) : FGetActionsOnPlayersInSegmentTaskInstanceResult() + { + readFromValue(obj); + } + + ~FGetActionsOnPlayersInSegmentTaskInstanceResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetAllSegmentsRequest : public FPlayFabBaseModel + { + FGetAllSegmentsRequest() : + FPlayFabBaseModel() + {} + + FGetAllSegmentsRequest(const FGetAllSegmentsRequest& src) : + FPlayFabBaseModel() + {} + + FGetAllSegmentsRequest(const TSharedPtr& obj) : FGetAllSegmentsRequest() + { + readFromValue(obj); + } + + ~FGetAllSegmentsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSegmentResult : public FPlayFabBaseModel + { + // [optional] Identifier of the segments AB Test, if it is attached to one. + FString ABTestParent; + + // Unique identifier for this segment. + FString Id; + + // [optional] Segment name. + FString Name; + + FGetSegmentResult() : + FPlayFabBaseModel(), + ABTestParent(), + Id(), + Name() + {} + + FGetSegmentResult(const FGetSegmentResult& src) : + FPlayFabBaseModel(), + ABTestParent(src.ABTestParent), + Id(src.Id), + Name(src.Name) + {} + + FGetSegmentResult(const TSharedPtr& obj) : FGetSegmentResult() + { + readFromValue(obj); + } + + ~FGetSegmentResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetAllSegmentsResult : public FPlayFabBaseModel + { + // [optional] Array of segments for this title. + TArray Segments; + FGetAllSegmentsResult() : + FPlayFabBaseModel(), + Segments() + {} + + FGetAllSegmentsResult(const FGetAllSegmentsResult& src) : + FPlayFabBaseModel(), + Segments(src.Segments) + {} + + FGetAllSegmentsResult(const TSharedPtr& obj) : FGetAllSegmentsResult() + { + readFromValue(obj); + } + + ~FGetAllSegmentsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCatalogItemsRequest : public FPlayFabBaseModel + { + // [optional] Which catalog is being requested. If null, uses the default catalog. + FString CatalogVersion; + + FGetCatalogItemsRequest() : + FPlayFabBaseModel(), + CatalogVersion() + {} + + FGetCatalogItemsRequest(const FGetCatalogItemsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion) + {} + + FGetCatalogItemsRequest(const TSharedPtr& obj) : FGetCatalogItemsRequest() + { + readFromValue(obj); + } + + ~FGetCatalogItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCatalogItemsResult : public FPlayFabBaseModel + { + // [optional] Array of items which can be purchased. + TArray Catalog; + FGetCatalogItemsResult() : + FPlayFabBaseModel(), + Catalog() + {} + + FGetCatalogItemsResult(const FGetCatalogItemsResult& src) : + FPlayFabBaseModel(), + Catalog(src.Catalog) + {} + + FGetCatalogItemsResult(const TSharedPtr& obj) : FGetCatalogItemsResult() + { + readFromValue(obj); + } + + ~FGetCatalogItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCloudScriptRevisionRequest : public FPlayFabBaseModel + { + // [optional] Revision number. If left null, defaults to the latest revision + Boxed Revision; + + // [optional] Version number. If left null, defaults to the latest version + Boxed Version; + + FGetCloudScriptRevisionRequest() : + FPlayFabBaseModel(), + Revision(), + Version() + {} + + FGetCloudScriptRevisionRequest(const FGetCloudScriptRevisionRequest& src) : + FPlayFabBaseModel(), + Revision(src.Revision), + Version(src.Version) + {} + + FGetCloudScriptRevisionRequest(const TSharedPtr& obj) : FGetCloudScriptRevisionRequest() + { + readFromValue(obj); + } + + ~FGetCloudScriptRevisionRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCloudScriptRevisionResult : public FPlayFabBaseModel + { + // Time this revision was created + FDateTime CreatedAt; + + // [optional] List of Cloud Script files in this revision. + TArray Files; + // True if this is the currently published revision + bool IsPublished; + + // Revision number. + int32 Revision; + + // Version number. + int32 Version; + + FGetCloudScriptRevisionResult() : + FPlayFabBaseModel(), + CreatedAt(0), + Files(), + IsPublished(false), + Revision(0), + Version(0) + {} + + FGetCloudScriptRevisionResult(const FGetCloudScriptRevisionResult& src) : + FPlayFabBaseModel(), + CreatedAt(src.CreatedAt), + Files(src.Files), + IsPublished(src.IsPublished), + Revision(src.Revision), + Version(src.Version) + {} + + FGetCloudScriptRevisionResult(const TSharedPtr& obj) : FGetCloudScriptRevisionResult() + { + readFromValue(obj); + } + + ~FGetCloudScriptRevisionResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCloudScriptTaskInstanceResult : public FPlayFabBaseModel + { + // [optional] Parameter of this task instance + TSharedPtr Parameter; + + // [optional] Status summary of the CloudScript task instance + TSharedPtr Summary; + + FGetCloudScriptTaskInstanceResult() : + FPlayFabBaseModel(), + Parameter(nullptr), + Summary(nullptr) + {} + + FGetCloudScriptTaskInstanceResult(const FGetCloudScriptTaskInstanceResult& src) : + FPlayFabBaseModel(), + Parameter(src.Parameter.IsValid() ? MakeShareable(new FCloudScriptTaskParameter(*src.Parameter)) : nullptr), + Summary(src.Summary.IsValid() ? MakeShareable(new FCloudScriptTaskSummary(*src.Summary)) : nullptr) + {} + + FGetCloudScriptTaskInstanceResult(const TSharedPtr& obj) : FGetCloudScriptTaskInstanceResult() + { + readFromValue(obj); + } + + ~FGetCloudScriptTaskInstanceResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCloudScriptVersionsRequest : public FPlayFabBaseModel + { + FGetCloudScriptVersionsRequest() : + FPlayFabBaseModel() + {} + + FGetCloudScriptVersionsRequest(const FGetCloudScriptVersionsRequest& src) : + FPlayFabBaseModel() + {} + + FGetCloudScriptVersionsRequest(const TSharedPtr& obj) : FGetCloudScriptVersionsRequest() + { + readFromValue(obj); + } + + ~FGetCloudScriptVersionsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCloudScriptVersionsResult : public FPlayFabBaseModel + { + // [optional] List of versions + TArray Versions; + FGetCloudScriptVersionsResult() : + FPlayFabBaseModel(), + Versions() + {} + + FGetCloudScriptVersionsResult(const FGetCloudScriptVersionsResult& src) : + FPlayFabBaseModel(), + Versions(src.Versions) + {} + + FGetCloudScriptVersionsResult(const TSharedPtr& obj) : FGetCloudScriptVersionsResult() + { + readFromValue(obj); + } + + ~FGetCloudScriptVersionsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentListRequest : public FPlayFabBaseModel + { + /** + * [optional] Limits the response to keys that begin with the specified prefix. You can use prefixes to list contents under a folder, + * or for a specified version, etc. + */ + FString Prefix; + + FGetContentListRequest() : + FPlayFabBaseModel(), + Prefix() + {} + + FGetContentListRequest(const FGetContentListRequest& src) : + FPlayFabBaseModel(), + Prefix(src.Prefix) + {} + + FGetContentListRequest(const TSharedPtr& obj) : FGetContentListRequest() + { + readFromValue(obj); + } + + ~FGetContentListRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentListResult : public FPlayFabBaseModel + { + // [optional] List of content items. + TArray Contents; + // Number of content items returned. We currently have a maximum of 1000 items limit. + int32 ItemCount; + + // The total size of listed contents in bytes. + uint32 TotalSize; + + FGetContentListResult() : + FPlayFabBaseModel(), + Contents(), + ItemCount(0), + TotalSize(0) + {} + + FGetContentListResult(const FGetContentListResult& src) : + FPlayFabBaseModel(), + Contents(src.Contents), + ItemCount(src.ItemCount), + TotalSize(src.TotalSize) + {} + + FGetContentListResult(const TSharedPtr& obj) : FGetContentListResult() + { + readFromValue(obj); + } + + ~FGetContentListResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentUploadUrlRequest : public FPlayFabBaseModel + { + /** + * [optional] A standard MIME type describing the format of the contents. The same MIME type has to be set in the header when + * uploading the content. If not specified, the MIME type is 'binary/octet-stream' by default. + */ + FString ContentType; + + // Key of the content item to upload, usually formatted as a path, e.g. images/a.png + FString Key; + + FGetContentUploadUrlRequest() : + FPlayFabBaseModel(), + ContentType(), + Key() + {} + + FGetContentUploadUrlRequest(const FGetContentUploadUrlRequest& src) : + FPlayFabBaseModel(), + ContentType(src.ContentType), + Key(src.Key) + {} + + FGetContentUploadUrlRequest(const TSharedPtr& obj) : FGetContentUploadUrlRequest() + { + readFromValue(obj); + } + + ~FGetContentUploadUrlRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentUploadUrlResult : public FPlayFabBaseModel + { + // [optional] URL for uploading content via HTTP PUT method. The URL will expire in approximately one hour. + FString URL; + + FGetContentUploadUrlResult() : + FPlayFabBaseModel(), + URL() + {} + + FGetContentUploadUrlResult(const FGetContentUploadUrlResult& src) : + FPlayFabBaseModel(), + URL(src.URL) + {} + + FGetContentUploadUrlResult(const TSharedPtr& obj) : FGetContentUploadUrlResult() + { + readFromValue(obj); + } + + ~FGetContentUploadUrlResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetDataReportRequest : public FPlayFabBaseModel + { + // Reporting year (UTC) + int32 Day; + + // Reporting month (UTC) + int32 Month; + + // Report name + FString ReportName; + + // Reporting year (UTC) + int32 Year; + + FGetDataReportRequest() : + FPlayFabBaseModel(), + Day(0), + Month(0), + ReportName(), + Year(0) + {} + + FGetDataReportRequest(const FGetDataReportRequest& src) : + FPlayFabBaseModel(), + Day(src.Day), + Month(src.Month), + ReportName(src.ReportName), + Year(src.Year) + {} + + FGetDataReportRequest(const TSharedPtr& obj) : FGetDataReportRequest() + { + readFromValue(obj); + } + + ~FGetDataReportRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetDataReportResult : public FPlayFabBaseModel + { + // [optional] The URL where the requested report can be downloaded. + FString DownloadUrl; + + FGetDataReportResult() : + FPlayFabBaseModel(), + DownloadUrl() + {} + + FGetDataReportResult(const FGetDataReportResult& src) : + FPlayFabBaseModel(), + DownloadUrl(src.DownloadUrl) + {} + + FGetDataReportResult(const TSharedPtr& obj) : FGetDataReportResult() + { + readFromValue(obj); + } + + ~FGetDataReportResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetMatchmakerGameInfoRequest : public FPlayFabBaseModel + { + // unique identifier of the lobby for which info is being requested + FString LobbyId; + + FGetMatchmakerGameInfoRequest() : + FPlayFabBaseModel(), + LobbyId() + {} + + FGetMatchmakerGameInfoRequest(const FGetMatchmakerGameInfoRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId) + {} + + FGetMatchmakerGameInfoRequest(const TSharedPtr& obj) : FGetMatchmakerGameInfoRequest() + { + readFromValue(obj); + } + + ~FGetMatchmakerGameInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetMatchmakerGameInfoResult : public FPlayFabBaseModel + { + // [optional] version identifier of the game server executable binary being run + FString BuildVersion; + + // [optional] time when Game Server Instance is currently scheduled to end + Boxed EndTime; + + // [optional] unique identifier of the lobby + FString LobbyId; + + // [optional] game mode for this Game Server Instance + FString Mode; + + // [optional] array of unique PlayFab identifiers for users currently connected to this Game Server Instance + TArray Players; + // [optional] region in which the Game Server Instance is running + Boxed pfRegion; + + // [optional] IPV4 address of the game server instance + FString ServerAddress; + + // [optional] IPV4 address of the server + FString ServerIPV4Address; + + // [optional] IPV6 address of the server + FString ServerIPV6Address; + + // communication port for this Game Server Instance + uint32 ServerPort; + + // [optional] Public DNS name (if any) of the server + FString ServerPublicDNSName; + + // time when the Game Server Instance was created + FDateTime StartTime; + + // [optional] unique identifier of the Game Server Instance for this lobby + FString TitleId; + + FGetMatchmakerGameInfoResult() : + FPlayFabBaseModel(), + BuildVersion(), + EndTime(), + LobbyId(), + Mode(), + Players(), + pfRegion(), + ServerAddress(), + ServerIPV4Address(), + ServerIPV6Address(), + ServerPort(0), + ServerPublicDNSName(), + StartTime(0), + TitleId() + {} + + FGetMatchmakerGameInfoResult(const FGetMatchmakerGameInfoResult& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + EndTime(src.EndTime), + LobbyId(src.LobbyId), + Mode(src.Mode), + Players(src.Players), + pfRegion(src.pfRegion), + ServerAddress(src.ServerAddress), + ServerIPV4Address(src.ServerIPV4Address), + ServerIPV6Address(src.ServerIPV6Address), + ServerPort(src.ServerPort), + ServerPublicDNSName(src.ServerPublicDNSName), + StartTime(src.StartTime), + TitleId(src.TitleId) + {} + + FGetMatchmakerGameInfoResult(const TSharedPtr& obj) : FGetMatchmakerGameInfoResult() + { + readFromValue(obj); + } + + ~FGetMatchmakerGameInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetMatchmakerGameModesRequest : public FPlayFabBaseModel + { + // previously uploaded build version for which game modes are being requested + FString BuildVersion; + + FGetMatchmakerGameModesRequest() : + FPlayFabBaseModel(), + BuildVersion() + {} + + FGetMatchmakerGameModesRequest(const FGetMatchmakerGameModesRequest& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion) + {} + + FGetMatchmakerGameModesRequest(const TSharedPtr& obj) : FGetMatchmakerGameModesRequest() + { + readFromValue(obj); + } + + ~FGetMatchmakerGameModesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetMatchmakerGameModesResult : public FPlayFabBaseModel + { + // [optional] array of game modes available for the specified build + TArray GameModes; + FGetMatchmakerGameModesResult() : + FPlayFabBaseModel(), + GameModes() + {} + + FGetMatchmakerGameModesResult(const FGetMatchmakerGameModesResult& src) : + FPlayFabBaseModel(), + GameModes(src.GameModes) + {} + + FGetMatchmakerGameModesResult(const TSharedPtr& obj) : FGetMatchmakerGameModesResult() + { + readFromValue(obj); + } + + ~FGetMatchmakerGameModesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayedTitleListRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayedTitleListRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetPlayedTitleListRequest(const FGetPlayedTitleListRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetPlayedTitleListRequest(const TSharedPtr& obj) : FGetPlayedTitleListRequest() + { + readFromValue(obj); + } + + ~FGetPlayedTitleListRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayedTitleListResult : public FPlayFabBaseModel + { + // [optional] List of titles the player has played + TArray TitleIds; + FGetPlayedTitleListResult() : + FPlayFabBaseModel(), + TitleIds() + {} + + FGetPlayedTitleListResult(const FGetPlayedTitleListResult& src) : + FPlayFabBaseModel(), + TitleIds(src.TitleIds) + {} + + FGetPlayedTitleListResult(const TSharedPtr& obj) : FGetPlayedTitleListResult() + { + readFromValue(obj); + } + + ~FGetPlayedTitleListResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerIdFromAuthTokenRequest : public FPlayFabBaseModel + { + // The auth token of the player requesting the password reset. + FString Token; + + // The type of auth token of the player requesting the password reset. + AuthTokenType TokenType; + + FGetPlayerIdFromAuthTokenRequest() : + FPlayFabBaseModel(), + Token(), + TokenType() + {} + + FGetPlayerIdFromAuthTokenRequest(const FGetPlayerIdFromAuthTokenRequest& src) : + FPlayFabBaseModel(), + Token(src.Token), + TokenType(src.TokenType) + {} + + FGetPlayerIdFromAuthTokenRequest(const TSharedPtr& obj) : FGetPlayerIdFromAuthTokenRequest() + { + readFromValue(obj); + } + + ~FGetPlayerIdFromAuthTokenRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerIdFromAuthTokenResult : public FPlayFabBaseModel + { + // [optional] The player ID from the token passed in + FString PlayFabId; + + FGetPlayerIdFromAuthTokenResult() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetPlayerIdFromAuthTokenResult(const FGetPlayerIdFromAuthTokenResult& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerIdFromAuthTokenResult(const TSharedPtr& obj) : FGetPlayerIdFromAuthTokenResult() + { + readFromValue(obj); + } + + ~FGetPlayerIdFromAuthTokenResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfileViewConstraints : public FPlayFabBaseModel + { + // Whether to show player's avatar URL. Defaults to false + bool ShowAvatarUrl; + + // Whether to show the banned until time. Defaults to false + bool ShowBannedUntil; + + // Whether to show campaign attributions. Defaults to false + bool ShowCampaignAttributions; + + // Whether to show contact email addresses. Defaults to false + bool ShowContactEmailAddresses; + + // Whether to show the created date. Defaults to false + bool ShowCreated; + + // Whether to show the display name. Defaults to false + bool ShowDisplayName; + + // Whether to show the last login time. Defaults to false + bool ShowLastLogin; + + // Whether to show the linked accounts. Defaults to false + bool ShowLinkedAccounts; + + // Whether to show player's locations. Defaults to false + bool ShowLocations; + + // Whether to show player's membership information. Defaults to false + bool ShowMemberships; + + // Whether to show origination. Defaults to false + bool ShowOrigination; + + // Whether to show push notification registrations. Defaults to false + bool ShowPushNotificationRegistrations; + + // Reserved for future development + bool ShowStatistics; + + // Whether to show tags. Defaults to false + bool ShowTags; + + // Whether to show the total value to date in usd. Defaults to false + bool ShowTotalValueToDateInUsd; + + // Whether to show the values to date. Defaults to false + bool ShowValuesToDate; + + FPlayerProfileViewConstraints() : + FPlayFabBaseModel(), + ShowAvatarUrl(false), + ShowBannedUntil(false), + ShowCampaignAttributions(false), + ShowContactEmailAddresses(false), + ShowCreated(false), + ShowDisplayName(false), + ShowLastLogin(false), + ShowLinkedAccounts(false), + ShowLocations(false), + ShowMemberships(false), + ShowOrigination(false), + ShowPushNotificationRegistrations(false), + ShowStatistics(false), + ShowTags(false), + ShowTotalValueToDateInUsd(false), + ShowValuesToDate(false) + {} + + FPlayerProfileViewConstraints(const FPlayerProfileViewConstraints& src) : + FPlayFabBaseModel(), + ShowAvatarUrl(src.ShowAvatarUrl), + ShowBannedUntil(src.ShowBannedUntil), + ShowCampaignAttributions(src.ShowCampaignAttributions), + ShowContactEmailAddresses(src.ShowContactEmailAddresses), + ShowCreated(src.ShowCreated), + ShowDisplayName(src.ShowDisplayName), + ShowLastLogin(src.ShowLastLogin), + ShowLinkedAccounts(src.ShowLinkedAccounts), + ShowLocations(src.ShowLocations), + ShowMemberships(src.ShowMemberships), + ShowOrigination(src.ShowOrigination), + ShowPushNotificationRegistrations(src.ShowPushNotificationRegistrations), + ShowStatistics(src.ShowStatistics), + ShowTags(src.ShowTags), + ShowTotalValueToDateInUsd(src.ShowTotalValueToDateInUsd), + ShowValuesToDate(src.ShowValuesToDate) + {} + + FPlayerProfileViewConstraints(const TSharedPtr& obj) : FPlayerProfileViewConstraints() + { + readFromValue(obj); + } + + ~FPlayerProfileViewConstraints(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerProfileRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + FGetPlayerProfileRequest() : + FPlayFabBaseModel(), + PlayFabId(), + ProfileConstraints(nullptr) + {} + + FGetPlayerProfileRequest(const FGetPlayerProfileRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr) + {} + + FGetPlayerProfileRequest(const TSharedPtr& obj) : FGetPlayerProfileRequest() + { + readFromValue(obj); + } + + ~FGetPlayerProfileRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum LoginIdentityProvider + { + LoginIdentityProviderUnknown, + LoginIdentityProviderPlayFab, + LoginIdentityProviderCustom, + LoginIdentityProviderGameCenter, + LoginIdentityProviderGooglePlay, + LoginIdentityProviderSteam, + LoginIdentityProviderXBoxLive, + LoginIdentityProviderPSN, + LoginIdentityProviderKongregate, + LoginIdentityProviderFacebook, + LoginIdentityProviderIOSDevice, + LoginIdentityProviderAndroidDevice, + LoginIdentityProviderTwitch, + LoginIdentityProviderWindowsHello, + LoginIdentityProviderGameServer, + LoginIdentityProviderCustomServer, + LoginIdentityProviderNintendoSwitch, + LoginIdentityProviderFacebookInstantGames, + LoginIdentityProviderOpenIdConnect + }; + + PLAYFABCPP_API void writeLoginIdentityProviderEnumJSON(LoginIdentityProvider enumVal, JsonWriter& writer); + PLAYFABCPP_API LoginIdentityProvider readLoginIdentityProviderFromValue(const TSharedPtr& value); + PLAYFABCPP_API LoginIdentityProvider readLoginIdentityProviderFromValue(const FString& value); + + struct PLAYFABCPP_API FLinkedPlatformAccountModel : public FPlayFabBaseModel + { + // [optional] Linked account email of the user on the platform, if available + FString Email; + + // [optional] Authentication platform + Boxed Platform; + + // [optional] Unique account identifier of the user on the platform + FString PlatformUserId; + + // [optional] Linked account username of the user on the platform, if available + FString Username; + + FLinkedPlatformAccountModel() : + FPlayFabBaseModel(), + Email(), + Platform(), + PlatformUserId(), + Username() + {} + + FLinkedPlatformAccountModel(const FLinkedPlatformAccountModel& src) : + FPlayFabBaseModel(), + Email(src.Email), + Platform(src.Platform), + PlatformUserId(src.PlatformUserId), + Username(src.Username) + {} + + FLinkedPlatformAccountModel(const TSharedPtr& obj) : FLinkedPlatformAccountModel() + { + readFromValue(obj); + } + + ~FLinkedPlatformAccountModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLocationModel : public FPlayFabBaseModel + { + // [optional] City name. + FString City; + + // [optional] The two-character continent code for this location + Boxed pfContinentCode; + + // [optional] The two-character ISO 3166-1 country code for the country associated with the location + Boxed pfCountryCode; + + // [optional] Latitude coordinate of the geographic location. + Boxed Latitude; + + // [optional] Longitude coordinate of the geographic location. + Boxed Longitude; + + FLocationModel() : + FPlayFabBaseModel(), + City(), + pfContinentCode(), + pfCountryCode(), + Latitude(), + Longitude() + {} + + FLocationModel(const FLocationModel& src) : + FPlayFabBaseModel(), + City(src.City), + pfContinentCode(src.pfContinentCode), + pfCountryCode(src.pfCountryCode), + Latitude(src.Latitude), + Longitude(src.Longitude) + {} + + FLocationModel(const TSharedPtr& obj) : FLocationModel() + { + readFromValue(obj); + } + + ~FLocationModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum SubscriptionProviderStatus + { + SubscriptionProviderStatusNoError, + SubscriptionProviderStatusCancelled, + SubscriptionProviderStatusUnknownError, + SubscriptionProviderStatusBillingError, + SubscriptionProviderStatusProductUnavailable, + SubscriptionProviderStatusCustomerDidNotAcceptPriceChange, + SubscriptionProviderStatusFreeTrial, + SubscriptionProviderStatusPaymentPending + }; + + PLAYFABCPP_API void writeSubscriptionProviderStatusEnumJSON(SubscriptionProviderStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API SubscriptionProviderStatus readSubscriptionProviderStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API SubscriptionProviderStatus readSubscriptionProviderStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FSubscriptionModel : public FPlayFabBaseModel + { + // When this subscription expires. + FDateTime Expiration; + + // The time the subscription was orignially purchased + FDateTime InitialSubscriptionTime; + + // Whether this subscription is currently active. That is, if Expiration > now. + bool IsActive; + + // [optional] The status of this subscription, according to the subscription provider. + Boxed Status; + + // [optional] The id for this subscription + FString SubscriptionId; + + // [optional] The item id for this subscription from the primary catalog + FString SubscriptionItemId; + + // [optional] The provider for this subscription. Apple or Google Play are supported today. + FString SubscriptionProvider; + + FSubscriptionModel() : + FPlayFabBaseModel(), + Expiration(0), + InitialSubscriptionTime(0), + IsActive(false), + Status(), + SubscriptionId(), + SubscriptionItemId(), + SubscriptionProvider() + {} + + FSubscriptionModel(const FSubscriptionModel& src) : + FPlayFabBaseModel(), + Expiration(src.Expiration), + InitialSubscriptionTime(src.InitialSubscriptionTime), + IsActive(src.IsActive), + Status(src.Status), + SubscriptionId(src.SubscriptionId), + SubscriptionItemId(src.SubscriptionItemId), + SubscriptionProvider(src.SubscriptionProvider) + {} + + FSubscriptionModel(const TSharedPtr& obj) : FSubscriptionModel() + { + readFromValue(obj); + } + + ~FSubscriptionModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMembershipModel : public FPlayFabBaseModel + { + // Whether this membership is active. That is, whether the MembershipExpiration time has been reached. + bool IsActive; + + // The time this membership expires + FDateTime MembershipExpiration; + + // [optional] The id of the membership + FString MembershipId; + + /** + * [optional] Membership expirations can be explicitly overridden (via game manager or the admin api). If this membership has been + * overridden, this will be the new expiration time. + */ + Boxed OverrideExpiration; + + // [optional] Whether the override expiration is set. + Boxed OverrideIsSet; + + // [optional] The list of subscriptions that this player has for this membership + TArray Subscriptions; + FMembershipModel() : + FPlayFabBaseModel(), + IsActive(false), + MembershipExpiration(0), + MembershipId(), + OverrideExpiration(), + OverrideIsSet(), + Subscriptions() + {} + + FMembershipModel(const FMembershipModel& src) : + FPlayFabBaseModel(), + IsActive(src.IsActive), + MembershipExpiration(src.MembershipExpiration), + MembershipId(src.MembershipId), + OverrideExpiration(src.OverrideExpiration), + OverrideIsSet(src.OverrideIsSet), + Subscriptions(src.Subscriptions) + {} + + FMembershipModel(const TSharedPtr& obj) : FMembershipModel() + { + readFromValue(obj); + } + + ~FMembershipModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum PushNotificationPlatform + { + PushNotificationPlatformApplePushNotificationService, + PushNotificationPlatformGoogleCloudMessaging + }; + + PLAYFABCPP_API void writePushNotificationPlatformEnumJSON(PushNotificationPlatform enumVal, JsonWriter& writer); + PLAYFABCPP_API PushNotificationPlatform readPushNotificationPlatformFromValue(const TSharedPtr& value); + PLAYFABCPP_API PushNotificationPlatform readPushNotificationPlatformFromValue(const FString& value); + + struct PLAYFABCPP_API FPushNotificationRegistrationModel : public FPlayFabBaseModel + { + // [optional] Notification configured endpoint + FString NotificationEndpointARN; + + // [optional] Push notification platform + Boxed Platform; + + FPushNotificationRegistrationModel() : + FPlayFabBaseModel(), + NotificationEndpointARN(), + Platform() + {} + + FPushNotificationRegistrationModel(const FPushNotificationRegistrationModel& src) : + FPlayFabBaseModel(), + NotificationEndpointARN(src.NotificationEndpointARN), + Platform(src.Platform) + {} + + FPushNotificationRegistrationModel(const TSharedPtr& obj) : FPushNotificationRegistrationModel() + { + readFromValue(obj); + } + + ~FPushNotificationRegistrationModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticModel : public FPlayFabBaseModel + { + // [optional] Statistic name + FString Name; + + // Statistic value + int32 Value; + + // Statistic version (0 if not a versioned statistic) + int32 Version; + + FStatisticModel() : + FPlayFabBaseModel(), + Name(), + Value(0), + Version(0) + {} + + FStatisticModel(const FStatisticModel& src) : + FPlayFabBaseModel(), + Name(src.Name), + Value(src.Value), + Version(src.Version) + {} + + FStatisticModel(const TSharedPtr& obj) : FStatisticModel() + { + readFromValue(obj); + } + + ~FStatisticModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FTagModel : public FPlayFabBaseModel + { + // [optional] Full value of the tag, including namespace + FString TagValue; + + FTagModel() : + FPlayFabBaseModel(), + TagValue() + {} + + FTagModel(const FTagModel& src) : + FPlayFabBaseModel(), + TagValue(src.TagValue) + {} + + FTagModel(const TSharedPtr& obj) : FTagModel() + { + readFromValue(obj); + } + + ~FTagModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValueToDateModel : public FPlayFabBaseModel + { + // [optional] ISO 4217 code of the currency used in the purchases + FString Currency; + + /** + * Total value of the purchases in a whole number of 1/100 monetary units. For example, 999 indicates nine dollars and + * ninety-nine cents when Currency is 'USD') + */ + uint32 TotalValue; + + /** + * [optional] Total value of the purchases in a string representation of decimal monetary units. For example, '9.99' indicates nine + * dollars and ninety-nine cents when Currency is 'USD'. + */ + FString TotalValueAsDecimal; + + FValueToDateModel() : + FPlayFabBaseModel(), + Currency(), + TotalValue(0), + TotalValueAsDecimal() + {} + + FValueToDateModel(const FValueToDateModel& src) : + FPlayFabBaseModel(), + Currency(src.Currency), + TotalValue(src.TotalValue), + TotalValueAsDecimal(src.TotalValueAsDecimal) + {} + + FValueToDateModel(const TSharedPtr& obj) : FValueToDateModel() + { + readFromValue(obj); + } + + ~FValueToDateModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfileModel : public FPlayFabBaseModel + { + // [optional] List of advertising campaigns the player has been attributed to + TArray AdCampaignAttributions; + // [optional] URL of the player's avatar image + FString AvatarUrl; + + // [optional] If the player is currently banned, the UTC Date when the ban expires + Boxed BannedUntil; + + // [optional] List of all contact email info associated with the player account + TArray ContactEmailAddresses; + // [optional] Player record created + Boxed Created; + + // [optional] Player display name + FString DisplayName; + + // [optional] UTC time when the player most recently logged in to the title + Boxed LastLogin; + + // [optional] List of all authentication systems linked to this player account + TArray LinkedAccounts; + // [optional] List of geographic locations from which the player has logged in to the title + TArray Locations; + // [optional] List of memberships for the player, along with whether are expired. + TArray Memberships; + // [optional] Player account origination + Boxed Origination; + + // [optional] PlayFab player account unique identifier + FString PlayerId; + + // [optional] Publisher this player belongs to + FString PublisherId; + + // [optional] List of configured end points registered for sending the player push notifications + TArray PushNotificationRegistrations; + // [optional] List of leaderboard statistic values for the player + TArray Statistics; + // [optional] List of player's tags for segmentation + TArray Tags; + // [optional] Title ID this player profile applies to + FString TitleId; + + /** + * [optional] Sum of the player's purchases made with real-money currencies, converted to US dollars equivalent and represented as a + * whole number of cents (1/100 USD). For example, 999 indicates nine dollars and ninety-nine cents. + */ + Boxed TotalValueToDateInUSD; + + // [optional] List of the player's lifetime purchase totals, summed by real-money currency + TArray ValuesToDate; + FPlayerProfileModel() : + FPlayFabBaseModel(), + AdCampaignAttributions(), + AvatarUrl(), + BannedUntil(), + ContactEmailAddresses(), + Created(), + DisplayName(), + LastLogin(), + LinkedAccounts(), + Locations(), + Memberships(), + Origination(), + PlayerId(), + PublisherId(), + PushNotificationRegistrations(), + Statistics(), + Tags(), + TitleId(), + TotalValueToDateInUSD(), + ValuesToDate() + {} + + FPlayerProfileModel(const FPlayerProfileModel& src) : + FPlayFabBaseModel(), + AdCampaignAttributions(src.AdCampaignAttributions), + AvatarUrl(src.AvatarUrl), + BannedUntil(src.BannedUntil), + ContactEmailAddresses(src.ContactEmailAddresses), + Created(src.Created), + DisplayName(src.DisplayName), + LastLogin(src.LastLogin), + LinkedAccounts(src.LinkedAccounts), + Locations(src.Locations), + Memberships(src.Memberships), + Origination(src.Origination), + PlayerId(src.PlayerId), + PublisherId(src.PublisherId), + PushNotificationRegistrations(src.PushNotificationRegistrations), + Statistics(src.Statistics), + Tags(src.Tags), + TitleId(src.TitleId), + TotalValueToDateInUSD(src.TotalValueToDateInUSD), + ValuesToDate(src.ValuesToDate) + {} + + FPlayerProfileModel(const TSharedPtr& obj) : FPlayerProfileModel() + { + readFromValue(obj); + } + + ~FPlayerProfileModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerProfileResult : public FPlayFabBaseModel + { + /** + * [optional] The profile of the player. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + TSharedPtr PlayerProfile; + + FGetPlayerProfileResult() : + FPlayFabBaseModel(), + PlayerProfile(nullptr) + {} + + FGetPlayerProfileResult(const FGetPlayerProfileResult& src) : + FPlayFabBaseModel(), + PlayerProfile(src.PlayerProfile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.PlayerProfile)) : nullptr) + {} + + FGetPlayerProfileResult(const TSharedPtr& obj) : FGetPlayerProfileResult() + { + readFromValue(obj); + } + + ~FGetPlayerProfileResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerSegmentsResult : public FPlayFabBaseModel + { + // [optional] Array of segments the requested player currently belongs to. + TArray Segments; + FGetPlayerSegmentsResult() : + FPlayFabBaseModel(), + Segments() + {} + + FGetPlayerSegmentsResult(const FGetPlayerSegmentsResult& src) : + FPlayFabBaseModel(), + Segments(src.Segments) + {} + + FGetPlayerSegmentsResult(const TSharedPtr& obj) : FGetPlayerSegmentsResult() + { + readFromValue(obj); + } + + ~FGetPlayerSegmentsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerSharedSecretsRequest : public FPlayFabBaseModel + { + FGetPlayerSharedSecretsRequest() : + FPlayFabBaseModel() + {} + + FGetPlayerSharedSecretsRequest(const FGetPlayerSharedSecretsRequest& src) : + FPlayFabBaseModel() + {} + + FGetPlayerSharedSecretsRequest(const TSharedPtr& obj) : FGetPlayerSharedSecretsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerSharedSecretsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSharedSecret : public FPlayFabBaseModel + { + // Flag to indicate if this key is disabled + bool Disabled; + + // [optional] Friendly name for this key + FString FriendlyName; + + // [optional] The player shared secret to use when calling Client/GetTitlePublicKey + FString SecretKey; + + FSharedSecret() : + FPlayFabBaseModel(), + Disabled(false), + FriendlyName(), + SecretKey() + {} + + FSharedSecret(const FSharedSecret& src) : + FPlayFabBaseModel(), + Disabled(src.Disabled), + FriendlyName(src.FriendlyName), + SecretKey(src.SecretKey) + {} + + FSharedSecret(const TSharedPtr& obj) : FSharedSecret() + { + readFromValue(obj); + } + + ~FSharedSecret(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerSharedSecretsResult : public FPlayFabBaseModel + { + // [optional] The player shared secret to use when calling Client/GetTitlePublicKey + TArray SharedSecrets; + FGetPlayerSharedSecretsResult() : + FPlayFabBaseModel(), + SharedSecrets() + {} + + FGetPlayerSharedSecretsResult(const FGetPlayerSharedSecretsResult& src) : + FPlayFabBaseModel(), + SharedSecrets(src.SharedSecrets) + {} + + FGetPlayerSharedSecretsResult(const TSharedPtr& obj) : FGetPlayerSharedSecretsResult() + { + readFromValue(obj); + } + + ~FGetPlayerSharedSecretsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayersInSegmentRequest : public FPlayFabBaseModel + { + // [optional] Continuation token if retrieving subsequent pages of results. + FString ContinuationToken; + + // [optional] Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. + Boxed MaxBatchSize; + + /** + * [optional] Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging + * results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). + */ + Boxed SecondsToLive; + + // Unique identifier for this segment. + FString SegmentId; + + FGetPlayersInSegmentRequest() : + FPlayFabBaseModel(), + ContinuationToken(), + MaxBatchSize(), + SecondsToLive(), + SegmentId() + {} + + FGetPlayersInSegmentRequest(const FGetPlayersInSegmentRequest& src) : + FPlayFabBaseModel(), + ContinuationToken(src.ContinuationToken), + MaxBatchSize(src.MaxBatchSize), + SecondsToLive(src.SecondsToLive), + SegmentId(src.SegmentId) + {} + + FGetPlayersInSegmentRequest(const TSharedPtr& obj) : FGetPlayersInSegmentRequest() + { + readFromValue(obj); + } + + ~FGetPlayersInSegmentRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLinkedAccount : public FPlayFabBaseModel + { + // [optional] Linked account's email + FString Email; + + // [optional] Authentication platform + Boxed Platform; + + // [optional] Platform user identifier + FString PlatformUserId; + + // [optional] Linked account's username + FString Username; + + FPlayerLinkedAccount() : + FPlayFabBaseModel(), + Email(), + Platform(), + PlatformUserId(), + Username() + {} + + FPlayerLinkedAccount(const FPlayerLinkedAccount& src) : + FPlayFabBaseModel(), + Email(src.Email), + Platform(src.Platform), + PlatformUserId(src.PlatformUserId), + Username(src.Username) + {} + + FPlayerLinkedAccount(const TSharedPtr& obj) : FPlayerLinkedAccount() + { + readFromValue(obj); + } + + ~FPlayerLinkedAccount(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLocation : public FPlayFabBaseModel + { + // [optional] City of the player's geographic location. + FString City; + + // The two-character continent code for this location + ContinentCode pfContinentCode; + + // The two-character ISO 3166-1 country code for the country associated with the location + CountryCode pfCountryCode; + + // [optional] Latitude coordinate of the player's geographic location. + Boxed Latitude; + + // [optional] Longitude coordinate of the player's geographic location. + Boxed Longitude; + + FPlayerLocation() : + FPlayFabBaseModel(), + City(), + pfContinentCode(), + pfCountryCode(), + Latitude(), + Longitude() + {} + + FPlayerLocation(const FPlayerLocation& src) : + FPlayFabBaseModel(), + City(src.City), + pfContinentCode(src.pfContinentCode), + pfCountryCode(src.pfCountryCode), + Latitude(src.Latitude), + Longitude(src.Longitude) + {} + + FPlayerLocation(const TSharedPtr& obj) : FPlayerLocation() + { + readFromValue(obj); + } + + ~FPlayerLocation(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerStatistic : public FPlayFabBaseModel + { + // [optional] Statistic ID + FString Id; + + // [optional] Statistic name + FString Name; + + // Current statistic value + int32 StatisticValue; + + // Statistic version (0 if not a versioned statistic) + int32 StatisticVersion; + + FPlayerStatistic() : + FPlayFabBaseModel(), + Id(), + Name(), + StatisticValue(0), + StatisticVersion(0) + {} + + FPlayerStatistic(const FPlayerStatistic& src) : + FPlayFabBaseModel(), + Id(src.Id), + Name(src.Name), + StatisticValue(src.StatisticValue), + StatisticVersion(src.StatisticVersion) + {} + + FPlayerStatistic(const TSharedPtr& obj) : FPlayerStatistic() + { + readFromValue(obj); + } + + ~FPlayerStatistic(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPushNotificationRegistration : public FPlayFabBaseModel + { + // [optional] Notification configured endpoint + FString NotificationEndpointARN; + + // [optional] Push notification platform + Boxed Platform; + + FPushNotificationRegistration() : + FPlayFabBaseModel(), + NotificationEndpointARN(), + Platform() + {} + + FPushNotificationRegistration(const FPushNotificationRegistration& src) : + FPlayFabBaseModel(), + NotificationEndpointARN(src.NotificationEndpointARN), + Platform(src.Platform) + {} + + FPushNotificationRegistration(const TSharedPtr& obj) : FPushNotificationRegistration() + { + readFromValue(obj); + } + + ~FPushNotificationRegistration(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfile : public FPlayFabBaseModel + { + // [optional] Array of ad campaigns player has been attributed to + TArray AdCampaignAttributions; + // [optional] Image URL of the player's avatar. + FString AvatarUrl; + + // [optional] Banned until UTC Date. If permanent ban this is set for 20 years after the original ban date. + Boxed BannedUntil; + + // [optional] Array of contact email addresses associated with the player + TArray ContactEmailAddresses; + // [optional] Player record created + Boxed Created; + + // [optional] Player Display Name + FString DisplayName; + + // [optional] Last login + Boxed LastLogin; + + // [optional] Array of third party accounts linked to this player + TArray LinkedAccounts; + // [optional] Dictionary of player's locations by type. + TMap Locations; + // [optional] Player account origination + Boxed Origination; + + // [optional] PlayFab Player ID + FString PlayerId; + + // [optional] Array of player statistics + TArray PlayerStatistics; + // [optional] Publisher this player belongs to + FString PublisherId; + + // [optional] Array of configured push notification end points + TArray PushNotificationRegistrations; + // [optional] Dictionary of player's statistics using only the latest version's value + TMap Statistics; + // [optional] List of player's tags for segmentation. + TArray Tags; + // [optional] Title ID this profile applies to + FString TitleId; + + // [optional] A sum of player's total purchases in USD across all currencies. + Boxed TotalValueToDateInUSD; + + // [optional] Dictionary of player's total purchases by currency. + TMap ValuesToDate; + // [optional] Dictionary of player's virtual currency balances + TMap VirtualCurrencyBalances; + FPlayerProfile() : + FPlayFabBaseModel(), + AdCampaignAttributions(), + AvatarUrl(), + BannedUntil(), + ContactEmailAddresses(), + Created(), + DisplayName(), + LastLogin(), + LinkedAccounts(), + Locations(), + Origination(), + PlayerId(), + PlayerStatistics(), + PublisherId(), + PushNotificationRegistrations(), + Statistics(), + Tags(), + TitleId(), + TotalValueToDateInUSD(), + ValuesToDate(), + VirtualCurrencyBalances() + {} + + FPlayerProfile(const FPlayerProfile& src) : + FPlayFabBaseModel(), + AdCampaignAttributions(src.AdCampaignAttributions), + AvatarUrl(src.AvatarUrl), + BannedUntil(src.BannedUntil), + ContactEmailAddresses(src.ContactEmailAddresses), + Created(src.Created), + DisplayName(src.DisplayName), + LastLogin(src.LastLogin), + LinkedAccounts(src.LinkedAccounts), + Locations(src.Locations), + Origination(src.Origination), + PlayerId(src.PlayerId), + PlayerStatistics(src.PlayerStatistics), + PublisherId(src.PublisherId), + PushNotificationRegistrations(src.PushNotificationRegistrations), + Statistics(src.Statistics), + Tags(src.Tags), + TitleId(src.TitleId), + TotalValueToDateInUSD(src.TotalValueToDateInUSD), + ValuesToDate(src.ValuesToDate), + VirtualCurrencyBalances(src.VirtualCurrencyBalances) + {} + + FPlayerProfile(const TSharedPtr& obj) : FPlayerProfile() + { + readFromValue(obj); + } + + ~FPlayerProfile(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayersInSegmentResult : public FPlayFabBaseModel + { + // [optional] Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. + FString ContinuationToken; + + // [optional] Array of player profiles in this segment. + TArray PlayerProfiles; + // Count of profiles matching this segment. + int32 ProfilesInSegment; + + FGetPlayersInSegmentResult() : + FPlayFabBaseModel(), + ContinuationToken(), + PlayerProfiles(), + ProfilesInSegment(0) + {} + + FGetPlayersInSegmentResult(const FGetPlayersInSegmentResult& src) : + FPlayFabBaseModel(), + ContinuationToken(src.ContinuationToken), + PlayerProfiles(src.PlayerProfiles), + ProfilesInSegment(src.ProfilesInSegment) + {} + + FGetPlayersInSegmentResult(const TSharedPtr& obj) : FGetPlayersInSegmentResult() + { + readFromValue(obj); + } + + ~FGetPlayersInSegmentResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayersSegmentsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayersSegmentsRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetPlayersSegmentsRequest(const FGetPlayersSegmentsRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetPlayersSegmentsRequest(const TSharedPtr& obj) : FGetPlayersSegmentsRequest() + { + readFromValue(obj); + } + + ~FGetPlayersSegmentsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticDefinitionsRequest : public FPlayFabBaseModel + { + FGetPlayerStatisticDefinitionsRequest() : + FPlayFabBaseModel() + {} + + FGetPlayerStatisticDefinitionsRequest(const FGetPlayerStatisticDefinitionsRequest& src) : + FPlayFabBaseModel() + {} + + FGetPlayerStatisticDefinitionsRequest(const TSharedPtr& obj) : FGetPlayerStatisticDefinitionsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticDefinitionsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticDefinitionsResult : public FPlayFabBaseModel + { + // [optional] the player statistic definitions for the title + TArray Statistics; + FGetPlayerStatisticDefinitionsResult() : + FPlayFabBaseModel(), + Statistics() + {} + + FGetPlayerStatisticDefinitionsResult(const FGetPlayerStatisticDefinitionsResult& src) : + FPlayFabBaseModel(), + Statistics(src.Statistics) + {} + + FGetPlayerStatisticDefinitionsResult(const TSharedPtr& obj) : FGetPlayerStatisticDefinitionsResult() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticDefinitionsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticVersionsRequest : public FPlayFabBaseModel + { + // [optional] unique name of the statistic + FString StatisticName; + + FGetPlayerStatisticVersionsRequest() : + FPlayFabBaseModel(), + StatisticName() + {} + + FGetPlayerStatisticVersionsRequest(const FGetPlayerStatisticVersionsRequest& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName) + {} + + FGetPlayerStatisticVersionsRequest(const TSharedPtr& obj) : FGetPlayerStatisticVersionsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticVersionsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum StatisticVersionStatus + { + StatisticVersionStatusActive, + StatisticVersionStatusSnapshotPending, + StatisticVersionStatusSnapshot, + StatisticVersionStatusArchivalPending, + StatisticVersionStatusArchived + }; + + PLAYFABCPP_API void writeStatisticVersionStatusEnumJSON(StatisticVersionStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API StatisticVersionStatus readStatisticVersionStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API StatisticVersionStatus readStatisticVersionStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FPlayerStatisticVersion : public FPlayFabBaseModel + { + // time when the statistic version became active + FDateTime ActivationTime; + + // [optional] URL for the downloadable archive of player statistic values, if available + FString ArchiveDownloadUrl; + + // [optional] time when the statistic version became inactive due to statistic version incrementing + Boxed DeactivationTime; + + // [optional] time at which the statistic version was scheduled to become active, based on the configured ResetInterval + Boxed ScheduledActivationTime; + + // [optional] time at which the statistic version was scheduled to become inactive, based on the configured ResetInterval + Boxed ScheduledDeactivationTime; + + // [optional] name of the statistic when the version became active + FString StatisticName; + + // [optional] status of the statistic version + Boxed Status; + + // version of the statistic + uint32 Version; + + FPlayerStatisticVersion() : + FPlayFabBaseModel(), + ActivationTime(0), + ArchiveDownloadUrl(), + DeactivationTime(), + ScheduledActivationTime(), + ScheduledDeactivationTime(), + StatisticName(), + Status(), + Version(0) + {} + + FPlayerStatisticVersion(const FPlayerStatisticVersion& src) : + FPlayFabBaseModel(), + ActivationTime(src.ActivationTime), + ArchiveDownloadUrl(src.ArchiveDownloadUrl), + DeactivationTime(src.DeactivationTime), + ScheduledActivationTime(src.ScheduledActivationTime), + ScheduledDeactivationTime(src.ScheduledDeactivationTime), + StatisticName(src.StatisticName), + Status(src.Status), + Version(src.Version) + {} + + FPlayerStatisticVersion(const TSharedPtr& obj) : FPlayerStatisticVersion() + { + readFromValue(obj); + } + + ~FPlayerStatisticVersion(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticVersionsResult : public FPlayFabBaseModel + { + // [optional] version change history of the statistic + TArray StatisticVersions; + FGetPlayerStatisticVersionsResult() : + FPlayFabBaseModel(), + StatisticVersions() + {} + + FGetPlayerStatisticVersionsResult(const FGetPlayerStatisticVersionsResult& src) : + FPlayFabBaseModel(), + StatisticVersions(src.StatisticVersions) + {} + + FGetPlayerStatisticVersionsResult(const TSharedPtr& obj) : FGetPlayerStatisticVersionsResult() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticVersionsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTagsRequest : public FPlayFabBaseModel + { + // [optional] Optional namespace to filter results by + FString Namespace; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayerTagsRequest() : + FPlayFabBaseModel(), + Namespace(), + PlayFabId() + {} + + FGetPlayerTagsRequest(const FGetPlayerTagsRequest& src) : + FPlayFabBaseModel(), + Namespace(src.Namespace), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerTagsRequest(const TSharedPtr& obj) : FGetPlayerTagsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerTagsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTagsResult : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Canonical tags (including namespace and tag's name) for the requested user + TArray Tags; + FGetPlayerTagsResult() : + FPlayFabBaseModel(), + PlayFabId(), + Tags() + {} + + FGetPlayerTagsResult(const FGetPlayerTagsResult& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + Tags(src.Tags) + {} + + FGetPlayerTagsResult(const TSharedPtr& obj) : FGetPlayerTagsResult() + { + readFromValue(obj); + } + + ~FGetPlayerTagsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPolicyRequest : public FPlayFabBaseModel + { + // [optional] The name of the policy to read. Only supported name is 'ApiPolicy'. + FString PolicyName; + + FGetPolicyRequest() : + FPlayFabBaseModel(), + PolicyName() + {} + + FGetPolicyRequest(const FGetPolicyRequest& src) : + FPlayFabBaseModel(), + PolicyName(src.PolicyName) + {} + + FGetPolicyRequest(const TSharedPtr& obj) : FGetPolicyRequest() + { + readFromValue(obj); + } + + ~FGetPolicyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPermissionStatement : public FPlayFabBaseModel + { + // The action this statement effects. The only supported action is 'Execute'. + FString Action; + + // [optional] Additional conditions to be applied for API Resources. + TSharedPtr ApiConditions; + + // [optional] A comment about the statement. Intended solely for bookkeeping and debugging. + FString Comment; + + // The effect this statement will have. It could be either Allow or Deny + EffectType Effect; + + // The principal this statement will effect. The only supported principal is '*'. + FString Principal; + + /** + * The resource this statements effects. The only supported resources look like 'pfrn:api--*' for all apis, or + * 'pfrn:api--/Client/ConfirmPurchase' for specific apis. + */ + FString Resource; + + FPermissionStatement() : + FPlayFabBaseModel(), + Action(), + ApiConditions(nullptr), + Comment(), + Effect(), + Principal(), + Resource() + {} + + FPermissionStatement(const FPermissionStatement& src) : + FPlayFabBaseModel(), + Action(src.Action), + ApiConditions(src.ApiConditions.IsValid() ? MakeShareable(new FApiCondition(*src.ApiConditions)) : nullptr), + Comment(src.Comment), + Effect(src.Effect), + Principal(src.Principal), + Resource(src.Resource) + {} + + FPermissionStatement(const TSharedPtr& obj) : FPermissionStatement() + { + readFromValue(obj); + } + + ~FPermissionStatement(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPolicyResponse : public FPlayFabBaseModel + { + // [optional] The name of the policy read. + FString PolicyName; + + // [optional] The statements in the requested policy. + TArray Statements; + FGetPolicyResponse() : + FPlayFabBaseModel(), + PolicyName(), + Statements() + {} + + FGetPolicyResponse(const FGetPolicyResponse& src) : + FPlayFabBaseModel(), + PolicyName(src.PolicyName), + Statements(src.Statements) + {} + + FGetPolicyResponse(const TSharedPtr& obj) : FGetPolicyResponse() + { + readFromValue(obj); + } + + ~FGetPolicyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPublisherDataRequest : public FPlayFabBaseModel + { + // array of keys to get back data from the Publisher data blob, set by the admin tools + TArray Keys; + FGetPublisherDataRequest() : + FPlayFabBaseModel(), + Keys() + {} + + FGetPublisherDataRequest(const FGetPublisherDataRequest& src) : + FPlayFabBaseModel(), + Keys(src.Keys) + {} + + FGetPublisherDataRequest(const TSharedPtr& obj) : FGetPublisherDataRequest() + { + readFromValue(obj); + } + + ~FGetPublisherDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPublisherDataResult : public FPlayFabBaseModel + { + // [optional] a dictionary object of key / value pairs + TMap Data; + FGetPublisherDataResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPublisherDataResult(const FGetPublisherDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPublisherDataResult(const TSharedPtr& obj) : FGetPublisherDataResult() + { + readFromValue(obj); + } + + ~FGetPublisherDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetRandomResultTablesRequest : public FPlayFabBaseModel + { + // [optional] catalog version to fetch tables from. Use default catalog version if null + FString CatalogVersion; + + FGetRandomResultTablesRequest() : + FPlayFabBaseModel(), + CatalogVersion() + {} + + FGetRandomResultTablesRequest(const FGetRandomResultTablesRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion) + {} + + FGetRandomResultTablesRequest(const TSharedPtr& obj) : FGetRandomResultTablesRequest() + { + readFromValue(obj); + } + + ~FGetRandomResultTablesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ResultTableNodeType + { + ResultTableNodeTypeItemId, + ResultTableNodeTypeTableId + }; + + PLAYFABCPP_API void writeResultTableNodeTypeEnumJSON(ResultTableNodeType enumVal, JsonWriter& writer); + PLAYFABCPP_API ResultTableNodeType readResultTableNodeTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ResultTableNodeType readResultTableNodeTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FResultTableNode : public FPlayFabBaseModel + { + // Either an ItemId, or the TableId of another random result table + FString ResultItem; + + // Whether this entry in the table is an item or a link to another table + ResultTableNodeType ResultItemType; + + // How likely this is to be rolled - larger numbers add more weight + int32 Weight; + + FResultTableNode() : + FPlayFabBaseModel(), + ResultItem(), + ResultItemType(), + Weight(0) + {} + + FResultTableNode(const FResultTableNode& src) : + FPlayFabBaseModel(), + ResultItem(src.ResultItem), + ResultItemType(src.ResultItemType), + Weight(src.Weight) + {} + + FResultTableNode(const TSharedPtr& obj) : FResultTableNode() + { + readFromValue(obj); + } + + ~FResultTableNode(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRandomResultTableListing : public FPlayFabBaseModel + { + // [optional] Catalog version this table is associated with + FString CatalogVersion; + + // Child nodes that indicate what kind of drop table item this actually is. + TArray Nodes; + // Unique name for this drop table + FString TableId; + + FRandomResultTableListing() : + FPlayFabBaseModel(), + CatalogVersion(), + Nodes(), + TableId() + {} + + FRandomResultTableListing(const FRandomResultTableListing& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + Nodes(src.Nodes), + TableId(src.TableId) + {} + + FRandomResultTableListing(const TSharedPtr& obj) : FRandomResultTableListing() + { + readFromValue(obj); + } + + ~FRandomResultTableListing(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetRandomResultTablesResult : public FPlayFabBaseModel + { + // [optional] array of random result tables currently available + TMap Tables; + FGetRandomResultTablesResult() : + FPlayFabBaseModel(), + Tables() + {} + + FGetRandomResultTablesResult(const FGetRandomResultTablesResult& src) : + FPlayFabBaseModel(), + Tables(src.Tables) + {} + + FGetRandomResultTablesResult(const TSharedPtr& obj) : FGetRandomResultTablesResult() + { + readFromValue(obj); + } + + ~FGetRandomResultTablesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetServerBuildInfoRequest : public FPlayFabBaseModel + { + // unique identifier of the previously uploaded build executable for which information is being requested + FString BuildId; + + FGetServerBuildInfoRequest() : + FPlayFabBaseModel(), + BuildId() + {} + + FGetServerBuildInfoRequest(const FGetServerBuildInfoRequest& src) : + FPlayFabBaseModel(), + BuildId(src.BuildId) + {} + + FGetServerBuildInfoRequest(const TSharedPtr& obj) : FGetServerBuildInfoRequest() + { + readFromValue(obj); + } + + ~FGetServerBuildInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetServerBuildInfoResult : public FPlayFabBaseModel + { + // [optional] array of regions where this build can used, when it is active + TArray ActiveRegions; + // [optional] unique identifier for this build executable + FString BuildId; + + // [optional] developer comment(s) for this build + FString Comment; + + // [optional] error message, if any, about this build + FString ErrorMessage; + + // maximum number of game server instances that can run on a single host machine + int32 MaxGamesPerHost; + + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + int32 MinFreeGameSlots; + + // [optional] the current status of the build validation and processing steps + Boxed Status; + + // time this build was last modified (or uploaded, if this build has never been modified) + FDateTime Timestamp; + + /** + * [optional] Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FGetServerBuildInfoResult() : + FPlayFabBaseModel(), + ActiveRegions(), + BuildId(), + Comment(), + ErrorMessage(), + MaxGamesPerHost(0), + MinFreeGameSlots(0), + Status(), + Timestamp(0), + TitleId() + {} + + FGetServerBuildInfoResult(const FGetServerBuildInfoResult& src) : + FPlayFabBaseModel(), + ActiveRegions(src.ActiveRegions), + BuildId(src.BuildId), + Comment(src.Comment), + ErrorMessage(src.ErrorMessage), + MaxGamesPerHost(src.MaxGamesPerHost), + MinFreeGameSlots(src.MinFreeGameSlots), + Status(src.Status), + Timestamp(src.Timestamp), + TitleId(src.TitleId) + {} + + FGetServerBuildInfoResult(const TSharedPtr& obj) : FGetServerBuildInfoResult() + { + readFromValue(obj); + } + + ~FGetServerBuildInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetServerBuildUploadURLRequest : public FPlayFabBaseModel + { + // unique identifier of the game server build to upload + FString BuildId; + + FGetServerBuildUploadURLRequest() : + FPlayFabBaseModel(), + BuildId() + {} + + FGetServerBuildUploadURLRequest(const FGetServerBuildUploadURLRequest& src) : + FPlayFabBaseModel(), + BuildId(src.BuildId) + {} + + FGetServerBuildUploadURLRequest(const TSharedPtr& obj) : FGetServerBuildUploadURLRequest() + { + readFromValue(obj); + } + + ~FGetServerBuildUploadURLRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetServerBuildUploadURLResult : public FPlayFabBaseModel + { + // [optional] pre-authorized URL for uploading the game server build package + FString URL; + + FGetServerBuildUploadURLResult() : + FPlayFabBaseModel(), + URL() + {} + + FGetServerBuildUploadURLResult(const FGetServerBuildUploadURLResult& src) : + FPlayFabBaseModel(), + URL(src.URL) + {} + + FGetServerBuildUploadURLResult(const TSharedPtr& obj) : FGetServerBuildUploadURLResult() + { + readFromValue(obj); + } + + ~FGetServerBuildUploadURLResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetStoreItemsRequest : public FPlayFabBaseModel + { + // [optional] catalog version to store items from. Use default catalog version if null + FString CatalogVersion; + + // Unqiue identifier for the store which is being requested. + FString StoreId; + + FGetStoreItemsRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + StoreId() + {} + + FGetStoreItemsRequest(const FGetStoreItemsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + StoreId(src.StoreId) + {} + + FGetStoreItemsRequest(const TSharedPtr& obj) : FGetStoreItemsRequest() + { + readFromValue(obj); + } + + ~FGetStoreItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStoreMarketingModel : public FPlayFabBaseModel + { + // [optional] Tagline for a store. + FString Description; + + // [optional] Display name of a store as it will appear to users. + FString DisplayName; + + // [optional] Custom data about a store. + FJsonKeeper Metadata; + + FStoreMarketingModel() : + FPlayFabBaseModel(), + Description(), + DisplayName(), + Metadata() + {} + + FStoreMarketingModel(const FStoreMarketingModel& src) : + FPlayFabBaseModel(), + Description(src.Description), + DisplayName(src.DisplayName), + Metadata(src.Metadata) + {} + + FStoreMarketingModel(const TSharedPtr& obj) : FStoreMarketingModel() + { + readFromValue(obj); + } + + ~FStoreMarketingModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum SourceType + { + SourceTypeAdmin, + SourceTypeBackEnd, + SourceTypeGameClient, + SourceTypeGameServer, + SourceTypePartner, + SourceTypeCustom, + SourceTypeAPI + }; + + PLAYFABCPP_API void writeSourceTypeEnumJSON(SourceType enumVal, JsonWriter& writer); + PLAYFABCPP_API SourceType readSourceTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API SourceType readSourceTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FStoreItem : public FPlayFabBaseModel + { + // [optional] Store specific custom data. The data only exists as part of this store; it is not transferred to item instances + FJsonKeeper CustomData; + + // [optional] Intended display position for this item. Note that 0 is the first position + Boxed DisplayPosition; + + /** + * Unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the + * catalog + */ + FString ItemId; + + // [optional] Override prices for this item for specific currencies + TMap RealCurrencyPrices; + // [optional] Override prices for this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + TMap VirtualCurrencyPrices; + FStoreItem() : + FPlayFabBaseModel(), + CustomData(), + DisplayPosition(), + ItemId(), + RealCurrencyPrices(), + VirtualCurrencyPrices() + {} + + FStoreItem(const FStoreItem& src) : + FPlayFabBaseModel(), + CustomData(src.CustomData), + DisplayPosition(src.DisplayPosition), + ItemId(src.ItemId), + RealCurrencyPrices(src.RealCurrencyPrices), + VirtualCurrencyPrices(src.VirtualCurrencyPrices) + {} + + FStoreItem(const TSharedPtr& obj) : FStoreItem() + { + readFromValue(obj); + } + + ~FStoreItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetStoreItemsResult : public FPlayFabBaseModel + { + // [optional] The base catalog that this store is a part of. + FString CatalogVersion; + + // [optional] Additional data about the store. + TSharedPtr MarketingData; + + // [optional] How the store was last updated (Admin or a third party). + Boxed Source; + + // [optional] Array of items which can be purchased from this store. + TArray Store; + // [optional] The ID of this store. + FString StoreId; + + FGetStoreItemsResult() : + FPlayFabBaseModel(), + CatalogVersion(), + MarketingData(nullptr), + Source(), + Store(), + StoreId() + {} + + FGetStoreItemsResult(const FGetStoreItemsResult& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + MarketingData(src.MarketingData.IsValid() ? MakeShareable(new FStoreMarketingModel(*src.MarketingData)) : nullptr), + Source(src.Source), + Store(src.Store), + StoreId(src.StoreId) + {} + + FGetStoreItemsResult(const TSharedPtr& obj) : FGetStoreItemsResult() + { + readFromValue(obj); + } + + ~FGetStoreItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTaskInstanceRequest : public FPlayFabBaseModel + { + // ID of the requested task instance. + FString TaskInstanceId; + + FGetTaskInstanceRequest() : + FPlayFabBaseModel(), + TaskInstanceId() + {} + + FGetTaskInstanceRequest(const FGetTaskInstanceRequest& src) : + FPlayFabBaseModel(), + TaskInstanceId(src.TaskInstanceId) + {} + + FGetTaskInstanceRequest(const TSharedPtr& obj) : FGetTaskInstanceRequest() + { + readFromValue(obj); + } + + ~FGetTaskInstanceRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTaskInstancesRequest : public FPlayFabBaseModel + { + // [optional] Optional range-from filter for task instances' StartedAt timestamp. + Boxed StartedAtRangeFrom; + + // [optional] Optional range-to filter for task instances' StartedAt timestamp. + Boxed StartedAtRangeTo; + + // [optional] Optional filter for task instances that are of a specific status. + Boxed StatusFilter; + + /** + * [optional] Name or ID of the task whose instances are being queried. If not specified, return all task instances that satisfy + * conditions set by other filters. + */ + TSharedPtr TaskIdentifier; + + FGetTaskInstancesRequest() : + FPlayFabBaseModel(), + StartedAtRangeFrom(), + StartedAtRangeTo(), + StatusFilter(), + TaskIdentifier(nullptr) + {} + + FGetTaskInstancesRequest(const FGetTaskInstancesRequest& src) : + FPlayFabBaseModel(), + StartedAtRangeFrom(src.StartedAtRangeFrom), + StartedAtRangeTo(src.StartedAtRangeTo), + StatusFilter(src.StatusFilter), + TaskIdentifier(src.TaskIdentifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.TaskIdentifier)) : nullptr) + {} + + FGetTaskInstancesRequest(const TSharedPtr& obj) : FGetTaskInstancesRequest() + { + readFromValue(obj); + } + + ~FGetTaskInstancesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ScheduledTaskType + { + ScheduledTaskTypeCloudScript, + ScheduledTaskTypeActionsOnPlayerSegment + }; + + PLAYFABCPP_API void writeScheduledTaskTypeEnumJSON(ScheduledTaskType enumVal, JsonWriter& writer); + PLAYFABCPP_API ScheduledTaskType readScheduledTaskTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ScheduledTaskType readScheduledTaskTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FTaskInstanceBasicSummary : public FPlayFabBaseModel + { + // [optional] UTC timestamp when the task completed. + Boxed CompletedAt; + + // [optional] Estimated time remaining in seconds. + Boxed EstimatedSecondsRemaining; + + // [optional] Progress represented as percentage. + Boxed PercentComplete; + + // [optional] If manually scheduled, ID of user who scheduled the task. + FString ScheduledByUserId; + + // UTC timestamp when the task started. + FDateTime StartedAt; + + // [optional] Current status of the task instance. + Boxed Status; + + // [optional] Identifier of the task this instance belongs to. + TSharedPtr TaskIdentifier; + + // [optional] ID of the task instance. + FString TaskInstanceId; + + // [optional] Type of the task. + Boxed Type; + + FTaskInstanceBasicSummary() : + FPlayFabBaseModel(), + CompletedAt(), + EstimatedSecondsRemaining(), + PercentComplete(), + ScheduledByUserId(), + StartedAt(0), + Status(), + TaskIdentifier(nullptr), + TaskInstanceId(), + Type() + {} + + FTaskInstanceBasicSummary(const FTaskInstanceBasicSummary& src) : + FPlayFabBaseModel(), + CompletedAt(src.CompletedAt), + EstimatedSecondsRemaining(src.EstimatedSecondsRemaining), + PercentComplete(src.PercentComplete), + ScheduledByUserId(src.ScheduledByUserId), + StartedAt(src.StartedAt), + Status(src.Status), + TaskIdentifier(src.TaskIdentifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.TaskIdentifier)) : nullptr), + TaskInstanceId(src.TaskInstanceId), + Type(src.Type) + {} + + FTaskInstanceBasicSummary(const TSharedPtr& obj) : FTaskInstanceBasicSummary() + { + readFromValue(obj); + } + + ~FTaskInstanceBasicSummary(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTaskInstancesResult : public FPlayFabBaseModel + { + /** + * [optional] Basic status summaries of the queried task instances. Empty If no task instances meets the filter criteria. To get + * detailed status summary, use Get*TaskInstance API according to task type (e.g. + * GetActionsOnPlayersInSegmentTaskInstance). + */ + TArray Summaries; + FGetTaskInstancesResult() : + FPlayFabBaseModel(), + Summaries() + {} + + FGetTaskInstancesResult(const FGetTaskInstancesResult& src) : + FPlayFabBaseModel(), + Summaries(src.Summaries) + {} + + FGetTaskInstancesResult(const TSharedPtr& obj) : FGetTaskInstancesResult() + { + readFromValue(obj); + } + + ~FGetTaskInstancesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTasksRequest : public FPlayFabBaseModel + { + // [optional] Provide either the task ID or the task name to get a specific task. If not specified, return all defined tasks. + TSharedPtr Identifier; + + FGetTasksRequest() : + FPlayFabBaseModel(), + Identifier(nullptr) + {} + + FGetTasksRequest(const FGetTasksRequest& src) : + FPlayFabBaseModel(), + Identifier(src.Identifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.Identifier)) : nullptr) + {} + + FGetTasksRequest(const TSharedPtr& obj) : FGetTasksRequest() + { + readFromValue(obj); + } + + ~FGetTasksRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FScheduledTask : public FPlayFabBaseModel + { + // [optional] Description the task + FString Description; + + // Whether the schedule is active. Inactive schedule will not trigger task execution. + bool IsActive; + + // [optional] UTC time of last run + Boxed LastRunTime; + + // Name of the task. This is a unique identifier for tasks in the title. + FString Name; + + // [optional] UTC time of next run + Boxed NextRunTime; + + /** + * [optional] Task parameter. Different types of task have different parameter structure. See each task type's create API + * documentation for the details. + */ + FJsonKeeper Parameter; + + // [optional] Cron expression for the run schedule of the task. The expression should be in UTC. + FString Schedule; + + // [optional] ID of the task + FString TaskId; + + // [optional] Task type. + Boxed Type; + + FScheduledTask() : + FPlayFabBaseModel(), + Description(), + IsActive(false), + LastRunTime(), + Name(), + NextRunTime(), + Parameter(), + Schedule(), + TaskId(), + Type() + {} + + FScheduledTask(const FScheduledTask& src) : + FPlayFabBaseModel(), + Description(src.Description), + IsActive(src.IsActive), + LastRunTime(src.LastRunTime), + Name(src.Name), + NextRunTime(src.NextRunTime), + Parameter(src.Parameter), + Schedule(src.Schedule), + TaskId(src.TaskId), + Type(src.Type) + {} + + FScheduledTask(const TSharedPtr& obj) : FScheduledTask() + { + readFromValue(obj); + } + + ~FScheduledTask(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTasksResult : public FPlayFabBaseModel + { + // [optional] Result tasks. Empty if there is no task found. + TArray Tasks; + FGetTasksResult() : + FPlayFabBaseModel(), + Tasks() + {} + + FGetTasksResult(const FGetTasksResult& src) : + FPlayFabBaseModel(), + Tasks(src.Tasks) + {} + + FGetTasksResult(const TSharedPtr& obj) : FGetTasksResult() + { + readFromValue(obj); + } + + ~FGetTasksResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleDataRequest : public FPlayFabBaseModel + { + // [optional] Specific keys to search for in the title data (leave null to get all keys) + TArray Keys; + FGetTitleDataRequest() : + FPlayFabBaseModel(), + Keys() + {} + + FGetTitleDataRequest(const FGetTitleDataRequest& src) : + FPlayFabBaseModel(), + Keys(src.Keys) + {} + + FGetTitleDataRequest(const TSharedPtr& obj) : FGetTitleDataRequest() + { + readFromValue(obj); + } + + ~FGetTitleDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleDataResult : public FPlayFabBaseModel + { + // [optional] a dictionary object of key / value pairs + TMap Data; + FGetTitleDataResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetTitleDataResult(const FGetTitleDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetTitleDataResult(const TSharedPtr& obj) : FGetTitleDataResult() + { + readFromValue(obj); + } + + ~FGetTitleDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserBansRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserBansRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetUserBansRequest(const FGetUserBansRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetUserBansRequest(const TSharedPtr& obj) : FGetUserBansRequest() + { + readFromValue(obj); + } + + ~FGetUserBansRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserBansResult : public FPlayFabBaseModel + { + // [optional] Information about the bans + TArray BanData; + FGetUserBansResult() : + FPlayFabBaseModel(), + BanData() + {} + + FGetUserBansResult(const FGetUserBansResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FGetUserBansResult(const TSharedPtr& obj) : FGetUserBansResult() + { + readFromValue(obj); + } + + ~FGetUserBansResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserDataRequest : public FPlayFabBaseModel + { + /** + * [optional] The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + Boxed IfChangedFromDataVersion; + + // [optional] Specific keys to search for in the custom user data. + TArray Keys; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserDataRequest() : + FPlayFabBaseModel(), + IfChangedFromDataVersion(), + Keys(), + PlayFabId() + {} + + FGetUserDataRequest(const FGetUserDataRequest& src) : + FPlayFabBaseModel(), + IfChangedFromDataVersion(src.IfChangedFromDataVersion), + Keys(src.Keys), + PlayFabId(src.PlayFabId) + {} + + FGetUserDataRequest(const TSharedPtr& obj) : FGetUserDataRequest() + { + readFromValue(obj); + } + + ~FGetUserDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum UserDataPermission + { + UserDataPermissionPrivate, + UserDataPermissionPublic + }; + + PLAYFABCPP_API void writeUserDataPermissionEnumJSON(UserDataPermission enumVal, JsonWriter& writer); + PLAYFABCPP_API UserDataPermission readUserDataPermissionFromValue(const TSharedPtr& value); + PLAYFABCPP_API UserDataPermission readUserDataPermissionFromValue(const FString& value); + + struct PLAYFABCPP_API FUserDataRecord : public FPlayFabBaseModel + { + // Timestamp for when this data was last updated. + FDateTime LastUpdated; + + /** + * [optional] Indicates whether this data can be read by all users (public) or only the user (private). This is used for GetUserData + * requests being made by one player about another player. + */ + Boxed Permission; + + // [optional] Data stored for the specified user data key. + FString Value; + + FUserDataRecord() : + FPlayFabBaseModel(), + LastUpdated(0), + Permission(), + Value() + {} + + FUserDataRecord(const FUserDataRecord& src) : + FPlayFabBaseModel(), + LastUpdated(src.LastUpdated), + Permission(src.Permission), + Value(src.Value) + {} + + FUserDataRecord(const TSharedPtr& obj) : FUserDataRecord() + { + readFromValue(obj); + } + + ~FUserDataRecord(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserDataResult : public FPlayFabBaseModel + { + // [optional] User specific data for this title. + TMap Data; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + // [optional] PlayFab unique identifier of the user whose custom data is being returned. + FString PlayFabId; + + FGetUserDataResult() : + FPlayFabBaseModel(), + Data(), + DataVersion(0), + PlayFabId() + {} + + FGetUserDataResult(const FGetUserDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data), + DataVersion(src.DataVersion), + PlayFabId(src.PlayFabId) + {} + + FGetUserDataResult(const TSharedPtr& obj) : FGetUserDataResult() + { + readFromValue(obj); + } + + ~FGetUserDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserInventoryRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserInventoryRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetUserInventoryRequest(const FGetUserInventoryRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetUserInventoryRequest(const TSharedPtr& obj) : FGetUserInventoryRequest() + { + readFromValue(obj); + } + + ~FGetUserInventoryRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemInstance : public FPlayFabBaseModel + { + // [optional] Game specific comment associated with this instance when it was added to the user inventory. + FString Annotation; + + // [optional] Array of unique items that were awarded when this catalog item was purchased. + TArray BundleContents; + /** + * [optional] Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or + * container. + */ + FString BundleParent; + + // [optional] Catalog version for the inventory item, when this instance was created. + FString CatalogVersion; + + // [optional] A set of custom key-value pairs on the inventory item. + TMap CustomData; + // [optional] CatalogItem.DisplayName at the time this item was purchased. + FString DisplayName; + + // [optional] Timestamp for when this instance will expire. + Boxed Expiration; + + // [optional] Class name for the inventory item, as defined in the catalog. + FString ItemClass; + + // [optional] Unique identifier for the inventory item, as defined in the catalog. + FString ItemId; + + // [optional] Unique item identifier for this specific instance of the item. + FString ItemInstanceId; + + // [optional] Timestamp for when this instance was purchased. + Boxed PurchaseDate; + + // [optional] Total number of remaining uses, if this is a consumable item. + Boxed RemainingUses; + + // [optional] Currency type for the cost of the catalog item. + FString UnitCurrency; + + // Cost of the catalog item in the given currency. + uint32 UnitPrice; + + // [optional] The number of uses that were added or removed to this item in this call. + Boxed UsesIncrementedBy; + + FItemInstance() : + FPlayFabBaseModel(), + Annotation(), + BundleContents(), + BundleParent(), + CatalogVersion(), + CustomData(), + DisplayName(), + Expiration(), + ItemClass(), + ItemId(), + ItemInstanceId(), + PurchaseDate(), + RemainingUses(), + UnitCurrency(), + UnitPrice(0), + UsesIncrementedBy() + {} + + FItemInstance(const FItemInstance& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + BundleContents(src.BundleContents), + BundleParent(src.BundleParent), + CatalogVersion(src.CatalogVersion), + CustomData(src.CustomData), + DisplayName(src.DisplayName), + Expiration(src.Expiration), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + PurchaseDate(src.PurchaseDate), + RemainingUses(src.RemainingUses), + UnitCurrency(src.UnitCurrency), + UnitPrice(src.UnitPrice), + UsesIncrementedBy(src.UsesIncrementedBy) + {} + + FItemInstance(const TSharedPtr& obj) : FItemInstance() + { + readFromValue(obj); + } + + ~FItemInstance(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FVirtualCurrencyRechargeTime : public FPlayFabBaseModel + { + /** + * Maximum value to which the regenerating currency will automatically increment. Note that it can exceed this value + * through use of the AddUserVirtualCurrency API call. However, it will not regenerate automatically until it has fallen + * below this value. + */ + int32 RechargeMax; + + // Server timestamp in UTC indicating the next time the virtual currency will be incremented. + FDateTime RechargeTime; + + // Time remaining (in seconds) before the next recharge increment of the virtual currency. + int32 SecondsToRecharge; + + FVirtualCurrencyRechargeTime() : + FPlayFabBaseModel(), + RechargeMax(0), + RechargeTime(0), + SecondsToRecharge(0) + {} + + FVirtualCurrencyRechargeTime(const FVirtualCurrencyRechargeTime& src) : + FPlayFabBaseModel(), + RechargeMax(src.RechargeMax), + RechargeTime(src.RechargeTime), + SecondsToRecharge(src.SecondsToRecharge) + {} + + FVirtualCurrencyRechargeTime(const TSharedPtr& obj) : FVirtualCurrencyRechargeTime() + { + readFromValue(obj); + } + + ~FVirtualCurrencyRechargeTime(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserInventoryResult : public FPlayFabBaseModel + { + // [optional] Array of inventory items belonging to the user. + TArray Inventory; + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] Array of virtual currency balance(s) belonging to the user. + TMap VirtualCurrency; + // [optional] Array of remaining times and timestamps for virtual currencies. + TMap VirtualCurrencyRechargeTimes; + FGetUserInventoryResult() : + FPlayFabBaseModel(), + Inventory(), + PlayFabId(), + VirtualCurrency(), + VirtualCurrencyRechargeTimes() + {} + + FGetUserInventoryResult(const FGetUserInventoryResult& src) : + FPlayFabBaseModel(), + Inventory(src.Inventory), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency), + VirtualCurrencyRechargeTimes(src.VirtualCurrencyRechargeTimes) + {} + + FGetUserInventoryResult(const TSharedPtr& obj) : FGetUserInventoryResult() + { + readFromValue(obj); + } + + ~FGetUserInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantedItemInstance : public FPlayFabBaseModel + { + // [optional] Game specific comment associated with this instance when it was added to the user inventory. + FString Annotation; + + // [optional] Array of unique items that were awarded when this catalog item was purchased. + TArray BundleContents; + /** + * [optional] Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or + * container. + */ + FString BundleParent; + + // [optional] Catalog version for the inventory item, when this instance was created. + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] A set of custom key-value pairs on the inventory item. + TMap CustomData; + // [optional] CatalogItem.DisplayName at the time this item was purchased. + FString DisplayName; + + // [optional] Timestamp for when this instance will expire. + Boxed Expiration; + + // [optional] Class name for the inventory item, as defined in the catalog. + FString ItemClass; + + // [optional] Unique identifier for the inventory item, as defined in the catalog. + FString ItemId; + + // [optional] Unique item identifier for this specific instance of the item. + FString ItemInstanceId; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] Timestamp for when this instance was purchased. + Boxed PurchaseDate; + + // [optional] Total number of remaining uses, if this is a consumable item. + Boxed RemainingUses; + + // Result of this operation. + bool Result; + + // [optional] Currency type for the cost of the catalog item. + FString UnitCurrency; + + // Cost of the catalog item in the given currency. + uint32 UnitPrice; + + // [optional] The number of uses that were added or removed to this item in this call. + Boxed UsesIncrementedBy; + + FGrantedItemInstance() : + FPlayFabBaseModel(), + Annotation(), + BundleContents(), + BundleParent(), + CatalogVersion(), + CharacterId(), + CustomData(), + DisplayName(), + Expiration(), + ItemClass(), + ItemId(), + ItemInstanceId(), + PlayFabId(), + PurchaseDate(), + RemainingUses(), + Result(false), + UnitCurrency(), + UnitPrice(0), + UsesIncrementedBy() + {} + + FGrantedItemInstance(const FGrantedItemInstance& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + BundleContents(src.BundleContents), + BundleParent(src.BundleParent), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + CustomData(src.CustomData), + DisplayName(src.DisplayName), + Expiration(src.Expiration), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId), + PurchaseDate(src.PurchaseDate), + RemainingUses(src.RemainingUses), + Result(src.Result), + UnitCurrency(src.UnitCurrency), + UnitPrice(src.UnitPrice), + UsesIncrementedBy(src.UsesIncrementedBy) + {} + + FGrantedItemInstance(const TSharedPtr& obj) : FGrantedItemInstance() + { + readFromValue(obj); + } + + ~FGrantedItemInstance(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemGrant : public FPlayFabBaseModel + { + // [optional] String detailing any additional information concerning this operation. + FString Annotation; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + // Unique identifier of the catalog item to be granted to the user. + FString ItemId; + + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FItemGrant() : + FPlayFabBaseModel(), + Annotation(), + CharacterId(), + Data(), + ItemId(), + KeysToRemove(), + PlayFabId() + {} + + FItemGrant(const FItemGrant& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + CharacterId(src.CharacterId), + Data(src.Data), + ItemId(src.ItemId), + KeysToRemove(src.KeysToRemove), + PlayFabId(src.PlayFabId) + {} + + FItemGrant(const TSharedPtr& obj) : FItemGrant() + { + readFromValue(obj); + } + + ~FItemGrant(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToUsersRequest : public FPlayFabBaseModel + { + // [optional] Catalog version from which items are to be granted. + FString CatalogVersion; + + // Array of items to grant and the users to whom the items are to be granted. + TArray ItemGrants; + FGrantItemsToUsersRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + ItemGrants() + {} + + FGrantItemsToUsersRequest(const FGrantItemsToUsersRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + ItemGrants(src.ItemGrants) + {} + + FGrantItemsToUsersRequest(const TSharedPtr& obj) : FGrantItemsToUsersRequest() + { + readFromValue(obj); + } + + ~FGrantItemsToUsersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToUsersResult : public FPlayFabBaseModel + { + // [optional] Array of items granted to users. + TArray ItemGrantResults; + FGrantItemsToUsersResult() : + FPlayFabBaseModel(), + ItemGrantResults() + {} + + FGrantItemsToUsersResult(const FGrantItemsToUsersResult& src) : + FPlayFabBaseModel(), + ItemGrantResults(src.ItemGrantResults) + {} + + FGrantItemsToUsersResult(const TSharedPtr& obj) : FGrantItemsToUsersResult() + { + readFromValue(obj); + } + + ~FGrantItemsToUsersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FIncrementLimitedEditionItemAvailabilityRequest : public FPlayFabBaseModel + { + // Amount to increase availability by. + int32 Amount; + + // [optional] Which catalog is being updated. If null, uses the default catalog. + FString CatalogVersion; + + // The item which needs more availability. + FString ItemId; + + FIncrementLimitedEditionItemAvailabilityRequest() : + FPlayFabBaseModel(), + Amount(0), + CatalogVersion(), + ItemId() + {} + + FIncrementLimitedEditionItemAvailabilityRequest(const FIncrementLimitedEditionItemAvailabilityRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + CatalogVersion(src.CatalogVersion), + ItemId(src.ItemId) + {} + + FIncrementLimitedEditionItemAvailabilityRequest(const TSharedPtr& obj) : FIncrementLimitedEditionItemAvailabilityRequest() + { + readFromValue(obj); + } + + ~FIncrementLimitedEditionItemAvailabilityRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FIncrementLimitedEditionItemAvailabilityResult : public FPlayFabBaseModel + { + FIncrementLimitedEditionItemAvailabilityResult() : + FPlayFabBaseModel() + {} + + FIncrementLimitedEditionItemAvailabilityResult(const FIncrementLimitedEditionItemAvailabilityResult& src) : + FPlayFabBaseModel() + {} + + FIncrementLimitedEditionItemAvailabilityResult(const TSharedPtr& obj) : FIncrementLimitedEditionItemAvailabilityResult() + { + readFromValue(obj); + } + + ~FIncrementLimitedEditionItemAvailabilityResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FIncrementPlayerStatisticVersionRequest : public FPlayFabBaseModel + { + // [optional] unique name of the statistic + FString StatisticName; + + FIncrementPlayerStatisticVersionRequest() : + FPlayFabBaseModel(), + StatisticName() + {} + + FIncrementPlayerStatisticVersionRequest(const FIncrementPlayerStatisticVersionRequest& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName) + {} + + FIncrementPlayerStatisticVersionRequest(const TSharedPtr& obj) : FIncrementPlayerStatisticVersionRequest() + { + readFromValue(obj); + } + + ~FIncrementPlayerStatisticVersionRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FIncrementPlayerStatisticVersionResult : public FPlayFabBaseModel + { + // [optional] version change history of the statistic + TSharedPtr StatisticVersion; + + FIncrementPlayerStatisticVersionResult() : + FPlayFabBaseModel(), + StatisticVersion(nullptr) + {} + + FIncrementPlayerStatisticVersionResult(const FIncrementPlayerStatisticVersionResult& src) : + FPlayFabBaseModel(), + StatisticVersion(src.StatisticVersion.IsValid() ? MakeShareable(new FPlayerStatisticVersion(*src.StatisticVersion)) : nullptr) + {} + + FIncrementPlayerStatisticVersionResult(const TSharedPtr& obj) : FIncrementPlayerStatisticVersionResult() + { + readFromValue(obj); + } + + ~FIncrementPlayerStatisticVersionResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListBuildsRequest : public FPlayFabBaseModel + { + FListBuildsRequest() : + FPlayFabBaseModel() + {} + + FListBuildsRequest(const FListBuildsRequest& src) : + FPlayFabBaseModel() + {} + + FListBuildsRequest(const TSharedPtr& obj) : FListBuildsRequest() + { + readFromValue(obj); + } + + ~FListBuildsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListBuildsResult : public FPlayFabBaseModel + { + // [optional] array of uploaded game server builds + TArray Builds; + FListBuildsResult() : + FPlayFabBaseModel(), + Builds() + {} + + FListBuildsResult(const FListBuildsResult& src) : + FPlayFabBaseModel(), + Builds(src.Builds) + {} + + FListBuildsResult(const TSharedPtr& obj) : FListBuildsResult() + { + readFromValue(obj); + } + + ~FListBuildsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListVirtualCurrencyTypesRequest : public FPlayFabBaseModel + { + FListVirtualCurrencyTypesRequest() : + FPlayFabBaseModel() + {} + + FListVirtualCurrencyTypesRequest(const FListVirtualCurrencyTypesRequest& src) : + FPlayFabBaseModel() + {} + + FListVirtualCurrencyTypesRequest(const TSharedPtr& obj) : FListVirtualCurrencyTypesRequest() + { + readFromValue(obj); + } + + ~FListVirtualCurrencyTypesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListVirtualCurrencyTypesResult : public FPlayFabBaseModel + { + // [optional] List of virtual currency names defined for this title + TArray VirtualCurrencies; + FListVirtualCurrencyTypesResult() : + FPlayFabBaseModel(), + VirtualCurrencies() + {} + + FListVirtualCurrencyTypesResult(const FListVirtualCurrencyTypesResult& src) : + FPlayFabBaseModel(), + VirtualCurrencies(src.VirtualCurrencies) + {} + + FListVirtualCurrencyTypesResult(const TSharedPtr& obj) : FListVirtualCurrencyTypesResult() + { + readFromValue(obj); + } + + ~FListVirtualCurrencyTypesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLookupUserAccountInfoRequest : public FPlayFabBaseModel + { + // [optional] User email address attached to their account + FString Email; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] Title specific username to match against existing user accounts + FString TitleDisplayName; + + // [optional] PlayFab username for the account (3-20 characters) + FString Username; + + FLookupUserAccountInfoRequest() : + FPlayFabBaseModel(), + Email(), + PlayFabId(), + TitleDisplayName(), + Username() + {} + + FLookupUserAccountInfoRequest(const FLookupUserAccountInfoRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + PlayFabId(src.PlayFabId), + TitleDisplayName(src.TitleDisplayName), + Username(src.Username) + {} + + FLookupUserAccountInfoRequest(const TSharedPtr& obj) : FLookupUserAccountInfoRequest() + { + readFromValue(obj); + } + + ~FLookupUserAccountInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserAndroidDeviceInfo : public FPlayFabBaseModel + { + // [optional] Android device ID + FString AndroidDeviceId; + + FUserAndroidDeviceInfo() : + FPlayFabBaseModel(), + AndroidDeviceId() + {} + + FUserAndroidDeviceInfo(const FUserAndroidDeviceInfo& src) : + FPlayFabBaseModel(), + AndroidDeviceId(src.AndroidDeviceId) + {} + + FUserAndroidDeviceInfo(const TSharedPtr& obj) : FUserAndroidDeviceInfo() + { + readFromValue(obj); + } + + ~FUserAndroidDeviceInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserCustomIdInfo : public FPlayFabBaseModel + { + // [optional] Custom ID + FString CustomId; + + FUserCustomIdInfo() : + FPlayFabBaseModel(), + CustomId() + {} + + FUserCustomIdInfo(const FUserCustomIdInfo& src) : + FPlayFabBaseModel(), + CustomId(src.CustomId) + {} + + FUserCustomIdInfo(const TSharedPtr& obj) : FUserCustomIdInfo() + { + readFromValue(obj); + } + + ~FUserCustomIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserFacebookInfo : public FPlayFabBaseModel + { + // [optional] Facebook identifier + FString FacebookId; + + // [optional] Facebook full name + FString FullName; + + FUserFacebookInfo() : + FPlayFabBaseModel(), + FacebookId(), + FullName() + {} + + FUserFacebookInfo(const FUserFacebookInfo& src) : + FPlayFabBaseModel(), + FacebookId(src.FacebookId), + FullName(src.FullName) + {} + + FUserFacebookInfo(const TSharedPtr& obj) : FUserFacebookInfo() + { + readFromValue(obj); + } + + ~FUserFacebookInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserFacebookInstantGamesIdInfo : public FPlayFabBaseModel + { + // [optional] Facebook Instant Games ID + FString FacebookInstantGamesId; + + FUserFacebookInstantGamesIdInfo() : + FPlayFabBaseModel(), + FacebookInstantGamesId() + {} + + FUserFacebookInstantGamesIdInfo(const FUserFacebookInstantGamesIdInfo& src) : + FPlayFabBaseModel(), + FacebookInstantGamesId(src.FacebookInstantGamesId) + {} + + FUserFacebookInstantGamesIdInfo(const TSharedPtr& obj) : FUserFacebookInstantGamesIdInfo() + { + readFromValue(obj); + } + + ~FUserFacebookInstantGamesIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserGameCenterInfo : public FPlayFabBaseModel + { + // [optional] Gamecenter identifier + FString GameCenterId; + + FUserGameCenterInfo() : + FPlayFabBaseModel(), + GameCenterId() + {} + + FUserGameCenterInfo(const FUserGameCenterInfo& src) : + FPlayFabBaseModel(), + GameCenterId(src.GameCenterId) + {} + + FUserGameCenterInfo(const TSharedPtr& obj) : FUserGameCenterInfo() + { + readFromValue(obj); + } + + ~FUserGameCenterInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserGoogleInfo : public FPlayFabBaseModel + { + // [optional] Email address of the Google account + FString GoogleEmail; + + // [optional] Gender information of the Google account + FString GoogleGender; + + // [optional] Google ID + FString GoogleId; + + // [optional] Locale of the Google account + FString GoogleLocale; + + FUserGoogleInfo() : + FPlayFabBaseModel(), + GoogleEmail(), + GoogleGender(), + GoogleId(), + GoogleLocale() + {} + + FUserGoogleInfo(const FUserGoogleInfo& src) : + FPlayFabBaseModel(), + GoogleEmail(src.GoogleEmail), + GoogleGender(src.GoogleGender), + GoogleId(src.GoogleId), + GoogleLocale(src.GoogleLocale) + {} + + FUserGoogleInfo(const TSharedPtr& obj) : FUserGoogleInfo() + { + readFromValue(obj); + } + + ~FUserGoogleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserIosDeviceInfo : public FPlayFabBaseModel + { + // [optional] iOS device ID + FString IosDeviceId; + + FUserIosDeviceInfo() : + FPlayFabBaseModel(), + IosDeviceId() + {} + + FUserIosDeviceInfo(const FUserIosDeviceInfo& src) : + FPlayFabBaseModel(), + IosDeviceId(src.IosDeviceId) + {} + + FUserIosDeviceInfo(const TSharedPtr& obj) : FUserIosDeviceInfo() + { + readFromValue(obj); + } + + ~FUserIosDeviceInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserKongregateInfo : public FPlayFabBaseModel + { + // [optional] Kongregate ID + FString KongregateId; + + // [optional] Kongregate Username + FString KongregateName; + + FUserKongregateInfo() : + FPlayFabBaseModel(), + KongregateId(), + KongregateName() + {} + + FUserKongregateInfo(const FUserKongregateInfo& src) : + FPlayFabBaseModel(), + KongregateId(src.KongregateId), + KongregateName(src.KongregateName) + {} + + FUserKongregateInfo(const TSharedPtr& obj) : FUserKongregateInfo() + { + readFromValue(obj); + } + + ~FUserKongregateInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserNintendoSwitchDeviceIdInfo : public FPlayFabBaseModel + { + // [optional] Nintendo Switch Device ID + FString NintendoSwitchDeviceId; + + FUserNintendoSwitchDeviceIdInfo() : + FPlayFabBaseModel(), + NintendoSwitchDeviceId() + {} + + FUserNintendoSwitchDeviceIdInfo(const FUserNintendoSwitchDeviceIdInfo& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId) + {} + + FUserNintendoSwitchDeviceIdInfo(const TSharedPtr& obj) : FUserNintendoSwitchDeviceIdInfo() + { + readFromValue(obj); + } + + ~FUserNintendoSwitchDeviceIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserOpenIdInfo : public FPlayFabBaseModel + { + // [optional] OpenID Connection ID + FString ConnectionId; + + // [optional] OpenID Issuer + FString Issuer; + + // [optional] OpenID Subject + FString Subject; + + FUserOpenIdInfo() : + FPlayFabBaseModel(), + ConnectionId(), + Issuer(), + Subject() + {} + + FUserOpenIdInfo(const FUserOpenIdInfo& src) : + FPlayFabBaseModel(), + ConnectionId(src.ConnectionId), + Issuer(src.Issuer), + Subject(src.Subject) + {} + + FUserOpenIdInfo(const TSharedPtr& obj) : FUserOpenIdInfo() + { + readFromValue(obj); + } + + ~FUserOpenIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserPrivateAccountInfo : public FPlayFabBaseModel + { + // [optional] user email address + FString Email; + + FUserPrivateAccountInfo() : + FPlayFabBaseModel(), + Email() + {} + + FUserPrivateAccountInfo(const FUserPrivateAccountInfo& src) : + FPlayFabBaseModel(), + Email(src.Email) + {} + + FUserPrivateAccountInfo(const TSharedPtr& obj) : FUserPrivateAccountInfo() + { + readFromValue(obj); + } + + ~FUserPrivateAccountInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserPsnInfo : public FPlayFabBaseModel + { + // [optional] PSN account ID + FString PsnAccountId; + + // [optional] PSN online ID + FString PsnOnlineId; + + FUserPsnInfo() : + FPlayFabBaseModel(), + PsnAccountId(), + PsnOnlineId() + {} + + FUserPsnInfo(const FUserPsnInfo& src) : + FPlayFabBaseModel(), + PsnAccountId(src.PsnAccountId), + PsnOnlineId(src.PsnOnlineId) + {} + + FUserPsnInfo(const TSharedPtr& obj) : FUserPsnInfo() + { + readFromValue(obj); + } + + ~FUserPsnInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum TitleActivationStatus + { + TitleActivationStatusNone, + TitleActivationStatusActivatedTitleKey, + TitleActivationStatusPendingSteam, + TitleActivationStatusActivatedSteam, + TitleActivationStatusRevokedSteam + }; + + PLAYFABCPP_API void writeTitleActivationStatusEnumJSON(TitleActivationStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API TitleActivationStatus readTitleActivationStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API TitleActivationStatus readTitleActivationStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FUserSteamInfo : public FPlayFabBaseModel + { + // [optional] what stage of game ownership the user is listed as being in, from Steam + Boxed SteamActivationStatus; + + // [optional] the country in which the player resides, from Steam data + FString SteamCountry; + + // [optional] currency type set in the user Steam account + Boxed SteamCurrency; + + // [optional] Steam identifier + FString SteamId; + + FUserSteamInfo() : + FPlayFabBaseModel(), + SteamActivationStatus(), + SteamCountry(), + SteamCurrency(), + SteamId() + {} + + FUserSteamInfo(const FUserSteamInfo& src) : + FPlayFabBaseModel(), + SteamActivationStatus(src.SteamActivationStatus), + SteamCountry(src.SteamCountry), + SteamCurrency(src.SteamCurrency), + SteamId(src.SteamId) + {} + + FUserSteamInfo(const TSharedPtr& obj) : FUserSteamInfo() + { + readFromValue(obj); + } + + ~FUserSteamInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum UserOrigination + { + UserOriginationOrganic, + UserOriginationSteam, + UserOriginationGoogle, + UserOriginationAmazon, + UserOriginationFacebook, + UserOriginationKongregate, + UserOriginationGamersFirst, + UserOriginationUnknown, + UserOriginationIOS, + UserOriginationLoadTest, + UserOriginationAndroid, + UserOriginationPSN, + UserOriginationGameCenter, + UserOriginationCustomId, + UserOriginationXboxLive, + UserOriginationParse, + UserOriginationTwitch, + UserOriginationWindowsHello, + UserOriginationServerCustomId, + UserOriginationNintendoSwitchDeviceId, + UserOriginationFacebookInstantGamesId, + UserOriginationOpenIdConnect + }; + + PLAYFABCPP_API void writeUserOriginationEnumJSON(UserOrigination enumVal, JsonWriter& writer); + PLAYFABCPP_API UserOrigination readUserOriginationFromValue(const TSharedPtr& value); + PLAYFABCPP_API UserOrigination readUserOriginationFromValue(const FString& value); + + struct PLAYFABCPP_API FUserTitleInfo : public FPlayFabBaseModel + { + // [optional] URL to the player's avatar. + FString AvatarUrl; + + /** + * timestamp indicating when the user was first associated with this game (this can differ significantly from when the user + * first registered with PlayFab) + */ + FDateTime Created; + + // [optional] name of the user, as it is displayed in-game + FString DisplayName; + + /** + * [optional] timestamp indicating when the user first signed into this game (this can differ from the Created timestamp, as other + * events, such as issuing a beta key to the user, can associate the title to the user) + */ + Boxed FirstLogin; + + // [optional] boolean indicating whether or not the user is currently banned for a title + Boxed isBanned; + + // [optional] timestamp for the last user login for this title + Boxed LastLogin; + + // [optional] source by which the user first joined the game, if known + Boxed Origination; + + // [optional] Title player account entity for this user + TSharedPtr TitlePlayerAccount; + + FUserTitleInfo() : + FPlayFabBaseModel(), + AvatarUrl(), + Created(0), + DisplayName(), + FirstLogin(), + isBanned(), + LastLogin(), + Origination(), + TitlePlayerAccount(nullptr) + {} + + FUserTitleInfo(const FUserTitleInfo& src) : + FPlayFabBaseModel(), + AvatarUrl(src.AvatarUrl), + Created(src.Created), + DisplayName(src.DisplayName), + FirstLogin(src.FirstLogin), + isBanned(src.isBanned), + LastLogin(src.LastLogin), + Origination(src.Origination), + TitlePlayerAccount(src.TitlePlayerAccount.IsValid() ? MakeShareable(new FEntityKey(*src.TitlePlayerAccount)) : nullptr) + {} + + FUserTitleInfo(const TSharedPtr& obj) : FUserTitleInfo() + { + readFromValue(obj); + } + + ~FUserTitleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserTwitchInfo : public FPlayFabBaseModel + { + // [optional] Twitch ID + FString TwitchId; + + // [optional] Twitch Username + FString TwitchUserName; + + FUserTwitchInfo() : + FPlayFabBaseModel(), + TwitchId(), + TwitchUserName() + {} + + FUserTwitchInfo(const FUserTwitchInfo& src) : + FPlayFabBaseModel(), + TwitchId(src.TwitchId), + TwitchUserName(src.TwitchUserName) + {} + + FUserTwitchInfo(const TSharedPtr& obj) : FUserTwitchInfo() + { + readFromValue(obj); + } + + ~FUserTwitchInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserWindowsHelloInfo : public FPlayFabBaseModel + { + // [optional] Windows Hello Device Name + FString WindowsHelloDeviceName; + + // [optional] Windows Hello Public Key Hash + FString WindowsHelloPublicKeyHash; + + FUserWindowsHelloInfo() : + FPlayFabBaseModel(), + WindowsHelloDeviceName(), + WindowsHelloPublicKeyHash() + {} + + FUserWindowsHelloInfo(const FUserWindowsHelloInfo& src) : + FPlayFabBaseModel(), + WindowsHelloDeviceName(src.WindowsHelloDeviceName), + WindowsHelloPublicKeyHash(src.WindowsHelloPublicKeyHash) + {} + + FUserWindowsHelloInfo(const TSharedPtr& obj) : FUserWindowsHelloInfo() + { + readFromValue(obj); + } + + ~FUserWindowsHelloInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserXboxInfo : public FPlayFabBaseModel + { + // [optional] XBox user ID + FString XboxUserId; + + FUserXboxInfo() : + FPlayFabBaseModel(), + XboxUserId() + {} + + FUserXboxInfo(const FUserXboxInfo& src) : + FPlayFabBaseModel(), + XboxUserId(src.XboxUserId) + {} + + FUserXboxInfo(const TSharedPtr& obj) : FUserXboxInfo() + { + readFromValue(obj); + } + + ~FUserXboxInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserAccountInfo : public FPlayFabBaseModel + { + // [optional] User Android device information, if an Android device has been linked + TSharedPtr AndroidDeviceInfo; + + // Timestamp indicating when the user account was created + FDateTime Created; + + // [optional] Custom ID information, if a custom ID has been assigned + TSharedPtr CustomIdInfo; + + // [optional] User Facebook information, if a Facebook account has been linked + TSharedPtr FacebookInfo; + + // [optional] Facebook Instant Games account information, if a Facebook Instant Games account has been linked + TSharedPtr FacebookInstantGamesIdInfo; + + // [optional] User Gamecenter information, if a Gamecenter account has been linked + TSharedPtr GameCenterInfo; + + // [optional] User Google account information, if a Google account has been linked + TSharedPtr GoogleInfo; + + // [optional] User iOS device information, if an iOS device has been linked + TSharedPtr IosDeviceInfo; + + // [optional] User Kongregate account information, if a Kongregate account has been linked + TSharedPtr KongregateInfo; + + // [optional] Nintendo Switch account information, if a Nintendo Switch account has been linked + TSharedPtr NintendoSwitchDeviceIdInfo; + + // [optional] OpenID Connect information, if any OpenID Connect accounts have been linked + TArray OpenIdInfo; + // [optional] Unique identifier for the user account + FString PlayFabId; + + // [optional] Personal information for the user which is considered more sensitive + TSharedPtr PrivateInfo; + + // [optional] User PSN account information, if a PSN account has been linked + TSharedPtr PsnInfo; + + // [optional] User Steam information, if a Steam account has been linked + TSharedPtr SteamInfo; + + // [optional] Title-specific information for the user account + TSharedPtr TitleInfo; + + // [optional] User Twitch account information, if a Twitch account has been linked + TSharedPtr TwitchInfo; + + // [optional] User account name in the PlayFab service + FString Username; + + // [optional] Windows Hello account information, if a Windows Hello account has been linked + TSharedPtr WindowsHelloInfo; + + // [optional] User XBox account information, if a XBox account has been linked + TSharedPtr XboxInfo; + + FUserAccountInfo() : + FPlayFabBaseModel(), + AndroidDeviceInfo(nullptr), + Created(0), + CustomIdInfo(nullptr), + FacebookInfo(nullptr), + FacebookInstantGamesIdInfo(nullptr), + GameCenterInfo(nullptr), + GoogleInfo(nullptr), + IosDeviceInfo(nullptr), + KongregateInfo(nullptr), + NintendoSwitchDeviceIdInfo(nullptr), + OpenIdInfo(), + PlayFabId(), + PrivateInfo(nullptr), + PsnInfo(nullptr), + SteamInfo(nullptr), + TitleInfo(nullptr), + TwitchInfo(nullptr), + Username(), + WindowsHelloInfo(nullptr), + XboxInfo(nullptr) + {} + + FUserAccountInfo(const FUserAccountInfo& src) : + FPlayFabBaseModel(), + AndroidDeviceInfo(src.AndroidDeviceInfo.IsValid() ? MakeShareable(new FUserAndroidDeviceInfo(*src.AndroidDeviceInfo)) : nullptr), + Created(src.Created), + CustomIdInfo(src.CustomIdInfo.IsValid() ? MakeShareable(new FUserCustomIdInfo(*src.CustomIdInfo)) : nullptr), + FacebookInfo(src.FacebookInfo.IsValid() ? MakeShareable(new FUserFacebookInfo(*src.FacebookInfo)) : nullptr), + FacebookInstantGamesIdInfo(src.FacebookInstantGamesIdInfo.IsValid() ? MakeShareable(new FUserFacebookInstantGamesIdInfo(*src.FacebookInstantGamesIdInfo)) : nullptr), + GameCenterInfo(src.GameCenterInfo.IsValid() ? MakeShareable(new FUserGameCenterInfo(*src.GameCenterInfo)) : nullptr), + GoogleInfo(src.GoogleInfo.IsValid() ? MakeShareable(new FUserGoogleInfo(*src.GoogleInfo)) : nullptr), + IosDeviceInfo(src.IosDeviceInfo.IsValid() ? MakeShareable(new FUserIosDeviceInfo(*src.IosDeviceInfo)) : nullptr), + KongregateInfo(src.KongregateInfo.IsValid() ? MakeShareable(new FUserKongregateInfo(*src.KongregateInfo)) : nullptr), + NintendoSwitchDeviceIdInfo(src.NintendoSwitchDeviceIdInfo.IsValid() ? MakeShareable(new FUserNintendoSwitchDeviceIdInfo(*src.NintendoSwitchDeviceIdInfo)) : nullptr), + OpenIdInfo(src.OpenIdInfo), + PlayFabId(src.PlayFabId), + PrivateInfo(src.PrivateInfo.IsValid() ? MakeShareable(new FUserPrivateAccountInfo(*src.PrivateInfo)) : nullptr), + PsnInfo(src.PsnInfo.IsValid() ? MakeShareable(new FUserPsnInfo(*src.PsnInfo)) : nullptr), + SteamInfo(src.SteamInfo.IsValid() ? MakeShareable(new FUserSteamInfo(*src.SteamInfo)) : nullptr), + TitleInfo(src.TitleInfo.IsValid() ? MakeShareable(new FUserTitleInfo(*src.TitleInfo)) : nullptr), + TwitchInfo(src.TwitchInfo.IsValid() ? MakeShareable(new FUserTwitchInfo(*src.TwitchInfo)) : nullptr), + Username(src.Username), + WindowsHelloInfo(src.WindowsHelloInfo.IsValid() ? MakeShareable(new FUserWindowsHelloInfo(*src.WindowsHelloInfo)) : nullptr), + XboxInfo(src.XboxInfo.IsValid() ? MakeShareable(new FUserXboxInfo(*src.XboxInfo)) : nullptr) + {} + + FUserAccountInfo(const TSharedPtr& obj) : FUserAccountInfo() + { + readFromValue(obj); + } + + ~FUserAccountInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLookupUserAccountInfoResult : public FPlayFabBaseModel + { + // [optional] User info for the user matching the request + TSharedPtr UserInfo; + + FLookupUserAccountInfoResult() : + FPlayFabBaseModel(), + UserInfo(nullptr) + {} + + FLookupUserAccountInfoResult(const FLookupUserAccountInfoResult& src) : + FPlayFabBaseModel(), + UserInfo(src.UserInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.UserInfo)) : nullptr) + {} + + FLookupUserAccountInfoResult(const TSharedPtr& obj) : FLookupUserAccountInfoResult() + { + readFromValue(obj); + } + + ~FLookupUserAccountInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyMatchmakerGameModesRequest : public FPlayFabBaseModel + { + // previously uploaded build version for which game modes are being specified + FString BuildVersion; + + // array of game modes (Note: this will replace all game modes for the indicated build version) + TArray GameModes; + FModifyMatchmakerGameModesRequest() : + FPlayFabBaseModel(), + BuildVersion(), + GameModes() + {} + + FModifyMatchmakerGameModesRequest(const FModifyMatchmakerGameModesRequest& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + GameModes(src.GameModes) + {} + + FModifyMatchmakerGameModesRequest(const TSharedPtr& obj) : FModifyMatchmakerGameModesRequest() + { + readFromValue(obj); + } + + ~FModifyMatchmakerGameModesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyMatchmakerGameModesResult : public FPlayFabBaseModel + { + FModifyMatchmakerGameModesResult() : + FPlayFabBaseModel() + {} + + FModifyMatchmakerGameModesResult(const FModifyMatchmakerGameModesResult& src) : + FPlayFabBaseModel() + {} + + FModifyMatchmakerGameModesResult(const TSharedPtr& obj) : FModifyMatchmakerGameModesResult() + { + readFromValue(obj); + } + + ~FModifyMatchmakerGameModesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyServerBuildRequest : public FPlayFabBaseModel + { + // [optional] array of regions where this build can used, when it is active + TArray ActiveRegions; + // unique identifier of the previously uploaded build executable to be updated + FString BuildId; + + // [optional] appended to the end of the command line when starting game servers + FString CommandLineTemplate; + + // [optional] developer comment(s) for this build + FString Comment; + + // [optional] path to the game server executable. Defaults to gameserver.exe + FString ExecutablePath; + + // maximum number of game server instances that can run on a single host machine + int32 MaxGamesPerHost; + + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + int32 MinFreeGameSlots; + + // [optional] new timestamp + Boxed Timestamp; + + FModifyServerBuildRequest() : + FPlayFabBaseModel(), + ActiveRegions(), + BuildId(), + CommandLineTemplate(), + Comment(), + ExecutablePath(), + MaxGamesPerHost(0), + MinFreeGameSlots(0), + Timestamp() + {} + + FModifyServerBuildRequest(const FModifyServerBuildRequest& src) : + FPlayFabBaseModel(), + ActiveRegions(src.ActiveRegions), + BuildId(src.BuildId), + CommandLineTemplate(src.CommandLineTemplate), + Comment(src.Comment), + ExecutablePath(src.ExecutablePath), + MaxGamesPerHost(src.MaxGamesPerHost), + MinFreeGameSlots(src.MinFreeGameSlots), + Timestamp(src.Timestamp) + {} + + FModifyServerBuildRequest(const TSharedPtr& obj) : FModifyServerBuildRequest() + { + readFromValue(obj); + } + + ~FModifyServerBuildRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyServerBuildResult : public FPlayFabBaseModel + { + // [optional] array of regions where this build can used, when it is active + TArray ActiveRegions; + // [optional] unique identifier for this build executable + FString BuildId; + + // [optional] appended to the end of the command line when starting game servers + FString CommandLineTemplate; + + // [optional] developer comment(s) for this build + FString Comment; + + // [optional] path to the game server executable. Defaults to gameserver.exe + FString ExecutablePath; + + // maximum number of game server instances that can run on a single host machine + int32 MaxGamesPerHost; + + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + int32 MinFreeGameSlots; + + // [optional] the current status of the build validation and processing steps + Boxed Status; + + // time this build was last modified (or uploaded, if this build has never been modified) + FDateTime Timestamp; + + /** + * [optional] Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FModifyServerBuildResult() : + FPlayFabBaseModel(), + ActiveRegions(), + BuildId(), + CommandLineTemplate(), + Comment(), + ExecutablePath(), + MaxGamesPerHost(0), + MinFreeGameSlots(0), + Status(), + Timestamp(0), + TitleId() + {} + + FModifyServerBuildResult(const FModifyServerBuildResult& src) : + FPlayFabBaseModel(), + ActiveRegions(src.ActiveRegions), + BuildId(src.BuildId), + CommandLineTemplate(src.CommandLineTemplate), + Comment(src.Comment), + ExecutablePath(src.ExecutablePath), + MaxGamesPerHost(src.MaxGamesPerHost), + MinFreeGameSlots(src.MinFreeGameSlots), + Status(src.Status), + Timestamp(src.Timestamp), + TitleId(src.TitleId) + {} + + FModifyServerBuildResult(const TSharedPtr& obj) : FModifyServerBuildResult() + { + readFromValue(obj); + } + + ~FModifyServerBuildResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyUserVirtualCurrencyResult : public FPlayFabBaseModel + { + // Balance of the virtual currency after modification. + int32 Balance; + + /** + * Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase + * over this value will be discarded. + */ + int32 BalanceChange; + + // [optional] User currency was subtracted from. + FString PlayFabId; + + // [optional] Name of the virtual currency which was modified. + FString VirtualCurrency; + + FModifyUserVirtualCurrencyResult() : + FPlayFabBaseModel(), + Balance(0), + BalanceChange(0), + PlayFabId(), + VirtualCurrency() + {} + + FModifyUserVirtualCurrencyResult(const FModifyUserVirtualCurrencyResult& src) : + FPlayFabBaseModel(), + Balance(src.Balance), + BalanceChange(src.BalanceChange), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FModifyUserVirtualCurrencyResult(const TSharedPtr& obj) : FModifyUserVirtualCurrencyResult() + { + readFromValue(obj); + } + + ~FModifyUserVirtualCurrencyResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum PushSetupPlatform + { + PushSetupPlatformGCM, + PushSetupPlatformAPNS, + PushSetupPlatformAPNS_SANDBOX + }; + + PLAYFABCPP_API void writePushSetupPlatformEnumJSON(PushSetupPlatform enumVal, JsonWriter& writer); + PLAYFABCPP_API PushSetupPlatform readPushSetupPlatformFromValue(const TSharedPtr& value); + PLAYFABCPP_API PushSetupPlatform readPushSetupPlatformFromValue(const FString& value); + + struct PLAYFABCPP_API FRandomResultTable : public FPlayFabBaseModel + { + // Child nodes that indicate what kind of drop table item this actually is. + TArray Nodes; + // Unique name for this drop table + FString TableId; + + FRandomResultTable() : + FPlayFabBaseModel(), + Nodes(), + TableId() + {} + + FRandomResultTable(const FRandomResultTable& src) : + FPlayFabBaseModel(), + Nodes(src.Nodes), + TableId(src.TableId) + {} + + FRandomResultTable(const TSharedPtr& obj) : FRandomResultTable() + { + readFromValue(obj); + } + + ~FRandomResultTable(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRefundPurchaseRequest : public FPlayFabBaseModel + { + // Unique order ID for the purchase in question. + FString OrderId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * [optional] The Reason parameter should correspond with the payment providers reason field, if they require one such as Facebook. In + * the case of Facebook this must match one of their refund or dispute resolution enums (See: + * https://developers.facebook.com/docs/payments/implementation-guide/handling-disputes-refunds) + */ + FString Reason; + + FRefundPurchaseRequest() : + FPlayFabBaseModel(), + OrderId(), + PlayFabId(), + Reason() + {} + + FRefundPurchaseRequest(const FRefundPurchaseRequest& src) : + FPlayFabBaseModel(), + OrderId(src.OrderId), + PlayFabId(src.PlayFabId), + Reason(src.Reason) + {} + + FRefundPurchaseRequest(const TSharedPtr& obj) : FRefundPurchaseRequest() + { + readFromValue(obj); + } + + ~FRefundPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRefundPurchaseResponse : public FPlayFabBaseModel + { + // [optional] The order's updated purchase status. + FString PurchaseStatus; + + FRefundPurchaseResponse() : + FPlayFabBaseModel(), + PurchaseStatus() + {} + + FRefundPurchaseResponse(const FRefundPurchaseResponse& src) : + FPlayFabBaseModel(), + PurchaseStatus(src.PurchaseStatus) + {} + + FRefundPurchaseResponse(const TSharedPtr& obj) : FRefundPurchaseResponse() + { + readFromValue(obj); + } + + ~FRefundPurchaseResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemovePlayerTagRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique tag for player profile. + FString TagName; + + FRemovePlayerTagRequest() : + FPlayFabBaseModel(), + PlayFabId(), + TagName() + {} + + FRemovePlayerTagRequest(const FRemovePlayerTagRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + TagName(src.TagName) + {} + + FRemovePlayerTagRequest(const TSharedPtr& obj) : FRemovePlayerTagRequest() + { + readFromValue(obj); + } + + ~FRemovePlayerTagRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemovePlayerTagResult : public FPlayFabBaseModel + { + FRemovePlayerTagResult() : + FPlayFabBaseModel() + {} + + FRemovePlayerTagResult(const FRemovePlayerTagResult& src) : + FPlayFabBaseModel() + {} + + FRemovePlayerTagResult(const TSharedPtr& obj) : FRemovePlayerTagResult() + { + readFromValue(obj); + } + + ~FRemovePlayerTagResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveServerBuildRequest : public FPlayFabBaseModel + { + // unique identifier of the previously uploaded build executable to be removed + FString BuildId; + + FRemoveServerBuildRequest() : + FPlayFabBaseModel(), + BuildId() + {} + + FRemoveServerBuildRequest(const FRemoveServerBuildRequest& src) : + FPlayFabBaseModel(), + BuildId(src.BuildId) + {} + + FRemoveServerBuildRequest(const TSharedPtr& obj) : FRemoveServerBuildRequest() + { + readFromValue(obj); + } + + ~FRemoveServerBuildRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveServerBuildResult : public FPlayFabBaseModel + { + FRemoveServerBuildResult() : + FPlayFabBaseModel() + {} + + FRemoveServerBuildResult(const FRemoveServerBuildResult& src) : + FPlayFabBaseModel() + {} + + FRemoveServerBuildResult(const TSharedPtr& obj) : FRemoveServerBuildResult() + { + readFromValue(obj); + } + + ~FRemoveServerBuildResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveVirtualCurrencyTypesRequest : public FPlayFabBaseModel + { + // List of virtual currencies to delete + TArray VirtualCurrencies; + FRemoveVirtualCurrencyTypesRequest() : + FPlayFabBaseModel(), + VirtualCurrencies() + {} + + FRemoveVirtualCurrencyTypesRequest(const FRemoveVirtualCurrencyTypesRequest& src) : + FPlayFabBaseModel(), + VirtualCurrencies(src.VirtualCurrencies) + {} + + FRemoveVirtualCurrencyTypesRequest(const TSharedPtr& obj) : FRemoveVirtualCurrencyTypesRequest() + { + readFromValue(obj); + } + + ~FRemoveVirtualCurrencyTypesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResetCharacterStatisticsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FResetCharacterStatisticsRequest() : + FPlayFabBaseModel(), + CharacterId(), + PlayFabId() + {} + + FResetCharacterStatisticsRequest(const FResetCharacterStatisticsRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + PlayFabId(src.PlayFabId) + {} + + FResetCharacterStatisticsRequest(const TSharedPtr& obj) : FResetCharacterStatisticsRequest() + { + readFromValue(obj); + } + + ~FResetCharacterStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResetCharacterStatisticsResult : public FPlayFabBaseModel + { + FResetCharacterStatisticsResult() : + FPlayFabBaseModel() + {} + + FResetCharacterStatisticsResult(const FResetCharacterStatisticsResult& src) : + FPlayFabBaseModel() + {} + + FResetCharacterStatisticsResult(const TSharedPtr& obj) : FResetCharacterStatisticsResult() + { + readFromValue(obj); + } + + ~FResetCharacterStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResetPasswordRequest : public FPlayFabBaseModel + { + // The new password for the player. + FString Password; + + // The token of the player requesting the password reset. + FString Token; + + FResetPasswordRequest() : + FPlayFabBaseModel(), + Password(), + Token() + {} + + FResetPasswordRequest(const FResetPasswordRequest& src) : + FPlayFabBaseModel(), + Password(src.Password), + Token(src.Token) + {} + + FResetPasswordRequest(const TSharedPtr& obj) : FResetPasswordRequest() + { + readFromValue(obj); + } + + ~FResetPasswordRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResetPasswordResult : public FPlayFabBaseModel + { + FResetPasswordResult() : + FPlayFabBaseModel() + {} + + FResetPasswordResult(const FResetPasswordResult& src) : + FPlayFabBaseModel() + {} + + FResetPasswordResult(const TSharedPtr& obj) : FResetPasswordResult() + { + readFromValue(obj); + } + + ~FResetPasswordResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResetUserStatisticsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FResetUserStatisticsRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FResetUserStatisticsRequest(const FResetUserStatisticsRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FResetUserStatisticsRequest(const TSharedPtr& obj) : FResetUserStatisticsRequest() + { + readFromValue(obj); + } + + ~FResetUserStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResetUserStatisticsResult : public FPlayFabBaseModel + { + FResetUserStatisticsResult() : + FPlayFabBaseModel() + {} + + FResetUserStatisticsResult(const FResetUserStatisticsResult& src) : + FPlayFabBaseModel() + {} + + FResetUserStatisticsResult(const TSharedPtr& obj) : FResetUserStatisticsResult() + { + readFromValue(obj); + } + + ~FResetUserStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ResolutionOutcome + { + ResolutionOutcomeRevoke, + ResolutionOutcomeReinstate, + ResolutionOutcomeManual + }; + + PLAYFABCPP_API void writeResolutionOutcomeEnumJSON(ResolutionOutcome enumVal, JsonWriter& writer); + PLAYFABCPP_API ResolutionOutcome readResolutionOutcomeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ResolutionOutcome readResolutionOutcomeFromValue(const FString& value); + + struct PLAYFABCPP_API FResolvePurchaseDisputeRequest : public FPlayFabBaseModel + { + // Unique order ID for the purchase in question. + FString OrderId; + + /** + * Enum for the desired purchase result state after notifying the payment provider. Valid values are Revoke, Reinstate and + * Manual. Manual will cause no change to the order state. + */ + ResolutionOutcome Outcome; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * [optional] The Reason parameter should correspond with the payment providers reason field, if they require one such as Facebook. In + * the case of Facebook this must match one of their refund or dispute resolution enums (See: + * https://developers.facebook.com/docs/payments/implementation-guide/handling-disputes-refunds) + */ + FString Reason; + + FResolvePurchaseDisputeRequest() : + FPlayFabBaseModel(), + OrderId(), + Outcome(), + PlayFabId(), + Reason() + {} + + FResolvePurchaseDisputeRequest(const FResolvePurchaseDisputeRequest& src) : + FPlayFabBaseModel(), + OrderId(src.OrderId), + Outcome(src.Outcome), + PlayFabId(src.PlayFabId), + Reason(src.Reason) + {} + + FResolvePurchaseDisputeRequest(const TSharedPtr& obj) : FResolvePurchaseDisputeRequest() + { + readFromValue(obj); + } + + ~FResolvePurchaseDisputeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResolvePurchaseDisputeResponse : public FPlayFabBaseModel + { + // [optional] The order's updated purchase status. + FString PurchaseStatus; + + FResolvePurchaseDisputeResponse() : + FPlayFabBaseModel(), + PurchaseStatus() + {} + + FResolvePurchaseDisputeResponse(const FResolvePurchaseDisputeResponse& src) : + FPlayFabBaseModel(), + PurchaseStatus(src.PurchaseStatus) + {} + + FResolvePurchaseDisputeResponse(const TSharedPtr& obj) : FResolvePurchaseDisputeResponse() + { + readFromValue(obj); + } + + ~FResolvePurchaseDisputeResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeAllBansForUserRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRevokeAllBansForUserRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FRevokeAllBansForUserRequest(const FRevokeAllBansForUserRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FRevokeAllBansForUserRequest(const TSharedPtr& obj) : FRevokeAllBansForUserRequest() + { + readFromValue(obj); + } + + ~FRevokeAllBansForUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeAllBansForUserResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were revoked. + TArray BanData; + FRevokeAllBansForUserResult() : + FPlayFabBaseModel(), + BanData() + {} + + FRevokeAllBansForUserResult(const FRevokeAllBansForUserResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FRevokeAllBansForUserResult(const TSharedPtr& obj) : FRevokeAllBansForUserResult() + { + readFromValue(obj); + } + + ~FRevokeAllBansForUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeBansRequest : public FPlayFabBaseModel + { + // Ids of the bans to be revoked. Maximum 100. + TArray BanIds; + FRevokeBansRequest() : + FPlayFabBaseModel(), + BanIds() + {} + + FRevokeBansRequest(const FRevokeBansRequest& src) : + FPlayFabBaseModel(), + BanIds(src.BanIds) + {} + + FRevokeBansRequest(const TSharedPtr& obj) : FRevokeBansRequest() + { + readFromValue(obj); + } + + ~FRevokeBansRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeBansResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were revoked + TArray BanData; + FRevokeBansResult() : + FPlayFabBaseModel(), + BanData() + {} + + FRevokeBansResult(const FRevokeBansResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FRevokeBansResult(const TSharedPtr& obj) : FRevokeBansResult() + { + readFromValue(obj); + } + + ~FRevokeBansResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItem : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRevokeInventoryItem() : + FPlayFabBaseModel(), + CharacterId(), + ItemInstanceId(), + PlayFabId() + {} + + FRevokeInventoryItem(const FRevokeInventoryItem& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FRevokeInventoryItem(const TSharedPtr& obj) : FRevokeInventoryItem() + { + readFromValue(obj); + } + + ~FRevokeInventoryItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItemRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRevokeInventoryItemRequest() : + FPlayFabBaseModel(), + CharacterId(), + ItemInstanceId(), + PlayFabId() + {} + + FRevokeInventoryItemRequest(const FRevokeInventoryItemRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FRevokeInventoryItemRequest(const TSharedPtr& obj) : FRevokeInventoryItemRequest() + { + readFromValue(obj); + } + + ~FRevokeInventoryItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItemsRequest : public FPlayFabBaseModel + { + // Array of player items to revoke, between 1 and 25 items. + TArray Items; + FRevokeInventoryItemsRequest() : + FPlayFabBaseModel(), + Items() + {} + + FRevokeInventoryItemsRequest(const FRevokeInventoryItemsRequest& src) : + FPlayFabBaseModel(), + Items(src.Items) + {} + + FRevokeInventoryItemsRequest(const TSharedPtr& obj) : FRevokeInventoryItemsRequest() + { + readFromValue(obj); + } + + ~FRevokeInventoryItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeItemError : public FPlayFabBaseModel + { + // [optional] Specific error that was encountered. + FString Error; + + // [optional] Item information that failed to be revoked. + TSharedPtr Item; + + FRevokeItemError() : + FPlayFabBaseModel(), + Error(), + Item(nullptr) + {} + + FRevokeItemError(const FRevokeItemError& src) : + FPlayFabBaseModel(), + Error(src.Error), + Item(src.Item.IsValid() ? MakeShareable(new FRevokeInventoryItem(*src.Item)) : nullptr) + {} + + FRevokeItemError(const TSharedPtr& obj) : FRevokeItemError() + { + readFromValue(obj); + } + + ~FRevokeItemError(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItemsResult : public FPlayFabBaseModel + { + // [optional] Collection of any errors that occurred during processing. + TArray Errors; + FRevokeInventoryItemsResult() : + FPlayFabBaseModel(), + Errors() + {} + + FRevokeInventoryItemsResult(const FRevokeInventoryItemsResult& src) : + FPlayFabBaseModel(), + Errors(src.Errors) + {} + + FRevokeInventoryItemsResult(const TSharedPtr& obj) : FRevokeInventoryItemsResult() + { + readFromValue(obj); + } + + ~FRevokeInventoryItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryResult : public FPlayFabBaseModel + { + FRevokeInventoryResult() : + FPlayFabBaseModel() + {} + + FRevokeInventoryResult(const FRevokeInventoryResult& src) : + FPlayFabBaseModel() + {} + + FRevokeInventoryResult(const TSharedPtr& obj) : FRevokeInventoryResult() + { + readFromValue(obj); + } + + ~FRevokeInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRunTaskRequest : public FPlayFabBaseModel + { + // [optional] Provide either the task ID or the task name to run a task. + TSharedPtr Identifier; + + FRunTaskRequest() : + FPlayFabBaseModel(), + Identifier(nullptr) + {} + + FRunTaskRequest(const FRunTaskRequest& src) : + FPlayFabBaseModel(), + Identifier(src.Identifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.Identifier)) : nullptr) + {} + + FRunTaskRequest(const TSharedPtr& obj) : FRunTaskRequest() + { + readFromValue(obj); + } + + ~FRunTaskRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRunTaskResult : public FPlayFabBaseModel + { + /** + * [optional] ID of the task instance that is started. This can be used in Get*TaskInstance (e.g. GetCloudScriptTaskInstance) API call + * to retrieve status for the task instance. + */ + FString TaskInstanceId; + + FRunTaskResult() : + FPlayFabBaseModel(), + TaskInstanceId() + {} + + FRunTaskResult(const FRunTaskResult& src) : + FPlayFabBaseModel(), + TaskInstanceId(src.TaskInstanceId) + {} + + FRunTaskResult(const TSharedPtr& obj) : FRunTaskResult() + { + readFromValue(obj); + } + + ~FRunTaskResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendAccountRecoveryEmailRequest : public FPlayFabBaseModel + { + // User email address attached to their account + FString Email; + + // [optional] The email template id of the account recovery email template to send. + FString EmailTemplateId; + + FSendAccountRecoveryEmailRequest() : + FPlayFabBaseModel(), + Email(), + EmailTemplateId() + {} + + FSendAccountRecoveryEmailRequest(const FSendAccountRecoveryEmailRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + EmailTemplateId(src.EmailTemplateId) + {} + + FSendAccountRecoveryEmailRequest(const TSharedPtr& obj) : FSendAccountRecoveryEmailRequest() + { + readFromValue(obj); + } + + ~FSendAccountRecoveryEmailRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendAccountRecoveryEmailResult : public FPlayFabBaseModel + { + FSendAccountRecoveryEmailResult() : + FPlayFabBaseModel() + {} + + FSendAccountRecoveryEmailResult(const FSendAccountRecoveryEmailResult& src) : + FPlayFabBaseModel() + {} + + FSendAccountRecoveryEmailResult(const TSharedPtr& obj) : FSendAccountRecoveryEmailResult() + { + readFromValue(obj); + } + + ~FSendAccountRecoveryEmailResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPlayerSecretRequest : public FPlayFabBaseModel + { + // Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FSetPlayerSecretRequest() : + FPlayFabBaseModel(), + PlayerSecret(), + PlayFabId() + {} + + FSetPlayerSecretRequest(const FSetPlayerSecretRequest& src) : + FPlayFabBaseModel(), + PlayerSecret(src.PlayerSecret), + PlayFabId(src.PlayFabId) + {} + + FSetPlayerSecretRequest(const TSharedPtr& obj) : FSetPlayerSecretRequest() + { + readFromValue(obj); + } + + ~FSetPlayerSecretRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPlayerSecretResult : public FPlayFabBaseModel + { + FSetPlayerSecretResult() : + FPlayFabBaseModel() + {} + + FSetPlayerSecretResult(const FSetPlayerSecretResult& src) : + FPlayFabBaseModel() + {} + + FSetPlayerSecretResult(const TSharedPtr& obj) : FSetPlayerSecretResult() + { + readFromValue(obj); + } + + ~FSetPlayerSecretResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPublishedRevisionRequest : public FPlayFabBaseModel + { + // Revision to make the current published revision + int32 Revision; + + // Version number + int32 Version; + + FSetPublishedRevisionRequest() : + FPlayFabBaseModel(), + Revision(0), + Version(0) + {} + + FSetPublishedRevisionRequest(const FSetPublishedRevisionRequest& src) : + FPlayFabBaseModel(), + Revision(src.Revision), + Version(src.Version) + {} + + FSetPublishedRevisionRequest(const TSharedPtr& obj) : FSetPublishedRevisionRequest() + { + readFromValue(obj); + } + + ~FSetPublishedRevisionRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPublishedRevisionResult : public FPlayFabBaseModel + { + FSetPublishedRevisionResult() : + FPlayFabBaseModel() + {} + + FSetPublishedRevisionResult(const FSetPublishedRevisionResult& src) : + FPlayFabBaseModel() + {} + + FSetPublishedRevisionResult(const TSharedPtr& obj) : FSetPublishedRevisionResult() + { + readFromValue(obj); + } + + ~FSetPublishedRevisionResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPublisherDataRequest : public FPlayFabBaseModel + { + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + FString Key; + + // [optional] new value to set. Set to null to remove a value + FString Value; + + FSetPublisherDataRequest() : + FPlayFabBaseModel(), + Key(), + Value() + {} + + FSetPublisherDataRequest(const FSetPublisherDataRequest& src) : + FPlayFabBaseModel(), + Key(src.Key), + Value(src.Value) + {} + + FSetPublisherDataRequest(const TSharedPtr& obj) : FSetPublisherDataRequest() + { + readFromValue(obj); + } + + ~FSetPublisherDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPublisherDataResult : public FPlayFabBaseModel + { + FSetPublisherDataResult() : + FPlayFabBaseModel() + {} + + FSetPublisherDataResult(const FSetPublisherDataResult& src) : + FPlayFabBaseModel() + {} + + FSetPublisherDataResult(const TSharedPtr& obj) : FSetPublisherDataResult() + { + readFromValue(obj); + } + + ~FSetPublisherDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetTitleDataRequest : public FPlayFabBaseModel + { + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + FString Key; + + // [optional] new value to set. Set to null to remove a value + FString Value; + + FSetTitleDataRequest() : + FPlayFabBaseModel(), + Key(), + Value() + {} + + FSetTitleDataRequest(const FSetTitleDataRequest& src) : + FPlayFabBaseModel(), + Key(src.Key), + Value(src.Value) + {} + + FSetTitleDataRequest(const TSharedPtr& obj) : FSetTitleDataRequest() + { + readFromValue(obj); + } + + ~FSetTitleDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetTitleDataResult : public FPlayFabBaseModel + { + FSetTitleDataResult() : + FPlayFabBaseModel() + {} + + FSetTitleDataResult(const FSetTitleDataResult& src) : + FPlayFabBaseModel() + {} + + FSetTitleDataResult(const TSharedPtr& obj) : FSetTitleDataResult() + { + readFromValue(obj); + } + + ~FSetTitleDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetupPushNotificationRequest : public FPlayFabBaseModel + { + // Credential is the Private Key for APNS/APNS_SANDBOX, and the API Key for GCM + FString Credential; + + // [optional] for APNS, this is the PlatformPrincipal (SSL Certificate) + FString Key; + + /** + * name of the application sending the message (application names must be made up of only uppercase and lowercase ASCII + * letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long) + */ + FString Name; + + /** + * replace any existing ARN with the newly generated one. If this is set to false, an error will be returned if + * notifications have already setup for this platform. + */ + bool OverwriteOldARN; + + /** + * supported notification platforms are Apple Push Notification Service (APNS and APNS_SANDBOX) for iOS and Google Cloud + * Messaging (GCM) for Android + */ + PushSetupPlatform Platform; + + FSetupPushNotificationRequest() : + FPlayFabBaseModel(), + Credential(), + Key(), + Name(), + OverwriteOldARN(false), + Platform() + {} + + FSetupPushNotificationRequest(const FSetupPushNotificationRequest& src) : + FPlayFabBaseModel(), + Credential(src.Credential), + Key(src.Key), + Name(src.Name), + OverwriteOldARN(src.OverwriteOldARN), + Platform(src.Platform) + {} + + FSetupPushNotificationRequest(const TSharedPtr& obj) : FSetupPushNotificationRequest() + { + readFromValue(obj); + } + + ~FSetupPushNotificationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetupPushNotificationResult : public FPlayFabBaseModel + { + // [optional] Amazon Resource Name for the created notification topic. + FString ARN; + + FSetupPushNotificationResult() : + FPlayFabBaseModel(), + ARN() + {} + + FSetupPushNotificationResult(const FSetupPushNotificationResult& src) : + FPlayFabBaseModel(), + ARN(src.ARN) + {} + + FSetupPushNotificationResult(const TSharedPtr& obj) : FSetupPushNotificationResult() + { + readFromValue(obj); + } + + ~FSetupPushNotificationResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum StatisticVersionArchivalStatus + { + StatisticVersionArchivalStatusNotScheduled, + StatisticVersionArchivalStatusScheduled, + StatisticVersionArchivalStatusQueued, + StatisticVersionArchivalStatusInProgress, + StatisticVersionArchivalStatusComplete + }; + + PLAYFABCPP_API void writeStatisticVersionArchivalStatusEnumJSON(StatisticVersionArchivalStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API StatisticVersionArchivalStatus readStatisticVersionArchivalStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API StatisticVersionArchivalStatus readStatisticVersionArchivalStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FSubtractUserVirtualCurrencyRequest : public FPlayFabBaseModel + { + // Amount to be subtracted from the user balance of the specified virtual currency. + int32 Amount; + + // PlayFab unique identifier of the user whose virtual currency balance is to be decreased. + FString PlayFabId; + + // Name of the virtual currency which is to be decremented. + FString VirtualCurrency; + + FSubtractUserVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + PlayFabId(), + VirtualCurrency() + {} + + FSubtractUserVirtualCurrencyRequest(const FSubtractUserVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FSubtractUserVirtualCurrencyRequest(const TSharedPtr& obj) : FSubtractUserVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FSubtractUserVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateBanRequest : public FPlayFabBaseModel + { + // [optional] The updated active state for the ban. Null for no change. + Boxed Active; + + // The id of the ban to be updated. + FString BanId; + + // [optional] The updated expiration date for the ban. Null for no change. + Boxed Expires; + + // [optional] The updated IP address for the ban. Null for no change. + FString IPAddress; + + // [optional] The updated MAC address for the ban. Null for no change. + FString MACAddress; + + // [optional] Whether to make this ban permanent. Set to true to make this ban permanent. This will not modify Active state. + Boxed Permanent; + + // [optional] The updated reason for the ban to be updated. Maximum 140 characters. Null for no change. + FString Reason; + + FUpdateBanRequest() : + FPlayFabBaseModel(), + Active(), + BanId(), + Expires(), + IPAddress(), + MACAddress(), + Permanent(), + Reason() + {} + + FUpdateBanRequest(const FUpdateBanRequest& src) : + FPlayFabBaseModel(), + Active(src.Active), + BanId(src.BanId), + Expires(src.Expires), + IPAddress(src.IPAddress), + MACAddress(src.MACAddress), + Permanent(src.Permanent), + Reason(src.Reason) + {} + + FUpdateBanRequest(const TSharedPtr& obj) : FUpdateBanRequest() + { + readFromValue(obj); + } + + ~FUpdateBanRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateBansRequest : public FPlayFabBaseModel + { + // List of bans to be updated. Maximum 100. + TArray Bans; + FUpdateBansRequest() : + FPlayFabBaseModel(), + Bans() + {} + + FUpdateBansRequest(const FUpdateBansRequest& src) : + FPlayFabBaseModel(), + Bans(src.Bans) + {} + + FUpdateBansRequest(const TSharedPtr& obj) : FUpdateBansRequest() + { + readFromValue(obj); + } + + ~FUpdateBansRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateBansResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were updated + TArray BanData; + FUpdateBansResult() : + FPlayFabBaseModel(), + BanData() + {} + + FUpdateBansResult(const FUpdateBansResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FUpdateBansResult(const TSharedPtr& obj) : FUpdateBansResult() + { + readFromValue(obj); + } + + ~FUpdateBansResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCatalogItemsRequest : public FPlayFabBaseModel + { + /** + * [optional] Array of catalog items to be submitted. Note that while CatalogItem has a parameter for CatalogVersion, it is not + * required and ignored in this call. + */ + TArray Catalog; + // [optional] Which catalog is being updated. If null, uses the default catalog. + FString CatalogVersion; + + /** + * [optional] Should this catalog be set as the default catalog. Defaults to true. If there is currently no default catalog, this will + * always set it. + */ + Boxed SetAsDefaultCatalog; + + FUpdateCatalogItemsRequest() : + FPlayFabBaseModel(), + Catalog(), + CatalogVersion(), + SetAsDefaultCatalog() + {} + + FUpdateCatalogItemsRequest(const FUpdateCatalogItemsRequest& src) : + FPlayFabBaseModel(), + Catalog(src.Catalog), + CatalogVersion(src.CatalogVersion), + SetAsDefaultCatalog(src.SetAsDefaultCatalog) + {} + + FUpdateCatalogItemsRequest(const TSharedPtr& obj) : FUpdateCatalogItemsRequest() + { + readFromValue(obj); + } + + ~FUpdateCatalogItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCatalogItemsResult : public FPlayFabBaseModel + { + FUpdateCatalogItemsResult() : + FPlayFabBaseModel() + {} + + FUpdateCatalogItemsResult(const FUpdateCatalogItemsResult& src) : + FPlayFabBaseModel() + {} + + FUpdateCatalogItemsResult(const TSharedPtr& obj) : FUpdateCatalogItemsResult() + { + readFromValue(obj); + } + + ~FUpdateCatalogItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCloudScriptRequest : public FPlayFabBaseModel + { + // [optional] PlayFab user ID of the developer initiating the request. + FString DeveloperPlayFabId; + + // List of Cloud Script files to upload to create the new revision. Must have at least one file. + TArray Files; + // Immediately publish the new revision + bool Publish; + + FUpdateCloudScriptRequest() : + FPlayFabBaseModel(), + DeveloperPlayFabId(), + Files(), + Publish(false) + {} + + FUpdateCloudScriptRequest(const FUpdateCloudScriptRequest& src) : + FPlayFabBaseModel(), + DeveloperPlayFabId(src.DeveloperPlayFabId), + Files(src.Files), + Publish(src.Publish) + {} + + FUpdateCloudScriptRequest(const TSharedPtr& obj) : FUpdateCloudScriptRequest() + { + readFromValue(obj); + } + + ~FUpdateCloudScriptRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCloudScriptResult : public FPlayFabBaseModel + { + // New revision number created + int32 Revision; + + // Cloud Script version updated + int32 Version; + + FUpdateCloudScriptResult() : + FPlayFabBaseModel(), + Revision(0), + Version(0) + {} + + FUpdateCloudScriptResult(const FUpdateCloudScriptResult& src) : + FPlayFabBaseModel(), + Revision(src.Revision), + Version(src.Version) + {} + + FUpdateCloudScriptResult(const TSharedPtr& obj) : FUpdateCloudScriptResult() + { + readFromValue(obj); + } + + ~FUpdateCloudScriptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerSharedSecretRequest : public FPlayFabBaseModel + { + // Disable or Enable this key + bool Disabled; + + // [optional] Friendly name for this key + FString FriendlyName; + + // [optional] The shared secret key to update + FString SecretKey; + + FUpdatePlayerSharedSecretRequest() : + FPlayFabBaseModel(), + Disabled(false), + FriendlyName(), + SecretKey() + {} + + FUpdatePlayerSharedSecretRequest(const FUpdatePlayerSharedSecretRequest& src) : + FPlayFabBaseModel(), + Disabled(src.Disabled), + FriendlyName(src.FriendlyName), + SecretKey(src.SecretKey) + {} + + FUpdatePlayerSharedSecretRequest(const TSharedPtr& obj) : FUpdatePlayerSharedSecretRequest() + { + readFromValue(obj); + } + + ~FUpdatePlayerSharedSecretRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerSharedSecretResult : public FPlayFabBaseModel + { + FUpdatePlayerSharedSecretResult() : + FPlayFabBaseModel() + {} + + FUpdatePlayerSharedSecretResult(const FUpdatePlayerSharedSecretResult& src) : + FPlayFabBaseModel() + {} + + FUpdatePlayerSharedSecretResult(const TSharedPtr& obj) : FUpdatePlayerSharedSecretResult() + { + readFromValue(obj); + } + + ~FUpdatePlayerSharedSecretResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerStatisticDefinitionRequest : public FPlayFabBaseModel + { + // [optional] the aggregation method to use in updating the statistic (defaults to last) + Boxed AggregationMethod; + + // unique name of the statistic + FString StatisticName; + + /** + * [optional] interval at which the values of the statistic for all players are reset (changes are effective at the next occurance of + * the new interval boundary) + */ + Boxed VersionChangeInterval; + + FUpdatePlayerStatisticDefinitionRequest() : + FPlayFabBaseModel(), + AggregationMethod(), + StatisticName(), + VersionChangeInterval() + {} + + FUpdatePlayerStatisticDefinitionRequest(const FUpdatePlayerStatisticDefinitionRequest& src) : + FPlayFabBaseModel(), + AggregationMethod(src.AggregationMethod), + StatisticName(src.StatisticName), + VersionChangeInterval(src.VersionChangeInterval) + {} + + FUpdatePlayerStatisticDefinitionRequest(const TSharedPtr& obj) : FUpdatePlayerStatisticDefinitionRequest() + { + readFromValue(obj); + } + + ~FUpdatePlayerStatisticDefinitionRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerStatisticDefinitionResult : public FPlayFabBaseModel + { + // [optional] updated statistic definition + TSharedPtr Statistic; + + FUpdatePlayerStatisticDefinitionResult() : + FPlayFabBaseModel(), + Statistic(nullptr) + {} + + FUpdatePlayerStatisticDefinitionResult(const FUpdatePlayerStatisticDefinitionResult& src) : + FPlayFabBaseModel(), + Statistic(src.Statistic.IsValid() ? MakeShareable(new FPlayerStatisticDefinition(*src.Statistic)) : nullptr) + {} + + FUpdatePlayerStatisticDefinitionResult(const TSharedPtr& obj) : FUpdatePlayerStatisticDefinitionResult() + { + readFromValue(obj); + } + + ~FUpdatePlayerStatisticDefinitionResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePolicyRequest : public FPlayFabBaseModel + { + // Whether to overwrite or append to the existing policy. + bool OverwritePolicy; + + // The name of the policy being updated. Only supported name is 'ApiPolicy' + FString PolicyName; + + // The new statements to include in the policy. + TArray Statements; + FUpdatePolicyRequest() : + FPlayFabBaseModel(), + OverwritePolicy(false), + PolicyName(), + Statements() + {} + + FUpdatePolicyRequest(const FUpdatePolicyRequest& src) : + FPlayFabBaseModel(), + OverwritePolicy(src.OverwritePolicy), + PolicyName(src.PolicyName), + Statements(src.Statements) + {} + + FUpdatePolicyRequest(const TSharedPtr& obj) : FUpdatePolicyRequest() + { + readFromValue(obj); + } + + ~FUpdatePolicyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePolicyResponse : public FPlayFabBaseModel + { + // [optional] The name of the policy that was updated. + FString PolicyName; + + // [optional] The statements included in the new version of the policy. + TArray Statements; + FUpdatePolicyResponse() : + FPlayFabBaseModel(), + PolicyName(), + Statements() + {} + + FUpdatePolicyResponse(const FUpdatePolicyResponse& src) : + FPlayFabBaseModel(), + PolicyName(src.PolicyName), + Statements(src.Statements) + {} + + FUpdatePolicyResponse(const TSharedPtr& obj) : FUpdatePolicyResponse() + { + readFromValue(obj); + } + + ~FUpdatePolicyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateRandomResultTablesRequest : public FPlayFabBaseModel + { + // [optional] which catalog is being updated. If null, update the current default catalog version + FString CatalogVersion; + + /** + * [optional] array of random result tables to make available (Note: specifying an existing TableId will result in overwriting that + * table, while any others will be added to the available set) + */ + TArray Tables; + FUpdateRandomResultTablesRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + Tables() + {} + + FUpdateRandomResultTablesRequest(const FUpdateRandomResultTablesRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + Tables(src.Tables) + {} + + FUpdateRandomResultTablesRequest(const TSharedPtr& obj) : FUpdateRandomResultTablesRequest() + { + readFromValue(obj); + } + + ~FUpdateRandomResultTablesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateRandomResultTablesResult : public FPlayFabBaseModel + { + FUpdateRandomResultTablesResult() : + FPlayFabBaseModel() + {} + + FUpdateRandomResultTablesResult(const FUpdateRandomResultTablesResult& src) : + FPlayFabBaseModel() + {} + + FUpdateRandomResultTablesResult(const TSharedPtr& obj) : FUpdateRandomResultTablesResult() + { + readFromValue(obj); + } + + ~FUpdateRandomResultTablesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateStoreItemsRequest : public FPlayFabBaseModel + { + // [optional] Catalog version of the store to update. If null, uses the default catalog. + FString CatalogVersion; + + // [optional] Additional data about the store + TSharedPtr MarketingData; + + // [optional] Array of store items - references to catalog items, with specific pricing - to be added + TArray Store; + // Unique identifier for the store which is to be updated + FString StoreId; + + FUpdateStoreItemsRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + MarketingData(nullptr), + Store(), + StoreId() + {} + + FUpdateStoreItemsRequest(const FUpdateStoreItemsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + MarketingData(src.MarketingData.IsValid() ? MakeShareable(new FStoreMarketingModel(*src.MarketingData)) : nullptr), + Store(src.Store), + StoreId(src.StoreId) + {} + + FUpdateStoreItemsRequest(const TSharedPtr& obj) : FUpdateStoreItemsRequest() + { + readFromValue(obj); + } + + ~FUpdateStoreItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateStoreItemsResult : public FPlayFabBaseModel + { + FUpdateStoreItemsResult() : + FPlayFabBaseModel() + {} + + FUpdateStoreItemsResult(const FUpdateStoreItemsResult& src) : + FPlayFabBaseModel() + {} + + FUpdateStoreItemsResult(const TSharedPtr& obj) : FUpdateStoreItemsResult() + { + readFromValue(obj); + } + + ~FUpdateStoreItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateTaskRequest : public FPlayFabBaseModel + { + // [optional] Description the task + FString Description; + + // [optional] Specify either the task ID or the name of the task to be updated. + TSharedPtr Identifier; + + // Whether the schedule is active. Inactive schedule will not trigger task execution. + bool IsActive; + + // Name of the task. This is a unique identifier for tasks in the title. + FString Name; + + // [optional] Parameter object specific to the task type. See each task type's create API documentation for details. + FJsonKeeper Parameter; + + // [optional] Cron expression for the run schedule of the task. The expression should be in UTC. + FString Schedule; + + // Task type. + ScheduledTaskType Type; + + FUpdateTaskRequest() : + FPlayFabBaseModel(), + Description(), + Identifier(nullptr), + IsActive(false), + Name(), + Parameter(), + Schedule(), + Type() + {} + + FUpdateTaskRequest(const FUpdateTaskRequest& src) : + FPlayFabBaseModel(), + Description(src.Description), + Identifier(src.Identifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.Identifier)) : nullptr), + IsActive(src.IsActive), + Name(src.Name), + Parameter(src.Parameter), + Schedule(src.Schedule), + Type(src.Type) + {} + + FUpdateTaskRequest(const TSharedPtr& obj) : FUpdateTaskRequest() + { + readFromValue(obj); + } + + ~FUpdateTaskRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // [optional] Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. + Boxed Permission; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateUserDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + Permission(), + PlayFabId() + {} + + FUpdateUserDataRequest(const FUpdateUserDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission), + PlayFabId(src.PlayFabId) + {} + + FUpdateUserDataRequest(const TSharedPtr& obj) : FUpdateUserDataRequest() + { + readFromValue(obj); + } + + ~FUpdateUserDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserDataResult : public FPlayFabBaseModel + { + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FUpdateUserDataResult() : + FPlayFabBaseModel(), + DataVersion(0) + {} + + FUpdateUserDataResult(const FUpdateUserDataResult& src) : + FPlayFabBaseModel(), + DataVersion(src.DataVersion) + {} + + FUpdateUserDataResult(const TSharedPtr& obj) : FUpdateUserDataResult() + { + readFromValue(obj); + } + + ~FUpdateUserDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserInternalDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateUserInternalDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + PlayFabId() + {} + + FUpdateUserInternalDataRequest(const FUpdateUserInternalDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + PlayFabId(src.PlayFabId) + {} + + FUpdateUserInternalDataRequest(const TSharedPtr& obj) : FUpdateUserInternalDataRequest() + { + readFromValue(obj); + } + + ~FUpdateUserInternalDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserTitleDisplayNameRequest : public FPlayFabBaseModel + { + // New title display name for the user - must be between 3 and 25 characters + FString DisplayName; + + // PlayFab unique identifier of the user whose title specific display name is to be changed + FString PlayFabId; + + FUpdateUserTitleDisplayNameRequest() : + FPlayFabBaseModel(), + DisplayName(), + PlayFabId() + {} + + FUpdateUserTitleDisplayNameRequest(const FUpdateUserTitleDisplayNameRequest& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName), + PlayFabId(src.PlayFabId) + {} + + FUpdateUserTitleDisplayNameRequest(const TSharedPtr& obj) : FUpdateUserTitleDisplayNameRequest() + { + readFromValue(obj); + } + + ~FUpdateUserTitleDisplayNameRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserTitleDisplayNameResult : public FPlayFabBaseModel + { + // [optional] current title display name for the user (this will be the original display name if the rename attempt failed) + FString DisplayName; + + FUpdateUserTitleDisplayNameResult() : + FPlayFabBaseModel(), + DisplayName() + {} + + FUpdateUserTitleDisplayNameResult(const FUpdateUserTitleDisplayNameResult& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName) + {} + + FUpdateUserTitleDisplayNameResult(const TSharedPtr& obj) : FUpdateUserTitleDisplayNameResult() + { + readFromValue(obj); + } + + ~FUpdateUserTitleDisplayNameResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAuthenticationAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAuthenticationAPI.h new file mode 100644 index 000000000..7681c0a0d --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAuthenticationAPI.h @@ -0,0 +1,44 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabAuthenticationDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabAuthenticationAPI + { + public: + DECLARE_DELEGATE_OneParam(FGetEntityTokenDelegate, const AuthenticationModels::FGetEntityTokenResponse&); + + UPlayFabAuthenticationAPI(); + ~UPlayFabAuthenticationAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Method to exchange a legacy AuthenticationTicket or title SecretKey for an Entity Token or to refresh a still valid + * Entity Token. + * This API must be called with X-SecretKey, X-Authentication or X-EntityToken headers. An optional EntityKey may be included to attempt to set the resulting EntityToken to a specific entity, however the entity must be a relation of the caller, such as the master_player_account of a character. If sending X-EntityToken the account will be marked as freshly logged in and will issue a new token. If using X-Authentication or X-EntityToken the header must still be valid and cannot be expired or revoked. + */ + bool GetEntityToken(AuthenticationModels::FGetEntityTokenRequest& request, const FGetEntityTokenDelegate& SuccessDelegate = FGetEntityTokenDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnGetEntityTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetEntityTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAuthenticationDataModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAuthenticationDataModels.h new file mode 100644 index 000000000..6b710d43c --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAuthenticationDataModels.h @@ -0,0 +1,111 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace AuthenticationModels +{ + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetEntityTokenRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + FGetEntityTokenRequest() : + FPlayFabBaseModel(), + Entity(nullptr) + {} + + FGetEntityTokenRequest(const FGetEntityTokenRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr) + {} + + FGetEntityTokenRequest(const TSharedPtr& obj) : FGetEntityTokenRequest() + { + readFromValue(obj); + } + + ~FGetEntityTokenRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetEntityTokenResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // [optional] The token used to set X-EntityToken for all entity based API calls. + FString EntityToken; + + // [optional] The time the token will expire, if it is an expiring token, in UTC. + Boxed TokenExpiration; + + FGetEntityTokenResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + EntityToken(), + TokenExpiration() + {} + + FGetEntityTokenResponse(const FGetEntityTokenResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + EntityToken(src.EntityToken), + TokenExpiration(src.TokenExpiration) + {} + + FGetEntityTokenResponse(const TSharedPtr& obj) : FGetEntityTokenResponse() + { + readFromValue(obj); + } + + ~FGetEntityTokenResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabBaseModel.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabBaseModel.h new file mode 100644 index 000000000..04ffaf386 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabBaseModel.h @@ -0,0 +1,98 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" +#include "Json.h" + +namespace PlayFab +{ + typedef TSharedRef< TJsonWriter > > JsonWriter; + typedef TSharedRef< TJsonReader > JsonReader; + + template + class Boxed + { + public: + BoxedType mValue; + + Boxed() : mValue(), mIsSet(false) {} + Boxed(BoxedType value) : mValue(value), mIsSet(true) {} + + Boxed& operator=(BoxedType value) { mValue = value; mIsSet = true; return *this; } + operator BoxedType() { return mValue; } + operator BoxedType() const { return mValue; } + + void setNull() { mIsSet = false; } + bool notNull() { return mIsSet; } + bool notNull() const { return mIsSet; } + bool isNull() { return !mIsSet; } + bool isNull() const { return !mIsSet; } + private: + bool mIsSet; + }; + + struct PLAYFABCPP_API FPlayFabBaseModel + { + virtual ~FPlayFabBaseModel() {} + virtual void writeJSON(JsonWriter& Json) const = 0; + virtual bool readFromValue(const TSharedPtr& obj) = 0; + virtual bool readFromValue(const TSharedPtr& value) { return false; }; + + FString toJSONString() const; + }; + + struct PLAYFABCPP_API FJsonKeeper : public FPlayFabBaseModel + { + private: + TSharedRef JsonValue; // Reference so that any time this struct is avaiable, the JsonValue is aswell, even if a FJsonValueNull + + public: + FJsonKeeper() : JsonValue(MakeShareable(new FJsonValueNull())) {} + FJsonKeeper(const TSharedPtr& val) : JsonValue(val.ToSharedRef()) {} + FJsonKeeper(const TSharedPtr& val) : JsonValue(MakeShareable(new FJsonValueObject(val))) {} + FJsonKeeper(const FString& val) : JsonValue(MakeShareable(new FJsonValueString(val))) {} + FJsonKeeper(const bool& val) : JsonValue(MakeShareable(new FJsonValueBoolean(val))) {} + FJsonKeeper(const int8& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const int16& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const int32& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const int64& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const uint8& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const uint16& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const uint32& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const uint64& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const float& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const double& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + + bool notNull() const { return !isNull(); } + bool isNull() const { return JsonValue->IsNull(); } + + FJsonKeeper& operator=(const TSharedPtr& val) { JsonValue = val.ToSharedRef(); return *this; } + FJsonKeeper& operator=(const TSharedPtr& val) { JsonValue = MakeShareable(new FJsonValueObject(val)); return *this; } + FJsonKeeper& operator=(const FString& val) { JsonValue = MakeShareable(new FJsonValueString(val)); return *this; } + FJsonKeeper& operator=(const bool& val) { JsonValue = MakeShareable(new FJsonValueBoolean(val)); return *this; } + FJsonKeeper& operator=(const int8& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const int16& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const int32& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const int64& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const uint8& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const uint16& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const uint32& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const uint64& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const float& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const double& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + + ~FJsonKeeper() {} + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + bool readFromValue(const TSharedPtr& value) override; + + TSharedPtr GetJsonValue() const { return JsonValue; }; + }; + + void writeDatetime(FDateTime datetime, JsonWriter& writer); + FDateTime readDatetime(const TSharedPtr& value); +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabClientAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabClientAPI.h new file mode 100644 index 000000000..7ac7116ed --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabClientAPI.h @@ -0,0 +1,998 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabClientDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabClientAPI + { + public: + DECLARE_DELEGATE_OneParam(FAcceptTradeDelegate, const ClientModels::FAcceptTradeResponse&); + DECLARE_DELEGATE_OneParam(FAddFriendDelegate, const ClientModels::FAddFriendResult&); + DECLARE_DELEGATE_OneParam(FAddGenericIDDelegate, const ClientModels::FAddGenericIDResult&); + DECLARE_DELEGATE_OneParam(FAddOrUpdateContactEmailDelegate, const ClientModels::FAddOrUpdateContactEmailResult&); + DECLARE_DELEGATE_OneParam(FAddSharedGroupMembersDelegate, const ClientModels::FAddSharedGroupMembersResult&); + DECLARE_DELEGATE_OneParam(FAddUsernamePasswordDelegate, const ClientModels::FAddUsernamePasswordResult&); + DECLARE_DELEGATE_OneParam(FAddUserVirtualCurrencyDelegate, const ClientModels::FModifyUserVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FAndroidDevicePushNotificationRegistrationDelegate, const ClientModels::FAndroidDevicePushNotificationRegistrationResult&); + DECLARE_DELEGATE_OneParam(FAttributeInstallDelegate, const ClientModels::FAttributeInstallResult&); + DECLARE_DELEGATE_OneParam(FCancelTradeDelegate, const ClientModels::FCancelTradeResponse&); + DECLARE_DELEGATE_OneParam(FConfirmPurchaseDelegate, const ClientModels::FConfirmPurchaseResult&); + DECLARE_DELEGATE_OneParam(FConsumeItemDelegate, const ClientModels::FConsumeItemResult&); + DECLARE_DELEGATE_OneParam(FConsumeXboxEntitlementsDelegate, const ClientModels::FConsumeXboxEntitlementsResult&); + DECLARE_DELEGATE_OneParam(FCreateSharedGroupDelegate, const ClientModels::FCreateSharedGroupResult&); + DECLARE_DELEGATE_OneParam(FExecuteCloudScriptDelegate, const ClientModels::FExecuteCloudScriptResult&); + DECLARE_DELEGATE_OneParam(FGetAccountInfoDelegate, const ClientModels::FGetAccountInfoResult&); + DECLARE_DELEGATE_OneParam(FGetAllUsersCharactersDelegate, const ClientModels::FListUsersCharactersResult&); + DECLARE_DELEGATE_OneParam(FGetCatalogItemsDelegate, const ClientModels::FGetCatalogItemsResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterDataDelegate, const ClientModels::FGetCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterInventoryDelegate, const ClientModels::FGetCharacterInventoryResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterLeaderboardDelegate, const ClientModels::FGetCharacterLeaderboardResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterReadOnlyDataDelegate, const ClientModels::FGetCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterStatisticsDelegate, const ClientModels::FGetCharacterStatisticsResult&); + DECLARE_DELEGATE_OneParam(FGetContentDownloadUrlDelegate, const ClientModels::FGetContentDownloadUrlResult&); + DECLARE_DELEGATE_OneParam(FGetCurrentGamesDelegate, const ClientModels::FCurrentGamesResult&); + DECLARE_DELEGATE_OneParam(FGetFriendLeaderboardDelegate, const ClientModels::FGetLeaderboardResult&); + DECLARE_DELEGATE_OneParam(FGetFriendLeaderboardAroundPlayerDelegate, const ClientModels::FGetFriendLeaderboardAroundPlayerResult&); + DECLARE_DELEGATE_OneParam(FGetFriendsListDelegate, const ClientModels::FGetFriendsListResult&); + DECLARE_DELEGATE_OneParam(FGetGameServerRegionsDelegate, const ClientModels::FGameServerRegionsResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardDelegate, const ClientModels::FGetLeaderboardResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardAroundCharacterDelegate, const ClientModels::FGetLeaderboardAroundCharacterResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardAroundPlayerDelegate, const ClientModels::FGetLeaderboardAroundPlayerResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardForUserCharactersDelegate, const ClientModels::FGetLeaderboardForUsersCharactersResult&); + DECLARE_DELEGATE_OneParam(FGetPaymentTokenDelegate, const ClientModels::FGetPaymentTokenResult&); + DECLARE_DELEGATE_OneParam(FGetPhotonAuthenticationTokenDelegate, const ClientModels::FGetPhotonAuthenticationTokenResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerCombinedInfoDelegate, const ClientModels::FGetPlayerCombinedInfoResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerProfileDelegate, const ClientModels::FGetPlayerProfileResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerSegmentsDelegate, const ClientModels::FGetPlayerSegmentsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerStatisticsDelegate, const ClientModels::FGetPlayerStatisticsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerStatisticVersionsDelegate, const ClientModels::FGetPlayerStatisticVersionsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerTagsDelegate, const ClientModels::FGetPlayerTagsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerTradesDelegate, const ClientModels::FGetPlayerTradesResponse&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromFacebookIDsDelegate, const ClientModels::FGetPlayFabIDsFromFacebookIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate, const ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromGameCenterIDsDelegate, const ClientModels::FGetPlayFabIDsFromGameCenterIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromGenericIDsDelegate, const ClientModels::FGetPlayFabIDsFromGenericIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromGoogleIDsDelegate, const ClientModels::FGetPlayFabIDsFromGoogleIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromKongregateIDsDelegate, const ClientModels::FGetPlayFabIDsFromKongregateIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate, const ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromSteamIDsDelegate, const ClientModels::FGetPlayFabIDsFromSteamIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromTwitchIDsDelegate, const ClientModels::FGetPlayFabIDsFromTwitchIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPublisherDataDelegate, const ClientModels::FGetPublisherDataResult&); + DECLARE_DELEGATE_OneParam(FGetPurchaseDelegate, const ClientModels::FGetPurchaseResult&); + DECLARE_DELEGATE_OneParam(FGetSharedGroupDataDelegate, const ClientModels::FGetSharedGroupDataResult&); + DECLARE_DELEGATE_OneParam(FGetStoreItemsDelegate, const ClientModels::FGetStoreItemsResult&); + DECLARE_DELEGATE_OneParam(FGetTimeDelegate, const ClientModels::FGetTimeResult&); + DECLARE_DELEGATE_OneParam(FGetTitleDataDelegate, const ClientModels::FGetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FGetTitleNewsDelegate, const ClientModels::FGetTitleNewsResult&); + DECLARE_DELEGATE_OneParam(FGetTitlePublicKeyDelegate, const ClientModels::FGetTitlePublicKeyResult&); + DECLARE_DELEGATE_OneParam(FGetTradeStatusDelegate, const ClientModels::FGetTradeStatusResponse&); + DECLARE_DELEGATE_OneParam(FGetUserDataDelegate, const ClientModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserInventoryDelegate, const ClientModels::FGetUserInventoryResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherDataDelegate, const ClientModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherReadOnlyDataDelegate, const ClientModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserReadOnlyDataDelegate, const ClientModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetWindowsHelloChallengeDelegate, const ClientModels::FGetWindowsHelloChallengeResponse&); + DECLARE_DELEGATE_OneParam(FGrantCharacterToUserDelegate, const ClientModels::FGrantCharacterToUserResult&); + DECLARE_DELEGATE_OneParam(FLinkAndroidDeviceIDDelegate, const ClientModels::FLinkAndroidDeviceIDResult&); + DECLARE_DELEGATE_OneParam(FLinkCustomIDDelegate, const ClientModels::FLinkCustomIDResult&); + DECLARE_DELEGATE_OneParam(FLinkFacebookAccountDelegate, const ClientModels::FLinkFacebookAccountResult&); + DECLARE_DELEGATE_OneParam(FLinkFacebookInstantGamesIdDelegate, const ClientModels::FLinkFacebookInstantGamesIdResult&); + DECLARE_DELEGATE_OneParam(FLinkGameCenterAccountDelegate, const ClientModels::FLinkGameCenterAccountResult&); + DECLARE_DELEGATE_OneParam(FLinkGoogleAccountDelegate, const ClientModels::FLinkGoogleAccountResult&); + DECLARE_DELEGATE_OneParam(FLinkIOSDeviceIDDelegate, const ClientModels::FLinkIOSDeviceIDResult&); + DECLARE_DELEGATE_OneParam(FLinkKongregateDelegate, const ClientModels::FLinkKongregateAccountResult&); + DECLARE_DELEGATE_OneParam(FLinkNintendoSwitchDeviceIdDelegate, const ClientModels::FLinkNintendoSwitchDeviceIdResult&); + DECLARE_DELEGATE_OneParam(FLinkSteamAccountDelegate, const ClientModels::FLinkSteamAccountResult&); + DECLARE_DELEGATE_OneParam(FLinkTwitchDelegate, const ClientModels::FLinkTwitchAccountResult&); + DECLARE_DELEGATE_OneParam(FLinkWindowsHelloDelegate, const ClientModels::FLinkWindowsHelloAccountResponse&); + DECLARE_DELEGATE_OneParam(FLinkXboxAccountDelegate, const ClientModels::FLinkXboxAccountResult&); + DECLARE_DELEGATE_OneParam(FLoginWithAndroidDeviceIDDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithCustomIDDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithEmailAddressDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithFacebookDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithFacebookInstantGamesIdDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithGameCenterDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithGoogleAccountDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithIOSDeviceIDDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithKongregateDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithNintendoSwitchDeviceIdDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithPlayFabDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithSteamDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithTwitchDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithWindowsHelloDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithXboxDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FMatchmakeDelegate, const ClientModels::FMatchmakeResult&); + DECLARE_DELEGATE_OneParam(FOpenTradeDelegate, const ClientModels::FOpenTradeResponse&); + DECLARE_DELEGATE_OneParam(FPayForPurchaseDelegate, const ClientModels::FPayForPurchaseResult&); + DECLARE_DELEGATE_OneParam(FPurchaseItemDelegate, const ClientModels::FPurchaseItemResult&); + DECLARE_DELEGATE_OneParam(FRedeemCouponDelegate, const ClientModels::FRedeemCouponResult&); + DECLARE_DELEGATE_OneParam(FRegisterForIOSPushNotificationDelegate, const ClientModels::FRegisterForIOSPushNotificationResult&); + DECLARE_DELEGATE_OneParam(FRegisterPlayFabUserDelegate, const ClientModels::FRegisterPlayFabUserResult&); + DECLARE_DELEGATE_OneParam(FRegisterWithWindowsHelloDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FRemoveContactEmailDelegate, const ClientModels::FRemoveContactEmailResult&); + DECLARE_DELEGATE_OneParam(FRemoveFriendDelegate, const ClientModels::FRemoveFriendResult&); + DECLARE_DELEGATE_OneParam(FRemoveGenericIDDelegate, const ClientModels::FRemoveGenericIDResult&); + DECLARE_DELEGATE_OneParam(FRemoveSharedGroupMembersDelegate, const ClientModels::FRemoveSharedGroupMembersResult&); + DECLARE_DELEGATE_OneParam(FReportDeviceInfoDelegate, const ClientModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FReportPlayerDelegate, const ClientModels::FReportPlayerClientResult&); + DECLARE_DELEGATE_OneParam(FRestoreIOSPurchasesDelegate, const ClientModels::FRestoreIOSPurchasesResult&); + DECLARE_DELEGATE_OneParam(FSendAccountRecoveryEmailDelegate, const ClientModels::FSendAccountRecoveryEmailResult&); + DECLARE_DELEGATE_OneParam(FSetFriendTagsDelegate, const ClientModels::FSetFriendTagsResult&); + DECLARE_DELEGATE_OneParam(FSetPlayerSecretDelegate, const ClientModels::FSetPlayerSecretResult&); + DECLARE_DELEGATE_OneParam(FStartGameDelegate, const ClientModels::FStartGameResult&); + DECLARE_DELEGATE_OneParam(FStartPurchaseDelegate, const ClientModels::FStartPurchaseResult&); + DECLARE_DELEGATE_OneParam(FSubtractUserVirtualCurrencyDelegate, const ClientModels::FModifyUserVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FUnlinkAndroidDeviceIDDelegate, const ClientModels::FUnlinkAndroidDeviceIDResult&); + DECLARE_DELEGATE_OneParam(FUnlinkCustomIDDelegate, const ClientModels::FUnlinkCustomIDResult&); + DECLARE_DELEGATE_OneParam(FUnlinkFacebookAccountDelegate, const ClientModels::FUnlinkFacebookAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlinkFacebookInstantGamesIdDelegate, const ClientModels::FUnlinkFacebookInstantGamesIdResult&); + DECLARE_DELEGATE_OneParam(FUnlinkGameCenterAccountDelegate, const ClientModels::FUnlinkGameCenterAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlinkGoogleAccountDelegate, const ClientModels::FUnlinkGoogleAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlinkIOSDeviceIDDelegate, const ClientModels::FUnlinkIOSDeviceIDResult&); + DECLARE_DELEGATE_OneParam(FUnlinkKongregateDelegate, const ClientModels::FUnlinkKongregateAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlinkNintendoSwitchDeviceIdDelegate, const ClientModels::FUnlinkNintendoSwitchDeviceIdResult&); + DECLARE_DELEGATE_OneParam(FUnlinkSteamAccountDelegate, const ClientModels::FUnlinkSteamAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlinkTwitchDelegate, const ClientModels::FUnlinkTwitchAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlinkWindowsHelloDelegate, const ClientModels::FUnlinkWindowsHelloAccountResponse&); + DECLARE_DELEGATE_OneParam(FUnlinkXboxAccountDelegate, const ClientModels::FUnlinkXboxAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlockContainerInstanceDelegate, const ClientModels::FUnlockContainerItemResult&); + DECLARE_DELEGATE_OneParam(FUnlockContainerItemDelegate, const ClientModels::FUnlockContainerItemResult&); + DECLARE_DELEGATE_OneParam(FUpdateAvatarUrlDelegate, const ClientModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FUpdateCharacterDataDelegate, const ClientModels::FUpdateCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateCharacterStatisticsDelegate, const ClientModels::FUpdateCharacterStatisticsResult&); + DECLARE_DELEGATE_OneParam(FUpdatePlayerStatisticsDelegate, const ClientModels::FUpdatePlayerStatisticsResult&); + DECLARE_DELEGATE_OneParam(FUpdateSharedGroupDataDelegate, const ClientModels::FUpdateSharedGroupDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserDataDelegate, const ClientModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherDataDelegate, const ClientModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserTitleDisplayNameDelegate, const ClientModels::FUpdateUserTitleDisplayNameResult&); + DECLARE_DELEGATE_OneParam(FValidateAmazonIAPReceiptDelegate, const ClientModels::FValidateAmazonReceiptResult&); + DECLARE_DELEGATE_OneParam(FValidateGooglePlayPurchaseDelegate, const ClientModels::FValidateGooglePlayPurchaseResult&); + DECLARE_DELEGATE_OneParam(FValidateIOSReceiptDelegate, const ClientModels::FValidateIOSReceiptResult&); + DECLARE_DELEGATE_OneParam(FValidateWindowsStoreReceiptDelegate, const ClientModels::FValidateWindowsReceiptResult&); + DECLARE_DELEGATE_OneParam(FWriteCharacterEventDelegate, const ClientModels::FWriteEventResponse&); + DECLARE_DELEGATE_OneParam(FWritePlayerEventDelegate, const ClientModels::FWriteEventResponse&); + DECLARE_DELEGATE_OneParam(FWriteTitleEventDelegate, const ClientModels::FWriteEventResponse&); + + UPlayFabClientAPI(); + ~UPlayFabClientAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + bool SetAdvertId(const FString& typeId, const FString& advertisingIdValue); + bool AdvertIdSuccessful(); + bool IsClientLoggedIn() const; + void MultiStepClientLogin(bool needsAttribution); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Accepts an open trade (one that has not yet been accepted or cancelled), if the locally signed-in player is in the + * allowed player list for the trade, or it is open to all players. If the call is successful, the offered and accepted + * items will be swapped between the two players' inventories. + */ + bool AcceptTrade(ClientModels::FAcceptTradeRequest& request, const FAcceptTradeDelegate& SuccessDelegate = FAcceptTradeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user. At + * least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. + */ + bool AddFriend(ClientModels::FAddFriendRequest& request, const FAddFriendDelegate& SuccessDelegate = FAddFriendDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab + * ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as + * authentication credentials, as the intent is that it is easily accessible by other players. + */ + bool AddGenericID(ClientModels::FAddGenericIDRequest& request, const FAddGenericIDDelegate& SuccessDelegate = FAddGenericIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds or updates a contact email to the player's profile. + * This API adds a contact email to the player's profile. If the player's profile already contains a contact email, it will update the contact email to the email address specified. + */ + bool AddOrUpdateContactEmail(ClientModels::FAddOrUpdateContactEmailRequest& request, const FAddOrUpdateContactEmailDelegate& SuccessDelegate = FAddOrUpdateContactEmailDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users + * in the group can add new members. Shared Groups are designed for sharing data between a very small number of players, + * please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool AddSharedGroupMembers(ClientModels::FAddSharedGroupMembersRequest& request, const FAddSharedGroupMembersDelegate& SuccessDelegate = FAddSharedGroupMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds playfab username/password auth to an existing account created via an anonymous auth method, e.g. automatic device + * ID login. + */ + bool AddUsernamePassword(ClientModels::FAddUsernamePasswordRequest& request, const FAddUsernamePasswordDelegate& SuccessDelegate = FAddUsernamePasswordDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Increments the user's balance of the specified virtual currency by the stated amount + * This API must be enabled for use as an option in the game manager website. It is disabled by default. + */ + bool AddUserVirtualCurrency(ClientModels::FAddUserVirtualCurrencyRequest& request, const FAddUserVirtualCurrencyDelegate& SuccessDelegate = FAddUserVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Registers the Android device to receive push notifications + * More information can be found on configuring your game for the Google Cloud Messaging service in the Google developer documentation, here: http://developer.android.com/google/gcm/client.html. The steps to configure and send Push Notifications is described in the PlayFab tutorials, here: https://api.playfab.com/docs/pushCrashCourse/. + */ + bool AndroidDevicePushNotificationRegistration(ClientModels::FAndroidDevicePushNotificationRegistrationRequest& request, const FAndroidDevicePushNotificationRegistrationDelegate& SuccessDelegate = FAndroidDevicePushNotificationRegistrationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Attributes an install for advertisment. + * If you have an ad attribution partner enabled, this will post an install to their service to track the device. It uses the given device id to match based on clicks on ads. + */ + bool AttributeInstall(ClientModels::FAttributeInstallRequest& request, const FAttributeInstallDelegate& SuccessDelegate = FAttributeInstallDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Cancels an open trade (one that has not yet been accepted or cancelled). Note that only the player who created the trade + * can cancel it via this API call, to prevent griefing of the trade system (cancelling trades in order to prevent other + * players from accepting them, for trades that can be claimed by more than one player). + */ + bool CancelTrade(ClientModels::FCancelTradeRequest& request, const FCancelTradeDelegate& SuccessDelegate = FCancelTradeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Confirms with the payment provider that the purchase was approved (if applicable) and adjusts inventory and virtual + * currency balances as appropriate + * The final step in the purchasing process, this API finalizes the purchase with the payment provider, where applicable, adding virtual goods to the player inventory (including random drop table resolution and recursive addition of bundled items) and adjusting virtual currency balances for funds used or added. Note that this is a pull operation, and should be polled regularly when a purchase is in progress. Please note that the processing time for inventory grants and purchases increases fractionally the more items are in the inventory, and the more items are in the grant/purchase operation. + */ + bool ConfirmPurchase(ClientModels::FConfirmPurchaseRequest& request, const FConfirmPurchaseDelegate& SuccessDelegate = FConfirmPurchaseDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. + bool ConsumeItem(ClientModels::FConsumeItemRequest& request, const FConsumeItemDelegate& SuccessDelegate = FConsumeItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Grants the player's current entitlements from Xbox Live, consuming all availble items in Xbox and granting them to the + * player's PlayFab inventory. This call is idempotent and will not grant previously granted items to the player. + */ + bool ConsumeXboxEntitlements(ClientModels::FConsumeXboxEntitlementsRequest& request, const FConsumeXboxEntitlementsDelegate& SuccessDelegate = FConsumeXboxEntitlementsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the + * group. Upon creation, the current user will be the only member of the group. Shared Groups are designed for sharing data + * between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + * If SharedGroupId is specified, the service will attempt to create a group with that identifier, and will return an error if it is already in use. If no SharedGroupId is specified, a random identifier will be assigned. + */ + bool CreateSharedGroup(ClientModels::FCreateSharedGroupRequest& request, const FCreateSharedGroupDelegate& SuccessDelegate = FCreateSharedGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Executes a CloudScript function, with the 'currentPlayerId' set to the PlayFab ID of the authenticated player. + bool ExecuteCloudScript(ClientModels::FExecuteCloudScriptRequest& request, const FExecuteCloudScriptDelegate& SuccessDelegate = FExecuteCloudScriptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the user's PlayFab account details + bool GetAccountInfo(ClientModels::FGetAccountInfoRequest& request, const FGetAccountInfoDelegate& SuccessDelegate = FGetAccountInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be + * evaluated with the parent PlayFabId to guarantee uniqueness. + * Returns a list of every character that currently belongs to a user. + */ + bool GetAllUsersCharacters(ClientModels::FListUsersCharactersRequest& request, const FGetAllUsersCharactersDelegate& SuccessDelegate = FGetAllUsersCharactersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the specified version of the title's catalog of virtual goods, including all defined properties + bool GetCatalogItems(ClientModels::FGetCatalogItemsRequest& request, const FGetCatalogItemsDelegate& SuccessDelegate = FGetCatalogItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the character which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom character data will be returned. + */ + bool GetCharacterData(ClientModels::FGetCharacterDataRequest& request, const FGetCharacterDataDelegate& SuccessDelegate = FGetCharacterDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the specified character's current inventory of virtual goods + * All items currently in the character inventory will be returned, irrespective of how they were acquired (via purchasing, grants, coupons, etc.). Items that are expired, fully consumed, or are no longer valid are not considered to be in the user's current inventory, and so will not be not included. Also returns their virtual currency balances. + */ + bool GetCharacterInventory(ClientModels::FGetCharacterInventoryRequest& request, const FGetCharacterInventoryDelegate& SuccessDelegate = FGetCharacterInventoryDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard + bool GetCharacterLeaderboard(ClientModels::FGetCharacterLeaderboardRequest& request, const FGetCharacterLeaderboardDelegate& SuccessDelegate = FGetCharacterLeaderboardDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the character which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom character data will be returned. + */ + bool GetCharacterReadOnlyData(ClientModels::FGetCharacterDataRequest& request, const FGetCharacterReadOnlyDataDelegate& SuccessDelegate = FGetCharacterReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the details of all title-specific statistics for the user + bool GetCharacterStatistics(ClientModels::FGetCharacterStatisticsRequest& request, const FGetCharacterStatisticsDelegate& SuccessDelegate = FGetCharacterStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned + * URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the + * content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, + * the query to retrieve the data will fail. See this post for more information: + * https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service. Also, + * please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. + */ + bool GetContentDownloadUrl(ClientModels::FGetContentDownloadUrlRequest& request, const FGetContentDownloadUrlDelegate& SuccessDelegate = FGetContentDownloadUrlDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Get details about all current running game servers matching the given parameters. + bool GetCurrentGames(ClientModels::FCurrentGamesRequest& request, const FGetCurrentGamesDelegate& SuccessDelegate = FGetCurrentGamesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves a list of ranked friends of the current player for the given statistic, starting from the indicated point in + * the leaderboard + */ + bool GetFriendLeaderboard(ClientModels::FGetFriendLeaderboardRequest& request, const FGetFriendLeaderboardDelegate& SuccessDelegate = FGetFriendLeaderboardDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves a list of ranked friends of the current player for the given statistic, centered on the requested PlayFab + * user. If PlayFabId is empty or null will return currently logged in user. + */ + bool GetFriendLeaderboardAroundPlayer(ClientModels::FGetFriendLeaderboardAroundPlayerRequest& request, const FGetFriendLeaderboardAroundPlayerDelegate& SuccessDelegate = FGetFriendLeaderboardAroundPlayerDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the current friend list for the local user, constrained to users who have PlayFab accounts. Friends from + * linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. + */ + bool GetFriendsList(ClientModels::FGetFriendsListRequest& request, const FGetFriendsListDelegate& SuccessDelegate = FGetFriendsListDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Get details about the regions hosting game servers matching the given parameters. + bool GetGameServerRegions(ClientModels::FGameServerRegionsRequest& request, const FGetGameServerRegionsDelegate& SuccessDelegate = FGetGameServerRegionsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard + bool GetLeaderboard(ClientModels::FGetLeaderboardRequest& request, const FGetLeaderboardDelegate& SuccessDelegate = FGetLeaderboardDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked characters for the given statistic, centered on the requested Character ID + bool GetLeaderboardAroundCharacter(ClientModels::FGetLeaderboardAroundCharacterRequest& request, const FGetLeaderboardAroundCharacterDelegate& SuccessDelegate = FGetLeaderboardAroundCharacterDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves a list of ranked users for the given statistic, centered on the requested player. If PlayFabId is empty or + * null will return currently logged in user. + */ + bool GetLeaderboardAroundPlayer(ClientModels::FGetLeaderboardAroundPlayerRequest& request, const FGetLeaderboardAroundPlayerDelegate& SuccessDelegate = FGetLeaderboardAroundPlayerDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of all of the user's characters for the given statistic. + bool GetLeaderboardForUserCharacters(ClientModels::FGetLeaderboardForUsersCharactersRequest& request, const FGetLeaderboardForUserCharactersDelegate& SuccessDelegate = FGetLeaderboardForUserCharactersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * For payments flows where the provider requires playfab (the fulfiller) to initiate the transaction, but the client + * completes the rest of the flow. In the Xsolla case, the token returned here will be passed to Xsolla by the client to + * create a cart. Poll GetPurchase using the returned OrderId once you've completed the payment. + */ + bool GetPaymentToken(ClientModels::FGetPaymentTokenRequest& request, const FGetPaymentTokenDelegate& SuccessDelegate = FGetPaymentTokenDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Gets a Photon custom authentication token that can be used to securely join the player into a Photon room. See + * https://api.playfab.com/docs/using-photon-with-playfab/ for more details. + */ + bool GetPhotonAuthenticationToken(ClientModels::FGetPhotonAuthenticationTokenRequest& request, const FGetPhotonAuthenticationTokenDelegate& SuccessDelegate = FGetPhotonAuthenticationTokenDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves all of the user's different kinds of info. + bool GetPlayerCombinedInfo(ClientModels::FGetPlayerCombinedInfoRequest& request, const FGetPlayerCombinedInfoDelegate& SuccessDelegate = FGetPlayerCombinedInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the player's profile + * This API allows for access to details regarding a user in the PlayFab service, usually for purposes of customer support. Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool GetPlayerProfile(ClientModels::FGetPlayerProfileRequest& request, const FGetPlayerProfileDelegate& SuccessDelegate = FGetPlayerProfileDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // List all segments that a player currently belongs to at this moment in time. + + bool GetPlayerSegments(const FGetPlayerSegmentsDelegate& SuccessDelegate = FGetPlayerSegmentsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the indicated statistics (current version and values for all statistics, if none are specified), for the local + * player. + */ + bool GetPlayerStatistics(ClientModels::FGetPlayerStatisticsRequest& request, const FGetPlayerStatisticsDelegate& SuccessDelegate = FGetPlayerStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the information on the available versions of the specified statistic. + bool GetPlayerStatisticVersions(ClientModels::FGetPlayerStatisticVersionsRequest& request, const FGetPlayerStatisticVersionsDelegate& SuccessDelegate = FGetPlayerStatisticVersionsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Get all tags with a given Namespace (optional) from a player profile. + * This API will return a list of canonical tags which includes both namespace and tag's name. If namespace is not provided, the result is a list of all canonical tags. TagName can be used for segmentation and Namespace is limited to 128 characters. + */ + bool GetPlayerTags(ClientModels::FGetPlayerTagsRequest& request, const FGetPlayerTagsDelegate& SuccessDelegate = FGetPlayerTagsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Gets all trades the player has either opened or accepted, optionally filtered by trade status. + bool GetPlayerTrades(ClientModels::FGetPlayerTradesRequest& request, const FGetPlayerTradesDelegate& SuccessDelegate = FGetPlayerTradesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. + bool GetPlayFabIDsFromFacebookIDs(ClientModels::FGetPlayFabIDsFromFacebookIDsRequest& request, const FGetPlayFabIDsFromFacebookIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromFacebookIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the unique PlayFab identifiers for the given set of Facebook Instant Game identifiers. + bool GetPlayFabIDsFromFacebookInstantGamesIds(ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest& request, const FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate& SuccessDelegate = FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of Game Center identifiers (referenced in the Game Center + * Programming Guide as the Player Identifier). + */ + bool GetPlayFabIDsFromGameCenterIDs(ClientModels::FGetPlayFabIDsFromGameCenterIDsRequest& request, const FGetPlayFabIDsFromGameCenterIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromGameCenterIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the + * service name plus the service-specific ID for the player, as specified by the title when the generic identifier was + * added to the player account. + */ + bool GetPlayFabIDsFromGenericIDs(ClientModels::FGetPlayFabIDsFromGenericIDsRequest& request, const FGetPlayFabIDsFromGenericIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromGenericIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of Google identifiers. The Google identifiers are the IDs for + * the user accounts, available as "id" in the Google+ People API calls. + */ + bool GetPlayFabIDsFromGoogleIDs(ClientModels::FGetPlayFabIDsFromGoogleIDsRequest& request, const FGetPlayFabIDsFromGoogleIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromGoogleIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of Kongregate identifiers. The Kongregate identifiers are the + * IDs for the user accounts, available as "user_id" from the Kongregate API methods(ex: + * http://developers.kongregate.com/docs/client/getUserId). + */ + bool GetPlayFabIDsFromKongregateIDs(ClientModels::FGetPlayFabIDsFromKongregateIDsRequest& request, const FGetPlayFabIDsFromKongregateIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromKongregateIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the unique PlayFab identifiers for the given set of Nintendo Switch identifiers. + bool GetPlayFabIDsFromNintendoSwitchDeviceIds(ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& request, const FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate& SuccessDelegate = FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile + * IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + bool GetPlayFabIDsFromSteamIDs(ClientModels::FGetPlayFabIDsFromSteamIDsRequest& request, const FGetPlayFabIDsFromSteamIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromSteamIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of Twitch identifiers. The Twitch identifiers are the IDs for + * the user accounts, available as "_id" from the Twitch API methods (ex: + * https://github.com/justintv/Twitch-API/blob/master/v3_resources/users.md#get-usersuser). + */ + bool GetPlayFabIDsFromTwitchIDs(ClientModels::FGetPlayFabIDsFromTwitchIDsRequest& request, const FGetPlayFabIDsFromTwitchIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromTwitchIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom publisher settings + * This API is designed to return publisher-specific values which can be read, but not written to, by the client. This data is shared across all titles assigned to a particular publisher, and can be used for cross-game coordination. Only titles assigned to a publisher can use this API. For more information email devrel@playfab.com. Note that there may up to a minute delay in between updating title data and this API call returning the newest value. + */ + bool GetPublisherData(ClientModels::FGetPublisherDataRequest& request, const FGetPublisherDataDelegate& SuccessDelegate = FGetPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves a purchase along with its current PlayFab status. Returns inventory items from the purchase that are still + * active. + */ + bool GetPurchase(ClientModels::FGetPurchaseRequest& request, const FGetPurchaseDelegate& SuccessDelegate = FGetPurchaseDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves data stored in a shared group object, as well as the list of members in the group. Non-members of the group + * may use this to retrieve group data, including membership, but they will not receive data for keys marked as private. + * Shared Groups are designed for sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool GetSharedGroupData(ClientModels::FGetSharedGroupDataRequest& request, const FGetSharedGroupDataDelegate& SuccessDelegate = FGetSharedGroupDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the set of items defined for the specified store, including all prices defined + * A store contains an array of references to items defined in one or more catalog versions of the game, along with the prices for the item, in both real world and virtual currencies. These prices act as an override to any prices defined in the catalog. In this way, the base definitions of the items may be defined in the catalog, with all associated properties, while the pricing can be set for each store, as needed. This allows for subsets of goods to be defined for different purposes (in order to simplify showing some, but not all catalog items to users, based upon different characteristics), along with unique prices. Note that all prices defined in the catalog and store definitions for the item are considered valid, and that a compromised client can be made to send a request for an item based upon any of these definitions. If no price is specified in the store for an item, the price set in the catalog should be displayed to the user. + */ + bool GetStoreItems(ClientModels::FGetStoreItemsRequest& request, const FGetStoreItemsDelegate& SuccessDelegate = FGetStoreItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the current server time + * This query retrieves the current time from one of the servers in PlayFab. Please note that due to clock drift between servers, there is a potential variance of up to 5 seconds. + */ + + bool GetTime(const FGetTimeDelegate& SuccessDelegate = FGetTimeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom title settings + * This API is designed to return title specific values which can be read, but not written to, by the client. For example, a developer could choose to store values which modify the user experience, such as enemy spawn rates, weapon strengths, movement speeds, etc. This allows a developer to update the title without the need to create, test, and ship a new build. Note that there may up to a minute delay in between updating title data and this API call returning the newest value. + */ + bool GetTitleData(ClientModels::FGetTitleDataRequest& request, const FGetTitleDataDelegate& SuccessDelegate = FGetTitleDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the title news feed, as configured in the developer portal + bool GetTitleNews(ClientModels::FGetTitleNewsRequest& request, const FGetTitleNewsDelegate& SuccessDelegate = FGetTitleNewsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Returns the title's base 64 encoded RSA CSP blob. + * An RSA CSP blob to be used to encrypt the payload of account creation requests when that API requires a signature header. For example if Client/LoginWithCustomId requires signature headers but the player does not have an account yet follow these steps: 1) Call Client/GetTitlePublicKey with one of the title's shared secrets. 2) Convert the Base64 encoded CSP blob to a byte array and create an RSA signing object. 3) Encrypt the UTF8 encoded JSON body of the registration request and place the Base64 encoded result into the EncryptedRequest and with the TitleId field, all other fields can be left empty when performing the API request. 4) Client receives authentication token as normal. Future requests to LoginWithCustomId will require the X-PlayFab-Signature header. + */ + bool GetTitlePublicKey(ClientModels::FGetTitlePublicKeyRequest& request, const FGetTitlePublicKeyDelegate& SuccessDelegate = FGetTitlePublicKeyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Gets the current status of an existing trade. + bool GetTradeStatus(ClientModels::FGetTradeStatusRequest& request, const FGetTradeStatusDelegate& SuccessDelegate = FGetTradeStatusDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. Every time the data is updated via any source, the version counter is incremented. If the Version parameter is provided, then this call will only return data if the current version on the system is greater than the value provided. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserData(ClientModels::FGetUserDataRequest& request, const FGetUserDataDelegate& SuccessDelegate = FGetUserDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the user's current inventory of virtual goods + + bool GetUserInventory(const FGetUserInventoryDelegate& SuccessDelegate = FGetUserInventoryDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherData(ClientModels::FGetUserDataRequest& request, const FGetUserPublisherDataDelegate& SuccessDelegate = FGetUserPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherReadOnlyData(ClientModels::FGetUserDataRequest& request, const FGetUserPublisherReadOnlyDataDelegate& SuccessDelegate = FGetUserPublisherReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which can only be read by the client + * Data is stored as JSON key-value pairs. Every time the data is updated via any source, the version counter is incremented. If the Version parameter is provided, then this call will only return data if the current version on the system is greater than the value provided. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserReadOnlyData(ClientModels::FGetUserDataRequest& request, const FGetUserReadOnlyDataDelegate& SuccessDelegate = FGetUserReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Requests a challenge from the server to be signed by Windows Hello Passport service to authenticate. + * Requires the SHA256 hash of the user's public key. + */ + bool GetWindowsHelloChallenge(ClientModels::FGetWindowsHelloChallengeRequest& request, const FGetWindowsHelloChallengeDelegate& SuccessDelegate = FGetWindowsHelloChallengeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated + * with the parent PlayFabId to guarantee uniqueness. + * Grants a character to the user of the type specified by the item ID. The user must already have an instance of this item in their inventory in order to allow character creation. This item can come from a purchase or grant, which must be done before calling to create the character. + */ + bool GrantCharacterToUser(ClientModels::FGrantCharacterToUserRequest& request, const FGrantCharacterToUserDelegate& SuccessDelegate = FGrantCharacterToUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the Android device identifier to the user's PlayFab account + bool LinkAndroidDeviceID(ClientModels::FLinkAndroidDeviceIDRequest& request, const FLinkAndroidDeviceIDDelegate& SuccessDelegate = FLinkAndroidDeviceIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the custom identifier, generated by the title, to the user's PlayFab account + bool LinkCustomID(ClientModels::FLinkCustomIDRequest& request, const FLinkCustomIDDelegate& SuccessDelegate = FLinkCustomIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Links the Facebook account associated with the provided Facebook access token to the user's PlayFab account + * Facebook sign-in is accomplished using the Facebook User Access Token. More information on the Token can be found in the Facebook developer documentation (https://developers.facebook.com/docs/facebook-login/access-tokens/). In Unity, for example, the Token is available as AccessToken in the Facebook SDK ScriptableObject FB. Note that titles should never re-use the same Facebook applications between PlayFab Title IDs, as Facebook provides unique user IDs per application and doing so can result in issues with the Facebook ID for the user in their PlayFab account information. If you must re-use an application in a new PlayFab Title ID, please be sure to first unlink all accounts from Facebook, or delete all users in the first Title ID. + */ + bool LinkFacebookAccount(ClientModels::FLinkFacebookAccountRequest& request, const FLinkFacebookAccountDelegate& SuccessDelegate = FLinkFacebookAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the Facebook Instant Games Id to the user's PlayFab account + bool LinkFacebookInstantGamesId(ClientModels::FLinkFacebookInstantGamesIdRequest& request, const FLinkFacebookInstantGamesIdDelegate& SuccessDelegate = FLinkFacebookInstantGamesIdDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the Game Center account associated with the provided Game Center ID to the user's PlayFab account + bool LinkGameCenterAccount(ClientModels::FLinkGameCenterAccountRequest& request, const FLinkGameCenterAccountDelegate& SuccessDelegate = FLinkGameCenterAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Links the currently signed-in user account to their Google account, using their Google account credentials + * Google sign-in is accomplished by obtaining a Google OAuth 2.0 credential using the Google sign-in for Android APIs on the device and passing it to this API. + */ + bool LinkGoogleAccount(ClientModels::FLinkGoogleAccountRequest& request, const FLinkGoogleAccountDelegate& SuccessDelegate = FLinkGoogleAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the vendor-specific iOS device identifier to the user's PlayFab account + bool LinkIOSDeviceID(ClientModels::FLinkIOSDeviceIDRequest& request, const FLinkIOSDeviceIDDelegate& SuccessDelegate = FLinkIOSDeviceIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the Kongregate identifier to the user's PlayFab account + bool LinkKongregate(ClientModels::FLinkKongregateAccountRequest& request, const FLinkKongregateDelegate& SuccessDelegate = FLinkKongregateDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the NintendoSwitchDeviceId to the user's PlayFab account + bool LinkNintendoSwitchDeviceId(ClientModels::FLinkNintendoSwitchDeviceIdRequest& request, const FLinkNintendoSwitchDeviceIdDelegate& SuccessDelegate = FLinkNintendoSwitchDeviceIdDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Links the Steam account associated with the provided Steam authentication ticket to the user's PlayFab account + * Steam authentication is accomplished with the Steam Session Ticket. More information on the Ticket can be found in the Steamworks SDK, here: https://partner.steamgames.com/documentation/auth (requires sign-in). NOTE: For Steam authentication to work, the title must be configured with the Steam Application ID and Publisher Key in the PlayFab Game Manager (under Properties). Information on creating a Publisher Key (referred to as the Secret Key in PlayFab) for your title can be found here: https://partner.steamgames.com/documentation/webapi#publisherkey. + */ + bool LinkSteamAccount(ClientModels::FLinkSteamAccountRequest& request, const FLinkSteamAccountDelegate& SuccessDelegate = FLinkSteamAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the Twitch account associated with the token to the user's PlayFab account. + bool LinkTwitch(ClientModels::FLinkTwitchAccountRequest& request, const FLinkTwitchDelegate& SuccessDelegate = FLinkTwitchDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Link Windows Hello authentication to the current PlayFab Account + * PublicKey must be generated using the Windows Hello Passport service. + */ + bool LinkWindowsHello(ClientModels::FLinkWindowsHelloAccountRequest& request, const FLinkWindowsHelloDelegate& SuccessDelegate = FLinkWindowsHelloDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the Xbox Live account associated with the provided access code to the user's PlayFab account + bool LinkXboxAccount(ClientModels::FLinkXboxAccountRequest& request, const FLinkXboxAccountDelegate& SuccessDelegate = FLinkXboxAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using the Android device identifier, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user + * On Android devices, the recommendation is to use the Settings.Secure.ANDROID_ID as the AndroidDeviceId, as described in this blog post (http://android-developers.blogspot.com/2011/03/identifying-app-installations.html). More information on this identifier can be found in the Android documentation (http://developer.android.com/reference/android/provider/Settings.Secure.html). If this is the first time a user has signed in with the Android device and CreateAccount is set to true, a new PlayFab account will be created and linked to the Android device ID. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Android device, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. Please note that while multiple devices of this type can be linked to a single user account, only the one most recently used to login (or most recently linked) will be reflected in the user's account information. We will be updating to show all linked devices in a future release. + */ + bool LoginWithAndroidDeviceID(ClientModels::FLoginWithAndroidDeviceIDRequest& request, const FLoginWithAndroidDeviceIDDelegate& SuccessDelegate = FLoginWithAndroidDeviceIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a custom unique identifier generated by the title, returning a session identifier that can + * subsequently be used for API calls which require an authenticated user + * It is highly recommended that developers ensure that it is extremely unlikely that a customer could generate an ID which is already in use by another customer. If this is the first time a user has signed in with the Custom ID and CreateAccount is set to true, a new PlayFab account will be created and linked to the Custom ID. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Custom ID, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. + */ + bool LoginWithCustomID(ClientModels::FLoginWithCustomIDRequest& request, const FLoginWithCustomIDDelegate& SuccessDelegate = FLoginWithCustomIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls + * which require an authenticated user. Unlike most other login API calls, LoginWithEmailAddress does not permit the + * creation of new accounts via the CreateAccountFlag. Email addresses may be used to create accounts via + * RegisterPlayFabUser. + * Email address and password lengths are provided for information purposes. The server will validate that data passed in conforms to the field definition and report errors appropriately. It is recommended that developers not perform this validation locally, so that future updates do not require client updates. + */ + bool LoginWithEmailAddress(ClientModels::FLoginWithEmailAddressRequest& request, const FLoginWithEmailAddressDelegate& SuccessDelegate = FLoginWithEmailAddressDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Facebook access token, returning a session identifier that can subsequently be used for API + * calls which require an authenticated user + * Facebook sign-in is accomplished using the Facebook User Access Token. More information on the Token can be found in the Facebook developer documentation (https://developers.facebook.com/docs/facebook-login/access-tokens/). In Unity, for example, the Token is available as AccessToken in the Facebook SDK ScriptableObject FB. If this is the first time a user has signed in with the Facebook account and CreateAccount is set to true, a new PlayFab account will be created and linked to the provided account's Facebook ID. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Facebook account, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. Note that titles should never re-use the same Facebook applications between PlayFab Title IDs, as Facebook provides unique user IDs per application and doing so can result in issues with the Facebook ID for the user in their PlayFab account information. If you must re-use an application in a new PlayFab Title ID, please be sure to first unlink all accounts from Facebook, or delete all users in the first Title ID. + */ + bool LoginWithFacebook(ClientModels::FLoginWithFacebookRequest& request, const FLoginWithFacebookDelegate& SuccessDelegate = FLoginWithFacebookDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Facebook Instant Games ID, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user. Requires Facebook Instant Games to be configured. + */ + bool LoginWithFacebookInstantGamesId(ClientModels::FLoginWithFacebookInstantGamesIdRequest& request, const FLoginWithFacebookInstantGamesIdDelegate& SuccessDelegate = FLoginWithFacebookInstantGamesIdDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using an iOS Game Center player identifier, returning a session identifier that can subsequently be + * used for API calls which require an authenticated user + * The Game Center player identifier (https://developer.apple.com/library/ios/documentation/Accounts/Reference/ACAccountClassRef/index.html#//apple_ref/occ/instp/ACAccount/identifier) is a generated string which is stored on the local device. As with device identifiers, care must be taken to never expose a player's Game Center identifier to end users, as that could result in a user's account being compromised. If this is the first time a user has signed in with Game Center and CreateAccount is set to true, a new PlayFab account will be created and linked to the Game Center identifier. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Game Center account, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. + */ + bool LoginWithGameCenter(ClientModels::FLoginWithGameCenterRequest& request, const FLoginWithGameCenterDelegate& SuccessDelegate = FLoginWithGameCenterDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using their Google account credentials + * Google sign-in is accomplished by obtaining a Google OAuth 2.0 credential using the Google sign-in for Android APIs on the device and passing it to this API. If this is the first time a user has signed in with the Google account and CreateAccount is set to true, a new PlayFab account will be created and linked to the Google account. Otherwise, if no PlayFab account is linked to the Google account, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. The current (recommended) method for obtaining a Google account credential in an Android application is to call GoogleSignInAccount.getServerAuthCode() and send the auth code as the ServerAuthCode parameter of this API. Before doing this, you must create an OAuth 2.0 web application client ID in the Google API Console and configure its client ID and secret in the PlayFab Game Manager Google Add-on for your title. This method does not require prompting of the user for additional Google account permissions, resulting in a user experience with the least possible friction. For more information about obtaining the server auth code, see https://developers.google.com/identity/sign-in/android/offline-access. The previous (deprecated) method was to obtain an OAuth access token by calling GetAccessToken() on the client and passing it as the AccessToken parameter to this API. for the with the Google OAuth 2.0 Access Token. More information on this change can be found in the Google developer documentation (https://android-developers.googleblog.com/2016/01/play-games-permissions-are-changing-in.html). + */ + bool LoginWithGoogleAccount(ClientModels::FLoginWithGoogleAccountRequest& request, const FLoginWithGoogleAccountDelegate& SuccessDelegate = FLoginWithGoogleAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using the vendor-specific iOS device identifier, returning a session identifier that can subsequently + * be used for API calls which require an authenticated user + * On iOS devices, the identifierForVendor (https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice/identifierForVendor) must be used as the DeviceId, as the UIDevice uniqueIdentifier has been deprecated as of iOS 5, and use of the advertisingIdentifier for this purpose will result in failure of Apple's certification process. If this is the first time a user has signed in with the iOS device and CreateAccount is set to true, a new PlayFab account will be created and linked to the vendor-specific iOS device ID. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the iOS device, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. Please note that while multiple devices of this type can be linked to a single user account, only the one most recently used to login (or most recently linked) will be reflected in the user's account information. We will be updating to show all linked devices in a future release. + */ + bool LoginWithIOSDeviceID(ClientModels::FLoginWithIOSDeviceIDRequest& request, const FLoginWithIOSDeviceIDDelegate& SuccessDelegate = FLoginWithIOSDeviceIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Kongregate player account. + * More details regarding Kongregate and their game authentication system can be found at http://developers.kongregate.com/docs/virtual-goods/authentication. Developers must provide the Kongregate user ID and auth token that are generated using the Kongregate client library. PlayFab will combine these identifiers with the title's unique Kongregate app ID to log the player into the Kongregate system. If CreateAccount is set to true and there is not already a user matched to this Kongregate ID, then PlayFab will create a new account for this user and link the ID. In this case, no email or username will be associated with the PlayFab account. If there is already a different PlayFab user linked with this account, then an error will be returned. + */ + bool LoginWithKongregate(ClientModels::FLoginWithKongregateRequest& request, const FLoginWithKongregateDelegate& SuccessDelegate = FLoginWithKongregateDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Nintendo Switch Device ID, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user + */ + bool LoginWithNintendoSwitchDeviceId(ClientModels::FLoginWithNintendoSwitchDeviceIdRequest& request, const FLoginWithNintendoSwitchDeviceIdDelegate& SuccessDelegate = FLoginWithNintendoSwitchDeviceIdDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls + * which require an authenticated user. Unlike most other login API calls, LoginWithPlayFab does not permit the creation of + * new accounts via the CreateAccountFlag. Username/Password credentials may be used to create accounts via + * RegisterPlayFabUser, or added to existing accounts using AddUsernamePassword. + * Username and password lengths are provided for information purposes. The server will validate that data passed in conforms to the field definition and report errors appropriately. It is recommended that developers not perform this validation locally, so that future updates to the username or password do not require client updates. + */ + bool LoginWithPlayFab(ClientModels::FLoginWithPlayFabRequest& request, const FLoginWithPlayFabDelegate& SuccessDelegate = FLoginWithPlayFabDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Steam authentication ticket, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user + * Steam sign-in is accomplished with the Steam Session Ticket. More information on the Ticket can be found in the Steamworks SDK, here: https://partner.steamgames.com/documentation/auth (requires sign-in). NOTE: For Steam authentication to work, the title must be configured with the Steam Application ID and Web API Key in the PlayFab Game Manager (under Steam in the Add-ons Marketplace). You can obtain a Web API Key from the Permissions page of any Group associated with your App ID in the Steamworks site. If this is the first time a user has signed in with the Steam account and CreateAccount is set to true, a new PlayFab account will be created and linked to the provided account's Steam ID. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Steam account, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. + */ + bool LoginWithSteam(ClientModels::FLoginWithSteamRequest& request, const FLoginWithSteamDelegate& SuccessDelegate = FLoginWithSteamDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Twitch access token. + * More details regarding Twitch and their authentication system can be found at https://github.com/justintv/Twitch-API/blob/master/authentication.md. Developers must provide the Twitch access token that is generated using one of the Twitch authentication flows. PlayFab will use the title's unique Twitch Client ID to authenticate the token and log in to the PlayFab system. If CreateAccount is set to true and there is not already a user matched to the Twitch username that generated the token, then PlayFab will create a new account for this user and link the ID. In this case, no email or username will be associated with the PlayFab account. If there is already a different PlayFab user linked with this account, then an error will be returned. + */ + bool LoginWithTwitch(ClientModels::FLoginWithTwitchRequest& request, const FLoginWithTwitchDelegate& SuccessDelegate = FLoginWithTwitchDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Completes the Windows Hello login flow by returning the signed value of the challange from GetWindowsHelloChallenge. + * Windows Hello has a 2 step client to server authentication scheme. Step one is to request from the server a challenge + * string. Step two is to request the user sign the string via Windows Hello and then send the signed value back to the + * server. + * Requires both the SHA256 hash of the user's public key as well as the signed response from GetWindowsHelloChallenge + */ + bool LoginWithWindowsHello(ClientModels::FLoginWithWindowsHelloRequest& request, const FLoginWithWindowsHelloDelegate& SuccessDelegate = FLoginWithWindowsHelloDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls + * which require an authenticated user + * If this is the first time a user has signed in with the Xbox Live account and CreateAccount is set to true, a new PlayFab account will be created and linked to the Xbox Live account. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Xbox Live account, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. + */ + bool LoginWithXbox(ClientModels::FLoginWithXboxRequest& request, const FLoginWithXboxDelegate& SuccessDelegate = FLoginWithXboxDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Attempts to locate a game session matching the given parameters. If the goal is to match the player into a specific + * active session, only the LobbyId is required. Otherwise, the BuildVersion, GameMode, and Region are all required + * parameters. Note that parameters specified in the search are required (they are not weighting factors). If a slot is + * found in a server instance matching the parameters, the slot will be assigned to that player, removing it from the + * availabe set. In that case, the information on the game session will be returned, otherwise the Status returned will be + * GameNotFound. + */ + bool Matchmake(ClientModels::FMatchmakeRequest& request, const FMatchmakeDelegate& SuccessDelegate = FMatchmakeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Opens a new outstanding trade. Note that a given item instance may only be in one open trade at a time. + bool OpenTrade(ClientModels::FOpenTradeRequest& request, const FOpenTradeDelegate& SuccessDelegate = FOpenTradeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Selects a payment option for purchase order created via StartPurchase + * This is the second step in the purchasing process, initiating the purchase transaction with the payment provider (if applicable). For payment provider scenarios, the title should next present the user with the payment provider'sinterface for payment. Once the player has completed the payment with the provider, the title should call ConfirmPurchase tofinalize the process and add the appropriate items to the player inventory. + */ + bool PayForPurchase(ClientModels::FPayForPurchaseRequest& request, const FPayForPurchaseDelegate& SuccessDelegate = FPayForPurchaseDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Buys a single item with virtual currency. You must specify both the virtual currency to use to purchase, as well as what + * the client believes the price to be. This lets the server fail the purchase if the price has changed. + * Please note that the processing time for inventory grants and purchases increases fractionally the more items are in the inventory, and the more items are in the grant/purchase operation (with each item in a bundle being a distinct add). + */ + bool PurchaseItem(ClientModels::FPurchaseItemRequest& request, const FPurchaseItemDelegate& SuccessDelegate = FPurchaseItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the + * Economy->Catalogs tab in the PlayFab Game Manager. + * Coupon codes can be created for any item, or set of items, in the catalog for the title. This operation causes the coupon to be consumed, and the specific items to be awarded to the user. Attempting to re-use an already consumed code, or a code which has not yet been created in the service, will result in an error. + */ + bool RedeemCoupon(ClientModels::FRedeemCouponRequest& request, const FRedeemCouponDelegate& SuccessDelegate = FRedeemCouponDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Registers the iOS device to receive push notifications + * The steps to configure and send Push Notifications is described in the PlayFab tutorials, here: https://api.playfab.com/docs/pushCrashCourse/ + */ + bool RegisterForIOSPushNotification(ClientModels::FRegisterForIOSPushNotificationRequest& request, const FRegisterForIOSPushNotificationDelegate& SuccessDelegate = FRegisterForIOSPushNotificationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Registers a new Playfab user account, returning a session identifier that can subsequently be used for API calls which + * require an authenticated user. You must supply either a username or an email address. + */ + bool RegisterPlayFabUser(ClientModels::FRegisterPlayFabUserRequest& request, const FRegisterPlayFabUserDelegate& SuccessDelegate = FRegisterPlayFabUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Registers a new PlayFab user account using Windows Hello authentication, returning a session ticket that can + * subsequently be used for API calls which require an authenticated user + * PublicKey must be generated using the Windows Hello Passport service. + */ + bool RegisterWithWindowsHello(ClientModels::FRegisterWithWindowsHelloRequest& request, const FRegisterWithWindowsHelloDelegate& SuccessDelegate = FRegisterWithWindowsHelloDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes a contact email from the player's profile. + * This API removes an existing contact email from the player's profile. + */ + + bool RemoveContactEmail(const FRemoveContactEmailDelegate& SuccessDelegate = FRemoveContactEmailDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Removes a specified user from the friend list of the local user + bool RemoveFriend(ClientModels::FRemoveFriendRequest& request, const FRemoveFriendDelegate& SuccessDelegate = FRemoveFriendDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Removes the specified generic service identifier from the player's PlayFab account. + bool RemoveGenericID(ClientModels::FRemoveGenericIDRequest& request, const FRemoveGenericIDDelegate& SuccessDelegate = FRemoveGenericIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the + * group can remove members. If as a result of the call, zero users remain with access, the group and its associated data + * will be deleted. Shared Groups are designed for sharing data between a very small number of players, please see our + * guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool RemoveSharedGroupMembers(ClientModels::FRemoveSharedGroupMembersRequest& request, const FRemoveSharedGroupMembersDelegate& SuccessDelegate = FRemoveSharedGroupMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Write a PlayStream event to describe the provided player device information. This API method is not designed to be + * called directly by developers. Each PlayFab client SDK will eventually report this information automatically. + * Any arbitrary information collected by the device + */ + bool ReportDeviceInfo(ClientModels::FDeviceInfoRequest& request, const FReportDeviceInfoDelegate& SuccessDelegate = FReportDeviceInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title + * can take action concerning potentially toxic players. + */ + bool ReportPlayer(ClientModels::FReportPlayerClientRequest& request, const FReportPlayerDelegate& SuccessDelegate = FReportPlayerDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Restores all in-app purchases based on the given restore receipt + * The title should obtain a refresh receipt via restoreCompletedTransactions in the SKPaymentQueue of the Apple StoreKit and pass that in to this call. The resultant receipt contains new receipt instances for all non-consumable goods previously purchased by the user. This API call iterates through every purchase in the receipt and restores the items if they still exist in the catalog and can be validated. + */ + bool RestoreIOSPurchases(ClientModels::FRestoreIOSPurchasesRequest& request, const FRestoreIOSPurchasesDelegate& SuccessDelegate = FRestoreIOSPurchasesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to + * change the password.If an account recovery email template ID is provided, an email using the custom email template will + * be used. + * If the account in question is a "temporary" account (for example, one that was created via a call to LoginFromIOSDeviceID), thisfunction will have no effect. Only PlayFab accounts which have valid email addresses will be able to receive a password reset email using this API. + */ + bool SendAccountRecoveryEmail(ClientModels::FSendAccountRecoveryEmailRequest& request, const FSendAccountRecoveryEmailDelegate& SuccessDelegate = FSendAccountRecoveryEmailDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the tag list for a specified user in the friend list of the local user + * This operation is not additive. It will completely replace the tag list for the specified user. Please note that only users in the PlayFab friends list can be assigned tags. Attempting to set a tag on a friend only included in the friends list from a social site integration (such as Facebook or Steam) will return the AccountNotFound error. + */ + bool SetFriendTags(ClientModels::FSetFriendTagsRequest& request, const FSetFriendTagsDelegate& SuccessDelegate = FSetFriendTagsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's + * secret use the Admin or Server API method SetPlayerSecret. + * APIs that require signatures require that the player have a configured Player Secret Key that is used to sign all requests. Players that don't have a secret will be blocked from making API calls until it is configured. To create a signature header add a SHA256 hashed string containing UTF8 encoded JSON body as it will be sent to the server, the current time in UTC formatted to ISO 8601, and the players secret formatted as 'body.date.secret'. Place the resulting hash into the header X-PlayFab-Signature, along with a header X-PlayFab-Timestamp of the same UTC timestamp used in the signature. + */ + bool SetPlayerSecret(ClientModels::FSetPlayerSecretRequest& request, const FSetPlayerSecretDelegate& SuccessDelegate = FSetPlayerSecretDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Start a new game server with a given configuration, add the current player and return the connection information. + * This API must be enabled for use as an option in the game manager website. It is disabled by default. + */ + bool StartGame(ClientModels::FStartGameRequest& request, const FStartGameDelegate& SuccessDelegate = FStartGameDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates an order for a list of items from the title catalog + * This is the first step in the purchasing process. For security purposes, once the order (or "cart") has been created, additional inventory objects may no longer be added. In addition, inventory objects will be locked to the current prices, regardless of any subsequent changes at the catalog level which may occur during the next two steps. + */ + bool StartPurchase(ClientModels::FStartPurchaseRequest& request, const FStartPurchaseDelegate& SuccessDelegate = FStartPurchaseDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Decrements the user's balance of the specified virtual currency by the stated amount. It is possible to make a VC + * balance negative with this API. + * This API must be enabled for use as an option in the game manager website. It is disabled by default. + */ + bool SubtractUserVirtualCurrency(ClientModels::FSubtractUserVirtualCurrencyRequest& request, const FSubtractUserVirtualCurrencyDelegate& SuccessDelegate = FSubtractUserVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Android device identifier from the user's PlayFab account + bool UnlinkAndroidDeviceID(ClientModels::FUnlinkAndroidDeviceIDRequest& request, const FUnlinkAndroidDeviceIDDelegate& SuccessDelegate = FUnlinkAndroidDeviceIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related custom identifier from the user's PlayFab account + bool UnlinkCustomID(ClientModels::FUnlinkCustomIDRequest& request, const FUnlinkCustomIDDelegate& SuccessDelegate = FUnlinkCustomIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Facebook account from the user's PlayFab account + + bool UnlinkFacebookAccount(const FUnlinkFacebookAccountDelegate& SuccessDelegate = FUnlinkFacebookAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Facebook Instant Game Ids from the user's PlayFab account + bool UnlinkFacebookInstantGamesId(ClientModels::FUnlinkFacebookInstantGamesIdRequest& request, const FUnlinkFacebookInstantGamesIdDelegate& SuccessDelegate = FUnlinkFacebookInstantGamesIdDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Game Center account from the user's PlayFab account + + bool UnlinkGameCenterAccount(const FUnlinkGameCenterAccountDelegate& SuccessDelegate = FUnlinkGameCenterAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Unlinks the related Google account from the user's PlayFab account + * (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods). + */ + + bool UnlinkGoogleAccount(const FUnlinkGoogleAccountDelegate& SuccessDelegate = FUnlinkGoogleAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related iOS device identifier from the user's PlayFab account + bool UnlinkIOSDeviceID(ClientModels::FUnlinkIOSDeviceIDRequest& request, const FUnlinkIOSDeviceIDDelegate& SuccessDelegate = FUnlinkIOSDeviceIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Kongregate identifier from the user's PlayFab account + + bool UnlinkKongregate(const FUnlinkKongregateDelegate& SuccessDelegate = FUnlinkKongregateDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related NintendoSwitchDeviceId from the user's PlayFab account + bool UnlinkNintendoSwitchDeviceId(ClientModels::FUnlinkNintendoSwitchDeviceIdRequest& request, const FUnlinkNintendoSwitchDeviceIdDelegate& SuccessDelegate = FUnlinkNintendoSwitchDeviceIdDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Steam account from the user's PlayFab account + + bool UnlinkSteamAccount(const FUnlinkSteamAccountDelegate& SuccessDelegate = FUnlinkSteamAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Twitch account from the user's PlayFab account. + + bool UnlinkTwitch(const FUnlinkTwitchDelegate& SuccessDelegate = FUnlinkTwitchDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Unlink Windows Hello authentication from the current PlayFab Account + * Must include the Public Key Hint + */ + bool UnlinkWindowsHello(ClientModels::FUnlinkWindowsHelloAccountRequest& request, const FUnlinkWindowsHelloDelegate& SuccessDelegate = FUnlinkWindowsHelloDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Xbox Live account from the user's PlayFab account + bool UnlinkXboxAccount(ClientModels::FUnlinkXboxAccountRequest& request, const FUnlinkXboxAccountDelegate& SuccessDelegate = FUnlinkXboxAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Opens the specified container, with the specified key (when required), and returns the contents of the opened container. + * If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, + * consistent with the operation of ConsumeItem. + * Specify the container and optionally the catalogVersion for the container to open + */ + bool UnlockContainerInstance(ClientModels::FUnlockContainerInstanceRequest& request, const FUnlockContainerInstanceDelegate& SuccessDelegate = FUnlockContainerInstanceDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Searches target inventory for an ItemInstance matching the given CatalogItemId, if necessary unlocks it using an + * appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are + * consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. + * Specify the type of container to open and optionally the catalogVersion for the container to open + */ + bool UnlockContainerItem(ClientModels::FUnlockContainerItemRequest& request, const FUnlockContainerItemDelegate& SuccessDelegate = FUnlockContainerItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Update the avatar URL of the player + bool UpdateAvatarUrl(ClientModels::FUpdateAvatarUrlRequest& request, const FUpdateAvatarUrlDelegate& SuccessDelegate = FUpdateAvatarUrlDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates and updates the title-specific custom data for the user's character which is readable and writable by the client + * This function performs an additive update of the arbitrary strings containing the custom data for the character. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. New keys will be added, with the given values. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateCharacterData(ClientModels::FUpdateCharacterDataRequest& request, const FUpdateCharacterDataDelegate& SuccessDelegate = FUpdateCharacterDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the values of the specified title-specific statistics for the specific character. By default, clients are not + * permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * Enable this option with the 'Allow Client to Post Player Statistics' option in PlayFab GameManager for your title. However, this is not best practice, as this data will no longer be safely controlled by the server. This operation is additive. Character Statistics not currently defined will be added, while those already defined will be updated with the given values. All other user statistics will remain unchanged. Character statistics are used by the character-leaderboard apis, and accessible for custom game-logic. + */ + bool UpdateCharacterStatistics(ClientModels::FUpdateCharacterStatisticsRequest& request, const FUpdateCharacterStatisticsDelegate& SuccessDelegate = FUpdateCharacterStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to + * update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * Enable this option with the 'Allow Client to Post Player Statistics' option in PlayFab GameManager for your title. However, this is not best practice, as this data will no longer be safely controlled by the server. This operation is additive. Statistics not currently defined will be added, while those already defined will be updated with the given values. All other user statistics will remain unchanged. Note that if the statistic is intended to have a reset period, the UpdatePlayerStatisticDefinition API call can be used to define that reset period. Once a statistic has been versioned (reset), the now-previous version can still be written to for up a short, pre-defined period (currently 10 seconds), using the Version parameter in this call. + */ + bool UpdatePlayerStatistics(ClientModels::FUpdatePlayerStatisticsRequest& request, const FUpdatePlayerStatisticsDelegate& SuccessDelegate = FUpdatePlayerStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated + * or added in this call will be readable by users not in the group. By default, data permissions are set to Private. + * Regardless of the permission setting, only members of the group can update the data. Shared Groups are designed for + * sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + * Note that in the case of multiple calls to write to the same shared group data keys, the last write received by the PlayFab service will determine the value available to subsequent read operations. For scenarios requiring coordination of data updates, it is recommended that titles make use of user data with read permission set to public, or a combination of user data and shared group data. + */ + bool UpdateSharedGroupData(ClientModels::FUpdateSharedGroupDataRequest& request, const FUpdateSharedGroupDataDelegate& SuccessDelegate = FUpdateSharedGroupDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates and updates the title-specific custom data for the user which is readable and writable by the client + * This function performs an additive update of the arbitrary strings containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. New keys will be added, with the given values. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserData(ClientModels::FUpdateUserDataRequest& request, const FUpdateUserDataDelegate& SuccessDelegate = FUpdateUserDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates and updates the publisher-specific custom data for the user which is readable and writable by the client + * This function performs an additive update of the arbitrary strings containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. New keys will be added, with the given values. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserPublisherData(ClientModels::FUpdateUserDataRequest& request, const FUpdateUserPublisherDataDelegate& SuccessDelegate = FUpdateUserPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title specific display name for the user + * In addition to the PlayFab username, titles can make use of a DisplayName which is also a unique identifier, but specific to the title. This allows for unique names which more closely match the theme or genre of a title, for example. + */ + bool UpdateUserTitleDisplayName(ClientModels::FUpdateUserTitleDisplayNameRequest& request, const FUpdateUserTitleDisplayNameDelegate& SuccessDelegate = FUpdateUserTitleDisplayNameDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the + * purchased catalog item + */ + bool ValidateAmazonIAPReceipt(ClientModels::FValidateAmazonReceiptRequest& request, const FValidateAmazonIAPReceiptDelegate& SuccessDelegate = FValidateAmazonIAPReceiptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Validates a Google Play purchase and gives the corresponding item to the player. + * The packageName and productId are defined in the GooglePlay store. The productId must match the ItemId of the inventory item in the PlayFab catalog for the title. This enables the PlayFab service to securely validate that the purchase is for the correct item, in order to prevent uses from passing valid receipts as being for more expensive items (passing a receipt for a 99-cent purchase as being for a $19.99 purchase, for example). Each receipt may be validated only once to avoid granting the same item over and over from a single purchase. + */ + bool ValidateGooglePlayPurchase(ClientModels::FValidateGooglePlayPurchaseRequest& request, const FValidateGooglePlayPurchaseDelegate& SuccessDelegate = FValidateGooglePlayPurchaseDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased + * catalog item + * The CurrencyCode and PurchasePrice must match the price which was set up for the item in the Apple store. In addition, The ItemId of the inventory in the PlayFab Catalog must match the Product ID as it was set up in the Apple store. This enables the PlayFab service to securely validate that the purchase is for the correct item, in order to prevent uses from passing valid receipts as being for more expensive items (passing a receipt for a 99-cent purchase as being for a $19.99 purchase, for example). + */ + bool ValidateIOSReceipt(ClientModels::FValidateIOSReceiptRequest& request, const FValidateIOSReceiptDelegate& SuccessDelegate = FValidateIOSReceiptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Validates with Windows that the receipt for an Windows App Store in-app purchase is valid and that it matches the + * purchased catalog item + */ + bool ValidateWindowsStoreReceipt(ClientModels::FValidateWindowsReceiptRequest& request, const FValidateWindowsStoreReceiptDelegate& SuccessDelegate = FValidateWindowsStoreReceiptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Writes a character-based event into PlayStream. + * This API is designed to write a multitude of different client-defined events into PlayStream. It supports a flexible JSON schema, which allowsfor arbitrary key-value pairs to describe any character-based event. The created event will be locked to the authenticated title and player. + */ + bool WriteCharacterEvent(ClientModels::FWriteClientCharacterEventRequest& request, const FWriteCharacterEventDelegate& SuccessDelegate = FWriteCharacterEventDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Writes a player-based event into PlayStream. + * This API is designed to write a multitude of different event types into PlayStream. It supports a flexible JSON schema, which allowsfor arbitrary key-value pairs to describe any player-based event. The created event will be locked to the authenticated title and player. + */ + bool WritePlayerEvent(ClientModels::FWriteClientPlayerEventRequest& request, const FWritePlayerEventDelegate& SuccessDelegate = FWritePlayerEventDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Writes a title-based event into PlayStream. + * This API is designed to write a multitude of different client-defined events into PlayStream. It supports a flexible JSON schema, which allowsfor arbitrary key-value pairs to describe any title-based event. The created event will be locked to the authenticated title. + */ + bool WriteTitleEvent(ClientModels::FWriteTitleEventRequest& request, const FWriteTitleEventDelegate& SuccessDelegate = FWriteTitleEventDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnAcceptTradeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAcceptTradeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddGenericIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddGenericIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddOrUpdateContactEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddOrUpdateContactEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddUsernamePasswordResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUsernamePasswordDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAndroidDevicePushNotificationRegistrationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAndroidDevicePushNotificationRegistrationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAttributeInstallResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAttributeInstallDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCancelTradeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCancelTradeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnConfirmPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConfirmPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnConsumeItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConsumeItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnConsumeXboxEntitlementsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConsumeXboxEntitlementsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreateSharedGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateSharedGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnExecuteCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExecuteCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetAccountInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAccountInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetAllUsersCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllUsersCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetContentDownloadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentDownloadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCurrentGamesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCurrentGamesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetFriendLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetFriendLeaderboardAroundPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendLeaderboardAroundPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetFriendsListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendsListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetGameServerRegionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetGameServerRegionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardAroundCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardAroundPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardForUserCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardForUserCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPaymentTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPaymentTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPhotonAuthenticationTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPhotonAuthenticationTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerCombinedInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerCombinedInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerStatisticVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerTradesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTradesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromFacebookIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromFacebookInstantGamesIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromGameCenterIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromGameCenterIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromGenericIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromGenericIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromGoogleIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromGoogleIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromKongregateIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromKongregateIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromSteamIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromSteamIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromTwitchIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromTwitchIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTimeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTimeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleNewsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleNewsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitlePublicKeyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitlePublicKeyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTradeStatusResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTradeStatusDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetWindowsHelloChallengeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetWindowsHelloChallengeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGrantCharacterToUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantCharacterToUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkAndroidDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkAndroidDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkCustomIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkCustomIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkFacebookAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkFacebookAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkFacebookInstantGamesIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkFacebookInstantGamesIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkGameCenterAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkGameCenterAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkGoogleAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkGoogleAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkIOSDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkIOSDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkKongregateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkKongregateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkNintendoSwitchDeviceIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkNintendoSwitchDeviceIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkSteamAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkSteamAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkTwitchResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkTwitchDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkXboxAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkXboxAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithAndroidDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithAndroidDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithCustomIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithCustomIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithEmailAddressResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithEmailAddressDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithFacebookResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithFacebookDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithFacebookInstantGamesIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithFacebookInstantGamesIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithGameCenterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithGameCenterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithGoogleAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithGoogleAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithIOSDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithIOSDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithKongregateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithKongregateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithNintendoSwitchDeviceIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithNintendoSwitchDeviceIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithPlayFabResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithPlayFabDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithSteamResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithSteamDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithTwitchResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithTwitchDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithXboxResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithXboxDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnMatchmakeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMatchmakeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnOpenTradeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FOpenTradeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnPayForPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPayForPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnPurchaseItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPurchaseItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRedeemCouponResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRedeemCouponDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRegisterForIOSPushNotificationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterForIOSPushNotificationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRegisterPlayFabUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterPlayFabUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRegisterWithWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterWithWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveContactEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveContactEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveGenericIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveGenericIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnReportDeviceInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FReportDeviceInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnReportPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FReportPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRestoreIOSPurchasesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRestoreIOSPurchasesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSendAccountRecoveryEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendAccountRecoveryEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetFriendTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetFriendTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetPlayerSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPlayerSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnStartGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FStartGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnStartPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FStartPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSubtractUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkAndroidDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkAndroidDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkCustomIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkCustomIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkFacebookAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkFacebookAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkFacebookInstantGamesIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkFacebookInstantGamesIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkGameCenterAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkGameCenterAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkGoogleAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkGoogleAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkIOSDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkIOSDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkKongregateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkKongregateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkNintendoSwitchDeviceIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkNintendoSwitchDeviceIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkSteamAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkSteamAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkTwitchResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkTwitchDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkXboxAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkXboxAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlockContainerInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlockContainerItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateAvatarUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateAvatarUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdatePlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserTitleDisplayNameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserTitleDisplayNameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnValidateAmazonIAPReceiptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateAmazonIAPReceiptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnValidateGooglePlayPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateGooglePlayPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnValidateIOSReceiptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateIOSReceiptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnValidateWindowsStoreReceiptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateWindowsStoreReceiptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnWriteCharacterEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteCharacterEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnWritePlayerEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWritePlayerEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnWriteTitleEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteTitleEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabClientDataModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabClientDataModels.h new file mode 100644 index 000000000..d269752e2 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabClientDataModels.h @@ -0,0 +1,12548 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace ClientModels +{ + + struct PLAYFABCPP_API FAcceptTradeRequest : public FPlayFabBaseModel + { + /** + * [optional] Items from the accepting player's inventory in exchange for the offered items in the trade. In the case of a gift, this + * will be null. + */ + TArray AcceptedInventoryInstanceIds; + // Player who opened the trade. + FString OfferingPlayerId; + + // Trade identifier. + FString TradeId; + + FAcceptTradeRequest() : + FPlayFabBaseModel(), + AcceptedInventoryInstanceIds(), + OfferingPlayerId(), + TradeId() + {} + + FAcceptTradeRequest(const FAcceptTradeRequest& src) : + FPlayFabBaseModel(), + AcceptedInventoryInstanceIds(src.AcceptedInventoryInstanceIds), + OfferingPlayerId(src.OfferingPlayerId), + TradeId(src.TradeId) + {} + + FAcceptTradeRequest(const TSharedPtr& obj) : FAcceptTradeRequest() + { + readFromValue(obj); + } + + ~FAcceptTradeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum TradeStatus + { + TradeStatusInvalid, + TradeStatusOpening, + TradeStatusOpen, + TradeStatusAccepting, + TradeStatusAccepted, + TradeStatusFilled, + TradeStatusCancelled + }; + + PLAYFABCPP_API void writeTradeStatusEnumJSON(TradeStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API TradeStatus readTradeStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API TradeStatus readTradeStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FTradeInfo : public FPlayFabBaseModel + { + // [optional] Item instances from the accepting player that are used to fulfill the trade. If null, no one has accepted the trade. + TArray AcceptedInventoryInstanceIds; + // [optional] The PlayFab ID of the player who accepted the trade. If null, no one has accepted the trade. + FString AcceptedPlayerId; + + // [optional] An optional list of players allowed to complete this trade. If null, anybody can complete the trade. + TArray AllowedPlayerIds; + // [optional] If set, The UTC time when this trade was canceled. + Boxed CancelledAt; + + // [optional] If set, The UTC time when this trade was fulfilled. + Boxed FilledAt; + + // [optional] If set, The UTC time when this trade was made invalid. + Boxed InvalidatedAt; + + // [optional] The catalogItem Ids of the item instances being offered. + TArray OfferedCatalogItemIds; + // [optional] The itemInstance Ids that are being offered. + TArray OfferedInventoryInstanceIds; + // [optional] The PlayFabId for the offering player. + FString OfferingPlayerId; + + // [optional] The UTC time when this trade was created. + Boxed OpenedAt; + + // [optional] The catalogItem Ids requested in exchange. + TArray RequestedCatalogItemIds; + // [optional] Describes the current state of this trade. + Boxed Status; + + // [optional] The identifier for this trade. + FString TradeId; + + FTradeInfo() : + FPlayFabBaseModel(), + AcceptedInventoryInstanceIds(), + AcceptedPlayerId(), + AllowedPlayerIds(), + CancelledAt(), + FilledAt(), + InvalidatedAt(), + OfferedCatalogItemIds(), + OfferedInventoryInstanceIds(), + OfferingPlayerId(), + OpenedAt(), + RequestedCatalogItemIds(), + Status(), + TradeId() + {} + + FTradeInfo(const FTradeInfo& src) : + FPlayFabBaseModel(), + AcceptedInventoryInstanceIds(src.AcceptedInventoryInstanceIds), + AcceptedPlayerId(src.AcceptedPlayerId), + AllowedPlayerIds(src.AllowedPlayerIds), + CancelledAt(src.CancelledAt), + FilledAt(src.FilledAt), + InvalidatedAt(src.InvalidatedAt), + OfferedCatalogItemIds(src.OfferedCatalogItemIds), + OfferedInventoryInstanceIds(src.OfferedInventoryInstanceIds), + OfferingPlayerId(src.OfferingPlayerId), + OpenedAt(src.OpenedAt), + RequestedCatalogItemIds(src.RequestedCatalogItemIds), + Status(src.Status), + TradeId(src.TradeId) + {} + + FTradeInfo(const TSharedPtr& obj) : FTradeInfo() + { + readFromValue(obj); + } + + ~FTradeInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAcceptTradeResponse : public FPlayFabBaseModel + { + // [optional] Details about trade which was just accepted. + TSharedPtr Trade; + + FAcceptTradeResponse() : + FPlayFabBaseModel(), + Trade(nullptr) + {} + + FAcceptTradeResponse(const FAcceptTradeResponse& src) : + FPlayFabBaseModel(), + Trade(src.Trade.IsValid() ? MakeShareable(new FTradeInfo(*src.Trade)) : nullptr) + {} + + FAcceptTradeResponse(const TSharedPtr& obj) : FAcceptTradeResponse() + { + readFromValue(obj); + } + + ~FAcceptTradeResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAdCampaignAttributionModel : public FPlayFabBaseModel + { + // UTC time stamp of attribution + FDateTime AttributedAt; + + // [optional] Attribution campaign identifier + FString CampaignId; + + // [optional] Attribution network name + FString Platform; + + FAdCampaignAttributionModel() : + FPlayFabBaseModel(), + AttributedAt(0), + CampaignId(), + Platform() + {} + + FAdCampaignAttributionModel(const FAdCampaignAttributionModel& src) : + FPlayFabBaseModel(), + AttributedAt(src.AttributedAt), + CampaignId(src.CampaignId), + Platform(src.Platform) + {} + + FAdCampaignAttributionModel(const TSharedPtr& obj) : FAdCampaignAttributionModel() + { + readFromValue(obj); + } + + ~FAdCampaignAttributionModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddFriendRequest : public FPlayFabBaseModel + { + // [optional] Email address of the user to attempt to add to the local user's friend list. + FString FriendEmail; + + // [optional] PlayFab identifier of the user to attempt to add to the local user's friend list. + FString FriendPlayFabId; + + // [optional] Title-specific display name of the user to attempt to add to the local user's friend list. + FString FriendTitleDisplayName; + + // [optional] PlayFab username of the user to attempt to add to the local user's friend list. + FString FriendUsername; + + FAddFriendRequest() : + FPlayFabBaseModel(), + FriendEmail(), + FriendPlayFabId(), + FriendTitleDisplayName(), + FriendUsername() + {} + + FAddFriendRequest(const FAddFriendRequest& src) : + FPlayFabBaseModel(), + FriendEmail(src.FriendEmail), + FriendPlayFabId(src.FriendPlayFabId), + FriendTitleDisplayName(src.FriendTitleDisplayName), + FriendUsername(src.FriendUsername) + {} + + FAddFriendRequest(const TSharedPtr& obj) : FAddFriendRequest() + { + readFromValue(obj); + } + + ~FAddFriendRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddFriendResult : public FPlayFabBaseModel + { + // True if the friend request was processed successfully. + bool Created; + + FAddFriendResult() : + FPlayFabBaseModel(), + Created(false) + {} + + FAddFriendResult(const FAddFriendResult& src) : + FPlayFabBaseModel(), + Created(src.Created) + {} + + FAddFriendResult(const TSharedPtr& obj) : FAddFriendResult() + { + readFromValue(obj); + } + + ~FAddFriendResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGenericServiceId : public FPlayFabBaseModel + { + // Name of the service for which the player has a unique identifier. + FString ServiceName; + + // Unique identifier of the player in that service. + FString UserId; + + FGenericServiceId() : + FPlayFabBaseModel(), + ServiceName(), + UserId() + {} + + FGenericServiceId(const FGenericServiceId& src) : + FPlayFabBaseModel(), + ServiceName(src.ServiceName), + UserId(src.UserId) + {} + + FGenericServiceId(const TSharedPtr& obj) : FGenericServiceId() + { + readFromValue(obj); + } + + ~FGenericServiceId(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddGenericIDRequest : public FPlayFabBaseModel + { + // Generic service identifier to add to the player account. + FGenericServiceId GenericId; + + FAddGenericIDRequest() : + FPlayFabBaseModel(), + GenericId() + {} + + FAddGenericIDRequest(const FAddGenericIDRequest& src) : + FPlayFabBaseModel(), + GenericId(src.GenericId) + {} + + FAddGenericIDRequest(const TSharedPtr& obj) : FAddGenericIDRequest() + { + readFromValue(obj); + } + + ~FAddGenericIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddGenericIDResult : public FPlayFabBaseModel + { + FAddGenericIDResult() : + FPlayFabBaseModel() + {} + + FAddGenericIDResult(const FAddGenericIDResult& src) : + FPlayFabBaseModel() + {} + + FAddGenericIDResult(const TSharedPtr& obj) : FAddGenericIDResult() + { + readFromValue(obj); + } + + ~FAddGenericIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddOrUpdateContactEmailRequest : public FPlayFabBaseModel + { + // The new contact email to associate with the player. + FString EmailAddress; + + FAddOrUpdateContactEmailRequest() : + FPlayFabBaseModel(), + EmailAddress() + {} + + FAddOrUpdateContactEmailRequest(const FAddOrUpdateContactEmailRequest& src) : + FPlayFabBaseModel(), + EmailAddress(src.EmailAddress) + {} + + FAddOrUpdateContactEmailRequest(const TSharedPtr& obj) : FAddOrUpdateContactEmailRequest() + { + readFromValue(obj); + } + + ~FAddOrUpdateContactEmailRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddOrUpdateContactEmailResult : public FPlayFabBaseModel + { + FAddOrUpdateContactEmailResult() : + FPlayFabBaseModel() + {} + + FAddOrUpdateContactEmailResult(const FAddOrUpdateContactEmailResult& src) : + FPlayFabBaseModel() + {} + + FAddOrUpdateContactEmailResult(const TSharedPtr& obj) : FAddOrUpdateContactEmailResult() + { + readFromValue(obj); + } + + ~FAddOrUpdateContactEmailResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddSharedGroupMembersRequest : public FPlayFabBaseModel + { + // An array of unique PlayFab assigned ID of the user on whom the operation will be performed. + TArray PlayFabIds; + // Unique identifier for the shared group. + FString SharedGroupId; + + FAddSharedGroupMembersRequest() : + FPlayFabBaseModel(), + PlayFabIds(), + SharedGroupId() + {} + + FAddSharedGroupMembersRequest(const FAddSharedGroupMembersRequest& src) : + FPlayFabBaseModel(), + PlayFabIds(src.PlayFabIds), + SharedGroupId(src.SharedGroupId) + {} + + FAddSharedGroupMembersRequest(const TSharedPtr& obj) : FAddSharedGroupMembersRequest() + { + readFromValue(obj); + } + + ~FAddSharedGroupMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddSharedGroupMembersResult : public FPlayFabBaseModel + { + FAddSharedGroupMembersResult() : + FPlayFabBaseModel() + {} + + FAddSharedGroupMembersResult(const FAddSharedGroupMembersResult& src) : + FPlayFabBaseModel() + {} + + FAddSharedGroupMembersResult(const TSharedPtr& obj) : FAddSharedGroupMembersResult() + { + readFromValue(obj); + } + + ~FAddSharedGroupMembersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddUsernamePasswordRequest : public FPlayFabBaseModel + { + // User email address attached to their account + FString Email; + + // Password for the PlayFab account (6-100 characters) + FString Password; + + // PlayFab username for the account (3-20 characters) + FString Username; + + FAddUsernamePasswordRequest() : + FPlayFabBaseModel(), + Email(), + Password(), + Username() + {} + + FAddUsernamePasswordRequest(const FAddUsernamePasswordRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + Password(src.Password), + Username(src.Username) + {} + + FAddUsernamePasswordRequest(const TSharedPtr& obj) : FAddUsernamePasswordRequest() + { + readFromValue(obj); + } + + ~FAddUsernamePasswordRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddUsernamePasswordResult : public FPlayFabBaseModel + { + // [optional] PlayFab unique user name. + FString Username; + + FAddUsernamePasswordResult() : + FPlayFabBaseModel(), + Username() + {} + + FAddUsernamePasswordResult(const FAddUsernamePasswordResult& src) : + FPlayFabBaseModel(), + Username(src.Username) + {} + + FAddUsernamePasswordResult(const TSharedPtr& obj) : FAddUsernamePasswordResult() + { + readFromValue(obj); + } + + ~FAddUsernamePasswordResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddUserVirtualCurrencyRequest : public FPlayFabBaseModel + { + // Amount to be added to the user balance of the specified virtual currency. + int32 Amount; + + // Name of the virtual currency which is to be incremented. + FString VirtualCurrency; + + FAddUserVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + VirtualCurrency() + {} + + FAddUserVirtualCurrencyRequest(const FAddUserVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + VirtualCurrency(src.VirtualCurrency) + {} + + FAddUserVirtualCurrencyRequest(const TSharedPtr& obj) : FAddUserVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FAddUserVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAndroidDevicePushNotificationRegistrationRequest : public FPlayFabBaseModel + { + // [optional] Message to display when confirming push notification. + FString ConfirmationMessage; + + /** + * Registration ID provided by the Google Cloud Messaging service when the title registered to receive push notifications + * (see the GCM documentation, here: http://developer.android.com/google/gcm/client.html). + */ + FString DeviceToken; + + // [optional] If true, send a test push message immediately after sucessful registration. Defaults to false. + Boxed SendPushNotificationConfirmation; + + FAndroidDevicePushNotificationRegistrationRequest() : + FPlayFabBaseModel(), + ConfirmationMessage(), + DeviceToken(), + SendPushNotificationConfirmation() + {} + + FAndroidDevicePushNotificationRegistrationRequest(const FAndroidDevicePushNotificationRegistrationRequest& src) : + FPlayFabBaseModel(), + ConfirmationMessage(src.ConfirmationMessage), + DeviceToken(src.DeviceToken), + SendPushNotificationConfirmation(src.SendPushNotificationConfirmation) + {} + + FAndroidDevicePushNotificationRegistrationRequest(const TSharedPtr& obj) : FAndroidDevicePushNotificationRegistrationRequest() + { + readFromValue(obj); + } + + ~FAndroidDevicePushNotificationRegistrationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAndroidDevicePushNotificationRegistrationResult : public FPlayFabBaseModel + { + FAndroidDevicePushNotificationRegistrationResult() : + FPlayFabBaseModel() + {} + + FAndroidDevicePushNotificationRegistrationResult(const FAndroidDevicePushNotificationRegistrationResult& src) : + FPlayFabBaseModel() + {} + + FAndroidDevicePushNotificationRegistrationResult(const TSharedPtr& obj) : FAndroidDevicePushNotificationRegistrationResult() + { + readFromValue(obj); + } + + ~FAndroidDevicePushNotificationRegistrationResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAttributeInstallRequest : public FPlayFabBaseModel + { + // [optional] The adid for this device. + FString Adid; + + // [optional] The IdentifierForAdvertisers for iOS Devices. + FString Idfa; + + FAttributeInstallRequest() : + FPlayFabBaseModel(), + Adid(), + Idfa() + {} + + FAttributeInstallRequest(const FAttributeInstallRequest& src) : + FPlayFabBaseModel(), + Adid(src.Adid), + Idfa(src.Idfa) + {} + + FAttributeInstallRequest(const TSharedPtr& obj) : FAttributeInstallRequest() + { + readFromValue(obj); + } + + ~FAttributeInstallRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAttributeInstallResult : public FPlayFabBaseModel + { + FAttributeInstallResult() : + FPlayFabBaseModel() + {} + + FAttributeInstallResult(const FAttributeInstallResult& src) : + FPlayFabBaseModel() + {} + + FAttributeInstallResult(const TSharedPtr& obj) : FAttributeInstallResult() + { + readFromValue(obj); + } + + ~FAttributeInstallResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCancelTradeRequest : public FPlayFabBaseModel + { + // Trade identifier. + FString TradeId; + + FCancelTradeRequest() : + FPlayFabBaseModel(), + TradeId() + {} + + FCancelTradeRequest(const FCancelTradeRequest& src) : + FPlayFabBaseModel(), + TradeId(src.TradeId) + {} + + FCancelTradeRequest(const TSharedPtr& obj) : FCancelTradeRequest() + { + readFromValue(obj); + } + + ~FCancelTradeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCancelTradeResponse : public FPlayFabBaseModel + { + // [optional] Details about trade which was just canceled. + TSharedPtr Trade; + + FCancelTradeResponse() : + FPlayFabBaseModel(), + Trade(nullptr) + {} + + FCancelTradeResponse(const FCancelTradeResponse& src) : + FPlayFabBaseModel(), + Trade(src.Trade.IsValid() ? MakeShareable(new FTradeInfo(*src.Trade)) : nullptr) + {} + + FCancelTradeResponse(const TSharedPtr& obj) : FCancelTradeResponse() + { + readFromValue(obj); + } + + ~FCancelTradeResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCartItem : public FPlayFabBaseModel + { + // [optional] Description of the catalog item. + FString Description; + + // [optional] Display name for the catalog item. + FString DisplayName; + + // [optional] Class name to which catalog item belongs. + FString ItemClass; + + // [optional] Unique identifier for the catalog item. + FString ItemId; + + // [optional] Unique instance identifier for this catalog item. + FString ItemInstanceId; + + // [optional] Cost of the catalog item for each applicable real world currency. + TMap RealCurrencyPrices; + // [optional] Amount of each applicable virtual currency which will be received as a result of purchasing this catalog item. + TMap VCAmount; + // [optional] Cost of the catalog item for each applicable virtual currency. + TMap VirtualCurrencyPrices; + FCartItem() : + FPlayFabBaseModel(), + Description(), + DisplayName(), + ItemClass(), + ItemId(), + ItemInstanceId(), + RealCurrencyPrices(), + VCAmount(), + VirtualCurrencyPrices() + {} + + FCartItem(const FCartItem& src) : + FPlayFabBaseModel(), + Description(src.Description), + DisplayName(src.DisplayName), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + RealCurrencyPrices(src.RealCurrencyPrices), + VCAmount(src.VCAmount), + VirtualCurrencyPrices(src.VirtualCurrencyPrices) + {} + + FCartItem(const TSharedPtr& obj) : FCartItem() + { + readFromValue(obj); + } + + ~FCartItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemBundleInfo : public FPlayFabBaseModel + { + // [optional] unique ItemId values for all items which will be added to the player inventory when the bundle is added + TArray BundledItems; + /** + * [optional] unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and + * add the relevant items to the player inventory when the bundle is added) + */ + TArray BundledResultTables; + // [optional] virtual currency types and balances which will be added to the player inventory when the bundle is added + TMap BundledVirtualCurrencies; + FCatalogItemBundleInfo() : + FPlayFabBaseModel(), + BundledItems(), + BundledResultTables(), + BundledVirtualCurrencies() + {} + + FCatalogItemBundleInfo(const FCatalogItemBundleInfo& src) : + FPlayFabBaseModel(), + BundledItems(src.BundledItems), + BundledResultTables(src.BundledResultTables), + BundledVirtualCurrencies(src.BundledVirtualCurrencies) + {} + + FCatalogItemBundleInfo(const TSharedPtr& obj) : FCatalogItemBundleInfo() + { + readFromValue(obj); + } + + ~FCatalogItemBundleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemConsumableInfo : public FPlayFabBaseModel + { + // [optional] number of times this object can be used, after which it will be removed from the player inventory + Boxed UsageCount; + + /** + * [optional] duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed + * (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on + * this item's details have completed) + */ + Boxed UsagePeriod; + + /** + * [optional] all inventory item instances in the player inventory sharing a non-null UsagePeriodGroup have their UsagePeriod values + * added together, and share the result - when that period has elapsed, all the items in the group will be removed + */ + FString UsagePeriodGroup; + + FCatalogItemConsumableInfo() : + FPlayFabBaseModel(), + UsageCount(), + UsagePeriod(), + UsagePeriodGroup() + {} + + FCatalogItemConsumableInfo(const FCatalogItemConsumableInfo& src) : + FPlayFabBaseModel(), + UsageCount(src.UsageCount), + UsagePeriod(src.UsagePeriod), + UsagePeriodGroup(src.UsagePeriodGroup) + {} + + FCatalogItemConsumableInfo(const TSharedPtr& obj) : FCatalogItemConsumableInfo() + { + readFromValue(obj); + } + + ~FCatalogItemConsumableInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemContainerInfo : public FPlayFabBaseModel + { + // [optional] unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked + TArray ItemContents; + /** + * [optional] ItemId for the catalog item used to unlock the container, if any (if not specified, a call to UnlockContainerItem will + * open the container, adding the contents to the player inventory and currency balances) + */ + FString KeyItemId; + + /** + * [optional] unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables + * will be resolved and add the relevant items to the player inventory) + */ + TArray ResultTableContents; + // [optional] virtual currency types and balances which will be added to the player inventory when the container is unlocked + TMap VirtualCurrencyContents; + FCatalogItemContainerInfo() : + FPlayFabBaseModel(), + ItemContents(), + KeyItemId(), + ResultTableContents(), + VirtualCurrencyContents() + {} + + FCatalogItemContainerInfo(const FCatalogItemContainerInfo& src) : + FPlayFabBaseModel(), + ItemContents(src.ItemContents), + KeyItemId(src.KeyItemId), + ResultTableContents(src.ResultTableContents), + VirtualCurrencyContents(src.VirtualCurrencyContents) + {} + + FCatalogItemContainerInfo(const TSharedPtr& obj) : FCatalogItemContainerInfo() + { + readFromValue(obj); + } + + ~FCatalogItemContainerInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItem : public FPlayFabBaseModel + { + /** + * [optional] defines the bundle properties for the item - bundles are items which contain other items, including random drop tables + * and virtual currencies + */ + TSharedPtr Bundle; + + // if true, then an item instance of this type can be used to grant a character to a user. + bool CanBecomeCharacter; + + // [optional] catalog version for this item + FString CatalogVersion; + + // [optional] defines the consumable properties (number of uses, timeout) for the item + TSharedPtr Consumable; + + /** + * [optional] defines the container properties for the item - what items it contains, including random drop tables and virtual + * currencies, and what item (if any) is required to open it via the UnlockContainerItem API + */ + TSharedPtr Container; + + // [optional] game specific custom data + FString CustomData; + + // [optional] text description of item, to show in-game + FString Description; + + // [optional] text name for the item, to show in-game + FString DisplayName; + + /** + * If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited + * edition item, this value determines the total number of instances to allocate for the title. Once this limit has been + * reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of + * false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less + * than zero, it will be ignored. + */ + int32 InitialLimitedEditionCount; + + // BETA: If true, then only a fixed number can ever be granted. + bool IsLimitedEdition; + + /** + * if true, then only one item instance of this type will exist and its remaininguses will be incremented instead. + * RemainingUses will cap out at Int32.Max (2,147,483,647). All subsequent increases will be discarded + */ + bool IsStackable; + + // if true, then an item instance of this type can be traded between players using the trading APIs + bool IsTradable; + + // [optional] class to which the item belongs + FString ItemClass; + + // unique identifier for this item + FString ItemId; + + /** + * [optional] URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP + * URL. + */ + FString ItemImageUrl; + + // [optional] override prices for this item for specific currencies + TMap RealCurrencyPrices; + // [optional] list of item tags + TArray Tags; + // [optional] price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + TMap VirtualCurrencyPrices; + FCatalogItem() : + FPlayFabBaseModel(), + Bundle(nullptr), + CanBecomeCharacter(false), + CatalogVersion(), + Consumable(nullptr), + Container(nullptr), + CustomData(), + Description(), + DisplayName(), + InitialLimitedEditionCount(0), + IsLimitedEdition(false), + IsStackable(false), + IsTradable(false), + ItemClass(), + ItemId(), + ItemImageUrl(), + RealCurrencyPrices(), + Tags(), + VirtualCurrencyPrices() + {} + + FCatalogItem(const FCatalogItem& src) : + FPlayFabBaseModel(), + Bundle(src.Bundle.IsValid() ? MakeShareable(new FCatalogItemBundleInfo(*src.Bundle)) : nullptr), + CanBecomeCharacter(src.CanBecomeCharacter), + CatalogVersion(src.CatalogVersion), + Consumable(src.Consumable.IsValid() ? MakeShareable(new FCatalogItemConsumableInfo(*src.Consumable)) : nullptr), + Container(src.Container.IsValid() ? MakeShareable(new FCatalogItemContainerInfo(*src.Container)) : nullptr), + CustomData(src.CustomData), + Description(src.Description), + DisplayName(src.DisplayName), + InitialLimitedEditionCount(src.InitialLimitedEditionCount), + IsLimitedEdition(src.IsLimitedEdition), + IsStackable(src.IsStackable), + IsTradable(src.IsTradable), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemImageUrl(src.ItemImageUrl), + RealCurrencyPrices(src.RealCurrencyPrices), + Tags(src.Tags), + VirtualCurrencyPrices(src.VirtualCurrencyPrices) + {} + + FCatalogItem(const TSharedPtr& obj) : FCatalogItem() + { + readFromValue(obj); + } + + ~FCatalogItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemInstance : public FPlayFabBaseModel + { + // [optional] Game specific comment associated with this instance when it was added to the user inventory. + FString Annotation; + + // [optional] Array of unique items that were awarded when this catalog item was purchased. + TArray BundleContents; + /** + * [optional] Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or + * container. + */ + FString BundleParent; + + // [optional] Catalog version for the inventory item, when this instance was created. + FString CatalogVersion; + + // [optional] A set of custom key-value pairs on the inventory item. + TMap CustomData; + // [optional] CatalogItem.DisplayName at the time this item was purchased. + FString DisplayName; + + // [optional] Timestamp for when this instance will expire. + Boxed Expiration; + + // [optional] Class name for the inventory item, as defined in the catalog. + FString ItemClass; + + // [optional] Unique identifier for the inventory item, as defined in the catalog. + FString ItemId; + + // [optional] Unique item identifier for this specific instance of the item. + FString ItemInstanceId; + + // [optional] Timestamp for when this instance was purchased. + Boxed PurchaseDate; + + // [optional] Total number of remaining uses, if this is a consumable item. + Boxed RemainingUses; + + // [optional] Currency type for the cost of the catalog item. + FString UnitCurrency; + + // Cost of the catalog item in the given currency. + uint32 UnitPrice; + + // [optional] The number of uses that were added or removed to this item in this call. + Boxed UsesIncrementedBy; + + FItemInstance() : + FPlayFabBaseModel(), + Annotation(), + BundleContents(), + BundleParent(), + CatalogVersion(), + CustomData(), + DisplayName(), + Expiration(), + ItemClass(), + ItemId(), + ItemInstanceId(), + PurchaseDate(), + RemainingUses(), + UnitCurrency(), + UnitPrice(0), + UsesIncrementedBy() + {} + + FItemInstance(const FItemInstance& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + BundleContents(src.BundleContents), + BundleParent(src.BundleParent), + CatalogVersion(src.CatalogVersion), + CustomData(src.CustomData), + DisplayName(src.DisplayName), + Expiration(src.Expiration), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + PurchaseDate(src.PurchaseDate), + RemainingUses(src.RemainingUses), + UnitCurrency(src.UnitCurrency), + UnitPrice(src.UnitPrice), + UsesIncrementedBy(src.UsesIncrementedBy) + {} + + FItemInstance(const TSharedPtr& obj) : FItemInstance() + { + readFromValue(obj); + } + + ~FItemInstance(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCharacterInventory : public FPlayFabBaseModel + { + // [optional] The id of this character. + FString CharacterId; + + // [optional] The inventory of this character. + TArray Inventory; + FCharacterInventory() : + FPlayFabBaseModel(), + CharacterId(), + Inventory() + {} + + FCharacterInventory(const FCharacterInventory& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Inventory(src.Inventory) + {} + + FCharacterInventory(const TSharedPtr& obj) : FCharacterInventory() + { + readFromValue(obj); + } + + ~FCharacterInventory(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCharacterLeaderboardEntry : public FPlayFabBaseModel + { + // [optional] PlayFab unique identifier of the character that belongs to the user for this leaderboard entry. + FString CharacterId; + + // [optional] Title-specific display name of the character for this leaderboard entry. + FString CharacterName; + + // [optional] Name of the character class for this entry. + FString CharacterType; + + // [optional] Title-specific display name of the user for this leaderboard entry. + FString DisplayName; + + // [optional] PlayFab unique identifier of the user for this leaderboard entry. + FString PlayFabId; + + // User's overall position in the leaderboard. + int32 Position; + + // Specific value of the user's statistic. + int32 StatValue; + + FCharacterLeaderboardEntry() : + FPlayFabBaseModel(), + CharacterId(), + CharacterName(), + CharacterType(), + DisplayName(), + PlayFabId(), + Position(0), + StatValue(0) + {} + + FCharacterLeaderboardEntry(const FCharacterLeaderboardEntry& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterName(src.CharacterName), + CharacterType(src.CharacterType), + DisplayName(src.DisplayName), + PlayFabId(src.PlayFabId), + Position(src.Position), + StatValue(src.StatValue) + {} + + FCharacterLeaderboardEntry(const TSharedPtr& obj) : FCharacterLeaderboardEntry() + { + readFromValue(obj); + } + + ~FCharacterLeaderboardEntry(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCharacterResult : public FPlayFabBaseModel + { + // [optional] The id for this character on this player. + FString CharacterId; + + // [optional] The name of this character. + FString CharacterName; + + // [optional] The type-string that was given to this character on creation. + FString CharacterType; + + FCharacterResult() : + FPlayFabBaseModel(), + CharacterId(), + CharacterName(), + CharacterType() + {} + + FCharacterResult(const FCharacterResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterName(src.CharacterName), + CharacterType(src.CharacterType) + {} + + FCharacterResult(const TSharedPtr& obj) : FCharacterResult() + { + readFromValue(obj); + } + + ~FCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum CloudScriptRevisionOption + { + CloudScriptRevisionOptionLive, + CloudScriptRevisionOptionLatest, + CloudScriptRevisionOptionSpecific + }; + + PLAYFABCPP_API void writeCloudScriptRevisionOptionEnumJSON(CloudScriptRevisionOption enumVal, JsonWriter& writer); + PLAYFABCPP_API CloudScriptRevisionOption readCloudScriptRevisionOptionFromValue(const TSharedPtr& value); + PLAYFABCPP_API CloudScriptRevisionOption readCloudScriptRevisionOptionFromValue(const FString& value); + + struct PLAYFABCPP_API FContainer_Dictionary_String_String : public FPlayFabBaseModel + { + // [optional] Content of data + TMap Data; + FContainer_Dictionary_String_String() : + FPlayFabBaseModel(), + Data() + {} + + FContainer_Dictionary_String_String(const FContainer_Dictionary_String_String& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FContainer_Dictionary_String_String(const TSharedPtr& obj) : FContainer_Dictionary_String_String() + { + readFromValue(obj); + } + + ~FContainer_Dictionary_String_String(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCollectionFilter : public FPlayFabBaseModel + { + // [optional] List of Exclude rules, with any of which if a collection matches, it is excluded by the filter. + TArray Excludes; + /** + * [optional] List of Include rules, with any of which if a collection matches, it is included by the filter, unless it is excluded by + * one of the Exclude rule + */ + TArray Includes; + FCollectionFilter() : + FPlayFabBaseModel(), + Excludes(), + Includes() + {} + + FCollectionFilter(const FCollectionFilter& src) : + FPlayFabBaseModel(), + Excludes(src.Excludes), + Includes(src.Includes) + {} + + FCollectionFilter(const TSharedPtr& obj) : FCollectionFilter() + { + readFromValue(obj); + } + + ~FCollectionFilter(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConfirmPurchaseRequest : public FPlayFabBaseModel + { + // Purchase order identifier returned from StartPurchase. + FString OrderId; + + FConfirmPurchaseRequest() : + FPlayFabBaseModel(), + OrderId() + {} + + FConfirmPurchaseRequest(const FConfirmPurchaseRequest& src) : + FPlayFabBaseModel(), + OrderId(src.OrderId) + {} + + FConfirmPurchaseRequest(const TSharedPtr& obj) : FConfirmPurchaseRequest() + { + readFromValue(obj); + } + + ~FConfirmPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConfirmPurchaseResult : public FPlayFabBaseModel + { + // [optional] Array of items purchased. + TArray Items; + // [optional] Purchase order identifier. + FString OrderId; + + // Date and time of the purchase. + FDateTime PurchaseDate; + + FConfirmPurchaseResult() : + FPlayFabBaseModel(), + Items(), + OrderId(), + PurchaseDate(0) + {} + + FConfirmPurchaseResult(const FConfirmPurchaseResult& src) : + FPlayFabBaseModel(), + Items(src.Items), + OrderId(src.OrderId), + PurchaseDate(src.PurchaseDate) + {} + + FConfirmPurchaseResult(const TSharedPtr& obj) : FConfirmPurchaseResult() + { + readFromValue(obj); + } + + ~FConfirmPurchaseResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConsumeItemRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Number of uses to consume from the item. + int32 ConsumeCount; + + // Unique instance identifier of the item to be consumed. + FString ItemInstanceId; + + FConsumeItemRequest() : + FPlayFabBaseModel(), + CharacterId(), + ConsumeCount(0), + ItemInstanceId() + {} + + FConsumeItemRequest(const FConsumeItemRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ConsumeCount(src.ConsumeCount), + ItemInstanceId(src.ItemInstanceId) + {} + + FConsumeItemRequest(const TSharedPtr& obj) : FConsumeItemRequest() + { + readFromValue(obj); + } + + ~FConsumeItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConsumeItemResult : public FPlayFabBaseModel + { + // [optional] Unique instance identifier of the item with uses consumed. + FString ItemInstanceId; + + // Number of uses remaining on the item. + int32 RemainingUses; + + FConsumeItemResult() : + FPlayFabBaseModel(), + ItemInstanceId(), + RemainingUses(0) + {} + + FConsumeItemResult(const FConsumeItemResult& src) : + FPlayFabBaseModel(), + ItemInstanceId(src.ItemInstanceId), + RemainingUses(src.RemainingUses) + {} + + FConsumeItemResult(const TSharedPtr& obj) : FConsumeItemResult() + { + readFromValue(obj); + } + + ~FConsumeItemResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConsumeXboxEntitlementsRequest : public FPlayFabBaseModel + { + // [optional] Catalog version to use + FString CatalogVersion; + + // Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + FString XboxToken; + + FConsumeXboxEntitlementsRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + XboxToken() + {} + + FConsumeXboxEntitlementsRequest(const FConsumeXboxEntitlementsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + XboxToken(src.XboxToken) + {} + + FConsumeXboxEntitlementsRequest(const TSharedPtr& obj) : FConsumeXboxEntitlementsRequest() + { + readFromValue(obj); + } + + ~FConsumeXboxEntitlementsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConsumeXboxEntitlementsResult : public FPlayFabBaseModel + { + // [optional] Details for the items purchased. + TArray Items; + FConsumeXboxEntitlementsResult() : + FPlayFabBaseModel(), + Items() + {} + + FConsumeXboxEntitlementsResult(const FConsumeXboxEntitlementsResult& src) : + FPlayFabBaseModel(), + Items(src.Items) + {} + + FConsumeXboxEntitlementsResult(const TSharedPtr& obj) : FConsumeXboxEntitlementsResult() + { + readFromValue(obj); + } + + ~FConsumeXboxEntitlementsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum EmailVerificationStatus + { + EmailVerificationStatusUnverified, + EmailVerificationStatusPending, + EmailVerificationStatusConfirmed + }; + + PLAYFABCPP_API void writeEmailVerificationStatusEnumJSON(EmailVerificationStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API EmailVerificationStatus readEmailVerificationStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API EmailVerificationStatus readEmailVerificationStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FContactEmailInfoModel : public FPlayFabBaseModel + { + // [optional] The email address + FString EmailAddress; + + // [optional] The name of the email info data + FString Name; + + // [optional] The verification status of the email + Boxed VerificationStatus; + + FContactEmailInfoModel() : + FPlayFabBaseModel(), + EmailAddress(), + Name(), + VerificationStatus() + {} + + FContactEmailInfoModel(const FContactEmailInfoModel& src) : + FPlayFabBaseModel(), + EmailAddress(src.EmailAddress), + Name(src.Name), + VerificationStatus(src.VerificationStatus) + {} + + FContactEmailInfoModel(const TSharedPtr& obj) : FContactEmailInfoModel() + { + readFromValue(obj); + } + + ~FContactEmailInfoModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ContinentCode + { + ContinentCodeAF, + ContinentCodeAN, + ContinentCodeAS, + ContinentCodeEU, + ContinentCodeNA, + ContinentCodeOC, + ContinentCodeSA + }; + + PLAYFABCPP_API void writeContinentCodeEnumJSON(ContinentCode enumVal, JsonWriter& writer); + PLAYFABCPP_API ContinentCode readContinentCodeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ContinentCode readContinentCodeFromValue(const FString& value); + + enum CountryCode + { + CountryCodeAF, + CountryCodeAX, + CountryCodeAL, + CountryCodeDZ, + CountryCodeAS, + CountryCodeAD, + CountryCodeAO, + CountryCodeAI, + CountryCodeAQ, + CountryCodeAG, + CountryCodeAR, + CountryCodeAM, + CountryCodeAW, + CountryCodeAU, + CountryCodeAT, + CountryCodeAZ, + CountryCodeBS, + CountryCodeBH, + CountryCodeBD, + CountryCodeBB, + CountryCodeBY, + CountryCodeBE, + CountryCodeBZ, + CountryCodeBJ, + CountryCodeBM, + CountryCodeBT, + CountryCodeBO, + CountryCodeBQ, + CountryCodeBA, + CountryCodeBW, + CountryCodeBV, + CountryCodeBR, + CountryCodeIO, + CountryCodeBN, + CountryCodeBG, + CountryCodeBF, + CountryCodeBI, + CountryCodeKH, + CountryCodeCM, + CountryCodeCA, + CountryCodeCV, + CountryCodeKY, + CountryCodeCF, + CountryCodeTD, + CountryCodeCL, + CountryCodeCN, + CountryCodeCX, + CountryCodeCC, + CountryCodeCO, + CountryCodeKM, + CountryCodeCG, + CountryCodeCD, + CountryCodeCK, + CountryCodeCR, + CountryCodeCI, + CountryCodeHR, + CountryCodeCU, + CountryCodeCW, + CountryCodeCY, + CountryCodeCZ, + CountryCodeDK, + CountryCodeDJ, + CountryCodeDM, + CountryCodeDO, + CountryCodeEC, + CountryCodeEG, + CountryCodeSV, + CountryCodeGQ, + CountryCodeER, + CountryCodeEE, + CountryCodeET, + CountryCodeFK, + CountryCodeFO, + CountryCodeFJ, + CountryCodeFI, + CountryCodeFR, + CountryCodeGF, + CountryCodePF, + CountryCodeTF, + CountryCodeGA, + CountryCodeGM, + CountryCodeGE, + CountryCodeDE, + CountryCodeGH, + CountryCodeGI, + CountryCodeGR, + CountryCodeGL, + CountryCodeGD, + CountryCodeGP, + CountryCodeGU, + CountryCodeGT, + CountryCodeGG, + CountryCodeGN, + CountryCodeGW, + CountryCodeGY, + CountryCodeHT, + CountryCodeHM, + CountryCodeVA, + CountryCodeHN, + CountryCodeHK, + CountryCodeHU, + CountryCodeIS, + CountryCodeIN, + CountryCodeID, + CountryCodeIR, + CountryCodeIQ, + CountryCodeIE, + CountryCodeIM, + CountryCodeIL, + CountryCodeIT, + CountryCodeJM, + CountryCodeJP, + CountryCodeJE, + CountryCodeJO, + CountryCodeKZ, + CountryCodeKE, + CountryCodeKI, + CountryCodeKP, + CountryCodeKR, + CountryCodeKW, + CountryCodeKG, + CountryCodeLA, + CountryCodeLV, + CountryCodeLB, + CountryCodeLS, + CountryCodeLR, + CountryCodeLY, + CountryCodeLI, + CountryCodeLT, + CountryCodeLU, + CountryCodeMO, + CountryCodeMK, + CountryCodeMG, + CountryCodeMW, + CountryCodeMY, + CountryCodeMV, + CountryCodeML, + CountryCodeMT, + CountryCodeMH, + CountryCodeMQ, + CountryCodeMR, + CountryCodeMU, + CountryCodeYT, + CountryCodeMX, + CountryCodeFM, + CountryCodeMD, + CountryCodeMC, + CountryCodeMN, + CountryCodeME, + CountryCodeMS, + CountryCodeMA, + CountryCodeMZ, + CountryCodeMM, + CountryCodeNA, + CountryCodeNR, + CountryCodeNP, + CountryCodeNL, + CountryCodeNC, + CountryCodeNZ, + CountryCodeNI, + CountryCodeNE, + CountryCodeNG, + CountryCodeNU, + CountryCodeNF, + CountryCodeMP, + CountryCodeNO, + CountryCodeOM, + CountryCodePK, + CountryCodePW, + CountryCodePS, + CountryCodePA, + CountryCodePG, + CountryCodePY, + CountryCodePE, + CountryCodePH, + CountryCodePN, + CountryCodePL, + CountryCodePT, + CountryCodePR, + CountryCodeQA, + CountryCodeRE, + CountryCodeRO, + CountryCodeRU, + CountryCodeRW, + CountryCodeBL, + CountryCodeSH, + CountryCodeKN, + CountryCodeLC, + CountryCodeMF, + CountryCodePM, + CountryCodeVC, + CountryCodeWS, + CountryCodeSM, + CountryCodeST, + CountryCodeSA, + CountryCodeSN, + CountryCodeRS, + CountryCodeSC, + CountryCodeSL, + CountryCodeSG, + CountryCodeSX, + CountryCodeSK, + CountryCodeSI, + CountryCodeSB, + CountryCodeSO, + CountryCodeZA, + CountryCodeGS, + CountryCodeSS, + CountryCodeES, + CountryCodeLK, + CountryCodeSD, + CountryCodeSR, + CountryCodeSJ, + CountryCodeSZ, + CountryCodeSE, + CountryCodeCH, + CountryCodeSY, + CountryCodeTW, + CountryCodeTJ, + CountryCodeTZ, + CountryCodeTH, + CountryCodeTL, + CountryCodeTG, + CountryCodeTK, + CountryCodeTO, + CountryCodeTT, + CountryCodeTN, + CountryCodeTR, + CountryCodeTM, + CountryCodeTC, + CountryCodeTV, + CountryCodeUG, + CountryCodeUA, + CountryCodeAE, + CountryCodeGB, + CountryCodeUS, + CountryCodeUM, + CountryCodeUY, + CountryCodeUZ, + CountryCodeVU, + CountryCodeVE, + CountryCodeVN, + CountryCodeVG, + CountryCodeVI, + CountryCodeWF, + CountryCodeEH, + CountryCodeYE, + CountryCodeZM, + CountryCodeZW + }; + + PLAYFABCPP_API void writeCountryCodeEnumJSON(CountryCode enumVal, JsonWriter& writer); + PLAYFABCPP_API CountryCode readCountryCodeFromValue(const TSharedPtr& value); + PLAYFABCPP_API CountryCode readCountryCodeFromValue(const FString& value); + + struct PLAYFABCPP_API FCreateSharedGroupRequest : public FPlayFabBaseModel + { + // [optional] Unique identifier for the shared group (a random identifier will be assigned, if one is not specified). + FString SharedGroupId; + + FCreateSharedGroupRequest() : + FPlayFabBaseModel(), + SharedGroupId() + {} + + FCreateSharedGroupRequest(const FCreateSharedGroupRequest& src) : + FPlayFabBaseModel(), + SharedGroupId(src.SharedGroupId) + {} + + FCreateSharedGroupRequest(const TSharedPtr& obj) : FCreateSharedGroupRequest() + { + readFromValue(obj); + } + + ~FCreateSharedGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateSharedGroupResult : public FPlayFabBaseModel + { + // [optional] Unique identifier for the shared group. + FString SharedGroupId; + + FCreateSharedGroupResult() : + FPlayFabBaseModel(), + SharedGroupId() + {} + + FCreateSharedGroupResult(const FCreateSharedGroupResult& src) : + FPlayFabBaseModel(), + SharedGroupId(src.SharedGroupId) + {} + + FCreateSharedGroupResult(const TSharedPtr& obj) : FCreateSharedGroupResult() + { + readFromValue(obj); + } + + ~FCreateSharedGroupResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum Currency + { + CurrencyAED, + CurrencyAFN, + CurrencyALL, + CurrencyAMD, + CurrencyANG, + CurrencyAOA, + CurrencyARS, + CurrencyAUD, + CurrencyAWG, + CurrencyAZN, + CurrencyBAM, + CurrencyBBD, + CurrencyBDT, + CurrencyBGN, + CurrencyBHD, + CurrencyBIF, + CurrencyBMD, + CurrencyBND, + CurrencyBOB, + CurrencyBRL, + CurrencyBSD, + CurrencyBTN, + CurrencyBWP, + CurrencyBYR, + CurrencyBZD, + CurrencyCAD, + CurrencyCDF, + CurrencyCHF, + CurrencyCLP, + CurrencyCNY, + CurrencyCOP, + CurrencyCRC, + CurrencyCUC, + CurrencyCUP, + CurrencyCVE, + CurrencyCZK, + CurrencyDJF, + CurrencyDKK, + CurrencyDOP, + CurrencyDZD, + CurrencyEGP, + CurrencyERN, + CurrencyETB, + CurrencyEUR, + CurrencyFJD, + CurrencyFKP, + CurrencyGBP, + CurrencyGEL, + CurrencyGGP, + CurrencyGHS, + CurrencyGIP, + CurrencyGMD, + CurrencyGNF, + CurrencyGTQ, + CurrencyGYD, + CurrencyHKD, + CurrencyHNL, + CurrencyHRK, + CurrencyHTG, + CurrencyHUF, + CurrencyIDR, + CurrencyILS, + CurrencyIMP, + CurrencyINR, + CurrencyIQD, + CurrencyIRR, + CurrencyISK, + CurrencyJEP, + CurrencyJMD, + CurrencyJOD, + CurrencyJPY, + CurrencyKES, + CurrencyKGS, + CurrencyKHR, + CurrencyKMF, + CurrencyKPW, + CurrencyKRW, + CurrencyKWD, + CurrencyKYD, + CurrencyKZT, + CurrencyLAK, + CurrencyLBP, + CurrencyLKR, + CurrencyLRD, + CurrencyLSL, + CurrencyLYD, + CurrencyMAD, + CurrencyMDL, + CurrencyMGA, + CurrencyMKD, + CurrencyMMK, + CurrencyMNT, + CurrencyMOP, + CurrencyMRO, + CurrencyMUR, + CurrencyMVR, + CurrencyMWK, + CurrencyMXN, + CurrencyMYR, + CurrencyMZN, + CurrencyNAD, + CurrencyNGN, + CurrencyNIO, + CurrencyNOK, + CurrencyNPR, + CurrencyNZD, + CurrencyOMR, + CurrencyPAB, + CurrencyPEN, + CurrencyPGK, + CurrencyPHP, + CurrencyPKR, + CurrencyPLN, + CurrencyPYG, + CurrencyQAR, + CurrencyRON, + CurrencyRSD, + CurrencyRUB, + CurrencyRWF, + CurrencySAR, + CurrencySBD, + CurrencySCR, + CurrencySDG, + CurrencySEK, + CurrencySGD, + CurrencySHP, + CurrencySLL, + CurrencySOS, + CurrencySPL, + CurrencySRD, + CurrencySTD, + CurrencySVC, + CurrencySYP, + CurrencySZL, + CurrencyTHB, + CurrencyTJS, + CurrencyTMT, + CurrencyTND, + CurrencyTOP, + CurrencyTRY, + CurrencyTTD, + CurrencyTVD, + CurrencyTWD, + CurrencyTZS, + CurrencyUAH, + CurrencyUGX, + CurrencyUSD, + CurrencyUYU, + CurrencyUZS, + CurrencyVEF, + CurrencyVND, + CurrencyVUV, + CurrencyWST, + CurrencyXAF, + CurrencyXCD, + CurrencyXDR, + CurrencyXOF, + CurrencyXPF, + CurrencyYER, + CurrencyZAR, + CurrencyZMW, + CurrencyZWD + }; + + PLAYFABCPP_API void writeCurrencyEnumJSON(Currency enumVal, JsonWriter& writer); + PLAYFABCPP_API Currency readCurrencyFromValue(const TSharedPtr& value); + PLAYFABCPP_API Currency readCurrencyFromValue(const FString& value); + + enum Region + { + RegionUSCentral, + RegionUSEast, + RegionEUWest, + RegionSingapore, + RegionJapan, + RegionBrazil, + RegionAustralia + }; + + PLAYFABCPP_API void writeRegionEnumJSON(Region enumVal, JsonWriter& writer); + PLAYFABCPP_API Region readRegionFromValue(const TSharedPtr& value); + PLAYFABCPP_API Region readRegionFromValue(const FString& value); + + struct PLAYFABCPP_API FCurrentGamesRequest : public FPlayFabBaseModel + { + // [optional] Build to match against. + FString BuildVersion; + + // [optional] Game mode to look for. + FString GameMode; + + // [optional] Region to check for Game Server Instances. + Boxed pfRegion; + + // [optional] Statistic name to find statistic-based matches. + FString StatisticName; + + // [optional] Filter to include and/or exclude Game Server Instances associated with certain tags. + TSharedPtr TagFilter; + + FCurrentGamesRequest() : + FPlayFabBaseModel(), + BuildVersion(), + GameMode(), + pfRegion(), + StatisticName(), + TagFilter(nullptr) + {} + + FCurrentGamesRequest(const FCurrentGamesRequest& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + GameMode(src.GameMode), + pfRegion(src.pfRegion), + StatisticName(src.StatisticName), + TagFilter(src.TagFilter.IsValid() ? MakeShareable(new FCollectionFilter(*src.TagFilter)) : nullptr) + {} + + FCurrentGamesRequest(const TSharedPtr& obj) : FCurrentGamesRequest() + { + readFromValue(obj); + } + + ~FCurrentGamesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum GameInstanceState + { + GameInstanceStateOpen, + GameInstanceStateClosed + }; + + PLAYFABCPP_API void writeGameInstanceStateEnumJSON(GameInstanceState enumVal, JsonWriter& writer); + PLAYFABCPP_API GameInstanceState readGameInstanceStateFromValue(const TSharedPtr& value); + PLAYFABCPP_API GameInstanceState readGameInstanceStateFromValue(const FString& value); + + struct PLAYFABCPP_API FGameInfo : public FPlayFabBaseModel + { + // [optional] build version this server is running + FString BuildVersion; + + // [optional] game mode this server is running + FString GameMode; + + // [optional] game session custom data + FString GameServerData; + + // [optional] game specific string denoting server configuration + Boxed GameServerStateEnum; + + // [optional] last heartbeat of the game server instance, used in external game server provider mode + Boxed LastHeartbeat; + + // [optional] unique lobby identifier for this game server + FString LobbyID; + + // [optional] maximum players this server can support + Boxed MaxPlayers; + + // [optional] array of current player IDs on this server + TArray PlayerUserIds; + // [optional] region to which this server is associated + Boxed pfRegion; + + // duration in seconds this server has been running + uint32 RunTime; + + // [optional] IPV4 address of the server + FString ServerHostname; + + // [optional] IPV4 address of the server + FString ServerIPV4Address; + + // [optional] IPV6 address of the server + FString ServerIPV6Address; + + // [optional] port number to use for non-http communications with the server + Boxed ServerPort; + + // [optional] Public DNS name (if any) of the server + FString ServerPublicDNSName; + + // [optional] stastic used to match this game in player statistic matchmaking + FString StatisticName; + + // [optional] game session tags + TMap Tags; + FGameInfo() : + FPlayFabBaseModel(), + BuildVersion(), + GameMode(), + GameServerData(), + GameServerStateEnum(), + LastHeartbeat(), + LobbyID(), + MaxPlayers(), + PlayerUserIds(), + pfRegion(), + RunTime(0), + ServerHostname(), + ServerIPV4Address(), + ServerIPV6Address(), + ServerPort(), + ServerPublicDNSName(), + StatisticName(), + Tags() + {} + + FGameInfo(const FGameInfo& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + GameMode(src.GameMode), + GameServerData(src.GameServerData), + GameServerStateEnum(src.GameServerStateEnum), + LastHeartbeat(src.LastHeartbeat), + LobbyID(src.LobbyID), + MaxPlayers(src.MaxPlayers), + PlayerUserIds(src.PlayerUserIds), + pfRegion(src.pfRegion), + RunTime(src.RunTime), + ServerHostname(src.ServerHostname), + ServerIPV4Address(src.ServerIPV4Address), + ServerIPV6Address(src.ServerIPV6Address), + ServerPort(src.ServerPort), + ServerPublicDNSName(src.ServerPublicDNSName), + StatisticName(src.StatisticName), + Tags(src.Tags) + {} + + FGameInfo(const TSharedPtr& obj) : FGameInfo() + { + readFromValue(obj); + } + + ~FGameInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCurrentGamesResult : public FPlayFabBaseModel + { + // number of games running + int32 GameCount; + + // [optional] array of games found + TArray Games; + // total number of players across all servers + int32 PlayerCount; + + FCurrentGamesResult() : + FPlayFabBaseModel(), + GameCount(0), + Games(), + PlayerCount(0) + {} + + FCurrentGamesResult(const FCurrentGamesResult& src) : + FPlayFabBaseModel(), + GameCount(src.GameCount), + Games(src.Games), + PlayerCount(src.PlayerCount) + {} + + FCurrentGamesResult(const TSharedPtr& obj) : FCurrentGamesResult() + { + readFromValue(obj); + } + + ~FCurrentGamesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeviceInfoRequest : public FPlayFabBaseModel + { + // [optional] Information posted to the PlayStream Event. Currently arbitrary, and specific to the environment sending it. + TMap Info; + FDeviceInfoRequest() : + FPlayFabBaseModel(), + Info() + {} + + FDeviceInfoRequest(const FDeviceInfoRequest& src) : + FPlayFabBaseModel(), + Info(src.Info) + {} + + FDeviceInfoRequest(const TSharedPtr& obj) : FDeviceInfoRequest() + { + readFromValue(obj); + } + + ~FDeviceInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEmptyResponse : public FPlayFabBaseModel + { + FEmptyResponse() : + FPlayFabBaseModel() + {} + + FEmptyResponse(const FEmptyResponse& src) : + FPlayFabBaseModel() + {} + + FEmptyResponse(const TSharedPtr& obj) : FEmptyResponse() + { + readFromValue(obj); + } + + ~FEmptyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityTokenResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // [optional] The token used to set X-EntityToken for all entity based API calls. + FString EntityToken; + + // [optional] The time the token will expire, if it is an expiring token, in UTC. + Boxed TokenExpiration; + + FEntityTokenResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + EntityToken(), + TokenExpiration() + {} + + FEntityTokenResponse(const FEntityTokenResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + EntityToken(src.EntityToken), + TokenExpiration(src.TokenExpiration) + {} + + FEntityTokenResponse(const TSharedPtr& obj) : FEntityTokenResponse() + { + readFromValue(obj); + } + + ~FEntityTokenResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteCloudScriptRequest : public FPlayFabBaseModel + { + // The name of the CloudScript function to execute + FString FunctionName; + + // [optional] Object that is passed in to the function as the first argument + FJsonKeeper FunctionParameter; + + /** + * [optional] Generate a 'player_executed_cloudscript' PlayStream event containing the results of the function execution and other + * contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. + */ + Boxed GeneratePlayStreamEvent; + + /** + * [optional] Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' + * executes the current live, published revision, and 'Specific' executes the specified revision. The default value is + * 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. + */ + Boxed RevisionSelection; + + // [optional] The specivic revision to execute, when RevisionSelection is set to 'Specific' + Boxed SpecificRevision; + + FExecuteCloudScriptRequest() : + FPlayFabBaseModel(), + FunctionName(), + FunctionParameter(), + GeneratePlayStreamEvent(), + RevisionSelection(), + SpecificRevision() + {} + + FExecuteCloudScriptRequest(const FExecuteCloudScriptRequest& src) : + FPlayFabBaseModel(), + FunctionName(src.FunctionName), + FunctionParameter(src.FunctionParameter), + GeneratePlayStreamEvent(src.GeneratePlayStreamEvent), + RevisionSelection(src.RevisionSelection), + SpecificRevision(src.SpecificRevision) + {} + + FExecuteCloudScriptRequest(const TSharedPtr& obj) : FExecuteCloudScriptRequest() + { + readFromValue(obj); + } + + ~FExecuteCloudScriptRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FScriptExecutionError : public FPlayFabBaseModel + { + /** + * [optional] Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, + * CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError + */ + FString Error; + + // [optional] Details about the error + FString Message; + + // [optional] Point during the execution of the script at which the error occurred, if any + FString StackTrace; + + FScriptExecutionError() : + FPlayFabBaseModel(), + Error(), + Message(), + StackTrace() + {} + + FScriptExecutionError(const FScriptExecutionError& src) : + FPlayFabBaseModel(), + Error(src.Error), + Message(src.Message), + StackTrace(src.StackTrace) + {} + + FScriptExecutionError(const TSharedPtr& obj) : FScriptExecutionError() + { + readFromValue(obj); + } + + ~FScriptExecutionError(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLogStatement : public FPlayFabBaseModel + { + // [optional] Optional object accompanying the message as contextual information + FJsonKeeper Data; + + // [optional] 'Debug', 'Info', or 'Error' + FString Level; + + // [optional] undefined + FString Message; + + FLogStatement() : + FPlayFabBaseModel(), + Data(), + Level(), + Message() + {} + + FLogStatement(const FLogStatement& src) : + FPlayFabBaseModel(), + Data(src.Data), + Level(src.Level), + Message(src.Message) + {} + + FLogStatement(const TSharedPtr& obj) : FLogStatement() + { + readFromValue(obj); + } + + ~FLogStatement(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteCloudScriptResult : public FPlayFabBaseModel + { + // Number of PlayFab API requests issued by the CloudScript function + int32 APIRequestsIssued; + + // [optional] Information about the error, if any, that occurred during execution + TSharedPtr Error; + + double ExecutionTimeSeconds; + + // [optional] The name of the function that executed + FString FunctionName; + + // [optional] The object returned from the CloudScript function, if any + FJsonKeeper FunctionResult; + + /** + * [optional] Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + Boxed FunctionResultTooLarge; + + // Number of external HTTP requests issued by the CloudScript function + int32 HttpRequestsIssued; + + /** + * [optional] Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + TArray Logs; + /** + * [optional] Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + Boxed LogsTooLarge; + + uint32 MemoryConsumedBytes; + + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + double ProcessorTimeSeconds; + + // The revision of the CloudScript that executed + int32 Revision; + + FExecuteCloudScriptResult() : + FPlayFabBaseModel(), + APIRequestsIssued(0), + Error(nullptr), + ExecutionTimeSeconds(0), + FunctionName(), + FunctionResult(), + FunctionResultTooLarge(), + HttpRequestsIssued(0), + Logs(), + LogsTooLarge(), + MemoryConsumedBytes(0), + ProcessorTimeSeconds(0), + Revision(0) + {} + + FExecuteCloudScriptResult(const FExecuteCloudScriptResult& src) : + FPlayFabBaseModel(), + APIRequestsIssued(src.APIRequestsIssued), + Error(src.Error.IsValid() ? MakeShareable(new FScriptExecutionError(*src.Error)) : nullptr), + ExecutionTimeSeconds(src.ExecutionTimeSeconds), + FunctionName(src.FunctionName), + FunctionResult(src.FunctionResult), + FunctionResultTooLarge(src.FunctionResultTooLarge), + HttpRequestsIssued(src.HttpRequestsIssued), + Logs(src.Logs), + LogsTooLarge(src.LogsTooLarge), + MemoryConsumedBytes(src.MemoryConsumedBytes), + ProcessorTimeSeconds(src.ProcessorTimeSeconds), + Revision(src.Revision) + {} + + FExecuteCloudScriptResult(const TSharedPtr& obj) : FExecuteCloudScriptResult() + { + readFromValue(obj); + } + + ~FExecuteCloudScriptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFacebookInstantGamesPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Facebook Instant Games identifier for a user. + FString FacebookInstantGamesId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Facebook Instant Games identifier. + FString PlayFabId; + + FFacebookInstantGamesPlayFabIdPair() : + FPlayFabBaseModel(), + FacebookInstantGamesId(), + PlayFabId() + {} + + FFacebookInstantGamesPlayFabIdPair(const FFacebookInstantGamesPlayFabIdPair& src) : + FPlayFabBaseModel(), + FacebookInstantGamesId(src.FacebookInstantGamesId), + PlayFabId(src.PlayFabId) + {} + + FFacebookInstantGamesPlayFabIdPair(const TSharedPtr& obj) : FFacebookInstantGamesPlayFabIdPair() + { + readFromValue(obj); + } + + ~FFacebookInstantGamesPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFacebookPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Facebook identifier for a user. + FString FacebookId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Facebook identifier. + FString PlayFabId; + + FFacebookPlayFabIdPair() : + FPlayFabBaseModel(), + FacebookId(), + PlayFabId() + {} + + FFacebookPlayFabIdPair(const FFacebookPlayFabIdPair& src) : + FPlayFabBaseModel(), + FacebookId(src.FacebookId), + PlayFabId(src.PlayFabId) + {} + + FFacebookPlayFabIdPair(const TSharedPtr& obj) : FFacebookPlayFabIdPair() + { + readFromValue(obj); + } + + ~FFacebookPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserFacebookInfo : public FPlayFabBaseModel + { + // [optional] Facebook identifier + FString FacebookId; + + // [optional] Facebook full name + FString FullName; + + FUserFacebookInfo() : + FPlayFabBaseModel(), + FacebookId(), + FullName() + {} + + FUserFacebookInfo(const FUserFacebookInfo& src) : + FPlayFabBaseModel(), + FacebookId(src.FacebookId), + FullName(src.FullName) + {} + + FUserFacebookInfo(const TSharedPtr& obj) : FUserFacebookInfo() + { + readFromValue(obj); + } + + ~FUserFacebookInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserGameCenterInfo : public FPlayFabBaseModel + { + // [optional] Gamecenter identifier + FString GameCenterId; + + FUserGameCenterInfo() : + FPlayFabBaseModel(), + GameCenterId() + {} + + FUserGameCenterInfo(const FUserGameCenterInfo& src) : + FPlayFabBaseModel(), + GameCenterId(src.GameCenterId) + {} + + FUserGameCenterInfo(const TSharedPtr& obj) : FUserGameCenterInfo() + { + readFromValue(obj); + } + + ~FUserGameCenterInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum LoginIdentityProvider + { + LoginIdentityProviderUnknown, + LoginIdentityProviderPlayFab, + LoginIdentityProviderCustom, + LoginIdentityProviderGameCenter, + LoginIdentityProviderGooglePlay, + LoginIdentityProviderSteam, + LoginIdentityProviderXBoxLive, + LoginIdentityProviderPSN, + LoginIdentityProviderKongregate, + LoginIdentityProviderFacebook, + LoginIdentityProviderIOSDevice, + LoginIdentityProviderAndroidDevice, + LoginIdentityProviderTwitch, + LoginIdentityProviderWindowsHello, + LoginIdentityProviderGameServer, + LoginIdentityProviderCustomServer, + LoginIdentityProviderNintendoSwitch, + LoginIdentityProviderFacebookInstantGames, + LoginIdentityProviderOpenIdConnect + }; + + PLAYFABCPP_API void writeLoginIdentityProviderEnumJSON(LoginIdentityProvider enumVal, JsonWriter& writer); + PLAYFABCPP_API LoginIdentityProvider readLoginIdentityProviderFromValue(const TSharedPtr& value); + PLAYFABCPP_API LoginIdentityProvider readLoginIdentityProviderFromValue(const FString& value); + + struct PLAYFABCPP_API FLinkedPlatformAccountModel : public FPlayFabBaseModel + { + // [optional] Linked account email of the user on the platform, if available + FString Email; + + // [optional] Authentication platform + Boxed Platform; + + // [optional] Unique account identifier of the user on the platform + FString PlatformUserId; + + // [optional] Linked account username of the user on the platform, if available + FString Username; + + FLinkedPlatformAccountModel() : + FPlayFabBaseModel(), + Email(), + Platform(), + PlatformUserId(), + Username() + {} + + FLinkedPlatformAccountModel(const FLinkedPlatformAccountModel& src) : + FPlayFabBaseModel(), + Email(src.Email), + Platform(src.Platform), + PlatformUserId(src.PlatformUserId), + Username(src.Username) + {} + + FLinkedPlatformAccountModel(const TSharedPtr& obj) : FLinkedPlatformAccountModel() + { + readFromValue(obj); + } + + ~FLinkedPlatformAccountModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLocationModel : public FPlayFabBaseModel + { + // [optional] City name. + FString City; + + // [optional] The two-character continent code for this location + Boxed pfContinentCode; + + // [optional] The two-character ISO 3166-1 country code for the country associated with the location + Boxed pfCountryCode; + + // [optional] Latitude coordinate of the geographic location. + Boxed Latitude; + + // [optional] Longitude coordinate of the geographic location. + Boxed Longitude; + + FLocationModel() : + FPlayFabBaseModel(), + City(), + pfContinentCode(), + pfCountryCode(), + Latitude(), + Longitude() + {} + + FLocationModel(const FLocationModel& src) : + FPlayFabBaseModel(), + City(src.City), + pfContinentCode(src.pfContinentCode), + pfCountryCode(src.pfCountryCode), + Latitude(src.Latitude), + Longitude(src.Longitude) + {} + + FLocationModel(const TSharedPtr& obj) : FLocationModel() + { + readFromValue(obj); + } + + ~FLocationModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum SubscriptionProviderStatus + { + SubscriptionProviderStatusNoError, + SubscriptionProviderStatusCancelled, + SubscriptionProviderStatusUnknownError, + SubscriptionProviderStatusBillingError, + SubscriptionProviderStatusProductUnavailable, + SubscriptionProviderStatusCustomerDidNotAcceptPriceChange, + SubscriptionProviderStatusFreeTrial, + SubscriptionProviderStatusPaymentPending + }; + + PLAYFABCPP_API void writeSubscriptionProviderStatusEnumJSON(SubscriptionProviderStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API SubscriptionProviderStatus readSubscriptionProviderStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API SubscriptionProviderStatus readSubscriptionProviderStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FSubscriptionModel : public FPlayFabBaseModel + { + // When this subscription expires. + FDateTime Expiration; + + // The time the subscription was orignially purchased + FDateTime InitialSubscriptionTime; + + // Whether this subscription is currently active. That is, if Expiration > now. + bool IsActive; + + // [optional] The status of this subscription, according to the subscription provider. + Boxed Status; + + // [optional] The id for this subscription + FString SubscriptionId; + + // [optional] The item id for this subscription from the primary catalog + FString SubscriptionItemId; + + // [optional] The provider for this subscription. Apple or Google Play are supported today. + FString SubscriptionProvider; + + FSubscriptionModel() : + FPlayFabBaseModel(), + Expiration(0), + InitialSubscriptionTime(0), + IsActive(false), + Status(), + SubscriptionId(), + SubscriptionItemId(), + SubscriptionProvider() + {} + + FSubscriptionModel(const FSubscriptionModel& src) : + FPlayFabBaseModel(), + Expiration(src.Expiration), + InitialSubscriptionTime(src.InitialSubscriptionTime), + IsActive(src.IsActive), + Status(src.Status), + SubscriptionId(src.SubscriptionId), + SubscriptionItemId(src.SubscriptionItemId), + SubscriptionProvider(src.SubscriptionProvider) + {} + + FSubscriptionModel(const TSharedPtr& obj) : FSubscriptionModel() + { + readFromValue(obj); + } + + ~FSubscriptionModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMembershipModel : public FPlayFabBaseModel + { + // Whether this membership is active. That is, whether the MembershipExpiration time has been reached. + bool IsActive; + + // The time this membership expires + FDateTime MembershipExpiration; + + // [optional] The id of the membership + FString MembershipId; + + /** + * [optional] Membership expirations can be explicitly overridden (via game manager or the admin api). If this membership has been + * overridden, this will be the new expiration time. + */ + Boxed OverrideExpiration; + + // [optional] Whether the override expiration is set. + Boxed OverrideIsSet; + + // [optional] The list of subscriptions that this player has for this membership + TArray Subscriptions; + FMembershipModel() : + FPlayFabBaseModel(), + IsActive(false), + MembershipExpiration(0), + MembershipId(), + OverrideExpiration(), + OverrideIsSet(), + Subscriptions() + {} + + FMembershipModel(const FMembershipModel& src) : + FPlayFabBaseModel(), + IsActive(src.IsActive), + MembershipExpiration(src.MembershipExpiration), + MembershipId(src.MembershipId), + OverrideExpiration(src.OverrideExpiration), + OverrideIsSet(src.OverrideIsSet), + Subscriptions(src.Subscriptions) + {} + + FMembershipModel(const TSharedPtr& obj) : FMembershipModel() + { + readFromValue(obj); + } + + ~FMembershipModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum PushNotificationPlatform + { + PushNotificationPlatformApplePushNotificationService, + PushNotificationPlatformGoogleCloudMessaging + }; + + PLAYFABCPP_API void writePushNotificationPlatformEnumJSON(PushNotificationPlatform enumVal, JsonWriter& writer); + PLAYFABCPP_API PushNotificationPlatform readPushNotificationPlatformFromValue(const TSharedPtr& value); + PLAYFABCPP_API PushNotificationPlatform readPushNotificationPlatformFromValue(const FString& value); + + struct PLAYFABCPP_API FPushNotificationRegistrationModel : public FPlayFabBaseModel + { + // [optional] Notification configured endpoint + FString NotificationEndpointARN; + + // [optional] Push notification platform + Boxed Platform; + + FPushNotificationRegistrationModel() : + FPlayFabBaseModel(), + NotificationEndpointARN(), + Platform() + {} + + FPushNotificationRegistrationModel(const FPushNotificationRegistrationModel& src) : + FPlayFabBaseModel(), + NotificationEndpointARN(src.NotificationEndpointARN), + Platform(src.Platform) + {} + + FPushNotificationRegistrationModel(const TSharedPtr& obj) : FPushNotificationRegistrationModel() + { + readFromValue(obj); + } + + ~FPushNotificationRegistrationModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticModel : public FPlayFabBaseModel + { + // [optional] Statistic name + FString Name; + + // Statistic value + int32 Value; + + // Statistic version (0 if not a versioned statistic) + int32 Version; + + FStatisticModel() : + FPlayFabBaseModel(), + Name(), + Value(0), + Version(0) + {} + + FStatisticModel(const FStatisticModel& src) : + FPlayFabBaseModel(), + Name(src.Name), + Value(src.Value), + Version(src.Version) + {} + + FStatisticModel(const TSharedPtr& obj) : FStatisticModel() + { + readFromValue(obj); + } + + ~FStatisticModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FTagModel : public FPlayFabBaseModel + { + // [optional] Full value of the tag, including namespace + FString TagValue; + + FTagModel() : + FPlayFabBaseModel(), + TagValue() + {} + + FTagModel(const FTagModel& src) : + FPlayFabBaseModel(), + TagValue(src.TagValue) + {} + + FTagModel(const TSharedPtr& obj) : FTagModel() + { + readFromValue(obj); + } + + ~FTagModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValueToDateModel : public FPlayFabBaseModel + { + // [optional] ISO 4217 code of the currency used in the purchases + FString Currency; + + /** + * Total value of the purchases in a whole number of 1/100 monetary units. For example, 999 indicates nine dollars and + * ninety-nine cents when Currency is 'USD') + */ + uint32 TotalValue; + + /** + * [optional] Total value of the purchases in a string representation of decimal monetary units. For example, '9.99' indicates nine + * dollars and ninety-nine cents when Currency is 'USD'. + */ + FString TotalValueAsDecimal; + + FValueToDateModel() : + FPlayFabBaseModel(), + Currency(), + TotalValue(0), + TotalValueAsDecimal() + {} + + FValueToDateModel(const FValueToDateModel& src) : + FPlayFabBaseModel(), + Currency(src.Currency), + TotalValue(src.TotalValue), + TotalValueAsDecimal(src.TotalValueAsDecimal) + {} + + FValueToDateModel(const TSharedPtr& obj) : FValueToDateModel() + { + readFromValue(obj); + } + + ~FValueToDateModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfileModel : public FPlayFabBaseModel + { + // [optional] List of advertising campaigns the player has been attributed to + TArray AdCampaignAttributions; + // [optional] URL of the player's avatar image + FString AvatarUrl; + + // [optional] If the player is currently banned, the UTC Date when the ban expires + Boxed BannedUntil; + + // [optional] List of all contact email info associated with the player account + TArray ContactEmailAddresses; + // [optional] Player record created + Boxed Created; + + // [optional] Player display name + FString DisplayName; + + // [optional] UTC time when the player most recently logged in to the title + Boxed LastLogin; + + // [optional] List of all authentication systems linked to this player account + TArray LinkedAccounts; + // [optional] List of geographic locations from which the player has logged in to the title + TArray Locations; + // [optional] List of memberships for the player, along with whether are expired. + TArray Memberships; + // [optional] Player account origination + Boxed Origination; + + // [optional] PlayFab player account unique identifier + FString PlayerId; + + // [optional] Publisher this player belongs to + FString PublisherId; + + // [optional] List of configured end points registered for sending the player push notifications + TArray PushNotificationRegistrations; + // [optional] List of leaderboard statistic values for the player + TArray Statistics; + // [optional] List of player's tags for segmentation + TArray Tags; + // [optional] Title ID this player profile applies to + FString TitleId; + + /** + * [optional] Sum of the player's purchases made with real-money currencies, converted to US dollars equivalent and represented as a + * whole number of cents (1/100 USD). For example, 999 indicates nine dollars and ninety-nine cents. + */ + Boxed TotalValueToDateInUSD; + + // [optional] List of the player's lifetime purchase totals, summed by real-money currency + TArray ValuesToDate; + FPlayerProfileModel() : + FPlayFabBaseModel(), + AdCampaignAttributions(), + AvatarUrl(), + BannedUntil(), + ContactEmailAddresses(), + Created(), + DisplayName(), + LastLogin(), + LinkedAccounts(), + Locations(), + Memberships(), + Origination(), + PlayerId(), + PublisherId(), + PushNotificationRegistrations(), + Statistics(), + Tags(), + TitleId(), + TotalValueToDateInUSD(), + ValuesToDate() + {} + + FPlayerProfileModel(const FPlayerProfileModel& src) : + FPlayFabBaseModel(), + AdCampaignAttributions(src.AdCampaignAttributions), + AvatarUrl(src.AvatarUrl), + BannedUntil(src.BannedUntil), + ContactEmailAddresses(src.ContactEmailAddresses), + Created(src.Created), + DisplayName(src.DisplayName), + LastLogin(src.LastLogin), + LinkedAccounts(src.LinkedAccounts), + Locations(src.Locations), + Memberships(src.Memberships), + Origination(src.Origination), + PlayerId(src.PlayerId), + PublisherId(src.PublisherId), + PushNotificationRegistrations(src.PushNotificationRegistrations), + Statistics(src.Statistics), + Tags(src.Tags), + TitleId(src.TitleId), + TotalValueToDateInUSD(src.TotalValueToDateInUSD), + ValuesToDate(src.ValuesToDate) + {} + + FPlayerProfileModel(const TSharedPtr& obj) : FPlayerProfileModel() + { + readFromValue(obj); + } + + ~FPlayerProfileModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserPsnInfo : public FPlayFabBaseModel + { + // [optional] PSN account ID + FString PsnAccountId; + + // [optional] PSN online ID + FString PsnOnlineId; + + FUserPsnInfo() : + FPlayFabBaseModel(), + PsnAccountId(), + PsnOnlineId() + {} + + FUserPsnInfo(const FUserPsnInfo& src) : + FPlayFabBaseModel(), + PsnAccountId(src.PsnAccountId), + PsnOnlineId(src.PsnOnlineId) + {} + + FUserPsnInfo(const TSharedPtr& obj) : FUserPsnInfo() + { + readFromValue(obj); + } + + ~FUserPsnInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum TitleActivationStatus + { + TitleActivationStatusNone, + TitleActivationStatusActivatedTitleKey, + TitleActivationStatusPendingSteam, + TitleActivationStatusActivatedSteam, + TitleActivationStatusRevokedSteam + }; + + PLAYFABCPP_API void writeTitleActivationStatusEnumJSON(TitleActivationStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API TitleActivationStatus readTitleActivationStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API TitleActivationStatus readTitleActivationStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FUserSteamInfo : public FPlayFabBaseModel + { + // [optional] what stage of game ownership the user is listed as being in, from Steam + Boxed SteamActivationStatus; + + // [optional] the country in which the player resides, from Steam data + FString SteamCountry; + + // [optional] currency type set in the user Steam account + Boxed SteamCurrency; + + // [optional] Steam identifier + FString SteamId; + + FUserSteamInfo() : + FPlayFabBaseModel(), + SteamActivationStatus(), + SteamCountry(), + SteamCurrency(), + SteamId() + {} + + FUserSteamInfo(const FUserSteamInfo& src) : + FPlayFabBaseModel(), + SteamActivationStatus(src.SteamActivationStatus), + SteamCountry(src.SteamCountry), + SteamCurrency(src.SteamCurrency), + SteamId(src.SteamId) + {} + + FUserSteamInfo(const TSharedPtr& obj) : FUserSteamInfo() + { + readFromValue(obj); + } + + ~FUserSteamInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserXboxInfo : public FPlayFabBaseModel + { + // [optional] XBox user ID + FString XboxUserId; + + FUserXboxInfo() : + FPlayFabBaseModel(), + XboxUserId() + {} + + FUserXboxInfo(const FUserXboxInfo& src) : + FPlayFabBaseModel(), + XboxUserId(src.XboxUserId) + {} + + FUserXboxInfo(const TSharedPtr& obj) : FUserXboxInfo() + { + readFromValue(obj); + } + + ~FUserXboxInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFriendInfo : public FPlayFabBaseModel + { + // [optional] Unique lobby identifier of the Game Server Instance to which this player is currently connected. + FString CurrentMatchmakerLobbyId; + + // [optional] Available Facebook information (if the user and PlayFab friend are also connected in Facebook). + TSharedPtr FacebookInfo; + + // [optional] PlayFab unique identifier for this friend. + FString FriendPlayFabId; + + // [optional] Available Game Center information (if the user and PlayFab friend are also connected in Game Center). + TSharedPtr GameCenterInfo; + + // [optional] The profile of the user, if requested. + TSharedPtr Profile; + + // [optional] Available PSN information, if the user and PlayFab friend are both connected to PSN. + TSharedPtr PSNInfo; + + // [optional] Available Steam information (if the user and PlayFab friend are also connected in Steam). + TSharedPtr SteamInfo; + + // [optional] Tags which have been associated with this friend. + TArray Tags; + // [optional] Title-specific display name for this friend. + FString TitleDisplayName; + + // [optional] PlayFab unique username for this friend. + FString Username; + + // [optional] Available Xbox information, if the user and PlayFab friend are both connected to Xbox Live. + TSharedPtr XboxInfo; + + FFriendInfo() : + FPlayFabBaseModel(), + CurrentMatchmakerLobbyId(), + FacebookInfo(nullptr), + FriendPlayFabId(), + GameCenterInfo(nullptr), + Profile(nullptr), + PSNInfo(nullptr), + SteamInfo(nullptr), + Tags(), + TitleDisplayName(), + Username(), + XboxInfo(nullptr) + {} + + FFriendInfo(const FFriendInfo& src) : + FPlayFabBaseModel(), + CurrentMatchmakerLobbyId(src.CurrentMatchmakerLobbyId), + FacebookInfo(src.FacebookInfo.IsValid() ? MakeShareable(new FUserFacebookInfo(*src.FacebookInfo)) : nullptr), + FriendPlayFabId(src.FriendPlayFabId), + GameCenterInfo(src.GameCenterInfo.IsValid() ? MakeShareable(new FUserGameCenterInfo(*src.GameCenterInfo)) : nullptr), + Profile(src.Profile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.Profile)) : nullptr), + PSNInfo(src.PSNInfo.IsValid() ? MakeShareable(new FUserPsnInfo(*src.PSNInfo)) : nullptr), + SteamInfo(src.SteamInfo.IsValid() ? MakeShareable(new FUserSteamInfo(*src.SteamInfo)) : nullptr), + Tags(src.Tags), + TitleDisplayName(src.TitleDisplayName), + Username(src.Username), + XboxInfo(src.XboxInfo.IsValid() ? MakeShareable(new FUserXboxInfo(*src.XboxInfo)) : nullptr) + {} + + FFriendInfo(const TSharedPtr& obj) : FFriendInfo() + { + readFromValue(obj); + } + + ~FFriendInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGameCenterPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Game Center identifier for a user. + FString GameCenterId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Game Center identifier. + FString PlayFabId; + + FGameCenterPlayFabIdPair() : + FPlayFabBaseModel(), + GameCenterId(), + PlayFabId() + {} + + FGameCenterPlayFabIdPair(const FGameCenterPlayFabIdPair& src) : + FPlayFabBaseModel(), + GameCenterId(src.GameCenterId), + PlayFabId(src.PlayFabId) + {} + + FGameCenterPlayFabIdPair(const TSharedPtr& obj) : FGameCenterPlayFabIdPair() + { + readFromValue(obj); + } + + ~FGameCenterPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGameServerRegionsRequest : public FPlayFabBaseModel + { + // version of game server for which stats are being requested + FString BuildVersion; + + /** + * [optional] Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FGameServerRegionsRequest() : + FPlayFabBaseModel(), + BuildVersion(), + TitleId() + {} + + FGameServerRegionsRequest(const FGameServerRegionsRequest& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + TitleId(src.TitleId) + {} + + FGameServerRegionsRequest(const TSharedPtr& obj) : FGameServerRegionsRequest() + { + readFromValue(obj); + } + + ~FGameServerRegionsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegionInfo : public FPlayFabBaseModel + { + // indicates whether the server specified is available in this region + bool Available; + + // [optional] name of the region + FString Name; + + // [optional] url to ping to get roundtrip time + FString PingUrl; + + // [optional] unique identifier for the region + Boxed pfRegion; + + FRegionInfo() : + FPlayFabBaseModel(), + Available(false), + Name(), + PingUrl(), + pfRegion() + {} + + FRegionInfo(const FRegionInfo& src) : + FPlayFabBaseModel(), + Available(src.Available), + Name(src.Name), + PingUrl(src.PingUrl), + pfRegion(src.pfRegion) + {} + + FRegionInfo(const TSharedPtr& obj) : FRegionInfo() + { + readFromValue(obj); + } + + ~FRegionInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGameServerRegionsResult : public FPlayFabBaseModel + { + // [optional] array of regions found matching the request parameters + TArray Regions; + FGameServerRegionsResult() : + FPlayFabBaseModel(), + Regions() + {} + + FGameServerRegionsResult(const FGameServerRegionsResult& src) : + FPlayFabBaseModel(), + Regions(src.Regions) + {} + + FGameServerRegionsResult(const TSharedPtr& obj) : FGameServerRegionsResult() + { + readFromValue(obj); + } + + ~FGameServerRegionsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGenericPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique generic service identifier for a user. + TSharedPtr GenericId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the given generic identifier. + FString PlayFabId; + + FGenericPlayFabIdPair() : + FPlayFabBaseModel(), + GenericId(nullptr), + PlayFabId() + {} + + FGenericPlayFabIdPair(const FGenericPlayFabIdPair& src) : + FPlayFabBaseModel(), + GenericId(src.GenericId.IsValid() ? MakeShareable(new FGenericServiceId(*src.GenericId)) : nullptr), + PlayFabId(src.PlayFabId) + {} + + FGenericPlayFabIdPair(const TSharedPtr& obj) : FGenericPlayFabIdPair() + { + readFromValue(obj); + } + + ~FGenericPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetAccountInfoRequest : public FPlayFabBaseModel + { + // [optional] User email address for the account to find (if no Username is specified). + FString Email; + + /** + * [optional] Unique PlayFab identifier of the user whose info is being requested. Optional, defaults to the authenticated user if no + * other lookup identifier set. + */ + FString PlayFabId; + + /** + * [optional] Title-specific username for the account to find (if no Email is set). Note that if the non-unique Title Display Names + * option is enabled for the title, attempts to look up users by Title Display Name will always return AccountNotFound. + */ + FString TitleDisplayName; + + // [optional] PlayFab Username for the account to find (if no PlayFabId is specified). + FString Username; + + FGetAccountInfoRequest() : + FPlayFabBaseModel(), + Email(), + PlayFabId(), + TitleDisplayName(), + Username() + {} + + FGetAccountInfoRequest(const FGetAccountInfoRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + PlayFabId(src.PlayFabId), + TitleDisplayName(src.TitleDisplayName), + Username(src.Username) + {} + + FGetAccountInfoRequest(const TSharedPtr& obj) : FGetAccountInfoRequest() + { + readFromValue(obj); + } + + ~FGetAccountInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserAndroidDeviceInfo : public FPlayFabBaseModel + { + // [optional] Android device ID + FString AndroidDeviceId; + + FUserAndroidDeviceInfo() : + FPlayFabBaseModel(), + AndroidDeviceId() + {} + + FUserAndroidDeviceInfo(const FUserAndroidDeviceInfo& src) : + FPlayFabBaseModel(), + AndroidDeviceId(src.AndroidDeviceId) + {} + + FUserAndroidDeviceInfo(const TSharedPtr& obj) : FUserAndroidDeviceInfo() + { + readFromValue(obj); + } + + ~FUserAndroidDeviceInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserCustomIdInfo : public FPlayFabBaseModel + { + // [optional] Custom ID + FString CustomId; + + FUserCustomIdInfo() : + FPlayFabBaseModel(), + CustomId() + {} + + FUserCustomIdInfo(const FUserCustomIdInfo& src) : + FPlayFabBaseModel(), + CustomId(src.CustomId) + {} + + FUserCustomIdInfo(const TSharedPtr& obj) : FUserCustomIdInfo() + { + readFromValue(obj); + } + + ~FUserCustomIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserFacebookInstantGamesIdInfo : public FPlayFabBaseModel + { + // [optional] Facebook Instant Games ID + FString FacebookInstantGamesId; + + FUserFacebookInstantGamesIdInfo() : + FPlayFabBaseModel(), + FacebookInstantGamesId() + {} + + FUserFacebookInstantGamesIdInfo(const FUserFacebookInstantGamesIdInfo& src) : + FPlayFabBaseModel(), + FacebookInstantGamesId(src.FacebookInstantGamesId) + {} + + FUserFacebookInstantGamesIdInfo(const TSharedPtr& obj) : FUserFacebookInstantGamesIdInfo() + { + readFromValue(obj); + } + + ~FUserFacebookInstantGamesIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserGoogleInfo : public FPlayFabBaseModel + { + // [optional] Email address of the Google account + FString GoogleEmail; + + // [optional] Gender information of the Google account + FString GoogleGender; + + // [optional] Google ID + FString GoogleId; + + // [optional] Locale of the Google account + FString GoogleLocale; + + FUserGoogleInfo() : + FPlayFabBaseModel(), + GoogleEmail(), + GoogleGender(), + GoogleId(), + GoogleLocale() + {} + + FUserGoogleInfo(const FUserGoogleInfo& src) : + FPlayFabBaseModel(), + GoogleEmail(src.GoogleEmail), + GoogleGender(src.GoogleGender), + GoogleId(src.GoogleId), + GoogleLocale(src.GoogleLocale) + {} + + FUserGoogleInfo(const TSharedPtr& obj) : FUserGoogleInfo() + { + readFromValue(obj); + } + + ~FUserGoogleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserIosDeviceInfo : public FPlayFabBaseModel + { + // [optional] iOS device ID + FString IosDeviceId; + + FUserIosDeviceInfo() : + FPlayFabBaseModel(), + IosDeviceId() + {} + + FUserIosDeviceInfo(const FUserIosDeviceInfo& src) : + FPlayFabBaseModel(), + IosDeviceId(src.IosDeviceId) + {} + + FUserIosDeviceInfo(const TSharedPtr& obj) : FUserIosDeviceInfo() + { + readFromValue(obj); + } + + ~FUserIosDeviceInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserKongregateInfo : public FPlayFabBaseModel + { + // [optional] Kongregate ID + FString KongregateId; + + // [optional] Kongregate Username + FString KongregateName; + + FUserKongregateInfo() : + FPlayFabBaseModel(), + KongregateId(), + KongregateName() + {} + + FUserKongregateInfo(const FUserKongregateInfo& src) : + FPlayFabBaseModel(), + KongregateId(src.KongregateId), + KongregateName(src.KongregateName) + {} + + FUserKongregateInfo(const TSharedPtr& obj) : FUserKongregateInfo() + { + readFromValue(obj); + } + + ~FUserKongregateInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserNintendoSwitchDeviceIdInfo : public FPlayFabBaseModel + { + // [optional] Nintendo Switch Device ID + FString NintendoSwitchDeviceId; + + FUserNintendoSwitchDeviceIdInfo() : + FPlayFabBaseModel(), + NintendoSwitchDeviceId() + {} + + FUserNintendoSwitchDeviceIdInfo(const FUserNintendoSwitchDeviceIdInfo& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId) + {} + + FUserNintendoSwitchDeviceIdInfo(const TSharedPtr& obj) : FUserNintendoSwitchDeviceIdInfo() + { + readFromValue(obj); + } + + ~FUserNintendoSwitchDeviceIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserOpenIdInfo : public FPlayFabBaseModel + { + // [optional] OpenID Connection ID + FString ConnectionId; + + // [optional] OpenID Issuer + FString Issuer; + + // [optional] OpenID Subject + FString Subject; + + FUserOpenIdInfo() : + FPlayFabBaseModel(), + ConnectionId(), + Issuer(), + Subject() + {} + + FUserOpenIdInfo(const FUserOpenIdInfo& src) : + FPlayFabBaseModel(), + ConnectionId(src.ConnectionId), + Issuer(src.Issuer), + Subject(src.Subject) + {} + + FUserOpenIdInfo(const TSharedPtr& obj) : FUserOpenIdInfo() + { + readFromValue(obj); + } + + ~FUserOpenIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserPrivateAccountInfo : public FPlayFabBaseModel + { + // [optional] user email address + FString Email; + + FUserPrivateAccountInfo() : + FPlayFabBaseModel(), + Email() + {} + + FUserPrivateAccountInfo(const FUserPrivateAccountInfo& src) : + FPlayFabBaseModel(), + Email(src.Email) + {} + + FUserPrivateAccountInfo(const TSharedPtr& obj) : FUserPrivateAccountInfo() + { + readFromValue(obj); + } + + ~FUserPrivateAccountInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum UserOrigination + { + UserOriginationOrganic, + UserOriginationSteam, + UserOriginationGoogle, + UserOriginationAmazon, + UserOriginationFacebook, + UserOriginationKongregate, + UserOriginationGamersFirst, + UserOriginationUnknown, + UserOriginationIOS, + UserOriginationLoadTest, + UserOriginationAndroid, + UserOriginationPSN, + UserOriginationGameCenter, + UserOriginationCustomId, + UserOriginationXboxLive, + UserOriginationParse, + UserOriginationTwitch, + UserOriginationWindowsHello, + UserOriginationServerCustomId, + UserOriginationNintendoSwitchDeviceId, + UserOriginationFacebookInstantGamesId, + UserOriginationOpenIdConnect + }; + + PLAYFABCPP_API void writeUserOriginationEnumJSON(UserOrigination enumVal, JsonWriter& writer); + PLAYFABCPP_API UserOrigination readUserOriginationFromValue(const TSharedPtr& value); + PLAYFABCPP_API UserOrigination readUserOriginationFromValue(const FString& value); + + struct PLAYFABCPP_API FUserTitleInfo : public FPlayFabBaseModel + { + // [optional] URL to the player's avatar. + FString AvatarUrl; + + /** + * timestamp indicating when the user was first associated with this game (this can differ significantly from when the user + * first registered with PlayFab) + */ + FDateTime Created; + + // [optional] name of the user, as it is displayed in-game + FString DisplayName; + + /** + * [optional] timestamp indicating when the user first signed into this game (this can differ from the Created timestamp, as other + * events, such as issuing a beta key to the user, can associate the title to the user) + */ + Boxed FirstLogin; + + // [optional] boolean indicating whether or not the user is currently banned for a title + Boxed isBanned; + + // [optional] timestamp for the last user login for this title + Boxed LastLogin; + + // [optional] source by which the user first joined the game, if known + Boxed Origination; + + // [optional] Title player account entity for this user + TSharedPtr TitlePlayerAccount; + + FUserTitleInfo() : + FPlayFabBaseModel(), + AvatarUrl(), + Created(0), + DisplayName(), + FirstLogin(), + isBanned(), + LastLogin(), + Origination(), + TitlePlayerAccount(nullptr) + {} + + FUserTitleInfo(const FUserTitleInfo& src) : + FPlayFabBaseModel(), + AvatarUrl(src.AvatarUrl), + Created(src.Created), + DisplayName(src.DisplayName), + FirstLogin(src.FirstLogin), + isBanned(src.isBanned), + LastLogin(src.LastLogin), + Origination(src.Origination), + TitlePlayerAccount(src.TitlePlayerAccount.IsValid() ? MakeShareable(new FEntityKey(*src.TitlePlayerAccount)) : nullptr) + {} + + FUserTitleInfo(const TSharedPtr& obj) : FUserTitleInfo() + { + readFromValue(obj); + } + + ~FUserTitleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserTwitchInfo : public FPlayFabBaseModel + { + // [optional] Twitch ID + FString TwitchId; + + // [optional] Twitch Username + FString TwitchUserName; + + FUserTwitchInfo() : + FPlayFabBaseModel(), + TwitchId(), + TwitchUserName() + {} + + FUserTwitchInfo(const FUserTwitchInfo& src) : + FPlayFabBaseModel(), + TwitchId(src.TwitchId), + TwitchUserName(src.TwitchUserName) + {} + + FUserTwitchInfo(const TSharedPtr& obj) : FUserTwitchInfo() + { + readFromValue(obj); + } + + ~FUserTwitchInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserWindowsHelloInfo : public FPlayFabBaseModel + { + // [optional] Windows Hello Device Name + FString WindowsHelloDeviceName; + + // [optional] Windows Hello Public Key Hash + FString WindowsHelloPublicKeyHash; + + FUserWindowsHelloInfo() : + FPlayFabBaseModel(), + WindowsHelloDeviceName(), + WindowsHelloPublicKeyHash() + {} + + FUserWindowsHelloInfo(const FUserWindowsHelloInfo& src) : + FPlayFabBaseModel(), + WindowsHelloDeviceName(src.WindowsHelloDeviceName), + WindowsHelloPublicKeyHash(src.WindowsHelloPublicKeyHash) + {} + + FUserWindowsHelloInfo(const TSharedPtr& obj) : FUserWindowsHelloInfo() + { + readFromValue(obj); + } + + ~FUserWindowsHelloInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserAccountInfo : public FPlayFabBaseModel + { + // [optional] User Android device information, if an Android device has been linked + TSharedPtr AndroidDeviceInfo; + + // Timestamp indicating when the user account was created + FDateTime Created; + + // [optional] Custom ID information, if a custom ID has been assigned + TSharedPtr CustomIdInfo; + + // [optional] User Facebook information, if a Facebook account has been linked + TSharedPtr FacebookInfo; + + // [optional] Facebook Instant Games account information, if a Facebook Instant Games account has been linked + TSharedPtr FacebookInstantGamesIdInfo; + + // [optional] User Gamecenter information, if a Gamecenter account has been linked + TSharedPtr GameCenterInfo; + + // [optional] User Google account information, if a Google account has been linked + TSharedPtr GoogleInfo; + + // [optional] User iOS device information, if an iOS device has been linked + TSharedPtr IosDeviceInfo; + + // [optional] User Kongregate account information, if a Kongregate account has been linked + TSharedPtr KongregateInfo; + + // [optional] Nintendo Switch account information, if a Nintendo Switch account has been linked + TSharedPtr NintendoSwitchDeviceIdInfo; + + // [optional] OpenID Connect information, if any OpenID Connect accounts have been linked + TArray OpenIdInfo; + // [optional] Unique identifier for the user account + FString PlayFabId; + + // [optional] Personal information for the user which is considered more sensitive + TSharedPtr PrivateInfo; + + // [optional] User PSN account information, if a PSN account has been linked + TSharedPtr PsnInfo; + + // [optional] User Steam information, if a Steam account has been linked + TSharedPtr SteamInfo; + + // [optional] Title-specific information for the user account + TSharedPtr TitleInfo; + + // [optional] User Twitch account information, if a Twitch account has been linked + TSharedPtr TwitchInfo; + + // [optional] User account name in the PlayFab service + FString Username; + + // [optional] Windows Hello account information, if a Windows Hello account has been linked + TSharedPtr WindowsHelloInfo; + + // [optional] User XBox account information, if a XBox account has been linked + TSharedPtr XboxInfo; + + FUserAccountInfo() : + FPlayFabBaseModel(), + AndroidDeviceInfo(nullptr), + Created(0), + CustomIdInfo(nullptr), + FacebookInfo(nullptr), + FacebookInstantGamesIdInfo(nullptr), + GameCenterInfo(nullptr), + GoogleInfo(nullptr), + IosDeviceInfo(nullptr), + KongregateInfo(nullptr), + NintendoSwitchDeviceIdInfo(nullptr), + OpenIdInfo(), + PlayFabId(), + PrivateInfo(nullptr), + PsnInfo(nullptr), + SteamInfo(nullptr), + TitleInfo(nullptr), + TwitchInfo(nullptr), + Username(), + WindowsHelloInfo(nullptr), + XboxInfo(nullptr) + {} + + FUserAccountInfo(const FUserAccountInfo& src) : + FPlayFabBaseModel(), + AndroidDeviceInfo(src.AndroidDeviceInfo.IsValid() ? MakeShareable(new FUserAndroidDeviceInfo(*src.AndroidDeviceInfo)) : nullptr), + Created(src.Created), + CustomIdInfo(src.CustomIdInfo.IsValid() ? MakeShareable(new FUserCustomIdInfo(*src.CustomIdInfo)) : nullptr), + FacebookInfo(src.FacebookInfo.IsValid() ? MakeShareable(new FUserFacebookInfo(*src.FacebookInfo)) : nullptr), + FacebookInstantGamesIdInfo(src.FacebookInstantGamesIdInfo.IsValid() ? MakeShareable(new FUserFacebookInstantGamesIdInfo(*src.FacebookInstantGamesIdInfo)) : nullptr), + GameCenterInfo(src.GameCenterInfo.IsValid() ? MakeShareable(new FUserGameCenterInfo(*src.GameCenterInfo)) : nullptr), + GoogleInfo(src.GoogleInfo.IsValid() ? MakeShareable(new FUserGoogleInfo(*src.GoogleInfo)) : nullptr), + IosDeviceInfo(src.IosDeviceInfo.IsValid() ? MakeShareable(new FUserIosDeviceInfo(*src.IosDeviceInfo)) : nullptr), + KongregateInfo(src.KongregateInfo.IsValid() ? MakeShareable(new FUserKongregateInfo(*src.KongregateInfo)) : nullptr), + NintendoSwitchDeviceIdInfo(src.NintendoSwitchDeviceIdInfo.IsValid() ? MakeShareable(new FUserNintendoSwitchDeviceIdInfo(*src.NintendoSwitchDeviceIdInfo)) : nullptr), + OpenIdInfo(src.OpenIdInfo), + PlayFabId(src.PlayFabId), + PrivateInfo(src.PrivateInfo.IsValid() ? MakeShareable(new FUserPrivateAccountInfo(*src.PrivateInfo)) : nullptr), + PsnInfo(src.PsnInfo.IsValid() ? MakeShareable(new FUserPsnInfo(*src.PsnInfo)) : nullptr), + SteamInfo(src.SteamInfo.IsValid() ? MakeShareable(new FUserSteamInfo(*src.SteamInfo)) : nullptr), + TitleInfo(src.TitleInfo.IsValid() ? MakeShareable(new FUserTitleInfo(*src.TitleInfo)) : nullptr), + TwitchInfo(src.TwitchInfo.IsValid() ? MakeShareable(new FUserTwitchInfo(*src.TwitchInfo)) : nullptr), + Username(src.Username), + WindowsHelloInfo(src.WindowsHelloInfo.IsValid() ? MakeShareable(new FUserWindowsHelloInfo(*src.WindowsHelloInfo)) : nullptr), + XboxInfo(src.XboxInfo.IsValid() ? MakeShareable(new FUserXboxInfo(*src.XboxInfo)) : nullptr) + {} + + FUserAccountInfo(const TSharedPtr& obj) : FUserAccountInfo() + { + readFromValue(obj); + } + + ~FUserAccountInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetAccountInfoResult : public FPlayFabBaseModel + { + // [optional] Account information for the local user. + TSharedPtr AccountInfo; + + FGetAccountInfoResult() : + FPlayFabBaseModel(), + AccountInfo(nullptr) + {} + + FGetAccountInfoResult(const FGetAccountInfoResult& src) : + FPlayFabBaseModel(), + AccountInfo(src.AccountInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.AccountInfo)) : nullptr) + {} + + FGetAccountInfoResult(const TSharedPtr& obj) : FGetAccountInfoResult() + { + readFromValue(obj); + } + + ~FGetAccountInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCatalogItemsRequest : public FPlayFabBaseModel + { + // [optional] Which catalog is being requested. If null, uses the default catalog. + FString CatalogVersion; + + FGetCatalogItemsRequest() : + FPlayFabBaseModel(), + CatalogVersion() + {} + + FGetCatalogItemsRequest(const FGetCatalogItemsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion) + {} + + FGetCatalogItemsRequest(const TSharedPtr& obj) : FGetCatalogItemsRequest() + { + readFromValue(obj); + } + + ~FGetCatalogItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCatalogItemsResult : public FPlayFabBaseModel + { + // [optional] Array of items which can be purchased. + TArray Catalog; + FGetCatalogItemsResult() : + FPlayFabBaseModel(), + Catalog() + {} + + FGetCatalogItemsResult(const FGetCatalogItemsResult& src) : + FPlayFabBaseModel(), + Catalog(src.Catalog) + {} + + FGetCatalogItemsResult(const TSharedPtr& obj) : FGetCatalogItemsResult() + { + readFromValue(obj); + } + + ~FGetCatalogItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterDataRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + Boxed IfChangedFromDataVersion; + + // [optional] Specific keys to search for in the custom user data. + TArray Keys; + // [optional] Unique PlayFab identifier of the user to load data for. Optional, defaults to yourself if not set. + FString PlayFabId; + + FGetCharacterDataRequest() : + FPlayFabBaseModel(), + CharacterId(), + IfChangedFromDataVersion(), + Keys(), + PlayFabId() + {} + + FGetCharacterDataRequest(const FGetCharacterDataRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + IfChangedFromDataVersion(src.IfChangedFromDataVersion), + Keys(src.Keys), + PlayFabId(src.PlayFabId) + {} + + FGetCharacterDataRequest(const TSharedPtr& obj) : FGetCharacterDataRequest() + { + readFromValue(obj); + } + + ~FGetCharacterDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum UserDataPermission + { + UserDataPermissionPrivate, + UserDataPermissionPublic + }; + + PLAYFABCPP_API void writeUserDataPermissionEnumJSON(UserDataPermission enumVal, JsonWriter& writer); + PLAYFABCPP_API UserDataPermission readUserDataPermissionFromValue(const TSharedPtr& value); + PLAYFABCPP_API UserDataPermission readUserDataPermissionFromValue(const FString& value); + + struct PLAYFABCPP_API FUserDataRecord : public FPlayFabBaseModel + { + // Timestamp for when this data was last updated. + FDateTime LastUpdated; + + /** + * [optional] Indicates whether this data can be read by all users (public) or only the user (private). This is used for GetUserData + * requests being made by one player about another player. + */ + Boxed Permission; + + // [optional] Data stored for the specified user data key. + FString Value; + + FUserDataRecord() : + FPlayFabBaseModel(), + LastUpdated(0), + Permission(), + Value() + {} + + FUserDataRecord(const FUserDataRecord& src) : + FPlayFabBaseModel(), + LastUpdated(src.LastUpdated), + Permission(src.Permission), + Value(src.Value) + {} + + FUserDataRecord(const TSharedPtr& obj) : FUserDataRecord() + { + readFromValue(obj); + } + + ~FUserDataRecord(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterDataResult : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] User specific data for this title. + TMap Data; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FGetCharacterDataResult() : + FPlayFabBaseModel(), + CharacterId(), + Data(), + DataVersion(0) + {} + + FGetCharacterDataResult(const FGetCharacterDataResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Data(src.Data), + DataVersion(src.DataVersion) + {} + + FGetCharacterDataResult(const TSharedPtr& obj) : FGetCharacterDataResult() + { + readFromValue(obj); + } + + ~FGetCharacterDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterInventoryRequest : public FPlayFabBaseModel + { + // [optional] Used to limit results to only those from a specific catalog version. + FString CatalogVersion; + + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + FGetCharacterInventoryRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId() + {} + + FGetCharacterInventoryRequest(const FGetCharacterInventoryRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId) + {} + + FGetCharacterInventoryRequest(const TSharedPtr& obj) : FGetCharacterInventoryRequest() + { + readFromValue(obj); + } + + ~FGetCharacterInventoryRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FVirtualCurrencyRechargeTime : public FPlayFabBaseModel + { + /** + * Maximum value to which the regenerating currency will automatically increment. Note that it can exceed this value + * through use of the AddUserVirtualCurrency API call. However, it will not regenerate automatically until it has fallen + * below this value. + */ + int32 RechargeMax; + + // Server timestamp in UTC indicating the next time the virtual currency will be incremented. + FDateTime RechargeTime; + + // Time remaining (in seconds) before the next recharge increment of the virtual currency. + int32 SecondsToRecharge; + + FVirtualCurrencyRechargeTime() : + FPlayFabBaseModel(), + RechargeMax(0), + RechargeTime(0), + SecondsToRecharge(0) + {} + + FVirtualCurrencyRechargeTime(const FVirtualCurrencyRechargeTime& src) : + FPlayFabBaseModel(), + RechargeMax(src.RechargeMax), + RechargeTime(src.RechargeTime), + SecondsToRecharge(src.SecondsToRecharge) + {} + + FVirtualCurrencyRechargeTime(const TSharedPtr& obj) : FVirtualCurrencyRechargeTime() + { + readFromValue(obj); + } + + ~FVirtualCurrencyRechargeTime(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterInventoryResult : public FPlayFabBaseModel + { + // [optional] Unique identifier of the character for this inventory. + FString CharacterId; + + // [optional] Array of inventory items belonging to the character. + TArray Inventory; + // [optional] Array of virtual currency balance(s) belonging to the character. + TMap VirtualCurrency; + // [optional] Array of remaining times and timestamps for virtual currencies. + TMap VirtualCurrencyRechargeTimes; + FGetCharacterInventoryResult() : + FPlayFabBaseModel(), + CharacterId(), + Inventory(), + VirtualCurrency(), + VirtualCurrencyRechargeTimes() + {} + + FGetCharacterInventoryResult(const FGetCharacterInventoryResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Inventory(src.Inventory), + VirtualCurrency(src.VirtualCurrency), + VirtualCurrencyRechargeTimes(src.VirtualCurrencyRechargeTimes) + {} + + FGetCharacterInventoryResult(const TSharedPtr& obj) : FGetCharacterInventoryResult() + { + readFromValue(obj); + } + + ~FGetCharacterInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterLeaderboardRequest : public FPlayFabBaseModel + { + // [optional] Optional character type on which to filter the leaderboard entries. + FString CharacterType; + + // [optional] Maximum number of entries to retrieve. Default 10, maximum 100. + Boxed MaxResultsCount; + + // First entry in the leaderboard to be retrieved. + int32 StartPosition; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + FGetCharacterLeaderboardRequest() : + FPlayFabBaseModel(), + CharacterType(), + MaxResultsCount(), + StartPosition(0), + StatisticName() + {} + + FGetCharacterLeaderboardRequest(const FGetCharacterLeaderboardRequest& src) : + FPlayFabBaseModel(), + CharacterType(src.CharacterType), + MaxResultsCount(src.MaxResultsCount), + StartPosition(src.StartPosition), + StatisticName(src.StatisticName) + {} + + FGetCharacterLeaderboardRequest(const TSharedPtr& obj) : FGetCharacterLeaderboardRequest() + { + readFromValue(obj); + } + + ~FGetCharacterLeaderboardRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterLeaderboardResult : public FPlayFabBaseModel + { + // [optional] Ordered list of leaderboard entries. + TArray Leaderboard; + FGetCharacterLeaderboardResult() : + FPlayFabBaseModel(), + Leaderboard() + {} + + FGetCharacterLeaderboardResult(const FGetCharacterLeaderboardResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard) + {} + + FGetCharacterLeaderboardResult(const TSharedPtr& obj) : FGetCharacterLeaderboardResult() + { + readFromValue(obj); + } + + ~FGetCharacterLeaderboardResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterStatisticsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + FGetCharacterStatisticsRequest() : + FPlayFabBaseModel(), + CharacterId() + {} + + FGetCharacterStatisticsRequest(const FGetCharacterStatisticsRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId) + {} + + FGetCharacterStatisticsRequest(const TSharedPtr& obj) : FGetCharacterStatisticsRequest() + { + readFromValue(obj); + } + + ~FGetCharacterStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterStatisticsResult : public FPlayFabBaseModel + { + // [optional] The requested character statistics. + TMap CharacterStatistics; + FGetCharacterStatisticsResult() : + FPlayFabBaseModel(), + CharacterStatistics() + {} + + FGetCharacterStatisticsResult(const FGetCharacterStatisticsResult& src) : + FPlayFabBaseModel(), + CharacterStatistics(src.CharacterStatistics) + {} + + FGetCharacterStatisticsResult(const TSharedPtr& obj) : FGetCharacterStatisticsResult() + { + readFromValue(obj); + } + + ~FGetCharacterStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentDownloadUrlRequest : public FPlayFabBaseModel + { + // [optional] HTTP method to fetch item - GET or HEAD. Use HEAD when only fetching metadata. Default is GET. + FString HttpMethod; + + // Key of the content item to fetch, usually formatted as a path, e.g. images/a.png + FString Key; + + /** + * [optional] True to download through CDN. CDN provides higher download bandwidth and lower latency. However, if you want the latest, + * non-cached version of the content during development, set this to false. Default is true. + */ + Boxed ThruCDN; + + FGetContentDownloadUrlRequest() : + FPlayFabBaseModel(), + HttpMethod(), + Key(), + ThruCDN() + {} + + FGetContentDownloadUrlRequest(const FGetContentDownloadUrlRequest& src) : + FPlayFabBaseModel(), + HttpMethod(src.HttpMethod), + Key(src.Key), + ThruCDN(src.ThruCDN) + {} + + FGetContentDownloadUrlRequest(const TSharedPtr& obj) : FGetContentDownloadUrlRequest() + { + readFromValue(obj); + } + + ~FGetContentDownloadUrlRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentDownloadUrlResult : public FPlayFabBaseModel + { + // [optional] URL for downloading content via HTTP GET or HEAD method. The URL will expire in approximately one hour. + FString URL; + + FGetContentDownloadUrlResult() : + FPlayFabBaseModel(), + URL() + {} + + FGetContentDownloadUrlResult(const FGetContentDownloadUrlResult& src) : + FPlayFabBaseModel(), + URL(src.URL) + {} + + FGetContentDownloadUrlResult(const TSharedPtr& obj) : FGetContentDownloadUrlResult() + { + readFromValue(obj); + } + + ~FGetContentDownloadUrlResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfileViewConstraints : public FPlayFabBaseModel + { + // Whether to show player's avatar URL. Defaults to false + bool ShowAvatarUrl; + + // Whether to show the banned until time. Defaults to false + bool ShowBannedUntil; + + // Whether to show campaign attributions. Defaults to false + bool ShowCampaignAttributions; + + // Whether to show contact email addresses. Defaults to false + bool ShowContactEmailAddresses; + + // Whether to show the created date. Defaults to false + bool ShowCreated; + + // Whether to show the display name. Defaults to false + bool ShowDisplayName; + + // Whether to show the last login time. Defaults to false + bool ShowLastLogin; + + // Whether to show the linked accounts. Defaults to false + bool ShowLinkedAccounts; + + // Whether to show player's locations. Defaults to false + bool ShowLocations; + + // Whether to show player's membership information. Defaults to false + bool ShowMemberships; + + // Whether to show origination. Defaults to false + bool ShowOrigination; + + // Whether to show push notification registrations. Defaults to false + bool ShowPushNotificationRegistrations; + + // Reserved for future development + bool ShowStatistics; + + // Whether to show tags. Defaults to false + bool ShowTags; + + // Whether to show the total value to date in usd. Defaults to false + bool ShowTotalValueToDateInUsd; + + // Whether to show the values to date. Defaults to false + bool ShowValuesToDate; + + FPlayerProfileViewConstraints() : + FPlayFabBaseModel(), + ShowAvatarUrl(false), + ShowBannedUntil(false), + ShowCampaignAttributions(false), + ShowContactEmailAddresses(false), + ShowCreated(false), + ShowDisplayName(false), + ShowLastLogin(false), + ShowLinkedAccounts(false), + ShowLocations(false), + ShowMemberships(false), + ShowOrigination(false), + ShowPushNotificationRegistrations(false), + ShowStatistics(false), + ShowTags(false), + ShowTotalValueToDateInUsd(false), + ShowValuesToDate(false) + {} + + FPlayerProfileViewConstraints(const FPlayerProfileViewConstraints& src) : + FPlayFabBaseModel(), + ShowAvatarUrl(src.ShowAvatarUrl), + ShowBannedUntil(src.ShowBannedUntil), + ShowCampaignAttributions(src.ShowCampaignAttributions), + ShowContactEmailAddresses(src.ShowContactEmailAddresses), + ShowCreated(src.ShowCreated), + ShowDisplayName(src.ShowDisplayName), + ShowLastLogin(src.ShowLastLogin), + ShowLinkedAccounts(src.ShowLinkedAccounts), + ShowLocations(src.ShowLocations), + ShowMemberships(src.ShowMemberships), + ShowOrigination(src.ShowOrigination), + ShowPushNotificationRegistrations(src.ShowPushNotificationRegistrations), + ShowStatistics(src.ShowStatistics), + ShowTags(src.ShowTags), + ShowTotalValueToDateInUsd(src.ShowTotalValueToDateInUsd), + ShowValuesToDate(src.ShowValuesToDate) + {} + + FPlayerProfileViewConstraints(const TSharedPtr& obj) : FPlayerProfileViewConstraints() + { + readFromValue(obj); + } + + ~FPlayerProfileViewConstraints(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendLeaderboardAroundPlayerRequest : public FPlayFabBaseModel + { + // [optional] Indicates whether Facebook friends should be included in the response. Default is true. + Boxed IncludeFacebookFriends; + + // [optional] Indicates whether Steam service friends should be included in the response. Default is true. + Boxed IncludeSteamFriends; + + // [optional] Maximum number of entries to retrieve. Default 10, maximum 100. + Boxed MaxResultsCount; + + // [optional] PlayFab unique identifier of the user to center the leaderboard around. If null will center on the logged in user. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // Statistic used to rank players for this leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + // [optional] Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. + FString XboxToken; + + FGetFriendLeaderboardAroundPlayerRequest() : + FPlayFabBaseModel(), + IncludeFacebookFriends(), + IncludeSteamFriends(), + MaxResultsCount(), + PlayFabId(), + ProfileConstraints(nullptr), + StatisticName(), + UseSpecificVersion(), + Version(), + XboxToken() + {} + + FGetFriendLeaderboardAroundPlayerRequest(const FGetFriendLeaderboardAroundPlayerRequest& src) : + FPlayFabBaseModel(), + IncludeFacebookFriends(src.IncludeFacebookFriends), + IncludeSteamFriends(src.IncludeSteamFriends), + MaxResultsCount(src.MaxResultsCount), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version), + XboxToken(src.XboxToken) + {} + + FGetFriendLeaderboardAroundPlayerRequest(const TSharedPtr& obj) : FGetFriendLeaderboardAroundPlayerRequest() + { + readFromValue(obj); + } + + ~FGetFriendLeaderboardAroundPlayerRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLeaderboardEntry : public FPlayFabBaseModel + { + // [optional] Title-specific display name of the user for this leaderboard entry. + FString DisplayName; + + // [optional] PlayFab unique identifier of the user for this leaderboard entry. + FString PlayFabId; + + // User's overall position in the leaderboard. + int32 Position; + + // [optional] The profile of the user, if requested. + TSharedPtr Profile; + + // Specific value of the user's statistic. + int32 StatValue; + + FPlayerLeaderboardEntry() : + FPlayFabBaseModel(), + DisplayName(), + PlayFabId(), + Position(0), + Profile(nullptr), + StatValue(0) + {} + + FPlayerLeaderboardEntry(const FPlayerLeaderboardEntry& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName), + PlayFabId(src.PlayFabId), + Position(src.Position), + Profile(src.Profile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.Profile)) : nullptr), + StatValue(src.StatValue) + {} + + FPlayerLeaderboardEntry(const TSharedPtr& obj) : FPlayerLeaderboardEntry() + { + readFromValue(obj); + } + + ~FPlayerLeaderboardEntry(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendLeaderboardAroundPlayerResult : public FPlayFabBaseModel + { + // [optional] Ordered listing of users and their positions in the requested leaderboard. + TArray Leaderboard; + // [optional] The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. + Boxed NextReset; + + // The version of the leaderboard returned. + int32 Version; + + FGetFriendLeaderboardAroundPlayerResult() : + FPlayFabBaseModel(), + Leaderboard(), + NextReset(), + Version(0) + {} + + FGetFriendLeaderboardAroundPlayerResult(const FGetFriendLeaderboardAroundPlayerResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard), + NextReset(src.NextReset), + Version(src.Version) + {} + + FGetFriendLeaderboardAroundPlayerResult(const TSharedPtr& obj) : FGetFriendLeaderboardAroundPlayerResult() + { + readFromValue(obj); + } + + ~FGetFriendLeaderboardAroundPlayerResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendLeaderboardRequest : public FPlayFabBaseModel + { + // [optional] Indicates whether Facebook friends should be included in the response. Default is true. + Boxed IncludeFacebookFriends; + + // [optional] Indicates whether Steam service friends should be included in the response. Default is true. + Boxed IncludeSteamFriends; + + // [optional] Maximum number of entries to retrieve. Default 10, maximum 100. + Boxed MaxResultsCount; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // Position in the leaderboard to start this listing (defaults to the first entry). + int32 StartPosition; + + // Statistic used to rank friends for this leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + // [optional] Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. + FString XboxToken; + + FGetFriendLeaderboardRequest() : + FPlayFabBaseModel(), + IncludeFacebookFriends(), + IncludeSteamFriends(), + MaxResultsCount(), + ProfileConstraints(nullptr), + StartPosition(0), + StatisticName(), + UseSpecificVersion(), + Version(), + XboxToken() + {} + + FGetFriendLeaderboardRequest(const FGetFriendLeaderboardRequest& src) : + FPlayFabBaseModel(), + IncludeFacebookFriends(src.IncludeFacebookFriends), + IncludeSteamFriends(src.IncludeSteamFriends), + MaxResultsCount(src.MaxResultsCount), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StartPosition(src.StartPosition), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version), + XboxToken(src.XboxToken) + {} + + FGetFriendLeaderboardRequest(const TSharedPtr& obj) : FGetFriendLeaderboardRequest() + { + readFromValue(obj); + } + + ~FGetFriendLeaderboardRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendsListRequest : public FPlayFabBaseModel + { + // [optional] Indicates whether Facebook friends should be included in the response. Default is true. + Boxed IncludeFacebookFriends; + + // [optional] Indicates whether Steam service friends should be included in the response. Default is true. + Boxed IncludeSteamFriends; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // [optional] Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. + FString XboxToken; + + FGetFriendsListRequest() : + FPlayFabBaseModel(), + IncludeFacebookFriends(), + IncludeSteamFriends(), + ProfileConstraints(nullptr), + XboxToken() + {} + + FGetFriendsListRequest(const FGetFriendsListRequest& src) : + FPlayFabBaseModel(), + IncludeFacebookFriends(src.IncludeFacebookFriends), + IncludeSteamFriends(src.IncludeSteamFriends), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + XboxToken(src.XboxToken) + {} + + FGetFriendsListRequest(const TSharedPtr& obj) : FGetFriendsListRequest() + { + readFromValue(obj); + } + + ~FGetFriendsListRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendsListResult : public FPlayFabBaseModel + { + // [optional] Array of friends found. + TArray Friends; + FGetFriendsListResult() : + FPlayFabBaseModel(), + Friends() + {} + + FGetFriendsListResult(const FGetFriendsListResult& src) : + FPlayFabBaseModel(), + Friends(src.Friends) + {} + + FGetFriendsListResult(const TSharedPtr& obj) : FGetFriendsListResult() + { + readFromValue(obj); + } + + ~FGetFriendsListResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundCharacterRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character on which to center the leaderboard. + FString CharacterId; + + // [optional] Optional character type on which to filter the leaderboard entries. + FString CharacterType; + + // [optional] Maximum number of entries to retrieve. Default 10, maximum 100. + Boxed MaxResultsCount; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + FGetLeaderboardAroundCharacterRequest() : + FPlayFabBaseModel(), + CharacterId(), + CharacterType(), + MaxResultsCount(), + StatisticName() + {} + + FGetLeaderboardAroundCharacterRequest(const FGetLeaderboardAroundCharacterRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterType(src.CharacterType), + MaxResultsCount(src.MaxResultsCount), + StatisticName(src.StatisticName) + {} + + FGetLeaderboardAroundCharacterRequest(const TSharedPtr& obj) : FGetLeaderboardAroundCharacterRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundCharacterRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundCharacterResult : public FPlayFabBaseModel + { + // [optional] Ordered list of leaderboard entries. + TArray Leaderboard; + FGetLeaderboardAroundCharacterResult() : + FPlayFabBaseModel(), + Leaderboard() + {} + + FGetLeaderboardAroundCharacterResult(const FGetLeaderboardAroundCharacterResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard) + {} + + FGetLeaderboardAroundCharacterResult(const TSharedPtr& obj) : FGetLeaderboardAroundCharacterResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundPlayerRequest : public FPlayFabBaseModel + { + // [optional] Maximum number of entries to retrieve. Default 10, maximum 100. + Boxed MaxResultsCount; + + // [optional] PlayFab unique identifier of the user to center the leaderboard around. If null will center on the logged in user. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // Statistic used to rank players for this leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + FGetLeaderboardAroundPlayerRequest() : + FPlayFabBaseModel(), + MaxResultsCount(), + PlayFabId(), + ProfileConstraints(nullptr), + StatisticName(), + UseSpecificVersion(), + Version() + {} + + FGetLeaderboardAroundPlayerRequest(const FGetLeaderboardAroundPlayerRequest& src) : + FPlayFabBaseModel(), + MaxResultsCount(src.MaxResultsCount), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version) + {} + + FGetLeaderboardAroundPlayerRequest(const TSharedPtr& obj) : FGetLeaderboardAroundPlayerRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundPlayerRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundPlayerResult : public FPlayFabBaseModel + { + // [optional] Ordered listing of users and their positions in the requested leaderboard. + TArray Leaderboard; + // [optional] The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. + Boxed NextReset; + + // The version of the leaderboard returned. + int32 Version; + + FGetLeaderboardAroundPlayerResult() : + FPlayFabBaseModel(), + Leaderboard(), + NextReset(), + Version(0) + {} + + FGetLeaderboardAroundPlayerResult(const FGetLeaderboardAroundPlayerResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard), + NextReset(src.NextReset), + Version(src.Version) + {} + + FGetLeaderboardAroundPlayerResult(const TSharedPtr& obj) : FGetLeaderboardAroundPlayerResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundPlayerResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardForUsersCharactersRequest : public FPlayFabBaseModel + { + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + FGetLeaderboardForUsersCharactersRequest() : + FPlayFabBaseModel(), + MaxResultsCount(0), + StatisticName() + {} + + FGetLeaderboardForUsersCharactersRequest(const FGetLeaderboardForUsersCharactersRequest& src) : + FPlayFabBaseModel(), + MaxResultsCount(src.MaxResultsCount), + StatisticName(src.StatisticName) + {} + + FGetLeaderboardForUsersCharactersRequest(const TSharedPtr& obj) : FGetLeaderboardForUsersCharactersRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardForUsersCharactersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardForUsersCharactersResult : public FPlayFabBaseModel + { + // [optional] Ordered list of leaderboard entries. + TArray Leaderboard; + FGetLeaderboardForUsersCharactersResult() : + FPlayFabBaseModel(), + Leaderboard() + {} + + FGetLeaderboardForUsersCharactersResult(const FGetLeaderboardForUsersCharactersResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard) + {} + + FGetLeaderboardForUsersCharactersResult(const TSharedPtr& obj) : FGetLeaderboardForUsersCharactersResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardForUsersCharactersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardRequest : public FPlayFabBaseModel + { + // [optional] Maximum number of entries to retrieve. Default 10, maximum 100. + Boxed MaxResultsCount; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // Position in the leaderboard to start this listing (defaults to the first entry). + int32 StartPosition; + + // Statistic used to rank players for this leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + FGetLeaderboardRequest() : + FPlayFabBaseModel(), + MaxResultsCount(), + ProfileConstraints(nullptr), + StartPosition(0), + StatisticName(), + UseSpecificVersion(), + Version() + {} + + FGetLeaderboardRequest(const FGetLeaderboardRequest& src) : + FPlayFabBaseModel(), + MaxResultsCount(src.MaxResultsCount), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StartPosition(src.StartPosition), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version) + {} + + FGetLeaderboardRequest(const TSharedPtr& obj) : FGetLeaderboardRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardResult : public FPlayFabBaseModel + { + // [optional] Ordered listing of users and their positions in the requested leaderboard. + TArray Leaderboard; + // [optional] The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. + Boxed NextReset; + + // The version of the leaderboard returned. + int32 Version; + + FGetLeaderboardResult() : + FPlayFabBaseModel(), + Leaderboard(), + NextReset(), + Version(0) + {} + + FGetLeaderboardResult(const FGetLeaderboardResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard), + NextReset(src.NextReset), + Version(src.Version) + {} + + FGetLeaderboardResult(const TSharedPtr& obj) : FGetLeaderboardResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPaymentTokenRequest : public FPlayFabBaseModel + { + // The name of service to provide the payment token. Allowed Values are: xsolla + FString TokenProvider; + + FGetPaymentTokenRequest() : + FPlayFabBaseModel(), + TokenProvider() + {} + + FGetPaymentTokenRequest(const FGetPaymentTokenRequest& src) : + FPlayFabBaseModel(), + TokenProvider(src.TokenProvider) + {} + + FGetPaymentTokenRequest(const TSharedPtr& obj) : FGetPaymentTokenRequest() + { + readFromValue(obj); + } + + ~FGetPaymentTokenRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPaymentTokenResult : public FPlayFabBaseModel + { + // [optional] PlayFab's purchase order identifier. + FString OrderId; + + // [optional] The token from provider. + FString ProviderToken; + + FGetPaymentTokenResult() : + FPlayFabBaseModel(), + OrderId(), + ProviderToken() + {} + + FGetPaymentTokenResult(const FGetPaymentTokenResult& src) : + FPlayFabBaseModel(), + OrderId(src.OrderId), + ProviderToken(src.ProviderToken) + {} + + FGetPaymentTokenResult(const TSharedPtr& obj) : FGetPaymentTokenResult() + { + readFromValue(obj); + } + + ~FGetPaymentTokenResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPhotonAuthenticationTokenRequest : public FPlayFabBaseModel + { + // The Photon applicationId for the game you wish to log into. + FString PhotonApplicationId; + + FGetPhotonAuthenticationTokenRequest() : + FPlayFabBaseModel(), + PhotonApplicationId() + {} + + FGetPhotonAuthenticationTokenRequest(const FGetPhotonAuthenticationTokenRequest& src) : + FPlayFabBaseModel(), + PhotonApplicationId(src.PhotonApplicationId) + {} + + FGetPhotonAuthenticationTokenRequest(const TSharedPtr& obj) : FGetPhotonAuthenticationTokenRequest() + { + readFromValue(obj); + } + + ~FGetPhotonAuthenticationTokenRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPhotonAuthenticationTokenResult : public FPlayFabBaseModel + { + // [optional] The Photon authentication token for this game-session. + FString PhotonCustomAuthenticationToken; + + FGetPhotonAuthenticationTokenResult() : + FPlayFabBaseModel(), + PhotonCustomAuthenticationToken() + {} + + FGetPhotonAuthenticationTokenResult(const FGetPhotonAuthenticationTokenResult& src) : + FPlayFabBaseModel(), + PhotonCustomAuthenticationToken(src.PhotonCustomAuthenticationToken) + {} + + FGetPhotonAuthenticationTokenResult(const TSharedPtr& obj) : FGetPhotonAuthenticationTokenResult() + { + readFromValue(obj); + } + + ~FGetPhotonAuthenticationTokenResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoRequestParams : public FPlayFabBaseModel + { + // Whether to get character inventories. Defaults to false. + bool GetCharacterInventories; + + // Whether to get the list of characters. Defaults to false. + bool GetCharacterList; + + // Whether to get player profile. Defaults to false. + bool GetPlayerProfile; + + // Whether to get player statistics. Defaults to false. + bool GetPlayerStatistics; + + // Whether to get title data. Defaults to false. + bool GetTitleData; + + // Whether to get the player's account Info. Defaults to false + bool GetUserAccountInfo; + + // Whether to get the player's custom data. Defaults to false + bool GetUserData; + + // Whether to get the player's inventory. Defaults to false + bool GetUserInventory; + + // Whether to get the player's read only data. Defaults to false + bool GetUserReadOnlyData; + + // Whether to get the player's virtual currency balances. Defaults to false + bool GetUserVirtualCurrency; + + // [optional] Specific statistics to retrieve. Leave null to get all keys. Has no effect if GetPlayerStatistics is false + TArray PlayerStatisticNames; + // [optional] Specifies the properties to return from the player profile. Defaults to returning the player's display name. + TSharedPtr ProfileConstraints; + + // [optional] Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetTitleData is false + TArray TitleDataKeys; + // [optional] Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetUserData is false + TArray UserDataKeys; + /** + * [optional] Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetUserReadOnlyData is + * false + */ + TArray UserReadOnlyDataKeys; + FGetPlayerCombinedInfoRequestParams() : + FPlayFabBaseModel(), + GetCharacterInventories(false), + GetCharacterList(false), + GetPlayerProfile(false), + GetPlayerStatistics(false), + GetTitleData(false), + GetUserAccountInfo(false), + GetUserData(false), + GetUserInventory(false), + GetUserReadOnlyData(false), + GetUserVirtualCurrency(false), + PlayerStatisticNames(), + ProfileConstraints(nullptr), + TitleDataKeys(), + UserDataKeys(), + UserReadOnlyDataKeys() + {} + + FGetPlayerCombinedInfoRequestParams(const FGetPlayerCombinedInfoRequestParams& src) : + FPlayFabBaseModel(), + GetCharacterInventories(src.GetCharacterInventories), + GetCharacterList(src.GetCharacterList), + GetPlayerProfile(src.GetPlayerProfile), + GetPlayerStatistics(src.GetPlayerStatistics), + GetTitleData(src.GetTitleData), + GetUserAccountInfo(src.GetUserAccountInfo), + GetUserData(src.GetUserData), + GetUserInventory(src.GetUserInventory), + GetUserReadOnlyData(src.GetUserReadOnlyData), + GetUserVirtualCurrency(src.GetUserVirtualCurrency), + PlayerStatisticNames(src.PlayerStatisticNames), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + TitleDataKeys(src.TitleDataKeys), + UserDataKeys(src.UserDataKeys), + UserReadOnlyDataKeys(src.UserReadOnlyDataKeys) + {} + + FGetPlayerCombinedInfoRequestParams(const TSharedPtr& obj) : FGetPlayerCombinedInfoRequestParams() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoRequestParams(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoRequest : public FPlayFabBaseModel + { + // Flags for which pieces of info to return for the user. + FGetPlayerCombinedInfoRequestParams InfoRequestParameters; + + // [optional] PlayFabId of the user whose data will be returned. If not filled included, we return the data for the calling player. + FString PlayFabId; + + FGetPlayerCombinedInfoRequest() : + FPlayFabBaseModel(), + InfoRequestParameters(), + PlayFabId() + {} + + FGetPlayerCombinedInfoRequest(const FGetPlayerCombinedInfoRequest& src) : + FPlayFabBaseModel(), + InfoRequestParameters(src.InfoRequestParameters), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerCombinedInfoRequest(const TSharedPtr& obj) : FGetPlayerCombinedInfoRequest() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticValue : public FPlayFabBaseModel + { + // [optional] unique name of the statistic + FString StatisticName; + + // statistic value for the player + int32 Value; + + // for updates to an existing statistic value for a player, the version of the statistic when it was loaded + uint32 Version; + + FStatisticValue() : + FPlayFabBaseModel(), + StatisticName(), + Value(0), + Version(0) + {} + + FStatisticValue(const FStatisticValue& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName), + Value(src.Value), + Version(src.Version) + {} + + FStatisticValue(const TSharedPtr& obj) : FStatisticValue() + { + readFromValue(obj); + } + + ~FStatisticValue(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoResultPayload : public FPlayFabBaseModel + { + // [optional] Account information for the user. This is always retrieved. + TSharedPtr AccountInfo; + + // [optional] Inventories for each character for the user. + TArray CharacterInventories; + // [optional] List of characters for the user. + TArray CharacterList; + /** + * [optional] The profile of the players. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + TSharedPtr PlayerProfile; + + // [optional] List of statistics for this player. + TArray PlayerStatistics; + // [optional] Title data for this title. + TMap TitleData; + // [optional] User specific custom data. + TMap UserData; + // The version of the UserData that was returned. + uint32 UserDataVersion; + + // [optional] Array of inventory items in the user's current inventory. + TArray UserInventory; + // [optional] User specific read-only data. + TMap UserReadOnlyData; + // The version of the Read-Only UserData that was returned. + uint32 UserReadOnlyDataVersion; + + // [optional] Dictionary of virtual currency balance(s) belonging to the user. + TMap UserVirtualCurrency; + // [optional] Dictionary of remaining times and timestamps for virtual currencies. + TMap UserVirtualCurrencyRechargeTimes; + FGetPlayerCombinedInfoResultPayload() : + FPlayFabBaseModel(), + AccountInfo(nullptr), + CharacterInventories(), + CharacterList(), + PlayerProfile(nullptr), + PlayerStatistics(), + TitleData(), + UserData(), + UserDataVersion(0), + UserInventory(), + UserReadOnlyData(), + UserReadOnlyDataVersion(0), + UserVirtualCurrency(), + UserVirtualCurrencyRechargeTimes() + {} + + FGetPlayerCombinedInfoResultPayload(const FGetPlayerCombinedInfoResultPayload& src) : + FPlayFabBaseModel(), + AccountInfo(src.AccountInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.AccountInfo)) : nullptr), + CharacterInventories(src.CharacterInventories), + CharacterList(src.CharacterList), + PlayerProfile(src.PlayerProfile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.PlayerProfile)) : nullptr), + PlayerStatistics(src.PlayerStatistics), + TitleData(src.TitleData), + UserData(src.UserData), + UserDataVersion(src.UserDataVersion), + UserInventory(src.UserInventory), + UserReadOnlyData(src.UserReadOnlyData), + UserReadOnlyDataVersion(src.UserReadOnlyDataVersion), + UserVirtualCurrency(src.UserVirtualCurrency), + UserVirtualCurrencyRechargeTimes(src.UserVirtualCurrencyRechargeTimes) + {} + + FGetPlayerCombinedInfoResultPayload(const TSharedPtr& obj) : FGetPlayerCombinedInfoResultPayload() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoResultPayload(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoResult : public FPlayFabBaseModel + { + // [optional] Results for requested info. + TSharedPtr InfoResultPayload; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayerCombinedInfoResult() : + FPlayFabBaseModel(), + InfoResultPayload(nullptr), + PlayFabId() + {} + + FGetPlayerCombinedInfoResult(const FGetPlayerCombinedInfoResult& src) : + FPlayFabBaseModel(), + InfoResultPayload(src.InfoResultPayload.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoResultPayload(*src.InfoResultPayload)) : nullptr), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerCombinedInfoResult(const TSharedPtr& obj) : FGetPlayerCombinedInfoResult() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerProfileRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + FGetPlayerProfileRequest() : + FPlayFabBaseModel(), + PlayFabId(), + ProfileConstraints(nullptr) + {} + + FGetPlayerProfileRequest(const FGetPlayerProfileRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr) + {} + + FGetPlayerProfileRequest(const TSharedPtr& obj) : FGetPlayerProfileRequest() + { + readFromValue(obj); + } + + ~FGetPlayerProfileRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerProfileResult : public FPlayFabBaseModel + { + /** + * [optional] The profile of the player. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + TSharedPtr PlayerProfile; + + FGetPlayerProfileResult() : + FPlayFabBaseModel(), + PlayerProfile(nullptr) + {} + + FGetPlayerProfileResult(const FGetPlayerProfileResult& src) : + FPlayFabBaseModel(), + PlayerProfile(src.PlayerProfile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.PlayerProfile)) : nullptr) + {} + + FGetPlayerProfileResult(const TSharedPtr& obj) : FGetPlayerProfileResult() + { + readFromValue(obj); + } + + ~FGetPlayerProfileResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerSegmentsRequest : public FPlayFabBaseModel + { + FGetPlayerSegmentsRequest() : + FPlayFabBaseModel() + {} + + FGetPlayerSegmentsRequest(const FGetPlayerSegmentsRequest& src) : + FPlayFabBaseModel() + {} + + FGetPlayerSegmentsRequest(const TSharedPtr& obj) : FGetPlayerSegmentsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerSegmentsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSegmentResult : public FPlayFabBaseModel + { + // [optional] Identifier of the segments AB Test, if it is attached to one. + FString ABTestParent; + + // Unique identifier for this segment. + FString Id; + + // [optional] Segment name. + FString Name; + + FGetSegmentResult() : + FPlayFabBaseModel(), + ABTestParent(), + Id(), + Name() + {} + + FGetSegmentResult(const FGetSegmentResult& src) : + FPlayFabBaseModel(), + ABTestParent(src.ABTestParent), + Id(src.Id), + Name(src.Name) + {} + + FGetSegmentResult(const TSharedPtr& obj) : FGetSegmentResult() + { + readFromValue(obj); + } + + ~FGetSegmentResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerSegmentsResult : public FPlayFabBaseModel + { + // [optional] Array of segments the requested player currently belongs to. + TArray Segments; + FGetPlayerSegmentsResult() : + FPlayFabBaseModel(), + Segments() + {} + + FGetPlayerSegmentsResult(const FGetPlayerSegmentsResult& src) : + FPlayFabBaseModel(), + Segments(src.Segments) + {} + + FGetPlayerSegmentsResult(const TSharedPtr& obj) : FGetPlayerSegmentsResult() + { + readFromValue(obj); + } + + ~FGetPlayerSegmentsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticNameVersion : public FPlayFabBaseModel + { + // unique name of the statistic + FString StatisticName; + + // the version of the statistic to be returned + uint32 Version; + + FStatisticNameVersion() : + FPlayFabBaseModel(), + StatisticName(), + Version(0) + {} + + FStatisticNameVersion(const FStatisticNameVersion& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName), + Version(src.Version) + {} + + FStatisticNameVersion(const TSharedPtr& obj) : FStatisticNameVersion() + { + readFromValue(obj); + } + + ~FStatisticNameVersion(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticsRequest : public FPlayFabBaseModel + { + // [optional] statistics to return (current version will be returned for each) + TArray StatisticNames; + /** + * [optional] statistics to return, if StatisticNames is not set (only statistics which have a version matching that provided will be + * returned) + */ + TArray StatisticNameVersions; + FGetPlayerStatisticsRequest() : + FPlayFabBaseModel(), + StatisticNames(), + StatisticNameVersions() + {} + + FGetPlayerStatisticsRequest(const FGetPlayerStatisticsRequest& src) : + FPlayFabBaseModel(), + StatisticNames(src.StatisticNames), + StatisticNameVersions(src.StatisticNameVersions) + {} + + FGetPlayerStatisticsRequest(const TSharedPtr& obj) : FGetPlayerStatisticsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticsResult : public FPlayFabBaseModel + { + // [optional] User statistics for the requested user. + TArray Statistics; + FGetPlayerStatisticsResult() : + FPlayFabBaseModel(), + Statistics() + {} + + FGetPlayerStatisticsResult(const FGetPlayerStatisticsResult& src) : + FPlayFabBaseModel(), + Statistics(src.Statistics) + {} + + FGetPlayerStatisticsResult(const TSharedPtr& obj) : FGetPlayerStatisticsResult() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticVersionsRequest : public FPlayFabBaseModel + { + // [optional] unique name of the statistic + FString StatisticName; + + FGetPlayerStatisticVersionsRequest() : + FPlayFabBaseModel(), + StatisticName() + {} + + FGetPlayerStatisticVersionsRequest(const FGetPlayerStatisticVersionsRequest& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName) + {} + + FGetPlayerStatisticVersionsRequest(const TSharedPtr& obj) : FGetPlayerStatisticVersionsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticVersionsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerStatisticVersion : public FPlayFabBaseModel + { + // time when the statistic version became active + FDateTime ActivationTime; + + // [optional] time when the statistic version became inactive due to statistic version incrementing + Boxed DeactivationTime; + + // [optional] time at which the statistic version was scheduled to become active, based on the configured ResetInterval + Boxed ScheduledActivationTime; + + // [optional] time at which the statistic version was scheduled to become inactive, based on the configured ResetInterval + Boxed ScheduledDeactivationTime; + + // [optional] name of the statistic when the version became active + FString StatisticName; + + // version of the statistic + uint32 Version; + + FPlayerStatisticVersion() : + FPlayFabBaseModel(), + ActivationTime(0), + DeactivationTime(), + ScheduledActivationTime(), + ScheduledDeactivationTime(), + StatisticName(), + Version(0) + {} + + FPlayerStatisticVersion(const FPlayerStatisticVersion& src) : + FPlayFabBaseModel(), + ActivationTime(src.ActivationTime), + DeactivationTime(src.DeactivationTime), + ScheduledActivationTime(src.ScheduledActivationTime), + ScheduledDeactivationTime(src.ScheduledDeactivationTime), + StatisticName(src.StatisticName), + Version(src.Version) + {} + + FPlayerStatisticVersion(const TSharedPtr& obj) : FPlayerStatisticVersion() + { + readFromValue(obj); + } + + ~FPlayerStatisticVersion(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticVersionsResult : public FPlayFabBaseModel + { + // [optional] version change history of the statistic + TArray StatisticVersions; + FGetPlayerStatisticVersionsResult() : + FPlayFabBaseModel(), + StatisticVersions() + {} + + FGetPlayerStatisticVersionsResult(const FGetPlayerStatisticVersionsResult& src) : + FPlayFabBaseModel(), + StatisticVersions(src.StatisticVersions) + {} + + FGetPlayerStatisticVersionsResult(const TSharedPtr& obj) : FGetPlayerStatisticVersionsResult() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticVersionsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTagsRequest : public FPlayFabBaseModel + { + // [optional] Optional namespace to filter results by + FString Namespace; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayerTagsRequest() : + FPlayFabBaseModel(), + Namespace(), + PlayFabId() + {} + + FGetPlayerTagsRequest(const FGetPlayerTagsRequest& src) : + FPlayFabBaseModel(), + Namespace(src.Namespace), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerTagsRequest(const TSharedPtr& obj) : FGetPlayerTagsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerTagsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTagsResult : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Canonical tags (including namespace and tag's name) for the requested user + TArray Tags; + FGetPlayerTagsResult() : + FPlayFabBaseModel(), + PlayFabId(), + Tags() + {} + + FGetPlayerTagsResult(const FGetPlayerTagsResult& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + Tags(src.Tags) + {} + + FGetPlayerTagsResult(const TSharedPtr& obj) : FGetPlayerTagsResult() + { + readFromValue(obj); + } + + ~FGetPlayerTagsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTradesRequest : public FPlayFabBaseModel + { + // [optional] Returns only trades with the given status. If null, returns all trades. + Boxed StatusFilter; + + FGetPlayerTradesRequest() : + FPlayFabBaseModel(), + StatusFilter() + {} + + FGetPlayerTradesRequest(const FGetPlayerTradesRequest& src) : + FPlayFabBaseModel(), + StatusFilter(src.StatusFilter) + {} + + FGetPlayerTradesRequest(const TSharedPtr& obj) : FGetPlayerTradesRequest() + { + readFromValue(obj); + } + + ~FGetPlayerTradesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTradesResponse : public FPlayFabBaseModel + { + // [optional] History of trades which this player has accepted. + TArray AcceptedTrades; + // [optional] The trades for this player which are currently available to be accepted. + TArray OpenedTrades; + FGetPlayerTradesResponse() : + FPlayFabBaseModel(), + AcceptedTrades(), + OpenedTrades() + {} + + FGetPlayerTradesResponse(const FGetPlayerTradesResponse& src) : + FPlayFabBaseModel(), + AcceptedTrades(src.AcceptedTrades), + OpenedTrades(src.OpenedTrades) + {} + + FGetPlayerTradesResponse(const TSharedPtr& obj) : FGetPlayerTradesResponse() + { + readFromValue(obj); + } + + ~FGetPlayerTradesResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookIDsRequest : public FPlayFabBaseModel + { + // Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. + TArray FacebookIDs; + FGetPlayFabIDsFromFacebookIDsRequest() : + FPlayFabBaseModel(), + FacebookIDs() + {} + + FGetPlayFabIDsFromFacebookIDsRequest(const FGetPlayFabIDsFromFacebookIDsRequest& src) : + FPlayFabBaseModel(), + FacebookIDs(src.FacebookIDs) + {} + + FGetPlayFabIDsFromFacebookIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Facebook identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromFacebookIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromFacebookIDsResult(const FGetPlayFabIDsFromFacebookIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromFacebookIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookInstantGamesIdsRequest : public FPlayFabBaseModel + { + // Array of unique Facebook Instant Games identifiers for which the title needs to get PlayFab identifiers. + TArray FacebookInstantGamesIds; + FGetPlayFabIDsFromFacebookInstantGamesIdsRequest() : + FPlayFabBaseModel(), + FacebookInstantGamesIds() + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsRequest(const FGetPlayFabIDsFromFacebookInstantGamesIdsRequest& src) : + FPlayFabBaseModel(), + FacebookInstantGamesIds(src.FacebookInstantGamesIds) + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookInstantGamesIdsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookInstantGamesIdsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookInstantGamesIdsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Facebook Instant Games identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromFacebookInstantGamesIdsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsResult(const FGetPlayFabIDsFromFacebookInstantGamesIdsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookInstantGamesIdsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookInstantGamesIdsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromGameCenterIDsRequest : public FPlayFabBaseModel + { + // Array of unique Game Center identifiers (the Player Identifier) for which the title needs to get PlayFab identifiers. + TArray GameCenterIDs; + FGetPlayFabIDsFromGameCenterIDsRequest() : + FPlayFabBaseModel(), + GameCenterIDs() + {} + + FGetPlayFabIDsFromGameCenterIDsRequest(const FGetPlayFabIDsFromGameCenterIDsRequest& src) : + FPlayFabBaseModel(), + GameCenterIDs(src.GameCenterIDs) + {} + + FGetPlayFabIDsFromGameCenterIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromGameCenterIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromGameCenterIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromGameCenterIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Game Center identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromGameCenterIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromGameCenterIDsResult(const FGetPlayFabIDsFromGameCenterIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromGameCenterIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromGameCenterIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromGameCenterIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromGenericIDsRequest : public FPlayFabBaseModel + { + /** + * Array of unique generic service identifiers for which the title needs to get PlayFab identifiers. Currently limited to a + * maximum of 10 in a single request. + */ + TArray GenericIDs; + FGetPlayFabIDsFromGenericIDsRequest() : + FPlayFabBaseModel(), + GenericIDs() + {} + + FGetPlayFabIDsFromGenericIDsRequest(const FGetPlayFabIDsFromGenericIDsRequest& src) : + FPlayFabBaseModel(), + GenericIDs(src.GenericIDs) + {} + + FGetPlayFabIDsFromGenericIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromGenericIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromGenericIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromGenericIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of generic service identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromGenericIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromGenericIDsResult(const FGetPlayFabIDsFromGenericIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromGenericIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromGenericIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromGenericIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromGoogleIDsRequest : public FPlayFabBaseModel + { + // Array of unique Google identifiers (Google+ user IDs) for which the title needs to get PlayFab identifiers. + TArray GoogleIDs; + FGetPlayFabIDsFromGoogleIDsRequest() : + FPlayFabBaseModel(), + GoogleIDs() + {} + + FGetPlayFabIDsFromGoogleIDsRequest(const FGetPlayFabIDsFromGoogleIDsRequest& src) : + FPlayFabBaseModel(), + GoogleIDs(src.GoogleIDs) + {} + + FGetPlayFabIDsFromGoogleIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromGoogleIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromGoogleIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGooglePlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Google identifier for a user. + FString GoogleId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Google identifier. + FString PlayFabId; + + FGooglePlayFabIdPair() : + FPlayFabBaseModel(), + GoogleId(), + PlayFabId() + {} + + FGooglePlayFabIdPair(const FGooglePlayFabIdPair& src) : + FPlayFabBaseModel(), + GoogleId(src.GoogleId), + PlayFabId(src.PlayFabId) + {} + + FGooglePlayFabIdPair(const TSharedPtr& obj) : FGooglePlayFabIdPair() + { + readFromValue(obj); + } + + ~FGooglePlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromGoogleIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Google identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromGoogleIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromGoogleIDsResult(const FGetPlayFabIDsFromGoogleIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromGoogleIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromGoogleIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromGoogleIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromKongregateIDsRequest : public FPlayFabBaseModel + { + // Array of unique Kongregate identifiers (Kongregate's user_id) for which the title needs to get PlayFab identifiers. + TArray KongregateIDs; + FGetPlayFabIDsFromKongregateIDsRequest() : + FPlayFabBaseModel(), + KongregateIDs() + {} + + FGetPlayFabIDsFromKongregateIDsRequest(const FGetPlayFabIDsFromKongregateIDsRequest& src) : + FPlayFabBaseModel(), + KongregateIDs(src.KongregateIDs) + {} + + FGetPlayFabIDsFromKongregateIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromKongregateIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromKongregateIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FKongregatePlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Kongregate identifier for a user. + FString KongregateId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Kongregate identifier. + FString PlayFabId; + + FKongregatePlayFabIdPair() : + FPlayFabBaseModel(), + KongregateId(), + PlayFabId() + {} + + FKongregatePlayFabIdPair(const FKongregatePlayFabIdPair& src) : + FPlayFabBaseModel(), + KongregateId(src.KongregateId), + PlayFabId(src.PlayFabId) + {} + + FKongregatePlayFabIdPair(const TSharedPtr& obj) : FKongregatePlayFabIdPair() + { + readFromValue(obj); + } + + ~FKongregatePlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromKongregateIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Kongregate identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromKongregateIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromKongregateIDsResult(const FGetPlayFabIDsFromKongregateIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromKongregateIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromKongregateIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromKongregateIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest : public FPlayFabBaseModel + { + // Array of unique Nintendo Switch Device identifiers for which the title needs to get PlayFab identifiers. + TArray NintendoSwitchDeviceIds; + FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest() : + FPlayFabBaseModel(), + NintendoSwitchDeviceIds() + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest(const FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceIds(src.NintendoSwitchDeviceIds) + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FNintendoSwitchPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Nintendo Switch Device identifier for a user. + FString NintendoSwitchDeviceId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Nintendo Switch Device identifier. + FString PlayFabId; + + FNintendoSwitchPlayFabIdPair() : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(), + PlayFabId() + {} + + FNintendoSwitchPlayFabIdPair(const FNintendoSwitchPlayFabIdPair& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId), + PlayFabId(src.PlayFabId) + {} + + FNintendoSwitchPlayFabIdPair(const TSharedPtr& obj) : FNintendoSwitchPlayFabIdPair() + { + readFromValue(obj); + } + + ~FNintendoSwitchPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Nintendo Switch Device identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(const FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromSteamIDsRequest : public FPlayFabBaseModel + { + // [optional] Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. + TArray SteamStringIDs; + FGetPlayFabIDsFromSteamIDsRequest() : + FPlayFabBaseModel(), + SteamStringIDs() + {} + + FGetPlayFabIDsFromSteamIDsRequest(const FGetPlayFabIDsFromSteamIDsRequest& src) : + FPlayFabBaseModel(), + SteamStringIDs(src.SteamStringIDs) + {} + + FGetPlayFabIDsFromSteamIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromSteamIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromSteamIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSteamPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Steam identifier. + FString PlayFabId; + + // [optional] Unique Steam identifier for a user. + FString SteamStringId; + + FSteamPlayFabIdPair() : + FPlayFabBaseModel(), + PlayFabId(), + SteamStringId() + {} + + FSteamPlayFabIdPair(const FSteamPlayFabIdPair& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + SteamStringId(src.SteamStringId) + {} + + FSteamPlayFabIdPair(const TSharedPtr& obj) : FSteamPlayFabIdPair() + { + readFromValue(obj); + } + + ~FSteamPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromSteamIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Steam identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromSteamIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromSteamIDsResult(const FGetPlayFabIDsFromSteamIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromSteamIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromSteamIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromSteamIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromTwitchIDsRequest : public FPlayFabBaseModel + { + // Array of unique Twitch identifiers (Twitch's _id) for which the title needs to get PlayFab identifiers. + TArray TwitchIds; + FGetPlayFabIDsFromTwitchIDsRequest() : + FPlayFabBaseModel(), + TwitchIds() + {} + + FGetPlayFabIDsFromTwitchIDsRequest(const FGetPlayFabIDsFromTwitchIDsRequest& src) : + FPlayFabBaseModel(), + TwitchIds(src.TwitchIds) + {} + + FGetPlayFabIDsFromTwitchIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromTwitchIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromTwitchIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FTwitchPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Twitch identifier. + FString PlayFabId; + + // [optional] Unique Twitch identifier for a user. + FString TwitchId; + + FTwitchPlayFabIdPair() : + FPlayFabBaseModel(), + PlayFabId(), + TwitchId() + {} + + FTwitchPlayFabIdPair(const FTwitchPlayFabIdPair& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + TwitchId(src.TwitchId) + {} + + FTwitchPlayFabIdPair(const TSharedPtr& obj) : FTwitchPlayFabIdPair() + { + readFromValue(obj); + } + + ~FTwitchPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromTwitchIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Twitch identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromTwitchIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromTwitchIDsResult(const FGetPlayFabIDsFromTwitchIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromTwitchIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromTwitchIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromTwitchIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPublisherDataRequest : public FPlayFabBaseModel + { + // array of keys to get back data from the Publisher data blob, set by the admin tools + TArray Keys; + FGetPublisherDataRequest() : + FPlayFabBaseModel(), + Keys() + {} + + FGetPublisherDataRequest(const FGetPublisherDataRequest& src) : + FPlayFabBaseModel(), + Keys(src.Keys) + {} + + FGetPublisherDataRequest(const TSharedPtr& obj) : FGetPublisherDataRequest() + { + readFromValue(obj); + } + + ~FGetPublisherDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPublisherDataResult : public FPlayFabBaseModel + { + // [optional] a dictionary object of key / value pairs + TMap Data; + FGetPublisherDataResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPublisherDataResult(const FGetPublisherDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPublisherDataResult(const TSharedPtr& obj) : FGetPublisherDataResult() + { + readFromValue(obj); + } + + ~FGetPublisherDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPurchaseRequest : public FPlayFabBaseModel + { + // Purchase order identifier. + FString OrderId; + + FGetPurchaseRequest() : + FPlayFabBaseModel(), + OrderId() + {} + + FGetPurchaseRequest(const FGetPurchaseRequest& src) : + FPlayFabBaseModel(), + OrderId(src.OrderId) + {} + + FGetPurchaseRequest(const TSharedPtr& obj) : FGetPurchaseRequest() + { + readFromValue(obj); + } + + ~FGetPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPurchaseResult : public FPlayFabBaseModel + { + // [optional] Purchase order identifier. + FString OrderId; + + // [optional] Payment provider used for transaction (If not VC) + FString PaymentProvider; + + // Date and time of the purchase. + FDateTime PurchaseDate; + + // [optional] Provider transaction ID (If not VC) + FString TransactionId; + + // [optional] PlayFab transaction status + FString TransactionStatus; + + FGetPurchaseResult() : + FPlayFabBaseModel(), + OrderId(), + PaymentProvider(), + PurchaseDate(0), + TransactionId(), + TransactionStatus() + {} + + FGetPurchaseResult(const FGetPurchaseResult& src) : + FPlayFabBaseModel(), + OrderId(src.OrderId), + PaymentProvider(src.PaymentProvider), + PurchaseDate(src.PurchaseDate), + TransactionId(src.TransactionId), + TransactionStatus(src.TransactionStatus) + {} + + FGetPurchaseResult(const TSharedPtr& obj) : FGetPurchaseResult() + { + readFromValue(obj); + } + + ~FGetPurchaseResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSharedGroupDataRequest : public FPlayFabBaseModel + { + // [optional] If true, return the list of all members of the shared group. + Boxed GetMembers; + + /** + * [optional] Specific keys to retrieve from the shared group (if not specified, all keys will be returned, while an empty array + * indicates that no keys should be returned). + */ + TArray Keys; + // Unique identifier for the shared group. + FString SharedGroupId; + + FGetSharedGroupDataRequest() : + FPlayFabBaseModel(), + GetMembers(), + Keys(), + SharedGroupId() + {} + + FGetSharedGroupDataRequest(const FGetSharedGroupDataRequest& src) : + FPlayFabBaseModel(), + GetMembers(src.GetMembers), + Keys(src.Keys), + SharedGroupId(src.SharedGroupId) + {} + + FGetSharedGroupDataRequest(const TSharedPtr& obj) : FGetSharedGroupDataRequest() + { + readFromValue(obj); + } + + ~FGetSharedGroupDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSharedGroupDataRecord : public FPlayFabBaseModel + { + // Timestamp for when this data was last updated. + FDateTime LastUpdated; + + // [optional] Unique PlayFab identifier of the user to last update this value. + FString LastUpdatedBy; + + // [optional] Indicates whether this data can be read by all users (public) or only members of the group (private). + Boxed Permission; + + // [optional] Data stored for the specified group data key. + FString Value; + + FSharedGroupDataRecord() : + FPlayFabBaseModel(), + LastUpdated(0), + LastUpdatedBy(), + Permission(), + Value() + {} + + FSharedGroupDataRecord(const FSharedGroupDataRecord& src) : + FPlayFabBaseModel(), + LastUpdated(src.LastUpdated), + LastUpdatedBy(src.LastUpdatedBy), + Permission(src.Permission), + Value(src.Value) + {} + + FSharedGroupDataRecord(const TSharedPtr& obj) : FSharedGroupDataRecord() + { + readFromValue(obj); + } + + ~FSharedGroupDataRecord(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSharedGroupDataResult : public FPlayFabBaseModel + { + // [optional] Data for the requested keys. + TMap Data; + // [optional] List of PlayFabId identifiers for the members of this group, if requested. + TArray Members; + FGetSharedGroupDataResult() : + FPlayFabBaseModel(), + Data(), + Members() + {} + + FGetSharedGroupDataResult(const FGetSharedGroupDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data), + Members(src.Members) + {} + + FGetSharedGroupDataResult(const TSharedPtr& obj) : FGetSharedGroupDataResult() + { + readFromValue(obj); + } + + ~FGetSharedGroupDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetStoreItemsRequest : public FPlayFabBaseModel + { + // [optional] catalog version to store items from. Use default catalog version if null + FString CatalogVersion; + + // Unqiue identifier for the store which is being requested. + FString StoreId; + + FGetStoreItemsRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + StoreId() + {} + + FGetStoreItemsRequest(const FGetStoreItemsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + StoreId(src.StoreId) + {} + + FGetStoreItemsRequest(const TSharedPtr& obj) : FGetStoreItemsRequest() + { + readFromValue(obj); + } + + ~FGetStoreItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStoreMarketingModel : public FPlayFabBaseModel + { + // [optional] Tagline for a store. + FString Description; + + // [optional] Display name of a store as it will appear to users. + FString DisplayName; + + // [optional] Custom data about a store. + FJsonKeeper Metadata; + + FStoreMarketingModel() : + FPlayFabBaseModel(), + Description(), + DisplayName(), + Metadata() + {} + + FStoreMarketingModel(const FStoreMarketingModel& src) : + FPlayFabBaseModel(), + Description(src.Description), + DisplayName(src.DisplayName), + Metadata(src.Metadata) + {} + + FStoreMarketingModel(const TSharedPtr& obj) : FStoreMarketingModel() + { + readFromValue(obj); + } + + ~FStoreMarketingModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum SourceType + { + SourceTypeAdmin, + SourceTypeBackEnd, + SourceTypeGameClient, + SourceTypeGameServer, + SourceTypePartner, + SourceTypeCustom, + SourceTypeAPI + }; + + PLAYFABCPP_API void writeSourceTypeEnumJSON(SourceType enumVal, JsonWriter& writer); + PLAYFABCPP_API SourceType readSourceTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API SourceType readSourceTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FStoreItem : public FPlayFabBaseModel + { + // [optional] Store specific custom data. The data only exists as part of this store; it is not transferred to item instances + FJsonKeeper CustomData; + + // [optional] Intended display position for this item. Note that 0 is the first position + Boxed DisplayPosition; + + /** + * Unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the + * catalog + */ + FString ItemId; + + // [optional] Override prices for this item for specific currencies + TMap RealCurrencyPrices; + // [optional] Override prices for this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + TMap VirtualCurrencyPrices; + FStoreItem() : + FPlayFabBaseModel(), + CustomData(), + DisplayPosition(), + ItemId(), + RealCurrencyPrices(), + VirtualCurrencyPrices() + {} + + FStoreItem(const FStoreItem& src) : + FPlayFabBaseModel(), + CustomData(src.CustomData), + DisplayPosition(src.DisplayPosition), + ItemId(src.ItemId), + RealCurrencyPrices(src.RealCurrencyPrices), + VirtualCurrencyPrices(src.VirtualCurrencyPrices) + {} + + FStoreItem(const TSharedPtr& obj) : FStoreItem() + { + readFromValue(obj); + } + + ~FStoreItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetStoreItemsResult : public FPlayFabBaseModel + { + // [optional] The base catalog that this store is a part of. + FString CatalogVersion; + + // [optional] Additional data about the store. + TSharedPtr MarketingData; + + // [optional] How the store was last updated (Admin or a third party). + Boxed Source; + + // [optional] Array of items which can be purchased from this store. + TArray Store; + // [optional] The ID of this store. + FString StoreId; + + FGetStoreItemsResult() : + FPlayFabBaseModel(), + CatalogVersion(), + MarketingData(nullptr), + Source(), + Store(), + StoreId() + {} + + FGetStoreItemsResult(const FGetStoreItemsResult& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + MarketingData(src.MarketingData.IsValid() ? MakeShareable(new FStoreMarketingModel(*src.MarketingData)) : nullptr), + Source(src.Source), + Store(src.Store), + StoreId(src.StoreId) + {} + + FGetStoreItemsResult(const TSharedPtr& obj) : FGetStoreItemsResult() + { + readFromValue(obj); + } + + ~FGetStoreItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTimeRequest : public FPlayFabBaseModel + { + FGetTimeRequest() : + FPlayFabBaseModel() + {} + + FGetTimeRequest(const FGetTimeRequest& src) : + FPlayFabBaseModel() + {} + + FGetTimeRequest(const TSharedPtr& obj) : FGetTimeRequest() + { + readFromValue(obj); + } + + ~FGetTimeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTimeResult : public FPlayFabBaseModel + { + // Current server time when the request was received, in UTC + FDateTime Time; + + FGetTimeResult() : + FPlayFabBaseModel(), + Time(0) + {} + + FGetTimeResult(const FGetTimeResult& src) : + FPlayFabBaseModel(), + Time(src.Time) + {} + + FGetTimeResult(const TSharedPtr& obj) : FGetTimeResult() + { + readFromValue(obj); + } + + ~FGetTimeResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleDataRequest : public FPlayFabBaseModel + { + // [optional] Specific keys to search for in the title data (leave null to get all keys) + TArray Keys; + FGetTitleDataRequest() : + FPlayFabBaseModel(), + Keys() + {} + + FGetTitleDataRequest(const FGetTitleDataRequest& src) : + FPlayFabBaseModel(), + Keys(src.Keys) + {} + + FGetTitleDataRequest(const TSharedPtr& obj) : FGetTitleDataRequest() + { + readFromValue(obj); + } + + ~FGetTitleDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleDataResult : public FPlayFabBaseModel + { + // [optional] a dictionary object of key / value pairs + TMap Data; + FGetTitleDataResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetTitleDataResult(const FGetTitleDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetTitleDataResult(const TSharedPtr& obj) : FGetTitleDataResult() + { + readFromValue(obj); + } + + ~FGetTitleDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleNewsRequest : public FPlayFabBaseModel + { + // [optional] Limits the results to the last n entries. Defaults to 10 if not set. + Boxed Count; + + FGetTitleNewsRequest() : + FPlayFabBaseModel(), + Count() + {} + + FGetTitleNewsRequest(const FGetTitleNewsRequest& src) : + FPlayFabBaseModel(), + Count(src.Count) + {} + + FGetTitleNewsRequest(const TSharedPtr& obj) : FGetTitleNewsRequest() + { + readFromValue(obj); + } + + ~FGetTitleNewsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FTitleNewsItem : public FPlayFabBaseModel + { + // [optional] News item text. + FString Body; + + // [optional] Unique identifier of news item. + FString NewsId; + + // Date and time when the news items was posted. + FDateTime Timestamp; + + // [optional] Title of the news item. + FString Title; + + FTitleNewsItem() : + FPlayFabBaseModel(), + Body(), + NewsId(), + Timestamp(0), + Title() + {} + + FTitleNewsItem(const FTitleNewsItem& src) : + FPlayFabBaseModel(), + Body(src.Body), + NewsId(src.NewsId), + Timestamp(src.Timestamp), + Title(src.Title) + {} + + FTitleNewsItem(const TSharedPtr& obj) : FTitleNewsItem() + { + readFromValue(obj); + } + + ~FTitleNewsItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleNewsResult : public FPlayFabBaseModel + { + // [optional] Array of news items. + TArray News; + FGetTitleNewsResult() : + FPlayFabBaseModel(), + News() + {} + + FGetTitleNewsResult(const FGetTitleNewsResult& src) : + FPlayFabBaseModel(), + News(src.News) + {} + + FGetTitleNewsResult(const TSharedPtr& obj) : FGetTitleNewsResult() + { + readFromValue(obj); + } + + ~FGetTitleNewsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitlePublicKeyRequest : public FPlayFabBaseModel + { + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + // The shared secret key for this title + FString TitleSharedSecret; + + FGetTitlePublicKeyRequest() : + FPlayFabBaseModel(), + TitleId(), + TitleSharedSecret() + {} + + FGetTitlePublicKeyRequest(const FGetTitlePublicKeyRequest& src) : + FPlayFabBaseModel(), + TitleId(src.TitleId), + TitleSharedSecret(src.TitleSharedSecret) + {} + + FGetTitlePublicKeyRequest(const TSharedPtr& obj) : FGetTitlePublicKeyRequest() + { + readFromValue(obj); + } + + ~FGetTitlePublicKeyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitlePublicKeyResult : public FPlayFabBaseModel + { + // [optional] Base64 encoded RSA CSP byte array blob containing the title's public RSA key + FString RSAPublicKey; + + FGetTitlePublicKeyResult() : + FPlayFabBaseModel(), + RSAPublicKey() + {} + + FGetTitlePublicKeyResult(const FGetTitlePublicKeyResult& src) : + FPlayFabBaseModel(), + RSAPublicKey(src.RSAPublicKey) + {} + + FGetTitlePublicKeyResult(const TSharedPtr& obj) : FGetTitlePublicKeyResult() + { + readFromValue(obj); + } + + ~FGetTitlePublicKeyResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTradeStatusRequest : public FPlayFabBaseModel + { + // Player who opened trade. + FString OfferingPlayerId; + + // Trade identifier as returned by OpenTradeOffer. + FString TradeId; + + FGetTradeStatusRequest() : + FPlayFabBaseModel(), + OfferingPlayerId(), + TradeId() + {} + + FGetTradeStatusRequest(const FGetTradeStatusRequest& src) : + FPlayFabBaseModel(), + OfferingPlayerId(src.OfferingPlayerId), + TradeId(src.TradeId) + {} + + FGetTradeStatusRequest(const TSharedPtr& obj) : FGetTradeStatusRequest() + { + readFromValue(obj); + } + + ~FGetTradeStatusRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTradeStatusResponse : public FPlayFabBaseModel + { + // [optional] Information about the requested trade. + TSharedPtr Trade; + + FGetTradeStatusResponse() : + FPlayFabBaseModel(), + Trade(nullptr) + {} + + FGetTradeStatusResponse(const FGetTradeStatusResponse& src) : + FPlayFabBaseModel(), + Trade(src.Trade.IsValid() ? MakeShareable(new FTradeInfo(*src.Trade)) : nullptr) + {} + + FGetTradeStatusResponse(const TSharedPtr& obj) : FGetTradeStatusResponse() + { + readFromValue(obj); + } + + ~FGetTradeStatusResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserDataRequest : public FPlayFabBaseModel + { + /** + * [optional] The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + Boxed IfChangedFromDataVersion; + + // [optional] List of unique keys to load from. + TArray Keys; + /** + * [optional] Unique PlayFab identifier of the user to load data for. Optional, defaults to yourself if not set. When specified to a + * PlayFab id of another player, then this will only return public keys for that account. + */ + FString PlayFabId; + + FGetUserDataRequest() : + FPlayFabBaseModel(), + IfChangedFromDataVersion(), + Keys(), + PlayFabId() + {} + + FGetUserDataRequest(const FGetUserDataRequest& src) : + FPlayFabBaseModel(), + IfChangedFromDataVersion(src.IfChangedFromDataVersion), + Keys(src.Keys), + PlayFabId(src.PlayFabId) + {} + + FGetUserDataRequest(const TSharedPtr& obj) : FGetUserDataRequest() + { + readFromValue(obj); + } + + ~FGetUserDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserDataResult : public FPlayFabBaseModel + { + // [optional] User specific data for this title. + TMap Data; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FGetUserDataResult() : + FPlayFabBaseModel(), + Data(), + DataVersion(0) + {} + + FGetUserDataResult(const FGetUserDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data), + DataVersion(src.DataVersion) + {} + + FGetUserDataResult(const TSharedPtr& obj) : FGetUserDataResult() + { + readFromValue(obj); + } + + ~FGetUserDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserInventoryRequest : public FPlayFabBaseModel + { + FGetUserInventoryRequest() : + FPlayFabBaseModel() + {} + + FGetUserInventoryRequest(const FGetUserInventoryRequest& src) : + FPlayFabBaseModel() + {} + + FGetUserInventoryRequest(const TSharedPtr& obj) : FGetUserInventoryRequest() + { + readFromValue(obj); + } + + ~FGetUserInventoryRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserInventoryResult : public FPlayFabBaseModel + { + // [optional] Array of inventory items belonging to the user. + TArray Inventory; + // [optional] Array of virtual currency balance(s) belonging to the user. + TMap VirtualCurrency; + // [optional] Array of remaining times and timestamps for virtual currencies. + TMap VirtualCurrencyRechargeTimes; + FGetUserInventoryResult() : + FPlayFabBaseModel(), + Inventory(), + VirtualCurrency(), + VirtualCurrencyRechargeTimes() + {} + + FGetUserInventoryResult(const FGetUserInventoryResult& src) : + FPlayFabBaseModel(), + Inventory(src.Inventory), + VirtualCurrency(src.VirtualCurrency), + VirtualCurrencyRechargeTimes(src.VirtualCurrencyRechargeTimes) + {} + + FGetUserInventoryResult(const TSharedPtr& obj) : FGetUserInventoryResult() + { + readFromValue(obj); + } + + ~FGetUserInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetWindowsHelloChallengeRequest : public FPlayFabBaseModel + { + // SHA256 hash of the PublicKey generated by Windows Hello. + FString PublicKeyHint; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FGetWindowsHelloChallengeRequest() : + FPlayFabBaseModel(), + PublicKeyHint(), + TitleId() + {} + + FGetWindowsHelloChallengeRequest(const FGetWindowsHelloChallengeRequest& src) : + FPlayFabBaseModel(), + PublicKeyHint(src.PublicKeyHint), + TitleId(src.TitleId) + {} + + FGetWindowsHelloChallengeRequest(const TSharedPtr& obj) : FGetWindowsHelloChallengeRequest() + { + readFromValue(obj); + } + + ~FGetWindowsHelloChallengeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetWindowsHelloChallengeResponse : public FPlayFabBaseModel + { + // [optional] Server generated challenge to be signed by the user. + FString Challenge; + + FGetWindowsHelloChallengeResponse() : + FPlayFabBaseModel(), + Challenge() + {} + + FGetWindowsHelloChallengeResponse(const FGetWindowsHelloChallengeResponse& src) : + FPlayFabBaseModel(), + Challenge(src.Challenge) + {} + + FGetWindowsHelloChallengeResponse(const TSharedPtr& obj) : FGetWindowsHelloChallengeResponse() + { + readFromValue(obj); + } + + ~FGetWindowsHelloChallengeResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantCharacterToUserRequest : public FPlayFabBaseModel + { + // [optional] Catalog version from which items are to be granted. + FString CatalogVersion; + + // Non-unique display name of the character being granted (1-20 characters in length). + FString CharacterName; + + /** + * Catalog item identifier of the item in the user's inventory that corresponds to the character in the catalog to be + * created. + */ + FString ItemId; + + FGrantCharacterToUserRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterName(), + ItemId() + {} + + FGrantCharacterToUserRequest(const FGrantCharacterToUserRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterName(src.CharacterName), + ItemId(src.ItemId) + {} + + FGrantCharacterToUserRequest(const TSharedPtr& obj) : FGrantCharacterToUserRequest() + { + readFromValue(obj); + } + + ~FGrantCharacterToUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantCharacterToUserResult : public FPlayFabBaseModel + { + // [optional] Unique identifier tagged to this character. + FString CharacterId; + + // [optional] Type of character that was created. + FString CharacterType; + + // Indicates whether this character was created successfully. + bool Result; + + FGrantCharacterToUserResult() : + FPlayFabBaseModel(), + CharacterId(), + CharacterType(), + Result(false) + {} + + FGrantCharacterToUserResult(const FGrantCharacterToUserResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterType(src.CharacterType), + Result(src.Result) + {} + + FGrantCharacterToUserResult(const TSharedPtr& obj) : FGrantCharacterToUserResult() + { + readFromValue(obj); + } + + ~FGrantCharacterToUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemPurchaseRequest : public FPlayFabBaseModel + { + // [optional] Title-specific text concerning this purchase. + FString Annotation; + + // Unique ItemId of the item to purchase. + FString ItemId; + + // How many of this item to purchase. Min 1, maximum 25. + uint32 Quantity; + + // [optional] Items to be upgraded as a result of this purchase (upgraded items are hidden, as they are "replaced" by the new items). + TArray UpgradeFromItems; + FItemPurchaseRequest() : + FPlayFabBaseModel(), + Annotation(), + ItemId(), + Quantity(0), + UpgradeFromItems() + {} + + FItemPurchaseRequest(const FItemPurchaseRequest& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + ItemId(src.ItemId), + Quantity(src.Quantity), + UpgradeFromItems(src.UpgradeFromItems) + {} + + FItemPurchaseRequest(const TSharedPtr& obj) : FItemPurchaseRequest() + { + readFromValue(obj); + } + + ~FItemPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkAndroidDeviceIDRequest : public FPlayFabBaseModel + { + // [optional] Specific model of the user's device. + FString AndroidDevice; + + // Android device identifier for the user's device. + FString AndroidDeviceId; + + // [optional] If another user is already linked to the device, unlink the other user and re-link. + Boxed ForceLink; + + // [optional] Specific Operating System version for the user's device. + FString OS; + + FLinkAndroidDeviceIDRequest() : + FPlayFabBaseModel(), + AndroidDevice(), + AndroidDeviceId(), + ForceLink(), + OS() + {} + + FLinkAndroidDeviceIDRequest(const FLinkAndroidDeviceIDRequest& src) : + FPlayFabBaseModel(), + AndroidDevice(src.AndroidDevice), + AndroidDeviceId(src.AndroidDeviceId), + ForceLink(src.ForceLink), + OS(src.OS) + {} + + FLinkAndroidDeviceIDRequest(const TSharedPtr& obj) : FLinkAndroidDeviceIDRequest() + { + readFromValue(obj); + } + + ~FLinkAndroidDeviceIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkAndroidDeviceIDResult : public FPlayFabBaseModel + { + FLinkAndroidDeviceIDResult() : + FPlayFabBaseModel() + {} + + FLinkAndroidDeviceIDResult(const FLinkAndroidDeviceIDResult& src) : + FPlayFabBaseModel() + {} + + FLinkAndroidDeviceIDResult(const TSharedPtr& obj) : FLinkAndroidDeviceIDResult() + { + readFromValue(obj); + } + + ~FLinkAndroidDeviceIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkCustomIDRequest : public FPlayFabBaseModel + { + // Custom unique identifier for the user, generated by the title. + FString CustomId; + + // [optional] If another user is already linked to the custom ID, unlink the other user and re-link. + Boxed ForceLink; + + FLinkCustomIDRequest() : + FPlayFabBaseModel(), + CustomId(), + ForceLink() + {} + + FLinkCustomIDRequest(const FLinkCustomIDRequest& src) : + FPlayFabBaseModel(), + CustomId(src.CustomId), + ForceLink(src.ForceLink) + {} + + FLinkCustomIDRequest(const TSharedPtr& obj) : FLinkCustomIDRequest() + { + readFromValue(obj); + } + + ~FLinkCustomIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkCustomIDResult : public FPlayFabBaseModel + { + FLinkCustomIDResult() : + FPlayFabBaseModel() + {} + + FLinkCustomIDResult(const FLinkCustomIDResult& src) : + FPlayFabBaseModel() + {} + + FLinkCustomIDResult(const TSharedPtr& obj) : FLinkCustomIDResult() + { + readFromValue(obj); + } + + ~FLinkCustomIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkFacebookAccountRequest : public FPlayFabBaseModel + { + // Unique identifier from Facebook for the user. + FString AccessToken; + + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + FLinkFacebookAccountRequest() : + FPlayFabBaseModel(), + AccessToken(), + ForceLink() + {} + + FLinkFacebookAccountRequest(const FLinkFacebookAccountRequest& src) : + FPlayFabBaseModel(), + AccessToken(src.AccessToken), + ForceLink(src.ForceLink) + {} + + FLinkFacebookAccountRequest(const TSharedPtr& obj) : FLinkFacebookAccountRequest() + { + readFromValue(obj); + } + + ~FLinkFacebookAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkFacebookAccountResult : public FPlayFabBaseModel + { + FLinkFacebookAccountResult() : + FPlayFabBaseModel() + {} + + FLinkFacebookAccountResult(const FLinkFacebookAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkFacebookAccountResult(const TSharedPtr& obj) : FLinkFacebookAccountResult() + { + readFromValue(obj); + } + + ~FLinkFacebookAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkFacebookInstantGamesIdRequest : public FPlayFabBaseModel + { + // Facebook Instant Games signature for the user. + FString FacebookInstantGamesSignature; + + // [optional] If another user is already linked to the Facebook Instant Games ID, unlink the other user and re-link. + Boxed ForceLink; + + FLinkFacebookInstantGamesIdRequest() : + FPlayFabBaseModel(), + FacebookInstantGamesSignature(), + ForceLink() + {} + + FLinkFacebookInstantGamesIdRequest(const FLinkFacebookInstantGamesIdRequest& src) : + FPlayFabBaseModel(), + FacebookInstantGamesSignature(src.FacebookInstantGamesSignature), + ForceLink(src.ForceLink) + {} + + FLinkFacebookInstantGamesIdRequest(const TSharedPtr& obj) : FLinkFacebookInstantGamesIdRequest() + { + readFromValue(obj); + } + + ~FLinkFacebookInstantGamesIdRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkFacebookInstantGamesIdResult : public FPlayFabBaseModel + { + FLinkFacebookInstantGamesIdResult() : + FPlayFabBaseModel() + {} + + FLinkFacebookInstantGamesIdResult(const FLinkFacebookInstantGamesIdResult& src) : + FPlayFabBaseModel() + {} + + FLinkFacebookInstantGamesIdResult(const TSharedPtr& obj) : FLinkFacebookInstantGamesIdResult() + { + readFromValue(obj); + } + + ~FLinkFacebookInstantGamesIdResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkGameCenterAccountRequest : public FPlayFabBaseModel + { + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + // Game Center identifier for the player account to be linked. + FString GameCenterId; + + FLinkGameCenterAccountRequest() : + FPlayFabBaseModel(), + ForceLink(), + GameCenterId() + {} + + FLinkGameCenterAccountRequest(const FLinkGameCenterAccountRequest& src) : + FPlayFabBaseModel(), + ForceLink(src.ForceLink), + GameCenterId(src.GameCenterId) + {} + + FLinkGameCenterAccountRequest(const TSharedPtr& obj) : FLinkGameCenterAccountRequest() + { + readFromValue(obj); + } + + ~FLinkGameCenterAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkGameCenterAccountResult : public FPlayFabBaseModel + { + FLinkGameCenterAccountResult() : + FPlayFabBaseModel() + {} + + FLinkGameCenterAccountResult(const FLinkGameCenterAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkGameCenterAccountResult(const TSharedPtr& obj) : FLinkGameCenterAccountResult() + { + readFromValue(obj); + } + + ~FLinkGameCenterAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkGoogleAccountRequest : public FPlayFabBaseModel + { + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + /** + * [optional] Server authentication code obtained on the client by calling getServerAuthCode() + * (https://developers.google.com/identity/sign-in/android/offline-access) from Google Play for the user. + */ + FString ServerAuthCode; + + FLinkGoogleAccountRequest() : + FPlayFabBaseModel(), + ForceLink(), + ServerAuthCode() + {} + + FLinkGoogleAccountRequest(const FLinkGoogleAccountRequest& src) : + FPlayFabBaseModel(), + ForceLink(src.ForceLink), + ServerAuthCode(src.ServerAuthCode) + {} + + FLinkGoogleAccountRequest(const TSharedPtr& obj) : FLinkGoogleAccountRequest() + { + readFromValue(obj); + } + + ~FLinkGoogleAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkGoogleAccountResult : public FPlayFabBaseModel + { + FLinkGoogleAccountResult() : + FPlayFabBaseModel() + {} + + FLinkGoogleAccountResult(const FLinkGoogleAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkGoogleAccountResult(const TSharedPtr& obj) : FLinkGoogleAccountResult() + { + readFromValue(obj); + } + + ~FLinkGoogleAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkIOSDeviceIDRequest : public FPlayFabBaseModel + { + // Vendor-specific iOS identifier for the user's device. + FString DeviceId; + + // [optional] Specific model of the user's device. + FString DeviceModel; + + // [optional] If another user is already linked to the device, unlink the other user and re-link. + Boxed ForceLink; + + // [optional] Specific Operating System version for the user's device. + FString OS; + + FLinkIOSDeviceIDRequest() : + FPlayFabBaseModel(), + DeviceId(), + DeviceModel(), + ForceLink(), + OS() + {} + + FLinkIOSDeviceIDRequest(const FLinkIOSDeviceIDRequest& src) : + FPlayFabBaseModel(), + DeviceId(src.DeviceId), + DeviceModel(src.DeviceModel), + ForceLink(src.ForceLink), + OS(src.OS) + {} + + FLinkIOSDeviceIDRequest(const TSharedPtr& obj) : FLinkIOSDeviceIDRequest() + { + readFromValue(obj); + } + + ~FLinkIOSDeviceIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkIOSDeviceIDResult : public FPlayFabBaseModel + { + FLinkIOSDeviceIDResult() : + FPlayFabBaseModel() + {} + + FLinkIOSDeviceIDResult(const FLinkIOSDeviceIDResult& src) : + FPlayFabBaseModel() + {} + + FLinkIOSDeviceIDResult(const TSharedPtr& obj) : FLinkIOSDeviceIDResult() + { + readFromValue(obj); + } + + ~FLinkIOSDeviceIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkKongregateAccountRequest : public FPlayFabBaseModel + { + // Valid session auth ticket issued by Kongregate + FString AuthTicket; + + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + // Numeric user ID assigned by Kongregate + FString KongregateId; + + FLinkKongregateAccountRequest() : + FPlayFabBaseModel(), + AuthTicket(), + ForceLink(), + KongregateId() + {} + + FLinkKongregateAccountRequest(const FLinkKongregateAccountRequest& src) : + FPlayFabBaseModel(), + AuthTicket(src.AuthTicket), + ForceLink(src.ForceLink), + KongregateId(src.KongregateId) + {} + + FLinkKongregateAccountRequest(const TSharedPtr& obj) : FLinkKongregateAccountRequest() + { + readFromValue(obj); + } + + ~FLinkKongregateAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkKongregateAccountResult : public FPlayFabBaseModel + { + FLinkKongregateAccountResult() : + FPlayFabBaseModel() + {} + + FLinkKongregateAccountResult(const FLinkKongregateAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkKongregateAccountResult(const TSharedPtr& obj) : FLinkKongregateAccountResult() + { + readFromValue(obj); + } + + ~FLinkKongregateAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkNintendoSwitchDeviceIdRequest : public FPlayFabBaseModel + { + // [optional] If another user is already linked to the Nintendo Switch Device ID, unlink the other user and re-link. + Boxed ForceLink; + + // Nintendo Switch unique identifier for the user's device. + FString NintendoSwitchDeviceId; + + FLinkNintendoSwitchDeviceIdRequest() : + FPlayFabBaseModel(), + ForceLink(), + NintendoSwitchDeviceId() + {} + + FLinkNintendoSwitchDeviceIdRequest(const FLinkNintendoSwitchDeviceIdRequest& src) : + FPlayFabBaseModel(), + ForceLink(src.ForceLink), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId) + {} + + FLinkNintendoSwitchDeviceIdRequest(const TSharedPtr& obj) : FLinkNintendoSwitchDeviceIdRequest() + { + readFromValue(obj); + } + + ~FLinkNintendoSwitchDeviceIdRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkNintendoSwitchDeviceIdResult : public FPlayFabBaseModel + { + FLinkNintendoSwitchDeviceIdResult() : + FPlayFabBaseModel() + {} + + FLinkNintendoSwitchDeviceIdResult(const FLinkNintendoSwitchDeviceIdResult& src) : + FPlayFabBaseModel() + {} + + FLinkNintendoSwitchDeviceIdResult(const TSharedPtr& obj) : FLinkNintendoSwitchDeviceIdResult() + { + readFromValue(obj); + } + + ~FLinkNintendoSwitchDeviceIdResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkSteamAccountRequest : public FPlayFabBaseModel + { + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + /** + * Authentication token for the user, returned as a byte array from Steam, and converted to a string (for example, the byte + * 0x08 should become "08"). + */ + FString SteamTicket; + + FLinkSteamAccountRequest() : + FPlayFabBaseModel(), + ForceLink(), + SteamTicket() + {} + + FLinkSteamAccountRequest(const FLinkSteamAccountRequest& src) : + FPlayFabBaseModel(), + ForceLink(src.ForceLink), + SteamTicket(src.SteamTicket) + {} + + FLinkSteamAccountRequest(const TSharedPtr& obj) : FLinkSteamAccountRequest() + { + readFromValue(obj); + } + + ~FLinkSteamAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkSteamAccountResult : public FPlayFabBaseModel + { + FLinkSteamAccountResult() : + FPlayFabBaseModel() + {} + + FLinkSteamAccountResult(const FLinkSteamAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkSteamAccountResult(const TSharedPtr& obj) : FLinkSteamAccountResult() + { + readFromValue(obj); + } + + ~FLinkSteamAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkTwitchAccountRequest : public FPlayFabBaseModel + { + // Valid token issued by Twitch + FString AccessToken; + + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + FLinkTwitchAccountRequest() : + FPlayFabBaseModel(), + AccessToken(), + ForceLink() + {} + + FLinkTwitchAccountRequest(const FLinkTwitchAccountRequest& src) : + FPlayFabBaseModel(), + AccessToken(src.AccessToken), + ForceLink(src.ForceLink) + {} + + FLinkTwitchAccountRequest(const TSharedPtr& obj) : FLinkTwitchAccountRequest() + { + readFromValue(obj); + } + + ~FLinkTwitchAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkTwitchAccountResult : public FPlayFabBaseModel + { + FLinkTwitchAccountResult() : + FPlayFabBaseModel() + {} + + FLinkTwitchAccountResult(const FLinkTwitchAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkTwitchAccountResult(const TSharedPtr& obj) : FLinkTwitchAccountResult() + { + readFromValue(obj); + } + + ~FLinkTwitchAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkWindowsHelloAccountRequest : public FPlayFabBaseModel + { + // [optional] Device name. + FString DeviceName; + + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + // PublicKey generated by Windows Hello. + FString PublicKey; + + // Player's user named used by Windows Hello. + FString UserName; + + FLinkWindowsHelloAccountRequest() : + FPlayFabBaseModel(), + DeviceName(), + ForceLink(), + PublicKey(), + UserName() + {} + + FLinkWindowsHelloAccountRequest(const FLinkWindowsHelloAccountRequest& src) : + FPlayFabBaseModel(), + DeviceName(src.DeviceName), + ForceLink(src.ForceLink), + PublicKey(src.PublicKey), + UserName(src.UserName) + {} + + FLinkWindowsHelloAccountRequest(const TSharedPtr& obj) : FLinkWindowsHelloAccountRequest() + { + readFromValue(obj); + } + + ~FLinkWindowsHelloAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkWindowsHelloAccountResponse : public FPlayFabBaseModel + { + FLinkWindowsHelloAccountResponse() : + FPlayFabBaseModel() + {} + + FLinkWindowsHelloAccountResponse(const FLinkWindowsHelloAccountResponse& src) : + FPlayFabBaseModel() + {} + + FLinkWindowsHelloAccountResponse(const TSharedPtr& obj) : FLinkWindowsHelloAccountResponse() + { + readFromValue(obj); + } + + ~FLinkWindowsHelloAccountResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkXboxAccountRequest : public FPlayFabBaseModel + { + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + // Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + FString XboxToken; + + FLinkXboxAccountRequest() : + FPlayFabBaseModel(), + ForceLink(), + XboxToken() + {} + + FLinkXboxAccountRequest(const FLinkXboxAccountRequest& src) : + FPlayFabBaseModel(), + ForceLink(src.ForceLink), + XboxToken(src.XboxToken) + {} + + FLinkXboxAccountRequest(const TSharedPtr& obj) : FLinkXboxAccountRequest() + { + readFromValue(obj); + } + + ~FLinkXboxAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkXboxAccountResult : public FPlayFabBaseModel + { + FLinkXboxAccountResult() : + FPlayFabBaseModel() + {} + + FLinkXboxAccountResult(const FLinkXboxAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkXboxAccountResult(const TSharedPtr& obj) : FLinkXboxAccountResult() + { + readFromValue(obj); + } + + ~FLinkXboxAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListUsersCharactersRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FListUsersCharactersRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FListUsersCharactersRequest(const FListUsersCharactersRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FListUsersCharactersRequest(const TSharedPtr& obj) : FListUsersCharactersRequest() + { + readFromValue(obj); + } + + ~FListUsersCharactersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListUsersCharactersResult : public FPlayFabBaseModel + { + // [optional] The requested list of characters. + TArray Characters; + FListUsersCharactersResult() : + FPlayFabBaseModel(), + Characters() + {} + + FListUsersCharactersResult(const FListUsersCharactersResult& src) : + FPlayFabBaseModel(), + Characters(src.Characters) + {} + + FListUsersCharactersResult(const TSharedPtr& obj) : FListUsersCharactersResult() + { + readFromValue(obj); + } + + ~FListUsersCharactersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserSettings : public FPlayFabBaseModel + { + // Boolean for whether this player is eligible for gathering device info. + bool GatherDeviceInfo; + + // Boolean for whether this player should report OnFocus play-time tracking. + bool GatherFocusInfo; + + // Boolean for whether this player is eligible for ad tracking. + bool NeedsAttribution; + + FUserSettings() : + FPlayFabBaseModel(), + GatherDeviceInfo(false), + GatherFocusInfo(false), + NeedsAttribution(false) + {} + + FUserSettings(const FUserSettings& src) : + FPlayFabBaseModel(), + GatherDeviceInfo(src.GatherDeviceInfo), + GatherFocusInfo(src.GatherFocusInfo), + NeedsAttribution(src.NeedsAttribution) + {} + + FUserSettings(const TSharedPtr& obj) : FUserSettings() + { + readFromValue(obj); + } + + ~FUserSettings(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginResult : public FPlayFabBaseModel + { + /** + * [optional] If LoginTitlePlayerAccountEntity flag is set on the login request the title_player_account will also be logged in and + * returned. + */ + TSharedPtr EntityToken; + + // [optional] Results for requested info. + TSharedPtr InfoResultPayload; + + // [optional] The time of this user's previous login. If there was no previous login, then it's DateTime.MinValue + Boxed LastLoginTime; + + // True if the account was newly created on this login. + bool NewlyCreated; + + // [optional] Player's unique PlayFabId. + FString PlayFabId; + + // [optional] Unique token authorizing the user and game at the server level, for the current session. + FString SessionTicket; + + // [optional] Settings specific to this user. + TSharedPtr SettingsForUser; + + FLoginResult() : + FPlayFabBaseModel(), + EntityToken(nullptr), + InfoResultPayload(nullptr), + LastLoginTime(), + NewlyCreated(false), + PlayFabId(), + SessionTicket(), + SettingsForUser(nullptr) + {} + + FLoginResult(const FLoginResult& src) : + FPlayFabBaseModel(), + EntityToken(src.EntityToken.IsValid() ? MakeShareable(new FEntityTokenResponse(*src.EntityToken)) : nullptr), + InfoResultPayload(src.InfoResultPayload.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoResultPayload(*src.InfoResultPayload)) : nullptr), + LastLoginTime(src.LastLoginTime), + NewlyCreated(src.NewlyCreated), + PlayFabId(src.PlayFabId), + SessionTicket(src.SessionTicket), + SettingsForUser(src.SettingsForUser.IsValid() ? MakeShareable(new FUserSettings(*src.SettingsForUser)) : nullptr) + {} + + FLoginResult(const TSharedPtr& obj) : FLoginResult() + { + readFromValue(obj); + } + + ~FLoginResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithAndroidDeviceIDRequest : public FPlayFabBaseModel + { + // [optional] Specific model of the user's device. + FString AndroidDevice; + + // [optional] Android device identifier for the user's device. + FString AndroidDeviceId; + + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Specific Operating System version for the user's device. + FString OS; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithAndroidDeviceIDRequest() : + FPlayFabBaseModel(), + AndroidDevice(), + AndroidDeviceId(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + OS(), + PlayerSecret(), + TitleId() + {} + + FLoginWithAndroidDeviceIDRequest(const FLoginWithAndroidDeviceIDRequest& src) : + FPlayFabBaseModel(), + AndroidDevice(src.AndroidDevice), + AndroidDeviceId(src.AndroidDeviceId), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + OS(src.OS), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithAndroidDeviceIDRequest(const TSharedPtr& obj) : FLoginWithAndroidDeviceIDRequest() + { + readFromValue(obj); + } + + ~FLoginWithAndroidDeviceIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithCustomIDRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Custom unique identifier for the user, generated by the title. + FString CustomId; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithCustomIDRequest() : + FPlayFabBaseModel(), + CreateAccount(), + CustomId(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + TitleId() + {} + + FLoginWithCustomIDRequest(const FLoginWithCustomIDRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + CustomId(src.CustomId), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithCustomIDRequest(const TSharedPtr& obj) : FLoginWithCustomIDRequest() + { + readFromValue(obj); + } + + ~FLoginWithCustomIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithEmailAddressRequest : public FPlayFabBaseModel + { + // Email address for the account. + FString Email; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // Password for the PlayFab account (6-100 characters) + FString Password; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithEmailAddressRequest() : + FPlayFabBaseModel(), + Email(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + Password(), + TitleId() + {} + + FLoginWithEmailAddressRequest(const FLoginWithEmailAddressRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + Password(src.Password), + TitleId(src.TitleId) + {} + + FLoginWithEmailAddressRequest(const TSharedPtr& obj) : FLoginWithEmailAddressRequest() + { + readFromValue(obj); + } + + ~FLoginWithEmailAddressRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithFacebookInstantGamesIdRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // Facebook Instant Games signature for the user. + FString FacebookInstantGamesSignature; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithFacebookInstantGamesIdRequest() : + FPlayFabBaseModel(), + CreateAccount(), + EncryptedRequest(), + FacebookInstantGamesSignature(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + TitleId() + {} + + FLoginWithFacebookInstantGamesIdRequest(const FLoginWithFacebookInstantGamesIdRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + FacebookInstantGamesSignature(src.FacebookInstantGamesSignature), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithFacebookInstantGamesIdRequest(const TSharedPtr& obj) : FLoginWithFacebookInstantGamesIdRequest() + { + readFromValue(obj); + } + + ~FLoginWithFacebookInstantGamesIdRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithFacebookRequest : public FPlayFabBaseModel + { + // Unique identifier from Facebook for the user. + FString AccessToken; + + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithFacebookRequest() : + FPlayFabBaseModel(), + AccessToken(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + TitleId() + {} + + FLoginWithFacebookRequest(const FLoginWithFacebookRequest& src) : + FPlayFabBaseModel(), + AccessToken(src.AccessToken), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithFacebookRequest(const TSharedPtr& obj) : FLoginWithFacebookRequest() + { + readFromValue(obj); + } + + ~FLoginWithFacebookRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithGameCenterRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Unique Game Center player id. + FString PlayerId; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithGameCenterRequest() : + FPlayFabBaseModel(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerId(), + PlayerSecret(), + TitleId() + {} + + FLoginWithGameCenterRequest(const FLoginWithGameCenterRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerId(src.PlayerId), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithGameCenterRequest(const TSharedPtr& obj) : FLoginWithGameCenterRequest() + { + readFromValue(obj); + } + + ~FLoginWithGameCenterRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithGoogleAccountRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * [optional] OAuth 2.0 server authentication code obtained on the client by calling the getServerAuthCode() + * (https://developers.google.com/identity/sign-in/android/offline-access) Google client API. + */ + FString ServerAuthCode; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithGoogleAccountRequest() : + FPlayFabBaseModel(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + ServerAuthCode(), + TitleId() + {} + + FLoginWithGoogleAccountRequest(const FLoginWithGoogleAccountRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + ServerAuthCode(src.ServerAuthCode), + TitleId(src.TitleId) + {} + + FLoginWithGoogleAccountRequest(const TSharedPtr& obj) : FLoginWithGoogleAccountRequest() + { + readFromValue(obj); + } + + ~FLoginWithGoogleAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithIOSDeviceIDRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Vendor-specific iOS identifier for the user's device. + FString DeviceId; + + // [optional] Specific model of the user's device. + FString DeviceModel; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Specific Operating System version for the user's device. + FString OS; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithIOSDeviceIDRequest() : + FPlayFabBaseModel(), + CreateAccount(), + DeviceId(), + DeviceModel(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + OS(), + PlayerSecret(), + TitleId() + {} + + FLoginWithIOSDeviceIDRequest(const FLoginWithIOSDeviceIDRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + DeviceId(src.DeviceId), + DeviceModel(src.DeviceModel), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + OS(src.OS), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithIOSDeviceIDRequest(const TSharedPtr& obj) : FLoginWithIOSDeviceIDRequest() + { + readFromValue(obj); + } + + ~FLoginWithIOSDeviceIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithKongregateRequest : public FPlayFabBaseModel + { + // [optional] Token issued by Kongregate's client API for the user. + FString AuthTicket; + + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Numeric user ID assigned by Kongregate + FString KongregateId; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithKongregateRequest() : + FPlayFabBaseModel(), + AuthTicket(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + KongregateId(), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + TitleId() + {} + + FLoginWithKongregateRequest(const FLoginWithKongregateRequest& src) : + FPlayFabBaseModel(), + AuthTicket(src.AuthTicket), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + KongregateId(src.KongregateId), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithKongregateRequest(const TSharedPtr& obj) : FLoginWithKongregateRequest() + { + readFromValue(obj); + } + + ~FLoginWithKongregateRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithNintendoSwitchDeviceIdRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Nintendo Switch unique identifier for the user's device. + FString NintendoSwitchDeviceId; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithNintendoSwitchDeviceIdRequest() : + FPlayFabBaseModel(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + NintendoSwitchDeviceId(), + PlayerSecret(), + TitleId() + {} + + FLoginWithNintendoSwitchDeviceIdRequest(const FLoginWithNintendoSwitchDeviceIdRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithNintendoSwitchDeviceIdRequest(const TSharedPtr& obj) : FLoginWithNintendoSwitchDeviceIdRequest() + { + readFromValue(obj); + } + + ~FLoginWithNintendoSwitchDeviceIdRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithPlayFabRequest : public FPlayFabBaseModel + { + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // Password for the PlayFab account (6-100 characters) + FString Password; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + // PlayFab username for the account. + FString Username; + + FLoginWithPlayFabRequest() : + FPlayFabBaseModel(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + Password(), + TitleId(), + Username() + {} + + FLoginWithPlayFabRequest(const FLoginWithPlayFabRequest& src) : + FPlayFabBaseModel(), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + Password(src.Password), + TitleId(src.TitleId), + Username(src.Username) + {} + + FLoginWithPlayFabRequest(const TSharedPtr& obj) : FLoginWithPlayFabRequest() + { + readFromValue(obj); + } + + ~FLoginWithPlayFabRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithSteamRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * [optional] Authentication token for the user, returned as a byte array from Steam, and converted to a string (for example, the byte + * 0x08 should become "08"). + */ + FString SteamTicket; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithSteamRequest() : + FPlayFabBaseModel(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + SteamTicket(), + TitleId() + {} + + FLoginWithSteamRequest(const FLoginWithSteamRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + SteamTicket(src.SteamTicket), + TitleId(src.TitleId) + {} + + FLoginWithSteamRequest(const TSharedPtr& obj) : FLoginWithSteamRequest() + { + readFromValue(obj); + } + + ~FLoginWithSteamRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithTwitchRequest : public FPlayFabBaseModel + { + // [optional] Token issued by Twitch's API for the user. + FString AccessToken; + + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithTwitchRequest() : + FPlayFabBaseModel(), + AccessToken(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + TitleId() + {} + + FLoginWithTwitchRequest(const FLoginWithTwitchRequest& src) : + FPlayFabBaseModel(), + AccessToken(src.AccessToken), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithTwitchRequest(const TSharedPtr& obj) : FLoginWithTwitchRequest() + { + readFromValue(obj); + } + + ~FLoginWithTwitchRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithWindowsHelloRequest : public FPlayFabBaseModel + { + // The signed response from the user for the Challenge. + FString ChallengeSignature; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // SHA256 hash of the PublicKey generated by Windows Hello. + FString PublicKeyHint; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithWindowsHelloRequest() : + FPlayFabBaseModel(), + ChallengeSignature(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PublicKeyHint(), + TitleId() + {} + + FLoginWithWindowsHelloRequest(const FLoginWithWindowsHelloRequest& src) : + FPlayFabBaseModel(), + ChallengeSignature(src.ChallengeSignature), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PublicKeyHint(src.PublicKeyHint), + TitleId(src.TitleId) + {} + + FLoginWithWindowsHelloRequest(const TSharedPtr& obj) : FLoginWithWindowsHelloRequest() + { + readFromValue(obj); + } + + ~FLoginWithWindowsHelloRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithXboxRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + // [optional] Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + FString XboxToken; + + FLoginWithXboxRequest() : + FPlayFabBaseModel(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + TitleId(), + XboxToken() + {} + + FLoginWithXboxRequest(const FLoginWithXboxRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId), + XboxToken(src.XboxToken) + {} + + FLoginWithXboxRequest(const TSharedPtr& obj) : FLoginWithXboxRequest() + { + readFromValue(obj); + } + + ~FLoginWithXboxRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMatchmakeRequest : public FPlayFabBaseModel + { + // [optional] Build version to match against. [Note: Required if LobbyId is not specified] + FString BuildVersion; + + // [optional] Character to use for stats based matching. Leave null to use account stats. + FString CharacterId; + + // [optional] Game mode to match make against. [Note: Required if LobbyId is not specified] + FString GameMode; + + // [optional] Lobby identifier to match make against. This is used to select a specific Game Server Instance. + FString LobbyId; + + // [optional] Region to match make against. [Note: Required if LobbyId is not specified] + Boxed pfRegion; + + // [optional] Start a game session if one with an open slot is not found. Defaults to true. + Boxed StartNewIfNoneFound; + + // [optional] Player statistic to use in finding a match. May be null for no stat-based matching. + FString StatisticName; + + // [optional] Filter to include and/or exclude Game Server Instances associated with certain Tags + TSharedPtr TagFilter; + + FMatchmakeRequest() : + FPlayFabBaseModel(), + BuildVersion(), + CharacterId(), + GameMode(), + LobbyId(), + pfRegion(), + StartNewIfNoneFound(), + StatisticName(), + TagFilter(nullptr) + {} + + FMatchmakeRequest(const FMatchmakeRequest& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + CharacterId(src.CharacterId), + GameMode(src.GameMode), + LobbyId(src.LobbyId), + pfRegion(src.pfRegion), + StartNewIfNoneFound(src.StartNewIfNoneFound), + StatisticName(src.StatisticName), + TagFilter(src.TagFilter.IsValid() ? MakeShareable(new FCollectionFilter(*src.TagFilter)) : nullptr) + {} + + FMatchmakeRequest(const TSharedPtr& obj) : FMatchmakeRequest() + { + readFromValue(obj); + } + + ~FMatchmakeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum MatchmakeStatus + { + MatchmakeStatusComplete, + MatchmakeStatusWaiting, + MatchmakeStatusGameNotFound, + MatchmakeStatusNoAvailableSlots, + MatchmakeStatusSessionClosed + }; + + PLAYFABCPP_API void writeMatchmakeStatusEnumJSON(MatchmakeStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API MatchmakeStatus readMatchmakeStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API MatchmakeStatus readMatchmakeStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FMatchmakeResult : public FPlayFabBaseModel + { + // [optional] timestamp for when the server will expire, if applicable + FString Expires; + + // [optional] unique lobby identifier of the server matched + FString LobbyID; + + // [optional] time in milliseconds the application is configured to wait on matchmaking results + Boxed PollWaitTimeMS; + + // [optional] IPV4 address of the server + FString ServerHostname; + + // [optional] IPV4 address of the server + FString ServerIPV4Address; + + // [optional] IPV6 address of the server + FString ServerIPV6Address; + + // [optional] port number to use for non-http communications with the server + Boxed ServerPort; + + // [optional] Public DNS name (if any) of the server + FString ServerPublicDNSName; + + // [optional] result of match making process + Boxed Status; + + // [optional] server authorization ticket (used by RedeemMatchmakerTicket to validate user insertion into the game) + FString Ticket; + + FMatchmakeResult() : + FPlayFabBaseModel(), + Expires(), + LobbyID(), + PollWaitTimeMS(), + ServerHostname(), + ServerIPV4Address(), + ServerIPV6Address(), + ServerPort(), + ServerPublicDNSName(), + Status(), + Ticket() + {} + + FMatchmakeResult(const FMatchmakeResult& src) : + FPlayFabBaseModel(), + Expires(src.Expires), + LobbyID(src.LobbyID), + PollWaitTimeMS(src.PollWaitTimeMS), + ServerHostname(src.ServerHostname), + ServerIPV4Address(src.ServerIPV4Address), + ServerIPV6Address(src.ServerIPV6Address), + ServerPort(src.ServerPort), + ServerPublicDNSName(src.ServerPublicDNSName), + Status(src.Status), + Ticket(src.Ticket) + {} + + FMatchmakeResult(const TSharedPtr& obj) : FMatchmakeResult() + { + readFromValue(obj); + } + + ~FMatchmakeResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyUserVirtualCurrencyResult : public FPlayFabBaseModel + { + // Balance of the virtual currency after modification. + int32 Balance; + + /** + * Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase + * over this value will be discarded. + */ + int32 BalanceChange; + + // [optional] User currency was subtracted from. + FString PlayFabId; + + // [optional] Name of the virtual currency which was modified. + FString VirtualCurrency; + + FModifyUserVirtualCurrencyResult() : + FPlayFabBaseModel(), + Balance(0), + BalanceChange(0), + PlayFabId(), + VirtualCurrency() + {} + + FModifyUserVirtualCurrencyResult(const FModifyUserVirtualCurrencyResult& src) : + FPlayFabBaseModel(), + Balance(src.Balance), + BalanceChange(src.BalanceChange), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FModifyUserVirtualCurrencyResult(const TSharedPtr& obj) : FModifyUserVirtualCurrencyResult() + { + readFromValue(obj); + } + + ~FModifyUserVirtualCurrencyResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FOpenTradeRequest : public FPlayFabBaseModel + { + /** + * [optional] Players who are allowed to accept the trade. If null, the trade may be accepted by any player. If empty, the trade may + * not be accepted by any player. + */ + TArray AllowedPlayerIds; + // [optional] Player inventory items offered for trade. If not set, the trade is effectively a gift request + TArray OfferedInventoryInstanceIds; + // [optional] Catalog items accepted for the trade. If not set, the trade is effectively a gift. + TArray RequestedCatalogItemIds; + FOpenTradeRequest() : + FPlayFabBaseModel(), + AllowedPlayerIds(), + OfferedInventoryInstanceIds(), + RequestedCatalogItemIds() + {} + + FOpenTradeRequest(const FOpenTradeRequest& src) : + FPlayFabBaseModel(), + AllowedPlayerIds(src.AllowedPlayerIds), + OfferedInventoryInstanceIds(src.OfferedInventoryInstanceIds), + RequestedCatalogItemIds(src.RequestedCatalogItemIds) + {} + + FOpenTradeRequest(const TSharedPtr& obj) : FOpenTradeRequest() + { + readFromValue(obj); + } + + ~FOpenTradeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FOpenTradeResponse : public FPlayFabBaseModel + { + // [optional] The information about the trade that was just opened. + TSharedPtr Trade; + + FOpenTradeResponse() : + FPlayFabBaseModel(), + Trade(nullptr) + {} + + FOpenTradeResponse(const FOpenTradeResponse& src) : + FPlayFabBaseModel(), + Trade(src.Trade.IsValid() ? MakeShareable(new FTradeInfo(*src.Trade)) : nullptr) + {} + + FOpenTradeResponse(const TSharedPtr& obj) : FOpenTradeResponse() + { + readFromValue(obj); + } + + ~FOpenTradeResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPayForPurchaseRequest : public FPlayFabBaseModel + { + // Currency to use to fund the purchase. + FString Currency; + + // Purchase order identifier returned from StartPurchase. + FString OrderId; + + // Payment provider to use to fund the purchase. + FString ProviderName; + + // [optional] Payment provider transaction identifier. Required for Facebook Payments. + FString ProviderTransactionId; + + FPayForPurchaseRequest() : + FPlayFabBaseModel(), + Currency(), + OrderId(), + ProviderName(), + ProviderTransactionId() + {} + + FPayForPurchaseRequest(const FPayForPurchaseRequest& src) : + FPlayFabBaseModel(), + Currency(src.Currency), + OrderId(src.OrderId), + ProviderName(src.ProviderName), + ProviderTransactionId(src.ProviderTransactionId) + {} + + FPayForPurchaseRequest(const TSharedPtr& obj) : FPayForPurchaseRequest() + { + readFromValue(obj); + } + + ~FPayForPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum TransactionStatus + { + TransactionStatusCreateCart, + TransactionStatusInit, + TransactionStatusApproved, + TransactionStatusSucceeded, + TransactionStatusFailedByProvider, + TransactionStatusDisputePending, + TransactionStatusRefundPending, + TransactionStatusRefunded, + TransactionStatusRefundFailed, + TransactionStatusChargedBack, + TransactionStatusFailedByUber, + TransactionStatusFailedByPlayFab, + TransactionStatusRevoked, + TransactionStatusTradePending, + TransactionStatusTraded, + TransactionStatusUpgraded, + TransactionStatusStackPending, + TransactionStatusStacked, + TransactionStatusOther, + TransactionStatusFailed + }; + + PLAYFABCPP_API void writeTransactionStatusEnumJSON(TransactionStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API TransactionStatus readTransactionStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API TransactionStatus readTransactionStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FPayForPurchaseResult : public FPlayFabBaseModel + { + // Local credit applied to the transaction (provider specific). + uint32 CreditApplied; + + // [optional] Purchase order identifier. + FString OrderId; + + // [optional] Provider used for the transaction. + FString ProviderData; + + // [optional] A token generated by the provider to authenticate the request (provider-specific). + FString ProviderToken; + + // [optional] URL to the purchase provider page that details the purchase. + FString PurchaseConfirmationPageURL; + + // [optional] Currency for the transaction, may be a virtual currency or real money. + FString PurchaseCurrency; + + // Cost of the transaction. + uint32 PurchasePrice; + + // [optional] Status of the transaction. + Boxed Status; + + // [optional] Virtual currencies granted by the transaction, if any. + TMap VCAmount; + // [optional] Current virtual currency balances for the user. + TMap VirtualCurrency; + FPayForPurchaseResult() : + FPlayFabBaseModel(), + CreditApplied(0), + OrderId(), + ProviderData(), + ProviderToken(), + PurchaseConfirmationPageURL(), + PurchaseCurrency(), + PurchasePrice(0), + Status(), + VCAmount(), + VirtualCurrency() + {} + + FPayForPurchaseResult(const FPayForPurchaseResult& src) : + FPlayFabBaseModel(), + CreditApplied(src.CreditApplied), + OrderId(src.OrderId), + ProviderData(src.ProviderData), + ProviderToken(src.ProviderToken), + PurchaseConfirmationPageURL(src.PurchaseConfirmationPageURL), + PurchaseCurrency(src.PurchaseCurrency), + PurchasePrice(src.PurchasePrice), + Status(src.Status), + VCAmount(src.VCAmount), + VirtualCurrency(src.VirtualCurrency) + {} + + FPayForPurchaseResult(const TSharedPtr& obj) : FPayForPurchaseResult() + { + readFromValue(obj); + } + + ~FPayForPurchaseResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPaymentOption : public FPlayFabBaseModel + { + // [optional] Specific currency to use to fund the purchase. + FString Currency; + + // Amount of the specified currency needed for the purchase. + uint32 Price; + + // [optional] Name of the purchase provider for this option. + FString ProviderName; + + // Amount of existing credit the user has with the provider. + uint32 StoreCredit; + + FPaymentOption() : + FPlayFabBaseModel(), + Currency(), + Price(0), + ProviderName(), + StoreCredit(0) + {} + + FPaymentOption(const FPaymentOption& src) : + FPlayFabBaseModel(), + Currency(src.Currency), + Price(src.Price), + ProviderName(src.ProviderName), + StoreCredit(src.StoreCredit) + {} + + FPaymentOption(const TSharedPtr& obj) : FPaymentOption() + { + readFromValue(obj); + } + + ~FPaymentOption(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPurchaseItemRequest : public FPlayFabBaseModel + { + // [optional] Catalog version for the items to be purchased (defaults to most recent version. + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique identifier of the item to purchase. + FString ItemId; + + // Price the client expects to pay for the item (in case a new catalog or store was uploaded, with new prices). + int32 Price; + + // [optional] Store to buy this item through. If not set, prices default to those in the catalog. + FString StoreId; + + // Virtual currency to use to purchase the item. + FString VirtualCurrency; + + FPurchaseItemRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + ItemId(), + Price(0), + StoreId(), + VirtualCurrency() + {} + + FPurchaseItemRequest(const FPurchaseItemRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + ItemId(src.ItemId), + Price(src.Price), + StoreId(src.StoreId), + VirtualCurrency(src.VirtualCurrency) + {} + + FPurchaseItemRequest(const TSharedPtr& obj) : FPurchaseItemRequest() + { + readFromValue(obj); + } + + ~FPurchaseItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPurchaseItemResult : public FPlayFabBaseModel + { + // [optional] Details for the items purchased. + TArray Items; + FPurchaseItemResult() : + FPlayFabBaseModel(), + Items() + {} + + FPurchaseItemResult(const FPurchaseItemResult& src) : + FPlayFabBaseModel(), + Items(src.Items) + {} + + FPurchaseItemResult(const TSharedPtr& obj) : FPurchaseItemResult() + { + readFromValue(obj); + } + + ~FPurchaseItemResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRedeemCouponRequest : public FPlayFabBaseModel + { + // [optional] Catalog version of the coupon. If null, uses the default catalog + FString CatalogVersion; + + // [optional] Optional identifier for the Character that should receive the item. If null, item is added to the player + FString CharacterId; + + // Generated coupon code to redeem. + FString CouponCode; + + FRedeemCouponRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + CouponCode() + {} + + FRedeemCouponRequest(const FRedeemCouponRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + CouponCode(src.CouponCode) + {} + + FRedeemCouponRequest(const TSharedPtr& obj) : FRedeemCouponRequest() + { + readFromValue(obj); + } + + ~FRedeemCouponRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRedeemCouponResult : public FPlayFabBaseModel + { + // [optional] Items granted to the player as a result of redeeming the coupon. + TArray GrantedItems; + FRedeemCouponResult() : + FPlayFabBaseModel(), + GrantedItems() + {} + + FRedeemCouponResult(const FRedeemCouponResult& src) : + FPlayFabBaseModel(), + GrantedItems(src.GrantedItems) + {} + + FRedeemCouponResult(const TSharedPtr& obj) : FRedeemCouponResult() + { + readFromValue(obj); + } + + ~FRedeemCouponResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegisterForIOSPushNotificationRequest : public FPlayFabBaseModel + { + // [optional] Message to display when confirming push notification. + FString ConfirmationMessage; + + // Unique token generated by the Apple Push Notification service when the title registered to receive push notifications. + FString DeviceToken; + + // [optional] If true, send a test push message immediately after sucessful registration. Defaults to false. + Boxed SendPushNotificationConfirmation; + + FRegisterForIOSPushNotificationRequest() : + FPlayFabBaseModel(), + ConfirmationMessage(), + DeviceToken(), + SendPushNotificationConfirmation() + {} + + FRegisterForIOSPushNotificationRequest(const FRegisterForIOSPushNotificationRequest& src) : + FPlayFabBaseModel(), + ConfirmationMessage(src.ConfirmationMessage), + DeviceToken(src.DeviceToken), + SendPushNotificationConfirmation(src.SendPushNotificationConfirmation) + {} + + FRegisterForIOSPushNotificationRequest(const TSharedPtr& obj) : FRegisterForIOSPushNotificationRequest() + { + readFromValue(obj); + } + + ~FRegisterForIOSPushNotificationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegisterForIOSPushNotificationResult : public FPlayFabBaseModel + { + FRegisterForIOSPushNotificationResult() : + FPlayFabBaseModel() + {} + + FRegisterForIOSPushNotificationResult(const FRegisterForIOSPushNotificationResult& src) : + FPlayFabBaseModel() + {} + + FRegisterForIOSPushNotificationResult(const TSharedPtr& obj) : FRegisterForIOSPushNotificationResult() + { + readFromValue(obj); + } + + ~FRegisterForIOSPushNotificationResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegisterPlayFabUserRequest : public FPlayFabBaseModel + { + // [optional] An optional parameter for setting the display name for this title (3-25 characters). + FString DisplayName; + + // [optional] User email address attached to their account + FString Email; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Password for the PlayFab account (6-100 characters) + FString Password; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * [optional] An optional parameter that specifies whether both the username and email parameters are required. If true, both + * parameters are required; if false, the user must supply either the username or email parameter. The default value is + * true. + */ + Boxed RequireBothUsernameAndEmail; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + // [optional] PlayFab username for the account (3-20 characters) + FString Username; + + FRegisterPlayFabUserRequest() : + FPlayFabBaseModel(), + DisplayName(), + Email(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + Password(), + PlayerSecret(), + RequireBothUsernameAndEmail(), + TitleId(), + Username() + {} + + FRegisterPlayFabUserRequest(const FRegisterPlayFabUserRequest& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName), + Email(src.Email), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + Password(src.Password), + PlayerSecret(src.PlayerSecret), + RequireBothUsernameAndEmail(src.RequireBothUsernameAndEmail), + TitleId(src.TitleId), + Username(src.Username) + {} + + FRegisterPlayFabUserRequest(const TSharedPtr& obj) : FRegisterPlayFabUserRequest() + { + readFromValue(obj); + } + + ~FRegisterPlayFabUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegisterPlayFabUserResult : public FPlayFabBaseModel + { + /** + * [optional] If LoginTitlePlayerAccountEntity flag is set on the login request the title_player_account will also be logged in and + * returned. + */ + TSharedPtr EntityToken; + + // [optional] PlayFab unique identifier for this newly created account. + FString PlayFabId; + + // [optional] Unique token identifying the user and game at the server level, for the current session. + FString SessionTicket; + + // [optional] Settings specific to this user. + TSharedPtr SettingsForUser; + + // [optional] PlayFab unique user name. + FString Username; + + FRegisterPlayFabUserResult() : + FPlayFabBaseModel(), + EntityToken(nullptr), + PlayFabId(), + SessionTicket(), + SettingsForUser(nullptr), + Username() + {} + + FRegisterPlayFabUserResult(const FRegisterPlayFabUserResult& src) : + FPlayFabBaseModel(), + EntityToken(src.EntityToken.IsValid() ? MakeShareable(new FEntityTokenResponse(*src.EntityToken)) : nullptr), + PlayFabId(src.PlayFabId), + SessionTicket(src.SessionTicket), + SettingsForUser(src.SettingsForUser.IsValid() ? MakeShareable(new FUserSettings(*src.SettingsForUser)) : nullptr), + Username(src.Username) + {} + + FRegisterPlayFabUserResult(const TSharedPtr& obj) : FRegisterPlayFabUserResult() + { + readFromValue(obj); + } + + ~FRegisterPlayFabUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegisterWithWindowsHelloRequest : public FPlayFabBaseModel + { + // [optional] Device name. + FString DeviceName; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + // [optional] PublicKey generated by Windows Hello. + FString PublicKey; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + // [optional] Player's user name used by Windows Hello. + FString UserName; + + FRegisterWithWindowsHelloRequest() : + FPlayFabBaseModel(), + DeviceName(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + PublicKey(), + TitleId(), + UserName() + {} + + FRegisterWithWindowsHelloRequest(const FRegisterWithWindowsHelloRequest& src) : + FPlayFabBaseModel(), + DeviceName(src.DeviceName), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + PublicKey(src.PublicKey), + TitleId(src.TitleId), + UserName(src.UserName) + {} + + FRegisterWithWindowsHelloRequest(const TSharedPtr& obj) : FRegisterWithWindowsHelloRequest() + { + readFromValue(obj); + } + + ~FRegisterWithWindowsHelloRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveContactEmailRequest : public FPlayFabBaseModel + { + FRemoveContactEmailRequest() : + FPlayFabBaseModel() + {} + + FRemoveContactEmailRequest(const FRemoveContactEmailRequest& src) : + FPlayFabBaseModel() + {} + + FRemoveContactEmailRequest(const TSharedPtr& obj) : FRemoveContactEmailRequest() + { + readFromValue(obj); + } + + ~FRemoveContactEmailRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveContactEmailResult : public FPlayFabBaseModel + { + FRemoveContactEmailResult() : + FPlayFabBaseModel() + {} + + FRemoveContactEmailResult(const FRemoveContactEmailResult& src) : + FPlayFabBaseModel() + {} + + FRemoveContactEmailResult(const TSharedPtr& obj) : FRemoveContactEmailResult() + { + readFromValue(obj); + } + + ~FRemoveContactEmailResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveFriendRequest : public FPlayFabBaseModel + { + // PlayFab identifier of the friend account which is to be removed. + FString FriendPlayFabId; + + FRemoveFriendRequest() : + FPlayFabBaseModel(), + FriendPlayFabId() + {} + + FRemoveFriendRequest(const FRemoveFriendRequest& src) : + FPlayFabBaseModel(), + FriendPlayFabId(src.FriendPlayFabId) + {} + + FRemoveFriendRequest(const TSharedPtr& obj) : FRemoveFriendRequest() + { + readFromValue(obj); + } + + ~FRemoveFriendRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveFriendResult : public FPlayFabBaseModel + { + FRemoveFriendResult() : + FPlayFabBaseModel() + {} + + FRemoveFriendResult(const FRemoveFriendResult& src) : + FPlayFabBaseModel() + {} + + FRemoveFriendResult(const TSharedPtr& obj) : FRemoveFriendResult() + { + readFromValue(obj); + } + + ~FRemoveFriendResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveGenericIDRequest : public FPlayFabBaseModel + { + // Generic service identifier to be removed from the player. + FGenericServiceId GenericId; + + FRemoveGenericIDRequest() : + FPlayFabBaseModel(), + GenericId() + {} + + FRemoveGenericIDRequest(const FRemoveGenericIDRequest& src) : + FPlayFabBaseModel(), + GenericId(src.GenericId) + {} + + FRemoveGenericIDRequest(const TSharedPtr& obj) : FRemoveGenericIDRequest() + { + readFromValue(obj); + } + + ~FRemoveGenericIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveGenericIDResult : public FPlayFabBaseModel + { + FRemoveGenericIDResult() : + FPlayFabBaseModel() + {} + + FRemoveGenericIDResult(const FRemoveGenericIDResult& src) : + FPlayFabBaseModel() + {} + + FRemoveGenericIDResult(const TSharedPtr& obj) : FRemoveGenericIDResult() + { + readFromValue(obj); + } + + ~FRemoveGenericIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveSharedGroupMembersRequest : public FPlayFabBaseModel + { + // An array of unique PlayFab assigned ID of the user on whom the operation will be performed. + TArray PlayFabIds; + // Unique identifier for the shared group. + FString SharedGroupId; + + FRemoveSharedGroupMembersRequest() : + FPlayFabBaseModel(), + PlayFabIds(), + SharedGroupId() + {} + + FRemoveSharedGroupMembersRequest(const FRemoveSharedGroupMembersRequest& src) : + FPlayFabBaseModel(), + PlayFabIds(src.PlayFabIds), + SharedGroupId(src.SharedGroupId) + {} + + FRemoveSharedGroupMembersRequest(const TSharedPtr& obj) : FRemoveSharedGroupMembersRequest() + { + readFromValue(obj); + } + + ~FRemoveSharedGroupMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveSharedGroupMembersResult : public FPlayFabBaseModel + { + FRemoveSharedGroupMembersResult() : + FPlayFabBaseModel() + {} + + FRemoveSharedGroupMembersResult(const FRemoveSharedGroupMembersResult& src) : + FPlayFabBaseModel() + {} + + FRemoveSharedGroupMembersResult(const TSharedPtr& obj) : FRemoveSharedGroupMembersResult() + { + readFromValue(obj); + } + + ~FRemoveSharedGroupMembersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FReportPlayerClientRequest : public FPlayFabBaseModel + { + // [optional] Optional additional comment by reporting player. + FString Comment; + + // Unique PlayFab identifier of the reported player. + FString ReporteeId; + + FReportPlayerClientRequest() : + FPlayFabBaseModel(), + Comment(), + ReporteeId() + {} + + FReportPlayerClientRequest(const FReportPlayerClientRequest& src) : + FPlayFabBaseModel(), + Comment(src.Comment), + ReporteeId(src.ReporteeId) + {} + + FReportPlayerClientRequest(const TSharedPtr& obj) : FReportPlayerClientRequest() + { + readFromValue(obj); + } + + ~FReportPlayerClientRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FReportPlayerClientResult : public FPlayFabBaseModel + { + // The number of remaining reports which may be filed today. + int32 SubmissionsRemaining; + + FReportPlayerClientResult() : + FPlayFabBaseModel(), + SubmissionsRemaining(0) + {} + + FReportPlayerClientResult(const FReportPlayerClientResult& src) : + FPlayFabBaseModel(), + SubmissionsRemaining(src.SubmissionsRemaining) + {} + + FReportPlayerClientResult(const TSharedPtr& obj) : FReportPlayerClientResult() + { + readFromValue(obj); + } + + ~FReportPlayerClientResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRestoreIOSPurchasesRequest : public FPlayFabBaseModel + { + // Base64 encoded receipt data, passed back by the App Store as a result of a successful purchase. + FString ReceiptData; + + FRestoreIOSPurchasesRequest() : + FPlayFabBaseModel(), + ReceiptData() + {} + + FRestoreIOSPurchasesRequest(const FRestoreIOSPurchasesRequest& src) : + FPlayFabBaseModel(), + ReceiptData(src.ReceiptData) + {} + + FRestoreIOSPurchasesRequest(const TSharedPtr& obj) : FRestoreIOSPurchasesRequest() + { + readFromValue(obj); + } + + ~FRestoreIOSPurchasesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRestoreIOSPurchasesResult : public FPlayFabBaseModel + { + FRestoreIOSPurchasesResult() : + FPlayFabBaseModel() + {} + + FRestoreIOSPurchasesResult(const FRestoreIOSPurchasesResult& src) : + FPlayFabBaseModel() + {} + + FRestoreIOSPurchasesResult(const TSharedPtr& obj) : FRestoreIOSPurchasesResult() + { + readFromValue(obj); + } + + ~FRestoreIOSPurchasesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendAccountRecoveryEmailRequest : public FPlayFabBaseModel + { + // User email address attached to their account + FString Email; + + // [optional] The email template id of the account recovery email template to send. + FString EmailTemplateId; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FSendAccountRecoveryEmailRequest() : + FPlayFabBaseModel(), + Email(), + EmailTemplateId(), + TitleId() + {} + + FSendAccountRecoveryEmailRequest(const FSendAccountRecoveryEmailRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + EmailTemplateId(src.EmailTemplateId), + TitleId(src.TitleId) + {} + + FSendAccountRecoveryEmailRequest(const TSharedPtr& obj) : FSendAccountRecoveryEmailRequest() + { + readFromValue(obj); + } + + ~FSendAccountRecoveryEmailRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendAccountRecoveryEmailResult : public FPlayFabBaseModel + { + FSendAccountRecoveryEmailResult() : + FPlayFabBaseModel() + {} + + FSendAccountRecoveryEmailResult(const FSendAccountRecoveryEmailResult& src) : + FPlayFabBaseModel() + {} + + FSendAccountRecoveryEmailResult(const TSharedPtr& obj) : FSendAccountRecoveryEmailResult() + { + readFromValue(obj); + } + + ~FSendAccountRecoveryEmailResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetFriendTagsRequest : public FPlayFabBaseModel + { + // PlayFab identifier of the friend account to which the tag(s) should be applied. + FString FriendPlayFabId; + + // Array of tags to set on the friend account. + TArray Tags; + FSetFriendTagsRequest() : + FPlayFabBaseModel(), + FriendPlayFabId(), + Tags() + {} + + FSetFriendTagsRequest(const FSetFriendTagsRequest& src) : + FPlayFabBaseModel(), + FriendPlayFabId(src.FriendPlayFabId), + Tags(src.Tags) + {} + + FSetFriendTagsRequest(const TSharedPtr& obj) : FSetFriendTagsRequest() + { + readFromValue(obj); + } + + ~FSetFriendTagsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetFriendTagsResult : public FPlayFabBaseModel + { + FSetFriendTagsResult() : + FPlayFabBaseModel() + {} + + FSetFriendTagsResult(const FSetFriendTagsResult& src) : + FPlayFabBaseModel() + {} + + FSetFriendTagsResult(const TSharedPtr& obj) : FSetFriendTagsResult() + { + readFromValue(obj); + } + + ~FSetFriendTagsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPlayerSecretRequest : public FPlayFabBaseModel + { + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + FSetPlayerSecretRequest() : + FPlayFabBaseModel(), + EncryptedRequest(), + PlayerSecret() + {} + + FSetPlayerSecretRequest(const FSetPlayerSecretRequest& src) : + FPlayFabBaseModel(), + EncryptedRequest(src.EncryptedRequest), + PlayerSecret(src.PlayerSecret) + {} + + FSetPlayerSecretRequest(const TSharedPtr& obj) : FSetPlayerSecretRequest() + { + readFromValue(obj); + } + + ~FSetPlayerSecretRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPlayerSecretResult : public FPlayFabBaseModel + { + FSetPlayerSecretResult() : + FPlayFabBaseModel() + {} + + FSetPlayerSecretResult(const FSetPlayerSecretResult& src) : + FPlayFabBaseModel() + {} + + FSetPlayerSecretResult(const TSharedPtr& obj) : FSetPlayerSecretResult() + { + readFromValue(obj); + } + + ~FSetPlayerSecretResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStartGameRequest : public FPlayFabBaseModel + { + // version information for the build of the game server which is to be started + FString BuildVersion; + + // [optional] character to use for stats based matching. Leave null to use account stats + FString CharacterId; + + // [optional] custom command line argument when starting game server process + FString CustomCommandLineData; + + // the title-defined game mode this server is to be running (defaults to 0 if there is only one mode) + FString GameMode; + + // the region to associate this server with for match filtering + Region pfRegion; + + // [optional] player statistic for others to use in finding this game. May be null for no stat-based matching + FString StatisticName; + + FStartGameRequest() : + FPlayFabBaseModel(), + BuildVersion(), + CharacterId(), + CustomCommandLineData(), + GameMode(), + pfRegion(), + StatisticName() + {} + + FStartGameRequest(const FStartGameRequest& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + CharacterId(src.CharacterId), + CustomCommandLineData(src.CustomCommandLineData), + GameMode(src.GameMode), + pfRegion(src.pfRegion), + StatisticName(src.StatisticName) + {} + + FStartGameRequest(const TSharedPtr& obj) : FStartGameRequest() + { + readFromValue(obj); + } + + ~FStartGameRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStartGameResult : public FPlayFabBaseModel + { + // [optional] timestamp for when the server should expire, if applicable + FString Expires; + + // [optional] unique identifier for the lobby of the server started + FString LobbyID; + + // [optional] password required to log into the server + FString Password; + + // [optional] server IPV4 address + FString ServerHostname; + + // [optional] server IPV4 address + FString ServerIPV4Address; + + // [optional] server IPV6 address + FString ServerIPV6Address; + + // [optional] port on the server to be used for communication + Boxed ServerPort; + + // [optional] server public DNS name + FString ServerPublicDNSName; + + // [optional] unique identifier for the server + FString Ticket; + + FStartGameResult() : + FPlayFabBaseModel(), + Expires(), + LobbyID(), + Password(), + ServerHostname(), + ServerIPV4Address(), + ServerIPV6Address(), + ServerPort(), + ServerPublicDNSName(), + Ticket() + {} + + FStartGameResult(const FStartGameResult& src) : + FPlayFabBaseModel(), + Expires(src.Expires), + LobbyID(src.LobbyID), + Password(src.Password), + ServerHostname(src.ServerHostname), + ServerIPV4Address(src.ServerIPV4Address), + ServerIPV6Address(src.ServerIPV6Address), + ServerPort(src.ServerPort), + ServerPublicDNSName(src.ServerPublicDNSName), + Ticket(src.Ticket) + {} + + FStartGameResult(const TSharedPtr& obj) : FStartGameResult() + { + readFromValue(obj); + } + + ~FStartGameResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStartPurchaseRequest : public FPlayFabBaseModel + { + // [optional] Catalog version for the items to be purchased. Defaults to most recent catalog. + FString CatalogVersion; + + // Array of items to purchase. + TArray Items; + // [optional] Store through which to purchase items. If not set, prices will be pulled from the catalog itself. + FString StoreId; + + FStartPurchaseRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + Items(), + StoreId() + {} + + FStartPurchaseRequest(const FStartPurchaseRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + Items(src.Items), + StoreId(src.StoreId) + {} + + FStartPurchaseRequest(const TSharedPtr& obj) : FStartPurchaseRequest() + { + readFromValue(obj); + } + + ~FStartPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStartPurchaseResult : public FPlayFabBaseModel + { + // [optional] Cart items to be purchased. + TArray Contents; + // [optional] Purchase order identifier. + FString OrderId; + + // [optional] Available methods by which the user can pay. + TArray PaymentOptions; + // [optional] Current virtual currency totals for the user. + TMap VirtualCurrencyBalances; + FStartPurchaseResult() : + FPlayFabBaseModel(), + Contents(), + OrderId(), + PaymentOptions(), + VirtualCurrencyBalances() + {} + + FStartPurchaseResult(const FStartPurchaseResult& src) : + FPlayFabBaseModel(), + Contents(src.Contents), + OrderId(src.OrderId), + PaymentOptions(src.PaymentOptions), + VirtualCurrencyBalances(src.VirtualCurrencyBalances) + {} + + FStartPurchaseResult(const TSharedPtr& obj) : FStartPurchaseResult() + { + readFromValue(obj); + } + + ~FStartPurchaseResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticUpdate : public FPlayFabBaseModel + { + // unique name of the statistic + FString StatisticName; + + // statistic value for the player + int32 Value; + + /** + * [optional] for updates to an existing statistic value for a player, the version of the statistic when it was loaded. Null when + * setting the statistic value for the first time. + */ + Boxed Version; + + FStatisticUpdate() : + FPlayFabBaseModel(), + StatisticName(), + Value(0), + Version() + {} + + FStatisticUpdate(const FStatisticUpdate& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName), + Value(src.Value), + Version(src.Version) + {} + + FStatisticUpdate(const TSharedPtr& obj) : FStatisticUpdate() + { + readFromValue(obj); + } + + ~FStatisticUpdate(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSubtractUserVirtualCurrencyRequest : public FPlayFabBaseModel + { + // Amount to be subtracted from the user balance of the specified virtual currency. + int32 Amount; + + // Name of the virtual currency which is to be decremented. + FString VirtualCurrency; + + FSubtractUserVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + VirtualCurrency() + {} + + FSubtractUserVirtualCurrencyRequest(const FSubtractUserVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + VirtualCurrency(src.VirtualCurrency) + {} + + FSubtractUserVirtualCurrencyRequest(const TSharedPtr& obj) : FSubtractUserVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FSubtractUserVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkAndroidDeviceIDRequest : public FPlayFabBaseModel + { + /** + * [optional] Android device identifier for the user's device. If not specified, the most recently signed in Android Device ID will be + * used. + */ + FString AndroidDeviceId; + + FUnlinkAndroidDeviceIDRequest() : + FPlayFabBaseModel(), + AndroidDeviceId() + {} + + FUnlinkAndroidDeviceIDRequest(const FUnlinkAndroidDeviceIDRequest& src) : + FPlayFabBaseModel(), + AndroidDeviceId(src.AndroidDeviceId) + {} + + FUnlinkAndroidDeviceIDRequest(const TSharedPtr& obj) : FUnlinkAndroidDeviceIDRequest() + { + readFromValue(obj); + } + + ~FUnlinkAndroidDeviceIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkAndroidDeviceIDResult : public FPlayFabBaseModel + { + FUnlinkAndroidDeviceIDResult() : + FPlayFabBaseModel() + {} + + FUnlinkAndroidDeviceIDResult(const FUnlinkAndroidDeviceIDResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkAndroidDeviceIDResult(const TSharedPtr& obj) : FUnlinkAndroidDeviceIDResult() + { + readFromValue(obj); + } + + ~FUnlinkAndroidDeviceIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkCustomIDRequest : public FPlayFabBaseModel + { + /** + * [optional] Custom unique identifier for the user, generated by the title. If not specified, the most recently signed in Custom ID + * will be used. + */ + FString CustomId; + + FUnlinkCustomIDRequest() : + FPlayFabBaseModel(), + CustomId() + {} + + FUnlinkCustomIDRequest(const FUnlinkCustomIDRequest& src) : + FPlayFabBaseModel(), + CustomId(src.CustomId) + {} + + FUnlinkCustomIDRequest(const TSharedPtr& obj) : FUnlinkCustomIDRequest() + { + readFromValue(obj); + } + + ~FUnlinkCustomIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkCustomIDResult : public FPlayFabBaseModel + { + FUnlinkCustomIDResult() : + FPlayFabBaseModel() + {} + + FUnlinkCustomIDResult(const FUnlinkCustomIDResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkCustomIDResult(const TSharedPtr& obj) : FUnlinkCustomIDResult() + { + readFromValue(obj); + } + + ~FUnlinkCustomIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkFacebookAccountRequest : public FPlayFabBaseModel + { + FUnlinkFacebookAccountRequest() : + FPlayFabBaseModel() + {} + + FUnlinkFacebookAccountRequest(const FUnlinkFacebookAccountRequest& src) : + FPlayFabBaseModel() + {} + + FUnlinkFacebookAccountRequest(const TSharedPtr& obj) : FUnlinkFacebookAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkFacebookAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkFacebookAccountResult : public FPlayFabBaseModel + { + FUnlinkFacebookAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkFacebookAccountResult(const FUnlinkFacebookAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkFacebookAccountResult(const TSharedPtr& obj) : FUnlinkFacebookAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkFacebookAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkFacebookInstantGamesIdRequest : public FPlayFabBaseModel + { + // [optional] Facebook Instant Games identifier for the user. If not specified, the most recently signed in ID will be used. + FString FacebookInstantGamesId; + + FUnlinkFacebookInstantGamesIdRequest() : + FPlayFabBaseModel(), + FacebookInstantGamesId() + {} + + FUnlinkFacebookInstantGamesIdRequest(const FUnlinkFacebookInstantGamesIdRequest& src) : + FPlayFabBaseModel(), + FacebookInstantGamesId(src.FacebookInstantGamesId) + {} + + FUnlinkFacebookInstantGamesIdRequest(const TSharedPtr& obj) : FUnlinkFacebookInstantGamesIdRequest() + { + readFromValue(obj); + } + + ~FUnlinkFacebookInstantGamesIdRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkFacebookInstantGamesIdResult : public FPlayFabBaseModel + { + FUnlinkFacebookInstantGamesIdResult() : + FPlayFabBaseModel() + {} + + FUnlinkFacebookInstantGamesIdResult(const FUnlinkFacebookInstantGamesIdResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkFacebookInstantGamesIdResult(const TSharedPtr& obj) : FUnlinkFacebookInstantGamesIdResult() + { + readFromValue(obj); + } + + ~FUnlinkFacebookInstantGamesIdResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkGameCenterAccountRequest : public FPlayFabBaseModel + { + FUnlinkGameCenterAccountRequest() : + FPlayFabBaseModel() + {} + + FUnlinkGameCenterAccountRequest(const FUnlinkGameCenterAccountRequest& src) : + FPlayFabBaseModel() + {} + + FUnlinkGameCenterAccountRequest(const TSharedPtr& obj) : FUnlinkGameCenterAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkGameCenterAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkGameCenterAccountResult : public FPlayFabBaseModel + { + FUnlinkGameCenterAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkGameCenterAccountResult(const FUnlinkGameCenterAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkGameCenterAccountResult(const TSharedPtr& obj) : FUnlinkGameCenterAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkGameCenterAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkGoogleAccountRequest : public FPlayFabBaseModel + { + FUnlinkGoogleAccountRequest() : + FPlayFabBaseModel() + {} + + FUnlinkGoogleAccountRequest(const FUnlinkGoogleAccountRequest& src) : + FPlayFabBaseModel() + {} + + FUnlinkGoogleAccountRequest(const TSharedPtr& obj) : FUnlinkGoogleAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkGoogleAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkGoogleAccountResult : public FPlayFabBaseModel + { + FUnlinkGoogleAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkGoogleAccountResult(const FUnlinkGoogleAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkGoogleAccountResult(const TSharedPtr& obj) : FUnlinkGoogleAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkGoogleAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkIOSDeviceIDRequest : public FPlayFabBaseModel + { + /** + * [optional] Vendor-specific iOS identifier for the user's device. If not specified, the most recently signed in iOS Device ID will + * be used. + */ + FString DeviceId; + + FUnlinkIOSDeviceIDRequest() : + FPlayFabBaseModel(), + DeviceId() + {} + + FUnlinkIOSDeviceIDRequest(const FUnlinkIOSDeviceIDRequest& src) : + FPlayFabBaseModel(), + DeviceId(src.DeviceId) + {} + + FUnlinkIOSDeviceIDRequest(const TSharedPtr& obj) : FUnlinkIOSDeviceIDRequest() + { + readFromValue(obj); + } + + ~FUnlinkIOSDeviceIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkIOSDeviceIDResult : public FPlayFabBaseModel + { + FUnlinkIOSDeviceIDResult() : + FPlayFabBaseModel() + {} + + FUnlinkIOSDeviceIDResult(const FUnlinkIOSDeviceIDResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkIOSDeviceIDResult(const TSharedPtr& obj) : FUnlinkIOSDeviceIDResult() + { + readFromValue(obj); + } + + ~FUnlinkIOSDeviceIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkKongregateAccountRequest : public FPlayFabBaseModel + { + FUnlinkKongregateAccountRequest() : + FPlayFabBaseModel() + {} + + FUnlinkKongregateAccountRequest(const FUnlinkKongregateAccountRequest& src) : + FPlayFabBaseModel() + {} + + FUnlinkKongregateAccountRequest(const TSharedPtr& obj) : FUnlinkKongregateAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkKongregateAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkKongregateAccountResult : public FPlayFabBaseModel + { + FUnlinkKongregateAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkKongregateAccountResult(const FUnlinkKongregateAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkKongregateAccountResult(const TSharedPtr& obj) : FUnlinkKongregateAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkKongregateAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkNintendoSwitchDeviceIdRequest : public FPlayFabBaseModel + { + // [optional] Nintendo Switch Device identifier for the user. If not specified, the most recently signed in device ID will be used. + FString NintendoSwitchDeviceId; + + FUnlinkNintendoSwitchDeviceIdRequest() : + FPlayFabBaseModel(), + NintendoSwitchDeviceId() + {} + + FUnlinkNintendoSwitchDeviceIdRequest(const FUnlinkNintendoSwitchDeviceIdRequest& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId) + {} + + FUnlinkNintendoSwitchDeviceIdRequest(const TSharedPtr& obj) : FUnlinkNintendoSwitchDeviceIdRequest() + { + readFromValue(obj); + } + + ~FUnlinkNintendoSwitchDeviceIdRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkNintendoSwitchDeviceIdResult : public FPlayFabBaseModel + { + FUnlinkNintendoSwitchDeviceIdResult() : + FPlayFabBaseModel() + {} + + FUnlinkNintendoSwitchDeviceIdResult(const FUnlinkNintendoSwitchDeviceIdResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkNintendoSwitchDeviceIdResult(const TSharedPtr& obj) : FUnlinkNintendoSwitchDeviceIdResult() + { + readFromValue(obj); + } + + ~FUnlinkNintendoSwitchDeviceIdResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkSteamAccountRequest : public FPlayFabBaseModel + { + FUnlinkSteamAccountRequest() : + FPlayFabBaseModel() + {} + + FUnlinkSteamAccountRequest(const FUnlinkSteamAccountRequest& src) : + FPlayFabBaseModel() + {} + + FUnlinkSteamAccountRequest(const TSharedPtr& obj) : FUnlinkSteamAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkSteamAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkSteamAccountResult : public FPlayFabBaseModel + { + FUnlinkSteamAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkSteamAccountResult(const FUnlinkSteamAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkSteamAccountResult(const TSharedPtr& obj) : FUnlinkSteamAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkSteamAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkTwitchAccountRequest : public FPlayFabBaseModel + { + FUnlinkTwitchAccountRequest() : + FPlayFabBaseModel() + {} + + FUnlinkTwitchAccountRequest(const FUnlinkTwitchAccountRequest& src) : + FPlayFabBaseModel() + {} + + FUnlinkTwitchAccountRequest(const TSharedPtr& obj) : FUnlinkTwitchAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkTwitchAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkTwitchAccountResult : public FPlayFabBaseModel + { + FUnlinkTwitchAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkTwitchAccountResult(const FUnlinkTwitchAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkTwitchAccountResult(const TSharedPtr& obj) : FUnlinkTwitchAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkTwitchAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkWindowsHelloAccountRequest : public FPlayFabBaseModel + { + // SHA256 hash of the PublicKey generated by Windows Hello. + FString PublicKeyHint; + + FUnlinkWindowsHelloAccountRequest() : + FPlayFabBaseModel(), + PublicKeyHint() + {} + + FUnlinkWindowsHelloAccountRequest(const FUnlinkWindowsHelloAccountRequest& src) : + FPlayFabBaseModel(), + PublicKeyHint(src.PublicKeyHint) + {} + + FUnlinkWindowsHelloAccountRequest(const TSharedPtr& obj) : FUnlinkWindowsHelloAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkWindowsHelloAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkWindowsHelloAccountResponse : public FPlayFabBaseModel + { + FUnlinkWindowsHelloAccountResponse() : + FPlayFabBaseModel() + {} + + FUnlinkWindowsHelloAccountResponse(const FUnlinkWindowsHelloAccountResponse& src) : + FPlayFabBaseModel() + {} + + FUnlinkWindowsHelloAccountResponse(const TSharedPtr& obj) : FUnlinkWindowsHelloAccountResponse() + { + readFromValue(obj); + } + + ~FUnlinkWindowsHelloAccountResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkXboxAccountRequest : public FPlayFabBaseModel + { + // Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + FString XboxToken; + + FUnlinkXboxAccountRequest() : + FPlayFabBaseModel(), + XboxToken() + {} + + FUnlinkXboxAccountRequest(const FUnlinkXboxAccountRequest& src) : + FPlayFabBaseModel(), + XboxToken(src.XboxToken) + {} + + FUnlinkXboxAccountRequest(const TSharedPtr& obj) : FUnlinkXboxAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkXboxAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkXboxAccountResult : public FPlayFabBaseModel + { + FUnlinkXboxAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkXboxAccountResult(const FUnlinkXboxAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkXboxAccountResult(const TSharedPtr& obj) : FUnlinkXboxAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkXboxAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlockContainerInstanceRequest : public FPlayFabBaseModel + { + /** + * [optional] Specifies the catalog version that should be used to determine container contents. If unspecified, uses catalog + * associated with the item instance. + */ + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // ItemInstanceId of the container to unlock. + FString ContainerItemInstanceId; + + /** + * [optional] ItemInstanceId of the key that will be consumed by unlocking this container. If the container requires a key, this + * parameter is required. + */ + FString KeyItemInstanceId; + + FUnlockContainerInstanceRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + ContainerItemInstanceId(), + KeyItemInstanceId() + {} + + FUnlockContainerInstanceRequest(const FUnlockContainerInstanceRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + ContainerItemInstanceId(src.ContainerItemInstanceId), + KeyItemInstanceId(src.KeyItemInstanceId) + {} + + FUnlockContainerInstanceRequest(const TSharedPtr& obj) : FUnlockContainerInstanceRequest() + { + readFromValue(obj); + } + + ~FUnlockContainerInstanceRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlockContainerItemRequest : public FPlayFabBaseModel + { + /** + * [optional] Specifies the catalog version that should be used to determine container contents. If unspecified, uses default/primary + * catalog. + */ + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Catalog ItemId of the container type to unlock. + FString ContainerItemId; + + FUnlockContainerItemRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + ContainerItemId() + {} + + FUnlockContainerItemRequest(const FUnlockContainerItemRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + ContainerItemId(src.ContainerItemId) + {} + + FUnlockContainerItemRequest(const TSharedPtr& obj) : FUnlockContainerItemRequest() + { + readFromValue(obj); + } + + ~FUnlockContainerItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlockContainerItemResult : public FPlayFabBaseModel + { + // [optional] Items granted to the player as a result of unlocking the container. + TArray GrantedItems; + // [optional] Unique instance identifier of the container unlocked. + FString UnlockedItemInstanceId; + + // [optional] Unique instance identifier of the key used to unlock the container, if applicable. + FString UnlockedWithItemInstanceId; + + // [optional] Virtual currency granted to the player as a result of unlocking the container. + TMap VirtualCurrency; + FUnlockContainerItemResult() : + FPlayFabBaseModel(), + GrantedItems(), + UnlockedItemInstanceId(), + UnlockedWithItemInstanceId(), + VirtualCurrency() + {} + + FUnlockContainerItemResult(const FUnlockContainerItemResult& src) : + FPlayFabBaseModel(), + GrantedItems(src.GrantedItems), + UnlockedItemInstanceId(src.UnlockedItemInstanceId), + UnlockedWithItemInstanceId(src.UnlockedWithItemInstanceId), + VirtualCurrency(src.VirtualCurrency) + {} + + FUnlockContainerItemResult(const TSharedPtr& obj) : FUnlockContainerItemResult() + { + readFromValue(obj); + } + + ~FUnlockContainerItemResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateAvatarUrlRequest : public FPlayFabBaseModel + { + // URL of the avatar image. If empty, it removes the existing avatar URL. + FString ImageUrl; + + FUpdateAvatarUrlRequest() : + FPlayFabBaseModel(), + ImageUrl() + {} + + FUpdateAvatarUrlRequest(const FUpdateAvatarUrlRequest& src) : + FPlayFabBaseModel(), + ImageUrl(src.ImageUrl) + {} + + FUpdateAvatarUrlRequest(const TSharedPtr& obj) : FUpdateAvatarUrlRequest() + { + readFromValue(obj); + } + + ~FUpdateAvatarUrlRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterDataRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // [optional] Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. + Boxed Permission; + + FUpdateCharacterDataRequest() : + FPlayFabBaseModel(), + CharacterId(), + Data(), + KeysToRemove(), + Permission() + {} + + FUpdateCharacterDataRequest(const FUpdateCharacterDataRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission) + {} + + FUpdateCharacterDataRequest(const TSharedPtr& obj) : FUpdateCharacterDataRequest() + { + readFromValue(obj); + } + + ~FUpdateCharacterDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterDataResult : public FPlayFabBaseModel + { + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FUpdateCharacterDataResult() : + FPlayFabBaseModel(), + DataVersion(0) + {} + + FUpdateCharacterDataResult(const FUpdateCharacterDataResult& src) : + FPlayFabBaseModel(), + DataVersion(src.DataVersion) + {} + + FUpdateCharacterDataResult(const TSharedPtr& obj) : FUpdateCharacterDataResult() + { + readFromValue(obj); + } + + ~FUpdateCharacterDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterStatisticsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] Statistics to be updated with the provided values. + TMap CharacterStatistics; + FUpdateCharacterStatisticsRequest() : + FPlayFabBaseModel(), + CharacterId(), + CharacterStatistics() + {} + + FUpdateCharacterStatisticsRequest(const FUpdateCharacterStatisticsRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterStatistics(src.CharacterStatistics) + {} + + FUpdateCharacterStatisticsRequest(const TSharedPtr& obj) : FUpdateCharacterStatisticsRequest() + { + readFromValue(obj); + } + + ~FUpdateCharacterStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterStatisticsResult : public FPlayFabBaseModel + { + FUpdateCharacterStatisticsResult() : + FPlayFabBaseModel() + {} + + FUpdateCharacterStatisticsResult(const FUpdateCharacterStatisticsResult& src) : + FPlayFabBaseModel() + {} + + FUpdateCharacterStatisticsResult(const TSharedPtr& obj) : FUpdateCharacterStatisticsResult() + { + readFromValue(obj); + } + + ~FUpdateCharacterStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerStatisticsRequest : public FPlayFabBaseModel + { + // Statistics to be updated with the provided values + TArray Statistics; + FUpdatePlayerStatisticsRequest() : + FPlayFabBaseModel(), + Statistics() + {} + + FUpdatePlayerStatisticsRequest(const FUpdatePlayerStatisticsRequest& src) : + FPlayFabBaseModel(), + Statistics(src.Statistics) + {} + + FUpdatePlayerStatisticsRequest(const TSharedPtr& obj) : FUpdatePlayerStatisticsRequest() + { + readFromValue(obj); + } + + ~FUpdatePlayerStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerStatisticsResult : public FPlayFabBaseModel + { + FUpdatePlayerStatisticsResult() : + FPlayFabBaseModel() + {} + + FUpdatePlayerStatisticsResult(const FUpdatePlayerStatisticsResult& src) : + FPlayFabBaseModel() + {} + + FUpdatePlayerStatisticsResult(const TSharedPtr& obj) : FUpdatePlayerStatisticsResult() + { + readFromValue(obj); + } + + ~FUpdatePlayerStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateSharedGroupDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // [optional] Permission to be applied to all user data keys in this request. + Boxed Permission; + + // Unique identifier for the shared group. + FString SharedGroupId; + + FUpdateSharedGroupDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + Permission(), + SharedGroupId() + {} + + FUpdateSharedGroupDataRequest(const FUpdateSharedGroupDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission), + SharedGroupId(src.SharedGroupId) + {} + + FUpdateSharedGroupDataRequest(const TSharedPtr& obj) : FUpdateSharedGroupDataRequest() + { + readFromValue(obj); + } + + ~FUpdateSharedGroupDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateSharedGroupDataResult : public FPlayFabBaseModel + { + FUpdateSharedGroupDataResult() : + FPlayFabBaseModel() + {} + + FUpdateSharedGroupDataResult(const FUpdateSharedGroupDataResult& src) : + FPlayFabBaseModel() + {} + + FUpdateSharedGroupDataResult(const TSharedPtr& obj) : FUpdateSharedGroupDataResult() + { + readFromValue(obj); + } + + ~FUpdateSharedGroupDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + /** + * [optional] Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. This is used + * for requests by one player for information about another player; those requests will only return Public keys. + */ + Boxed Permission; + + FUpdateUserDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + Permission() + {} + + FUpdateUserDataRequest(const FUpdateUserDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission) + {} + + FUpdateUserDataRequest(const TSharedPtr& obj) : FUpdateUserDataRequest() + { + readFromValue(obj); + } + + ~FUpdateUserDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserDataResult : public FPlayFabBaseModel + { + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FUpdateUserDataResult() : + FPlayFabBaseModel(), + DataVersion(0) + {} + + FUpdateUserDataResult(const FUpdateUserDataResult& src) : + FPlayFabBaseModel(), + DataVersion(src.DataVersion) + {} + + FUpdateUserDataResult(const TSharedPtr& obj) : FUpdateUserDataResult() + { + readFromValue(obj); + } + + ~FUpdateUserDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserTitleDisplayNameRequest : public FPlayFabBaseModel + { + // New title display name for the user - must be between 3 and 25 characters. + FString DisplayName; + + FUpdateUserTitleDisplayNameRequest() : + FPlayFabBaseModel(), + DisplayName() + {} + + FUpdateUserTitleDisplayNameRequest(const FUpdateUserTitleDisplayNameRequest& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName) + {} + + FUpdateUserTitleDisplayNameRequest(const TSharedPtr& obj) : FUpdateUserTitleDisplayNameRequest() + { + readFromValue(obj); + } + + ~FUpdateUserTitleDisplayNameRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserTitleDisplayNameResult : public FPlayFabBaseModel + { + // [optional] Current title display name for the user (this will be the original display name if the rename attempt failed). + FString DisplayName; + + FUpdateUserTitleDisplayNameResult() : + FPlayFabBaseModel(), + DisplayName() + {} + + FUpdateUserTitleDisplayNameResult(const FUpdateUserTitleDisplayNameResult& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName) + {} + + FUpdateUserTitleDisplayNameResult(const TSharedPtr& obj) : FUpdateUserTitleDisplayNameResult() + { + readFromValue(obj); + } + + ~FUpdateUserTitleDisplayNameResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateAmazonReceiptRequest : public FPlayFabBaseModel + { + // [optional] Catalog version to use when granting receipt item. If null, defaults to primary catalog. + FString CatalogVersion; + + // Currency used for the purchase. + FString CurrencyCode; + + // Amount of the stated currency paid for the object. + int32 PurchasePrice; + + // ReceiptId returned by the Amazon App Store in-app purchase API + FString ReceiptId; + + // AmazonId of the user making the purchase as returned by the Amazon App Store in-app purchase API + FString UserId; + + FValidateAmazonReceiptRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CurrencyCode(), + PurchasePrice(0), + ReceiptId(), + UserId() + {} + + FValidateAmazonReceiptRequest(const FValidateAmazonReceiptRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CurrencyCode(src.CurrencyCode), + PurchasePrice(src.PurchasePrice), + ReceiptId(src.ReceiptId), + UserId(src.UserId) + {} + + FValidateAmazonReceiptRequest(const TSharedPtr& obj) : FValidateAmazonReceiptRequest() + { + readFromValue(obj); + } + + ~FValidateAmazonReceiptRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateAmazonReceiptResult : public FPlayFabBaseModel + { + FValidateAmazonReceiptResult() : + FPlayFabBaseModel() + {} + + FValidateAmazonReceiptResult(const FValidateAmazonReceiptResult& src) : + FPlayFabBaseModel() + {} + + FValidateAmazonReceiptResult(const TSharedPtr& obj) : FValidateAmazonReceiptResult() + { + readFromValue(obj); + } + + ~FValidateAmazonReceiptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateGooglePlayPurchaseRequest : public FPlayFabBaseModel + { + // [optional] Currency used for the purchase. + FString CurrencyCode; + + // [optional] Amount of the stated currency paid for the object. + Boxed PurchasePrice; + + // Original JSON string returned by the Google Play IAB API. + FString ReceiptJson; + + // Signature returned by the Google Play IAB API. + FString Signature; + + FValidateGooglePlayPurchaseRequest() : + FPlayFabBaseModel(), + CurrencyCode(), + PurchasePrice(), + ReceiptJson(), + Signature() + {} + + FValidateGooglePlayPurchaseRequest(const FValidateGooglePlayPurchaseRequest& src) : + FPlayFabBaseModel(), + CurrencyCode(src.CurrencyCode), + PurchasePrice(src.PurchasePrice), + ReceiptJson(src.ReceiptJson), + Signature(src.Signature) + {} + + FValidateGooglePlayPurchaseRequest(const TSharedPtr& obj) : FValidateGooglePlayPurchaseRequest() + { + readFromValue(obj); + } + + ~FValidateGooglePlayPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateGooglePlayPurchaseResult : public FPlayFabBaseModel + { + FValidateGooglePlayPurchaseResult() : + FPlayFabBaseModel() + {} + + FValidateGooglePlayPurchaseResult(const FValidateGooglePlayPurchaseResult& src) : + FPlayFabBaseModel() + {} + + FValidateGooglePlayPurchaseResult(const TSharedPtr& obj) : FValidateGooglePlayPurchaseResult() + { + readFromValue(obj); + } + + ~FValidateGooglePlayPurchaseResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateIOSReceiptRequest : public FPlayFabBaseModel + { + // Currency used for the purchase. + FString CurrencyCode; + + // Amount of the stated currency paid for the object. + int32 PurchasePrice; + + // Base64 encoded receipt data, passed back by the App Store as a result of a successful purchase. + FString ReceiptData; + + FValidateIOSReceiptRequest() : + FPlayFabBaseModel(), + CurrencyCode(), + PurchasePrice(0), + ReceiptData() + {} + + FValidateIOSReceiptRequest(const FValidateIOSReceiptRequest& src) : + FPlayFabBaseModel(), + CurrencyCode(src.CurrencyCode), + PurchasePrice(src.PurchasePrice), + ReceiptData(src.ReceiptData) + {} + + FValidateIOSReceiptRequest(const TSharedPtr& obj) : FValidateIOSReceiptRequest() + { + readFromValue(obj); + } + + ~FValidateIOSReceiptRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateIOSReceiptResult : public FPlayFabBaseModel + { + FValidateIOSReceiptResult() : + FPlayFabBaseModel() + {} + + FValidateIOSReceiptResult(const FValidateIOSReceiptResult& src) : + FPlayFabBaseModel() + {} + + FValidateIOSReceiptResult(const TSharedPtr& obj) : FValidateIOSReceiptResult() + { + readFromValue(obj); + } + + ~FValidateIOSReceiptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateWindowsReceiptRequest : public FPlayFabBaseModel + { + // [optional] Catalog version to use when granting receipt item. If null, defaults to primary catalog. + FString CatalogVersion; + + // Currency used for the purchase. + FString CurrencyCode; + + // Amount of the stated currency paid for the object. + uint32 PurchasePrice; + + // XML Receipt returned by the Windows App Store in-app purchase API + FString Receipt; + + FValidateWindowsReceiptRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CurrencyCode(), + PurchasePrice(0), + Receipt() + {} + + FValidateWindowsReceiptRequest(const FValidateWindowsReceiptRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CurrencyCode(src.CurrencyCode), + PurchasePrice(src.PurchasePrice), + Receipt(src.Receipt) + {} + + FValidateWindowsReceiptRequest(const TSharedPtr& obj) : FValidateWindowsReceiptRequest() + { + readFromValue(obj); + } + + ~FValidateWindowsReceiptRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateWindowsReceiptResult : public FPlayFabBaseModel + { + FValidateWindowsReceiptResult() : + FPlayFabBaseModel() + {} + + FValidateWindowsReceiptResult(const FValidateWindowsReceiptResult& src) : + FPlayFabBaseModel() + {} + + FValidateWindowsReceiptResult(const TSharedPtr& obj) : FValidateWindowsReceiptResult() + { + readFromValue(obj); + } + + ~FValidateWindowsReceiptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteClientCharacterEventRequest : public FPlayFabBaseModel + { + // [optional] Custom event properties. Each property consists of a name (string) and a value (JSON object). + TMap Body; + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + FString EventName; + + // [optional] The time (in UTC) associated with this event. The value dafaults to the current time. + Boxed Timestamp; + + FWriteClientCharacterEventRequest() : + FPlayFabBaseModel(), + Body(), + CharacterId(), + EventName(), + Timestamp() + {} + + FWriteClientCharacterEventRequest(const FWriteClientCharacterEventRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + CharacterId(src.CharacterId), + EventName(src.EventName), + Timestamp(src.Timestamp) + {} + + FWriteClientCharacterEventRequest(const TSharedPtr& obj) : FWriteClientCharacterEventRequest() + { + readFromValue(obj); + } + + ~FWriteClientCharacterEventRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteClientPlayerEventRequest : public FPlayFabBaseModel + { + // [optional] Custom data properties associated with the event. Each property consists of a name (string) and a value (JSON object). + TMap Body; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + FString EventName; + + // [optional] The time (in UTC) associated with this event. The value dafaults to the current time. + Boxed Timestamp; + + FWriteClientPlayerEventRequest() : + FPlayFabBaseModel(), + Body(), + EventName(), + Timestamp() + {} + + FWriteClientPlayerEventRequest(const FWriteClientPlayerEventRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + EventName(src.EventName), + Timestamp(src.Timestamp) + {} + + FWriteClientPlayerEventRequest(const TSharedPtr& obj) : FWriteClientPlayerEventRequest() + { + readFromValue(obj); + } + + ~FWriteClientPlayerEventRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteEventResponse : public FPlayFabBaseModel + { + /** + * [optional] The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to + * any particular format. + */ + FString EventId; + + FWriteEventResponse() : + FPlayFabBaseModel(), + EventId() + {} + + FWriteEventResponse(const FWriteEventResponse& src) : + FPlayFabBaseModel(), + EventId(src.EventId) + {} + + FWriteEventResponse(const TSharedPtr& obj) : FWriteEventResponse() + { + readFromValue(obj); + } + + ~FWriteEventResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteTitleEventRequest : public FPlayFabBaseModel + { + // [optional] Custom event properties. Each property consists of a name (string) and a value (JSON object). + TMap Body; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + FString EventName; + + // [optional] The time (in UTC) associated with this event. The value dafaults to the current time. + Boxed Timestamp; + + FWriteTitleEventRequest() : + FPlayFabBaseModel(), + Body(), + EventName(), + Timestamp() + {} + + FWriteTitleEventRequest(const FWriteTitleEventRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + EventName(src.EventName), + Timestamp(src.Timestamp) + {} + + FWriteTitleEventRequest(const TSharedPtr& obj) : FWriteTitleEventRequest() + { + readFromValue(obj); + } + + ~FWriteTitleEventRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabCloudScriptAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabCloudScriptAPI.h new file mode 100644 index 000000000..1f0c50fbe --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabCloudScriptAPI.h @@ -0,0 +1,44 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabCloudScriptDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabCloudScriptAPI + { + public: + DECLARE_DELEGATE_OneParam(FExecuteEntityCloudScriptDelegate, const CloudScriptModels::FExecuteCloudScriptResult&); + + UPlayFabCloudScriptAPI(); + ~UPlayFabCloudScriptAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Cloud Script is one of PlayFab's most versatile features. It allows client code to request execution of any kind of + * custom server-side functionality you can implement, and it can be used in conjunction with virtually anything. + * Executes CloudScript with the entity profile that is defined in the request. + */ + bool ExecuteEntityCloudScript(CloudScriptModels::FExecuteEntityCloudScriptRequest& request, const FExecuteEntityCloudScriptDelegate& SuccessDelegate = FExecuteEntityCloudScriptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnExecuteEntityCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExecuteEntityCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabCloudScriptDataModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabCloudScriptDataModels.h new file mode 100644 index 000000000..48d74e2b4 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabCloudScriptDataModels.h @@ -0,0 +1,283 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace CloudScriptModels +{ + + enum CloudScriptRevisionOption + { + CloudScriptRevisionOptionLive, + CloudScriptRevisionOptionLatest, + CloudScriptRevisionOptionSpecific + }; + + PLAYFABCPP_API void writeCloudScriptRevisionOptionEnumJSON(CloudScriptRevisionOption enumVal, JsonWriter& writer); + PLAYFABCPP_API CloudScriptRevisionOption readCloudScriptRevisionOptionFromValue(const TSharedPtr& value); + PLAYFABCPP_API CloudScriptRevisionOption readCloudScriptRevisionOptionFromValue(const FString& value); + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FScriptExecutionError : public FPlayFabBaseModel + { + /** + * [optional] Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, + * CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError + */ + FString Error; + + // [optional] Details about the error + FString Message; + + // [optional] Point during the execution of the script at which the error occurred, if any + FString StackTrace; + + FScriptExecutionError() : + FPlayFabBaseModel(), + Error(), + Message(), + StackTrace() + {} + + FScriptExecutionError(const FScriptExecutionError& src) : + FPlayFabBaseModel(), + Error(src.Error), + Message(src.Message), + StackTrace(src.StackTrace) + {} + + FScriptExecutionError(const TSharedPtr& obj) : FScriptExecutionError() + { + readFromValue(obj); + } + + ~FScriptExecutionError(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLogStatement : public FPlayFabBaseModel + { + // [optional] Optional object accompanying the message as contextual information + FJsonKeeper Data; + + // [optional] 'Debug', 'Info', or 'Error' + FString Level; + + // [optional] undefined + FString Message; + + FLogStatement() : + FPlayFabBaseModel(), + Data(), + Level(), + Message() + {} + + FLogStatement(const FLogStatement& src) : + FPlayFabBaseModel(), + Data(src.Data), + Level(src.Level), + Message(src.Message) + {} + + FLogStatement(const TSharedPtr& obj) : FLogStatement() + { + readFromValue(obj); + } + + ~FLogStatement(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteCloudScriptResult : public FPlayFabBaseModel + { + // Number of PlayFab API requests issued by the CloudScript function + int32 APIRequestsIssued; + + // [optional] Information about the error, if any, that occurred during execution + TSharedPtr Error; + + double ExecutionTimeSeconds; + + // [optional] The name of the function that executed + FString FunctionName; + + // [optional] The object returned from the CloudScript function, if any + FJsonKeeper FunctionResult; + + /** + * [optional] Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + Boxed FunctionResultTooLarge; + + // Number of external HTTP requests issued by the CloudScript function + int32 HttpRequestsIssued; + + /** + * [optional] Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + TArray Logs; + /** + * [optional] Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + Boxed LogsTooLarge; + + uint32 MemoryConsumedBytes; + + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + double ProcessorTimeSeconds; + + // The revision of the CloudScript that executed + int32 Revision; + + FExecuteCloudScriptResult() : + FPlayFabBaseModel(), + APIRequestsIssued(0), + Error(nullptr), + ExecutionTimeSeconds(0), + FunctionName(), + FunctionResult(), + FunctionResultTooLarge(), + HttpRequestsIssued(0), + Logs(), + LogsTooLarge(), + MemoryConsumedBytes(0), + ProcessorTimeSeconds(0), + Revision(0) + {} + + FExecuteCloudScriptResult(const FExecuteCloudScriptResult& src) : + FPlayFabBaseModel(), + APIRequestsIssued(src.APIRequestsIssued), + Error(src.Error.IsValid() ? MakeShareable(new FScriptExecutionError(*src.Error)) : nullptr), + ExecutionTimeSeconds(src.ExecutionTimeSeconds), + FunctionName(src.FunctionName), + FunctionResult(src.FunctionResult), + FunctionResultTooLarge(src.FunctionResultTooLarge), + HttpRequestsIssued(src.HttpRequestsIssued), + Logs(src.Logs), + LogsTooLarge(src.LogsTooLarge), + MemoryConsumedBytes(src.MemoryConsumedBytes), + ProcessorTimeSeconds(src.ProcessorTimeSeconds), + Revision(src.Revision) + {} + + FExecuteCloudScriptResult(const TSharedPtr& obj) : FExecuteCloudScriptResult() + { + readFromValue(obj); + } + + ~FExecuteCloudScriptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteEntityCloudScriptRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + // The name of the CloudScript function to execute + FString FunctionName; + + // [optional] Object that is passed in to the function as the first argument + FJsonKeeper FunctionParameter; + + /** + * [optional] Generate a 'entity_executed_cloudscript' PlayStream event containing the results of the function execution and other + * contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. + */ + Boxed GeneratePlayStreamEvent; + + /** + * [optional] Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' + * executes the current live, published revision, and 'Specific' executes the specified revision. The default value is + * 'Specific', if the SpecificRevision parameter is specified, otherwise it is 'Live'. + */ + Boxed RevisionSelection; + + // [optional] The specific revision to execute, when RevisionSelection is set to 'Specific' + Boxed SpecificRevision; + + FExecuteEntityCloudScriptRequest() : + FPlayFabBaseModel(), + Entity(nullptr), + FunctionName(), + FunctionParameter(), + GeneratePlayStreamEvent(), + RevisionSelection(), + SpecificRevision() + {} + + FExecuteEntityCloudScriptRequest(const FExecuteEntityCloudScriptRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + FunctionName(src.FunctionName), + FunctionParameter(src.FunctionParameter), + GeneratePlayStreamEvent(src.GeneratePlayStreamEvent), + RevisionSelection(src.RevisionSelection), + SpecificRevision(src.SpecificRevision) + {} + + FExecuteEntityCloudScriptRequest(const TSharedPtr& obj) : FExecuteEntityCloudScriptRequest() + { + readFromValue(obj); + } + + ~FExecuteEntityCloudScriptRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabDataAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabDataAPI.h new file mode 100644 index 000000000..929df9982 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabDataAPI.h @@ -0,0 +1,85 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabDataDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabDataAPI + { + public: + DECLARE_DELEGATE_OneParam(FAbortFileUploadsDelegate, const DataModels::FAbortFileUploadsResponse&); + DECLARE_DELEGATE_OneParam(FDeleteFilesDelegate, const DataModels::FDeleteFilesResponse&); + DECLARE_DELEGATE_OneParam(FFinalizeFileUploadsDelegate, const DataModels::FFinalizeFileUploadsResponse&); + DECLARE_DELEGATE_OneParam(FGetFilesDelegate, const DataModels::FGetFilesResponse&); + DECLARE_DELEGATE_OneParam(FGetObjectsDelegate, const DataModels::FGetObjectsResponse&); + DECLARE_DELEGATE_OneParam(FInitiateFileUploadsDelegate, const DataModels::FInitiateFileUploadsResponse&); + DECLARE_DELEGATE_OneParam(FSetObjectsDelegate, const DataModels::FSetObjectsResponse&); + + UPlayFabDataAPI(); + ~UPlayFabDataAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Abort pending file uploads to an entity's profile. + * Aborts the pending upload of the requested files. + */ + bool AbortFileUploads(DataModels::FAbortFileUploadsRequest& request, const FAbortFileUploadsDelegate& SuccessDelegate = FAbortFileUploadsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Delete files on an entity's profile. + * Deletes the requested files from the entity's profile. + */ + bool DeleteFiles(DataModels::FDeleteFilesRequest& request, const FDeleteFilesDelegate& SuccessDelegate = FDeleteFilesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Finalize file uploads to an entity's profile. + * Finalizes the upload of the requested files. Verifies that the files have been successfully uploaded and moves the file pointers from pending to live. + */ + bool FinalizeFileUploads(DataModels::FFinalizeFileUploadsRequest& request, const FFinalizeFileUploadsDelegate& SuccessDelegate = FFinalizeFileUploadsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves file metadata from an entity's profile. + * Returns URLs that may be used to download the files for a profile for a limited length of time. Only returns files that have been successfully uploaded, files that are still pending will either return the old value, if it exists, or nothing. + */ + bool GetFiles(DataModels::FGetFilesRequest& request, const FGetFilesDelegate& SuccessDelegate = FGetFilesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves objects from an entity's profile. + * Gets JSON objects from an entity profile and returns it. + */ + bool GetObjects(DataModels::FGetObjectsRequest& request, const FGetObjectsDelegate& SuccessDelegate = FGetObjectsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Initiates file uploads to an entity's profile. + * Returns URLs that may be used to upload the files for a profile 5 minutes. After using the upload calls FinalizeFileUploads must be called to move the file status from pending to live. + */ + bool InitiateFileUploads(DataModels::FInitiateFileUploadsRequest& request, const FInitiateFileUploadsDelegate& SuccessDelegate = FInitiateFileUploadsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets objects on an entity's profile. + * Sets JSON objects on the requested entity profile. May include a version number to be used to perform optimistic concurrency operations during update. If the current version differs from the version in the request the request will be ignored. If no version is set on the request then the value will always be updated if the values differ. Using the version value does not guarantee a write though, ConcurrentEditError may still occur if multiple clients are attempting to update the same profile. + */ + bool SetObjects(DataModels::FSetObjectsRequest& request, const FSetObjectsDelegate& SuccessDelegate = FSetObjectsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnAbortFileUploadsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAbortFileUploadsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteFilesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteFilesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnFinalizeFileUploadsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFinalizeFileUploadsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetFilesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFilesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetObjectsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetObjectsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnInitiateFileUploadsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FInitiateFileUploadsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetObjectsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetObjectsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabDataDataModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabDataDataModels.h new file mode 100644 index 000000000..b82aed495 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabDataDataModels.h @@ -0,0 +1,732 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace DataModels +{ + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAbortFileUploadsRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // Names of the files to have their pending uploads aborted. + TArray FileNames; + /** + * [optional] The expected version of the profile, if set and doesn't match the current version of the profile the operation will not + * be performed. + */ + Boxed ProfileVersion; + + FAbortFileUploadsRequest() : + FPlayFabBaseModel(), + Entity(), + FileNames(), + ProfileVersion() + {} + + FAbortFileUploadsRequest(const FAbortFileUploadsRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + FileNames(src.FileNames), + ProfileVersion(src.ProfileVersion) + {} + + FAbortFileUploadsRequest(const TSharedPtr& obj) : FAbortFileUploadsRequest() + { + readFromValue(obj); + } + + ~FAbortFileUploadsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAbortFileUploadsResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + FAbortFileUploadsResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + ProfileVersion(0) + {} + + FAbortFileUploadsResponse(const FAbortFileUploadsResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + ProfileVersion(src.ProfileVersion) + {} + + FAbortFileUploadsResponse(const TSharedPtr& obj) : FAbortFileUploadsResponse() + { + readFromValue(obj); + } + + ~FAbortFileUploadsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteFilesRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // Names of the files to be deleted. + TArray FileNames; + /** + * [optional] The expected version of the profile, if set and doesn't match the current version of the profile the operation will not + * be performed. + */ + Boxed ProfileVersion; + + FDeleteFilesRequest() : + FPlayFabBaseModel(), + Entity(), + FileNames(), + ProfileVersion() + {} + + FDeleteFilesRequest(const FDeleteFilesRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + FileNames(src.FileNames), + ProfileVersion(src.ProfileVersion) + {} + + FDeleteFilesRequest(const TSharedPtr& obj) : FDeleteFilesRequest() + { + readFromValue(obj); + } + + ~FDeleteFilesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteFilesResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + FDeleteFilesResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + ProfileVersion(0) + {} + + FDeleteFilesResponse(const FDeleteFilesResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + ProfileVersion(src.ProfileVersion) + {} + + FDeleteFilesResponse(const TSharedPtr& obj) : FDeleteFilesResponse() + { + readFromValue(obj); + } + + ~FDeleteFilesResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFinalizeFileUploadsRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // Names of the files to be finalized. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' + TArray FileNames; + FFinalizeFileUploadsRequest() : + FPlayFabBaseModel(), + Entity(), + FileNames() + {} + + FFinalizeFileUploadsRequest(const FFinalizeFileUploadsRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + FileNames(src.FileNames) + {} + + FFinalizeFileUploadsRequest(const TSharedPtr& obj) : FFinalizeFileUploadsRequest() + { + readFromValue(obj); + } + + ~FFinalizeFileUploadsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFileMetadata : public FPlayFabBaseModel + { + // [optional] Checksum value for the file + FString Checksum; + + // [optional] Download URL where the file can be retrieved + FString DownloadUrl; + + // [optional] Name of the file + FString FileName; + + // Last UTC time the file was modified + FDateTime LastModified; + + // Storage service's reported byte count + int32 Size; + + FGetFileMetadata() : + FPlayFabBaseModel(), + Checksum(), + DownloadUrl(), + FileName(), + LastModified(0), + Size(0) + {} + + FGetFileMetadata(const FGetFileMetadata& src) : + FPlayFabBaseModel(), + Checksum(src.Checksum), + DownloadUrl(src.DownloadUrl), + FileName(src.FileName), + LastModified(src.LastModified), + Size(src.Size) + {} + + FGetFileMetadata(const TSharedPtr& obj) : FGetFileMetadata() + { + readFromValue(obj); + } + + ~FGetFileMetadata(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFinalizeFileUploadsResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // [optional] Collection of metadata for the entity's files + TMap Metadata; + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + FFinalizeFileUploadsResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + Metadata(), + ProfileVersion(0) + {} + + FFinalizeFileUploadsResponse(const FFinalizeFileUploadsResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + Metadata(src.Metadata), + ProfileVersion(src.ProfileVersion) + {} + + FFinalizeFileUploadsResponse(const TSharedPtr& obj) : FFinalizeFileUploadsResponse() + { + readFromValue(obj); + } + + ~FFinalizeFileUploadsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFilesRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + FGetFilesRequest() : + FPlayFabBaseModel(), + Entity() + {} + + FGetFilesRequest(const FGetFilesRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity) + {} + + FGetFilesRequest(const TSharedPtr& obj) : FGetFilesRequest() + { + readFromValue(obj); + } + + ~FGetFilesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFilesResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // [optional] Collection of metadata for the entity's files + TMap Metadata; + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + FGetFilesResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + Metadata(), + ProfileVersion(0) + {} + + FGetFilesResponse(const FGetFilesResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + Metadata(src.Metadata), + ProfileVersion(src.ProfileVersion) + {} + + FGetFilesResponse(const TSharedPtr& obj) : FGetFilesResponse() + { + readFromValue(obj); + } + + ~FGetFilesResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetObjectsRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + /** + * [optional] Determines whether the object will be returned as an escaped JSON string or as a un-escaped JSON object. Default is JSON + * object. + */ + Boxed EscapeObject; + + FGetObjectsRequest() : + FPlayFabBaseModel(), + Entity(), + EscapeObject() + {} + + FGetObjectsRequest(const FGetObjectsRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + EscapeObject(src.EscapeObject) + {} + + FGetObjectsRequest(const TSharedPtr& obj) : FGetObjectsRequest() + { + readFromValue(obj); + } + + ~FGetObjectsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FObjectResult : public FPlayFabBaseModel + { + // [optional] Un-escaped JSON object, if EscapeObject false or default. + FJsonKeeper DataObject; + + // [optional] Escaped string JSON body of the object, if EscapeObject is true. + FString EscapedDataObject; + + // [optional] Name of the object. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' + FString ObjectName; + + FObjectResult() : + FPlayFabBaseModel(), + DataObject(), + EscapedDataObject(), + ObjectName() + {} + + FObjectResult(const FObjectResult& src) : + FPlayFabBaseModel(), + DataObject(src.DataObject), + EscapedDataObject(src.EscapedDataObject), + ObjectName(src.ObjectName) + {} + + FObjectResult(const TSharedPtr& obj) : FObjectResult() + { + readFromValue(obj); + } + + ~FObjectResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetObjectsResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // [optional] Requested objects that the calling entity has access to + TMap Objects; + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + FGetObjectsResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + Objects(), + ProfileVersion(0) + {} + + FGetObjectsResponse(const FGetObjectsResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + Objects(src.Objects), + ProfileVersion(src.ProfileVersion) + {} + + FGetObjectsResponse(const TSharedPtr& obj) : FGetObjectsResponse() + { + readFromValue(obj); + } + + ~FGetObjectsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FInitiateFileUploadMetadata : public FPlayFabBaseModel + { + // [optional] Name of the file. + FString FileName; + + // [optional] Location the data should be sent to via an HTTP PUT operation. + FString UploadUrl; + + FInitiateFileUploadMetadata() : + FPlayFabBaseModel(), + FileName(), + UploadUrl() + {} + + FInitiateFileUploadMetadata(const FInitiateFileUploadMetadata& src) : + FPlayFabBaseModel(), + FileName(src.FileName), + UploadUrl(src.UploadUrl) + {} + + FInitiateFileUploadMetadata(const TSharedPtr& obj) : FInitiateFileUploadMetadata() + { + readFromValue(obj); + } + + ~FInitiateFileUploadMetadata(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FInitiateFileUploadsRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // Names of the files to be set. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' + TArray FileNames; + /** + * [optional] The expected version of the profile, if set and doesn't match the current version of the profile the operation will not + * be performed. + */ + Boxed ProfileVersion; + + FInitiateFileUploadsRequest() : + FPlayFabBaseModel(), + Entity(), + FileNames(), + ProfileVersion() + {} + + FInitiateFileUploadsRequest(const FInitiateFileUploadsRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + FileNames(src.FileNames), + ProfileVersion(src.ProfileVersion) + {} + + FInitiateFileUploadsRequest(const TSharedPtr& obj) : FInitiateFileUploadsRequest() + { + readFromValue(obj); + } + + ~FInitiateFileUploadsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FInitiateFileUploadsResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + // [optional] Collection of file names and upload urls + TArray UploadDetails; + FInitiateFileUploadsResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + ProfileVersion(0), + UploadDetails() + {} + + FInitiateFileUploadsResponse(const FInitiateFileUploadsResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + ProfileVersion(src.ProfileVersion), + UploadDetails(src.UploadDetails) + {} + + FInitiateFileUploadsResponse(const TSharedPtr& obj) : FInitiateFileUploadsResponse() + { + readFromValue(obj); + } + + ~FInitiateFileUploadsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum OperationTypes + { + OperationTypesCreated, + OperationTypesUpdated, + OperationTypesDeleted, + OperationTypesNone + }; + + PLAYFABCPP_API void writeOperationTypesEnumJSON(OperationTypes enumVal, JsonWriter& writer); + PLAYFABCPP_API OperationTypes readOperationTypesFromValue(const TSharedPtr& value); + PLAYFABCPP_API OperationTypes readOperationTypesFromValue(const FString& value); + + struct PLAYFABCPP_API FSetObject : public FPlayFabBaseModel + { + /** + * [optional] Body of the object to be saved. If empty and DeleteObject is true object will be deleted if it exists, or no operation + * will occur if it does not exist. Only one of Object or EscapedDataObject fields may be used. + */ + FJsonKeeper DataObject; + + // [optional] Flag to indicate that this object should be deleted. Both DataObject and EscapedDataObject must not be set as well. + Boxed DeleteObject; + + /** + * [optional] Body of the object to be saved as an escaped JSON string. If empty and DeleteObject is true object will be deleted if it + * exists, or no operation will occur if it does not exist. Only one of DataObject or EscapedDataObject fields may be used. + */ + FString EscapedDataObject; + + // Name of object. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.'. + FString ObjectName; + + FSetObject() : + FPlayFabBaseModel(), + DataObject(), + DeleteObject(), + EscapedDataObject(), + ObjectName() + {} + + FSetObject(const FSetObject& src) : + FPlayFabBaseModel(), + DataObject(src.DataObject), + DeleteObject(src.DeleteObject), + EscapedDataObject(src.EscapedDataObject), + ObjectName(src.ObjectName) + {} + + FSetObject(const TSharedPtr& obj) : FSetObject() + { + readFromValue(obj); + } + + ~FSetObject(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetObjectInfo : public FPlayFabBaseModel + { + // [optional] Name of the object + FString ObjectName; + + // [optional] Optional reason to explain why the operation was the result that it was. + FString OperationReason; + + // [optional] Indicates which operation was completed, either Created, Updated, Deleted or None. + Boxed SetResult; + + FSetObjectInfo() : + FPlayFabBaseModel(), + ObjectName(), + OperationReason(), + SetResult() + {} + + FSetObjectInfo(const FSetObjectInfo& src) : + FPlayFabBaseModel(), + ObjectName(src.ObjectName), + OperationReason(src.OperationReason), + SetResult(src.SetResult) + {} + + FSetObjectInfo(const TSharedPtr& obj) : FSetObjectInfo() + { + readFromValue(obj); + } + + ~FSetObjectInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetObjectsRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + /** + * [optional] Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from + * GetProfile API, you can ensure that the object set will only be performed if the profile has not been updated by any + * other clients since the version you last loaded. + */ + Boxed ExpectedProfileVersion; + + // Collection of objects to set on the profile. + TArray Objects; + FSetObjectsRequest() : + FPlayFabBaseModel(), + Entity(), + ExpectedProfileVersion(), + Objects() + {} + + FSetObjectsRequest(const FSetObjectsRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + ExpectedProfileVersion(src.ExpectedProfileVersion), + Objects(src.Objects) + {} + + FSetObjectsRequest(const TSharedPtr& obj) : FSetObjectsRequest() + { + readFromValue(obj); + } + + ~FSetObjectsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetObjectsResponse : public FPlayFabBaseModel + { + // New version of the entity profile. + int32 ProfileVersion; + + // [optional] New version of the entity profile. + TArray SetResults; + FSetObjectsResponse() : + FPlayFabBaseModel(), + ProfileVersion(0), + SetResults() + {} + + FSetObjectsResponse(const FSetObjectsResponse& src) : + FPlayFabBaseModel(), + ProfileVersion(src.ProfileVersion), + SetResults(src.SetResults) + {} + + FSetObjectsResponse(const TSharedPtr& obj) : FSetObjectsResponse() + { + readFromValue(obj); + } + + ~FSetObjectsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabError.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabError.h new file mode 100644 index 000000000..dbf3b52cc --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabError.h @@ -0,0 +1,466 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" + +namespace PlayFab +{ + + enum PlayFabErrorCode + { + PlayFabErrorHostnameNotFound=1, + PlayFabErrorConnectionTimeout, + PlayFabErrorConnectionRefused, + PlayFabErrorSocketError, + PlayFabErrorSuccess = 0, + PlayFabErrorUnkownError = 500, + PlayFabErrorInvalidParams = 1000, + PlayFabErrorAccountNotFound = 1001, + PlayFabErrorAccountBanned = 1002, + PlayFabErrorInvalidUsernameOrPassword = 1003, + PlayFabErrorInvalidTitleId = 1004, + PlayFabErrorInvalidEmailAddress = 1005, + PlayFabErrorEmailAddressNotAvailable = 1006, + PlayFabErrorInvalidUsername = 1007, + PlayFabErrorInvalidPassword = 1008, + PlayFabErrorUsernameNotAvailable = 1009, + PlayFabErrorInvalidSteamTicket = 1010, + PlayFabErrorAccountAlreadyLinked = 1011, + PlayFabErrorLinkedAccountAlreadyClaimed = 1012, + PlayFabErrorInvalidFacebookToken = 1013, + PlayFabErrorAccountNotLinked = 1014, + PlayFabErrorFailedByPaymentProvider = 1015, + PlayFabErrorCouponCodeNotFound = 1016, + PlayFabErrorInvalidContainerItem = 1017, + PlayFabErrorContainerNotOwned = 1018, + PlayFabErrorKeyNotOwned = 1019, + PlayFabErrorInvalidItemIdInTable = 1020, + PlayFabErrorInvalidReceipt = 1021, + PlayFabErrorReceiptAlreadyUsed = 1022, + PlayFabErrorReceiptCancelled = 1023, + PlayFabErrorGameNotFound = 1024, + PlayFabErrorGameModeNotFound = 1025, + PlayFabErrorInvalidGoogleToken = 1026, + PlayFabErrorUserIsNotPartOfDeveloper = 1027, + PlayFabErrorInvalidTitleForDeveloper = 1028, + PlayFabErrorTitleNameConflicts = 1029, + PlayFabErrorUserisNotValid = 1030, + PlayFabErrorValueAlreadyExists = 1031, + PlayFabErrorBuildNotFound = 1032, + PlayFabErrorPlayerNotInGame = 1033, + PlayFabErrorInvalidTicket = 1034, + PlayFabErrorInvalidDeveloper = 1035, + PlayFabErrorInvalidOrderInfo = 1036, + PlayFabErrorRegistrationIncomplete = 1037, + PlayFabErrorInvalidPlatform = 1038, + PlayFabErrorUnknownError = 1039, + PlayFabErrorSteamApplicationNotOwned = 1040, + PlayFabErrorWrongSteamAccount = 1041, + PlayFabErrorTitleNotActivated = 1042, + PlayFabErrorRegistrationSessionNotFound = 1043, + PlayFabErrorNoSuchMod = 1044, + PlayFabErrorFileNotFound = 1045, + PlayFabErrorDuplicateEmail = 1046, + PlayFabErrorItemNotFound = 1047, + PlayFabErrorItemNotOwned = 1048, + PlayFabErrorItemNotRecycleable = 1049, + PlayFabErrorItemNotAffordable = 1050, + PlayFabErrorInvalidVirtualCurrency = 1051, + PlayFabErrorWrongVirtualCurrency = 1052, + PlayFabErrorWrongPrice = 1053, + PlayFabErrorNonPositiveValue = 1054, + PlayFabErrorInvalidRegion = 1055, + PlayFabErrorRegionAtCapacity = 1056, + PlayFabErrorServerFailedToStart = 1057, + PlayFabErrorNameNotAvailable = 1058, + PlayFabErrorInsufficientFunds = 1059, + PlayFabErrorInvalidDeviceID = 1060, + PlayFabErrorInvalidPushNotificationToken = 1061, + PlayFabErrorNoRemainingUses = 1062, + PlayFabErrorInvalidPaymentProvider = 1063, + PlayFabErrorPurchaseInitializationFailure = 1064, + PlayFabErrorDuplicateUsername = 1065, + PlayFabErrorInvalidBuyerInfo = 1066, + PlayFabErrorNoGameModeParamsSet = 1067, + PlayFabErrorBodyTooLarge = 1068, + PlayFabErrorReservedWordInBody = 1069, + PlayFabErrorInvalidTypeInBody = 1070, + PlayFabErrorInvalidRequest = 1071, + PlayFabErrorReservedEventName = 1072, + PlayFabErrorInvalidUserStatistics = 1073, + PlayFabErrorNotAuthenticated = 1074, + PlayFabErrorStreamAlreadyExists = 1075, + PlayFabErrorErrorCreatingStream = 1076, + PlayFabErrorStreamNotFound = 1077, + PlayFabErrorInvalidAccount = 1078, + PlayFabErrorPurchaseDoesNotExist = 1080, + PlayFabErrorInvalidPurchaseTransactionStatus = 1081, + PlayFabErrorAPINotEnabledForGameClientAccess = 1082, + PlayFabErrorNoPushNotificationARNForTitle = 1083, + PlayFabErrorBuildAlreadyExists = 1084, + PlayFabErrorBuildPackageDoesNotExist = 1085, + PlayFabErrorCustomAnalyticsEventsNotEnabledForTitle = 1087, + PlayFabErrorInvalidSharedGroupId = 1088, + PlayFabErrorNotAuthorized = 1089, + PlayFabErrorMissingTitleGoogleProperties = 1090, + PlayFabErrorInvalidItemProperties = 1091, + PlayFabErrorInvalidPSNAuthCode = 1092, + PlayFabErrorInvalidItemId = 1093, + PlayFabErrorPushNotEnabledForAccount = 1094, + PlayFabErrorPushServiceError = 1095, + PlayFabErrorReceiptDoesNotContainInAppItems = 1096, + PlayFabErrorReceiptContainsMultipleInAppItems = 1097, + PlayFabErrorInvalidBundleID = 1098, + PlayFabErrorJavascriptException = 1099, + PlayFabErrorInvalidSessionTicket = 1100, + PlayFabErrorUnableToConnectToDatabase = 1101, + PlayFabErrorInternalServerError = 1110, + PlayFabErrorInvalidReportDate = 1111, + PlayFabErrorReportNotAvailable = 1112, + PlayFabErrorDatabaseThroughputExceeded = 1113, + PlayFabErrorInvalidGameTicket = 1115, + PlayFabErrorExpiredGameTicket = 1116, + PlayFabErrorGameTicketDoesNotMatchLobby = 1117, + PlayFabErrorLinkedDeviceAlreadyClaimed = 1118, + PlayFabErrorDeviceAlreadyLinked = 1119, + PlayFabErrorDeviceNotLinked = 1120, + PlayFabErrorPartialFailure = 1121, + PlayFabErrorPublisherNotSet = 1122, + PlayFabErrorServiceUnavailable = 1123, + PlayFabErrorVersionNotFound = 1124, + PlayFabErrorRevisionNotFound = 1125, + PlayFabErrorInvalidPublisherId = 1126, + PlayFabErrorDownstreamServiceUnavailable = 1127, + PlayFabErrorAPINotIncludedInTitleUsageTier = 1128, + PlayFabErrorDAULimitExceeded = 1129, + PlayFabErrorAPIRequestLimitExceeded = 1130, + PlayFabErrorInvalidAPIEndpoint = 1131, + PlayFabErrorBuildNotAvailable = 1132, + PlayFabErrorConcurrentEditError = 1133, + PlayFabErrorContentNotFound = 1134, + PlayFabErrorCharacterNotFound = 1135, + PlayFabErrorCloudScriptNotFound = 1136, + PlayFabErrorContentQuotaExceeded = 1137, + PlayFabErrorInvalidCharacterStatistics = 1138, + PlayFabErrorPhotonNotEnabledForTitle = 1139, + PlayFabErrorPhotonApplicationNotFound = 1140, + PlayFabErrorPhotonApplicationNotAssociatedWithTitle = 1141, + PlayFabErrorInvalidEmailOrPassword = 1142, + PlayFabErrorFacebookAPIError = 1143, + PlayFabErrorInvalidContentType = 1144, + PlayFabErrorKeyLengthExceeded = 1145, + PlayFabErrorDataLengthExceeded = 1146, + PlayFabErrorTooManyKeys = 1147, + PlayFabErrorFreeTierCannotHaveVirtualCurrency = 1148, + PlayFabErrorMissingAmazonSharedKey = 1149, + PlayFabErrorAmazonValidationError = 1150, + PlayFabErrorInvalidPSNIssuerId = 1151, + PlayFabErrorPSNInaccessible = 1152, + PlayFabErrorExpiredAuthToken = 1153, + PlayFabErrorFailedToGetEntitlements = 1154, + PlayFabErrorFailedToConsumeEntitlement = 1155, + PlayFabErrorTradeAcceptingUserNotAllowed = 1156, + PlayFabErrorTradeInventoryItemIsAssignedToCharacter = 1157, + PlayFabErrorTradeInventoryItemIsBundle = 1158, + PlayFabErrorTradeStatusNotValidForCancelling = 1159, + PlayFabErrorTradeStatusNotValidForAccepting = 1160, + PlayFabErrorTradeDoesNotExist = 1161, + PlayFabErrorTradeCancelled = 1162, + PlayFabErrorTradeAlreadyFilled = 1163, + PlayFabErrorTradeWaitForStatusTimeout = 1164, + PlayFabErrorTradeInventoryItemExpired = 1165, + PlayFabErrorTradeMissingOfferedAndAcceptedItems = 1166, + PlayFabErrorTradeAcceptedItemIsBundle = 1167, + PlayFabErrorTradeAcceptedItemIsStackable = 1168, + PlayFabErrorTradeInventoryItemInvalidStatus = 1169, + PlayFabErrorTradeAcceptedCatalogItemInvalid = 1170, + PlayFabErrorTradeAllowedUsersInvalid = 1171, + PlayFabErrorTradeInventoryItemDoesNotExist = 1172, + PlayFabErrorTradeInventoryItemIsConsumed = 1173, + PlayFabErrorTradeInventoryItemIsStackable = 1174, + PlayFabErrorTradeAcceptedItemsMismatch = 1175, + PlayFabErrorInvalidKongregateToken = 1176, + PlayFabErrorFeatureNotConfiguredForTitle = 1177, + PlayFabErrorNoMatchingCatalogItemForReceipt = 1178, + PlayFabErrorInvalidCurrencyCode = 1179, + PlayFabErrorNoRealMoneyPriceForCatalogItem = 1180, + PlayFabErrorTradeInventoryItemIsNotTradable = 1181, + PlayFabErrorTradeAcceptedCatalogItemIsNotTradable = 1182, + PlayFabErrorUsersAlreadyFriends = 1183, + PlayFabErrorLinkedIdentifierAlreadyClaimed = 1184, + PlayFabErrorCustomIdNotLinked = 1185, + PlayFabErrorTotalDataSizeExceeded = 1186, + PlayFabErrorDeleteKeyConflict = 1187, + PlayFabErrorInvalidXboxLiveToken = 1188, + PlayFabErrorExpiredXboxLiveToken = 1189, + PlayFabErrorResettableStatisticVersionRequired = 1190, + PlayFabErrorNotAuthorizedByTitle = 1191, + PlayFabErrorNoPartnerEnabled = 1192, + PlayFabErrorInvalidPartnerResponse = 1193, + PlayFabErrorAPINotEnabledForGameServerAccess = 1194, + PlayFabErrorStatisticNotFound = 1195, + PlayFabErrorStatisticNameConflict = 1196, + PlayFabErrorStatisticVersionClosedForWrites = 1197, + PlayFabErrorStatisticVersionInvalid = 1198, + PlayFabErrorAPIClientRequestRateLimitExceeded = 1199, + PlayFabErrorInvalidJSONContent = 1200, + PlayFabErrorInvalidDropTable = 1201, + PlayFabErrorStatisticVersionAlreadyIncrementedForScheduledInterval = 1202, + PlayFabErrorStatisticCountLimitExceeded = 1203, + PlayFabErrorStatisticVersionIncrementRateExceeded = 1204, + PlayFabErrorContainerKeyInvalid = 1205, + PlayFabErrorCloudScriptExecutionTimeLimitExceeded = 1206, + PlayFabErrorNoWritePermissionsForEvent = 1207, + PlayFabErrorCloudScriptFunctionArgumentSizeExceeded = 1208, + PlayFabErrorCloudScriptAPIRequestCountExceeded = 1209, + PlayFabErrorCloudScriptAPIRequestError = 1210, + PlayFabErrorCloudScriptHTTPRequestError = 1211, + PlayFabErrorInsufficientGuildRole = 1212, + PlayFabErrorGuildNotFound = 1213, + PlayFabErrorOverLimit = 1214, + PlayFabErrorEventNotFound = 1215, + PlayFabErrorInvalidEventField = 1216, + PlayFabErrorInvalidEventName = 1217, + PlayFabErrorCatalogNotConfigured = 1218, + PlayFabErrorOperationNotSupportedForPlatform = 1219, + PlayFabErrorSegmentNotFound = 1220, + PlayFabErrorStoreNotFound = 1221, + PlayFabErrorInvalidStatisticName = 1222, + PlayFabErrorTitleNotQualifiedForLimit = 1223, + PlayFabErrorInvalidServiceLimitLevel = 1224, + PlayFabErrorServiceLimitLevelInTransition = 1225, + PlayFabErrorCouponAlreadyRedeemed = 1226, + PlayFabErrorGameServerBuildSizeLimitExceeded = 1227, + PlayFabErrorGameServerBuildCountLimitExceeded = 1228, + PlayFabErrorVirtualCurrencyCountLimitExceeded = 1229, + PlayFabErrorVirtualCurrencyCodeExists = 1230, + PlayFabErrorTitleNewsItemCountLimitExceeded = 1231, + PlayFabErrorInvalidTwitchToken = 1232, + PlayFabErrorTwitchResponseError = 1233, + PlayFabErrorProfaneDisplayName = 1234, + PlayFabErrorUserAlreadyAdded = 1235, + PlayFabErrorInvalidVirtualCurrencyCode = 1236, + PlayFabErrorVirtualCurrencyCannotBeDeleted = 1237, + PlayFabErrorIdentifierAlreadyClaimed = 1238, + PlayFabErrorIdentifierNotLinked = 1239, + PlayFabErrorInvalidContinuationToken = 1240, + PlayFabErrorExpiredContinuationToken = 1241, + PlayFabErrorInvalidSegment = 1242, + PlayFabErrorInvalidSessionId = 1243, + PlayFabErrorSessionLogNotFound = 1244, + PlayFabErrorInvalidSearchTerm = 1245, + PlayFabErrorTwoFactorAuthenticationTokenRequired = 1246, + PlayFabErrorGameServerHostCountLimitExceeded = 1247, + PlayFabErrorPlayerTagCountLimitExceeded = 1248, + PlayFabErrorRequestAlreadyRunning = 1249, + PlayFabErrorActionGroupNotFound = 1250, + PlayFabErrorMaximumSegmentBulkActionJobsRunning = 1251, + PlayFabErrorNoActionsOnPlayersInSegmentJob = 1252, + PlayFabErrorDuplicateStatisticName = 1253, + PlayFabErrorScheduledTaskNameConflict = 1254, + PlayFabErrorScheduledTaskCreateConflict = 1255, + PlayFabErrorInvalidScheduledTaskName = 1256, + PlayFabErrorInvalidTaskSchedule = 1257, + PlayFabErrorSteamNotEnabledForTitle = 1258, + PlayFabErrorLimitNotAnUpgradeOption = 1259, + PlayFabErrorNoSecretKeyEnabledForCloudScript = 1260, + PlayFabErrorTaskNotFound = 1261, + PlayFabErrorTaskInstanceNotFound = 1262, + PlayFabErrorInvalidIdentityProviderId = 1263, + PlayFabErrorMisconfiguredIdentityProvider = 1264, + PlayFabErrorInvalidScheduledTaskType = 1265, + PlayFabErrorBillingInformationRequired = 1266, + PlayFabErrorLimitedEditionItemUnavailable = 1267, + PlayFabErrorInvalidAdPlacementAndReward = 1268, + PlayFabErrorAllAdPlacementViewsAlreadyConsumed = 1269, + PlayFabErrorGoogleOAuthNotConfiguredForTitle = 1270, + PlayFabErrorGoogleOAuthError = 1271, + PlayFabErrorUserNotFriend = 1272, + PlayFabErrorInvalidSignature = 1273, + PlayFabErrorInvalidPublicKey = 1274, + PlayFabErrorGoogleOAuthNoIdTokenIncludedInResponse = 1275, + PlayFabErrorStatisticUpdateInProgress = 1276, + PlayFabErrorLeaderboardVersionNotAvailable = 1277, + PlayFabErrorStatisticAlreadyHasPrizeTable = 1279, + PlayFabErrorPrizeTableHasOverlappingRanks = 1280, + PlayFabErrorPrizeTableHasMissingRanks = 1281, + PlayFabErrorPrizeTableRankStartsAtZero = 1282, + PlayFabErrorInvalidStatistic = 1283, + PlayFabErrorExpressionParseFailure = 1284, + PlayFabErrorExpressionInvokeFailure = 1285, + PlayFabErrorExpressionTooLong = 1286, + PlayFabErrorDataUpdateRateExceeded = 1287, + PlayFabErrorRestrictedEmailDomain = 1288, + PlayFabErrorEncryptionKeyDisabled = 1289, + PlayFabErrorEncryptionKeyMissing = 1290, + PlayFabErrorEncryptionKeyBroken = 1291, + PlayFabErrorNoSharedSecretKeyConfigured = 1292, + PlayFabErrorSecretKeyNotFound = 1293, + PlayFabErrorPlayerSecretAlreadyConfigured = 1294, + PlayFabErrorAPIRequestsDisabledForTitle = 1295, + PlayFabErrorInvalidSharedSecretKey = 1296, + PlayFabErrorPrizeTableHasNoRanks = 1297, + PlayFabErrorProfileDoesNotExist = 1298, + PlayFabErrorContentS3OriginBucketNotConfigured = 1299, + PlayFabErrorInvalidEnvironmentForReceipt = 1300, + PlayFabErrorEncryptedRequestNotAllowed = 1301, + PlayFabErrorSignedRequestNotAllowed = 1302, + PlayFabErrorRequestViewConstraintParamsNotAllowed = 1303, + PlayFabErrorBadPartnerConfiguration = 1304, + PlayFabErrorXboxBPCertificateFailure = 1305, + PlayFabErrorXboxXASSExchangeFailure = 1306, + PlayFabErrorInvalidEntityId = 1307, + PlayFabErrorStatisticValueAggregationOverflow = 1308, + PlayFabErrorEmailMessageFromAddressIsMissing = 1309, + PlayFabErrorEmailMessageToAddressIsMissing = 1310, + PlayFabErrorSmtpServerAuthenticationError = 1311, + PlayFabErrorSmtpServerLimitExceeded = 1312, + PlayFabErrorSmtpServerInsufficientStorage = 1313, + PlayFabErrorSmtpServerCommunicationError = 1314, + PlayFabErrorSmtpServerGeneralFailure = 1315, + PlayFabErrorEmailClientTimeout = 1316, + PlayFabErrorEmailClientCanceledTask = 1317, + PlayFabErrorEmailTemplateMissing = 1318, + PlayFabErrorInvalidHostForTitleId = 1319, + PlayFabErrorEmailConfirmationTokenDoesNotExist = 1320, + PlayFabErrorEmailConfirmationTokenExpired = 1321, + PlayFabErrorAccountDeleted = 1322, + PlayFabErrorPlayerSecretNotConfigured = 1323, + PlayFabErrorInvalidSignatureTime = 1324, + PlayFabErrorNoContactEmailAddressFound = 1325, + PlayFabErrorInvalidAuthToken = 1326, + PlayFabErrorAuthTokenDoesNotExist = 1327, + PlayFabErrorAuthTokenExpired = 1328, + PlayFabErrorAuthTokenAlreadyUsedToResetPassword = 1329, + PlayFabErrorMembershipNameTooLong = 1330, + PlayFabErrorMembershipNotFound = 1331, + PlayFabErrorGoogleServiceAccountInvalid = 1332, + PlayFabErrorGoogleServiceAccountParseFailure = 1333, + PlayFabErrorEntityTokenMissing = 1334, + PlayFabErrorEntityTokenInvalid = 1335, + PlayFabErrorEntityTokenExpired = 1336, + PlayFabErrorEntityTokenRevoked = 1337, + PlayFabErrorInvalidProductForSubscription = 1338, + PlayFabErrorXboxInaccessible = 1339, + PlayFabErrorSubscriptionAlreadyTaken = 1340, + PlayFabErrorSmtpAddonNotEnabled = 1341, + PlayFabErrorAPIConcurrentRequestLimitExceeded = 1342, + PlayFabErrorXboxRejectedXSTSExchangeRequest = 1343, + PlayFabErrorVariableNotDefined = 1344, + PlayFabErrorTemplateVersionNotDefined = 1345, + PlayFabErrorFileTooLarge = 1346, + PlayFabErrorTitleDeleted = 1347, + PlayFabErrorTitleContainsUserAccounts = 1348, + PlayFabErrorTitleDeletionPlayerCleanupFailure = 1349, + PlayFabErrorEntityFileOperationPending = 1350, + PlayFabErrorNoEntityFileOperationPending = 1351, + PlayFabErrorEntityProfileVersionMismatch = 1352, + PlayFabErrorTemplateVersionTooOld = 1353, + PlayFabErrorMembershipDefinitionInUse = 1354, + PlayFabErrorPaymentPageNotConfigured = 1355, + PlayFabErrorFailedLoginAttemptRateLimitExceeded = 1356, + PlayFabErrorEntityBlockedByGroup = 1357, + PlayFabErrorRoleDoesNotExist = 1358, + PlayFabErrorEntityIsAlreadyMember = 1359, + PlayFabErrorDuplicateRoleId = 1360, + PlayFabErrorGroupInvitationNotFound = 1361, + PlayFabErrorGroupApplicationNotFound = 1362, + PlayFabErrorOutstandingInvitationAcceptedInstead = 1363, + PlayFabErrorOutstandingApplicationAcceptedInstead = 1364, + PlayFabErrorRoleIsGroupDefaultMember = 1365, + PlayFabErrorRoleIsGroupAdmin = 1366, + PlayFabErrorRoleNameNotAvailable = 1367, + PlayFabErrorGroupNameNotAvailable = 1368, + PlayFabErrorEmailReportAlreadySent = 1369, + PlayFabErrorEmailReportRecipientBlacklisted = 1370, + PlayFabErrorEventNamespaceNotAllowed = 1371, + PlayFabErrorEventEntityNotAllowed = 1372, + PlayFabErrorInvalidEntityType = 1373, + PlayFabErrorNullTokenResultFromAad = 1374, + PlayFabErrorInvalidTokenResultFromAad = 1375, + PlayFabErrorNoValidCertificateForAad = 1376, + PlayFabErrorInvalidCertificateForAad = 1377, + PlayFabErrorDuplicateDropTableId = 1378, + PlayFabErrorMultiplayerServerError = 1379, + PlayFabErrorMultiplayerServerTooManyRequests = 1380, + PlayFabErrorMultiplayerServerNoContent = 1381, + PlayFabErrorMultiplayerServerBadRequest = 1382, + PlayFabErrorMultiplayerServerUnauthorized = 1383, + PlayFabErrorMultiplayerServerForbidden = 1384, + PlayFabErrorMultiplayerServerNotFound = 1385, + PlayFabErrorMultiplayerServerConflict = 1386, + PlayFabErrorMultiplayerServerInternalServerError = 1387, + PlayFabErrorMultiplayerServerUnavailable = 1388, + PlayFabErrorExplicitContentDetected = 1389, + PlayFabErrorPIIContentDetected = 1390, + PlayFabErrorInvalidScheduledTaskParameter = 1391, + PlayFabErrorPerEntityEventRateLimitExceeded = 1392, + PlayFabErrorTitleDefaultLanguageNotSet = 1393, + PlayFabErrorEmailTemplateMissingDefaultVersion = 1394, + PlayFabErrorFacebookInstantGamesIdNotLinked = 1395, + PlayFabErrorInvalidFacebookInstantGamesSignature = 1396, + PlayFabErrorFacebookInstantGamesAuthNotConfiguredForTitle = 1397, + PlayFabErrorMatchmakingEntityInvalid = 2001, + PlayFabErrorMatchmakingPlayerAttributesInvalid = 2002, + PlayFabErrorMatchmakingCreateRequestMissing = 2003, + PlayFabErrorMatchmakingCreateRequestCreatorMissing = 2004, + PlayFabErrorMatchmakingCreateRequestCreatorIdMissing = 2005, + PlayFabErrorMatchmakingCreateRequestUserListMissing = 2006, + PlayFabErrorMatchmakingCreateRequestGiveUpAfterInvalid = 2007, + PlayFabErrorMatchmakingTicketIdMissing = 2008, + PlayFabErrorMatchmakingMatchIdMissing = 2009, + PlayFabErrorMatchmakingMatchIdIdMissing = 2010, + PlayFabErrorMatchmakingQueueNameMissing = 2011, + PlayFabErrorMatchmakingTitleIdMissing = 2012, + PlayFabErrorMatchmakingTicketIdIdMissing = 2013, + PlayFabErrorMatchmakingPlayerIdMissing = 2014, + PlayFabErrorMatchmakingJoinRequestUserMissing = 2015, + PlayFabErrorMatchmakingQueueConfigNotFound = 2016, + PlayFabErrorMatchmakingMatchNotFound = 2017, + PlayFabErrorMatchmakingTicketNotFound = 2018, + PlayFabErrorMatchmakingCreateTicketServerIdentityInvalid = 2019, + PlayFabErrorMatchmakingCreateTicketClientIdentityInvalid = 2020, + PlayFabErrorMatchmakingGetTicketUserMismatch = 2021, + PlayFabErrorMatchmakingJoinTicketServerIdentityInvalid = 2022, + PlayFabErrorMatchmakingJoinTicketUserIdentityMismatch = 2023, + PlayFabErrorMatchmakingCancelTicketServerIdentityInvalid = 2024, + PlayFabErrorMatchmakingCancelTicketUserIdentityMismatch = 2025, + PlayFabErrorMatchmakingGetMatchIdentityMismatch = 2026, + PlayFabErrorMatchmakingPlayerIdentityMismatch = 2027, + PlayFabErrorMatchmakingAlreadyJoinedTicket = 2028, + PlayFabErrorMatchmakingTicketAlreadyCompleted = 2029, + PlayFabErrorMatchmakingQueueNameInvalid = 2030, + PlayFabErrorMatchmakingQueueConfigInvalid = 2031, + PlayFabErrorMatchmakingMemberProfileInvalid = 2032, + PlayFabErrorWriteAttemptedDuringExport = 2033, + PlayFabErrorNintendoSwitchDeviceIdNotLinked = 2034, + PlayFabErrorMatchmakingNotEnabled = 2035 + }; + + struct FPlayFabError + { + int32 HttpCode; + FString HttpStatus; + int32 ErrorCode; + FString ErrorName; + FString ErrorMessage; + TMultiMap< FString, FString > ErrorDetails; + + FString GenerateErrorReport() const + { + FString output = TEXT(""); + if (ErrorMessage.Len() > 0) + output += ErrorMessage; + for (auto& Elem : ErrorDetails) + output += TEXT(" - ") + Elem.Key + TEXT(": ") + Elem.Value; + return output; + } + }; + + DECLARE_DELEGATE_OneParam(FPlayFabErrorDelegate, const FPlayFabError&); +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabEventsAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabEventsAPI.h new file mode 100644 index 000000000..7f7fe5d25 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabEventsAPI.h @@ -0,0 +1,40 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabEventsDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabEventsAPI + { + public: + DECLARE_DELEGATE_OneParam(FWriteEventsDelegate, const EventsModels::FWriteEventsResponse&); + + UPlayFabEventsAPI(); + ~UPlayFabEventsAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + // Write batches of entity based events to PlayStream. + bool WriteEvents(EventsModels::FWriteEventsRequest& request, const FWriteEventsDelegate& SuccessDelegate = FWriteEventsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnWriteEventsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteEventsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabEventsDataModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabEventsDataModels.h new file mode 100644 index 000000000..b4b0b1e59 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabEventsDataModels.h @@ -0,0 +1,167 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace EventsModels +{ + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEventContents : public FPlayFabBaseModel + { + // Entity associated with the event + FEntityKey Entity; + + // The namespace in which the event is defined. It must be prepended with 'com.playfab.events.' + FString EventNamespace; + + // The name of this event. + FString Name; + + /** + * [optional] The original unique identifier associated with this event before it was posted to PlayFab. The value might differ from + * the EventId value, which is assigned when the event is received by the server. + */ + FString OriginalId; + + /** + * [optional] The time (in UTC) associated with this event when it occurred. If specified, this value is stored in the + * OriginalTimestamp property of the PlayStream event. + */ + Boxed OriginalTimestamp; + + // [optional] Arbitrary data associated with the event. Only one of Payload or PayloadJSON is allowed. + FJsonKeeper Payload; + + /** + * [optional] Arbitrary data associated with the event, represented as a JSON serialized string. Only one of Payload or PayloadJSON is + * allowed. + */ + FString PayloadJSON; + + FEventContents() : + FPlayFabBaseModel(), + Entity(), + EventNamespace(), + Name(), + OriginalId(), + OriginalTimestamp(), + Payload(), + PayloadJSON() + {} + + FEventContents(const FEventContents& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + EventNamespace(src.EventNamespace), + Name(src.Name), + OriginalId(src.OriginalId), + OriginalTimestamp(src.OriginalTimestamp), + Payload(src.Payload), + PayloadJSON(src.PayloadJSON) + {} + + FEventContents(const TSharedPtr& obj) : FEventContents() + { + readFromValue(obj); + } + + ~FEventContents(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteEventsRequest : public FPlayFabBaseModel + { + // Collection of events to write to PlayStream. + TArray Events; + FWriteEventsRequest() : + FPlayFabBaseModel(), + Events() + {} + + FWriteEventsRequest(const FWriteEventsRequest& src) : + FPlayFabBaseModel(), + Events(src.Events) + {} + + FWriteEventsRequest(const TSharedPtr& obj) : FWriteEventsRequest() + { + readFromValue(obj); + } + + ~FWriteEventsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteEventsResponse : public FPlayFabBaseModel + { + /** + * [optional] The unique identifiers assigned by the server to the events, in the same order as the events in the request. Only + * returned if FlushToPlayStream option is true. + */ + TArray AssignedEventIds; + FWriteEventsResponse() : + FPlayFabBaseModel(), + AssignedEventIds() + {} + + FWriteEventsResponse(const FWriteEventsResponse& src) : + FPlayFabBaseModel(), + AssignedEventIds(src.AssignedEventIds) + {} + + FWriteEventsResponse(const TSharedPtr& obj) : FWriteEventsResponse() + { + readFromValue(obj); + } + + ~FWriteEventsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabGroupsAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabGroupsAPI.h new file mode 100644 index 000000000..f50bf69fc --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabGroupsAPI.h @@ -0,0 +1,211 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabGroupsDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabGroupsAPI + { + public: + DECLARE_DELEGATE_OneParam(FAcceptGroupApplicationDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FAcceptGroupInvitationDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FAddMembersDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FApplyToGroupDelegate, const GroupsModels::FApplyToGroupResponse&); + DECLARE_DELEGATE_OneParam(FBlockEntityDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FChangeMemberRoleDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FCreateGroupDelegate, const GroupsModels::FCreateGroupResponse&); + DECLARE_DELEGATE_OneParam(FCreateRoleDelegate, const GroupsModels::FCreateGroupRoleResponse&); + DECLARE_DELEGATE_OneParam(FDeleteGroupDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FDeleteRoleDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FGetGroupDelegate, const GroupsModels::FGetGroupResponse&); + DECLARE_DELEGATE_OneParam(FInviteToGroupDelegate, const GroupsModels::FInviteToGroupResponse&); + DECLARE_DELEGATE_OneParam(FIsMemberDelegate, const GroupsModels::FIsMemberResponse&); + DECLARE_DELEGATE_OneParam(FListGroupApplicationsDelegate, const GroupsModels::FListGroupApplicationsResponse&); + DECLARE_DELEGATE_OneParam(FListGroupBlocksDelegate, const GroupsModels::FListGroupBlocksResponse&); + DECLARE_DELEGATE_OneParam(FListGroupInvitationsDelegate, const GroupsModels::FListGroupInvitationsResponse&); + DECLARE_DELEGATE_OneParam(FListGroupMembersDelegate, const GroupsModels::FListGroupMembersResponse&); + DECLARE_DELEGATE_OneParam(FListMembershipDelegate, const GroupsModels::FListMembershipResponse&); + DECLARE_DELEGATE_OneParam(FListMembershipOpportunitiesDelegate, const GroupsModels::FListMembershipOpportunitiesResponse&); + DECLARE_DELEGATE_OneParam(FRemoveGroupApplicationDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FRemoveGroupInvitationDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FRemoveMembersDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FUnblockEntityDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FUpdateGroupDelegate, const GroupsModels::FUpdateGroupResponse&); + DECLARE_DELEGATE_OneParam(FUpdateRoleDelegate, const GroupsModels::FUpdateGroupRoleResponse&); + + UPlayFabGroupsAPI(); + ~UPlayFabGroupsAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Accepts an outstanding invitation to to join a group + * Accepts an outstanding invitation to to join a group if the invited entity is not blocked by the group. Nothing is returned in the case of success. + */ + bool AcceptGroupApplication(GroupsModels::FAcceptGroupApplicationRequest& request, const FAcceptGroupApplicationDelegate& SuccessDelegate = FAcceptGroupApplicationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Accepts an invitation to join a group + * Accepts an outstanding invitation to join the group if the invited entity is not blocked by the group. Only the invited entity or a parent in its chain (e.g. title) may accept the invitation on the invited entity's behalf. Nothing is returned in the case of success. + */ + bool AcceptGroupInvitation(GroupsModels::FAcceptGroupInvitationRequest& request, const FAcceptGroupInvitationDelegate& SuccessDelegate = FAcceptGroupInvitationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds members to a group or role. + * Adds members to a group or role. Existing members of the group will added to roles within the group, but if the user is not already a member of the group, only title claimants may add them to the group, and others must use the group application or invite system to add new members to a group. Returns nothing if successful. + */ + bool AddMembers(GroupsModels::FAddMembersRequest& request, const FAddMembersDelegate& SuccessDelegate = FAddMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Applies to join a group + * Creates an application to join a group. Calling this while a group application already exists will return the same application instead of an error and will not refresh the time before the application expires. By default, if the entity has an invitation to join the group outstanding, this will accept the invitation to join the group instead and return an error indicating such, rather than creating a duplicate application to join that will need to be cleaned up later. Returns information about the application or an error indicating an invitation was accepted instead. + */ + bool ApplyToGroup(GroupsModels::FApplyToGroupRequest& request, const FApplyToGroupDelegate& SuccessDelegate = FApplyToGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Blocks a list of entities from joining a group. + * Blocks a list of entities from joining a group. Blocked entities may not create new applications to join, be invited to join, accept an invitation, or have an application accepted. Failure due to being blocked does not clean up existing applications or invitations to the group. No data is returned in the case of success. + */ + bool BlockEntity(GroupsModels::FBlockEntityRequest& request, const FBlockEntityDelegate& SuccessDelegate = FBlockEntityDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Changes the role membership of a list of entities from one role to another. + * Changes the role membership of a list of entities from one role to another in in a single operation. The destination role must already exist. This is equivalent to adding the entities to the destination role and removing from the origin role. Returns nothing if successful. + */ + bool ChangeMemberRole(GroupsModels::FChangeMemberRoleRequest& request, const FChangeMemberRoleDelegate& SuccessDelegate = FChangeMemberRoleDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates a new group. + * Creates a new group, as well as administration and member roles, based off of a title's group template. Returns information about the group that was created. + */ + bool CreateGroup(GroupsModels::FCreateGroupRequest& request, const FCreateGroupDelegate& SuccessDelegate = FCreateGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates a new group role. + * Creates a new role within an existing group, with no members. Both the role ID and role name must be unique within the group, but the name can be the same as the ID. The role ID is set at creation and cannot be changed. Returns information about the role that was created. + */ + bool CreateRole(GroupsModels::FCreateGroupRoleRequest& request, const FCreateRoleDelegate& SuccessDelegate = FCreateRoleDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes a group and all roles, invitations, join requests, and blocks associated with it. + * Deletes a group and all roles, invitations, join requests, and blocks associated with it. Permission to delete is only required the group itself to execute this action. The group and data cannot be cannot be recovered once removed, but any abuse reports about the group will remain. No data is returned in the case of success. + */ + bool DeleteGroup(GroupsModels::FDeleteGroupRequest& request, const FDeleteGroupDelegate& SuccessDelegate = FDeleteGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes an existing role in a group. + * Returns information about the role + */ + bool DeleteRole(GroupsModels::FDeleteRoleRequest& request, const FDeleteRoleDelegate& SuccessDelegate = FDeleteRoleDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Gets information about a group and its roles + * Returns the ID, name, role list and other non-membership related information about a group. + */ + bool GetGroup(GroupsModels::FGetGroupRequest& request, const FGetGroupDelegate& SuccessDelegate = FGetGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Invites a player to join a group + * Invites a player to join a group, if they are not blocked by the group. An optional role can be provided to automatically assign the player to the role if they accept the invitation. By default, if the entity has an application to the group outstanding, this will accept the application instead and return an error indicating such, rather than creating a duplicate invitation to join that will need to be cleaned up later. Returns information about the new invitation or an error indicating an existing application to join was accepted. + */ + bool InviteToGroup(GroupsModels::FInviteToGroupRequest& request, const FInviteToGroupDelegate& SuccessDelegate = FInviteToGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Checks to see if an entity is a member of a group or role within the group + * Checks to see if an entity is a member of a group or role within the group. A result indicating if the entity is a member of the group is returned, or a permission error if the caller does not have permission to read the group's member list. + */ + bool IsMember(GroupsModels::FIsMemberRequest& request, const FIsMemberDelegate& SuccessDelegate = FIsMemberDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all outstanding requests to join a group + * Lists all outstanding requests to join a group. Returns a list of all requests to join, as well as when the request will expire. To get the group applications for a specific entity, use ListMembershipOpportunities. + */ + bool ListGroupApplications(GroupsModels::FListGroupApplicationsRequest& request, const FListGroupApplicationsDelegate& SuccessDelegate = FListGroupApplicationsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all entities blocked from joining a group + * Lists all entities blocked from joining a group. A list of blocked entities is returned + */ + bool ListGroupBlocks(GroupsModels::FListGroupBlocksRequest& request, const FListGroupBlocksDelegate& SuccessDelegate = FListGroupBlocksDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all outstanding invitations for a group + * Lists all outstanding invitations for a group. Returns a list of entities that have been invited, as well as when the invitation will expire. To get the group invitations for a specific entity, use ListMembershipOpportunities. + */ + bool ListGroupInvitations(GroupsModels::FListGroupInvitationsRequest& request, const FListGroupInvitationsDelegate& SuccessDelegate = FListGroupInvitationsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all members for a group + * Gets a list of members and the roles they belong to within the group. If the caller does not have permission to view the role, and the member is in no other role, the member is not displayed. Returns a list of entities that are members of the group. + */ + bool ListGroupMembers(GroupsModels::FListGroupMembersRequest& request, const FListGroupMembersDelegate& SuccessDelegate = FListGroupMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all groups and roles for an entity + * Lists the groups and roles that an entity is a part of, checking to see if group and role metadata and memberships should be visible to the caller. If the entity is not in any roles that are visible to the caller, the group is not returned in the results, even if the caller otherwise has permission to see that the entity is a member of that group. + */ + bool ListMembership(GroupsModels::FListMembershipRequest& request, const FListMembershipDelegate& SuccessDelegate = FListMembershipDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all outstanding invitations and group applications for an entity + * Lists all outstanding group applications and invitations for an entity. Anyone may call this for any entity, but data will only be returned for the entity or a parent of that entity. To list invitations or applications for a group to check if a player is trying to join, use ListGroupInvitations and ListGroupApplications. + */ + bool ListMembershipOpportunities(GroupsModels::FListMembershipOpportunitiesRequest& request, const FListMembershipOpportunitiesDelegate& SuccessDelegate = FListMembershipOpportunitiesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes an application to join a group + * Removes an existing application to join the group. This is used for both rejection of an application as well as withdrawing an application. The applying entity or a parent in its chain (e.g. title) may withdraw the application, and any caller with appropriate access in the group may reject an application. No data is returned in the case of success. + */ + bool RemoveGroupApplication(GroupsModels::FRemoveGroupApplicationRequest& request, const FRemoveGroupApplicationDelegate& SuccessDelegate = FRemoveGroupApplicationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes an invitation join a group + * Removes an existing invitation to join the group. This is used for both rejection of an invitation as well as rescinding an invitation. The invited entity or a parent in its chain (e.g. title) may reject the invitation by calling this method, and any caller with appropriate access in the group may rescind an invitation. No data is returned in the case of success. + */ + bool RemoveGroupInvitation(GroupsModels::FRemoveGroupInvitationRequest& request, const FRemoveGroupInvitationDelegate& SuccessDelegate = FRemoveGroupInvitationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes members from a group. + * Removes members from a group. A member can always remove themselves from a group, regardless of permissions. Returns nothing if successful. + */ + bool RemoveMembers(GroupsModels::FRemoveMembersRequest& request, const FRemoveMembersDelegate& SuccessDelegate = FRemoveMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Unblocks a list of entities from joining a group + * Unblocks a list of entities from joining a group. No data is returned in the case of success. + */ + bool UnblockEntity(GroupsModels::FUnblockEntityRequest& request, const FUnblockEntityDelegate& SuccessDelegate = FUnblockEntityDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates non-membership data about a group. + * Updates data about a group, such as the name or default member role. Returns information about whether the update was successful. Only title claimants may modify the administration role for a group. + */ + bool UpdateGroup(GroupsModels::FUpdateGroupRequest& request, const FUpdateGroupDelegate& SuccessDelegate = FUpdateGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates metadata about a role. + * Updates the role name. Returns information about whether the update was successful. + */ + bool UpdateRole(GroupsModels::FUpdateGroupRoleRequest& request, const FUpdateRoleDelegate& SuccessDelegate = FUpdateRoleDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnAcceptGroupApplicationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAcceptGroupApplicationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAcceptGroupInvitationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAcceptGroupInvitationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnApplyToGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FApplyToGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnBlockEntityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FBlockEntityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnChangeMemberRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FChangeMemberRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreateGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreateRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnInviteToGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FInviteToGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnIsMemberResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FIsMemberDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListGroupApplicationsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupApplicationsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListGroupBlocksResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupBlocksDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListGroupInvitationsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupInvitationsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListMembershipResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMembershipDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListMembershipOpportunitiesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMembershipOpportunitiesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveGroupApplicationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveGroupApplicationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveGroupInvitationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveGroupInvitationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnblockEntityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnblockEntityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabGroupsDataModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabGroupsDataModels.h new file mode 100644 index 000000000..6aa5e2876 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabGroupsDataModels.h @@ -0,0 +1,1650 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace GroupsModels +{ + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAcceptGroupApplicationRequest : public FPlayFabBaseModel + { + /** + * Optional. Type of the entity to accept as. If specified, must be the same entity as the claimant or an entity that is a + * child of the claimant entity. Defaults to the claimant entity. + */ + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + FAcceptGroupApplicationRequest() : + FPlayFabBaseModel(), + Entity(), + Group() + {} + + FAcceptGroupApplicationRequest(const FAcceptGroupApplicationRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Group(src.Group) + {} + + FAcceptGroupApplicationRequest(const TSharedPtr& obj) : FAcceptGroupApplicationRequest() + { + readFromValue(obj); + } + + ~FAcceptGroupApplicationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAcceptGroupInvitationRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + // The identifier of the group + FEntityKey Group; + + FAcceptGroupInvitationRequest() : + FPlayFabBaseModel(), + Entity(nullptr), + Group() + {} + + FAcceptGroupInvitationRequest(const FAcceptGroupInvitationRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + Group(src.Group) + {} + + FAcceptGroupInvitationRequest(const TSharedPtr& obj) : FAcceptGroupInvitationRequest() + { + readFromValue(obj); + } + + ~FAcceptGroupInvitationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddMembersRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + // List of entities to add to the group. Only entities of type title_player_account and character may be added to groups. + TArray Members; + /** + * [optional] Optional: The ID of the existing role to add the entities to. If this is not specified, the default member role for the + * group will be used. Role IDs must be between 1 and 64 characters long. + */ + FString RoleId; + + FAddMembersRequest() : + FPlayFabBaseModel(), + Group(), + Members(), + RoleId() + {} + + FAddMembersRequest(const FAddMembersRequest& src) : + FPlayFabBaseModel(), + Group(src.Group), + Members(src.Members), + RoleId(src.RoleId) + {} + + FAddMembersRequest(const TSharedPtr& obj) : FAddMembersRequest() + { + readFromValue(obj); + } + + ~FAddMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FApplyToGroupRequest : public FPlayFabBaseModel + { + // [optional] Optional, default true. Automatically accept an outstanding invitation if one exists instead of creating an application + Boxed AutoAcceptOutstandingInvite; + + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + // The identifier of the group + FEntityKey Group; + + FApplyToGroupRequest() : + FPlayFabBaseModel(), + AutoAcceptOutstandingInvite(), + Entity(nullptr), + Group() + {} + + FApplyToGroupRequest(const FApplyToGroupRequest& src) : + FPlayFabBaseModel(), + AutoAcceptOutstandingInvite(src.AutoAcceptOutstandingInvite), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + Group(src.Group) + {} + + FApplyToGroupRequest(const TSharedPtr& obj) : FApplyToGroupRequest() + { + readFromValue(obj); + } + + ~FApplyToGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityWithLineage : public FPlayFabBaseModel + { + // [optional] The entity key for the specified entity + TSharedPtr Key; + + // [optional] Dictionary of entity keys for related entities. Dictionary key is entity type. + TMap Lineage; + FEntityWithLineage() : + FPlayFabBaseModel(), + Key(nullptr), + Lineage() + {} + + FEntityWithLineage(const FEntityWithLineage& src) : + FPlayFabBaseModel(), + Key(src.Key.IsValid() ? MakeShareable(new FEntityKey(*src.Key)) : nullptr), + Lineage(src.Lineage) + {} + + FEntityWithLineage(const TSharedPtr& obj) : FEntityWithLineage() + { + readFromValue(obj); + } + + ~FEntityWithLineage(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FApplyToGroupResponse : public FPlayFabBaseModel + { + // [optional] Type of entity that requested membership + TSharedPtr Entity; + + // When the application to join will expire and be deleted + FDateTime Expires; + + // [optional] ID of the group that the entity requesting membership to + TSharedPtr Group; + + FApplyToGroupResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + Expires(0), + Group(nullptr) + {} + + FApplyToGroupResponse(const FApplyToGroupResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.Entity)) : nullptr), + Expires(src.Expires), + Group(src.Group.IsValid() ? MakeShareable(new FEntityKey(*src.Group)) : nullptr) + {} + + FApplyToGroupResponse(const TSharedPtr& obj) : FApplyToGroupResponse() + { + readFromValue(obj); + } + + ~FApplyToGroupResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBlockEntityRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + FBlockEntityRequest() : + FPlayFabBaseModel(), + Entity(), + Group() + {} + + FBlockEntityRequest(const FBlockEntityRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Group(src.Group) + {} + + FBlockEntityRequest(const TSharedPtr& obj) : FBlockEntityRequest() + { + readFromValue(obj); + } + + ~FBlockEntityRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FChangeMemberRoleRequest : public FPlayFabBaseModel + { + /** + * [optional] The ID of the role that the entities will become a member of. This must be an existing role. Role IDs must be between 1 + * and 64 characters long. + */ + FString DestinationRoleId; + + // The identifier of the group + FEntityKey Group; + + /** + * List of entities to move between roles in the group. All entities in this list must be members of the group and origin + * role. + */ + TArray Members; + // The ID of the role that the entities currently are a member of. Role IDs must be between 1 and 64 characters long. + FString OriginRoleId; + + FChangeMemberRoleRequest() : + FPlayFabBaseModel(), + DestinationRoleId(), + Group(), + Members(), + OriginRoleId() + {} + + FChangeMemberRoleRequest(const FChangeMemberRoleRequest& src) : + FPlayFabBaseModel(), + DestinationRoleId(src.DestinationRoleId), + Group(src.Group), + Members(src.Members), + OriginRoleId(src.OriginRoleId) + {} + + FChangeMemberRoleRequest(const TSharedPtr& obj) : FChangeMemberRoleRequest() + { + readFromValue(obj); + } + + ~FChangeMemberRoleRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateGroupRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + // The name of the group. This is unique at the title level by default. + FString GroupName; + + FCreateGroupRequest() : + FPlayFabBaseModel(), + Entity(nullptr), + GroupName() + {} + + FCreateGroupRequest(const FCreateGroupRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + GroupName(src.GroupName) + {} + + FCreateGroupRequest(const TSharedPtr& obj) : FCreateGroupRequest() + { + readFromValue(obj); + } + + ~FCreateGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateGroupResponse : public FPlayFabBaseModel + { + // [optional] The ID of the administrator role for the group. + FString AdminRoleId; + + // The server date and time the group was created. + FDateTime Created; + + // The identifier of the group + FEntityKey Group; + + // [optional] The name of the group. + FString GroupName; + + // [optional] The ID of the default member role for the group. + FString MemberRoleId; + + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + // [optional] The list of roles and names that belong to the group. + TMap Roles; + FCreateGroupResponse() : + FPlayFabBaseModel(), + AdminRoleId(), + Created(0), + Group(), + GroupName(), + MemberRoleId(), + ProfileVersion(0), + Roles() + {} + + FCreateGroupResponse(const FCreateGroupResponse& src) : + FPlayFabBaseModel(), + AdminRoleId(src.AdminRoleId), + Created(src.Created), + Group(src.Group), + GroupName(src.GroupName), + MemberRoleId(src.MemberRoleId), + ProfileVersion(src.ProfileVersion), + Roles(src.Roles) + {} + + FCreateGroupResponse(const TSharedPtr& obj) : FCreateGroupResponse() + { + readFromValue(obj); + } + + ~FCreateGroupResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateGroupRoleRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + /** + * The ID of the role. This must be unique within the group and cannot be changed. Role IDs must be between 1 and 64 + * characters long. + */ + FString RoleId; + + /** + * The name of the role. This must be unique within the group and can be changed later. Role names must be between 1 and + * 100 characters long + */ + FString RoleName; + + FCreateGroupRoleRequest() : + FPlayFabBaseModel(), + Group(), + RoleId(), + RoleName() + {} + + FCreateGroupRoleRequest(const FCreateGroupRoleRequest& src) : + FPlayFabBaseModel(), + Group(src.Group), + RoleId(src.RoleId), + RoleName(src.RoleName) + {} + + FCreateGroupRoleRequest(const TSharedPtr& obj) : FCreateGroupRoleRequest() + { + readFromValue(obj); + } + + ~FCreateGroupRoleRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateGroupRoleResponse : public FPlayFabBaseModel + { + // The current version of the group profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + // [optional] ID for the role + FString RoleId; + + // [optional] The name of the role + FString RoleName; + + FCreateGroupRoleResponse() : + FPlayFabBaseModel(), + ProfileVersion(0), + RoleId(), + RoleName() + {} + + FCreateGroupRoleResponse(const FCreateGroupRoleResponse& src) : + FPlayFabBaseModel(), + ProfileVersion(src.ProfileVersion), + RoleId(src.RoleId), + RoleName(src.RoleName) + {} + + FCreateGroupRoleResponse(const TSharedPtr& obj) : FCreateGroupRoleResponse() + { + readFromValue(obj); + } + + ~FCreateGroupRoleResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteGroupRequest : public FPlayFabBaseModel + { + // ID of the group or role to remove + FEntityKey Group; + + FDeleteGroupRequest() : + FPlayFabBaseModel(), + Group() + {} + + FDeleteGroupRequest(const FDeleteGroupRequest& src) : + FPlayFabBaseModel(), + Group(src.Group) + {} + + FDeleteGroupRequest(const TSharedPtr& obj) : FDeleteGroupRequest() + { + readFromValue(obj); + } + + ~FDeleteGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteRoleRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + // [optional] The ID of the role to delete. Role IDs must be between 1 and 64 characters long. + FString RoleId; + + FDeleteRoleRequest() : + FPlayFabBaseModel(), + Group(), + RoleId() + {} + + FDeleteRoleRequest(const FDeleteRoleRequest& src) : + FPlayFabBaseModel(), + Group(src.Group), + RoleId(src.RoleId) + {} + + FDeleteRoleRequest(const TSharedPtr& obj) : FDeleteRoleRequest() + { + readFromValue(obj); + } + + ~FDeleteRoleRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEmptyResponse : public FPlayFabBaseModel + { + FEmptyResponse() : + FPlayFabBaseModel() + {} + + FEmptyResponse(const FEmptyResponse& src) : + FPlayFabBaseModel() + {} + + FEmptyResponse(const TSharedPtr& obj) : FEmptyResponse() + { + readFromValue(obj); + } + + ~FEmptyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityMemberRole : public FPlayFabBaseModel + { + // [optional] The list of members in the role + TArray Members; + // [optional] The ID of the role. + FString RoleId; + + // [optional] The name of the role + FString RoleName; + + FEntityMemberRole() : + FPlayFabBaseModel(), + Members(), + RoleId(), + RoleName() + {} + + FEntityMemberRole(const FEntityMemberRole& src) : + FPlayFabBaseModel(), + Members(src.Members), + RoleId(src.RoleId), + RoleName(src.RoleName) + {} + + FEntityMemberRole(const TSharedPtr& obj) : FEntityMemberRole() + { + readFromValue(obj); + } + + ~FEntityMemberRole(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetGroupRequest : public FPlayFabBaseModel + { + // [optional] The identifier of the group + TSharedPtr Group; + + // [optional] The full name of the group + FString GroupName; + + FGetGroupRequest() : + FPlayFabBaseModel(), + Group(nullptr), + GroupName() + {} + + FGetGroupRequest(const FGetGroupRequest& src) : + FPlayFabBaseModel(), + Group(src.Group.IsValid() ? MakeShareable(new FEntityKey(*src.Group)) : nullptr), + GroupName(src.GroupName) + {} + + FGetGroupRequest(const TSharedPtr& obj) : FGetGroupRequest() + { + readFromValue(obj); + } + + ~FGetGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetGroupResponse : public FPlayFabBaseModel + { + // [optional] The ID of the administrator role for the group. + FString AdminRoleId; + + // The server date and time the group was created. + FDateTime Created; + + // The identifier of the group + FEntityKey Group; + + // [optional] The name of the group. + FString GroupName; + + // [optional] The ID of the default member role for the group. + FString MemberRoleId; + + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + // [optional] The list of roles and names that belong to the group. + TMap Roles; + FGetGroupResponse() : + FPlayFabBaseModel(), + AdminRoleId(), + Created(0), + Group(), + GroupName(), + MemberRoleId(), + ProfileVersion(0), + Roles() + {} + + FGetGroupResponse(const FGetGroupResponse& src) : + FPlayFabBaseModel(), + AdminRoleId(src.AdminRoleId), + Created(src.Created), + Group(src.Group), + GroupName(src.GroupName), + MemberRoleId(src.MemberRoleId), + ProfileVersion(src.ProfileVersion), + Roles(src.Roles) + {} + + FGetGroupResponse(const TSharedPtr& obj) : FGetGroupResponse() + { + readFromValue(obj); + } + + ~FGetGroupResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGroupApplication : public FPlayFabBaseModel + { + // [optional] Type of entity that requested membership + TSharedPtr Entity; + + // When the application to join will expire and be deleted + FDateTime Expires; + + // [optional] ID of the group that the entity requesting membership to + TSharedPtr Group; + + FGroupApplication() : + FPlayFabBaseModel(), + Entity(nullptr), + Expires(0), + Group(nullptr) + {} + + FGroupApplication(const FGroupApplication& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.Entity)) : nullptr), + Expires(src.Expires), + Group(src.Group.IsValid() ? MakeShareable(new FEntityKey(*src.Group)) : nullptr) + {} + + FGroupApplication(const TSharedPtr& obj) : FGroupApplication() + { + readFromValue(obj); + } + + ~FGroupApplication(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGroupBlock : public FPlayFabBaseModel + { + // [optional] The entity that is blocked + TSharedPtr Entity; + + // ID of the group that the entity is blocked from + FEntityKey Group; + + FGroupBlock() : + FPlayFabBaseModel(), + Entity(nullptr), + Group() + {} + + FGroupBlock(const FGroupBlock& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.Entity)) : nullptr), + Group(src.Group) + {} + + FGroupBlock(const TSharedPtr& obj) : FGroupBlock() + { + readFromValue(obj); + } + + ~FGroupBlock(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGroupInvitation : public FPlayFabBaseModel + { + // When the invitation will expire and be deleted + FDateTime Expires; + + // [optional] The group that the entity invited to + TSharedPtr Group; + + // [optional] The entity that created the invitation + TSharedPtr InvitedByEntity; + + // [optional] The entity that is invited + TSharedPtr InvitedEntity; + + // [optional] ID of the role in the group to assign the user to. + FString RoleId; + + FGroupInvitation() : + FPlayFabBaseModel(), + Expires(0), + Group(nullptr), + InvitedByEntity(nullptr), + InvitedEntity(nullptr), + RoleId() + {} + + FGroupInvitation(const FGroupInvitation& src) : + FPlayFabBaseModel(), + Expires(src.Expires), + Group(src.Group.IsValid() ? MakeShareable(new FEntityKey(*src.Group)) : nullptr), + InvitedByEntity(src.InvitedByEntity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.InvitedByEntity)) : nullptr), + InvitedEntity(src.InvitedEntity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.InvitedEntity)) : nullptr), + RoleId(src.RoleId) + {} + + FGroupInvitation(const TSharedPtr& obj) : FGroupInvitation() + { + readFromValue(obj); + } + + ~FGroupInvitation(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGroupRole : public FPlayFabBaseModel + { + // [optional] ID for the role + FString RoleId; + + // [optional] The name of the role + FString RoleName; + + FGroupRole() : + FPlayFabBaseModel(), + RoleId(), + RoleName() + {} + + FGroupRole(const FGroupRole& src) : + FPlayFabBaseModel(), + RoleId(src.RoleId), + RoleName(src.RoleName) + {} + + FGroupRole(const TSharedPtr& obj) : FGroupRole() + { + readFromValue(obj); + } + + ~FGroupRole(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGroupWithRoles : public FPlayFabBaseModel + { + // [optional] ID for the group + TSharedPtr Group; + + // [optional] The name of the group + FString GroupName; + + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + // [optional] The list of roles within the group + TArray Roles; + FGroupWithRoles() : + FPlayFabBaseModel(), + Group(nullptr), + GroupName(), + ProfileVersion(0), + Roles() + {} + + FGroupWithRoles(const FGroupWithRoles& src) : + FPlayFabBaseModel(), + Group(src.Group.IsValid() ? MakeShareable(new FEntityKey(*src.Group)) : nullptr), + GroupName(src.GroupName), + ProfileVersion(src.ProfileVersion), + Roles(src.Roles) + {} + + FGroupWithRoles(const TSharedPtr& obj) : FGroupWithRoles() + { + readFromValue(obj); + } + + ~FGroupWithRoles(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FInviteToGroupRequest : public FPlayFabBaseModel + { + // [optional] Optional, default true. Automatically accept an application if one exists instead of creating an invitation + Boxed AutoAcceptOutstandingApplication; + + // The entity to perform this action on. + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + /** + * [optional] Optional. ID of an existing a role in the group to assign the user to. The group's default member role is used if this + * is not specified. Role IDs must be between 1 and 64 characters long. + */ + FString RoleId; + + FInviteToGroupRequest() : + FPlayFabBaseModel(), + AutoAcceptOutstandingApplication(), + Entity(), + Group(), + RoleId() + {} + + FInviteToGroupRequest(const FInviteToGroupRequest& src) : + FPlayFabBaseModel(), + AutoAcceptOutstandingApplication(src.AutoAcceptOutstandingApplication), + Entity(src.Entity), + Group(src.Group), + RoleId(src.RoleId) + {} + + FInviteToGroupRequest(const TSharedPtr& obj) : FInviteToGroupRequest() + { + readFromValue(obj); + } + + ~FInviteToGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FInviteToGroupResponse : public FPlayFabBaseModel + { + // When the invitation will expire and be deleted + FDateTime Expires; + + // [optional] The group that the entity invited to + TSharedPtr Group; + + // [optional] The entity that created the invitation + TSharedPtr InvitedByEntity; + + // [optional] The entity that is invited + TSharedPtr InvitedEntity; + + // [optional] ID of the role in the group to assign the user to. + FString RoleId; + + FInviteToGroupResponse() : + FPlayFabBaseModel(), + Expires(0), + Group(nullptr), + InvitedByEntity(nullptr), + InvitedEntity(nullptr), + RoleId() + {} + + FInviteToGroupResponse(const FInviteToGroupResponse& src) : + FPlayFabBaseModel(), + Expires(src.Expires), + Group(src.Group.IsValid() ? MakeShareable(new FEntityKey(*src.Group)) : nullptr), + InvitedByEntity(src.InvitedByEntity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.InvitedByEntity)) : nullptr), + InvitedEntity(src.InvitedEntity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.InvitedEntity)) : nullptr), + RoleId(src.RoleId) + {} + + FInviteToGroupResponse(const TSharedPtr& obj) : FInviteToGroupResponse() + { + readFromValue(obj); + } + + ~FInviteToGroupResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FIsMemberRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + /** + * [optional] Optional: ID of the role to check membership of. Defaults to any role (that is, check to see if the entity is a member + * of the group in any capacity) if not specified. + */ + FString RoleId; + + FIsMemberRequest() : + FPlayFabBaseModel(), + Entity(), + Group(), + RoleId() + {} + + FIsMemberRequest(const FIsMemberRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Group(src.Group), + RoleId(src.RoleId) + {} + + FIsMemberRequest(const TSharedPtr& obj) : FIsMemberRequest() + { + readFromValue(obj); + } + + ~FIsMemberRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FIsMemberResponse : public FPlayFabBaseModel + { + // A value indicating whether or not the entity is a member. + bool IsMember; + + FIsMemberResponse() : + FPlayFabBaseModel(), + IsMember(false) + {} + + FIsMemberResponse(const FIsMemberResponse& src) : + FPlayFabBaseModel(), + IsMember(src.IsMember) + {} + + FIsMemberResponse(const TSharedPtr& obj) : FIsMemberResponse() + { + readFromValue(obj); + } + + ~FIsMemberResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupApplicationsRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + FListGroupApplicationsRequest() : + FPlayFabBaseModel(), + Group() + {} + + FListGroupApplicationsRequest(const FListGroupApplicationsRequest& src) : + FPlayFabBaseModel(), + Group(src.Group) + {} + + FListGroupApplicationsRequest(const TSharedPtr& obj) : FListGroupApplicationsRequest() + { + readFromValue(obj); + } + + ~FListGroupApplicationsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupApplicationsResponse : public FPlayFabBaseModel + { + // [optional] The requested list of applications to the group. + TArray Applications; + FListGroupApplicationsResponse() : + FPlayFabBaseModel(), + Applications() + {} + + FListGroupApplicationsResponse(const FListGroupApplicationsResponse& src) : + FPlayFabBaseModel(), + Applications(src.Applications) + {} + + FListGroupApplicationsResponse(const TSharedPtr& obj) : FListGroupApplicationsResponse() + { + readFromValue(obj); + } + + ~FListGroupApplicationsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupBlocksRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + FListGroupBlocksRequest() : + FPlayFabBaseModel(), + Group() + {} + + FListGroupBlocksRequest(const FListGroupBlocksRequest& src) : + FPlayFabBaseModel(), + Group(src.Group) + {} + + FListGroupBlocksRequest(const TSharedPtr& obj) : FListGroupBlocksRequest() + { + readFromValue(obj); + } + + ~FListGroupBlocksRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupBlocksResponse : public FPlayFabBaseModel + { + // [optional] The requested list blocked entities. + TArray BlockedEntities; + FListGroupBlocksResponse() : + FPlayFabBaseModel(), + BlockedEntities() + {} + + FListGroupBlocksResponse(const FListGroupBlocksResponse& src) : + FPlayFabBaseModel(), + BlockedEntities(src.BlockedEntities) + {} + + FListGroupBlocksResponse(const TSharedPtr& obj) : FListGroupBlocksResponse() + { + readFromValue(obj); + } + + ~FListGroupBlocksResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupInvitationsRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + FListGroupInvitationsRequest() : + FPlayFabBaseModel(), + Group() + {} + + FListGroupInvitationsRequest(const FListGroupInvitationsRequest& src) : + FPlayFabBaseModel(), + Group(src.Group) + {} + + FListGroupInvitationsRequest(const TSharedPtr& obj) : FListGroupInvitationsRequest() + { + readFromValue(obj); + } + + ~FListGroupInvitationsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupInvitationsResponse : public FPlayFabBaseModel + { + // [optional] The requested list of group invitations. + TArray Invitations; + FListGroupInvitationsResponse() : + FPlayFabBaseModel(), + Invitations() + {} + + FListGroupInvitationsResponse(const FListGroupInvitationsResponse& src) : + FPlayFabBaseModel(), + Invitations(src.Invitations) + {} + + FListGroupInvitationsResponse(const TSharedPtr& obj) : FListGroupInvitationsResponse() + { + readFromValue(obj); + } + + ~FListGroupInvitationsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupMembersRequest : public FPlayFabBaseModel + { + // ID of the group to list the members and roles for + FEntityKey Group; + + FListGroupMembersRequest() : + FPlayFabBaseModel(), + Group() + {} + + FListGroupMembersRequest(const FListGroupMembersRequest& src) : + FPlayFabBaseModel(), + Group(src.Group) + {} + + FListGroupMembersRequest(const TSharedPtr& obj) : FListGroupMembersRequest() + { + readFromValue(obj); + } + + ~FListGroupMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupMembersResponse : public FPlayFabBaseModel + { + // [optional] The requested list of roles and member entity IDs. + TArray Members; + FListGroupMembersResponse() : + FPlayFabBaseModel(), + Members() + {} + + FListGroupMembersResponse(const FListGroupMembersResponse& src) : + FPlayFabBaseModel(), + Members(src.Members) + {} + + FListGroupMembersResponse(const TSharedPtr& obj) : FListGroupMembersResponse() + { + readFromValue(obj); + } + + ~FListGroupMembersResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListMembershipOpportunitiesRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + FListMembershipOpportunitiesRequest() : + FPlayFabBaseModel(), + Entity(nullptr) + {} + + FListMembershipOpportunitiesRequest(const FListMembershipOpportunitiesRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr) + {} + + FListMembershipOpportunitiesRequest(const TSharedPtr& obj) : FListMembershipOpportunitiesRequest() + { + readFromValue(obj); + } + + ~FListMembershipOpportunitiesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListMembershipOpportunitiesResponse : public FPlayFabBaseModel + { + // [optional] The requested list of group applications. + TArray Applications; + // [optional] The requested list of group invitations. + TArray Invitations; + FListMembershipOpportunitiesResponse() : + FPlayFabBaseModel(), + Applications(), + Invitations() + {} + + FListMembershipOpportunitiesResponse(const FListMembershipOpportunitiesResponse& src) : + FPlayFabBaseModel(), + Applications(src.Applications), + Invitations(src.Invitations) + {} + + FListMembershipOpportunitiesResponse(const TSharedPtr& obj) : FListMembershipOpportunitiesResponse() + { + readFromValue(obj); + } + + ~FListMembershipOpportunitiesResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListMembershipRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + FListMembershipRequest() : + FPlayFabBaseModel(), + Entity(nullptr) + {} + + FListMembershipRequest(const FListMembershipRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr) + {} + + FListMembershipRequest(const TSharedPtr& obj) : FListMembershipRequest() + { + readFromValue(obj); + } + + ~FListMembershipRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListMembershipResponse : public FPlayFabBaseModel + { + // [optional] The list of groups + TArray Groups; + FListMembershipResponse() : + FPlayFabBaseModel(), + Groups() + {} + + FListMembershipResponse(const FListMembershipResponse& src) : + FPlayFabBaseModel(), + Groups(src.Groups) + {} + + FListMembershipResponse(const TSharedPtr& obj) : FListMembershipResponse() + { + readFromValue(obj); + } + + ~FListMembershipResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum OperationTypes + { + OperationTypesCreated, + OperationTypesUpdated, + OperationTypesDeleted, + OperationTypesNone + }; + + PLAYFABCPP_API void writeOperationTypesEnumJSON(OperationTypes enumVal, JsonWriter& writer); + PLAYFABCPP_API OperationTypes readOperationTypesFromValue(const TSharedPtr& value); + PLAYFABCPP_API OperationTypes readOperationTypesFromValue(const FString& value); + + struct PLAYFABCPP_API FRemoveGroupApplicationRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + FRemoveGroupApplicationRequest() : + FPlayFabBaseModel(), + Entity(), + Group() + {} + + FRemoveGroupApplicationRequest(const FRemoveGroupApplicationRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Group(src.Group) + {} + + FRemoveGroupApplicationRequest(const TSharedPtr& obj) : FRemoveGroupApplicationRequest() + { + readFromValue(obj); + } + + ~FRemoveGroupApplicationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveGroupInvitationRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + FRemoveGroupInvitationRequest() : + FPlayFabBaseModel(), + Entity(), + Group() + {} + + FRemoveGroupInvitationRequest(const FRemoveGroupInvitationRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Group(src.Group) + {} + + FRemoveGroupInvitationRequest(const TSharedPtr& obj) : FRemoveGroupInvitationRequest() + { + readFromValue(obj); + } + + ~FRemoveGroupInvitationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveMembersRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + // List of entities to remove + TArray Members; + // [optional] The ID of the role to remove the entities from. + FString RoleId; + + FRemoveMembersRequest() : + FPlayFabBaseModel(), + Group(), + Members(), + RoleId() + {} + + FRemoveMembersRequest(const FRemoveMembersRequest& src) : + FPlayFabBaseModel(), + Group(src.Group), + Members(src.Members), + RoleId(src.RoleId) + {} + + FRemoveMembersRequest(const TSharedPtr& obj) : FRemoveMembersRequest() + { + readFromValue(obj); + } + + ~FRemoveMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnblockEntityRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + FUnblockEntityRequest() : + FPlayFabBaseModel(), + Entity(), + Group() + {} + + FUnblockEntityRequest(const FUnblockEntityRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Group(src.Group) + {} + + FUnblockEntityRequest(const TSharedPtr& obj) : FUnblockEntityRequest() + { + readFromValue(obj); + } + + ~FUnblockEntityRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateGroupRequest : public FPlayFabBaseModel + { + // [optional] Optional: the ID of an existing role to set as the new administrator role for the group + FString AdminRoleId; + + /** + * [optional] Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from the + * GetGroup API, you can ensure that the group data update will only be performed if the group has not been updated by any + * other clients since the version you last loaded. + */ + Boxed ExpectedProfileVersion; + + // The identifier of the group + FEntityKey Group; + + // [optional] Optional: the new name of the group + FString GroupName; + + // [optional] Optional: the ID of an existing role to set as the new member role for the group + FString MemberRoleId; + + FUpdateGroupRequest() : + FPlayFabBaseModel(), + AdminRoleId(), + ExpectedProfileVersion(), + Group(), + GroupName(), + MemberRoleId() + {} + + FUpdateGroupRequest(const FUpdateGroupRequest& src) : + FPlayFabBaseModel(), + AdminRoleId(src.AdminRoleId), + ExpectedProfileVersion(src.ExpectedProfileVersion), + Group(src.Group), + GroupName(src.GroupName), + MemberRoleId(src.MemberRoleId) + {} + + FUpdateGroupRequest(const TSharedPtr& obj) : FUpdateGroupRequest() + { + readFromValue(obj); + } + + ~FUpdateGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateGroupResponse : public FPlayFabBaseModel + { + // [optional] Optional reason to explain why the operation was the result that it was. + FString OperationReason; + + // New version of the group data. + int32 ProfileVersion; + + // [optional] Indicates which operation was completed, either Created, Updated, Deleted or None. + Boxed SetResult; + + FUpdateGroupResponse() : + FPlayFabBaseModel(), + OperationReason(), + ProfileVersion(0), + SetResult() + {} + + FUpdateGroupResponse(const FUpdateGroupResponse& src) : + FPlayFabBaseModel(), + OperationReason(src.OperationReason), + ProfileVersion(src.ProfileVersion), + SetResult(src.SetResult) + {} + + FUpdateGroupResponse(const TSharedPtr& obj) : FUpdateGroupResponse() + { + readFromValue(obj); + } + + ~FUpdateGroupResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateGroupRoleRequest : public FPlayFabBaseModel + { + /** + * [optional] Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from the + * GetGroup API, you can ensure that the group data update will only be performed if the group has not been updated by any + * other clients since the version you last loaded. + */ + Boxed ExpectedProfileVersion; + + // The identifier of the group + FEntityKey Group; + + // [optional] ID of the role to update. Role IDs must be between 1 and 64 characters long. + FString RoleId; + + // The new name of the role + FString RoleName; + + FUpdateGroupRoleRequest() : + FPlayFabBaseModel(), + ExpectedProfileVersion(), + Group(), + RoleId(), + RoleName() + {} + + FUpdateGroupRoleRequest(const FUpdateGroupRoleRequest& src) : + FPlayFabBaseModel(), + ExpectedProfileVersion(src.ExpectedProfileVersion), + Group(src.Group), + RoleId(src.RoleId), + RoleName(src.RoleName) + {} + + FUpdateGroupRoleRequest(const TSharedPtr& obj) : FUpdateGroupRoleRequest() + { + readFromValue(obj); + } + + ~FUpdateGroupRoleRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateGroupRoleResponse : public FPlayFabBaseModel + { + // [optional] Optional reason to explain why the operation was the result that it was. + FString OperationReason; + + // New version of the role data. + int32 ProfileVersion; + + // [optional] Indicates which operation was completed, either Created, Updated, Deleted or None. + Boxed SetResult; + + FUpdateGroupRoleResponse() : + FPlayFabBaseModel(), + OperationReason(), + ProfileVersion(0), + SetResult() + {} + + FUpdateGroupRoleResponse(const FUpdateGroupRoleResponse& src) : + FPlayFabBaseModel(), + OperationReason(src.OperationReason), + ProfileVersion(src.ProfileVersion), + SetResult(src.SetResult) + {} + + FUpdateGroupRoleResponse(const TSharedPtr& obj) : FUpdateGroupRoleResponse() + { + readFromValue(obj); + } + + ~FUpdateGroupRoleResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabJsonHelpers.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabJsonHelpers.h new file mode 100644 index 000000000..22a817f16 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabJsonHelpers.h @@ -0,0 +1,51 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" + +class FJsonObject; +class FJsonValue; + +namespace PlayFab +{ + class FPlayFabJsonHelpers + { + public: + + // Returns the array named Key or nullptr if it is missing or the wrong type + static const TArray< TSharedPtr >& ReadArray(TSharedPtr Item, const FString& Key); +// +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const bool Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const double Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const int32 Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const uint32 Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const int64 Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const uint64 Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const FString& Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const TCHAR* Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const time_t Value); + + static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, double& OutNumber); + static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, int32& OutNumber); + static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, uint32& OutNumber); + + // why? +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalBool& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalUint16& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalInt16& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalUint32& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalInt32& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalUint64& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalInt64& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalFloat& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalDouble& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalTime& OutNumber); + + private: + FPlayFabJsonHelpers() {} + }; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabLocalizationAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabLocalizationAPI.h new file mode 100644 index 000000000..462e1b1b8 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabLocalizationAPI.h @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabLocalizationDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabLocalizationAPI + { + public: + DECLARE_DELEGATE_OneParam(FGetLanguageListDelegate, const LocalizationModels::FGetLanguageListResponse&); + + UPlayFabLocalizationAPI(); + ~UPlayFabLocalizationAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + // Retrieves the list of allowed languages, only accessible by title entities + + bool GetLanguageList(const FGetLanguageListDelegate& SuccessDelegate = FGetLanguageListDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnGetLanguageListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLanguageListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabLocalizationDataModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabLocalizationDataModels.h new file mode 100644 index 000000000..c3af3c408 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabLocalizationDataModels.h @@ -0,0 +1,64 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace LocalizationModels +{ + + struct PLAYFABCPP_API FGetLanguageListRequest : public FPlayFabBaseModel + { + FGetLanguageListRequest() : + FPlayFabBaseModel() + {} + + FGetLanguageListRequest(const FGetLanguageListRequest& src) : + FPlayFabBaseModel() + {} + + FGetLanguageListRequest(const TSharedPtr& obj) : FGetLanguageListRequest() + { + readFromValue(obj); + } + + ~FGetLanguageListRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLanguageListResponse : public FPlayFabBaseModel + { + // [optional] The list of Playfab-supported languages + TArray LanguageList; + FGetLanguageListResponse() : + FPlayFabBaseModel(), + LanguageList() + {} + + FGetLanguageListResponse(const FGetLanguageListResponse& src) : + FPlayFabBaseModel(), + LanguageList(src.LanguageList) + {} + + FGetLanguageListResponse(const TSharedPtr& obj) : FGetLanguageListResponse() + { + readFromValue(obj); + } + + ~FGetLanguageListResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabMatchmakerAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabMatchmakerAPI.h new file mode 100644 index 000000000..a796cc459 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabMatchmakerAPI.h @@ -0,0 +1,62 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabMatchmakerDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabMatchmakerAPI + { + public: + DECLARE_DELEGATE_OneParam(FAuthUserDelegate, const MatchmakerModels::FAuthUserResponse&); + DECLARE_DELEGATE_OneParam(FPlayerJoinedDelegate, const MatchmakerModels::FPlayerJoinedResponse&); + DECLARE_DELEGATE_OneParam(FPlayerLeftDelegate, const MatchmakerModels::FPlayerLeftResponse&); + DECLARE_DELEGATE_OneParam(FStartGameDelegate, const MatchmakerModels::FStartGameResponse&); + DECLARE_DELEGATE_OneParam(FUserInfoDelegate, const MatchmakerModels::FUserInfoResponse&); + + UPlayFabMatchmakerAPI(); + ~UPlayFabMatchmakerAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Validates a user with the PlayFab service + * This API allows the external match-making service to confirm that the user has a valid Session Ticket for the title, in order to securely enable match-making. The client passes the user's Session Ticket to the external match-making service, which then passes the Session Ticket in as the AuthorizationTicket in this call. + */ + bool AuthUser(MatchmakerModels::FAuthUserRequest& request, const FAuthUserDelegate& SuccessDelegate = FAuthUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Informs the PlayFab game server hosting service that the indicated user has joined the Game Server Instance specified + bool PlayerJoined(MatchmakerModels::FPlayerJoinedRequest& request, const FPlayerJoinedDelegate& SuccessDelegate = FPlayerJoinedDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Informs the PlayFab game server hosting service that the indicated user has left the Game Server Instance specified + bool PlayerLeft(MatchmakerModels::FPlayerLeftRequest& request, const FPlayerLeftDelegate& SuccessDelegate = FPlayerLeftDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Instructs the PlayFab game server hosting service to instantiate a new Game Server Instance + bool StartGame(MatchmakerModels::FStartGameRequest& request, const FStartGameDelegate& SuccessDelegate = FStartGameDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the relevant details for a specified user, which the external match-making service can then use to compute + * effective matches + */ + bool UserInfo(MatchmakerModels::FUserInfoRequest& request, const FUserInfoDelegate& SuccessDelegate = FUserInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnAuthUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAuthUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnPlayerJoinedResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPlayerJoinedDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnPlayerLeftResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPlayerLeftDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnStartGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FStartGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUserInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUserInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabMatchmakerDataModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabMatchmakerDataModels.h new file mode 100644 index 000000000..cf9964418 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabMatchmakerDataModels.h @@ -0,0 +1,530 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace MatchmakerModels +{ + + struct PLAYFABCPP_API FAuthUserRequest : public FPlayFabBaseModel + { + // Session Ticket provided by the client. + FString AuthorizationTicket; + + FAuthUserRequest() : + FPlayFabBaseModel(), + AuthorizationTicket() + {} + + FAuthUserRequest(const FAuthUserRequest& src) : + FPlayFabBaseModel(), + AuthorizationTicket(src.AuthorizationTicket) + {} + + FAuthUserRequest(const TSharedPtr& obj) : FAuthUserRequest() + { + readFromValue(obj); + } + + ~FAuthUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAuthUserResponse : public FPlayFabBaseModel + { + // Boolean indicating if the user has been authorized to use the external match-making service. + bool Authorized; + + // [optional] PlayFab unique identifier of the account that has been authorized. + FString PlayFabId; + + FAuthUserResponse() : + FPlayFabBaseModel(), + Authorized(false), + PlayFabId() + {} + + FAuthUserResponse(const FAuthUserResponse& src) : + FPlayFabBaseModel(), + Authorized(src.Authorized), + PlayFabId(src.PlayFabId) + {} + + FAuthUserResponse(const TSharedPtr& obj) : FAuthUserResponse() + { + readFromValue(obj); + } + + ~FAuthUserResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemInstance : public FPlayFabBaseModel + { + // [optional] Game specific comment associated with this instance when it was added to the user inventory. + FString Annotation; + + // [optional] Array of unique items that were awarded when this catalog item was purchased. + TArray BundleContents; + /** + * [optional] Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or + * container. + */ + FString BundleParent; + + // [optional] Catalog version for the inventory item, when this instance was created. + FString CatalogVersion; + + // [optional] A set of custom key-value pairs on the inventory item. + TMap CustomData; + // [optional] CatalogItem.DisplayName at the time this item was purchased. + FString DisplayName; + + // [optional] Timestamp for when this instance will expire. + Boxed Expiration; + + // [optional] Class name for the inventory item, as defined in the catalog. + FString ItemClass; + + // [optional] Unique identifier for the inventory item, as defined in the catalog. + FString ItemId; + + // [optional] Unique item identifier for this specific instance of the item. + FString ItemInstanceId; + + // [optional] Timestamp for when this instance was purchased. + Boxed PurchaseDate; + + // [optional] Total number of remaining uses, if this is a consumable item. + Boxed RemainingUses; + + // [optional] Currency type for the cost of the catalog item. + FString UnitCurrency; + + // Cost of the catalog item in the given currency. + uint32 UnitPrice; + + // [optional] The number of uses that were added or removed to this item in this call. + Boxed UsesIncrementedBy; + + FItemInstance() : + FPlayFabBaseModel(), + Annotation(), + BundleContents(), + BundleParent(), + CatalogVersion(), + CustomData(), + DisplayName(), + Expiration(), + ItemClass(), + ItemId(), + ItemInstanceId(), + PurchaseDate(), + RemainingUses(), + UnitCurrency(), + UnitPrice(0), + UsesIncrementedBy() + {} + + FItemInstance(const FItemInstance& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + BundleContents(src.BundleContents), + BundleParent(src.BundleParent), + CatalogVersion(src.CatalogVersion), + CustomData(src.CustomData), + DisplayName(src.DisplayName), + Expiration(src.Expiration), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + PurchaseDate(src.PurchaseDate), + RemainingUses(src.RemainingUses), + UnitCurrency(src.UnitCurrency), + UnitPrice(src.UnitPrice), + UsesIncrementedBy(src.UsesIncrementedBy) + {} + + FItemInstance(const TSharedPtr& obj) : FItemInstance() + { + readFromValue(obj); + } + + ~FItemInstance(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerJoinedRequest : public FPlayFabBaseModel + { + /** + * Unique identifier of the Game Server Instance the user is joining. This must be a Game Server Instance started with the + * Matchmaker/StartGame API. + */ + FString LobbyId; + + // PlayFab unique identifier for the player joining. + FString PlayFabId; + + FPlayerJoinedRequest() : + FPlayFabBaseModel(), + LobbyId(), + PlayFabId() + {} + + FPlayerJoinedRequest(const FPlayerJoinedRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId), + PlayFabId(src.PlayFabId) + {} + + FPlayerJoinedRequest(const TSharedPtr& obj) : FPlayerJoinedRequest() + { + readFromValue(obj); + } + + ~FPlayerJoinedRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerJoinedResponse : public FPlayFabBaseModel + { + FPlayerJoinedResponse() : + FPlayFabBaseModel() + {} + + FPlayerJoinedResponse(const FPlayerJoinedResponse& src) : + FPlayFabBaseModel() + {} + + FPlayerJoinedResponse(const TSharedPtr& obj) : FPlayerJoinedResponse() + { + readFromValue(obj); + } + + ~FPlayerJoinedResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLeftRequest : public FPlayFabBaseModel + { + /** + * Unique identifier of the Game Server Instance the user is leaving. This must be a Game Server Instance started with the + * Matchmaker/StartGame API. + */ + FString LobbyId; + + // PlayFab unique identifier for the player leaving. + FString PlayFabId; + + FPlayerLeftRequest() : + FPlayFabBaseModel(), + LobbyId(), + PlayFabId() + {} + + FPlayerLeftRequest(const FPlayerLeftRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId), + PlayFabId(src.PlayFabId) + {} + + FPlayerLeftRequest(const TSharedPtr& obj) : FPlayerLeftRequest() + { + readFromValue(obj); + } + + ~FPlayerLeftRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLeftResponse : public FPlayFabBaseModel + { + FPlayerLeftResponse() : + FPlayFabBaseModel() + {} + + FPlayerLeftResponse(const FPlayerLeftResponse& src) : + FPlayFabBaseModel() + {} + + FPlayerLeftResponse(const TSharedPtr& obj) : FPlayerLeftResponse() + { + readFromValue(obj); + } + + ~FPlayerLeftResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum Region + { + RegionUSCentral, + RegionUSEast, + RegionEUWest, + RegionSingapore, + RegionJapan, + RegionBrazil, + RegionAustralia + }; + + PLAYFABCPP_API void writeRegionEnumJSON(Region enumVal, JsonWriter& writer); + PLAYFABCPP_API Region readRegionFromValue(const TSharedPtr& value); + PLAYFABCPP_API Region readRegionFromValue(const FString& value); + + struct PLAYFABCPP_API FStartGameRequest : public FPlayFabBaseModel + { + // Unique identifier of the previously uploaded build executable which is to be started. + FString Build; + + // [optional] Custom command line argument when starting game server process. + FString CustomCommandLineData; + + /** + * HTTP endpoint URL for receiving game status events, if using an external matchmaker. When the game ends, PlayFab will + * make a POST request to this URL with the X-SecretKey header set to the value of the game's secret and an + * application/json body of { "EventName": "game_ended", "GameID": "" }. + */ + FString ExternalMatchmakerEventEndpoint; + + // Game mode for this Game Server Instance. + FString GameMode; + + // Region with which to associate the server, for filtering. + Region pfRegion; + + FStartGameRequest() : + FPlayFabBaseModel(), + Build(), + CustomCommandLineData(), + ExternalMatchmakerEventEndpoint(), + GameMode(), + pfRegion() + {} + + FStartGameRequest(const FStartGameRequest& src) : + FPlayFabBaseModel(), + Build(src.Build), + CustomCommandLineData(src.CustomCommandLineData), + ExternalMatchmakerEventEndpoint(src.ExternalMatchmakerEventEndpoint), + GameMode(src.GameMode), + pfRegion(src.pfRegion) + {} + + FStartGameRequest(const TSharedPtr& obj) : FStartGameRequest() + { + readFromValue(obj); + } + + ~FStartGameRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStartGameResponse : public FPlayFabBaseModel + { + // [optional] Unique identifier for the game/lobby in the new Game Server Instance. + FString GameID; + + // [optional] IPV4 address of the new Game Server Instance. + FString ServerHostname; + + // [optional] IPV4 address of the server + FString ServerIPV4Address; + + // [optional] IPV6 address of the new Game Server Instance. + FString ServerIPV6Address; + + // Port number for communication with the Game Server Instance. + uint32 ServerPort; + + // [optional] Public DNS name (if any) of the server + FString ServerPublicDNSName; + + FStartGameResponse() : + FPlayFabBaseModel(), + GameID(), + ServerHostname(), + ServerIPV4Address(), + ServerIPV6Address(), + ServerPort(0), + ServerPublicDNSName() + {} + + FStartGameResponse(const FStartGameResponse& src) : + FPlayFabBaseModel(), + GameID(src.GameID), + ServerHostname(src.ServerHostname), + ServerIPV4Address(src.ServerIPV4Address), + ServerIPV6Address(src.ServerIPV6Address), + ServerPort(src.ServerPort), + ServerPublicDNSName(src.ServerPublicDNSName) + {} + + FStartGameResponse(const TSharedPtr& obj) : FStartGameResponse() + { + readFromValue(obj); + } + + ~FStartGameResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserInfoRequest : public FPlayFabBaseModel + { + /** + * Minimum catalog version for which data is requested (filters the results to only contain inventory items which have a + * catalog version of this or higher). + */ + int32 MinCatalogVersion; + + // PlayFab unique identifier of the user whose information is being requested. + FString PlayFabId; + + FUserInfoRequest() : + FPlayFabBaseModel(), + MinCatalogVersion(0), + PlayFabId() + {} + + FUserInfoRequest(const FUserInfoRequest& src) : + FPlayFabBaseModel(), + MinCatalogVersion(src.MinCatalogVersion), + PlayFabId(src.PlayFabId) + {} + + FUserInfoRequest(const TSharedPtr& obj) : FUserInfoRequest() + { + readFromValue(obj); + } + + ~FUserInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FVirtualCurrencyRechargeTime : public FPlayFabBaseModel + { + /** + * Maximum value to which the regenerating currency will automatically increment. Note that it can exceed this value + * through use of the AddUserVirtualCurrency API call. However, it will not regenerate automatically until it has fallen + * below this value. + */ + int32 RechargeMax; + + // Server timestamp in UTC indicating the next time the virtual currency will be incremented. + FDateTime RechargeTime; + + // Time remaining (in seconds) before the next recharge increment of the virtual currency. + int32 SecondsToRecharge; + + FVirtualCurrencyRechargeTime() : + FPlayFabBaseModel(), + RechargeMax(0), + RechargeTime(0), + SecondsToRecharge(0) + {} + + FVirtualCurrencyRechargeTime(const FVirtualCurrencyRechargeTime& src) : + FPlayFabBaseModel(), + RechargeMax(src.RechargeMax), + RechargeTime(src.RechargeTime), + SecondsToRecharge(src.SecondsToRecharge) + {} + + FVirtualCurrencyRechargeTime(const TSharedPtr& obj) : FVirtualCurrencyRechargeTime() + { + readFromValue(obj); + } + + ~FVirtualCurrencyRechargeTime(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserInfoResponse : public FPlayFabBaseModel + { + // [optional] Array of inventory items in the user's current inventory. + TArray Inventory; + // Boolean indicating whether the user is a developer. + bool IsDeveloper; + + // [optional] PlayFab unique identifier of the user whose information was requested. + FString PlayFabId; + + // [optional] Steam unique identifier, if the user has an associated Steam account. + FString SteamId; + + // [optional] Title specific display name, if set. + FString TitleDisplayName; + + // [optional] PlayFab unique user name. + FString Username; + + // [optional] Array of virtual currency balance(s) belonging to the user. + TMap VirtualCurrency; + // [optional] Array of remaining times and timestamps for virtual currencies. + TMap VirtualCurrencyRechargeTimes; + FUserInfoResponse() : + FPlayFabBaseModel(), + Inventory(), + IsDeveloper(false), + PlayFabId(), + SteamId(), + TitleDisplayName(), + Username(), + VirtualCurrency(), + VirtualCurrencyRechargeTimes() + {} + + FUserInfoResponse(const FUserInfoResponse& src) : + FPlayFabBaseModel(), + Inventory(src.Inventory), + IsDeveloper(src.IsDeveloper), + PlayFabId(src.PlayFabId), + SteamId(src.SteamId), + TitleDisplayName(src.TitleDisplayName), + Username(src.Username), + VirtualCurrency(src.VirtualCurrency), + VirtualCurrencyRechargeTimes(src.VirtualCurrencyRechargeTimes) + {} + + FUserInfoResponse(const TSharedPtr& obj) : FUserInfoResponse() + { + readFromValue(obj); + } + + ~FUserInfoResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabProfilesAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabProfilesAPI.h new file mode 100644 index 000000000..7a34c38c6 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabProfilesAPI.h @@ -0,0 +1,79 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabProfilesDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabProfilesAPI + { + public: + DECLARE_DELEGATE_OneParam(FGetGlobalPolicyDelegate, const ProfilesModels::FGetGlobalPolicyResponse&); + DECLARE_DELEGATE_OneParam(FGetProfileDelegate, const ProfilesModels::FGetEntityProfileResponse&); + DECLARE_DELEGATE_OneParam(FGetProfilesDelegate, const ProfilesModels::FGetEntityProfilesResponse&); + DECLARE_DELEGATE_OneParam(FSetGlobalPolicyDelegate, const ProfilesModels::FSetGlobalPolicyResponse&); + DECLARE_DELEGATE_OneParam(FSetProfileLanguageDelegate, const ProfilesModels::FSetProfileLanguageResponse&); + DECLARE_DELEGATE_OneParam(FSetProfilePolicyDelegate, const ProfilesModels::FSetEntityProfilePolicyResponse&); + + UPlayFabProfilesAPI(); + ~UPlayFabProfilesAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Gets the global title access policy + * Retrieves the title access policy that is used before the profile's policy is inspected during a request. If never customized this will return the default starter policy built by PlayFab. + */ + + bool GetGlobalPolicy(const FGetGlobalPolicyDelegate& SuccessDelegate = FGetGlobalPolicyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the entity's profile. + * Given an entity type and entity identifier will retrieve the profile from the entity store. If the profile being retrieved is the caller's, then the read operation is consistent, if not it is an inconsistent read. An inconsistent read means that we do not guarantee all committed writes have occurred before reading the profile, allowing for a stale read. If consistency is important the Version Number on the result can be used to compare which version of the profile any reader has. + */ + bool GetProfile(ProfilesModels::FGetEntityProfileRequest& request, const FGetProfileDelegate& SuccessDelegate = FGetProfileDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the entity's profile. + * Given a set of entity types and entity identifiers will retrieve all readable profiles properties for the caller. Profiles that the caller is not allowed to read will silently not be included in the results. + */ + bool GetProfiles(ProfilesModels::FGetEntityProfilesRequest& request, const FGetProfilesDelegate& SuccessDelegate = FGetProfilesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets the global title access policy + * Updates the title access policy that is used before the profile's policy is inspected during a request. Policies are compiled and cached for several minutes so an update here may not be reflected in behavior for a short time. + */ + bool SetGlobalPolicy(ProfilesModels::FSetGlobalPolicyRequest& request, const FSetGlobalPolicyDelegate& SuccessDelegate = FSetGlobalPolicyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the entity's language + * Given an entity profile, will update its language to the one passed in if the profile's version is at least the one passed in + */ + bool SetProfileLanguage(ProfilesModels::FSetProfileLanguageRequest& request, const FSetProfileLanguageDelegate& SuccessDelegate = FSetProfileLanguageDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets the profiles access policy + * This will set the access policy statements on the given entity profile. This is not additive, any existing statements will be replaced with the statements in this request. + */ + bool SetProfilePolicy(ProfilesModels::FSetEntityProfilePolicyRequest& request, const FSetProfilePolicyDelegate& SuccessDelegate = FSetProfilePolicyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnGetGlobalPolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetGlobalPolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetProfilesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetProfilesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetGlobalPolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGlobalPolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetProfileLanguageResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetProfileLanguageDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetProfilePolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetProfilePolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabProfilesDataModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabProfilesDataModels.h new file mode 100644 index 000000000..cbaf94449 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabProfilesDataModels.h @@ -0,0 +1,600 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace ProfilesModels +{ + + enum EffectType + { + EffectTypeAllow, + EffectTypeDeny + }; + + PLAYFABCPP_API void writeEffectTypeEnumJSON(EffectType enumVal, JsonWriter& writer); + PLAYFABCPP_API EffectType readEffectTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API EffectType readEffectTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FEntityDataObject : public FPlayFabBaseModel + { + // [optional] Un-escaped JSON object, if DataAsObject is true. + FJsonKeeper DataObject; + + // [optional] Escaped string JSON body of the object, if DataAsObject is default or false. + FString EscapedDataObject; + + // [optional] Name of this object. + FString ObjectName; + + FEntityDataObject() : + FPlayFabBaseModel(), + DataObject(), + EscapedDataObject(), + ObjectName() + {} + + FEntityDataObject(const FEntityDataObject& src) : + FPlayFabBaseModel(), + DataObject(src.DataObject), + EscapedDataObject(src.EscapedDataObject), + ObjectName(src.ObjectName) + {} + + FEntityDataObject(const TSharedPtr& obj) : FEntityDataObject() + { + readFromValue(obj); + } + + ~FEntityDataObject(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityPermissionStatement : public FPlayFabBaseModel + { + // The action this statement effects. May be 'Read', 'Write' or '*' for both read and write. + FString Action; + + // [optional] A comment about the statement. Intended solely for bookkeeping and debugging. + FString Comment; + + // [optional] Additional conditions to be applied for entity resources. + FJsonKeeper Condition; + + // The effect this statement will have. It may be either Allow or Deny + EffectType Effect; + + // The principal this statement will effect. + FJsonKeeper Principal; + + // The resource this statements effects. Similar to 'pfrn:data--title![Title ID]/Profile/*' + FString Resource; + + FEntityPermissionStatement() : + FPlayFabBaseModel(), + Action(), + Comment(), + Condition(), + Effect(), + Principal(), + Resource() + {} + + FEntityPermissionStatement(const FEntityPermissionStatement& src) : + FPlayFabBaseModel(), + Action(src.Action), + Comment(src.Comment), + Condition(src.Condition), + Effect(src.Effect), + Principal(src.Principal), + Resource(src.Resource) + {} + + FEntityPermissionStatement(const TSharedPtr& obj) : FEntityPermissionStatement() + { + readFromValue(obj); + } + + ~FEntityPermissionStatement(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityProfileFileMetadata : public FPlayFabBaseModel + { + // [optional] Checksum value for the file + FString Checksum; + + // [optional] Name of the file + FString FileName; + + // Last UTC time the file was modified + FDateTime LastModified; + + // Storage service's reported byte count + int32 Size; + + FEntityProfileFileMetadata() : + FPlayFabBaseModel(), + Checksum(), + FileName(), + LastModified(0), + Size(0) + {} + + FEntityProfileFileMetadata(const FEntityProfileFileMetadata& src) : + FPlayFabBaseModel(), + Checksum(src.Checksum), + FileName(src.FileName), + LastModified(src.LastModified), + Size(src.Size) + {} + + FEntityProfileFileMetadata(const TSharedPtr& obj) : FEntityProfileFileMetadata() + { + readFromValue(obj); + } + + ~FEntityProfileFileMetadata(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityProfileBody : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + /** + * [optional] The chain of responsibility for this entity. This is a representation of 'ownership'. It is constructed using the + * following formats (replace '[ID]' with the unique identifier for the given entity): Namespace: 'namespace![Namespace + * ID]' Title: 'title![Namespace ID]/[Title ID]' Master Player Account: 'master_player_account![Namespace + * ID]/[MasterPlayerAccount ID]' Title Player Account: 'title_player_account![Namespace ID]/[Title ID]/[MasterPlayerAccount + * ID]/[TitlePlayerAccount ID]' Character: 'character![Namespace ID]/[Title ID]/[MasterPlayerAccount + * ID]/[TitlePlayerAccount ID]/[Character ID]' + */ + FString EntityChain; + + // [optional] The files on this profile. + TMap Files; + // [optional] The language on this profile. + FString Language; + + // [optional] The objects on this profile. + TMap Objects; + /** + * [optional] The permissions that govern access to this entity profile and its properties. Only includes permissions set on this + * profile, not global statements from titles and namespaces. + */ + TArray Permissions; + /** + * The version number of the profile in persistent storage at the time of the read. Used for optional optimistic + * concurrency during update. + */ + int32 VersionNumber; + + FEntityProfileBody() : + FPlayFabBaseModel(), + Entity(nullptr), + EntityChain(), + Files(), + Language(), + Objects(), + Permissions(), + VersionNumber(0) + {} + + FEntityProfileBody(const FEntityProfileBody& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + EntityChain(src.EntityChain), + Files(src.Files), + Language(src.Language), + Objects(src.Objects), + Permissions(src.Permissions), + VersionNumber(src.VersionNumber) + {} + + FEntityProfileBody(const TSharedPtr& obj) : FEntityProfileBody() + { + readFromValue(obj); + } + + ~FEntityProfileBody(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetEntityProfileRequest : public FPlayFabBaseModel + { + /** + * [optional] Determines whether the objects will be returned as an escaped JSON string or as a un-escaped JSON object. Default is + * JSON string. + */ + Boxed DataAsObject; + + // The entity to perform this action on. + FEntityKey Entity; + + FGetEntityProfileRequest() : + FPlayFabBaseModel(), + DataAsObject(), + Entity() + {} + + FGetEntityProfileRequest(const FGetEntityProfileRequest& src) : + FPlayFabBaseModel(), + DataAsObject(src.DataAsObject), + Entity(src.Entity) + {} + + FGetEntityProfileRequest(const TSharedPtr& obj) : FGetEntityProfileRequest() + { + readFromValue(obj); + } + + ~FGetEntityProfileRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetEntityProfileResponse : public FPlayFabBaseModel + { + // [optional] Entity profile + TSharedPtr Profile; + + FGetEntityProfileResponse() : + FPlayFabBaseModel(), + Profile(nullptr) + {} + + FGetEntityProfileResponse(const FGetEntityProfileResponse& src) : + FPlayFabBaseModel(), + Profile(src.Profile.IsValid() ? MakeShareable(new FEntityProfileBody(*src.Profile)) : nullptr) + {} + + FGetEntityProfileResponse(const TSharedPtr& obj) : FGetEntityProfileResponse() + { + readFromValue(obj); + } + + ~FGetEntityProfileResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetEntityProfilesRequest : public FPlayFabBaseModel + { + /** + * [optional] Determines whether the objects will be returned as an escaped JSON string or as a un-escaped JSON object. Default is + * JSON string. + */ + Boxed DataAsObject; + + // Entity keys of the profiles to load. Must be between 1 and 25 + TArray Entities; + FGetEntityProfilesRequest() : + FPlayFabBaseModel(), + DataAsObject(), + Entities() + {} + + FGetEntityProfilesRequest(const FGetEntityProfilesRequest& src) : + FPlayFabBaseModel(), + DataAsObject(src.DataAsObject), + Entities(src.Entities) + {} + + FGetEntityProfilesRequest(const TSharedPtr& obj) : FGetEntityProfilesRequest() + { + readFromValue(obj); + } + + ~FGetEntityProfilesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetEntityProfilesResponse : public FPlayFabBaseModel + { + // [optional] Entity profiles + TArray Profiles; + FGetEntityProfilesResponse() : + FPlayFabBaseModel(), + Profiles() + {} + + FGetEntityProfilesResponse(const FGetEntityProfilesResponse& src) : + FPlayFabBaseModel(), + Profiles(src.Profiles) + {} + + FGetEntityProfilesResponse(const TSharedPtr& obj) : FGetEntityProfilesResponse() + { + readFromValue(obj); + } + + ~FGetEntityProfilesResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetGlobalPolicyRequest : public FPlayFabBaseModel + { + FGetGlobalPolicyRequest() : + FPlayFabBaseModel() + {} + + FGetGlobalPolicyRequest(const FGetGlobalPolicyRequest& src) : + FPlayFabBaseModel() + {} + + FGetGlobalPolicyRequest(const TSharedPtr& obj) : FGetGlobalPolicyRequest() + { + readFromValue(obj); + } + + ~FGetGlobalPolicyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetGlobalPolicyResponse : public FPlayFabBaseModel + { + // [optional] The permissions that govern access to all entities under this title or namespace. + TArray Permissions; + FGetGlobalPolicyResponse() : + FPlayFabBaseModel(), + Permissions() + {} + + FGetGlobalPolicyResponse(const FGetGlobalPolicyResponse& src) : + FPlayFabBaseModel(), + Permissions(src.Permissions) + {} + + FGetGlobalPolicyResponse(const TSharedPtr& obj) : FGetGlobalPolicyResponse() + { + readFromValue(obj); + } + + ~FGetGlobalPolicyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum OperationTypes + { + OperationTypesCreated, + OperationTypesUpdated, + OperationTypesDeleted, + OperationTypesNone + }; + + PLAYFABCPP_API void writeOperationTypesEnumJSON(OperationTypes enumVal, JsonWriter& writer); + PLAYFABCPP_API OperationTypes readOperationTypesFromValue(const TSharedPtr& value); + PLAYFABCPP_API OperationTypes readOperationTypesFromValue(const FString& value); + + struct PLAYFABCPP_API FSetEntityProfilePolicyRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // [optional] The statements to include in the access policy. + TArray Statements; + FSetEntityProfilePolicyRequest() : + FPlayFabBaseModel(), + Entity(), + Statements() + {} + + FSetEntityProfilePolicyRequest(const FSetEntityProfilePolicyRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Statements(src.Statements) + {} + + FSetEntityProfilePolicyRequest(const TSharedPtr& obj) : FSetEntityProfilePolicyRequest() + { + readFromValue(obj); + } + + ~FSetEntityProfilePolicyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetEntityProfilePolicyResponse : public FPlayFabBaseModel + { + /** + * [optional] The permissions that govern access to this entity profile and its properties. Only includes permissions set on this + * profile, not global statements from titles and namespaces. + */ + TArray Permissions; + FSetEntityProfilePolicyResponse() : + FPlayFabBaseModel(), + Permissions() + {} + + FSetEntityProfilePolicyResponse(const FSetEntityProfilePolicyResponse& src) : + FPlayFabBaseModel(), + Permissions(src.Permissions) + {} + + FSetEntityProfilePolicyResponse(const TSharedPtr& obj) : FSetEntityProfilePolicyResponse() + { + readFromValue(obj); + } + + ~FSetEntityProfilePolicyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGlobalPolicyRequest : public FPlayFabBaseModel + { + // [optional] The permissions that govern access to all entities under this title or namespace. + TArray Permissions; + FSetGlobalPolicyRequest() : + FPlayFabBaseModel(), + Permissions() + {} + + FSetGlobalPolicyRequest(const FSetGlobalPolicyRequest& src) : + FPlayFabBaseModel(), + Permissions(src.Permissions) + {} + + FSetGlobalPolicyRequest(const TSharedPtr& obj) : FSetGlobalPolicyRequest() + { + readFromValue(obj); + } + + ~FSetGlobalPolicyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGlobalPolicyResponse : public FPlayFabBaseModel + { + FSetGlobalPolicyResponse() : + FPlayFabBaseModel() + {} + + FSetGlobalPolicyResponse(const FSetGlobalPolicyResponse& src) : + FPlayFabBaseModel() + {} + + FSetGlobalPolicyResponse(const TSharedPtr& obj) : FSetGlobalPolicyResponse() + { + readFromValue(obj); + } + + ~FSetGlobalPolicyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetProfileLanguageRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + // The expected version of a profile to perform this update on + int32 ExpectedVersion; + + // [optional] The language to set on the given entity. Deletes the profile's language if passed in a null string. + FString Language; + + FSetProfileLanguageRequest() : + FPlayFabBaseModel(), + Entity(nullptr), + ExpectedVersion(0), + Language() + {} + + FSetProfileLanguageRequest(const FSetProfileLanguageRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + ExpectedVersion(src.ExpectedVersion), + Language(src.Language) + {} + + FSetProfileLanguageRequest(const TSharedPtr& obj) : FSetProfileLanguageRequest() + { + readFromValue(obj); + } + + ~FSetProfileLanguageRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetProfileLanguageResponse : public FPlayFabBaseModel + { + // [optional] The type of operation that occured on the profile's language + Boxed OperationResult; + + // [optional] The updated version of the profile after the language update + Boxed VersionNumber; + + FSetProfileLanguageResponse() : + FPlayFabBaseModel(), + OperationResult(), + VersionNumber() + {} + + FSetProfileLanguageResponse(const FSetProfileLanguageResponse& src) : + FPlayFabBaseModel(), + OperationResult(src.OperationResult), + VersionNumber(src.VersionNumber) + {} + + FSetProfileLanguageResponse(const TSharedPtr& obj) : FSetProfileLanguageResponse() + { + readFromValue(obj); + } + + ~FSetProfileLanguageResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabResultHandler.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabResultHandler.h new file mode 100644 index 000000000..69f469837 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabResultHandler.h @@ -0,0 +1,25 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" +#include "PlayFabBaseModel.h" +#include "PlayFabError.h" +#include "Http.h" + +namespace PlayFab +{ + class PlayFabRequestHandler + { + private: + static int pendingCalls; + public: + static int GetPendingCalls(); + static TSharedRef SendRequest(const FString& url, const FString& callBody, const FString& authKey, const FString& authValue); + static bool DecodeRequest(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, PlayFab::FPlayFabBaseModel& OutResult, PlayFab::FPlayFabError& OutError); + static bool DecodeError(TSharedPtr JsonObject, PlayFab::FPlayFabError& OutError); + }; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabServerAPI.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabServerAPI.h new file mode 100644 index 000000000..21fc48e8e --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabServerAPI.h @@ -0,0 +1,778 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabServerDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabServerAPI + { + public: + DECLARE_DELEGATE_OneParam(FAddCharacterVirtualCurrencyDelegate, const ServerModels::FModifyCharacterVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FAddFriendDelegate, const ServerModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FAddPlayerTagDelegate, const ServerModels::FAddPlayerTagResult&); + DECLARE_DELEGATE_OneParam(FAddSharedGroupMembersDelegate, const ServerModels::FAddSharedGroupMembersResult&); + DECLARE_DELEGATE_OneParam(FAddUserVirtualCurrencyDelegate, const ServerModels::FModifyUserVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FAuthenticateSessionTicketDelegate, const ServerModels::FAuthenticateSessionTicketResult&); + DECLARE_DELEGATE_OneParam(FAwardSteamAchievementDelegate, const ServerModels::FAwardSteamAchievementResult&); + DECLARE_DELEGATE_OneParam(FBanUsersDelegate, const ServerModels::FBanUsersResult&); + DECLARE_DELEGATE_OneParam(FConsumeItemDelegate, const ServerModels::FConsumeItemResult&); + DECLARE_DELEGATE_OneParam(FCreateSharedGroupDelegate, const ServerModels::FCreateSharedGroupResult&); + DECLARE_DELEGATE_OneParam(FDeleteCharacterFromUserDelegate, const ServerModels::FDeleteCharacterFromUserResult&); + DECLARE_DELEGATE_OneParam(FDeleteSharedGroupDelegate, const ServerModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FDeleteUsersDelegate, const ServerModels::FDeleteUsersResult&); + DECLARE_DELEGATE_OneParam(FDeregisterGameDelegate, const ServerModels::FDeregisterGameResponse&); + DECLARE_DELEGATE_OneParam(FEvaluateRandomResultTableDelegate, const ServerModels::FEvaluateRandomResultTableResult&); + DECLARE_DELEGATE_OneParam(FExecuteCloudScriptDelegate, const ServerModels::FExecuteCloudScriptResult&); + DECLARE_DELEGATE_OneParam(FGetAllSegmentsDelegate, const ServerModels::FGetAllSegmentsResult&); + DECLARE_DELEGATE_OneParam(FGetAllUsersCharactersDelegate, const ServerModels::FListUsersCharactersResult&); + DECLARE_DELEGATE_OneParam(FGetCatalogItemsDelegate, const ServerModels::FGetCatalogItemsResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterDataDelegate, const ServerModels::FGetCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterInternalDataDelegate, const ServerModels::FGetCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterInventoryDelegate, const ServerModels::FGetCharacterInventoryResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterLeaderboardDelegate, const ServerModels::FGetCharacterLeaderboardResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterReadOnlyDataDelegate, const ServerModels::FGetCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterStatisticsDelegate, const ServerModels::FGetCharacterStatisticsResult&); + DECLARE_DELEGATE_OneParam(FGetContentDownloadUrlDelegate, const ServerModels::FGetContentDownloadUrlResult&); + DECLARE_DELEGATE_OneParam(FGetFriendLeaderboardDelegate, const ServerModels::FGetLeaderboardResult&); + DECLARE_DELEGATE_OneParam(FGetFriendsListDelegate, const ServerModels::FGetFriendsListResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardDelegate, const ServerModels::FGetLeaderboardResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardAroundCharacterDelegate, const ServerModels::FGetLeaderboardAroundCharacterResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardAroundUserDelegate, const ServerModels::FGetLeaderboardAroundUserResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardForUserCharactersDelegate, const ServerModels::FGetLeaderboardForUsersCharactersResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerCombinedInfoDelegate, const ServerModels::FGetPlayerCombinedInfoResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerProfileDelegate, const ServerModels::FGetPlayerProfileResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerSegmentsDelegate, const ServerModels::FGetPlayerSegmentsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayersInSegmentDelegate, const ServerModels::FGetPlayersInSegmentResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerStatisticsDelegate, const ServerModels::FGetPlayerStatisticsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerStatisticVersionsDelegate, const ServerModels::FGetPlayerStatisticVersionsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerTagsDelegate, const ServerModels::FGetPlayerTagsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromFacebookIDsDelegate, const ServerModels::FGetPlayFabIDsFromFacebookIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate, const ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate, const ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromSteamIDsDelegate, const ServerModels::FGetPlayFabIDsFromSteamIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPublisherDataDelegate, const ServerModels::FGetPublisherDataResult&); + DECLARE_DELEGATE_OneParam(FGetRandomResultTablesDelegate, const ServerModels::FGetRandomResultTablesResult&); + DECLARE_DELEGATE_OneParam(FGetSharedGroupDataDelegate, const ServerModels::FGetSharedGroupDataResult&); + DECLARE_DELEGATE_OneParam(FGetTimeDelegate, const ServerModels::FGetTimeResult&); + DECLARE_DELEGATE_OneParam(FGetTitleDataDelegate, const ServerModels::FGetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FGetTitleInternalDataDelegate, const ServerModels::FGetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FGetTitleNewsDelegate, const ServerModels::FGetTitleNewsResult&); + DECLARE_DELEGATE_OneParam(FGetUserAccountInfoDelegate, const ServerModels::FGetUserAccountInfoResult&); + DECLARE_DELEGATE_OneParam(FGetUserBansDelegate, const ServerModels::FGetUserBansResult&); + DECLARE_DELEGATE_OneParam(FGetUserDataDelegate, const ServerModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserInternalDataDelegate, const ServerModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserInventoryDelegate, const ServerModels::FGetUserInventoryResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherDataDelegate, const ServerModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherInternalDataDelegate, const ServerModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherReadOnlyDataDelegate, const ServerModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserReadOnlyDataDelegate, const ServerModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGrantCharacterToUserDelegate, const ServerModels::FGrantCharacterToUserResult&); + DECLARE_DELEGATE_OneParam(FGrantItemsToCharacterDelegate, const ServerModels::FGrantItemsToCharacterResult&); + DECLARE_DELEGATE_OneParam(FGrantItemsToUserDelegate, const ServerModels::FGrantItemsToUserResult&); + DECLARE_DELEGATE_OneParam(FGrantItemsToUsersDelegate, const ServerModels::FGrantItemsToUsersResult&); + DECLARE_DELEGATE_OneParam(FModifyItemUsesDelegate, const ServerModels::FModifyItemUsesResult&); + DECLARE_DELEGATE_OneParam(FMoveItemToCharacterFromCharacterDelegate, const ServerModels::FMoveItemToCharacterFromCharacterResult&); + DECLARE_DELEGATE_OneParam(FMoveItemToCharacterFromUserDelegate, const ServerModels::FMoveItemToCharacterFromUserResult&); + DECLARE_DELEGATE_OneParam(FMoveItemToUserFromCharacterDelegate, const ServerModels::FMoveItemToUserFromCharacterResult&); + DECLARE_DELEGATE_OneParam(FNotifyMatchmakerPlayerLeftDelegate, const ServerModels::FNotifyMatchmakerPlayerLeftResult&); + DECLARE_DELEGATE_OneParam(FRedeemCouponDelegate, const ServerModels::FRedeemCouponResult&); + DECLARE_DELEGATE_OneParam(FRedeemMatchmakerTicketDelegate, const ServerModels::FRedeemMatchmakerTicketResult&); + DECLARE_DELEGATE_OneParam(FRefreshGameServerInstanceHeartbeatDelegate, const ServerModels::FRefreshGameServerInstanceHeartbeatResult&); + DECLARE_DELEGATE_OneParam(FRegisterGameDelegate, const ServerModels::FRegisterGameResponse&); + DECLARE_DELEGATE_OneParam(FRemoveFriendDelegate, const ServerModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FRemovePlayerTagDelegate, const ServerModels::FRemovePlayerTagResult&); + DECLARE_DELEGATE_OneParam(FRemoveSharedGroupMembersDelegate, const ServerModels::FRemoveSharedGroupMembersResult&); + DECLARE_DELEGATE_OneParam(FReportPlayerDelegate, const ServerModels::FReportPlayerServerResult&); + DECLARE_DELEGATE_OneParam(FRevokeAllBansForUserDelegate, const ServerModels::FRevokeAllBansForUserResult&); + DECLARE_DELEGATE_OneParam(FRevokeBansDelegate, const ServerModels::FRevokeBansResult&); + DECLARE_DELEGATE_OneParam(FRevokeInventoryItemDelegate, const ServerModels::FRevokeInventoryResult&); + DECLARE_DELEGATE_OneParam(FRevokeInventoryItemsDelegate, const ServerModels::FRevokeInventoryItemsResult&); + DECLARE_DELEGATE_OneParam(FSendCustomAccountRecoveryEmailDelegate, const ServerModels::FSendCustomAccountRecoveryEmailResult&); + DECLARE_DELEGATE_OneParam(FSendEmailFromTemplateDelegate, const ServerModels::FSendEmailFromTemplateResult&); + DECLARE_DELEGATE_OneParam(FSendPushNotificationDelegate, const ServerModels::FSendPushNotificationResult&); + DECLARE_DELEGATE_OneParam(FSetFriendTagsDelegate, const ServerModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FSetGameServerInstanceDataDelegate, const ServerModels::FSetGameServerInstanceDataResult&); + DECLARE_DELEGATE_OneParam(FSetGameServerInstanceStateDelegate, const ServerModels::FSetGameServerInstanceStateResult&); + DECLARE_DELEGATE_OneParam(FSetGameServerInstanceTagsDelegate, const ServerModels::FSetGameServerInstanceTagsResult&); + DECLARE_DELEGATE_OneParam(FSetPlayerSecretDelegate, const ServerModels::FSetPlayerSecretResult&); + DECLARE_DELEGATE_OneParam(FSetPublisherDataDelegate, const ServerModels::FSetPublisherDataResult&); + DECLARE_DELEGATE_OneParam(FSetTitleDataDelegate, const ServerModels::FSetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FSetTitleInternalDataDelegate, const ServerModels::FSetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FSubtractCharacterVirtualCurrencyDelegate, const ServerModels::FModifyCharacterVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FSubtractUserVirtualCurrencyDelegate, const ServerModels::FModifyUserVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FUnlockContainerInstanceDelegate, const ServerModels::FUnlockContainerItemResult&); + DECLARE_DELEGATE_OneParam(FUnlockContainerItemDelegate, const ServerModels::FUnlockContainerItemResult&); + DECLARE_DELEGATE_OneParam(FUpdateAvatarUrlDelegate, const ServerModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FUpdateBansDelegate, const ServerModels::FUpdateBansResult&); + DECLARE_DELEGATE_OneParam(FUpdateCharacterDataDelegate, const ServerModels::FUpdateCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateCharacterInternalDataDelegate, const ServerModels::FUpdateCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateCharacterReadOnlyDataDelegate, const ServerModels::FUpdateCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateCharacterStatisticsDelegate, const ServerModels::FUpdateCharacterStatisticsResult&); + DECLARE_DELEGATE_OneParam(FUpdatePlayerStatisticsDelegate, const ServerModels::FUpdatePlayerStatisticsResult&); + DECLARE_DELEGATE_OneParam(FUpdateSharedGroupDataDelegate, const ServerModels::FUpdateSharedGroupDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserDataDelegate, const ServerModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserInternalDataDelegate, const ServerModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserInventoryItemCustomDataDelegate, const ServerModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherDataDelegate, const ServerModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherInternalDataDelegate, const ServerModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherReadOnlyDataDelegate, const ServerModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserReadOnlyDataDelegate, const ServerModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FWriteCharacterEventDelegate, const ServerModels::FWriteEventResponse&); + DECLARE_DELEGATE_OneParam(FWritePlayerEventDelegate, const ServerModels::FWriteEventResponse&); + DECLARE_DELEGATE_OneParam(FWriteTitleEventDelegate, const ServerModels::FWriteEventResponse&); + + UPlayFabServerAPI(); + ~UPlayFabServerAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + // Increments the character's balance of the specified virtual currency by the stated amount + bool AddCharacterVirtualCurrency(ServerModels::FAddCharacterVirtualCurrencyRequest& request, const FAddCharacterVirtualCurrencyDelegate& SuccessDelegate = FAddCharacterVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the Friend user to the friendlist of the user with PlayFabId. At least one of + * FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. + */ + bool AddFriend(ServerModels::FAddFriendRequest& request, const FAddFriendDelegate& SuccessDelegate = FAddFriendDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + * This API will trigger a player_tag_added event and add a tag with the given TagName and PlayFabID to the corresponding player profile. TagName can be used for segmentation and it is limited to 256 characters. Also there is a limit on the number of tags a title can have. + */ + bool AddPlayerTag(ServerModels::FAddPlayerTagRequest& request, const FAddPlayerTagDelegate& SuccessDelegate = FAddPlayerTagDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users + * in the group (and the server) can add new members. Shared Groups are designed for sharing data between a very small + * number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool AddSharedGroupMembers(ServerModels::FAddSharedGroupMembersRequest& request, const FAddSharedGroupMembersDelegate& SuccessDelegate = FAddSharedGroupMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Increments the user's balance of the specified virtual currency by the stated amount + bool AddUserVirtualCurrency(ServerModels::FAddUserVirtualCurrencyRequest& request, const FAddUserVirtualCurrencyDelegate& SuccessDelegate = FAddUserVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Validated a client's session ticket, and if successful, returns details for that user + * Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool AuthenticateSessionTicket(ServerModels::FAuthenticateSessionTicketRequest& request, const FAuthenticateSessionTicketDelegate& SuccessDelegate = FAuthenticateSessionTicketDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Awards the specified users the specified Steam achievements + bool AwardSteamAchievement(ServerModels::FAwardSteamAchievementRequest& request, const FAwardSteamAchievementDelegate& SuccessDelegate = FAwardSteamAchievementDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + * The existence of each user will not be verified. When banning by IP or MAC address, multiple players may be affected, so use this feature with caution. Returns information about the new bans. + */ + bool BanUsers(ServerModels::FBanUsersRequest& request, const FBanUsersDelegate& SuccessDelegate = FBanUsersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. + bool ConsumeItem(ServerModels::FConsumeItemRequest& request, const FConsumeItemDelegate& SuccessDelegate = FConsumeItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the + * group. When created by a server, the group will initially have no members. Shared Groups are designed for sharing data + * between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + * If SharedGroupId is specified, the service will attempt to create a group with that identifier, and will return an error if it is already in use. If no SharedGroupId is specified, a random identifier will be assigned. + */ + bool CreateSharedGroup(ServerModels::FCreateSharedGroupRequest& request, const FCreateSharedGroupDelegate& SuccessDelegate = FCreateSharedGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes the specific character ID from the specified user. + * This function will delete the specified character from the list allowed by the user, and will also delete any inventory or VC currently held by that character. It will NOT delete any statistics associated for this character, in order to preserve leaderboard integrity. + */ + bool DeleteCharacterFromUser(ServerModels::FDeleteCharacterFromUserRequest& request, const FDeleteCharacterFromUserDelegate& SuccessDelegate = FDeleteCharacterFromUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes a shared group, freeing up the shared group ID to be reused for a new group. Shared Groups are designed for + * sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool DeleteSharedGroup(ServerModels::FDeleteSharedGroupRequest& request, const FDeleteSharedGroupDelegate& SuccessDelegate = FDeleteSharedGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. + * Note that this action cannot be undone. It will unlink all accounts and remove all PII information, as well as reset any statistics and leaderboards and clear out any stored custom data for the user. This API must be enabled for use as an option in the game manager website. It is disabled by default. + */ + bool DeleteUsers(ServerModels::FDeleteUsersRequest& request, const FDeleteUsersDelegate& SuccessDelegate = FDeleteUsersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Inform the matchmaker that a Game Server Instance is removed. + bool DeregisterGame(ServerModels::FDeregisterGameRequest& request, const FDeregisterGameDelegate& SuccessDelegate = FDeregisterGameDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Returns the result of an evaluation of a Random Result Table - the ItemId from the game Catalog which would have been + * added to the player inventory, if the Random Result Table were added via a Bundle or a call to UnlockContainer. + */ + bool EvaluateRandomResultTable(ServerModels::FEvaluateRandomResultTableRequest& request, const FEvaluateRandomResultTableDelegate& SuccessDelegate = FEvaluateRandomResultTableDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Executes a CloudScript function, with the 'currentPlayerId' variable set to the specified PlayFabId parameter value. + bool ExecuteCloudScript(ServerModels::FExecuteCloudScriptServerRequest& request, const FExecuteCloudScriptDelegate& SuccessDelegate = FExecuteCloudScriptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as + * GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. + * Request has no paramaters. + */ + + bool GetAllSegments(const FGetAllSegmentsDelegate& SuccessDelegate = FGetAllSegmentsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be + * evaluated with the parent PlayFabId to guarantee uniqueness. + * Returns a list of every character that currently belongs to a user. + */ + bool GetAllUsersCharacters(ServerModels::FListUsersCharactersRequest& request, const FGetAllUsersCharactersDelegate& SuccessDelegate = FGetAllUsersCharactersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the specified version of the title's catalog of virtual goods, including all defined properties + bool GetCatalogItems(ServerModels::FGetCatalogItemsRequest& request, const FGetCatalogItemsDelegate& SuccessDelegate = FGetCatalogItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetCharacterData(ServerModels::FGetCharacterDataRequest& request, const FGetCharacterDataDelegate& SuccessDelegate = FGetCharacterDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user's character which cannot be accessed by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetCharacterInternalData(ServerModels::FGetCharacterDataRequest& request, const FGetCharacterInternalDataDelegate& SuccessDelegate = FGetCharacterInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the specified character's current inventory of virtual goods + * All items currently in the character inventory will be returned, irrespective of how they were acquired (via purchasing, grants, coupons, etc.). Items that are expired, fully consumed, or are no longer valid are not considered to be in the user's current inventory, and so will not be not included. Also returns their virtual currency balances. + */ + bool GetCharacterInventory(ServerModels::FGetCharacterInventoryRequest& request, const FGetCharacterInventoryDelegate& SuccessDelegate = FGetCharacterInventoryDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard + bool GetCharacterLeaderboard(ServerModels::FGetCharacterLeaderboardRequest& request, const FGetCharacterLeaderboardDelegate& SuccessDelegate = FGetCharacterLeaderboardDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user's character which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom data will be returned. + */ + bool GetCharacterReadOnlyData(ServerModels::FGetCharacterDataRequest& request, const FGetCharacterReadOnlyDataDelegate& SuccessDelegate = FGetCharacterReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the details of all title-specific statistics for the specific character + * Character statistics are similar to user statistics in that they are numeric values which may only be updated by a server operation, in order to minimize the opportunity for unauthorized changes. In addition to being available for use by the title, the statistics are used for all leaderboard operations in PlayFab. + */ + bool GetCharacterStatistics(ServerModels::FGetCharacterStatisticsRequest& request, const FGetCharacterStatisticsDelegate& SuccessDelegate = FGetCharacterStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned + * URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the + * content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, + * the query to retrieve the data will fail. See this post for more information: + * https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service. Also, + * please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. + */ + bool GetContentDownloadUrl(ServerModels::FGetContentDownloadUrlRequest& request, const FGetContentDownloadUrlDelegate& SuccessDelegate = FGetContentDownloadUrlDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves a list of ranked friends of the given player for the given statistic, starting from the indicated point in the + * leaderboard + */ + bool GetFriendLeaderboard(ServerModels::FGetFriendLeaderboardRequest& request, const FGetFriendLeaderboardDelegate& SuccessDelegate = FGetFriendLeaderboardDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the current friends for the user with PlayFabId, constrained to users who have PlayFab accounts. Friends from + * linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. + */ + bool GetFriendsList(ServerModels::FGetFriendsListRequest& request, const FGetFriendsListDelegate& SuccessDelegate = FGetFriendsListDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard + bool GetLeaderboard(ServerModels::FGetLeaderboardRequest& request, const FGetLeaderboardDelegate& SuccessDelegate = FGetLeaderboardDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked characters for the given statistic, centered on the requested user + bool GetLeaderboardAroundCharacter(ServerModels::FGetLeaderboardAroundCharacterRequest& request, const FGetLeaderboardAroundCharacterDelegate& SuccessDelegate = FGetLeaderboardAroundCharacterDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user + bool GetLeaderboardAroundUser(ServerModels::FGetLeaderboardAroundUserRequest& request, const FGetLeaderboardAroundUserDelegate& SuccessDelegate = FGetLeaderboardAroundUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of all of the user's characters for the given statistic. + bool GetLeaderboardForUserCharacters(ServerModels::FGetLeaderboardForUsersCharactersRequest& request, const FGetLeaderboardForUserCharactersDelegate& SuccessDelegate = FGetLeaderboardForUserCharactersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be + * returned. All parameters default to false. + */ + bool GetPlayerCombinedInfo(ServerModels::FGetPlayerCombinedInfoRequest& request, const FGetPlayerCombinedInfoDelegate& SuccessDelegate = FGetPlayerCombinedInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the player's profile + * This API allows for access to details regarding a user in the PlayFab service, usually for purposes of customer support. Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool GetPlayerProfile(ServerModels::FGetPlayerProfileRequest& request, const FGetPlayerProfileDelegate& SuccessDelegate = FGetPlayerProfileDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // List all segments that a player currently belongs to at this moment in time. + bool GetPlayerSegments(ServerModels::FGetPlayersSegmentsRequest& request, const FGetPlayerSegmentsDelegate& SuccessDelegate = FGetPlayerSegmentsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match + * the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span + * on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected + * in the results. AB Test segments are currently not supported by this operation. + * Initial request must contain at least a Segment ID. Subsequent requests must contain the Segment ID as well as the Continuation Token. Failure to send the Continuation Token will result in a new player segment list being generated. Each time the Continuation Token is passed in the length of the Total Seconds to Live is refreshed. If too much time passes between requests to the point that a subsequent request is past the Total Seconds to Live an error will be returned and paging will be terminated. This API is resource intensive and should not be used in scenarios which might generate high request volumes. Only one request to this API at a time should be made per title. Concurrent requests to the API may be rejected with the APIConcurrentRequestLimitExceeded error. + */ + bool GetPlayersInSegment(ServerModels::FGetPlayersInSegmentRequest& request, const FGetPlayersInSegmentDelegate& SuccessDelegate = FGetPlayersInSegmentDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the current version and values for the indicated statistics, for the local player. + bool GetPlayerStatistics(ServerModels::FGetPlayerStatisticsRequest& request, const FGetPlayerStatisticsDelegate& SuccessDelegate = FGetPlayerStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the information on the available versions of the specified statistic. + bool GetPlayerStatisticVersions(ServerModels::FGetPlayerStatisticVersionsRequest& request, const FGetPlayerStatisticVersionsDelegate& SuccessDelegate = FGetPlayerStatisticVersionsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Get all tags with a given Namespace (optional) from a player profile. + * This API will return a list of canonical tags which includes both namespace and tag's name. If namespace is not provided, the result is a list of all canonical tags. TagName can be used for segmentation and Namespace is limited to 128 characters. + */ + bool GetPlayerTags(ServerModels::FGetPlayerTagsRequest& request, const FGetPlayerTagsDelegate& SuccessDelegate = FGetPlayerTagsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. + bool GetPlayFabIDsFromFacebookIDs(ServerModels::FGetPlayFabIDsFromFacebookIDsRequest& request, const FGetPlayFabIDsFromFacebookIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromFacebookIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the unique PlayFab identifiers for the given set of Facebook Instant Games identifiers. + bool GetPlayFabIDsFromFacebookInstantGamesIds(ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest& request, const FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate& SuccessDelegate = FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the unique PlayFab identifiers for the given set of Nintendo Switch Device identifiers. + bool GetPlayFabIDsFromNintendoSwitchDeviceIds(ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& request, const FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate& SuccessDelegate = FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile + * IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + bool GetPlayFabIDsFromSteamIDs(ServerModels::FGetPlayFabIDsFromSteamIDsRequest& request, const FGetPlayFabIDsFromSteamIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromSteamIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom publisher settings + * This API is designed to return publisher-specific values which can be read, but not written to, by the client. This data is shared across all titles assigned to a particular publisher, and can be used for cross-game coordination. Only titles assigned to a publisher can use this API. For more information email devrel@playfab.com. Note that there may up to a minute delay in between updating title data and this API call returning the newest value. + */ + bool GetPublisherData(ServerModels::FGetPublisherDataRequest& request, const FGetPublisherDataDelegate& SuccessDelegate = FGetPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the configuration information for the specified random results tables for the title, including all ItemId + * values and weights + */ + bool GetRandomResultTables(ServerModels::FGetRandomResultTablesRequest& request, const FGetRandomResultTablesDelegate& SuccessDelegate = FGetRandomResultTablesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves data stored in a shared group object, as well as the list of members in the group. The server can access all + * public and private group data. Shared Groups are designed for sharing data between a very small number of players, + * please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool GetSharedGroupData(ServerModels::FGetSharedGroupDataRequest& request, const FGetSharedGroupDataDelegate& SuccessDelegate = FGetSharedGroupDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the current server time + * This query retrieves the current time from one of the servers in PlayFab. Please note that due to clock drift between servers, there is a potential variance of up to 5 seconds. + */ + + bool GetTime(const FGetTimeDelegate& SuccessDelegate = FGetTimeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom title settings + * This API is designed to return title specific values which can be read, but not written to, by the client. For example, a developer could choose to store values which modify the user experience, such as enemy spawn rates, weapon strengths, movement speeds, etc. This allows a developer to update the title without the need to create, test, and ship a new build. Note that there may up to a minute delay in between updating title data and this API call returning the newest value. + */ + bool GetTitleData(ServerModels::FGetTitleDataRequest& request, const FGetTitleDataDelegate& SuccessDelegate = FGetTitleDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom internal title settings + * This API is designed to return title specific values which are accessible only to the server. This can be used to tweak settings on game servers and Cloud Scripts without needed to update and re-deploy them. Note that there may up to a minute delay in between updating title data and this API call returning the newest value. + */ + bool GetTitleInternalData(ServerModels::FGetTitleDataRequest& request, const FGetTitleInternalDataDelegate& SuccessDelegate = FGetTitleInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the title news feed, as configured in the developer portal + bool GetTitleNews(ServerModels::FGetTitleNewsRequest& request, const FGetTitleNewsDelegate& SuccessDelegate = FGetTitleNewsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the relevant details for a specified user + * This API allows for access to details regarding a user in the PlayFab service, usually for purposes of customer support. Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool GetUserAccountInfo(ServerModels::FGetUserAccountInfoRequest& request, const FGetUserAccountInfoDelegate& SuccessDelegate = FGetUserAccountInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Gets all bans for a user. + * Get all bans for a user, including inactive and expired bans. + */ + bool GetUserBans(ServerModels::FGetUserBansRequest& request, const FGetUserBansDelegate& SuccessDelegate = FGetUserBansDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserData(ServerModels::FGetUserDataRequest& request, const FGetUserDataDelegate& SuccessDelegate = FGetUserDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which cannot be accessed by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserInternalData(ServerModels::FGetUserDataRequest& request, const FGetUserInternalDataDelegate& SuccessDelegate = FGetUserInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the specified user's current inventory of virtual goods + * All items currently in the user inventory will be returned, irrespective of how they were acquired (via purchasing, grants, coupons, etc.). Items that are expired, fully consumed, or are no longer valid are not considered to be in the user's current inventory, and so will not be not included. + */ + bool GetUserInventory(ServerModels::FGetUserInventoryRequest& request, const FGetUserInventoryDelegate& SuccessDelegate = FGetUserInventoryDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherData(ServerModels::FGetUserDataRequest& request, const FGetUserPublisherDataDelegate& SuccessDelegate = FGetUserPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which cannot be accessed by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherInternalData(ServerModels::FGetUserDataRequest& request, const FGetUserPublisherInternalDataDelegate& SuccessDelegate = FGetUserPublisherInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherReadOnlyData(ServerModels::FGetUserDataRequest& request, const FGetUserPublisherReadOnlyDataDelegate& SuccessDelegate = FGetUserPublisherReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserReadOnlyData(ServerModels::FGetUserDataRequest& request, const FGetUserReadOnlyDataDelegate& SuccessDelegate = FGetUserReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated + * with the parent PlayFabId to guarantee uniqueness. + * Grants a character to the user of the type and name specified in the request. + */ + bool GrantCharacterToUser(ServerModels::FGrantCharacterToUserRequest& request, const FGrantCharacterToUserDelegate& SuccessDelegate = FGrantCharacterToUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the specified items to the specified character's inventory + * This function directly adds inventory items to the character's inventories. As a result of this operations, the user will not be charged any transaction fee, regardless of the inventory item catalog definition. Please note that the processing time for inventory grants and purchases increases fractionally the more items are in the inventory, and the more items are in the grant/purchase operation. + */ + bool GrantItemsToCharacter(ServerModels::FGrantItemsToCharacterRequest& request, const FGrantItemsToCharacterDelegate& SuccessDelegate = FGrantItemsToCharacterDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the specified items to the specified user's inventory + * This function directly adds inventory items to the user's inventories. As a result of this operations, the user will not be charged any transaction fee, regardless of the inventory item catalog definition. Please note that the processing time for inventory grants and purchases increases fractionally the more items are in the inventory, and the more items are in the grant/purchase operation. + */ + bool GrantItemsToUser(ServerModels::FGrantItemsToUserRequest& request, const FGrantItemsToUserDelegate& SuccessDelegate = FGrantItemsToUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the specified items to the specified user inventories + * This function directly adds inventory items to user inventories. As a result of this operations, the user will not be charged any transaction fee, regardless of the inventory item catalog definition. Please note that the processing time for inventory grants and purchases increases fractionally the more items are in the inventory, and the more items are in the grant/purchase operation. + */ + bool GrantItemsToUsers(ServerModels::FGrantItemsToUsersRequest& request, const FGrantItemsToUsersDelegate& SuccessDelegate = FGrantItemsToUsersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Modifies the number of remaining uses of a player's inventory item + * This function can both add and remove uses of an inventory item. If the number of uses drops below zero, the item will be removed from active inventory. + */ + bool ModifyItemUses(ServerModels::FModifyItemUsesRequest& request, const FModifyItemUsesDelegate& SuccessDelegate = FModifyItemUsesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Moves an item from a character's inventory into another of the users's character's inventory. + * Transfers an item from a character to another character that is owned by the same user. This will remove the item from the character's inventory (until and unless it is moved back), and will enable the other character to make use of the item instead. + */ + bool MoveItemToCharacterFromCharacter(ServerModels::FMoveItemToCharacterFromCharacterRequest& request, const FMoveItemToCharacterFromCharacterDelegate& SuccessDelegate = FMoveItemToCharacterFromCharacterDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Moves an item from a user's inventory into their character's inventory. + * Transfers an item from a user to a character she owns. This will remove the item from the user's inventory (until and unless it is moved back), and will enable the character to make use of the item instead. + */ + bool MoveItemToCharacterFromUser(ServerModels::FMoveItemToCharacterFromUserRequest& request, const FMoveItemToCharacterFromUserDelegate& SuccessDelegate = FMoveItemToCharacterFromUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Moves an item from a character's inventory into the owning user's inventory. + * Transfers an item from a character to the owning user. This will remove the item from the character's inventory (until and unless it is moved back), and will enable the user to make use of the item instead. + */ + bool MoveItemToUserFromCharacter(ServerModels::FMoveItemToUserFromCharacterRequest& request, const FMoveItemToUserFromCharacterDelegate& SuccessDelegate = FMoveItemToUserFromCharacterDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Informs the PlayFab match-making service that the user specified has left the Game Server Instance + bool NotifyMatchmakerPlayerLeft(ServerModels::FNotifyMatchmakerPlayerLeftRequest& request, const FNotifyMatchmakerPlayerLeftDelegate& SuccessDelegate = FNotifyMatchmakerPlayerLeftDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the + * Economy->Catalogs tab in the PlayFab Game Manager. + * Coupon codes can be created for any item, or set of items, in the catalog for the title. This operation causes the coupon to be consumed, and the specific items to be awarded to the user. Attempting to re-use an already consumed code, or a code which has not yet been created in the service, will result in an error. + */ + bool RedeemCoupon(ServerModels::FRedeemCouponRequest& request, const FRedeemCouponDelegate& SuccessDelegate = FRedeemCouponDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Validates a Game Server session ticket and returns details about the user + * This function is used by a Game Server Instance to validate with the PlayFab service that a user has been registered as connected to the server. The Ticket is provided to the client either as a result of a call to StartGame or Matchmake, each of which return a Ticket specific to the Game Server Instance. This function will fail in any case where the Ticket presented is not valid for the specific Game Server Instance making the call. Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool RedeemMatchmakerTicket(ServerModels::FRedeemMatchmakerTicketRequest& request, const FRedeemMatchmakerTicketDelegate& SuccessDelegate = FRedeemMatchmakerTicketDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Set the state of the indicated Game Server Instance. Also update the heartbeat for the instance. + bool RefreshGameServerInstanceHeartbeat(ServerModels::FRefreshGameServerInstanceHeartbeatRequest& request, const FRefreshGameServerInstanceHeartbeatDelegate& SuccessDelegate = FRefreshGameServerInstanceHeartbeatDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Inform the matchmaker that a new Game Server Instance is added. + bool RegisterGame(ServerModels::FRegisterGameRequest& request, const FRegisterGameDelegate& SuccessDelegate = FRegisterGameDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Removes the specified friend from the the user's friend list + bool RemoveFriend(ServerModels::FRemoveFriendRequest& request, const FRemoveFriendDelegate& SuccessDelegate = FRemoveFriendDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + * This API will trigger a player_tag_removed event and remove a tag with the given TagName and PlayFabID from the corresponding player profile. TagName can be used for segmentation and it is limited to 256 characters + */ + bool RemovePlayerTag(ServerModels::FRemovePlayerTagRequest& request, const FRemovePlayerTagDelegate& SuccessDelegate = FRemovePlayerTagDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the + * group can remove members. If as a result of the call, zero users remain with access, the group and its associated data + * will be deleted. Shared Groups are designed for sharing data between a very small number of players, please see our + * guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool RemoveSharedGroupMembers(ServerModels::FRemoveSharedGroupMembersRequest& request, const FRemoveSharedGroupMembersDelegate& SuccessDelegate = FRemoveSharedGroupMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Submit a report about a player (due to bad bahavior, etc.) on behalf of another player, so that customer service + * representatives for the title can take action concerning potentially toxic players. + */ + bool ReportPlayer(ServerModels::FReportPlayerServerRequest& request, const FReportPlayerDelegate& SuccessDelegate = FReportPlayerDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revoke all active bans for a user. + * Setting the active state of all non-expired bans for a user to Inactive. Expired bans with an Active state will be ignored, however. Returns information about applied updates only. + */ + bool RevokeAllBansForUser(ServerModels::FRevokeAllBansForUserRequest& request, const FRevokeAllBansForUserDelegate& SuccessDelegate = FRevokeAllBansForUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revoke all active bans specified with BanId. + * Setting the active state of all bans requested to Inactive regardless of whether that ban has already expired. BanIds that do not exist will be skipped. Returns information about applied updates only. + */ + bool RevokeBans(ServerModels::FRevokeBansRequest& request, const FRevokeBansDelegate& SuccessDelegate = FRevokeBansDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revokes access to an item in a user's inventory + * In cases where the inventory item in question is a "crate", and the items it contained have already been dispensed, this will not revoke access or otherwise remove the items which were dispensed. + */ + bool RevokeInventoryItem(ServerModels::FRevokeInventoryItemRequest& request, const FRevokeInventoryItemDelegate& SuccessDelegate = FRevokeInventoryItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revokes access for up to 25 items across multiple users and characters. + * In cases where the inventory item in question is a "crate", and the items it contained have already been dispensed, this will not revoke access or otherwise remove the items which were dispensed. + */ + bool RevokeInventoryItems(ServerModels::FRevokeInventoryItemsRequest& request, const FRevokeInventoryItemsDelegate& SuccessDelegate = FRevokeInventoryItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Forces an email to be sent to the registered contact email address for the user's account based on an account recovery + * email template + * PlayFab accounts which have valid email address or username will be able to receive a password reset email using this API.The email sent must be an account recovery email template. The username or email can be passed in to send the email + */ + bool SendCustomAccountRecoveryEmail(ServerModels::FSendCustomAccountRecoveryEmailRequest& request, const FSendCustomAccountRecoveryEmailDelegate& SuccessDelegate = FSendCustomAccountRecoveryEmailDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sends an email based on an email template to a player's contact email + * Sends an email for only players that have contact emails associated with them. Takes in an email template ID specifyingthe email template to send. + */ + bool SendEmailFromTemplate(ServerModels::FSendEmailFromTemplateRequest& request, const FSendEmailFromTemplateDelegate& SuccessDelegate = FSendEmailFromTemplateDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sends an iOS/Android Push Notification to a specific user, if that user's device has been configured for Push + * Notifications in PlayFab. If a user has linked both Android and iOS devices, both will be notified. + */ + bool SendPushNotification(ServerModels::FSendPushNotificationRequest& request, const FSendPushNotificationDelegate& SuccessDelegate = FSendPushNotificationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the tag list for a specified user in the friend list of another user + * This operation is not additive. It will completely replace the tag list for the specified user. Please note that only users in the PlayFab friends list can be assigned tags. Attempting to set a tag on a friend only included in the friends list from a social site integration (such as Facebook or Steam) will return the AccountNotFound error. + */ + bool SetFriendTags(ServerModels::FSetFriendTagsRequest& request, const FSetFriendTagsDelegate& SuccessDelegate = FSetFriendTagsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Sets the custom data of the indicated Game Server Instance + bool SetGameServerInstanceData(ServerModels::FSetGameServerInstanceDataRequest& request, const FSetGameServerInstanceDataDelegate& SuccessDelegate = FSetGameServerInstanceDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Set the state of the indicated Game Server Instance. + bool SetGameServerInstanceState(ServerModels::FSetGameServerInstanceStateRequest& request, const FSetGameServerInstanceStateDelegate& SuccessDelegate = FSetGameServerInstanceStateDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Set custom tags for the specified Game Server Instance + bool SetGameServerInstanceTags(ServerModels::FSetGameServerInstanceTagsRequest& request, const FSetGameServerInstanceTagsDelegate& SuccessDelegate = FSetGameServerInstanceTagsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's + * secret use the Admin or Server API method SetPlayerSecret. + * APIs that require signatures require that the player have a configured Player Secret Key that is used to sign all requests. Players that don't have a secret will be blocked from making API calls until it is configured. To create a signature header add a SHA256 hashed string containing UTF8 encoded JSON body as it will be sent to the server, the current time in UTC formatted to ISO 8601, and the players secret formatted as 'body.date.secret'. Place the resulting hash into the header X-PlayFab-Signature, along with a header X-PlayFab-Timestamp of the same UTC timestamp used in the signature. + */ + bool SetPlayerSecret(ServerModels::FSetPlayerSecretRequest& request, const FSetPlayerSecretDelegate& SuccessDelegate = FSetPlayerSecretDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the key-value store of custom publisher settings + * This API is designed to store publisher-specific values which can be read, but not written to, by the client. This data is shared across all titles assigned to a particular publisher, and can be used for cross-game coordination. Only titles assigned to a publisher can use this API. This operation is additive. If a Key does not exist in the current dataset, it will be added with the specified Value. If it already exists, the Value for that key will be overwritten with the new Value. For more information email devrel@playfab.com + */ + bool SetPublisherData(ServerModels::FSetPublisherDataRequest& request, const FSetPublisherDataDelegate& SuccessDelegate = FSetPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the key-value store of custom title settings + * This API is designed to store title specific values which can be read, but not written to, by the client. For example, a developer could choose to store values which modify the user experience, such as enemy spawn rates, weapon strengths, movement speeds, etc. This allows a developer to update the title without the need to create, test, and ship a new build. This operation is additive. If a Key does not exist in the current dataset, it will be added with the specified Value. If it already exists, the Value for that key will be overwritten with the new Value. + */ + bool SetTitleData(ServerModels::FSetTitleDataRequest& request, const FSetTitleDataDelegate& SuccessDelegate = FSetTitleDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the key-value store of custom title settings + * This API is designed to store title specific values which are accessible only to the server. This can be used to tweak settings on game servers and Cloud Scripts without needed to update and re-deploy them. This operation is additive. If a Key does not exist in the current dataset, it will be added with the specified Value. If it already exists, the Value for that key will be overwritten with the new Value. + */ + bool SetTitleInternalData(ServerModels::FSetTitleDataRequest& request, const FSetTitleInternalDataDelegate& SuccessDelegate = FSetTitleInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Decrements the character's balance of the specified virtual currency by the stated amount. It is possible to make a VC + * balance negative with this API. + */ + bool SubtractCharacterVirtualCurrency(ServerModels::FSubtractCharacterVirtualCurrencyRequest& request, const FSubtractCharacterVirtualCurrencyDelegate& SuccessDelegate = FSubtractCharacterVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Decrements the user's balance of the specified virtual currency by the stated amount. It is possible to make a VC + * balance negative with this API. + */ + bool SubtractUserVirtualCurrency(ServerModels::FSubtractUserVirtualCurrencyRequest& request, const FSubtractUserVirtualCurrencyDelegate& SuccessDelegate = FSubtractUserVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Opens a specific container (ContainerItemInstanceId), with a specific key (KeyItemInstanceId, when required), and + * returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > + * 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. + * Specify the container and optionally the catalogVersion for the container to open + */ + bool UnlockContainerInstance(ServerModels::FUnlockContainerInstanceRequest& request, const FUnlockContainerInstanceDelegate& SuccessDelegate = FUnlockContainerInstanceDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Searches Player or Character inventory for any ItemInstance matching the given CatalogItemId, if necessary unlocks it + * using any appropriate key, and returns the contents of the opened container. If the container (and key when relevant) + * are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of + * ConsumeItem. + * Specify the type of container to open and optionally the catalogVersion for the container to open + */ + bool UnlockContainerItem(ServerModels::FUnlockContainerItemRequest& request, const FUnlockContainerItemDelegate& SuccessDelegate = FUnlockContainerItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Update the avatar URL of the specified player + bool UpdateAvatarUrl(ServerModels::FUpdateAvatarUrlRequest& request, const FUpdateAvatarUrlDelegate& SuccessDelegate = FUpdateAvatarUrlDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates information of a list of existing bans specified with Ban Ids. + * For each ban, only updates the values that are set. Leave any value to null for no change. If a ban could not be found, the rest are still applied. Returns information about applied updates only. + */ + bool UpdateBans(ServerModels::FUpdateBansRequest& request, const FUpdateBansDelegate& SuccessDelegate = FUpdateBansDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user's character which is readable and writable by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateCharacterData(ServerModels::FUpdateCharacterDataRequest& request, const FUpdateCharacterDataDelegate& SuccessDelegate = FUpdateCharacterDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user's character which cannot be accessed by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateCharacterInternalData(ServerModels::FUpdateCharacterDataRequest& request, const FUpdateCharacterInternalDataDelegate& SuccessDelegate = FUpdateCharacterInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user's character which can only be read by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateCharacterReadOnlyData(ServerModels::FUpdateCharacterDataRequest& request, const FUpdateCharacterReadOnlyDataDelegate& SuccessDelegate = FUpdateCharacterReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the values of the specified title-specific statistics for the specific character + * Character statistics are similar to user statistics in that they are numeric values which may only be updated by a server operation, in order to minimize the opportunity for unauthorized changes. In addition to being available for use by the title, the statistics are used for all leaderboard operations in PlayFab. + */ + bool UpdateCharacterStatistics(ServerModels::FUpdateCharacterStatisticsRequest& request, const FUpdateCharacterStatisticsDelegate& SuccessDelegate = FUpdateCharacterStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the values of the specified title-specific statistics for the user + * This operation is additive. Statistics not currently defined will be added, while those already defined will be updated with the given values. All other user statistics will remain unchanged. + */ + bool UpdatePlayerStatistics(ServerModels::FUpdatePlayerStatisticsRequest& request, const FUpdatePlayerStatisticsDelegate& SuccessDelegate = FUpdatePlayerStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated + * or added in this call will be readable by users not in the group. By default, data permissions are set to Private. + * Regardless of the permission setting, only members of the group (and the server) can update the data. Shared Groups are + * designed for sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + * Note that in the case of multiple calls to write to the same shared group data keys, the last write received by the PlayFab service will determine the value available to subsequent read operations. For scenarios requiring coordination of data updates, it is recommended that titles make use of user data with read permission set to public, or a combination of user data and shared group data. + */ + bool UpdateSharedGroupData(ServerModels::FUpdateSharedGroupDataRequest& request, const FUpdateSharedGroupDataDelegate& SuccessDelegate = FUpdateSharedGroupDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user which is readable and writable by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserData(ServerModels::FUpdateUserDataRequest& request, const FUpdateUserDataDelegate& SuccessDelegate = FUpdateUserDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user which cannot be accessed by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserInternalData(ServerModels::FUpdateUserInternalDataRequest& request, const FUpdateUserInternalDataDelegate& SuccessDelegate = FUpdateUserInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the key-value pair data tagged to the specified item, which is read-only from the client. + * This function performs an additive update of the arbitrary JSON object containing the custom data for the item instance which belongs to the specified user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserInventoryItemCustomData(ServerModels::FUpdateUserInventoryItemDataRequest& request, const FUpdateUserInventoryItemCustomDataDelegate& SuccessDelegate = FUpdateUserInventoryItemCustomDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the publisher-specific custom data for the user which is readable and writable by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserPublisherData(ServerModels::FUpdateUserDataRequest& request, const FUpdateUserPublisherDataDelegate& SuccessDelegate = FUpdateUserPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the publisher-specific custom data for the user which cannot be accessed by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserPublisherInternalData(ServerModels::FUpdateUserInternalDataRequest& request, const FUpdateUserPublisherInternalDataDelegate& SuccessDelegate = FUpdateUserPublisherInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the publisher-specific custom data for the user which can only be read by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserPublisherReadOnlyData(ServerModels::FUpdateUserDataRequest& request, const FUpdateUserPublisherReadOnlyDataDelegate& SuccessDelegate = FUpdateUserPublisherReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user which can only be read by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserReadOnlyData(ServerModels::FUpdateUserDataRequest& request, const FUpdateUserReadOnlyDataDelegate& SuccessDelegate = FUpdateUserReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Writes a character-based event into PlayStream. + * This API is designed to write a multitude of different event types into PlayStream. It supports a flexible JSON schema, which allowsfor arbitrary key-value pairs to describe any character-based event. The created event will be locked to the authenticated title. + */ + bool WriteCharacterEvent(ServerModels::FWriteServerCharacterEventRequest& request, const FWriteCharacterEventDelegate& SuccessDelegate = FWriteCharacterEventDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Writes a player-based event into PlayStream. + * This API is designed to write a multitude of different event types into PlayStream. It supports a flexible JSON schema, which allowsfor arbitrary key-value pairs to describe any player-based event. The created event will be locked to the authenticated title. + */ + bool WritePlayerEvent(ServerModels::FWriteServerPlayerEventRequest& request, const FWritePlayerEventDelegate& SuccessDelegate = FWritePlayerEventDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Writes a title-based event into PlayStream. + * This API is designed to write a multitude of different event types into PlayStream. It supports a flexible JSON schema, which allowsfor arbitrary key-value pairs to describe any title-based event. The created event will be locked to the authenticated title. + */ + bool WriteTitleEvent(ServerModels::FWriteTitleEventRequest& request, const FWriteTitleEventDelegate& SuccessDelegate = FWriteTitleEventDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnAddCharacterVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddCharacterVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddPlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddPlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAuthenticateSessionTicketResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAuthenticateSessionTicketDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAwardSteamAchievementResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAwardSteamAchievementDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnBanUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FBanUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnConsumeItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConsumeItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreateSharedGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateSharedGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteCharacterFromUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteCharacterFromUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteSharedGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteSharedGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeregisterGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeregisterGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnEvaluateRandomResultTableResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FEvaluateRandomResultTableDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnExecuteCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExecuteCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetAllSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetAllUsersCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllUsersCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetContentDownloadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentDownloadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetFriendLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetFriendsListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendsListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardAroundCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardAroundUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardForUserCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardForUserCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerCombinedInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerCombinedInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayersInSegmentResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayersInSegmentDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerStatisticVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromFacebookIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromFacebookInstantGamesIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromSteamIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromSteamIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetRandomResultTablesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetRandomResultTablesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTimeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTimeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleNewsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleNewsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserAccountInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserAccountInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGrantCharacterToUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantCharacterToUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGrantItemsToCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGrantItemsToUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGrantItemsToUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnModifyItemUsesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FModifyItemUsesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnMoveItemToCharacterFromCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveItemToCharacterFromCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnMoveItemToCharacterFromUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveItemToCharacterFromUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnMoveItemToUserFromCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveItemToUserFromCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnNotifyMatchmakerPlayerLeftResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FNotifyMatchmakerPlayerLeftDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRedeemCouponResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRedeemCouponDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRedeemMatchmakerTicketResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRedeemMatchmakerTicketDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRefreshGameServerInstanceHeartbeatResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefreshGameServerInstanceHeartbeatDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRegisterGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemovePlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemovePlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnReportPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FReportPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeAllBansForUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeAllBansForUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeInventoryItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeInventoryItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSendCustomAccountRecoveryEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendCustomAccountRecoveryEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSendEmailFromTemplateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendEmailFromTemplateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSendPushNotificationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendPushNotificationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetFriendTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetFriendTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetGameServerInstanceDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGameServerInstanceDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetGameServerInstanceStateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGameServerInstanceStateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetGameServerInstanceTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGameServerInstanceTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetPlayerSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPlayerSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSubtractCharacterVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractCharacterVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSubtractUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlockContainerInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlockContainerItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateAvatarUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateAvatarUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCharacterInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCharacterReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdatePlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserInventoryItemCustomDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserInventoryItemCustomDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnWriteCharacterEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteCharacterEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnWritePlayerEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWritePlayerEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnWriteTitleEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteTitleEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabServerDataModels.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabServerDataModels.h new file mode 100644 index 000000000..08ff0b47a --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabServerDataModels.h @@ -0,0 +1,10021 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace ServerModels +{ + + struct PLAYFABCPP_API FAdCampaignAttribution : public FPlayFabBaseModel + { + // UTC time stamp of attribution + FDateTime AttributedAt; + + // [optional] Attribution campaign identifier + FString CampaignId; + + // [optional] Attribution network name + FString Platform; + + FAdCampaignAttribution() : + FPlayFabBaseModel(), + AttributedAt(0), + CampaignId(), + Platform() + {} + + FAdCampaignAttribution(const FAdCampaignAttribution& src) : + FPlayFabBaseModel(), + AttributedAt(src.AttributedAt), + CampaignId(src.CampaignId), + Platform(src.Platform) + {} + + FAdCampaignAttribution(const TSharedPtr& obj) : FAdCampaignAttribution() + { + readFromValue(obj); + } + + ~FAdCampaignAttribution(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAdCampaignAttributionModel : public FPlayFabBaseModel + { + // UTC time stamp of attribution + FDateTime AttributedAt; + + // [optional] Attribution campaign identifier + FString CampaignId; + + // [optional] Attribution network name + FString Platform; + + FAdCampaignAttributionModel() : + FPlayFabBaseModel(), + AttributedAt(0), + CampaignId(), + Platform() + {} + + FAdCampaignAttributionModel(const FAdCampaignAttributionModel& src) : + FPlayFabBaseModel(), + AttributedAt(src.AttributedAt), + CampaignId(src.CampaignId), + Platform(src.Platform) + {} + + FAdCampaignAttributionModel(const TSharedPtr& obj) : FAdCampaignAttributionModel() + { + readFromValue(obj); + } + + ~FAdCampaignAttributionModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddCharacterVirtualCurrencyRequest : public FPlayFabBaseModel + { + /** + * Amount to be added to the character balance of the specified virtual currency. Maximum VC balance is Int32 + * (2,147,483,647). Any increase over this value will be discarded. + */ + int32 Amount; + + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // PlayFab unique identifier of the user whose virtual currency balance is to be incremented. + FString PlayFabId; + + // Name of the virtual currency which is to be incremented. + FString VirtualCurrency; + + FAddCharacterVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + CharacterId(), + PlayFabId(), + VirtualCurrency() + {} + + FAddCharacterVirtualCurrencyRequest(const FAddCharacterVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + CharacterId(src.CharacterId), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FAddCharacterVirtualCurrencyRequest(const TSharedPtr& obj) : FAddCharacterVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FAddCharacterVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddFriendRequest : public FPlayFabBaseModel + { + // [optional] Email address of the user being added. + FString FriendEmail; + + // [optional] The PlayFab identifier of the user being added. + FString FriendPlayFabId; + + // [optional] Title-specific display name of the user to being added. + FString FriendTitleDisplayName; + + // [optional] The PlayFab username of the user being added + FString FriendUsername; + + // PlayFab identifier of the player to add a new friend. + FString PlayFabId; + + FAddFriendRequest() : + FPlayFabBaseModel(), + FriendEmail(), + FriendPlayFabId(), + FriendTitleDisplayName(), + FriendUsername(), + PlayFabId() + {} + + FAddFriendRequest(const FAddFriendRequest& src) : + FPlayFabBaseModel(), + FriendEmail(src.FriendEmail), + FriendPlayFabId(src.FriendPlayFabId), + FriendTitleDisplayName(src.FriendTitleDisplayName), + FriendUsername(src.FriendUsername), + PlayFabId(src.PlayFabId) + {} + + FAddFriendRequest(const TSharedPtr& obj) : FAddFriendRequest() + { + readFromValue(obj); + } + + ~FAddFriendRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddPlayerTagRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique tag for player profile. + FString TagName; + + FAddPlayerTagRequest() : + FPlayFabBaseModel(), + PlayFabId(), + TagName() + {} + + FAddPlayerTagRequest(const FAddPlayerTagRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + TagName(src.TagName) + {} + + FAddPlayerTagRequest(const TSharedPtr& obj) : FAddPlayerTagRequest() + { + readFromValue(obj); + } + + ~FAddPlayerTagRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddPlayerTagResult : public FPlayFabBaseModel + { + FAddPlayerTagResult() : + FPlayFabBaseModel() + {} + + FAddPlayerTagResult(const FAddPlayerTagResult& src) : + FPlayFabBaseModel() + {} + + FAddPlayerTagResult(const TSharedPtr& obj) : FAddPlayerTagResult() + { + readFromValue(obj); + } + + ~FAddPlayerTagResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddSharedGroupMembersRequest : public FPlayFabBaseModel + { + // An array of unique PlayFab assigned ID of the user on whom the operation will be performed. + TArray PlayFabIds; + // Unique identifier for the shared group. + FString SharedGroupId; + + FAddSharedGroupMembersRequest() : + FPlayFabBaseModel(), + PlayFabIds(), + SharedGroupId() + {} + + FAddSharedGroupMembersRequest(const FAddSharedGroupMembersRequest& src) : + FPlayFabBaseModel(), + PlayFabIds(src.PlayFabIds), + SharedGroupId(src.SharedGroupId) + {} + + FAddSharedGroupMembersRequest(const TSharedPtr& obj) : FAddSharedGroupMembersRequest() + { + readFromValue(obj); + } + + ~FAddSharedGroupMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddSharedGroupMembersResult : public FPlayFabBaseModel + { + FAddSharedGroupMembersResult() : + FPlayFabBaseModel() + {} + + FAddSharedGroupMembersResult(const FAddSharedGroupMembersResult& src) : + FPlayFabBaseModel() + {} + + FAddSharedGroupMembersResult(const TSharedPtr& obj) : FAddSharedGroupMembersResult() + { + readFromValue(obj); + } + + ~FAddSharedGroupMembersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddUserVirtualCurrencyRequest : public FPlayFabBaseModel + { + /** + * Amount to be added to the user balance of the specified virtual currency. Maximum VC balance is Int32 (2,147,483,647). + * Any increase over this value will be discarded. + */ + int32 Amount; + + // PlayFab unique identifier of the user whose virtual currency balance is to be increased. + FString PlayFabId; + + // Name of the virtual currency which is to be incremented. + FString VirtualCurrency; + + FAddUserVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + PlayFabId(), + VirtualCurrency() + {} + + FAddUserVirtualCurrencyRequest(const FAddUserVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FAddUserVirtualCurrencyRequest(const TSharedPtr& obj) : FAddUserVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FAddUserVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum PushNotificationPlatform + { + PushNotificationPlatformApplePushNotificationService, + PushNotificationPlatformGoogleCloudMessaging + }; + + PLAYFABCPP_API void writePushNotificationPlatformEnumJSON(PushNotificationPlatform enumVal, JsonWriter& writer); + PLAYFABCPP_API PushNotificationPlatform readPushNotificationPlatformFromValue(const TSharedPtr& value); + PLAYFABCPP_API PushNotificationPlatform readPushNotificationPlatformFromValue(const FString& value); + + struct PLAYFABCPP_API FAdvancedPushPlatformMsg : public FPlayFabBaseModel + { + // The Json the platform should receive. + FString Json; + + // The platform that should receive the Json. + PushNotificationPlatform Platform; + + FAdvancedPushPlatformMsg() : + FPlayFabBaseModel(), + Json(), + Platform() + {} + + FAdvancedPushPlatformMsg(const FAdvancedPushPlatformMsg& src) : + FPlayFabBaseModel(), + Json(src.Json), + Platform(src.Platform) + {} + + FAdvancedPushPlatformMsg(const TSharedPtr& obj) : FAdvancedPushPlatformMsg() + { + readFromValue(obj); + } + + ~FAdvancedPushPlatformMsg(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAuthenticateSessionTicketRequest : public FPlayFabBaseModel + { + // Session ticket as issued by a PlayFab client login API. + FString SessionTicket; + + FAuthenticateSessionTicketRequest() : + FPlayFabBaseModel(), + SessionTicket() + {} + + FAuthenticateSessionTicketRequest(const FAuthenticateSessionTicketRequest& src) : + FPlayFabBaseModel(), + SessionTicket(src.SessionTicket) + {} + + FAuthenticateSessionTicketRequest(const TSharedPtr& obj) : FAuthenticateSessionTicketRequest() + { + readFromValue(obj); + } + + ~FAuthenticateSessionTicketRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserAndroidDeviceInfo : public FPlayFabBaseModel + { + // [optional] Android device ID + FString AndroidDeviceId; + + FUserAndroidDeviceInfo() : + FPlayFabBaseModel(), + AndroidDeviceId() + {} + + FUserAndroidDeviceInfo(const FUserAndroidDeviceInfo& src) : + FPlayFabBaseModel(), + AndroidDeviceId(src.AndroidDeviceId) + {} + + FUserAndroidDeviceInfo(const TSharedPtr& obj) : FUserAndroidDeviceInfo() + { + readFromValue(obj); + } + + ~FUserAndroidDeviceInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserCustomIdInfo : public FPlayFabBaseModel + { + // [optional] Custom ID + FString CustomId; + + FUserCustomIdInfo() : + FPlayFabBaseModel(), + CustomId() + {} + + FUserCustomIdInfo(const FUserCustomIdInfo& src) : + FPlayFabBaseModel(), + CustomId(src.CustomId) + {} + + FUserCustomIdInfo(const TSharedPtr& obj) : FUserCustomIdInfo() + { + readFromValue(obj); + } + + ~FUserCustomIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserFacebookInfo : public FPlayFabBaseModel + { + // [optional] Facebook identifier + FString FacebookId; + + // [optional] Facebook full name + FString FullName; + + FUserFacebookInfo() : + FPlayFabBaseModel(), + FacebookId(), + FullName() + {} + + FUserFacebookInfo(const FUserFacebookInfo& src) : + FPlayFabBaseModel(), + FacebookId(src.FacebookId), + FullName(src.FullName) + {} + + FUserFacebookInfo(const TSharedPtr& obj) : FUserFacebookInfo() + { + readFromValue(obj); + } + + ~FUserFacebookInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserFacebookInstantGamesIdInfo : public FPlayFabBaseModel + { + // [optional] Facebook Instant Games ID + FString FacebookInstantGamesId; + + FUserFacebookInstantGamesIdInfo() : + FPlayFabBaseModel(), + FacebookInstantGamesId() + {} + + FUserFacebookInstantGamesIdInfo(const FUserFacebookInstantGamesIdInfo& src) : + FPlayFabBaseModel(), + FacebookInstantGamesId(src.FacebookInstantGamesId) + {} + + FUserFacebookInstantGamesIdInfo(const TSharedPtr& obj) : FUserFacebookInstantGamesIdInfo() + { + readFromValue(obj); + } + + ~FUserFacebookInstantGamesIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserGameCenterInfo : public FPlayFabBaseModel + { + // [optional] Gamecenter identifier + FString GameCenterId; + + FUserGameCenterInfo() : + FPlayFabBaseModel(), + GameCenterId() + {} + + FUserGameCenterInfo(const FUserGameCenterInfo& src) : + FPlayFabBaseModel(), + GameCenterId(src.GameCenterId) + {} + + FUserGameCenterInfo(const TSharedPtr& obj) : FUserGameCenterInfo() + { + readFromValue(obj); + } + + ~FUserGameCenterInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserGoogleInfo : public FPlayFabBaseModel + { + // [optional] Email address of the Google account + FString GoogleEmail; + + // [optional] Gender information of the Google account + FString GoogleGender; + + // [optional] Google ID + FString GoogleId; + + // [optional] Locale of the Google account + FString GoogleLocale; + + FUserGoogleInfo() : + FPlayFabBaseModel(), + GoogleEmail(), + GoogleGender(), + GoogleId(), + GoogleLocale() + {} + + FUserGoogleInfo(const FUserGoogleInfo& src) : + FPlayFabBaseModel(), + GoogleEmail(src.GoogleEmail), + GoogleGender(src.GoogleGender), + GoogleId(src.GoogleId), + GoogleLocale(src.GoogleLocale) + {} + + FUserGoogleInfo(const TSharedPtr& obj) : FUserGoogleInfo() + { + readFromValue(obj); + } + + ~FUserGoogleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserIosDeviceInfo : public FPlayFabBaseModel + { + // [optional] iOS device ID + FString IosDeviceId; + + FUserIosDeviceInfo() : + FPlayFabBaseModel(), + IosDeviceId() + {} + + FUserIosDeviceInfo(const FUserIosDeviceInfo& src) : + FPlayFabBaseModel(), + IosDeviceId(src.IosDeviceId) + {} + + FUserIosDeviceInfo(const TSharedPtr& obj) : FUserIosDeviceInfo() + { + readFromValue(obj); + } + + ~FUserIosDeviceInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserKongregateInfo : public FPlayFabBaseModel + { + // [optional] Kongregate ID + FString KongregateId; + + // [optional] Kongregate Username + FString KongregateName; + + FUserKongregateInfo() : + FPlayFabBaseModel(), + KongregateId(), + KongregateName() + {} + + FUserKongregateInfo(const FUserKongregateInfo& src) : + FPlayFabBaseModel(), + KongregateId(src.KongregateId), + KongregateName(src.KongregateName) + {} + + FUserKongregateInfo(const TSharedPtr& obj) : FUserKongregateInfo() + { + readFromValue(obj); + } + + ~FUserKongregateInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserNintendoSwitchDeviceIdInfo : public FPlayFabBaseModel + { + // [optional] Nintendo Switch Device ID + FString NintendoSwitchDeviceId; + + FUserNintendoSwitchDeviceIdInfo() : + FPlayFabBaseModel(), + NintendoSwitchDeviceId() + {} + + FUserNintendoSwitchDeviceIdInfo(const FUserNintendoSwitchDeviceIdInfo& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId) + {} + + FUserNintendoSwitchDeviceIdInfo(const TSharedPtr& obj) : FUserNintendoSwitchDeviceIdInfo() + { + readFromValue(obj); + } + + ~FUserNintendoSwitchDeviceIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserOpenIdInfo : public FPlayFabBaseModel + { + // [optional] OpenID Connection ID + FString ConnectionId; + + // [optional] OpenID Issuer + FString Issuer; + + // [optional] OpenID Subject + FString Subject; + + FUserOpenIdInfo() : + FPlayFabBaseModel(), + ConnectionId(), + Issuer(), + Subject() + {} + + FUserOpenIdInfo(const FUserOpenIdInfo& src) : + FPlayFabBaseModel(), + ConnectionId(src.ConnectionId), + Issuer(src.Issuer), + Subject(src.Subject) + {} + + FUserOpenIdInfo(const TSharedPtr& obj) : FUserOpenIdInfo() + { + readFromValue(obj); + } + + ~FUserOpenIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserPrivateAccountInfo : public FPlayFabBaseModel + { + // [optional] user email address + FString Email; + + FUserPrivateAccountInfo() : + FPlayFabBaseModel(), + Email() + {} + + FUserPrivateAccountInfo(const FUserPrivateAccountInfo& src) : + FPlayFabBaseModel(), + Email(src.Email) + {} + + FUserPrivateAccountInfo(const TSharedPtr& obj) : FUserPrivateAccountInfo() + { + readFromValue(obj); + } + + ~FUserPrivateAccountInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserPsnInfo : public FPlayFabBaseModel + { + // [optional] PSN account ID + FString PsnAccountId; + + // [optional] PSN online ID + FString PsnOnlineId; + + FUserPsnInfo() : + FPlayFabBaseModel(), + PsnAccountId(), + PsnOnlineId() + {} + + FUserPsnInfo(const FUserPsnInfo& src) : + FPlayFabBaseModel(), + PsnAccountId(src.PsnAccountId), + PsnOnlineId(src.PsnOnlineId) + {} + + FUserPsnInfo(const TSharedPtr& obj) : FUserPsnInfo() + { + readFromValue(obj); + } + + ~FUserPsnInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum TitleActivationStatus + { + TitleActivationStatusNone, + TitleActivationStatusActivatedTitleKey, + TitleActivationStatusPendingSteam, + TitleActivationStatusActivatedSteam, + TitleActivationStatusRevokedSteam + }; + + PLAYFABCPP_API void writeTitleActivationStatusEnumJSON(TitleActivationStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API TitleActivationStatus readTitleActivationStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API TitleActivationStatus readTitleActivationStatusFromValue(const FString& value); + + enum Currency + { + CurrencyAED, + CurrencyAFN, + CurrencyALL, + CurrencyAMD, + CurrencyANG, + CurrencyAOA, + CurrencyARS, + CurrencyAUD, + CurrencyAWG, + CurrencyAZN, + CurrencyBAM, + CurrencyBBD, + CurrencyBDT, + CurrencyBGN, + CurrencyBHD, + CurrencyBIF, + CurrencyBMD, + CurrencyBND, + CurrencyBOB, + CurrencyBRL, + CurrencyBSD, + CurrencyBTN, + CurrencyBWP, + CurrencyBYR, + CurrencyBZD, + CurrencyCAD, + CurrencyCDF, + CurrencyCHF, + CurrencyCLP, + CurrencyCNY, + CurrencyCOP, + CurrencyCRC, + CurrencyCUC, + CurrencyCUP, + CurrencyCVE, + CurrencyCZK, + CurrencyDJF, + CurrencyDKK, + CurrencyDOP, + CurrencyDZD, + CurrencyEGP, + CurrencyERN, + CurrencyETB, + CurrencyEUR, + CurrencyFJD, + CurrencyFKP, + CurrencyGBP, + CurrencyGEL, + CurrencyGGP, + CurrencyGHS, + CurrencyGIP, + CurrencyGMD, + CurrencyGNF, + CurrencyGTQ, + CurrencyGYD, + CurrencyHKD, + CurrencyHNL, + CurrencyHRK, + CurrencyHTG, + CurrencyHUF, + CurrencyIDR, + CurrencyILS, + CurrencyIMP, + CurrencyINR, + CurrencyIQD, + CurrencyIRR, + CurrencyISK, + CurrencyJEP, + CurrencyJMD, + CurrencyJOD, + CurrencyJPY, + CurrencyKES, + CurrencyKGS, + CurrencyKHR, + CurrencyKMF, + CurrencyKPW, + CurrencyKRW, + CurrencyKWD, + CurrencyKYD, + CurrencyKZT, + CurrencyLAK, + CurrencyLBP, + CurrencyLKR, + CurrencyLRD, + CurrencyLSL, + CurrencyLYD, + CurrencyMAD, + CurrencyMDL, + CurrencyMGA, + CurrencyMKD, + CurrencyMMK, + CurrencyMNT, + CurrencyMOP, + CurrencyMRO, + CurrencyMUR, + CurrencyMVR, + CurrencyMWK, + CurrencyMXN, + CurrencyMYR, + CurrencyMZN, + CurrencyNAD, + CurrencyNGN, + CurrencyNIO, + CurrencyNOK, + CurrencyNPR, + CurrencyNZD, + CurrencyOMR, + CurrencyPAB, + CurrencyPEN, + CurrencyPGK, + CurrencyPHP, + CurrencyPKR, + CurrencyPLN, + CurrencyPYG, + CurrencyQAR, + CurrencyRON, + CurrencyRSD, + CurrencyRUB, + CurrencyRWF, + CurrencySAR, + CurrencySBD, + CurrencySCR, + CurrencySDG, + CurrencySEK, + CurrencySGD, + CurrencySHP, + CurrencySLL, + CurrencySOS, + CurrencySPL, + CurrencySRD, + CurrencySTD, + CurrencySVC, + CurrencySYP, + CurrencySZL, + CurrencyTHB, + CurrencyTJS, + CurrencyTMT, + CurrencyTND, + CurrencyTOP, + CurrencyTRY, + CurrencyTTD, + CurrencyTVD, + CurrencyTWD, + CurrencyTZS, + CurrencyUAH, + CurrencyUGX, + CurrencyUSD, + CurrencyUYU, + CurrencyUZS, + CurrencyVEF, + CurrencyVND, + CurrencyVUV, + CurrencyWST, + CurrencyXAF, + CurrencyXCD, + CurrencyXDR, + CurrencyXOF, + CurrencyXPF, + CurrencyYER, + CurrencyZAR, + CurrencyZMW, + CurrencyZWD + }; + + PLAYFABCPP_API void writeCurrencyEnumJSON(Currency enumVal, JsonWriter& writer); + PLAYFABCPP_API Currency readCurrencyFromValue(const TSharedPtr& value); + PLAYFABCPP_API Currency readCurrencyFromValue(const FString& value); + + struct PLAYFABCPP_API FUserSteamInfo : public FPlayFabBaseModel + { + // [optional] what stage of game ownership the user is listed as being in, from Steam + Boxed SteamActivationStatus; + + // [optional] the country in which the player resides, from Steam data + FString SteamCountry; + + // [optional] currency type set in the user Steam account + Boxed SteamCurrency; + + // [optional] Steam identifier + FString SteamId; + + FUserSteamInfo() : + FPlayFabBaseModel(), + SteamActivationStatus(), + SteamCountry(), + SteamCurrency(), + SteamId() + {} + + FUserSteamInfo(const FUserSteamInfo& src) : + FPlayFabBaseModel(), + SteamActivationStatus(src.SteamActivationStatus), + SteamCountry(src.SteamCountry), + SteamCurrency(src.SteamCurrency), + SteamId(src.SteamId) + {} + + FUserSteamInfo(const TSharedPtr& obj) : FUserSteamInfo() + { + readFromValue(obj); + } + + ~FUserSteamInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum UserOrigination + { + UserOriginationOrganic, + UserOriginationSteam, + UserOriginationGoogle, + UserOriginationAmazon, + UserOriginationFacebook, + UserOriginationKongregate, + UserOriginationGamersFirst, + UserOriginationUnknown, + UserOriginationIOS, + UserOriginationLoadTest, + UserOriginationAndroid, + UserOriginationPSN, + UserOriginationGameCenter, + UserOriginationCustomId, + UserOriginationXboxLive, + UserOriginationParse, + UserOriginationTwitch, + UserOriginationWindowsHello, + UserOriginationServerCustomId, + UserOriginationNintendoSwitchDeviceId, + UserOriginationFacebookInstantGamesId, + UserOriginationOpenIdConnect + }; + + PLAYFABCPP_API void writeUserOriginationEnumJSON(UserOrigination enumVal, JsonWriter& writer); + PLAYFABCPP_API UserOrigination readUserOriginationFromValue(const TSharedPtr& value); + PLAYFABCPP_API UserOrigination readUserOriginationFromValue(const FString& value); + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserTitleInfo : public FPlayFabBaseModel + { + // [optional] URL to the player's avatar. + FString AvatarUrl; + + /** + * timestamp indicating when the user was first associated with this game (this can differ significantly from when the user + * first registered with PlayFab) + */ + FDateTime Created; + + // [optional] name of the user, as it is displayed in-game + FString DisplayName; + + /** + * [optional] timestamp indicating when the user first signed into this game (this can differ from the Created timestamp, as other + * events, such as issuing a beta key to the user, can associate the title to the user) + */ + Boxed FirstLogin; + + // [optional] boolean indicating whether or not the user is currently banned for a title + Boxed isBanned; + + // [optional] timestamp for the last user login for this title + Boxed LastLogin; + + // [optional] source by which the user first joined the game, if known + Boxed Origination; + + // [optional] Title player account entity for this user + TSharedPtr TitlePlayerAccount; + + FUserTitleInfo() : + FPlayFabBaseModel(), + AvatarUrl(), + Created(0), + DisplayName(), + FirstLogin(), + isBanned(), + LastLogin(), + Origination(), + TitlePlayerAccount(nullptr) + {} + + FUserTitleInfo(const FUserTitleInfo& src) : + FPlayFabBaseModel(), + AvatarUrl(src.AvatarUrl), + Created(src.Created), + DisplayName(src.DisplayName), + FirstLogin(src.FirstLogin), + isBanned(src.isBanned), + LastLogin(src.LastLogin), + Origination(src.Origination), + TitlePlayerAccount(src.TitlePlayerAccount.IsValid() ? MakeShareable(new FEntityKey(*src.TitlePlayerAccount)) : nullptr) + {} + + FUserTitleInfo(const TSharedPtr& obj) : FUserTitleInfo() + { + readFromValue(obj); + } + + ~FUserTitleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserTwitchInfo : public FPlayFabBaseModel + { + // [optional] Twitch ID + FString TwitchId; + + // [optional] Twitch Username + FString TwitchUserName; + + FUserTwitchInfo() : + FPlayFabBaseModel(), + TwitchId(), + TwitchUserName() + {} + + FUserTwitchInfo(const FUserTwitchInfo& src) : + FPlayFabBaseModel(), + TwitchId(src.TwitchId), + TwitchUserName(src.TwitchUserName) + {} + + FUserTwitchInfo(const TSharedPtr& obj) : FUserTwitchInfo() + { + readFromValue(obj); + } + + ~FUserTwitchInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserWindowsHelloInfo : public FPlayFabBaseModel + { + // [optional] Windows Hello Device Name + FString WindowsHelloDeviceName; + + // [optional] Windows Hello Public Key Hash + FString WindowsHelloPublicKeyHash; + + FUserWindowsHelloInfo() : + FPlayFabBaseModel(), + WindowsHelloDeviceName(), + WindowsHelloPublicKeyHash() + {} + + FUserWindowsHelloInfo(const FUserWindowsHelloInfo& src) : + FPlayFabBaseModel(), + WindowsHelloDeviceName(src.WindowsHelloDeviceName), + WindowsHelloPublicKeyHash(src.WindowsHelloPublicKeyHash) + {} + + FUserWindowsHelloInfo(const TSharedPtr& obj) : FUserWindowsHelloInfo() + { + readFromValue(obj); + } + + ~FUserWindowsHelloInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserXboxInfo : public FPlayFabBaseModel + { + // [optional] XBox user ID + FString XboxUserId; + + FUserXboxInfo() : + FPlayFabBaseModel(), + XboxUserId() + {} + + FUserXboxInfo(const FUserXboxInfo& src) : + FPlayFabBaseModel(), + XboxUserId(src.XboxUserId) + {} + + FUserXboxInfo(const TSharedPtr& obj) : FUserXboxInfo() + { + readFromValue(obj); + } + + ~FUserXboxInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserAccountInfo : public FPlayFabBaseModel + { + // [optional] User Android device information, if an Android device has been linked + TSharedPtr AndroidDeviceInfo; + + // Timestamp indicating when the user account was created + FDateTime Created; + + // [optional] Custom ID information, if a custom ID has been assigned + TSharedPtr CustomIdInfo; + + // [optional] User Facebook information, if a Facebook account has been linked + TSharedPtr FacebookInfo; + + // [optional] Facebook Instant Games account information, if a Facebook Instant Games account has been linked + TSharedPtr FacebookInstantGamesIdInfo; + + // [optional] User Gamecenter information, if a Gamecenter account has been linked + TSharedPtr GameCenterInfo; + + // [optional] User Google account information, if a Google account has been linked + TSharedPtr GoogleInfo; + + // [optional] User iOS device information, if an iOS device has been linked + TSharedPtr IosDeviceInfo; + + // [optional] User Kongregate account information, if a Kongregate account has been linked + TSharedPtr KongregateInfo; + + // [optional] Nintendo Switch account information, if a Nintendo Switch account has been linked + TSharedPtr NintendoSwitchDeviceIdInfo; + + // [optional] OpenID Connect information, if any OpenID Connect accounts have been linked + TArray OpenIdInfo; + // [optional] Unique identifier for the user account + FString PlayFabId; + + // [optional] Personal information for the user which is considered more sensitive + TSharedPtr PrivateInfo; + + // [optional] User PSN account information, if a PSN account has been linked + TSharedPtr PsnInfo; + + // [optional] User Steam information, if a Steam account has been linked + TSharedPtr SteamInfo; + + // [optional] Title-specific information for the user account + TSharedPtr TitleInfo; + + // [optional] User Twitch account information, if a Twitch account has been linked + TSharedPtr TwitchInfo; + + // [optional] User account name in the PlayFab service + FString Username; + + // [optional] Windows Hello account information, if a Windows Hello account has been linked + TSharedPtr WindowsHelloInfo; + + // [optional] User XBox account information, if a XBox account has been linked + TSharedPtr XboxInfo; + + FUserAccountInfo() : + FPlayFabBaseModel(), + AndroidDeviceInfo(nullptr), + Created(0), + CustomIdInfo(nullptr), + FacebookInfo(nullptr), + FacebookInstantGamesIdInfo(nullptr), + GameCenterInfo(nullptr), + GoogleInfo(nullptr), + IosDeviceInfo(nullptr), + KongregateInfo(nullptr), + NintendoSwitchDeviceIdInfo(nullptr), + OpenIdInfo(), + PlayFabId(), + PrivateInfo(nullptr), + PsnInfo(nullptr), + SteamInfo(nullptr), + TitleInfo(nullptr), + TwitchInfo(nullptr), + Username(), + WindowsHelloInfo(nullptr), + XboxInfo(nullptr) + {} + + FUserAccountInfo(const FUserAccountInfo& src) : + FPlayFabBaseModel(), + AndroidDeviceInfo(src.AndroidDeviceInfo.IsValid() ? MakeShareable(new FUserAndroidDeviceInfo(*src.AndroidDeviceInfo)) : nullptr), + Created(src.Created), + CustomIdInfo(src.CustomIdInfo.IsValid() ? MakeShareable(new FUserCustomIdInfo(*src.CustomIdInfo)) : nullptr), + FacebookInfo(src.FacebookInfo.IsValid() ? MakeShareable(new FUserFacebookInfo(*src.FacebookInfo)) : nullptr), + FacebookInstantGamesIdInfo(src.FacebookInstantGamesIdInfo.IsValid() ? MakeShareable(new FUserFacebookInstantGamesIdInfo(*src.FacebookInstantGamesIdInfo)) : nullptr), + GameCenterInfo(src.GameCenterInfo.IsValid() ? MakeShareable(new FUserGameCenterInfo(*src.GameCenterInfo)) : nullptr), + GoogleInfo(src.GoogleInfo.IsValid() ? MakeShareable(new FUserGoogleInfo(*src.GoogleInfo)) : nullptr), + IosDeviceInfo(src.IosDeviceInfo.IsValid() ? MakeShareable(new FUserIosDeviceInfo(*src.IosDeviceInfo)) : nullptr), + KongregateInfo(src.KongregateInfo.IsValid() ? MakeShareable(new FUserKongregateInfo(*src.KongregateInfo)) : nullptr), + NintendoSwitchDeviceIdInfo(src.NintendoSwitchDeviceIdInfo.IsValid() ? MakeShareable(new FUserNintendoSwitchDeviceIdInfo(*src.NintendoSwitchDeviceIdInfo)) : nullptr), + OpenIdInfo(src.OpenIdInfo), + PlayFabId(src.PlayFabId), + PrivateInfo(src.PrivateInfo.IsValid() ? MakeShareable(new FUserPrivateAccountInfo(*src.PrivateInfo)) : nullptr), + PsnInfo(src.PsnInfo.IsValid() ? MakeShareable(new FUserPsnInfo(*src.PsnInfo)) : nullptr), + SteamInfo(src.SteamInfo.IsValid() ? MakeShareable(new FUserSteamInfo(*src.SteamInfo)) : nullptr), + TitleInfo(src.TitleInfo.IsValid() ? MakeShareable(new FUserTitleInfo(*src.TitleInfo)) : nullptr), + TwitchInfo(src.TwitchInfo.IsValid() ? MakeShareable(new FUserTwitchInfo(*src.TwitchInfo)) : nullptr), + Username(src.Username), + WindowsHelloInfo(src.WindowsHelloInfo.IsValid() ? MakeShareable(new FUserWindowsHelloInfo(*src.WindowsHelloInfo)) : nullptr), + XboxInfo(src.XboxInfo.IsValid() ? MakeShareable(new FUserXboxInfo(*src.XboxInfo)) : nullptr) + {} + + FUserAccountInfo(const TSharedPtr& obj) : FUserAccountInfo() + { + readFromValue(obj); + } + + ~FUserAccountInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAuthenticateSessionTicketResult : public FPlayFabBaseModel + { + // [optional] Account info for the user whose session ticket was supplied. + TSharedPtr UserInfo; + + FAuthenticateSessionTicketResult() : + FPlayFabBaseModel(), + UserInfo(nullptr) + {} + + FAuthenticateSessionTicketResult(const FAuthenticateSessionTicketResult& src) : + FPlayFabBaseModel(), + UserInfo(src.UserInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.UserInfo)) : nullptr) + {} + + FAuthenticateSessionTicketResult(const TSharedPtr& obj) : FAuthenticateSessionTicketResult() + { + readFromValue(obj); + } + + ~FAuthenticateSessionTicketResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAwardSteamAchievementItem : public FPlayFabBaseModel + { + // Unique Steam achievement name. + FString AchievementName; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Result of the award attempt (only valid on response, not on request). + bool Result; + + FAwardSteamAchievementItem() : + FPlayFabBaseModel(), + AchievementName(), + PlayFabId(), + Result(false) + {} + + FAwardSteamAchievementItem(const FAwardSteamAchievementItem& src) : + FPlayFabBaseModel(), + AchievementName(src.AchievementName), + PlayFabId(src.PlayFabId), + Result(src.Result) + {} + + FAwardSteamAchievementItem(const TSharedPtr& obj) : FAwardSteamAchievementItem() + { + readFromValue(obj); + } + + ~FAwardSteamAchievementItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAwardSteamAchievementRequest : public FPlayFabBaseModel + { + // Array of achievements to grant and the users to whom they are to be granted. + TArray Achievements; + FAwardSteamAchievementRequest() : + FPlayFabBaseModel(), + Achievements() + {} + + FAwardSteamAchievementRequest(const FAwardSteamAchievementRequest& src) : + FPlayFabBaseModel(), + Achievements(src.Achievements) + {} + + FAwardSteamAchievementRequest(const TSharedPtr& obj) : FAwardSteamAchievementRequest() + { + readFromValue(obj); + } + + ~FAwardSteamAchievementRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAwardSteamAchievementResult : public FPlayFabBaseModel + { + // [optional] Array of achievements granted. + TArray AchievementResults; + FAwardSteamAchievementResult() : + FPlayFabBaseModel(), + AchievementResults() + {} + + FAwardSteamAchievementResult(const FAwardSteamAchievementResult& src) : + FPlayFabBaseModel(), + AchievementResults(src.AchievementResults) + {} + + FAwardSteamAchievementResult(const TSharedPtr& obj) : FAwardSteamAchievementResult() + { + readFromValue(obj); + } + + ~FAwardSteamAchievementResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanInfo : public FPlayFabBaseModel + { + // The active state of this ban. Expired bans may still have this value set to true but they will have no effect. + bool Active; + + // [optional] The unique Ban Id associated with this ban. + FString BanId; + + // [optional] The time when this ban was applied. + Boxed Created; + + // [optional] The time when this ban expires. Permanent bans do not have expiration date. + Boxed Expires; + + // [optional] The IP address on which the ban was applied. May affect multiple players. + FString IPAddress; + + // [optional] The MAC address on which the ban was applied. May affect multiple players. + FString MACAddress; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] The reason why this ban was applied. + FString Reason; + + FBanInfo() : + FPlayFabBaseModel(), + Active(false), + BanId(), + Created(), + Expires(), + IPAddress(), + MACAddress(), + PlayFabId(), + Reason() + {} + + FBanInfo(const FBanInfo& src) : + FPlayFabBaseModel(), + Active(src.Active), + BanId(src.BanId), + Created(src.Created), + Expires(src.Expires), + IPAddress(src.IPAddress), + MACAddress(src.MACAddress), + PlayFabId(src.PlayFabId), + Reason(src.Reason) + {} + + FBanInfo(const TSharedPtr& obj) : FBanInfo() + { + readFromValue(obj); + } + + ~FBanInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanRequest : public FPlayFabBaseModel + { + // [optional] The duration in hours for the ban. Leave this blank for a permanent ban. + Boxed DurationInHours; + + // [optional] IP address to be banned. May affect multiple players. + FString IPAddress; + + // [optional] MAC address to be banned. May affect multiple players. + FString MACAddress; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] The reason for this ban. Maximum 140 characters. + FString Reason; + + FBanRequest() : + FPlayFabBaseModel(), + DurationInHours(), + IPAddress(), + MACAddress(), + PlayFabId(), + Reason() + {} + + FBanRequest(const FBanRequest& src) : + FPlayFabBaseModel(), + DurationInHours(src.DurationInHours), + IPAddress(src.IPAddress), + MACAddress(src.MACAddress), + PlayFabId(src.PlayFabId), + Reason(src.Reason) + {} + + FBanRequest(const TSharedPtr& obj) : FBanRequest() + { + readFromValue(obj); + } + + ~FBanRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanUsersRequest : public FPlayFabBaseModel + { + // List of ban requests to be applied. Maximum 100. + TArray Bans; + FBanUsersRequest() : + FPlayFabBaseModel(), + Bans() + {} + + FBanUsersRequest(const FBanUsersRequest& src) : + FPlayFabBaseModel(), + Bans(src.Bans) + {} + + FBanUsersRequest(const TSharedPtr& obj) : FBanUsersRequest() + { + readFromValue(obj); + } + + ~FBanUsersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanUsersResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were applied + TArray BanData; + FBanUsersResult() : + FPlayFabBaseModel(), + BanData() + {} + + FBanUsersResult(const FBanUsersResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FBanUsersResult(const TSharedPtr& obj) : FBanUsersResult() + { + readFromValue(obj); + } + + ~FBanUsersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemBundleInfo : public FPlayFabBaseModel + { + // [optional] unique ItemId values for all items which will be added to the player inventory when the bundle is added + TArray BundledItems; + /** + * [optional] unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and + * add the relevant items to the player inventory when the bundle is added) + */ + TArray BundledResultTables; + // [optional] virtual currency types and balances which will be added to the player inventory when the bundle is added + TMap BundledVirtualCurrencies; + FCatalogItemBundleInfo() : + FPlayFabBaseModel(), + BundledItems(), + BundledResultTables(), + BundledVirtualCurrencies() + {} + + FCatalogItemBundleInfo(const FCatalogItemBundleInfo& src) : + FPlayFabBaseModel(), + BundledItems(src.BundledItems), + BundledResultTables(src.BundledResultTables), + BundledVirtualCurrencies(src.BundledVirtualCurrencies) + {} + + FCatalogItemBundleInfo(const TSharedPtr& obj) : FCatalogItemBundleInfo() + { + readFromValue(obj); + } + + ~FCatalogItemBundleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemConsumableInfo : public FPlayFabBaseModel + { + // [optional] number of times this object can be used, after which it will be removed from the player inventory + Boxed UsageCount; + + /** + * [optional] duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed + * (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on + * this item's details have completed) + */ + Boxed UsagePeriod; + + /** + * [optional] all inventory item instances in the player inventory sharing a non-null UsagePeriodGroup have their UsagePeriod values + * added together, and share the result - when that period has elapsed, all the items in the group will be removed + */ + FString UsagePeriodGroup; + + FCatalogItemConsumableInfo() : + FPlayFabBaseModel(), + UsageCount(), + UsagePeriod(), + UsagePeriodGroup() + {} + + FCatalogItemConsumableInfo(const FCatalogItemConsumableInfo& src) : + FPlayFabBaseModel(), + UsageCount(src.UsageCount), + UsagePeriod(src.UsagePeriod), + UsagePeriodGroup(src.UsagePeriodGroup) + {} + + FCatalogItemConsumableInfo(const TSharedPtr& obj) : FCatalogItemConsumableInfo() + { + readFromValue(obj); + } + + ~FCatalogItemConsumableInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemContainerInfo : public FPlayFabBaseModel + { + // [optional] unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked + TArray ItemContents; + /** + * [optional] ItemId for the catalog item used to unlock the container, if any (if not specified, a call to UnlockContainerItem will + * open the container, adding the contents to the player inventory and currency balances) + */ + FString KeyItemId; + + /** + * [optional] unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables + * will be resolved and add the relevant items to the player inventory) + */ + TArray ResultTableContents; + // [optional] virtual currency types and balances which will be added to the player inventory when the container is unlocked + TMap VirtualCurrencyContents; + FCatalogItemContainerInfo() : + FPlayFabBaseModel(), + ItemContents(), + KeyItemId(), + ResultTableContents(), + VirtualCurrencyContents() + {} + + FCatalogItemContainerInfo(const FCatalogItemContainerInfo& src) : + FPlayFabBaseModel(), + ItemContents(src.ItemContents), + KeyItemId(src.KeyItemId), + ResultTableContents(src.ResultTableContents), + VirtualCurrencyContents(src.VirtualCurrencyContents) + {} + + FCatalogItemContainerInfo(const TSharedPtr& obj) : FCatalogItemContainerInfo() + { + readFromValue(obj); + } + + ~FCatalogItemContainerInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItem : public FPlayFabBaseModel + { + /** + * [optional] defines the bundle properties for the item - bundles are items which contain other items, including random drop tables + * and virtual currencies + */ + TSharedPtr Bundle; + + // if true, then an item instance of this type can be used to grant a character to a user. + bool CanBecomeCharacter; + + // [optional] catalog version for this item + FString CatalogVersion; + + // [optional] defines the consumable properties (number of uses, timeout) for the item + TSharedPtr Consumable; + + /** + * [optional] defines the container properties for the item - what items it contains, including random drop tables and virtual + * currencies, and what item (if any) is required to open it via the UnlockContainerItem API + */ + TSharedPtr Container; + + // [optional] game specific custom data + FString CustomData; + + // [optional] text description of item, to show in-game + FString Description; + + // [optional] text name for the item, to show in-game + FString DisplayName; + + /** + * If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited + * edition item, this value determines the total number of instances to allocate for the title. Once this limit has been + * reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of + * false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less + * than zero, it will be ignored. + */ + int32 InitialLimitedEditionCount; + + // BETA: If true, then only a fixed number can ever be granted. + bool IsLimitedEdition; + + /** + * if true, then only one item instance of this type will exist and its remaininguses will be incremented instead. + * RemainingUses will cap out at Int32.Max (2,147,483,647). All subsequent increases will be discarded + */ + bool IsStackable; + + // if true, then an item instance of this type can be traded between players using the trading APIs + bool IsTradable; + + // [optional] class to which the item belongs + FString ItemClass; + + // unique identifier for this item + FString ItemId; + + /** + * [optional] URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP + * URL. + */ + FString ItemImageUrl; + + // [optional] override prices for this item for specific currencies + TMap RealCurrencyPrices; + // [optional] list of item tags + TArray Tags; + // [optional] price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + TMap VirtualCurrencyPrices; + FCatalogItem() : + FPlayFabBaseModel(), + Bundle(nullptr), + CanBecomeCharacter(false), + CatalogVersion(), + Consumable(nullptr), + Container(nullptr), + CustomData(), + Description(), + DisplayName(), + InitialLimitedEditionCount(0), + IsLimitedEdition(false), + IsStackable(false), + IsTradable(false), + ItemClass(), + ItemId(), + ItemImageUrl(), + RealCurrencyPrices(), + Tags(), + VirtualCurrencyPrices() + {} + + FCatalogItem(const FCatalogItem& src) : + FPlayFabBaseModel(), + Bundle(src.Bundle.IsValid() ? MakeShareable(new FCatalogItemBundleInfo(*src.Bundle)) : nullptr), + CanBecomeCharacter(src.CanBecomeCharacter), + CatalogVersion(src.CatalogVersion), + Consumable(src.Consumable.IsValid() ? MakeShareable(new FCatalogItemConsumableInfo(*src.Consumable)) : nullptr), + Container(src.Container.IsValid() ? MakeShareable(new FCatalogItemContainerInfo(*src.Container)) : nullptr), + CustomData(src.CustomData), + Description(src.Description), + DisplayName(src.DisplayName), + InitialLimitedEditionCount(src.InitialLimitedEditionCount), + IsLimitedEdition(src.IsLimitedEdition), + IsStackable(src.IsStackable), + IsTradable(src.IsTradable), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemImageUrl(src.ItemImageUrl), + RealCurrencyPrices(src.RealCurrencyPrices), + Tags(src.Tags), + VirtualCurrencyPrices(src.VirtualCurrencyPrices) + {} + + FCatalogItem(const TSharedPtr& obj) : FCatalogItem() + { + readFromValue(obj); + } + + ~FCatalogItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemInstance : public FPlayFabBaseModel + { + // [optional] Game specific comment associated with this instance when it was added to the user inventory. + FString Annotation; + + // [optional] Array of unique items that were awarded when this catalog item was purchased. + TArray BundleContents; + /** + * [optional] Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or + * container. + */ + FString BundleParent; + + // [optional] Catalog version for the inventory item, when this instance was created. + FString CatalogVersion; + + // [optional] A set of custom key-value pairs on the inventory item. + TMap CustomData; + // [optional] CatalogItem.DisplayName at the time this item was purchased. + FString DisplayName; + + // [optional] Timestamp for when this instance will expire. + Boxed Expiration; + + // [optional] Class name for the inventory item, as defined in the catalog. + FString ItemClass; + + // [optional] Unique identifier for the inventory item, as defined in the catalog. + FString ItemId; + + // [optional] Unique item identifier for this specific instance of the item. + FString ItemInstanceId; + + // [optional] Timestamp for when this instance was purchased. + Boxed PurchaseDate; + + // [optional] Total number of remaining uses, if this is a consumable item. + Boxed RemainingUses; + + // [optional] Currency type for the cost of the catalog item. + FString UnitCurrency; + + // Cost of the catalog item in the given currency. + uint32 UnitPrice; + + // [optional] The number of uses that were added or removed to this item in this call. + Boxed UsesIncrementedBy; + + FItemInstance() : + FPlayFabBaseModel(), + Annotation(), + BundleContents(), + BundleParent(), + CatalogVersion(), + CustomData(), + DisplayName(), + Expiration(), + ItemClass(), + ItemId(), + ItemInstanceId(), + PurchaseDate(), + RemainingUses(), + UnitCurrency(), + UnitPrice(0), + UsesIncrementedBy() + {} + + FItemInstance(const FItemInstance& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + BundleContents(src.BundleContents), + BundleParent(src.BundleParent), + CatalogVersion(src.CatalogVersion), + CustomData(src.CustomData), + DisplayName(src.DisplayName), + Expiration(src.Expiration), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + PurchaseDate(src.PurchaseDate), + RemainingUses(src.RemainingUses), + UnitCurrency(src.UnitCurrency), + UnitPrice(src.UnitPrice), + UsesIncrementedBy(src.UsesIncrementedBy) + {} + + FItemInstance(const TSharedPtr& obj) : FItemInstance() + { + readFromValue(obj); + } + + ~FItemInstance(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCharacterInventory : public FPlayFabBaseModel + { + // [optional] The id of this character. + FString CharacterId; + + // [optional] The inventory of this character. + TArray Inventory; + FCharacterInventory() : + FPlayFabBaseModel(), + CharacterId(), + Inventory() + {} + + FCharacterInventory(const FCharacterInventory& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Inventory(src.Inventory) + {} + + FCharacterInventory(const TSharedPtr& obj) : FCharacterInventory() + { + readFromValue(obj); + } + + ~FCharacterInventory(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCharacterLeaderboardEntry : public FPlayFabBaseModel + { + // [optional] PlayFab unique identifier of the character that belongs to the user for this leaderboard entry. + FString CharacterId; + + // [optional] Title-specific display name of the character for this leaderboard entry. + FString CharacterName; + + // [optional] Name of the character class for this entry. + FString CharacterType; + + // [optional] Title-specific display name of the user for this leaderboard entry. + FString DisplayName; + + // [optional] PlayFab unique identifier of the user for this leaderboard entry. + FString PlayFabId; + + // User's overall position in the leaderboard. + int32 Position; + + // Specific value of the user's statistic. + int32 StatValue; + + FCharacterLeaderboardEntry() : + FPlayFabBaseModel(), + CharacterId(), + CharacterName(), + CharacterType(), + DisplayName(), + PlayFabId(), + Position(0), + StatValue(0) + {} + + FCharacterLeaderboardEntry(const FCharacterLeaderboardEntry& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterName(src.CharacterName), + CharacterType(src.CharacterType), + DisplayName(src.DisplayName), + PlayFabId(src.PlayFabId), + Position(src.Position), + StatValue(src.StatValue) + {} + + FCharacterLeaderboardEntry(const TSharedPtr& obj) : FCharacterLeaderboardEntry() + { + readFromValue(obj); + } + + ~FCharacterLeaderboardEntry(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCharacterResult : public FPlayFabBaseModel + { + // [optional] The id for this character on this player. + FString CharacterId; + + // [optional] The name of this character. + FString CharacterName; + + // [optional] The type-string that was given to this character on creation. + FString CharacterType; + + FCharacterResult() : + FPlayFabBaseModel(), + CharacterId(), + CharacterName(), + CharacterType() + {} + + FCharacterResult(const FCharacterResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterName(src.CharacterName), + CharacterType(src.CharacterType) + {} + + FCharacterResult(const TSharedPtr& obj) : FCharacterResult() + { + readFromValue(obj); + } + + ~FCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum CloudScriptRevisionOption + { + CloudScriptRevisionOptionLive, + CloudScriptRevisionOptionLatest, + CloudScriptRevisionOptionSpecific + }; + + PLAYFABCPP_API void writeCloudScriptRevisionOptionEnumJSON(CloudScriptRevisionOption enumVal, JsonWriter& writer); + PLAYFABCPP_API CloudScriptRevisionOption readCloudScriptRevisionOptionFromValue(const TSharedPtr& value); + PLAYFABCPP_API CloudScriptRevisionOption readCloudScriptRevisionOptionFromValue(const FString& value); + + struct PLAYFABCPP_API FConsumeItemRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Number of uses to consume from the item. + int32 ConsumeCount; + + // Unique instance identifier of the item to be consumed. + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FConsumeItemRequest() : + FPlayFabBaseModel(), + CharacterId(), + ConsumeCount(0), + ItemInstanceId(), + PlayFabId() + {} + + FConsumeItemRequest(const FConsumeItemRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ConsumeCount(src.ConsumeCount), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FConsumeItemRequest(const TSharedPtr& obj) : FConsumeItemRequest() + { + readFromValue(obj); + } + + ~FConsumeItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConsumeItemResult : public FPlayFabBaseModel + { + // [optional] Unique instance identifier of the item with uses consumed. + FString ItemInstanceId; + + // Number of uses remaining on the item. + int32 RemainingUses; + + FConsumeItemResult() : + FPlayFabBaseModel(), + ItemInstanceId(), + RemainingUses(0) + {} + + FConsumeItemResult(const FConsumeItemResult& src) : + FPlayFabBaseModel(), + ItemInstanceId(src.ItemInstanceId), + RemainingUses(src.RemainingUses) + {} + + FConsumeItemResult(const TSharedPtr& obj) : FConsumeItemResult() + { + readFromValue(obj); + } + + ~FConsumeItemResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum EmailVerificationStatus + { + EmailVerificationStatusUnverified, + EmailVerificationStatusPending, + EmailVerificationStatusConfirmed + }; + + PLAYFABCPP_API void writeEmailVerificationStatusEnumJSON(EmailVerificationStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API EmailVerificationStatus readEmailVerificationStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API EmailVerificationStatus readEmailVerificationStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FContactEmailInfo : public FPlayFabBaseModel + { + // [optional] The email address + FString EmailAddress; + + // [optional] The name of the email info data + FString Name; + + // [optional] The verification status of the email + Boxed VerificationStatus; + + FContactEmailInfo() : + FPlayFabBaseModel(), + EmailAddress(), + Name(), + VerificationStatus() + {} + + FContactEmailInfo(const FContactEmailInfo& src) : + FPlayFabBaseModel(), + EmailAddress(src.EmailAddress), + Name(src.Name), + VerificationStatus(src.VerificationStatus) + {} + + FContactEmailInfo(const TSharedPtr& obj) : FContactEmailInfo() + { + readFromValue(obj); + } + + ~FContactEmailInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FContactEmailInfoModel : public FPlayFabBaseModel + { + // [optional] The email address + FString EmailAddress; + + // [optional] The name of the email info data + FString Name; + + // [optional] The verification status of the email + Boxed VerificationStatus; + + FContactEmailInfoModel() : + FPlayFabBaseModel(), + EmailAddress(), + Name(), + VerificationStatus() + {} + + FContactEmailInfoModel(const FContactEmailInfoModel& src) : + FPlayFabBaseModel(), + EmailAddress(src.EmailAddress), + Name(src.Name), + VerificationStatus(src.VerificationStatus) + {} + + FContactEmailInfoModel(const TSharedPtr& obj) : FContactEmailInfoModel() + { + readFromValue(obj); + } + + ~FContactEmailInfoModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ContinentCode + { + ContinentCodeAF, + ContinentCodeAN, + ContinentCodeAS, + ContinentCodeEU, + ContinentCodeNA, + ContinentCodeOC, + ContinentCodeSA + }; + + PLAYFABCPP_API void writeContinentCodeEnumJSON(ContinentCode enumVal, JsonWriter& writer); + PLAYFABCPP_API ContinentCode readContinentCodeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ContinentCode readContinentCodeFromValue(const FString& value); + + enum CountryCode + { + CountryCodeAF, + CountryCodeAX, + CountryCodeAL, + CountryCodeDZ, + CountryCodeAS, + CountryCodeAD, + CountryCodeAO, + CountryCodeAI, + CountryCodeAQ, + CountryCodeAG, + CountryCodeAR, + CountryCodeAM, + CountryCodeAW, + CountryCodeAU, + CountryCodeAT, + CountryCodeAZ, + CountryCodeBS, + CountryCodeBH, + CountryCodeBD, + CountryCodeBB, + CountryCodeBY, + CountryCodeBE, + CountryCodeBZ, + CountryCodeBJ, + CountryCodeBM, + CountryCodeBT, + CountryCodeBO, + CountryCodeBQ, + CountryCodeBA, + CountryCodeBW, + CountryCodeBV, + CountryCodeBR, + CountryCodeIO, + CountryCodeBN, + CountryCodeBG, + CountryCodeBF, + CountryCodeBI, + CountryCodeKH, + CountryCodeCM, + CountryCodeCA, + CountryCodeCV, + CountryCodeKY, + CountryCodeCF, + CountryCodeTD, + CountryCodeCL, + CountryCodeCN, + CountryCodeCX, + CountryCodeCC, + CountryCodeCO, + CountryCodeKM, + CountryCodeCG, + CountryCodeCD, + CountryCodeCK, + CountryCodeCR, + CountryCodeCI, + CountryCodeHR, + CountryCodeCU, + CountryCodeCW, + CountryCodeCY, + CountryCodeCZ, + CountryCodeDK, + CountryCodeDJ, + CountryCodeDM, + CountryCodeDO, + CountryCodeEC, + CountryCodeEG, + CountryCodeSV, + CountryCodeGQ, + CountryCodeER, + CountryCodeEE, + CountryCodeET, + CountryCodeFK, + CountryCodeFO, + CountryCodeFJ, + CountryCodeFI, + CountryCodeFR, + CountryCodeGF, + CountryCodePF, + CountryCodeTF, + CountryCodeGA, + CountryCodeGM, + CountryCodeGE, + CountryCodeDE, + CountryCodeGH, + CountryCodeGI, + CountryCodeGR, + CountryCodeGL, + CountryCodeGD, + CountryCodeGP, + CountryCodeGU, + CountryCodeGT, + CountryCodeGG, + CountryCodeGN, + CountryCodeGW, + CountryCodeGY, + CountryCodeHT, + CountryCodeHM, + CountryCodeVA, + CountryCodeHN, + CountryCodeHK, + CountryCodeHU, + CountryCodeIS, + CountryCodeIN, + CountryCodeID, + CountryCodeIR, + CountryCodeIQ, + CountryCodeIE, + CountryCodeIM, + CountryCodeIL, + CountryCodeIT, + CountryCodeJM, + CountryCodeJP, + CountryCodeJE, + CountryCodeJO, + CountryCodeKZ, + CountryCodeKE, + CountryCodeKI, + CountryCodeKP, + CountryCodeKR, + CountryCodeKW, + CountryCodeKG, + CountryCodeLA, + CountryCodeLV, + CountryCodeLB, + CountryCodeLS, + CountryCodeLR, + CountryCodeLY, + CountryCodeLI, + CountryCodeLT, + CountryCodeLU, + CountryCodeMO, + CountryCodeMK, + CountryCodeMG, + CountryCodeMW, + CountryCodeMY, + CountryCodeMV, + CountryCodeML, + CountryCodeMT, + CountryCodeMH, + CountryCodeMQ, + CountryCodeMR, + CountryCodeMU, + CountryCodeYT, + CountryCodeMX, + CountryCodeFM, + CountryCodeMD, + CountryCodeMC, + CountryCodeMN, + CountryCodeME, + CountryCodeMS, + CountryCodeMA, + CountryCodeMZ, + CountryCodeMM, + CountryCodeNA, + CountryCodeNR, + CountryCodeNP, + CountryCodeNL, + CountryCodeNC, + CountryCodeNZ, + CountryCodeNI, + CountryCodeNE, + CountryCodeNG, + CountryCodeNU, + CountryCodeNF, + CountryCodeMP, + CountryCodeNO, + CountryCodeOM, + CountryCodePK, + CountryCodePW, + CountryCodePS, + CountryCodePA, + CountryCodePG, + CountryCodePY, + CountryCodePE, + CountryCodePH, + CountryCodePN, + CountryCodePL, + CountryCodePT, + CountryCodePR, + CountryCodeQA, + CountryCodeRE, + CountryCodeRO, + CountryCodeRU, + CountryCodeRW, + CountryCodeBL, + CountryCodeSH, + CountryCodeKN, + CountryCodeLC, + CountryCodeMF, + CountryCodePM, + CountryCodeVC, + CountryCodeWS, + CountryCodeSM, + CountryCodeST, + CountryCodeSA, + CountryCodeSN, + CountryCodeRS, + CountryCodeSC, + CountryCodeSL, + CountryCodeSG, + CountryCodeSX, + CountryCodeSK, + CountryCodeSI, + CountryCodeSB, + CountryCodeSO, + CountryCodeZA, + CountryCodeGS, + CountryCodeSS, + CountryCodeES, + CountryCodeLK, + CountryCodeSD, + CountryCodeSR, + CountryCodeSJ, + CountryCodeSZ, + CountryCodeSE, + CountryCodeCH, + CountryCodeSY, + CountryCodeTW, + CountryCodeTJ, + CountryCodeTZ, + CountryCodeTH, + CountryCodeTL, + CountryCodeTG, + CountryCodeTK, + CountryCodeTO, + CountryCodeTT, + CountryCodeTN, + CountryCodeTR, + CountryCodeTM, + CountryCodeTC, + CountryCodeTV, + CountryCodeUG, + CountryCodeUA, + CountryCodeAE, + CountryCodeGB, + CountryCodeUS, + CountryCodeUM, + CountryCodeUY, + CountryCodeUZ, + CountryCodeVU, + CountryCodeVE, + CountryCodeVN, + CountryCodeVG, + CountryCodeVI, + CountryCodeWF, + CountryCodeEH, + CountryCodeYE, + CountryCodeZM, + CountryCodeZW + }; + + PLAYFABCPP_API void writeCountryCodeEnumJSON(CountryCode enumVal, JsonWriter& writer); + PLAYFABCPP_API CountryCode readCountryCodeFromValue(const TSharedPtr& value); + PLAYFABCPP_API CountryCode readCountryCodeFromValue(const FString& value); + + struct PLAYFABCPP_API FCreateSharedGroupRequest : public FPlayFabBaseModel + { + // [optional] Unique identifier for the shared group (a random identifier will be assigned, if one is not specified). + FString SharedGroupId; + + FCreateSharedGroupRequest() : + FPlayFabBaseModel(), + SharedGroupId() + {} + + FCreateSharedGroupRequest(const FCreateSharedGroupRequest& src) : + FPlayFabBaseModel(), + SharedGroupId(src.SharedGroupId) + {} + + FCreateSharedGroupRequest(const TSharedPtr& obj) : FCreateSharedGroupRequest() + { + readFromValue(obj); + } + + ~FCreateSharedGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateSharedGroupResult : public FPlayFabBaseModel + { + // [optional] Unique identifier for the shared group. + FString SharedGroupId; + + FCreateSharedGroupResult() : + FPlayFabBaseModel(), + SharedGroupId() + {} + + FCreateSharedGroupResult(const FCreateSharedGroupResult& src) : + FPlayFabBaseModel(), + SharedGroupId(src.SharedGroupId) + {} + + FCreateSharedGroupResult(const TSharedPtr& obj) : FCreateSharedGroupResult() + { + readFromValue(obj); + } + + ~FCreateSharedGroupResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteCharacterFromUserRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * If true, the character's inventory will be transferred up to the owning user; otherwise, this request will purge those + * items. + */ + bool SaveCharacterInventory; + + FDeleteCharacterFromUserRequest() : + FPlayFabBaseModel(), + CharacterId(), + PlayFabId(), + SaveCharacterInventory(false) + {} + + FDeleteCharacterFromUserRequest(const FDeleteCharacterFromUserRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + PlayFabId(src.PlayFabId), + SaveCharacterInventory(src.SaveCharacterInventory) + {} + + FDeleteCharacterFromUserRequest(const TSharedPtr& obj) : FDeleteCharacterFromUserRequest() + { + readFromValue(obj); + } + + ~FDeleteCharacterFromUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteCharacterFromUserResult : public FPlayFabBaseModel + { + FDeleteCharacterFromUserResult() : + FPlayFabBaseModel() + {} + + FDeleteCharacterFromUserResult(const FDeleteCharacterFromUserResult& src) : + FPlayFabBaseModel() + {} + + FDeleteCharacterFromUserResult(const TSharedPtr& obj) : FDeleteCharacterFromUserResult() + { + readFromValue(obj); + } + + ~FDeleteCharacterFromUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteSharedGroupRequest : public FPlayFabBaseModel + { + // Unique identifier for the shared group. + FString SharedGroupId; + + FDeleteSharedGroupRequest() : + FPlayFabBaseModel(), + SharedGroupId() + {} + + FDeleteSharedGroupRequest(const FDeleteSharedGroupRequest& src) : + FPlayFabBaseModel(), + SharedGroupId(src.SharedGroupId) + {} + + FDeleteSharedGroupRequest(const TSharedPtr& obj) : FDeleteSharedGroupRequest() + { + readFromValue(obj); + } + + ~FDeleteSharedGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteUsersRequest : public FPlayFabBaseModel + { + // An array of unique PlayFab assigned ID of the user on whom the operation will be performed. + TArray PlayFabIds; + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FDeleteUsersRequest() : + FPlayFabBaseModel(), + PlayFabIds(), + TitleId() + {} + + FDeleteUsersRequest(const FDeleteUsersRequest& src) : + FPlayFabBaseModel(), + PlayFabIds(src.PlayFabIds), + TitleId(src.TitleId) + {} + + FDeleteUsersRequest(const TSharedPtr& obj) : FDeleteUsersRequest() + { + readFromValue(obj); + } + + ~FDeleteUsersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteUsersResult : public FPlayFabBaseModel + { + FDeleteUsersResult() : + FPlayFabBaseModel() + {} + + FDeleteUsersResult(const FDeleteUsersResult& src) : + FPlayFabBaseModel() + {} + + FDeleteUsersResult(const TSharedPtr& obj) : FDeleteUsersResult() + { + readFromValue(obj); + } + + ~FDeleteUsersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeregisterGameRequest : public FPlayFabBaseModel + { + // Unique identifier for the Game Server Instance that is being deregistered. + FString LobbyId; + + FDeregisterGameRequest() : + FPlayFabBaseModel(), + LobbyId() + {} + + FDeregisterGameRequest(const FDeregisterGameRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId) + {} + + FDeregisterGameRequest(const TSharedPtr& obj) : FDeregisterGameRequest() + { + readFromValue(obj); + } + + ~FDeregisterGameRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeregisterGameResponse : public FPlayFabBaseModel + { + FDeregisterGameResponse() : + FPlayFabBaseModel() + {} + + FDeregisterGameResponse(const FDeregisterGameResponse& src) : + FPlayFabBaseModel() + {} + + FDeregisterGameResponse(const TSharedPtr& obj) : FDeregisterGameResponse() + { + readFromValue(obj); + } + + ~FDeregisterGameResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEmptyResponse : public FPlayFabBaseModel + { + FEmptyResponse() : + FPlayFabBaseModel() + {} + + FEmptyResponse(const FEmptyResponse& src) : + FPlayFabBaseModel() + {} + + FEmptyResponse(const TSharedPtr& obj) : FEmptyResponse() + { + readFromValue(obj); + } + + ~FEmptyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEvaluateRandomResultTableRequest : public FPlayFabBaseModel + { + /** + * [optional] Specifies the catalog version that should be used to evaluate the Random Result Table. If unspecified, uses + * default/primary catalog. + */ + FString CatalogVersion; + + // The unique identifier of the Random Result Table to use. + FString TableId; + + FEvaluateRandomResultTableRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + TableId() + {} + + FEvaluateRandomResultTableRequest(const FEvaluateRandomResultTableRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + TableId(src.TableId) + {} + + FEvaluateRandomResultTableRequest(const TSharedPtr& obj) : FEvaluateRandomResultTableRequest() + { + readFromValue(obj); + } + + ~FEvaluateRandomResultTableRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEvaluateRandomResultTableResult : public FPlayFabBaseModel + { + // [optional] Unique identifier for the item returned from the Random Result Table evaluation, for the given catalog. + FString ResultItemId; + + FEvaluateRandomResultTableResult() : + FPlayFabBaseModel(), + ResultItemId() + {} + + FEvaluateRandomResultTableResult(const FEvaluateRandomResultTableResult& src) : + FPlayFabBaseModel(), + ResultItemId(src.ResultItemId) + {} + + FEvaluateRandomResultTableResult(const TSharedPtr& obj) : FEvaluateRandomResultTableResult() + { + readFromValue(obj); + } + + ~FEvaluateRandomResultTableResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FScriptExecutionError : public FPlayFabBaseModel + { + /** + * [optional] Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, + * CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError + */ + FString Error; + + // [optional] Details about the error + FString Message; + + // [optional] Point during the execution of the script at which the error occurred, if any + FString StackTrace; + + FScriptExecutionError() : + FPlayFabBaseModel(), + Error(), + Message(), + StackTrace() + {} + + FScriptExecutionError(const FScriptExecutionError& src) : + FPlayFabBaseModel(), + Error(src.Error), + Message(src.Message), + StackTrace(src.StackTrace) + {} + + FScriptExecutionError(const TSharedPtr& obj) : FScriptExecutionError() + { + readFromValue(obj); + } + + ~FScriptExecutionError(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLogStatement : public FPlayFabBaseModel + { + // [optional] Optional object accompanying the message as contextual information + FJsonKeeper Data; + + // [optional] 'Debug', 'Info', or 'Error' + FString Level; + + // [optional] undefined + FString Message; + + FLogStatement() : + FPlayFabBaseModel(), + Data(), + Level(), + Message() + {} + + FLogStatement(const FLogStatement& src) : + FPlayFabBaseModel(), + Data(src.Data), + Level(src.Level), + Message(src.Message) + {} + + FLogStatement(const TSharedPtr& obj) : FLogStatement() + { + readFromValue(obj); + } + + ~FLogStatement(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteCloudScriptResult : public FPlayFabBaseModel + { + // Number of PlayFab API requests issued by the CloudScript function + int32 APIRequestsIssued; + + // [optional] Information about the error, if any, that occurred during execution + TSharedPtr Error; + + double ExecutionTimeSeconds; + + // [optional] The name of the function that executed + FString FunctionName; + + // [optional] The object returned from the CloudScript function, if any + FJsonKeeper FunctionResult; + + /** + * [optional] Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + Boxed FunctionResultTooLarge; + + // Number of external HTTP requests issued by the CloudScript function + int32 HttpRequestsIssued; + + /** + * [optional] Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + TArray Logs; + /** + * [optional] Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + Boxed LogsTooLarge; + + uint32 MemoryConsumedBytes; + + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + double ProcessorTimeSeconds; + + // The revision of the CloudScript that executed + int32 Revision; + + FExecuteCloudScriptResult() : + FPlayFabBaseModel(), + APIRequestsIssued(0), + Error(nullptr), + ExecutionTimeSeconds(0), + FunctionName(), + FunctionResult(), + FunctionResultTooLarge(), + HttpRequestsIssued(0), + Logs(), + LogsTooLarge(), + MemoryConsumedBytes(0), + ProcessorTimeSeconds(0), + Revision(0) + {} + + FExecuteCloudScriptResult(const FExecuteCloudScriptResult& src) : + FPlayFabBaseModel(), + APIRequestsIssued(src.APIRequestsIssued), + Error(src.Error.IsValid() ? MakeShareable(new FScriptExecutionError(*src.Error)) : nullptr), + ExecutionTimeSeconds(src.ExecutionTimeSeconds), + FunctionName(src.FunctionName), + FunctionResult(src.FunctionResult), + FunctionResultTooLarge(src.FunctionResultTooLarge), + HttpRequestsIssued(src.HttpRequestsIssued), + Logs(src.Logs), + LogsTooLarge(src.LogsTooLarge), + MemoryConsumedBytes(src.MemoryConsumedBytes), + ProcessorTimeSeconds(src.ProcessorTimeSeconds), + Revision(src.Revision) + {} + + FExecuteCloudScriptResult(const TSharedPtr& obj) : FExecuteCloudScriptResult() + { + readFromValue(obj); + } + + ~FExecuteCloudScriptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteCloudScriptServerRequest : public FPlayFabBaseModel + { + // The name of the CloudScript function to execute + FString FunctionName; + + // [optional] Object that is passed in to the function as the first argument + FJsonKeeper FunctionParameter; + + /** + * [optional] Generate a 'player_executed_cloudscript' PlayStream event containing the results of the function execution and other + * contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. + */ + Boxed GeneratePlayStreamEvent; + + // The unique user identifier for the player on whose behalf the script is being run + FString PlayFabId; + + /** + * [optional] Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' + * executes the current live, published revision, and 'Specific' executes the specified revision. The default value is + * 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. + */ + Boxed RevisionSelection; + + // [optional] The specivic revision to execute, when RevisionSelection is set to 'Specific' + Boxed SpecificRevision; + + FExecuteCloudScriptServerRequest() : + FPlayFabBaseModel(), + FunctionName(), + FunctionParameter(), + GeneratePlayStreamEvent(), + PlayFabId(), + RevisionSelection(), + SpecificRevision() + {} + + FExecuteCloudScriptServerRequest(const FExecuteCloudScriptServerRequest& src) : + FPlayFabBaseModel(), + FunctionName(src.FunctionName), + FunctionParameter(src.FunctionParameter), + GeneratePlayStreamEvent(src.GeneratePlayStreamEvent), + PlayFabId(src.PlayFabId), + RevisionSelection(src.RevisionSelection), + SpecificRevision(src.SpecificRevision) + {} + + FExecuteCloudScriptServerRequest(const TSharedPtr& obj) : FExecuteCloudScriptServerRequest() + { + readFromValue(obj); + } + + ~FExecuteCloudScriptServerRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFacebookInstantGamesPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Facebook Instant Games identifier for a user. + FString FacebookInstantGamesId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Facebook Instant Games identifier. + FString PlayFabId; + + FFacebookInstantGamesPlayFabIdPair() : + FPlayFabBaseModel(), + FacebookInstantGamesId(), + PlayFabId() + {} + + FFacebookInstantGamesPlayFabIdPair(const FFacebookInstantGamesPlayFabIdPair& src) : + FPlayFabBaseModel(), + FacebookInstantGamesId(src.FacebookInstantGamesId), + PlayFabId(src.PlayFabId) + {} + + FFacebookInstantGamesPlayFabIdPair(const TSharedPtr& obj) : FFacebookInstantGamesPlayFabIdPair() + { + readFromValue(obj); + } + + ~FFacebookInstantGamesPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFacebookPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Facebook identifier for a user. + FString FacebookId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Facebook identifier. + FString PlayFabId; + + FFacebookPlayFabIdPair() : + FPlayFabBaseModel(), + FacebookId(), + PlayFabId() + {} + + FFacebookPlayFabIdPair(const FFacebookPlayFabIdPair& src) : + FPlayFabBaseModel(), + FacebookId(src.FacebookId), + PlayFabId(src.PlayFabId) + {} + + FFacebookPlayFabIdPair(const TSharedPtr& obj) : FFacebookPlayFabIdPair() + { + readFromValue(obj); + } + + ~FFacebookPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum LoginIdentityProvider + { + LoginIdentityProviderUnknown, + LoginIdentityProviderPlayFab, + LoginIdentityProviderCustom, + LoginIdentityProviderGameCenter, + LoginIdentityProviderGooglePlay, + LoginIdentityProviderSteam, + LoginIdentityProviderXBoxLive, + LoginIdentityProviderPSN, + LoginIdentityProviderKongregate, + LoginIdentityProviderFacebook, + LoginIdentityProviderIOSDevice, + LoginIdentityProviderAndroidDevice, + LoginIdentityProviderTwitch, + LoginIdentityProviderWindowsHello, + LoginIdentityProviderGameServer, + LoginIdentityProviderCustomServer, + LoginIdentityProviderNintendoSwitch, + LoginIdentityProviderFacebookInstantGames, + LoginIdentityProviderOpenIdConnect + }; + + PLAYFABCPP_API void writeLoginIdentityProviderEnumJSON(LoginIdentityProvider enumVal, JsonWriter& writer); + PLAYFABCPP_API LoginIdentityProvider readLoginIdentityProviderFromValue(const TSharedPtr& value); + PLAYFABCPP_API LoginIdentityProvider readLoginIdentityProviderFromValue(const FString& value); + + struct PLAYFABCPP_API FLinkedPlatformAccountModel : public FPlayFabBaseModel + { + // [optional] Linked account email of the user on the platform, if available + FString Email; + + // [optional] Authentication platform + Boxed Platform; + + // [optional] Unique account identifier of the user on the platform + FString PlatformUserId; + + // [optional] Linked account username of the user on the platform, if available + FString Username; + + FLinkedPlatformAccountModel() : + FPlayFabBaseModel(), + Email(), + Platform(), + PlatformUserId(), + Username() + {} + + FLinkedPlatformAccountModel(const FLinkedPlatformAccountModel& src) : + FPlayFabBaseModel(), + Email(src.Email), + Platform(src.Platform), + PlatformUserId(src.PlatformUserId), + Username(src.Username) + {} + + FLinkedPlatformAccountModel(const TSharedPtr& obj) : FLinkedPlatformAccountModel() + { + readFromValue(obj); + } + + ~FLinkedPlatformAccountModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLocationModel : public FPlayFabBaseModel + { + // [optional] City name. + FString City; + + // [optional] The two-character continent code for this location + Boxed pfContinentCode; + + // [optional] The two-character ISO 3166-1 country code for the country associated with the location + Boxed pfCountryCode; + + // [optional] Latitude coordinate of the geographic location. + Boxed Latitude; + + // [optional] Longitude coordinate of the geographic location. + Boxed Longitude; + + FLocationModel() : + FPlayFabBaseModel(), + City(), + pfContinentCode(), + pfCountryCode(), + Latitude(), + Longitude() + {} + + FLocationModel(const FLocationModel& src) : + FPlayFabBaseModel(), + City(src.City), + pfContinentCode(src.pfContinentCode), + pfCountryCode(src.pfCountryCode), + Latitude(src.Latitude), + Longitude(src.Longitude) + {} + + FLocationModel(const TSharedPtr& obj) : FLocationModel() + { + readFromValue(obj); + } + + ~FLocationModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum SubscriptionProviderStatus + { + SubscriptionProviderStatusNoError, + SubscriptionProviderStatusCancelled, + SubscriptionProviderStatusUnknownError, + SubscriptionProviderStatusBillingError, + SubscriptionProviderStatusProductUnavailable, + SubscriptionProviderStatusCustomerDidNotAcceptPriceChange, + SubscriptionProviderStatusFreeTrial, + SubscriptionProviderStatusPaymentPending + }; + + PLAYFABCPP_API void writeSubscriptionProviderStatusEnumJSON(SubscriptionProviderStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API SubscriptionProviderStatus readSubscriptionProviderStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API SubscriptionProviderStatus readSubscriptionProviderStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FSubscriptionModel : public FPlayFabBaseModel + { + // When this subscription expires. + FDateTime Expiration; + + // The time the subscription was orignially purchased + FDateTime InitialSubscriptionTime; + + // Whether this subscription is currently active. That is, if Expiration > now. + bool IsActive; + + // [optional] The status of this subscription, according to the subscription provider. + Boxed Status; + + // [optional] The id for this subscription + FString SubscriptionId; + + // [optional] The item id for this subscription from the primary catalog + FString SubscriptionItemId; + + // [optional] The provider for this subscription. Apple or Google Play are supported today. + FString SubscriptionProvider; + + FSubscriptionModel() : + FPlayFabBaseModel(), + Expiration(0), + InitialSubscriptionTime(0), + IsActive(false), + Status(), + SubscriptionId(), + SubscriptionItemId(), + SubscriptionProvider() + {} + + FSubscriptionModel(const FSubscriptionModel& src) : + FPlayFabBaseModel(), + Expiration(src.Expiration), + InitialSubscriptionTime(src.InitialSubscriptionTime), + IsActive(src.IsActive), + Status(src.Status), + SubscriptionId(src.SubscriptionId), + SubscriptionItemId(src.SubscriptionItemId), + SubscriptionProvider(src.SubscriptionProvider) + {} + + FSubscriptionModel(const TSharedPtr& obj) : FSubscriptionModel() + { + readFromValue(obj); + } + + ~FSubscriptionModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMembershipModel : public FPlayFabBaseModel + { + // Whether this membership is active. That is, whether the MembershipExpiration time has been reached. + bool IsActive; + + // The time this membership expires + FDateTime MembershipExpiration; + + // [optional] The id of the membership + FString MembershipId; + + /** + * [optional] Membership expirations can be explicitly overridden (via game manager or the admin api). If this membership has been + * overridden, this will be the new expiration time. + */ + Boxed OverrideExpiration; + + // [optional] Whether the override expiration is set. + Boxed OverrideIsSet; + + // [optional] The list of subscriptions that this player has for this membership + TArray Subscriptions; + FMembershipModel() : + FPlayFabBaseModel(), + IsActive(false), + MembershipExpiration(0), + MembershipId(), + OverrideExpiration(), + OverrideIsSet(), + Subscriptions() + {} + + FMembershipModel(const FMembershipModel& src) : + FPlayFabBaseModel(), + IsActive(src.IsActive), + MembershipExpiration(src.MembershipExpiration), + MembershipId(src.MembershipId), + OverrideExpiration(src.OverrideExpiration), + OverrideIsSet(src.OverrideIsSet), + Subscriptions(src.Subscriptions) + {} + + FMembershipModel(const TSharedPtr& obj) : FMembershipModel() + { + readFromValue(obj); + } + + ~FMembershipModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPushNotificationRegistrationModel : public FPlayFabBaseModel + { + // [optional] Notification configured endpoint + FString NotificationEndpointARN; + + // [optional] Push notification platform + Boxed Platform; + + FPushNotificationRegistrationModel() : + FPlayFabBaseModel(), + NotificationEndpointARN(), + Platform() + {} + + FPushNotificationRegistrationModel(const FPushNotificationRegistrationModel& src) : + FPlayFabBaseModel(), + NotificationEndpointARN(src.NotificationEndpointARN), + Platform(src.Platform) + {} + + FPushNotificationRegistrationModel(const TSharedPtr& obj) : FPushNotificationRegistrationModel() + { + readFromValue(obj); + } + + ~FPushNotificationRegistrationModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticModel : public FPlayFabBaseModel + { + // [optional] Statistic name + FString Name; + + // Statistic value + int32 Value; + + // Statistic version (0 if not a versioned statistic) + int32 Version; + + FStatisticModel() : + FPlayFabBaseModel(), + Name(), + Value(0), + Version(0) + {} + + FStatisticModel(const FStatisticModel& src) : + FPlayFabBaseModel(), + Name(src.Name), + Value(src.Value), + Version(src.Version) + {} + + FStatisticModel(const TSharedPtr& obj) : FStatisticModel() + { + readFromValue(obj); + } + + ~FStatisticModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FTagModel : public FPlayFabBaseModel + { + // [optional] Full value of the tag, including namespace + FString TagValue; + + FTagModel() : + FPlayFabBaseModel(), + TagValue() + {} + + FTagModel(const FTagModel& src) : + FPlayFabBaseModel(), + TagValue(src.TagValue) + {} + + FTagModel(const TSharedPtr& obj) : FTagModel() + { + readFromValue(obj); + } + + ~FTagModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValueToDateModel : public FPlayFabBaseModel + { + // [optional] ISO 4217 code of the currency used in the purchases + FString Currency; + + /** + * Total value of the purchases in a whole number of 1/100 monetary units. For example, 999 indicates nine dollars and + * ninety-nine cents when Currency is 'USD') + */ + uint32 TotalValue; + + /** + * [optional] Total value of the purchases in a string representation of decimal monetary units. For example, '9.99' indicates nine + * dollars and ninety-nine cents when Currency is 'USD'. + */ + FString TotalValueAsDecimal; + + FValueToDateModel() : + FPlayFabBaseModel(), + Currency(), + TotalValue(0), + TotalValueAsDecimal() + {} + + FValueToDateModel(const FValueToDateModel& src) : + FPlayFabBaseModel(), + Currency(src.Currency), + TotalValue(src.TotalValue), + TotalValueAsDecimal(src.TotalValueAsDecimal) + {} + + FValueToDateModel(const TSharedPtr& obj) : FValueToDateModel() + { + readFromValue(obj); + } + + ~FValueToDateModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfileModel : public FPlayFabBaseModel + { + // [optional] List of advertising campaigns the player has been attributed to + TArray AdCampaignAttributions; + // [optional] URL of the player's avatar image + FString AvatarUrl; + + // [optional] If the player is currently banned, the UTC Date when the ban expires + Boxed BannedUntil; + + // [optional] List of all contact email info associated with the player account + TArray ContactEmailAddresses; + // [optional] Player record created + Boxed Created; + + // [optional] Player display name + FString DisplayName; + + // [optional] UTC time when the player most recently logged in to the title + Boxed LastLogin; + + // [optional] List of all authentication systems linked to this player account + TArray LinkedAccounts; + // [optional] List of geographic locations from which the player has logged in to the title + TArray Locations; + // [optional] List of memberships for the player, along with whether are expired. + TArray Memberships; + // [optional] Player account origination + Boxed Origination; + + // [optional] PlayFab player account unique identifier + FString PlayerId; + + // [optional] Publisher this player belongs to + FString PublisherId; + + // [optional] List of configured end points registered for sending the player push notifications + TArray PushNotificationRegistrations; + // [optional] List of leaderboard statistic values for the player + TArray Statistics; + // [optional] List of player's tags for segmentation + TArray Tags; + // [optional] Title ID this player profile applies to + FString TitleId; + + /** + * [optional] Sum of the player's purchases made with real-money currencies, converted to US dollars equivalent and represented as a + * whole number of cents (1/100 USD). For example, 999 indicates nine dollars and ninety-nine cents. + */ + Boxed TotalValueToDateInUSD; + + // [optional] List of the player's lifetime purchase totals, summed by real-money currency + TArray ValuesToDate; + FPlayerProfileModel() : + FPlayFabBaseModel(), + AdCampaignAttributions(), + AvatarUrl(), + BannedUntil(), + ContactEmailAddresses(), + Created(), + DisplayName(), + LastLogin(), + LinkedAccounts(), + Locations(), + Memberships(), + Origination(), + PlayerId(), + PublisherId(), + PushNotificationRegistrations(), + Statistics(), + Tags(), + TitleId(), + TotalValueToDateInUSD(), + ValuesToDate() + {} + + FPlayerProfileModel(const FPlayerProfileModel& src) : + FPlayFabBaseModel(), + AdCampaignAttributions(src.AdCampaignAttributions), + AvatarUrl(src.AvatarUrl), + BannedUntil(src.BannedUntil), + ContactEmailAddresses(src.ContactEmailAddresses), + Created(src.Created), + DisplayName(src.DisplayName), + LastLogin(src.LastLogin), + LinkedAccounts(src.LinkedAccounts), + Locations(src.Locations), + Memberships(src.Memberships), + Origination(src.Origination), + PlayerId(src.PlayerId), + PublisherId(src.PublisherId), + PushNotificationRegistrations(src.PushNotificationRegistrations), + Statistics(src.Statistics), + Tags(src.Tags), + TitleId(src.TitleId), + TotalValueToDateInUSD(src.TotalValueToDateInUSD), + ValuesToDate(src.ValuesToDate) + {} + + FPlayerProfileModel(const TSharedPtr& obj) : FPlayerProfileModel() + { + readFromValue(obj); + } + + ~FPlayerProfileModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFriendInfo : public FPlayFabBaseModel + { + // [optional] Unique lobby identifier of the Game Server Instance to which this player is currently connected. + FString CurrentMatchmakerLobbyId; + + // [optional] Available Facebook information (if the user and PlayFab friend are also connected in Facebook). + TSharedPtr FacebookInfo; + + // [optional] PlayFab unique identifier for this friend. + FString FriendPlayFabId; + + // [optional] Available Game Center information (if the user and PlayFab friend are also connected in Game Center). + TSharedPtr GameCenterInfo; + + // [optional] The profile of the user, if requested. + TSharedPtr Profile; + + // [optional] Available PSN information, if the user and PlayFab friend are both connected to PSN. + TSharedPtr PSNInfo; + + // [optional] Available Steam information (if the user and PlayFab friend are also connected in Steam). + TSharedPtr SteamInfo; + + // [optional] Tags which have been associated with this friend. + TArray Tags; + // [optional] Title-specific display name for this friend. + FString TitleDisplayName; + + // [optional] PlayFab unique username for this friend. + FString Username; + + // [optional] Available Xbox information, if the user and PlayFab friend are both connected to Xbox Live. + TSharedPtr XboxInfo; + + FFriendInfo() : + FPlayFabBaseModel(), + CurrentMatchmakerLobbyId(), + FacebookInfo(nullptr), + FriendPlayFabId(), + GameCenterInfo(nullptr), + Profile(nullptr), + PSNInfo(nullptr), + SteamInfo(nullptr), + Tags(), + TitleDisplayName(), + Username(), + XboxInfo(nullptr) + {} + + FFriendInfo(const FFriendInfo& src) : + FPlayFabBaseModel(), + CurrentMatchmakerLobbyId(src.CurrentMatchmakerLobbyId), + FacebookInfo(src.FacebookInfo.IsValid() ? MakeShareable(new FUserFacebookInfo(*src.FacebookInfo)) : nullptr), + FriendPlayFabId(src.FriendPlayFabId), + GameCenterInfo(src.GameCenterInfo.IsValid() ? MakeShareable(new FUserGameCenterInfo(*src.GameCenterInfo)) : nullptr), + Profile(src.Profile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.Profile)) : nullptr), + PSNInfo(src.PSNInfo.IsValid() ? MakeShareable(new FUserPsnInfo(*src.PSNInfo)) : nullptr), + SteamInfo(src.SteamInfo.IsValid() ? MakeShareable(new FUserSteamInfo(*src.SteamInfo)) : nullptr), + Tags(src.Tags), + TitleDisplayName(src.TitleDisplayName), + Username(src.Username), + XboxInfo(src.XboxInfo.IsValid() ? MakeShareable(new FUserXboxInfo(*src.XboxInfo)) : nullptr) + {} + + FFriendInfo(const TSharedPtr& obj) : FFriendInfo() + { + readFromValue(obj); + } + + ~FFriendInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum GameInstanceState + { + GameInstanceStateOpen, + GameInstanceStateClosed + }; + + PLAYFABCPP_API void writeGameInstanceStateEnumJSON(GameInstanceState enumVal, JsonWriter& writer); + PLAYFABCPP_API GameInstanceState readGameInstanceStateFromValue(const TSharedPtr& value); + PLAYFABCPP_API GameInstanceState readGameInstanceStateFromValue(const FString& value); + + struct PLAYFABCPP_API FGetAllSegmentsRequest : public FPlayFabBaseModel + { + FGetAllSegmentsRequest() : + FPlayFabBaseModel() + {} + + FGetAllSegmentsRequest(const FGetAllSegmentsRequest& src) : + FPlayFabBaseModel() + {} + + FGetAllSegmentsRequest(const TSharedPtr& obj) : FGetAllSegmentsRequest() + { + readFromValue(obj); + } + + ~FGetAllSegmentsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSegmentResult : public FPlayFabBaseModel + { + // [optional] Identifier of the segments AB Test, if it is attached to one. + FString ABTestParent; + + // Unique identifier for this segment. + FString Id; + + // [optional] Segment name. + FString Name; + + FGetSegmentResult() : + FPlayFabBaseModel(), + ABTestParent(), + Id(), + Name() + {} + + FGetSegmentResult(const FGetSegmentResult& src) : + FPlayFabBaseModel(), + ABTestParent(src.ABTestParent), + Id(src.Id), + Name(src.Name) + {} + + FGetSegmentResult(const TSharedPtr& obj) : FGetSegmentResult() + { + readFromValue(obj); + } + + ~FGetSegmentResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetAllSegmentsResult : public FPlayFabBaseModel + { + // [optional] Array of segments for this title. + TArray Segments; + FGetAllSegmentsResult() : + FPlayFabBaseModel(), + Segments() + {} + + FGetAllSegmentsResult(const FGetAllSegmentsResult& src) : + FPlayFabBaseModel(), + Segments(src.Segments) + {} + + FGetAllSegmentsResult(const TSharedPtr& obj) : FGetAllSegmentsResult() + { + readFromValue(obj); + } + + ~FGetAllSegmentsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCatalogItemsRequest : public FPlayFabBaseModel + { + // [optional] Which catalog is being requested. If null, uses the default catalog. + FString CatalogVersion; + + FGetCatalogItemsRequest() : + FPlayFabBaseModel(), + CatalogVersion() + {} + + FGetCatalogItemsRequest(const FGetCatalogItemsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion) + {} + + FGetCatalogItemsRequest(const TSharedPtr& obj) : FGetCatalogItemsRequest() + { + readFromValue(obj); + } + + ~FGetCatalogItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCatalogItemsResult : public FPlayFabBaseModel + { + // [optional] Array of items which can be purchased. + TArray Catalog; + FGetCatalogItemsResult() : + FPlayFabBaseModel(), + Catalog() + {} + + FGetCatalogItemsResult(const FGetCatalogItemsResult& src) : + FPlayFabBaseModel(), + Catalog(src.Catalog) + {} + + FGetCatalogItemsResult(const TSharedPtr& obj) : FGetCatalogItemsResult() + { + readFromValue(obj); + } + + ~FGetCatalogItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterDataRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + Boxed IfChangedFromDataVersion; + + // [optional] Specific keys to search for in the custom user data. + TArray Keys; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetCharacterDataRequest() : + FPlayFabBaseModel(), + CharacterId(), + IfChangedFromDataVersion(), + Keys(), + PlayFabId() + {} + + FGetCharacterDataRequest(const FGetCharacterDataRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + IfChangedFromDataVersion(src.IfChangedFromDataVersion), + Keys(src.Keys), + PlayFabId(src.PlayFabId) + {} + + FGetCharacterDataRequest(const TSharedPtr& obj) : FGetCharacterDataRequest() + { + readFromValue(obj); + } + + ~FGetCharacterDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum UserDataPermission + { + UserDataPermissionPrivate, + UserDataPermissionPublic + }; + + PLAYFABCPP_API void writeUserDataPermissionEnumJSON(UserDataPermission enumVal, JsonWriter& writer); + PLAYFABCPP_API UserDataPermission readUserDataPermissionFromValue(const TSharedPtr& value); + PLAYFABCPP_API UserDataPermission readUserDataPermissionFromValue(const FString& value); + + struct PLAYFABCPP_API FUserDataRecord : public FPlayFabBaseModel + { + // Timestamp for when this data was last updated. + FDateTime LastUpdated; + + /** + * [optional] Indicates whether this data can be read by all users (public) or only the user (private). This is used for GetUserData + * requests being made by one player about another player. + */ + Boxed Permission; + + // [optional] Data stored for the specified user data key. + FString Value; + + FUserDataRecord() : + FPlayFabBaseModel(), + LastUpdated(0), + Permission(), + Value() + {} + + FUserDataRecord(const FUserDataRecord& src) : + FPlayFabBaseModel(), + LastUpdated(src.LastUpdated), + Permission(src.Permission), + Value(src.Value) + {} + + FUserDataRecord(const TSharedPtr& obj) : FUserDataRecord() + { + readFromValue(obj); + } + + ~FUserDataRecord(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterDataResult : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] User specific data for this title. + TMap Data; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetCharacterDataResult() : + FPlayFabBaseModel(), + CharacterId(), + Data(), + DataVersion(0), + PlayFabId() + {} + + FGetCharacterDataResult(const FGetCharacterDataResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Data(src.Data), + DataVersion(src.DataVersion), + PlayFabId(src.PlayFabId) + {} + + FGetCharacterDataResult(const TSharedPtr& obj) : FGetCharacterDataResult() + { + readFromValue(obj); + } + + ~FGetCharacterDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterInventoryRequest : public FPlayFabBaseModel + { + // [optional] Used to limit results to only those from a specific catalog version. + FString CatalogVersion; + + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetCharacterInventoryRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + PlayFabId() + {} + + FGetCharacterInventoryRequest(const FGetCharacterInventoryRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + PlayFabId(src.PlayFabId) + {} + + FGetCharacterInventoryRequest(const TSharedPtr& obj) : FGetCharacterInventoryRequest() + { + readFromValue(obj); + } + + ~FGetCharacterInventoryRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FVirtualCurrencyRechargeTime : public FPlayFabBaseModel + { + /** + * Maximum value to which the regenerating currency will automatically increment. Note that it can exceed this value + * through use of the AddUserVirtualCurrency API call. However, it will not regenerate automatically until it has fallen + * below this value. + */ + int32 RechargeMax; + + // Server timestamp in UTC indicating the next time the virtual currency will be incremented. + FDateTime RechargeTime; + + // Time remaining (in seconds) before the next recharge increment of the virtual currency. + int32 SecondsToRecharge; + + FVirtualCurrencyRechargeTime() : + FPlayFabBaseModel(), + RechargeMax(0), + RechargeTime(0), + SecondsToRecharge(0) + {} + + FVirtualCurrencyRechargeTime(const FVirtualCurrencyRechargeTime& src) : + FPlayFabBaseModel(), + RechargeMax(src.RechargeMax), + RechargeTime(src.RechargeTime), + SecondsToRecharge(src.SecondsToRecharge) + {} + + FVirtualCurrencyRechargeTime(const TSharedPtr& obj) : FVirtualCurrencyRechargeTime() + { + readFromValue(obj); + } + + ~FVirtualCurrencyRechargeTime(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterInventoryResult : public FPlayFabBaseModel + { + // [optional] Unique identifier of the character for this inventory. + FString CharacterId; + + // [optional] Array of inventory items belonging to the character. + TArray Inventory; + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] Array of virtual currency balance(s) belonging to the character. + TMap VirtualCurrency; + // [optional] Array of remaining times and timestamps for virtual currencies. + TMap VirtualCurrencyRechargeTimes; + FGetCharacterInventoryResult() : + FPlayFabBaseModel(), + CharacterId(), + Inventory(), + PlayFabId(), + VirtualCurrency(), + VirtualCurrencyRechargeTimes() + {} + + FGetCharacterInventoryResult(const FGetCharacterInventoryResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Inventory(src.Inventory), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency), + VirtualCurrencyRechargeTimes(src.VirtualCurrencyRechargeTimes) + {} + + FGetCharacterInventoryResult(const TSharedPtr& obj) : FGetCharacterInventoryResult() + { + readFromValue(obj); + } + + ~FGetCharacterInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterLeaderboardRequest : public FPlayFabBaseModel + { + // [optional] Optional character type on which to filter the leaderboard entries. + FString CharacterType; + + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + // First entry in the leaderboard to be retrieved. + int32 StartPosition; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + FGetCharacterLeaderboardRequest() : + FPlayFabBaseModel(), + CharacterType(), + MaxResultsCount(0), + StartPosition(0), + StatisticName() + {} + + FGetCharacterLeaderboardRequest(const FGetCharacterLeaderboardRequest& src) : + FPlayFabBaseModel(), + CharacterType(src.CharacterType), + MaxResultsCount(src.MaxResultsCount), + StartPosition(src.StartPosition), + StatisticName(src.StatisticName) + {} + + FGetCharacterLeaderboardRequest(const TSharedPtr& obj) : FGetCharacterLeaderboardRequest() + { + readFromValue(obj); + } + + ~FGetCharacterLeaderboardRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterLeaderboardResult : public FPlayFabBaseModel + { + // [optional] Ordered list of leaderboard entries. + TArray Leaderboard; + FGetCharacterLeaderboardResult() : + FPlayFabBaseModel(), + Leaderboard() + {} + + FGetCharacterLeaderboardResult(const FGetCharacterLeaderboardResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard) + {} + + FGetCharacterLeaderboardResult(const TSharedPtr& obj) : FGetCharacterLeaderboardResult() + { + readFromValue(obj); + } + + ~FGetCharacterLeaderboardResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterStatisticsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetCharacterStatisticsRequest() : + FPlayFabBaseModel(), + CharacterId(), + PlayFabId() + {} + + FGetCharacterStatisticsRequest(const FGetCharacterStatisticsRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + PlayFabId(src.PlayFabId) + {} + + FGetCharacterStatisticsRequest(const TSharedPtr& obj) : FGetCharacterStatisticsRequest() + { + readFromValue(obj); + } + + ~FGetCharacterStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterStatisticsResult : public FPlayFabBaseModel + { + // [optional] Unique identifier of the character for the statistics. + FString CharacterId; + + // [optional] Character statistics for the requested user. + TMap CharacterStatistics; + // [optional] PlayFab unique identifier of the user whose character statistics are being returned. + FString PlayFabId; + + FGetCharacterStatisticsResult() : + FPlayFabBaseModel(), + CharacterId(), + CharacterStatistics(), + PlayFabId() + {} + + FGetCharacterStatisticsResult(const FGetCharacterStatisticsResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterStatistics(src.CharacterStatistics), + PlayFabId(src.PlayFabId) + {} + + FGetCharacterStatisticsResult(const TSharedPtr& obj) : FGetCharacterStatisticsResult() + { + readFromValue(obj); + } + + ~FGetCharacterStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentDownloadUrlRequest : public FPlayFabBaseModel + { + // [optional] HTTP method to fetch item - GET or HEAD. Use HEAD when only fetching metadata. Default is GET. + FString HttpMethod; + + // Key of the content item to fetch, usually formatted as a path, e.g. images/a.png + FString Key; + + /** + * [optional] True to download through CDN. CDN provides higher download bandwidth and lower latency. However, if you want the latest, + * non-cached version of the content during development, set this to false. Default is true. + */ + Boxed ThruCDN; + + FGetContentDownloadUrlRequest() : + FPlayFabBaseModel(), + HttpMethod(), + Key(), + ThruCDN() + {} + + FGetContentDownloadUrlRequest(const FGetContentDownloadUrlRequest& src) : + FPlayFabBaseModel(), + HttpMethod(src.HttpMethod), + Key(src.Key), + ThruCDN(src.ThruCDN) + {} + + FGetContentDownloadUrlRequest(const TSharedPtr& obj) : FGetContentDownloadUrlRequest() + { + readFromValue(obj); + } + + ~FGetContentDownloadUrlRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentDownloadUrlResult : public FPlayFabBaseModel + { + // [optional] URL for downloading content via HTTP GET or HEAD method. The URL will expire in approximately one hour. + FString URL; + + FGetContentDownloadUrlResult() : + FPlayFabBaseModel(), + URL() + {} + + FGetContentDownloadUrlResult(const FGetContentDownloadUrlResult& src) : + FPlayFabBaseModel(), + URL(src.URL) + {} + + FGetContentDownloadUrlResult(const TSharedPtr& obj) : FGetContentDownloadUrlResult() + { + readFromValue(obj); + } + + ~FGetContentDownloadUrlResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfileViewConstraints : public FPlayFabBaseModel + { + // Whether to show player's avatar URL. Defaults to false + bool ShowAvatarUrl; + + // Whether to show the banned until time. Defaults to false + bool ShowBannedUntil; + + // Whether to show campaign attributions. Defaults to false + bool ShowCampaignAttributions; + + // Whether to show contact email addresses. Defaults to false + bool ShowContactEmailAddresses; + + // Whether to show the created date. Defaults to false + bool ShowCreated; + + // Whether to show the display name. Defaults to false + bool ShowDisplayName; + + // Whether to show the last login time. Defaults to false + bool ShowLastLogin; + + // Whether to show the linked accounts. Defaults to false + bool ShowLinkedAccounts; + + // Whether to show player's locations. Defaults to false + bool ShowLocations; + + // Whether to show player's membership information. Defaults to false + bool ShowMemberships; + + // Whether to show origination. Defaults to false + bool ShowOrigination; + + // Whether to show push notification registrations. Defaults to false + bool ShowPushNotificationRegistrations; + + // Reserved for future development + bool ShowStatistics; + + // Whether to show tags. Defaults to false + bool ShowTags; + + // Whether to show the total value to date in usd. Defaults to false + bool ShowTotalValueToDateInUsd; + + // Whether to show the values to date. Defaults to false + bool ShowValuesToDate; + + FPlayerProfileViewConstraints() : + FPlayFabBaseModel(), + ShowAvatarUrl(false), + ShowBannedUntil(false), + ShowCampaignAttributions(false), + ShowContactEmailAddresses(false), + ShowCreated(false), + ShowDisplayName(false), + ShowLastLogin(false), + ShowLinkedAccounts(false), + ShowLocations(false), + ShowMemberships(false), + ShowOrigination(false), + ShowPushNotificationRegistrations(false), + ShowStatistics(false), + ShowTags(false), + ShowTotalValueToDateInUsd(false), + ShowValuesToDate(false) + {} + + FPlayerProfileViewConstraints(const FPlayerProfileViewConstraints& src) : + FPlayFabBaseModel(), + ShowAvatarUrl(src.ShowAvatarUrl), + ShowBannedUntil(src.ShowBannedUntil), + ShowCampaignAttributions(src.ShowCampaignAttributions), + ShowContactEmailAddresses(src.ShowContactEmailAddresses), + ShowCreated(src.ShowCreated), + ShowDisplayName(src.ShowDisplayName), + ShowLastLogin(src.ShowLastLogin), + ShowLinkedAccounts(src.ShowLinkedAccounts), + ShowLocations(src.ShowLocations), + ShowMemberships(src.ShowMemberships), + ShowOrigination(src.ShowOrigination), + ShowPushNotificationRegistrations(src.ShowPushNotificationRegistrations), + ShowStatistics(src.ShowStatistics), + ShowTags(src.ShowTags), + ShowTotalValueToDateInUsd(src.ShowTotalValueToDateInUsd), + ShowValuesToDate(src.ShowValuesToDate) + {} + + FPlayerProfileViewConstraints(const TSharedPtr& obj) : FPlayerProfileViewConstraints() + { + readFromValue(obj); + } + + ~FPlayerProfileViewConstraints(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendLeaderboardRequest : public FPlayFabBaseModel + { + // [optional] Indicates whether Facebook friends should be included in the response. Default is true. + Boxed IncludeFacebookFriends; + + // [optional] Indicates whether Steam service friends should be included in the response. Default is true. + Boxed IncludeSteamFriends; + + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + // The player whose friend leaderboard to get + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // Position in the leaderboard to start this listing (defaults to the first entry). + int32 StartPosition; + + // Statistic used to rank friends for this leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + // [optional] Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. + FString XboxToken; + + FGetFriendLeaderboardRequest() : + FPlayFabBaseModel(), + IncludeFacebookFriends(), + IncludeSteamFriends(), + MaxResultsCount(0), + PlayFabId(), + ProfileConstraints(nullptr), + StartPosition(0), + StatisticName(), + UseSpecificVersion(), + Version(), + XboxToken() + {} + + FGetFriendLeaderboardRequest(const FGetFriendLeaderboardRequest& src) : + FPlayFabBaseModel(), + IncludeFacebookFriends(src.IncludeFacebookFriends), + IncludeSteamFriends(src.IncludeSteamFriends), + MaxResultsCount(src.MaxResultsCount), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StartPosition(src.StartPosition), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version), + XboxToken(src.XboxToken) + {} + + FGetFriendLeaderboardRequest(const TSharedPtr& obj) : FGetFriendLeaderboardRequest() + { + readFromValue(obj); + } + + ~FGetFriendLeaderboardRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendsListRequest : public FPlayFabBaseModel + { + // [optional] Indicates whether Facebook friends should be included in the response. Default is true. + Boxed IncludeFacebookFriends; + + // [optional] Indicates whether Steam service friends should be included in the response. Default is true. + Boxed IncludeSteamFriends; + + // PlayFab identifier of the player whose friend list to get. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // [optional] Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. + FString XboxToken; + + FGetFriendsListRequest() : + FPlayFabBaseModel(), + IncludeFacebookFriends(), + IncludeSteamFriends(), + PlayFabId(), + ProfileConstraints(nullptr), + XboxToken() + {} + + FGetFriendsListRequest(const FGetFriendsListRequest& src) : + FPlayFabBaseModel(), + IncludeFacebookFriends(src.IncludeFacebookFriends), + IncludeSteamFriends(src.IncludeSteamFriends), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + XboxToken(src.XboxToken) + {} + + FGetFriendsListRequest(const TSharedPtr& obj) : FGetFriendsListRequest() + { + readFromValue(obj); + } + + ~FGetFriendsListRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendsListResult : public FPlayFabBaseModel + { + // [optional] Array of friends found. + TArray Friends; + FGetFriendsListResult() : + FPlayFabBaseModel(), + Friends() + {} + + FGetFriendsListResult(const FGetFriendsListResult& src) : + FPlayFabBaseModel(), + Friends(src.Friends) + {} + + FGetFriendsListResult(const TSharedPtr& obj) : FGetFriendsListResult() + { + readFromValue(obj); + } + + ~FGetFriendsListResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundCharacterRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] Optional character type on which to filter the leaderboard entries. + FString CharacterType; + + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + FGetLeaderboardAroundCharacterRequest() : + FPlayFabBaseModel(), + CharacterId(), + CharacterType(), + MaxResultsCount(0), + PlayFabId(), + StatisticName() + {} + + FGetLeaderboardAroundCharacterRequest(const FGetLeaderboardAroundCharacterRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterType(src.CharacterType), + MaxResultsCount(src.MaxResultsCount), + PlayFabId(src.PlayFabId), + StatisticName(src.StatisticName) + {} + + FGetLeaderboardAroundCharacterRequest(const TSharedPtr& obj) : FGetLeaderboardAroundCharacterRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundCharacterRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundCharacterResult : public FPlayFabBaseModel + { + // [optional] Ordered list of leaderboard entries. + TArray Leaderboard; + FGetLeaderboardAroundCharacterResult() : + FPlayFabBaseModel(), + Leaderboard() + {} + + FGetLeaderboardAroundCharacterResult(const FGetLeaderboardAroundCharacterResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard) + {} + + FGetLeaderboardAroundCharacterResult(const TSharedPtr& obj) : FGetLeaderboardAroundCharacterResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundUserRequest : public FPlayFabBaseModel + { + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + FGetLeaderboardAroundUserRequest() : + FPlayFabBaseModel(), + MaxResultsCount(0), + PlayFabId(), + ProfileConstraints(nullptr), + StatisticName(), + UseSpecificVersion(), + Version() + {} + + FGetLeaderboardAroundUserRequest(const FGetLeaderboardAroundUserRequest& src) : + FPlayFabBaseModel(), + MaxResultsCount(src.MaxResultsCount), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version) + {} + + FGetLeaderboardAroundUserRequest(const TSharedPtr& obj) : FGetLeaderboardAroundUserRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLeaderboardEntry : public FPlayFabBaseModel + { + // [optional] Title-specific display name of the user for this leaderboard entry. + FString DisplayName; + + // [optional] PlayFab unique identifier of the user for this leaderboard entry. + FString PlayFabId; + + // User's overall position in the leaderboard. + int32 Position; + + // [optional] The profile of the user, if requested. + TSharedPtr Profile; + + // Specific value of the user's statistic. + int32 StatValue; + + FPlayerLeaderboardEntry() : + FPlayFabBaseModel(), + DisplayName(), + PlayFabId(), + Position(0), + Profile(nullptr), + StatValue(0) + {} + + FPlayerLeaderboardEntry(const FPlayerLeaderboardEntry& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName), + PlayFabId(src.PlayFabId), + Position(src.Position), + Profile(src.Profile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.Profile)) : nullptr), + StatValue(src.StatValue) + {} + + FPlayerLeaderboardEntry(const TSharedPtr& obj) : FPlayerLeaderboardEntry() + { + readFromValue(obj); + } + + ~FPlayerLeaderboardEntry(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundUserResult : public FPlayFabBaseModel + { + // [optional] Ordered listing of users and their positions in the requested leaderboard. + TArray Leaderboard; + // [optional] The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. + Boxed NextReset; + + // The version of the leaderboard returned. + int32 Version; + + FGetLeaderboardAroundUserResult() : + FPlayFabBaseModel(), + Leaderboard(), + NextReset(), + Version(0) + {} + + FGetLeaderboardAroundUserResult(const FGetLeaderboardAroundUserResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard), + NextReset(src.NextReset), + Version(src.Version) + {} + + FGetLeaderboardAroundUserResult(const TSharedPtr& obj) : FGetLeaderboardAroundUserResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardForUsersCharactersRequest : public FPlayFabBaseModel + { + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + FGetLeaderboardForUsersCharactersRequest() : + FPlayFabBaseModel(), + MaxResultsCount(0), + PlayFabId(), + StatisticName() + {} + + FGetLeaderboardForUsersCharactersRequest(const FGetLeaderboardForUsersCharactersRequest& src) : + FPlayFabBaseModel(), + MaxResultsCount(src.MaxResultsCount), + PlayFabId(src.PlayFabId), + StatisticName(src.StatisticName) + {} + + FGetLeaderboardForUsersCharactersRequest(const TSharedPtr& obj) : FGetLeaderboardForUsersCharactersRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardForUsersCharactersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardForUsersCharactersResult : public FPlayFabBaseModel + { + // [optional] Ordered list of leaderboard entries. + TArray Leaderboard; + FGetLeaderboardForUsersCharactersResult() : + FPlayFabBaseModel(), + Leaderboard() + {} + + FGetLeaderboardForUsersCharactersResult(const FGetLeaderboardForUsersCharactersResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard) + {} + + FGetLeaderboardForUsersCharactersResult(const TSharedPtr& obj) : FGetLeaderboardForUsersCharactersResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardForUsersCharactersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardRequest : public FPlayFabBaseModel + { + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // First entry in the leaderboard to be retrieved. + int32 StartPosition; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + FGetLeaderboardRequest() : + FPlayFabBaseModel(), + MaxResultsCount(0), + ProfileConstraints(nullptr), + StartPosition(0), + StatisticName(), + UseSpecificVersion(), + Version() + {} + + FGetLeaderboardRequest(const FGetLeaderboardRequest& src) : + FPlayFabBaseModel(), + MaxResultsCount(src.MaxResultsCount), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StartPosition(src.StartPosition), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version) + {} + + FGetLeaderboardRequest(const TSharedPtr& obj) : FGetLeaderboardRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardResult : public FPlayFabBaseModel + { + // [optional] Ordered listing of users and their positions in the requested leaderboard. + TArray Leaderboard; + // [optional] The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. + Boxed NextReset; + + // The version of the leaderboard returned. + int32 Version; + + FGetLeaderboardResult() : + FPlayFabBaseModel(), + Leaderboard(), + NextReset(), + Version(0) + {} + + FGetLeaderboardResult(const FGetLeaderboardResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard), + NextReset(src.NextReset), + Version(src.Version) + {} + + FGetLeaderboardResult(const TSharedPtr& obj) : FGetLeaderboardResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoRequestParams : public FPlayFabBaseModel + { + // Whether to get character inventories. Defaults to false. + bool GetCharacterInventories; + + // Whether to get the list of characters. Defaults to false. + bool GetCharacterList; + + // Whether to get player profile. Defaults to false. + bool GetPlayerProfile; + + // Whether to get player statistics. Defaults to false. + bool GetPlayerStatistics; + + // Whether to get title data. Defaults to false. + bool GetTitleData; + + // Whether to get the player's account Info. Defaults to false + bool GetUserAccountInfo; + + // Whether to get the player's custom data. Defaults to false + bool GetUserData; + + // Whether to get the player's inventory. Defaults to false + bool GetUserInventory; + + // Whether to get the player's read only data. Defaults to false + bool GetUserReadOnlyData; + + // Whether to get the player's virtual currency balances. Defaults to false + bool GetUserVirtualCurrency; + + // [optional] Specific statistics to retrieve. Leave null to get all keys. Has no effect if GetPlayerStatistics is false + TArray PlayerStatisticNames; + // [optional] Specifies the properties to return from the player profile. Defaults to returning the player's display name. + TSharedPtr ProfileConstraints; + + // [optional] Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetTitleData is false + TArray TitleDataKeys; + // [optional] Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetUserData is false + TArray UserDataKeys; + /** + * [optional] Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetUserReadOnlyData is + * false + */ + TArray UserReadOnlyDataKeys; + FGetPlayerCombinedInfoRequestParams() : + FPlayFabBaseModel(), + GetCharacterInventories(false), + GetCharacterList(false), + GetPlayerProfile(false), + GetPlayerStatistics(false), + GetTitleData(false), + GetUserAccountInfo(false), + GetUserData(false), + GetUserInventory(false), + GetUserReadOnlyData(false), + GetUserVirtualCurrency(false), + PlayerStatisticNames(), + ProfileConstraints(nullptr), + TitleDataKeys(), + UserDataKeys(), + UserReadOnlyDataKeys() + {} + + FGetPlayerCombinedInfoRequestParams(const FGetPlayerCombinedInfoRequestParams& src) : + FPlayFabBaseModel(), + GetCharacterInventories(src.GetCharacterInventories), + GetCharacterList(src.GetCharacterList), + GetPlayerProfile(src.GetPlayerProfile), + GetPlayerStatistics(src.GetPlayerStatistics), + GetTitleData(src.GetTitleData), + GetUserAccountInfo(src.GetUserAccountInfo), + GetUserData(src.GetUserData), + GetUserInventory(src.GetUserInventory), + GetUserReadOnlyData(src.GetUserReadOnlyData), + GetUserVirtualCurrency(src.GetUserVirtualCurrency), + PlayerStatisticNames(src.PlayerStatisticNames), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + TitleDataKeys(src.TitleDataKeys), + UserDataKeys(src.UserDataKeys), + UserReadOnlyDataKeys(src.UserReadOnlyDataKeys) + {} + + FGetPlayerCombinedInfoRequestParams(const TSharedPtr& obj) : FGetPlayerCombinedInfoRequestParams() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoRequestParams(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoRequest : public FPlayFabBaseModel + { + // Flags for which pieces of info to return for the user. + FGetPlayerCombinedInfoRequestParams InfoRequestParameters; + + // PlayFabId of the user whose data will be returned + FString PlayFabId; + + FGetPlayerCombinedInfoRequest() : + FPlayFabBaseModel(), + InfoRequestParameters(), + PlayFabId() + {} + + FGetPlayerCombinedInfoRequest(const FGetPlayerCombinedInfoRequest& src) : + FPlayFabBaseModel(), + InfoRequestParameters(src.InfoRequestParameters), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerCombinedInfoRequest(const TSharedPtr& obj) : FGetPlayerCombinedInfoRequest() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticValue : public FPlayFabBaseModel + { + // [optional] unique name of the statistic + FString StatisticName; + + // statistic value for the player + int32 Value; + + // for updates to an existing statistic value for a player, the version of the statistic when it was loaded + uint32 Version; + + FStatisticValue() : + FPlayFabBaseModel(), + StatisticName(), + Value(0), + Version(0) + {} + + FStatisticValue(const FStatisticValue& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName), + Value(src.Value), + Version(src.Version) + {} + + FStatisticValue(const TSharedPtr& obj) : FStatisticValue() + { + readFromValue(obj); + } + + ~FStatisticValue(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoResultPayload : public FPlayFabBaseModel + { + // [optional] Account information for the user. This is always retrieved. + TSharedPtr AccountInfo; + + // [optional] Inventories for each character for the user. + TArray CharacterInventories; + // [optional] List of characters for the user. + TArray CharacterList; + /** + * [optional] The profile of the players. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + TSharedPtr PlayerProfile; + + // [optional] List of statistics for this player. + TArray PlayerStatistics; + // [optional] Title data for this title. + TMap TitleData; + // [optional] User specific custom data. + TMap UserData; + // The version of the UserData that was returned. + uint32 UserDataVersion; + + // [optional] Array of inventory items in the user's current inventory. + TArray UserInventory; + // [optional] User specific read-only data. + TMap UserReadOnlyData; + // The version of the Read-Only UserData that was returned. + uint32 UserReadOnlyDataVersion; + + // [optional] Dictionary of virtual currency balance(s) belonging to the user. + TMap UserVirtualCurrency; + // [optional] Dictionary of remaining times and timestamps for virtual currencies. + TMap UserVirtualCurrencyRechargeTimes; + FGetPlayerCombinedInfoResultPayload() : + FPlayFabBaseModel(), + AccountInfo(nullptr), + CharacterInventories(), + CharacterList(), + PlayerProfile(nullptr), + PlayerStatistics(), + TitleData(), + UserData(), + UserDataVersion(0), + UserInventory(), + UserReadOnlyData(), + UserReadOnlyDataVersion(0), + UserVirtualCurrency(), + UserVirtualCurrencyRechargeTimes() + {} + + FGetPlayerCombinedInfoResultPayload(const FGetPlayerCombinedInfoResultPayload& src) : + FPlayFabBaseModel(), + AccountInfo(src.AccountInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.AccountInfo)) : nullptr), + CharacterInventories(src.CharacterInventories), + CharacterList(src.CharacterList), + PlayerProfile(src.PlayerProfile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.PlayerProfile)) : nullptr), + PlayerStatistics(src.PlayerStatistics), + TitleData(src.TitleData), + UserData(src.UserData), + UserDataVersion(src.UserDataVersion), + UserInventory(src.UserInventory), + UserReadOnlyData(src.UserReadOnlyData), + UserReadOnlyDataVersion(src.UserReadOnlyDataVersion), + UserVirtualCurrency(src.UserVirtualCurrency), + UserVirtualCurrencyRechargeTimes(src.UserVirtualCurrencyRechargeTimes) + {} + + FGetPlayerCombinedInfoResultPayload(const TSharedPtr& obj) : FGetPlayerCombinedInfoResultPayload() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoResultPayload(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoResult : public FPlayFabBaseModel + { + // [optional] Results for requested info. + TSharedPtr InfoResultPayload; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayerCombinedInfoResult() : + FPlayFabBaseModel(), + InfoResultPayload(nullptr), + PlayFabId() + {} + + FGetPlayerCombinedInfoResult(const FGetPlayerCombinedInfoResult& src) : + FPlayFabBaseModel(), + InfoResultPayload(src.InfoResultPayload.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoResultPayload(*src.InfoResultPayload)) : nullptr), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerCombinedInfoResult(const TSharedPtr& obj) : FGetPlayerCombinedInfoResult() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerProfileRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + FGetPlayerProfileRequest() : + FPlayFabBaseModel(), + PlayFabId(), + ProfileConstraints(nullptr) + {} + + FGetPlayerProfileRequest(const FGetPlayerProfileRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr) + {} + + FGetPlayerProfileRequest(const TSharedPtr& obj) : FGetPlayerProfileRequest() + { + readFromValue(obj); + } + + ~FGetPlayerProfileRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerProfileResult : public FPlayFabBaseModel + { + /** + * [optional] The profile of the player. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + TSharedPtr PlayerProfile; + + FGetPlayerProfileResult() : + FPlayFabBaseModel(), + PlayerProfile(nullptr) + {} + + FGetPlayerProfileResult(const FGetPlayerProfileResult& src) : + FPlayFabBaseModel(), + PlayerProfile(src.PlayerProfile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.PlayerProfile)) : nullptr) + {} + + FGetPlayerProfileResult(const TSharedPtr& obj) : FGetPlayerProfileResult() + { + readFromValue(obj); + } + + ~FGetPlayerProfileResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerSegmentsResult : public FPlayFabBaseModel + { + // [optional] Array of segments the requested player currently belongs to. + TArray Segments; + FGetPlayerSegmentsResult() : + FPlayFabBaseModel(), + Segments() + {} + + FGetPlayerSegmentsResult(const FGetPlayerSegmentsResult& src) : + FPlayFabBaseModel(), + Segments(src.Segments) + {} + + FGetPlayerSegmentsResult(const TSharedPtr& obj) : FGetPlayerSegmentsResult() + { + readFromValue(obj); + } + + ~FGetPlayerSegmentsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayersInSegmentRequest : public FPlayFabBaseModel + { + // [optional] Continuation token if retrieving subsequent pages of results. + FString ContinuationToken; + + // [optional] Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. + Boxed MaxBatchSize; + + /** + * [optional] Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging + * results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). + */ + Boxed SecondsToLive; + + // Unique identifier for this segment. + FString SegmentId; + + FGetPlayersInSegmentRequest() : + FPlayFabBaseModel(), + ContinuationToken(), + MaxBatchSize(), + SecondsToLive(), + SegmentId() + {} + + FGetPlayersInSegmentRequest(const FGetPlayersInSegmentRequest& src) : + FPlayFabBaseModel(), + ContinuationToken(src.ContinuationToken), + MaxBatchSize(src.MaxBatchSize), + SecondsToLive(src.SecondsToLive), + SegmentId(src.SegmentId) + {} + + FGetPlayersInSegmentRequest(const TSharedPtr& obj) : FGetPlayersInSegmentRequest() + { + readFromValue(obj); + } + + ~FGetPlayersInSegmentRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLinkedAccount : public FPlayFabBaseModel + { + // [optional] Linked account's email + FString Email; + + // [optional] Authentication platform + Boxed Platform; + + // [optional] Platform user identifier + FString PlatformUserId; + + // [optional] Linked account's username + FString Username; + + FPlayerLinkedAccount() : + FPlayFabBaseModel(), + Email(), + Platform(), + PlatformUserId(), + Username() + {} + + FPlayerLinkedAccount(const FPlayerLinkedAccount& src) : + FPlayFabBaseModel(), + Email(src.Email), + Platform(src.Platform), + PlatformUserId(src.PlatformUserId), + Username(src.Username) + {} + + FPlayerLinkedAccount(const TSharedPtr& obj) : FPlayerLinkedAccount() + { + readFromValue(obj); + } + + ~FPlayerLinkedAccount(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLocation : public FPlayFabBaseModel + { + // [optional] City of the player's geographic location. + FString City; + + // The two-character continent code for this location + ContinentCode pfContinentCode; + + // The two-character ISO 3166-1 country code for the country associated with the location + CountryCode pfCountryCode; + + // [optional] Latitude coordinate of the player's geographic location. + Boxed Latitude; + + // [optional] Longitude coordinate of the player's geographic location. + Boxed Longitude; + + FPlayerLocation() : + FPlayFabBaseModel(), + City(), + pfContinentCode(), + pfCountryCode(), + Latitude(), + Longitude() + {} + + FPlayerLocation(const FPlayerLocation& src) : + FPlayFabBaseModel(), + City(src.City), + pfContinentCode(src.pfContinentCode), + pfCountryCode(src.pfCountryCode), + Latitude(src.Latitude), + Longitude(src.Longitude) + {} + + FPlayerLocation(const TSharedPtr& obj) : FPlayerLocation() + { + readFromValue(obj); + } + + ~FPlayerLocation(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerStatistic : public FPlayFabBaseModel + { + // [optional] Statistic ID + FString Id; + + // [optional] Statistic name + FString Name; + + // Current statistic value + int32 StatisticValue; + + // Statistic version (0 if not a versioned statistic) + int32 StatisticVersion; + + FPlayerStatistic() : + FPlayFabBaseModel(), + Id(), + Name(), + StatisticValue(0), + StatisticVersion(0) + {} + + FPlayerStatistic(const FPlayerStatistic& src) : + FPlayFabBaseModel(), + Id(src.Id), + Name(src.Name), + StatisticValue(src.StatisticValue), + StatisticVersion(src.StatisticVersion) + {} + + FPlayerStatistic(const TSharedPtr& obj) : FPlayerStatistic() + { + readFromValue(obj); + } + + ~FPlayerStatistic(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPushNotificationRegistration : public FPlayFabBaseModel + { + // [optional] Notification configured endpoint + FString NotificationEndpointARN; + + // [optional] Push notification platform + Boxed Platform; + + FPushNotificationRegistration() : + FPlayFabBaseModel(), + NotificationEndpointARN(), + Platform() + {} + + FPushNotificationRegistration(const FPushNotificationRegistration& src) : + FPlayFabBaseModel(), + NotificationEndpointARN(src.NotificationEndpointARN), + Platform(src.Platform) + {} + + FPushNotificationRegistration(const TSharedPtr& obj) : FPushNotificationRegistration() + { + readFromValue(obj); + } + + ~FPushNotificationRegistration(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfile : public FPlayFabBaseModel + { + // [optional] Array of ad campaigns player has been attributed to + TArray AdCampaignAttributions; + // [optional] Image URL of the player's avatar. + FString AvatarUrl; + + // [optional] Banned until UTC Date. If permanent ban this is set for 20 years after the original ban date. + Boxed BannedUntil; + + // [optional] Array of contact email addresses associated with the player + TArray ContactEmailAddresses; + // [optional] Player record created + Boxed Created; + + // [optional] Player Display Name + FString DisplayName; + + // [optional] Last login + Boxed LastLogin; + + // [optional] Array of third party accounts linked to this player + TArray LinkedAccounts; + // [optional] Dictionary of player's locations by type. + TMap Locations; + // [optional] Player account origination + Boxed Origination; + + // [optional] PlayFab Player ID + FString PlayerId; + + // [optional] Array of player statistics + TArray PlayerStatistics; + // [optional] Publisher this player belongs to + FString PublisherId; + + // [optional] Array of configured push notification end points + TArray PushNotificationRegistrations; + // [optional] Dictionary of player's statistics using only the latest version's value + TMap Statistics; + // [optional] List of player's tags for segmentation. + TArray Tags; + // [optional] Title ID this profile applies to + FString TitleId; + + // [optional] A sum of player's total purchases in USD across all currencies. + Boxed TotalValueToDateInUSD; + + // [optional] Dictionary of player's total purchases by currency. + TMap ValuesToDate; + // [optional] Dictionary of player's virtual currency balances + TMap VirtualCurrencyBalances; + FPlayerProfile() : + FPlayFabBaseModel(), + AdCampaignAttributions(), + AvatarUrl(), + BannedUntil(), + ContactEmailAddresses(), + Created(), + DisplayName(), + LastLogin(), + LinkedAccounts(), + Locations(), + Origination(), + PlayerId(), + PlayerStatistics(), + PublisherId(), + PushNotificationRegistrations(), + Statistics(), + Tags(), + TitleId(), + TotalValueToDateInUSD(), + ValuesToDate(), + VirtualCurrencyBalances() + {} + + FPlayerProfile(const FPlayerProfile& src) : + FPlayFabBaseModel(), + AdCampaignAttributions(src.AdCampaignAttributions), + AvatarUrl(src.AvatarUrl), + BannedUntil(src.BannedUntil), + ContactEmailAddresses(src.ContactEmailAddresses), + Created(src.Created), + DisplayName(src.DisplayName), + LastLogin(src.LastLogin), + LinkedAccounts(src.LinkedAccounts), + Locations(src.Locations), + Origination(src.Origination), + PlayerId(src.PlayerId), + PlayerStatistics(src.PlayerStatistics), + PublisherId(src.PublisherId), + PushNotificationRegistrations(src.PushNotificationRegistrations), + Statistics(src.Statistics), + Tags(src.Tags), + TitleId(src.TitleId), + TotalValueToDateInUSD(src.TotalValueToDateInUSD), + ValuesToDate(src.ValuesToDate), + VirtualCurrencyBalances(src.VirtualCurrencyBalances) + {} + + FPlayerProfile(const TSharedPtr& obj) : FPlayerProfile() + { + readFromValue(obj); + } + + ~FPlayerProfile(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayersInSegmentResult : public FPlayFabBaseModel + { + // [optional] Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. + FString ContinuationToken; + + // [optional] Array of player profiles in this segment. + TArray PlayerProfiles; + // Count of profiles matching this segment. + int32 ProfilesInSegment; + + FGetPlayersInSegmentResult() : + FPlayFabBaseModel(), + ContinuationToken(), + PlayerProfiles(), + ProfilesInSegment(0) + {} + + FGetPlayersInSegmentResult(const FGetPlayersInSegmentResult& src) : + FPlayFabBaseModel(), + ContinuationToken(src.ContinuationToken), + PlayerProfiles(src.PlayerProfiles), + ProfilesInSegment(src.ProfilesInSegment) + {} + + FGetPlayersInSegmentResult(const TSharedPtr& obj) : FGetPlayersInSegmentResult() + { + readFromValue(obj); + } + + ~FGetPlayersInSegmentResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayersSegmentsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayersSegmentsRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetPlayersSegmentsRequest(const FGetPlayersSegmentsRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetPlayersSegmentsRequest(const TSharedPtr& obj) : FGetPlayersSegmentsRequest() + { + readFromValue(obj); + } + + ~FGetPlayersSegmentsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticNameVersion : public FPlayFabBaseModel + { + // unique name of the statistic + FString StatisticName; + + // the version of the statistic to be returned + uint32 Version; + + FStatisticNameVersion() : + FPlayFabBaseModel(), + StatisticName(), + Version(0) + {} + + FStatisticNameVersion(const FStatisticNameVersion& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName), + Version(src.Version) + {} + + FStatisticNameVersion(const TSharedPtr& obj) : FStatisticNameVersion() + { + readFromValue(obj); + } + + ~FStatisticNameVersion(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticsRequest : public FPlayFabBaseModel + { + // user for whom statistics are being requested + FString PlayFabId; + + // [optional] statistics to return + TArray StatisticNames; + /** + * [optional] statistics to return, if StatisticNames is not set (only statistics which have a version matching that provided will be + * returned) + */ + TArray StatisticNameVersions; + FGetPlayerStatisticsRequest() : + FPlayFabBaseModel(), + PlayFabId(), + StatisticNames(), + StatisticNameVersions() + {} + + FGetPlayerStatisticsRequest(const FGetPlayerStatisticsRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + StatisticNames(src.StatisticNames), + StatisticNameVersions(src.StatisticNameVersions) + {} + + FGetPlayerStatisticsRequest(const TSharedPtr& obj) : FGetPlayerStatisticsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticsResult : public FPlayFabBaseModel + { + // [optional] PlayFab unique identifier of the user whose statistics are being returned + FString PlayFabId; + + // [optional] User statistics for the requested user. + TArray Statistics; + FGetPlayerStatisticsResult() : + FPlayFabBaseModel(), + PlayFabId(), + Statistics() + {} + + FGetPlayerStatisticsResult(const FGetPlayerStatisticsResult& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + Statistics(src.Statistics) + {} + + FGetPlayerStatisticsResult(const TSharedPtr& obj) : FGetPlayerStatisticsResult() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticVersionsRequest : public FPlayFabBaseModel + { + // [optional] unique name of the statistic + FString StatisticName; + + FGetPlayerStatisticVersionsRequest() : + FPlayFabBaseModel(), + StatisticName() + {} + + FGetPlayerStatisticVersionsRequest(const FGetPlayerStatisticVersionsRequest& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName) + {} + + FGetPlayerStatisticVersionsRequest(const TSharedPtr& obj) : FGetPlayerStatisticVersionsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticVersionsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerStatisticVersion : public FPlayFabBaseModel + { + // time when the statistic version became active + FDateTime ActivationTime; + + // [optional] time when the statistic version became inactive due to statistic version incrementing + Boxed DeactivationTime; + + // [optional] time at which the statistic version was scheduled to become active, based on the configured ResetInterval + Boxed ScheduledActivationTime; + + // [optional] time at which the statistic version was scheduled to become inactive, based on the configured ResetInterval + Boxed ScheduledDeactivationTime; + + // [optional] name of the statistic when the version became active + FString StatisticName; + + // version of the statistic + uint32 Version; + + FPlayerStatisticVersion() : + FPlayFabBaseModel(), + ActivationTime(0), + DeactivationTime(), + ScheduledActivationTime(), + ScheduledDeactivationTime(), + StatisticName(), + Version(0) + {} + + FPlayerStatisticVersion(const FPlayerStatisticVersion& src) : + FPlayFabBaseModel(), + ActivationTime(src.ActivationTime), + DeactivationTime(src.DeactivationTime), + ScheduledActivationTime(src.ScheduledActivationTime), + ScheduledDeactivationTime(src.ScheduledDeactivationTime), + StatisticName(src.StatisticName), + Version(src.Version) + {} + + FPlayerStatisticVersion(const TSharedPtr& obj) : FPlayerStatisticVersion() + { + readFromValue(obj); + } + + ~FPlayerStatisticVersion(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticVersionsResult : public FPlayFabBaseModel + { + // [optional] version change history of the statistic + TArray StatisticVersions; + FGetPlayerStatisticVersionsResult() : + FPlayFabBaseModel(), + StatisticVersions() + {} + + FGetPlayerStatisticVersionsResult(const FGetPlayerStatisticVersionsResult& src) : + FPlayFabBaseModel(), + StatisticVersions(src.StatisticVersions) + {} + + FGetPlayerStatisticVersionsResult(const TSharedPtr& obj) : FGetPlayerStatisticVersionsResult() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticVersionsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTagsRequest : public FPlayFabBaseModel + { + // [optional] Optional namespace to filter results by + FString Namespace; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayerTagsRequest() : + FPlayFabBaseModel(), + Namespace(), + PlayFabId() + {} + + FGetPlayerTagsRequest(const FGetPlayerTagsRequest& src) : + FPlayFabBaseModel(), + Namespace(src.Namespace), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerTagsRequest(const TSharedPtr& obj) : FGetPlayerTagsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerTagsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTagsResult : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Canonical tags (including namespace and tag's name) for the requested user + TArray Tags; + FGetPlayerTagsResult() : + FPlayFabBaseModel(), + PlayFabId(), + Tags() + {} + + FGetPlayerTagsResult(const FGetPlayerTagsResult& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + Tags(src.Tags) + {} + + FGetPlayerTagsResult(const TSharedPtr& obj) : FGetPlayerTagsResult() + { + readFromValue(obj); + } + + ~FGetPlayerTagsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookIDsRequest : public FPlayFabBaseModel + { + // Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. + TArray FacebookIDs; + FGetPlayFabIDsFromFacebookIDsRequest() : + FPlayFabBaseModel(), + FacebookIDs() + {} + + FGetPlayFabIDsFromFacebookIDsRequest(const FGetPlayFabIDsFromFacebookIDsRequest& src) : + FPlayFabBaseModel(), + FacebookIDs(src.FacebookIDs) + {} + + FGetPlayFabIDsFromFacebookIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Facebook identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromFacebookIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromFacebookIDsResult(const FGetPlayFabIDsFromFacebookIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromFacebookIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookInstantGamesIdsRequest : public FPlayFabBaseModel + { + // Array of unique Facebook Instant Games identifiers for which the title needs to get PlayFab identifiers. + TArray FacebookInstantGamesIds; + FGetPlayFabIDsFromFacebookInstantGamesIdsRequest() : + FPlayFabBaseModel(), + FacebookInstantGamesIds() + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsRequest(const FGetPlayFabIDsFromFacebookInstantGamesIdsRequest& src) : + FPlayFabBaseModel(), + FacebookInstantGamesIds(src.FacebookInstantGamesIds) + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookInstantGamesIdsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookInstantGamesIdsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookInstantGamesIdsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Facebook Instant Games identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromFacebookInstantGamesIdsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsResult(const FGetPlayFabIDsFromFacebookInstantGamesIdsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookInstantGamesIdsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookInstantGamesIdsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest : public FPlayFabBaseModel + { + // Array of unique Nintendo Switch Device identifiers for which the title needs to get PlayFab identifiers. + TArray NintendoSwitchDeviceIds; + FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest() : + FPlayFabBaseModel(), + NintendoSwitchDeviceIds() + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest(const FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceIds(src.NintendoSwitchDeviceIds) + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FNintendoSwitchPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Nintendo Switch Device identifier for a user. + FString NintendoSwitchDeviceId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Nintendo Switch Device identifier. + FString PlayFabId; + + FNintendoSwitchPlayFabIdPair() : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(), + PlayFabId() + {} + + FNintendoSwitchPlayFabIdPair(const FNintendoSwitchPlayFabIdPair& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId), + PlayFabId(src.PlayFabId) + {} + + FNintendoSwitchPlayFabIdPair(const TSharedPtr& obj) : FNintendoSwitchPlayFabIdPair() + { + readFromValue(obj); + } + + ~FNintendoSwitchPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Nintendo Switch Device identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(const FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromSteamIDsRequest : public FPlayFabBaseModel + { + // [optional] Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. + TArray SteamStringIDs; + FGetPlayFabIDsFromSteamIDsRequest() : + FPlayFabBaseModel(), + SteamStringIDs() + {} + + FGetPlayFabIDsFromSteamIDsRequest(const FGetPlayFabIDsFromSteamIDsRequest& src) : + FPlayFabBaseModel(), + SteamStringIDs(src.SteamStringIDs) + {} + + FGetPlayFabIDsFromSteamIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromSteamIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromSteamIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSteamPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Steam identifier. + FString PlayFabId; + + // [optional] Unique Steam identifier for a user. + FString SteamStringId; + + FSteamPlayFabIdPair() : + FPlayFabBaseModel(), + PlayFabId(), + SteamStringId() + {} + + FSteamPlayFabIdPair(const FSteamPlayFabIdPair& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + SteamStringId(src.SteamStringId) + {} + + FSteamPlayFabIdPair(const TSharedPtr& obj) : FSteamPlayFabIdPair() + { + readFromValue(obj); + } + + ~FSteamPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromSteamIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Steam identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromSteamIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromSteamIDsResult(const FGetPlayFabIDsFromSteamIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromSteamIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromSteamIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromSteamIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPublisherDataRequest : public FPlayFabBaseModel + { + // array of keys to get back data from the Publisher data blob, set by the admin tools + TArray Keys; + FGetPublisherDataRequest() : + FPlayFabBaseModel(), + Keys() + {} + + FGetPublisherDataRequest(const FGetPublisherDataRequest& src) : + FPlayFabBaseModel(), + Keys(src.Keys) + {} + + FGetPublisherDataRequest(const TSharedPtr& obj) : FGetPublisherDataRequest() + { + readFromValue(obj); + } + + ~FGetPublisherDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPublisherDataResult : public FPlayFabBaseModel + { + // [optional] a dictionary object of key / value pairs + TMap Data; + FGetPublisherDataResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPublisherDataResult(const FGetPublisherDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPublisherDataResult(const TSharedPtr& obj) : FGetPublisherDataResult() + { + readFromValue(obj); + } + + ~FGetPublisherDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetRandomResultTablesRequest : public FPlayFabBaseModel + { + /** + * [optional] Specifies the catalog version that should be used to retrieve the Random Result Tables. If unspecified, uses + * default/primary catalog. + */ + FString CatalogVersion; + + // The unique identifier of the Random Result Table to use. + TArray TableIDs; + FGetRandomResultTablesRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + TableIDs() + {} + + FGetRandomResultTablesRequest(const FGetRandomResultTablesRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + TableIDs(src.TableIDs) + {} + + FGetRandomResultTablesRequest(const TSharedPtr& obj) : FGetRandomResultTablesRequest() + { + readFromValue(obj); + } + + ~FGetRandomResultTablesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ResultTableNodeType + { + ResultTableNodeTypeItemId, + ResultTableNodeTypeTableId + }; + + PLAYFABCPP_API void writeResultTableNodeTypeEnumJSON(ResultTableNodeType enumVal, JsonWriter& writer); + PLAYFABCPP_API ResultTableNodeType readResultTableNodeTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ResultTableNodeType readResultTableNodeTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FResultTableNode : public FPlayFabBaseModel + { + // Either an ItemId, or the TableId of another random result table + FString ResultItem; + + // Whether this entry in the table is an item or a link to another table + ResultTableNodeType ResultItemType; + + // How likely this is to be rolled - larger numbers add more weight + int32 Weight; + + FResultTableNode() : + FPlayFabBaseModel(), + ResultItem(), + ResultItemType(), + Weight(0) + {} + + FResultTableNode(const FResultTableNode& src) : + FPlayFabBaseModel(), + ResultItem(src.ResultItem), + ResultItemType(src.ResultItemType), + Weight(src.Weight) + {} + + FResultTableNode(const TSharedPtr& obj) : FResultTableNode() + { + readFromValue(obj); + } + + ~FResultTableNode(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRandomResultTableListing : public FPlayFabBaseModel + { + // [optional] Catalog version this table is associated with + FString CatalogVersion; + + // Child nodes that indicate what kind of drop table item this actually is. + TArray Nodes; + // Unique name for this drop table + FString TableId; + + FRandomResultTableListing() : + FPlayFabBaseModel(), + CatalogVersion(), + Nodes(), + TableId() + {} + + FRandomResultTableListing(const FRandomResultTableListing& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + Nodes(src.Nodes), + TableId(src.TableId) + {} + + FRandomResultTableListing(const TSharedPtr& obj) : FRandomResultTableListing() + { + readFromValue(obj); + } + + ~FRandomResultTableListing(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetRandomResultTablesResult : public FPlayFabBaseModel + { + // [optional] array of random result tables currently available + TMap Tables; + FGetRandomResultTablesResult() : + FPlayFabBaseModel(), + Tables() + {} + + FGetRandomResultTablesResult(const FGetRandomResultTablesResult& src) : + FPlayFabBaseModel(), + Tables(src.Tables) + {} + + FGetRandomResultTablesResult(const TSharedPtr& obj) : FGetRandomResultTablesResult() + { + readFromValue(obj); + } + + ~FGetRandomResultTablesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSharedGroupDataRequest : public FPlayFabBaseModel + { + // [optional] If true, return the list of all members of the shared group. + Boxed GetMembers; + + /** + * [optional] Specific keys to retrieve from the shared group (if not specified, all keys will be returned, while an empty array + * indicates that no keys should be returned). + */ + TArray Keys; + // Unique identifier for the shared group. + FString SharedGroupId; + + FGetSharedGroupDataRequest() : + FPlayFabBaseModel(), + GetMembers(), + Keys(), + SharedGroupId() + {} + + FGetSharedGroupDataRequest(const FGetSharedGroupDataRequest& src) : + FPlayFabBaseModel(), + GetMembers(src.GetMembers), + Keys(src.Keys), + SharedGroupId(src.SharedGroupId) + {} + + FGetSharedGroupDataRequest(const TSharedPtr& obj) : FGetSharedGroupDataRequest() + { + readFromValue(obj); + } + + ~FGetSharedGroupDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSharedGroupDataRecord : public FPlayFabBaseModel + { + // Timestamp for when this data was last updated. + FDateTime LastUpdated; + + // [optional] PlayFabId of the user to last update this value. + FString LastUpdatedBy; + + // [optional] Indicates whether this data can be read by all users (public) or only members of the group (private). + Boxed Permission; + + // [optional] Data stored for the specified group data key. + FString Value; + + FSharedGroupDataRecord() : + FPlayFabBaseModel(), + LastUpdated(0), + LastUpdatedBy(), + Permission(), + Value() + {} + + FSharedGroupDataRecord(const FSharedGroupDataRecord& src) : + FPlayFabBaseModel(), + LastUpdated(src.LastUpdated), + LastUpdatedBy(src.LastUpdatedBy), + Permission(src.Permission), + Value(src.Value) + {} + + FSharedGroupDataRecord(const TSharedPtr& obj) : FSharedGroupDataRecord() + { + readFromValue(obj); + } + + ~FSharedGroupDataRecord(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSharedGroupDataResult : public FPlayFabBaseModel + { + // [optional] Data for the requested keys. + TMap Data; + // [optional] List of PlayFabId identifiers for the members of this group, if requested. + TArray Members; + FGetSharedGroupDataResult() : + FPlayFabBaseModel(), + Data(), + Members() + {} + + FGetSharedGroupDataResult(const FGetSharedGroupDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data), + Members(src.Members) + {} + + FGetSharedGroupDataResult(const TSharedPtr& obj) : FGetSharedGroupDataResult() + { + readFromValue(obj); + } + + ~FGetSharedGroupDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTimeRequest : public FPlayFabBaseModel + { + FGetTimeRequest() : + FPlayFabBaseModel() + {} + + FGetTimeRequest(const FGetTimeRequest& src) : + FPlayFabBaseModel() + {} + + FGetTimeRequest(const TSharedPtr& obj) : FGetTimeRequest() + { + readFromValue(obj); + } + + ~FGetTimeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTimeResult : public FPlayFabBaseModel + { + // Current server time when the request was received, in UTC + FDateTime Time; + + FGetTimeResult() : + FPlayFabBaseModel(), + Time(0) + {} + + FGetTimeResult(const FGetTimeResult& src) : + FPlayFabBaseModel(), + Time(src.Time) + {} + + FGetTimeResult(const TSharedPtr& obj) : FGetTimeResult() + { + readFromValue(obj); + } + + ~FGetTimeResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleDataRequest : public FPlayFabBaseModel + { + // [optional] Specific keys to search for in the title data (leave null to get all keys) + TArray Keys; + FGetTitleDataRequest() : + FPlayFabBaseModel(), + Keys() + {} + + FGetTitleDataRequest(const FGetTitleDataRequest& src) : + FPlayFabBaseModel(), + Keys(src.Keys) + {} + + FGetTitleDataRequest(const TSharedPtr& obj) : FGetTitleDataRequest() + { + readFromValue(obj); + } + + ~FGetTitleDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleDataResult : public FPlayFabBaseModel + { + // [optional] a dictionary object of key / value pairs + TMap Data; + FGetTitleDataResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetTitleDataResult(const FGetTitleDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetTitleDataResult(const TSharedPtr& obj) : FGetTitleDataResult() + { + readFromValue(obj); + } + + ~FGetTitleDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleNewsRequest : public FPlayFabBaseModel + { + // [optional] Limits the results to the last n entries. Defaults to 10 if not set. + Boxed Count; + + FGetTitleNewsRequest() : + FPlayFabBaseModel(), + Count() + {} + + FGetTitleNewsRequest(const FGetTitleNewsRequest& src) : + FPlayFabBaseModel(), + Count(src.Count) + {} + + FGetTitleNewsRequest(const TSharedPtr& obj) : FGetTitleNewsRequest() + { + readFromValue(obj); + } + + ~FGetTitleNewsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FTitleNewsItem : public FPlayFabBaseModel + { + // [optional] News item text. + FString Body; + + // [optional] Unique identifier of news item. + FString NewsId; + + // Date and time when the news items was posted. + FDateTime Timestamp; + + // [optional] Title of the news item. + FString Title; + + FTitleNewsItem() : + FPlayFabBaseModel(), + Body(), + NewsId(), + Timestamp(0), + Title() + {} + + FTitleNewsItem(const FTitleNewsItem& src) : + FPlayFabBaseModel(), + Body(src.Body), + NewsId(src.NewsId), + Timestamp(src.Timestamp), + Title(src.Title) + {} + + FTitleNewsItem(const TSharedPtr& obj) : FTitleNewsItem() + { + readFromValue(obj); + } + + ~FTitleNewsItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleNewsResult : public FPlayFabBaseModel + { + // [optional] Array of news items. + TArray News; + FGetTitleNewsResult() : + FPlayFabBaseModel(), + News() + {} + + FGetTitleNewsResult(const FGetTitleNewsResult& src) : + FPlayFabBaseModel(), + News(src.News) + {} + + FGetTitleNewsResult(const TSharedPtr& obj) : FGetTitleNewsResult() + { + readFromValue(obj); + } + + ~FGetTitleNewsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserAccountInfoRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserAccountInfoRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetUserAccountInfoRequest(const FGetUserAccountInfoRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetUserAccountInfoRequest(const TSharedPtr& obj) : FGetUserAccountInfoRequest() + { + readFromValue(obj); + } + + ~FGetUserAccountInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserAccountInfoResult : public FPlayFabBaseModel + { + // [optional] Account details for the user whose information was requested. + TSharedPtr UserInfo; + + FGetUserAccountInfoResult() : + FPlayFabBaseModel(), + UserInfo(nullptr) + {} + + FGetUserAccountInfoResult(const FGetUserAccountInfoResult& src) : + FPlayFabBaseModel(), + UserInfo(src.UserInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.UserInfo)) : nullptr) + {} + + FGetUserAccountInfoResult(const TSharedPtr& obj) : FGetUserAccountInfoResult() + { + readFromValue(obj); + } + + ~FGetUserAccountInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserBansRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserBansRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetUserBansRequest(const FGetUserBansRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetUserBansRequest(const TSharedPtr& obj) : FGetUserBansRequest() + { + readFromValue(obj); + } + + ~FGetUserBansRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserBansResult : public FPlayFabBaseModel + { + // [optional] Information about the bans + TArray BanData; + FGetUserBansResult() : + FPlayFabBaseModel(), + BanData() + {} + + FGetUserBansResult(const FGetUserBansResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FGetUserBansResult(const TSharedPtr& obj) : FGetUserBansResult() + { + readFromValue(obj); + } + + ~FGetUserBansResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserDataRequest : public FPlayFabBaseModel + { + /** + * [optional] The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + Boxed IfChangedFromDataVersion; + + // [optional] Specific keys to search for in the custom user data. + TArray Keys; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserDataRequest() : + FPlayFabBaseModel(), + IfChangedFromDataVersion(), + Keys(), + PlayFabId() + {} + + FGetUserDataRequest(const FGetUserDataRequest& src) : + FPlayFabBaseModel(), + IfChangedFromDataVersion(src.IfChangedFromDataVersion), + Keys(src.Keys), + PlayFabId(src.PlayFabId) + {} + + FGetUserDataRequest(const TSharedPtr& obj) : FGetUserDataRequest() + { + readFromValue(obj); + } + + ~FGetUserDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserDataResult : public FPlayFabBaseModel + { + // [optional] User specific data for this title. + TMap Data; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + // [optional] PlayFab unique identifier of the user whose custom data is being returned. + FString PlayFabId; + + FGetUserDataResult() : + FPlayFabBaseModel(), + Data(), + DataVersion(0), + PlayFabId() + {} + + FGetUserDataResult(const FGetUserDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data), + DataVersion(src.DataVersion), + PlayFabId(src.PlayFabId) + {} + + FGetUserDataResult(const TSharedPtr& obj) : FGetUserDataResult() + { + readFromValue(obj); + } + + ~FGetUserDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserInventoryRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserInventoryRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetUserInventoryRequest(const FGetUserInventoryRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetUserInventoryRequest(const TSharedPtr& obj) : FGetUserInventoryRequest() + { + readFromValue(obj); + } + + ~FGetUserInventoryRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserInventoryResult : public FPlayFabBaseModel + { + // [optional] Array of inventory items belonging to the user. + TArray Inventory; + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] Array of virtual currency balance(s) belonging to the user. + TMap VirtualCurrency; + // [optional] Array of remaining times and timestamps for virtual currencies. + TMap VirtualCurrencyRechargeTimes; + FGetUserInventoryResult() : + FPlayFabBaseModel(), + Inventory(), + PlayFabId(), + VirtualCurrency(), + VirtualCurrencyRechargeTimes() + {} + + FGetUserInventoryResult(const FGetUserInventoryResult& src) : + FPlayFabBaseModel(), + Inventory(src.Inventory), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency), + VirtualCurrencyRechargeTimes(src.VirtualCurrencyRechargeTimes) + {} + + FGetUserInventoryResult(const TSharedPtr& obj) : FGetUserInventoryResult() + { + readFromValue(obj); + } + + ~FGetUserInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantCharacterToUserRequest : public FPlayFabBaseModel + { + // Non-unique display name of the character being granted (1-20 characters in length). + FString CharacterName; + + // Type of the character being granted; statistics can be sliced based on this value. + FString CharacterType; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGrantCharacterToUserRequest() : + FPlayFabBaseModel(), + CharacterName(), + CharacterType(), + PlayFabId() + {} + + FGrantCharacterToUserRequest(const FGrantCharacterToUserRequest& src) : + FPlayFabBaseModel(), + CharacterName(src.CharacterName), + CharacterType(src.CharacterType), + PlayFabId(src.PlayFabId) + {} + + FGrantCharacterToUserRequest(const TSharedPtr& obj) : FGrantCharacterToUserRequest() + { + readFromValue(obj); + } + + ~FGrantCharacterToUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantCharacterToUserResult : public FPlayFabBaseModel + { + // [optional] Unique identifier tagged to this character. + FString CharacterId; + + FGrantCharacterToUserResult() : + FPlayFabBaseModel(), + CharacterId() + {} + + FGrantCharacterToUserResult(const FGrantCharacterToUserResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId) + {} + + FGrantCharacterToUserResult(const TSharedPtr& obj) : FGrantCharacterToUserResult() + { + readFromValue(obj); + } + + ~FGrantCharacterToUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantedItemInstance : public FPlayFabBaseModel + { + // [optional] Game specific comment associated with this instance when it was added to the user inventory. + FString Annotation; + + // [optional] Array of unique items that were awarded when this catalog item was purchased. + TArray BundleContents; + /** + * [optional] Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or + * container. + */ + FString BundleParent; + + // [optional] Catalog version for the inventory item, when this instance was created. + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] A set of custom key-value pairs on the inventory item. + TMap CustomData; + // [optional] CatalogItem.DisplayName at the time this item was purchased. + FString DisplayName; + + // [optional] Timestamp for when this instance will expire. + Boxed Expiration; + + // [optional] Class name for the inventory item, as defined in the catalog. + FString ItemClass; + + // [optional] Unique identifier for the inventory item, as defined in the catalog. + FString ItemId; + + // [optional] Unique item identifier for this specific instance of the item. + FString ItemInstanceId; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] Timestamp for when this instance was purchased. + Boxed PurchaseDate; + + // [optional] Total number of remaining uses, if this is a consumable item. + Boxed RemainingUses; + + // Result of this operation. + bool Result; + + // [optional] Currency type for the cost of the catalog item. + FString UnitCurrency; + + // Cost of the catalog item in the given currency. + uint32 UnitPrice; + + // [optional] The number of uses that were added or removed to this item in this call. + Boxed UsesIncrementedBy; + + FGrantedItemInstance() : + FPlayFabBaseModel(), + Annotation(), + BundleContents(), + BundleParent(), + CatalogVersion(), + CharacterId(), + CustomData(), + DisplayName(), + Expiration(), + ItemClass(), + ItemId(), + ItemInstanceId(), + PlayFabId(), + PurchaseDate(), + RemainingUses(), + Result(false), + UnitCurrency(), + UnitPrice(0), + UsesIncrementedBy() + {} + + FGrantedItemInstance(const FGrantedItemInstance& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + BundleContents(src.BundleContents), + BundleParent(src.BundleParent), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + CustomData(src.CustomData), + DisplayName(src.DisplayName), + Expiration(src.Expiration), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId), + PurchaseDate(src.PurchaseDate), + RemainingUses(src.RemainingUses), + Result(src.Result), + UnitCurrency(src.UnitCurrency), + UnitPrice(src.UnitPrice), + UsesIncrementedBy(src.UsesIncrementedBy) + {} + + FGrantedItemInstance(const TSharedPtr& obj) : FGrantedItemInstance() + { + readFromValue(obj); + } + + ~FGrantedItemInstance(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToCharacterRequest : public FPlayFabBaseModel + { + // [optional] String detailing any additional information concerning this operation. + FString Annotation; + + // [optional] Catalog version from which items are to be granted. + FString CatalogVersion; + + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] Array of itemIds to grant to the user. + TArray ItemIds; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGrantItemsToCharacterRequest() : + FPlayFabBaseModel(), + Annotation(), + CatalogVersion(), + CharacterId(), + ItemIds(), + PlayFabId() + {} + + FGrantItemsToCharacterRequest(const FGrantItemsToCharacterRequest& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + ItemIds(src.ItemIds), + PlayFabId(src.PlayFabId) + {} + + FGrantItemsToCharacterRequest(const TSharedPtr& obj) : FGrantItemsToCharacterRequest() + { + readFromValue(obj); + } + + ~FGrantItemsToCharacterRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToCharacterResult : public FPlayFabBaseModel + { + // [optional] Array of items granted to users. + TArray ItemGrantResults; + FGrantItemsToCharacterResult() : + FPlayFabBaseModel(), + ItemGrantResults() + {} + + FGrantItemsToCharacterResult(const FGrantItemsToCharacterResult& src) : + FPlayFabBaseModel(), + ItemGrantResults(src.ItemGrantResults) + {} + + FGrantItemsToCharacterResult(const TSharedPtr& obj) : FGrantItemsToCharacterResult() + { + readFromValue(obj); + } + + ~FGrantItemsToCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToUserRequest : public FPlayFabBaseModel + { + // [optional] String detailing any additional information concerning this operation. + FString Annotation; + + // [optional] Catalog version from which items are to be granted. + FString CatalogVersion; + + // Array of itemIds to grant to the user. + TArray ItemIds; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGrantItemsToUserRequest() : + FPlayFabBaseModel(), + Annotation(), + CatalogVersion(), + ItemIds(), + PlayFabId() + {} + + FGrantItemsToUserRequest(const FGrantItemsToUserRequest& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + CatalogVersion(src.CatalogVersion), + ItemIds(src.ItemIds), + PlayFabId(src.PlayFabId) + {} + + FGrantItemsToUserRequest(const TSharedPtr& obj) : FGrantItemsToUserRequest() + { + readFromValue(obj); + } + + ~FGrantItemsToUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToUserResult : public FPlayFabBaseModel + { + // [optional] Array of items granted to users. + TArray ItemGrantResults; + FGrantItemsToUserResult() : + FPlayFabBaseModel(), + ItemGrantResults() + {} + + FGrantItemsToUserResult(const FGrantItemsToUserResult& src) : + FPlayFabBaseModel(), + ItemGrantResults(src.ItemGrantResults) + {} + + FGrantItemsToUserResult(const TSharedPtr& obj) : FGrantItemsToUserResult() + { + readFromValue(obj); + } + + ~FGrantItemsToUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemGrant : public FPlayFabBaseModel + { + // [optional] String detailing any additional information concerning this operation. + FString Annotation; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + // Unique identifier of the catalog item to be granted to the user. + FString ItemId; + + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FItemGrant() : + FPlayFabBaseModel(), + Annotation(), + CharacterId(), + Data(), + ItemId(), + KeysToRemove(), + PlayFabId() + {} + + FItemGrant(const FItemGrant& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + CharacterId(src.CharacterId), + Data(src.Data), + ItemId(src.ItemId), + KeysToRemove(src.KeysToRemove), + PlayFabId(src.PlayFabId) + {} + + FItemGrant(const TSharedPtr& obj) : FItemGrant() + { + readFromValue(obj); + } + + ~FItemGrant(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToUsersRequest : public FPlayFabBaseModel + { + // [optional] Catalog version from which items are to be granted. + FString CatalogVersion; + + // Array of items to grant and the users to whom the items are to be granted. + TArray ItemGrants; + FGrantItemsToUsersRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + ItemGrants() + {} + + FGrantItemsToUsersRequest(const FGrantItemsToUsersRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + ItemGrants(src.ItemGrants) + {} + + FGrantItemsToUsersRequest(const TSharedPtr& obj) : FGrantItemsToUsersRequest() + { + readFromValue(obj); + } + + ~FGrantItemsToUsersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToUsersResult : public FPlayFabBaseModel + { + // [optional] Array of items granted to users. + TArray ItemGrantResults; + FGrantItemsToUsersResult() : + FPlayFabBaseModel(), + ItemGrantResults() + {} + + FGrantItemsToUsersResult(const FGrantItemsToUsersResult& src) : + FPlayFabBaseModel(), + ItemGrantResults(src.ItemGrantResults) + {} + + FGrantItemsToUsersResult(const TSharedPtr& obj) : FGrantItemsToUsersResult() + { + readFromValue(obj); + } + + ~FGrantItemsToUsersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListUsersCharactersRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FListUsersCharactersRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FListUsersCharactersRequest(const FListUsersCharactersRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FListUsersCharactersRequest(const TSharedPtr& obj) : FListUsersCharactersRequest() + { + readFromValue(obj); + } + + ~FListUsersCharactersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListUsersCharactersResult : public FPlayFabBaseModel + { + // [optional] The requested list of characters. + TArray Characters; + FListUsersCharactersResult() : + FPlayFabBaseModel(), + Characters() + {} + + FListUsersCharactersResult(const FListUsersCharactersResult& src) : + FPlayFabBaseModel(), + Characters(src.Characters) + {} + + FListUsersCharactersResult(const TSharedPtr& obj) : FListUsersCharactersResult() + { + readFromValue(obj); + } + + ~FListUsersCharactersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyCharacterVirtualCurrencyResult : public FPlayFabBaseModel + { + // Balance of the virtual currency after modification. + int32 Balance; + + // [optional] Name of the virtual currency which was modified. + FString VirtualCurrency; + + FModifyCharacterVirtualCurrencyResult() : + FPlayFabBaseModel(), + Balance(0), + VirtualCurrency() + {} + + FModifyCharacterVirtualCurrencyResult(const FModifyCharacterVirtualCurrencyResult& src) : + FPlayFabBaseModel(), + Balance(src.Balance), + VirtualCurrency(src.VirtualCurrency) + {} + + FModifyCharacterVirtualCurrencyResult(const TSharedPtr& obj) : FModifyCharacterVirtualCurrencyResult() + { + readFromValue(obj); + } + + ~FModifyCharacterVirtualCurrencyResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyItemUsesRequest : public FPlayFabBaseModel + { + // Unique instance identifier of the item to be modified. + FString ItemInstanceId; + + // PlayFab unique identifier of the user whose item is being modified. + FString PlayFabId; + + // Number of uses to add to the item. Can be negative to remove uses. + int32 UsesToAdd; + + FModifyItemUsesRequest() : + FPlayFabBaseModel(), + ItemInstanceId(), + PlayFabId(), + UsesToAdd(0) + {} + + FModifyItemUsesRequest(const FModifyItemUsesRequest& src) : + FPlayFabBaseModel(), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId), + UsesToAdd(src.UsesToAdd) + {} + + FModifyItemUsesRequest(const TSharedPtr& obj) : FModifyItemUsesRequest() + { + readFromValue(obj); + } + + ~FModifyItemUsesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyItemUsesResult : public FPlayFabBaseModel + { + // [optional] Unique instance identifier of the item with uses consumed. + FString ItemInstanceId; + + // Number of uses remaining on the item. + int32 RemainingUses; + + FModifyItemUsesResult() : + FPlayFabBaseModel(), + ItemInstanceId(), + RemainingUses(0) + {} + + FModifyItemUsesResult(const FModifyItemUsesResult& src) : + FPlayFabBaseModel(), + ItemInstanceId(src.ItemInstanceId), + RemainingUses(src.RemainingUses) + {} + + FModifyItemUsesResult(const TSharedPtr& obj) : FModifyItemUsesResult() + { + readFromValue(obj); + } + + ~FModifyItemUsesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyUserVirtualCurrencyResult : public FPlayFabBaseModel + { + // Balance of the virtual currency after modification. + int32 Balance; + + /** + * Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase + * over this value will be discarded. + */ + int32 BalanceChange; + + // [optional] User currency was subtracted from. + FString PlayFabId; + + // [optional] Name of the virtual currency which was modified. + FString VirtualCurrency; + + FModifyUserVirtualCurrencyResult() : + FPlayFabBaseModel(), + Balance(0), + BalanceChange(0), + PlayFabId(), + VirtualCurrency() + {} + + FModifyUserVirtualCurrencyResult(const FModifyUserVirtualCurrencyResult& src) : + FPlayFabBaseModel(), + Balance(src.Balance), + BalanceChange(src.BalanceChange), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FModifyUserVirtualCurrencyResult(const TSharedPtr& obj) : FModifyUserVirtualCurrencyResult() + { + readFromValue(obj); + } + + ~FModifyUserVirtualCurrencyResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMoveItemToCharacterFromCharacterRequest : public FPlayFabBaseModel + { + // Unique identifier of the character that currently has the item. + FString GivingCharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique identifier of the character that will be receiving the item. + FString ReceivingCharacterId; + + FMoveItemToCharacterFromCharacterRequest() : + FPlayFabBaseModel(), + GivingCharacterId(), + ItemInstanceId(), + PlayFabId(), + ReceivingCharacterId() + {} + + FMoveItemToCharacterFromCharacterRequest(const FMoveItemToCharacterFromCharacterRequest& src) : + FPlayFabBaseModel(), + GivingCharacterId(src.GivingCharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId), + ReceivingCharacterId(src.ReceivingCharacterId) + {} + + FMoveItemToCharacterFromCharacterRequest(const TSharedPtr& obj) : FMoveItemToCharacterFromCharacterRequest() + { + readFromValue(obj); + } + + ~FMoveItemToCharacterFromCharacterRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMoveItemToCharacterFromCharacterResult : public FPlayFabBaseModel + { + FMoveItemToCharacterFromCharacterResult() : + FPlayFabBaseModel() + {} + + FMoveItemToCharacterFromCharacterResult(const FMoveItemToCharacterFromCharacterResult& src) : + FPlayFabBaseModel() + {} + + FMoveItemToCharacterFromCharacterResult(const TSharedPtr& obj) : FMoveItemToCharacterFromCharacterResult() + { + readFromValue(obj); + } + + ~FMoveItemToCharacterFromCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMoveItemToCharacterFromUserRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FMoveItemToCharacterFromUserRequest() : + FPlayFabBaseModel(), + CharacterId(), + ItemInstanceId(), + PlayFabId() + {} + + FMoveItemToCharacterFromUserRequest(const FMoveItemToCharacterFromUserRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FMoveItemToCharacterFromUserRequest(const TSharedPtr& obj) : FMoveItemToCharacterFromUserRequest() + { + readFromValue(obj); + } + + ~FMoveItemToCharacterFromUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMoveItemToCharacterFromUserResult : public FPlayFabBaseModel + { + FMoveItemToCharacterFromUserResult() : + FPlayFabBaseModel() + {} + + FMoveItemToCharacterFromUserResult(const FMoveItemToCharacterFromUserResult& src) : + FPlayFabBaseModel() + {} + + FMoveItemToCharacterFromUserResult(const TSharedPtr& obj) : FMoveItemToCharacterFromUserResult() + { + readFromValue(obj); + } + + ~FMoveItemToCharacterFromUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMoveItemToUserFromCharacterRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FMoveItemToUserFromCharacterRequest() : + FPlayFabBaseModel(), + CharacterId(), + ItemInstanceId(), + PlayFabId() + {} + + FMoveItemToUserFromCharacterRequest(const FMoveItemToUserFromCharacterRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FMoveItemToUserFromCharacterRequest(const TSharedPtr& obj) : FMoveItemToUserFromCharacterRequest() + { + readFromValue(obj); + } + + ~FMoveItemToUserFromCharacterRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMoveItemToUserFromCharacterResult : public FPlayFabBaseModel + { + FMoveItemToUserFromCharacterResult() : + FPlayFabBaseModel() + {} + + FMoveItemToUserFromCharacterResult(const FMoveItemToUserFromCharacterResult& src) : + FPlayFabBaseModel() + {} + + FMoveItemToUserFromCharacterResult(const TSharedPtr& obj) : FMoveItemToUserFromCharacterResult() + { + readFromValue(obj); + } + + ~FMoveItemToUserFromCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FNotifyMatchmakerPlayerLeftRequest : public FPlayFabBaseModel + { + // Unique identifier of the Game Instance the user is leaving. + FString LobbyId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FNotifyMatchmakerPlayerLeftRequest() : + FPlayFabBaseModel(), + LobbyId(), + PlayFabId() + {} + + FNotifyMatchmakerPlayerLeftRequest(const FNotifyMatchmakerPlayerLeftRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId), + PlayFabId(src.PlayFabId) + {} + + FNotifyMatchmakerPlayerLeftRequest(const TSharedPtr& obj) : FNotifyMatchmakerPlayerLeftRequest() + { + readFromValue(obj); + } + + ~FNotifyMatchmakerPlayerLeftRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum PlayerConnectionState + { + PlayerConnectionStateUnassigned, + PlayerConnectionStateConnecting, + PlayerConnectionStateParticipating, + PlayerConnectionStateParticipated + }; + + PLAYFABCPP_API void writePlayerConnectionStateEnumJSON(PlayerConnectionState enumVal, JsonWriter& writer); + PLAYFABCPP_API PlayerConnectionState readPlayerConnectionStateFromValue(const TSharedPtr& value); + PLAYFABCPP_API PlayerConnectionState readPlayerConnectionStateFromValue(const FString& value); + + struct PLAYFABCPP_API FNotifyMatchmakerPlayerLeftResult : public FPlayFabBaseModel + { + // [optional] State of user leaving the Game Server Instance. + Boxed PlayerState; + + FNotifyMatchmakerPlayerLeftResult() : + FPlayFabBaseModel(), + PlayerState() + {} + + FNotifyMatchmakerPlayerLeftResult(const FNotifyMatchmakerPlayerLeftResult& src) : + FPlayFabBaseModel(), + PlayerState(src.PlayerState) + {} + + FNotifyMatchmakerPlayerLeftResult(const TSharedPtr& obj) : FNotifyMatchmakerPlayerLeftResult() + { + readFromValue(obj); + } + + ~FNotifyMatchmakerPlayerLeftResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPushNotificationPackage : public FPlayFabBaseModel + { + // Numerical badge to display on App icon (iOS only) + int32 Badge; + + // [optional] This must be a JSON formatted object. For use with developer-created custom Push Notification plugins + FString CustomData; + + // [optional] Icon file to display with the message (Not supported for iOS) + FString Icon; + + // Content of the message (all platforms) + FString Message; + + // [optional] Sound file to play with the message (all platforms) + FString Sound; + + // Title/Subject of the message. Not supported for iOS + FString Title; + + FPushNotificationPackage() : + FPlayFabBaseModel(), + Badge(0), + CustomData(), + Icon(), + Message(), + Sound(), + Title() + {} + + FPushNotificationPackage(const FPushNotificationPackage& src) : + FPlayFabBaseModel(), + Badge(src.Badge), + CustomData(src.CustomData), + Icon(src.Icon), + Message(src.Message), + Sound(src.Sound), + Title(src.Title) + {} + + FPushNotificationPackage(const TSharedPtr& obj) : FPushNotificationPackage() + { + readFromValue(obj); + } + + ~FPushNotificationPackage(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRedeemCouponRequest : public FPlayFabBaseModel + { + // [optional] Catalog version of the coupon. + FString CatalogVersion; + + // [optional] Optional identifier for the Character that should receive the item. If null, item is added to the player + FString CharacterId; + + // Generated coupon code to redeem. + FString CouponCode; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRedeemCouponRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + CouponCode(), + PlayFabId() + {} + + FRedeemCouponRequest(const FRedeemCouponRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + CouponCode(src.CouponCode), + PlayFabId(src.PlayFabId) + {} + + FRedeemCouponRequest(const TSharedPtr& obj) : FRedeemCouponRequest() + { + readFromValue(obj); + } + + ~FRedeemCouponRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRedeemCouponResult : public FPlayFabBaseModel + { + // [optional] Items granted to the player as a result of redeeming the coupon. + TArray GrantedItems; + FRedeemCouponResult() : + FPlayFabBaseModel(), + GrantedItems() + {} + + FRedeemCouponResult(const FRedeemCouponResult& src) : + FPlayFabBaseModel(), + GrantedItems(src.GrantedItems) + {} + + FRedeemCouponResult(const TSharedPtr& obj) : FRedeemCouponResult() + { + readFromValue(obj); + } + + ~FRedeemCouponResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRedeemMatchmakerTicketRequest : public FPlayFabBaseModel + { + // Unique identifier of the Game Server Instance that is asking for validation of the authorization ticket. + FString LobbyId; + + // Server authorization ticket passed back from a call to Matchmake or StartGame. + FString Ticket; + + FRedeemMatchmakerTicketRequest() : + FPlayFabBaseModel(), + LobbyId(), + Ticket() + {} + + FRedeemMatchmakerTicketRequest(const FRedeemMatchmakerTicketRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId), + Ticket(src.Ticket) + {} + + FRedeemMatchmakerTicketRequest(const TSharedPtr& obj) : FRedeemMatchmakerTicketRequest() + { + readFromValue(obj); + } + + ~FRedeemMatchmakerTicketRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRedeemMatchmakerTicketResult : public FPlayFabBaseModel + { + // [optional] Error value if the ticket was not validated. + FString Error; + + // Boolean indicating whether the ticket was validated by the PlayFab service. + bool TicketIsValid; + + // [optional] User account information for the user validated. + TSharedPtr UserInfo; + + FRedeemMatchmakerTicketResult() : + FPlayFabBaseModel(), + Error(), + TicketIsValid(false), + UserInfo(nullptr) + {} + + FRedeemMatchmakerTicketResult(const FRedeemMatchmakerTicketResult& src) : + FPlayFabBaseModel(), + Error(src.Error), + TicketIsValid(src.TicketIsValid), + UserInfo(src.UserInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.UserInfo)) : nullptr) + {} + + FRedeemMatchmakerTicketResult(const TSharedPtr& obj) : FRedeemMatchmakerTicketResult() + { + readFromValue(obj); + } + + ~FRedeemMatchmakerTicketResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRefreshGameServerInstanceHeartbeatRequest : public FPlayFabBaseModel + { + // Unique identifier of the Game Server Instance for which the heartbeat is updated. + FString LobbyId; + + FRefreshGameServerInstanceHeartbeatRequest() : + FPlayFabBaseModel(), + LobbyId() + {} + + FRefreshGameServerInstanceHeartbeatRequest(const FRefreshGameServerInstanceHeartbeatRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId) + {} + + FRefreshGameServerInstanceHeartbeatRequest(const TSharedPtr& obj) : FRefreshGameServerInstanceHeartbeatRequest() + { + readFromValue(obj); + } + + ~FRefreshGameServerInstanceHeartbeatRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRefreshGameServerInstanceHeartbeatResult : public FPlayFabBaseModel + { + FRefreshGameServerInstanceHeartbeatResult() : + FPlayFabBaseModel() + {} + + FRefreshGameServerInstanceHeartbeatResult(const FRefreshGameServerInstanceHeartbeatResult& src) : + FPlayFabBaseModel() + {} + + FRefreshGameServerInstanceHeartbeatResult(const TSharedPtr& obj) : FRefreshGameServerInstanceHeartbeatResult() + { + readFromValue(obj); + } + + ~FRefreshGameServerInstanceHeartbeatResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum Region + { + RegionUSCentral, + RegionUSEast, + RegionEUWest, + RegionSingapore, + RegionJapan, + RegionBrazil, + RegionAustralia + }; + + PLAYFABCPP_API void writeRegionEnumJSON(Region enumVal, JsonWriter& writer); + PLAYFABCPP_API Region readRegionFromValue(const TSharedPtr& value); + PLAYFABCPP_API Region readRegionFromValue(const FString& value); + + struct PLAYFABCPP_API FRegisterGameRequest : public FPlayFabBaseModel + { + // Unique identifier of the build running on the Game Server Instance. + FString Build; + + /** + * Game Mode the Game Server instance is running. Note that this must be defined in the Game Modes tab in the PlayFab Game + * Manager, along with the Build ID (the same Game Mode can be defined for multiple Build IDs). + */ + FString GameMode; + + // [optional] Previous lobby id if re-registering an existing game. + FString LobbyId; + + /** + * Region in which the Game Server Instance is running. For matchmaking using non-AWS region names, set this to any AWS + * region and use Tags (below) to specify your custom region. + */ + Region pfRegion; + + // [optional] IPV4 address of the Game Server Instance. + FString ServerHost; + + // [optional] IPV4 address of the game server instance. + FString ServerIPV4Address; + + // [optional] IPV6 address (if any) of the game server instance. + FString ServerIPV6Address; + + // Port number for communication with the Game Server Instance. + FString ServerPort; + + // [optional] Public DNS name (if any) of the server + FString ServerPublicDNSName; + + // [optional] Tags for the Game Server Instance + TMap Tags; + FRegisterGameRequest() : + FPlayFabBaseModel(), + Build(), + GameMode(), + LobbyId(), + pfRegion(), + ServerHost(), + ServerIPV4Address(), + ServerIPV6Address(), + ServerPort(), + ServerPublicDNSName(), + Tags() + {} + + FRegisterGameRequest(const FRegisterGameRequest& src) : + FPlayFabBaseModel(), + Build(src.Build), + GameMode(src.GameMode), + LobbyId(src.LobbyId), + pfRegion(src.pfRegion), + ServerHost(src.ServerHost), + ServerIPV4Address(src.ServerIPV4Address), + ServerIPV6Address(src.ServerIPV6Address), + ServerPort(src.ServerPort), + ServerPublicDNSName(src.ServerPublicDNSName), + Tags(src.Tags) + {} + + FRegisterGameRequest(const TSharedPtr& obj) : FRegisterGameRequest() + { + readFromValue(obj); + } + + ~FRegisterGameRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegisterGameResponse : public FPlayFabBaseModel + { + /** + * [optional] Unique identifier generated for the Game Server Instance that is registered. If LobbyId is specified in request and the + * game still exists in PlayFab, the LobbyId in request is returned. Otherwise a new lobby id will be returned. + */ + FString LobbyId; + + FRegisterGameResponse() : + FPlayFabBaseModel(), + LobbyId() + {} + + FRegisterGameResponse(const FRegisterGameResponse& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId) + {} + + FRegisterGameResponse(const TSharedPtr& obj) : FRegisterGameResponse() + { + readFromValue(obj); + } + + ~FRegisterGameResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveFriendRequest : public FPlayFabBaseModel + { + // PlayFab identifier of the friend account which is to be removed. + FString FriendPlayFabId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRemoveFriendRequest() : + FPlayFabBaseModel(), + FriendPlayFabId(), + PlayFabId() + {} + + FRemoveFriendRequest(const FRemoveFriendRequest& src) : + FPlayFabBaseModel(), + FriendPlayFabId(src.FriendPlayFabId), + PlayFabId(src.PlayFabId) + {} + + FRemoveFriendRequest(const TSharedPtr& obj) : FRemoveFriendRequest() + { + readFromValue(obj); + } + + ~FRemoveFriendRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemovePlayerTagRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique tag for player profile. + FString TagName; + + FRemovePlayerTagRequest() : + FPlayFabBaseModel(), + PlayFabId(), + TagName() + {} + + FRemovePlayerTagRequest(const FRemovePlayerTagRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + TagName(src.TagName) + {} + + FRemovePlayerTagRequest(const TSharedPtr& obj) : FRemovePlayerTagRequest() + { + readFromValue(obj); + } + + ~FRemovePlayerTagRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemovePlayerTagResult : public FPlayFabBaseModel + { + FRemovePlayerTagResult() : + FPlayFabBaseModel() + {} + + FRemovePlayerTagResult(const FRemovePlayerTagResult& src) : + FPlayFabBaseModel() + {} + + FRemovePlayerTagResult(const TSharedPtr& obj) : FRemovePlayerTagResult() + { + readFromValue(obj); + } + + ~FRemovePlayerTagResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveSharedGroupMembersRequest : public FPlayFabBaseModel + { + // An array of unique PlayFab assigned ID of the user on whom the operation will be performed. + TArray PlayFabIds; + // Unique identifier for the shared group. + FString SharedGroupId; + + FRemoveSharedGroupMembersRequest() : + FPlayFabBaseModel(), + PlayFabIds(), + SharedGroupId() + {} + + FRemoveSharedGroupMembersRequest(const FRemoveSharedGroupMembersRequest& src) : + FPlayFabBaseModel(), + PlayFabIds(src.PlayFabIds), + SharedGroupId(src.SharedGroupId) + {} + + FRemoveSharedGroupMembersRequest(const TSharedPtr& obj) : FRemoveSharedGroupMembersRequest() + { + readFromValue(obj); + } + + ~FRemoveSharedGroupMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveSharedGroupMembersResult : public FPlayFabBaseModel + { + FRemoveSharedGroupMembersResult() : + FPlayFabBaseModel() + {} + + FRemoveSharedGroupMembersResult(const FRemoveSharedGroupMembersResult& src) : + FPlayFabBaseModel() + {} + + FRemoveSharedGroupMembersResult(const TSharedPtr& obj) : FRemoveSharedGroupMembersResult() + { + readFromValue(obj); + } + + ~FRemoveSharedGroupMembersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FReportPlayerServerRequest : public FPlayFabBaseModel + { + // [optional] Optional additional comment by reporting player. + FString Comment; + + // Unique PlayFab identifier of the reported player. + FString ReporteeId; + + // PlayFabId of the reporting player. + FString ReporterId; + + FReportPlayerServerRequest() : + FPlayFabBaseModel(), + Comment(), + ReporteeId(), + ReporterId() + {} + + FReportPlayerServerRequest(const FReportPlayerServerRequest& src) : + FPlayFabBaseModel(), + Comment(src.Comment), + ReporteeId(src.ReporteeId), + ReporterId(src.ReporterId) + {} + + FReportPlayerServerRequest(const TSharedPtr& obj) : FReportPlayerServerRequest() + { + readFromValue(obj); + } + + ~FReportPlayerServerRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FReportPlayerServerResult : public FPlayFabBaseModel + { + // The number of remaining reports which may be filed today by this reporting player. + int32 SubmissionsRemaining; + + FReportPlayerServerResult() : + FPlayFabBaseModel(), + SubmissionsRemaining(0) + {} + + FReportPlayerServerResult(const FReportPlayerServerResult& src) : + FPlayFabBaseModel(), + SubmissionsRemaining(src.SubmissionsRemaining) + {} + + FReportPlayerServerResult(const TSharedPtr& obj) : FReportPlayerServerResult() + { + readFromValue(obj); + } + + ~FReportPlayerServerResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeAllBansForUserRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRevokeAllBansForUserRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FRevokeAllBansForUserRequest(const FRevokeAllBansForUserRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FRevokeAllBansForUserRequest(const TSharedPtr& obj) : FRevokeAllBansForUserRequest() + { + readFromValue(obj); + } + + ~FRevokeAllBansForUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeAllBansForUserResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were revoked. + TArray BanData; + FRevokeAllBansForUserResult() : + FPlayFabBaseModel(), + BanData() + {} + + FRevokeAllBansForUserResult(const FRevokeAllBansForUserResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FRevokeAllBansForUserResult(const TSharedPtr& obj) : FRevokeAllBansForUserResult() + { + readFromValue(obj); + } + + ~FRevokeAllBansForUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeBansRequest : public FPlayFabBaseModel + { + // Ids of the bans to be revoked. Maximum 100. + TArray BanIds; + FRevokeBansRequest() : + FPlayFabBaseModel(), + BanIds() + {} + + FRevokeBansRequest(const FRevokeBansRequest& src) : + FPlayFabBaseModel(), + BanIds(src.BanIds) + {} + + FRevokeBansRequest(const TSharedPtr& obj) : FRevokeBansRequest() + { + readFromValue(obj); + } + + ~FRevokeBansRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeBansResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were revoked + TArray BanData; + FRevokeBansResult() : + FPlayFabBaseModel(), + BanData() + {} + + FRevokeBansResult(const FRevokeBansResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FRevokeBansResult(const TSharedPtr& obj) : FRevokeBansResult() + { + readFromValue(obj); + } + + ~FRevokeBansResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItem : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRevokeInventoryItem() : + FPlayFabBaseModel(), + CharacterId(), + ItemInstanceId(), + PlayFabId() + {} + + FRevokeInventoryItem(const FRevokeInventoryItem& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FRevokeInventoryItem(const TSharedPtr& obj) : FRevokeInventoryItem() + { + readFromValue(obj); + } + + ~FRevokeInventoryItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItemRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRevokeInventoryItemRequest() : + FPlayFabBaseModel(), + CharacterId(), + ItemInstanceId(), + PlayFabId() + {} + + FRevokeInventoryItemRequest(const FRevokeInventoryItemRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FRevokeInventoryItemRequest(const TSharedPtr& obj) : FRevokeInventoryItemRequest() + { + readFromValue(obj); + } + + ~FRevokeInventoryItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItemsRequest : public FPlayFabBaseModel + { + // Array of player items to revoke, between 1 and 25 items. + TArray Items; + FRevokeInventoryItemsRequest() : + FPlayFabBaseModel(), + Items() + {} + + FRevokeInventoryItemsRequest(const FRevokeInventoryItemsRequest& src) : + FPlayFabBaseModel(), + Items(src.Items) + {} + + FRevokeInventoryItemsRequest(const TSharedPtr& obj) : FRevokeInventoryItemsRequest() + { + readFromValue(obj); + } + + ~FRevokeInventoryItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeItemError : public FPlayFabBaseModel + { + // [optional] Specific error that was encountered. + FString Error; + + // [optional] Item information that failed to be revoked. + TSharedPtr Item; + + FRevokeItemError() : + FPlayFabBaseModel(), + Error(), + Item(nullptr) + {} + + FRevokeItemError(const FRevokeItemError& src) : + FPlayFabBaseModel(), + Error(src.Error), + Item(src.Item.IsValid() ? MakeShareable(new FRevokeInventoryItem(*src.Item)) : nullptr) + {} + + FRevokeItemError(const TSharedPtr& obj) : FRevokeItemError() + { + readFromValue(obj); + } + + ~FRevokeItemError(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItemsResult : public FPlayFabBaseModel + { + // [optional] Collection of any errors that occurred during processing. + TArray Errors; + FRevokeInventoryItemsResult() : + FPlayFabBaseModel(), + Errors() + {} + + FRevokeInventoryItemsResult(const FRevokeInventoryItemsResult& src) : + FPlayFabBaseModel(), + Errors(src.Errors) + {} + + FRevokeInventoryItemsResult(const TSharedPtr& obj) : FRevokeInventoryItemsResult() + { + readFromValue(obj); + } + + ~FRevokeInventoryItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryResult : public FPlayFabBaseModel + { + FRevokeInventoryResult() : + FPlayFabBaseModel() + {} + + FRevokeInventoryResult(const FRevokeInventoryResult& src) : + FPlayFabBaseModel() + {} + + FRevokeInventoryResult(const TSharedPtr& obj) : FRevokeInventoryResult() + { + readFromValue(obj); + } + + ~FRevokeInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendCustomAccountRecoveryEmailRequest : public FPlayFabBaseModel + { + // [optional] User email address attached to their account + FString Email; + + // The email template id of the account recovery email template to send. + FString EmailTemplateId; + + // [optional] The user's username requesting an account recovery. + FString Username; + + FSendCustomAccountRecoveryEmailRequest() : + FPlayFabBaseModel(), + Email(), + EmailTemplateId(), + Username() + {} + + FSendCustomAccountRecoveryEmailRequest(const FSendCustomAccountRecoveryEmailRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + EmailTemplateId(src.EmailTemplateId), + Username(src.Username) + {} + + FSendCustomAccountRecoveryEmailRequest(const TSharedPtr& obj) : FSendCustomAccountRecoveryEmailRequest() + { + readFromValue(obj); + } + + ~FSendCustomAccountRecoveryEmailRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendCustomAccountRecoveryEmailResult : public FPlayFabBaseModel + { + FSendCustomAccountRecoveryEmailResult() : + FPlayFabBaseModel() + {} + + FSendCustomAccountRecoveryEmailResult(const FSendCustomAccountRecoveryEmailResult& src) : + FPlayFabBaseModel() + {} + + FSendCustomAccountRecoveryEmailResult(const TSharedPtr& obj) : FSendCustomAccountRecoveryEmailResult() + { + readFromValue(obj); + } + + ~FSendCustomAccountRecoveryEmailResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendEmailFromTemplateRequest : public FPlayFabBaseModel + { + // The email template id of the email template to send. + FString EmailTemplateId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FSendEmailFromTemplateRequest() : + FPlayFabBaseModel(), + EmailTemplateId(), + PlayFabId() + {} + + FSendEmailFromTemplateRequest(const FSendEmailFromTemplateRequest& src) : + FPlayFabBaseModel(), + EmailTemplateId(src.EmailTemplateId), + PlayFabId(src.PlayFabId) + {} + + FSendEmailFromTemplateRequest(const TSharedPtr& obj) : FSendEmailFromTemplateRequest() + { + readFromValue(obj); + } + + ~FSendEmailFromTemplateRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendEmailFromTemplateResult : public FPlayFabBaseModel + { + FSendEmailFromTemplateResult() : + FPlayFabBaseModel() + {} + + FSendEmailFromTemplateResult(const FSendEmailFromTemplateResult& src) : + FPlayFabBaseModel() + {} + + FSendEmailFromTemplateResult(const TSharedPtr& obj) : FSendEmailFromTemplateResult() + { + readFromValue(obj); + } + + ~FSendEmailFromTemplateResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendPushNotificationRequest : public FPlayFabBaseModel + { + /** + * [optional] Allows you to provide precisely formatted json to target devices. This is an advanced feature, allowing you to deliver + * to custom plugin logic, fields, or functionality not natively supported by PlayFab. + */ + TArray AdvancedPlatformDelivery; + // [optional] Text of message to send. + FString Message; + + /** + * [optional] Defines all possible push attributes like message, title, icon, etc. Some parameters are device specific - please see + * the PushNotificationPackage documentation for details. + */ + TSharedPtr Package; + + // PlayFabId of the recipient of the push notification. + FString Recipient; + + // [optional] Subject of message to send (may not be displayed in all platforms) + FString Subject; + + // [optional] Target Platforms that should receive the Message or Package. If omitted, we will send to all available platforms. + TArray TargetPlatforms; + FSendPushNotificationRequest() : + FPlayFabBaseModel(), + AdvancedPlatformDelivery(), + Message(), + Package(nullptr), + Recipient(), + Subject(), + TargetPlatforms() + {} + + FSendPushNotificationRequest(const FSendPushNotificationRequest& src) : + FPlayFabBaseModel(), + AdvancedPlatformDelivery(src.AdvancedPlatformDelivery), + Message(src.Message), + Package(src.Package.IsValid() ? MakeShareable(new FPushNotificationPackage(*src.Package)) : nullptr), + Recipient(src.Recipient), + Subject(src.Subject), + TargetPlatforms(src.TargetPlatforms) + {} + + FSendPushNotificationRequest(const TSharedPtr& obj) : FSendPushNotificationRequest() + { + readFromValue(obj); + } + + ~FSendPushNotificationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendPushNotificationResult : public FPlayFabBaseModel + { + FSendPushNotificationResult() : + FPlayFabBaseModel() + {} + + FSendPushNotificationResult(const FSendPushNotificationResult& src) : + FPlayFabBaseModel() + {} + + FSendPushNotificationResult(const TSharedPtr& obj) : FSendPushNotificationResult() + { + readFromValue(obj); + } + + ~FSendPushNotificationResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetFriendTagsRequest : public FPlayFabBaseModel + { + // PlayFab identifier of the friend account to which the tag(s) should be applied. + FString FriendPlayFabId; + + // PlayFab identifier of the player whose friend is to be updated. + FString PlayFabId; + + // Array of tags to set on the friend account. + TArray Tags; + FSetFriendTagsRequest() : + FPlayFabBaseModel(), + FriendPlayFabId(), + PlayFabId(), + Tags() + {} + + FSetFriendTagsRequest(const FSetFriendTagsRequest& src) : + FPlayFabBaseModel(), + FriendPlayFabId(src.FriendPlayFabId), + PlayFabId(src.PlayFabId), + Tags(src.Tags) + {} + + FSetFriendTagsRequest(const TSharedPtr& obj) : FSetFriendTagsRequest() + { + readFromValue(obj); + } + + ~FSetFriendTagsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGameServerInstanceDataRequest : public FPlayFabBaseModel + { + // Custom data to set for the specified game server instance. + FString GameServerData; + + // Unique identifier of the Game Instance to be updated, in decimal format. + FString LobbyId; + + FSetGameServerInstanceDataRequest() : + FPlayFabBaseModel(), + GameServerData(), + LobbyId() + {} + + FSetGameServerInstanceDataRequest(const FSetGameServerInstanceDataRequest& src) : + FPlayFabBaseModel(), + GameServerData(src.GameServerData), + LobbyId(src.LobbyId) + {} + + FSetGameServerInstanceDataRequest(const TSharedPtr& obj) : FSetGameServerInstanceDataRequest() + { + readFromValue(obj); + } + + ~FSetGameServerInstanceDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGameServerInstanceDataResult : public FPlayFabBaseModel + { + FSetGameServerInstanceDataResult() : + FPlayFabBaseModel() + {} + + FSetGameServerInstanceDataResult(const FSetGameServerInstanceDataResult& src) : + FPlayFabBaseModel() + {} + + FSetGameServerInstanceDataResult(const TSharedPtr& obj) : FSetGameServerInstanceDataResult() + { + readFromValue(obj); + } + + ~FSetGameServerInstanceDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGameServerInstanceStateRequest : public FPlayFabBaseModel + { + // Unique identifier of the Game Instance to be updated, in decimal format. + FString LobbyId; + + // State to set for the specified game server instance. + GameInstanceState State; + + FSetGameServerInstanceStateRequest() : + FPlayFabBaseModel(), + LobbyId(), + State() + {} + + FSetGameServerInstanceStateRequest(const FSetGameServerInstanceStateRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId), + State(src.State) + {} + + FSetGameServerInstanceStateRequest(const TSharedPtr& obj) : FSetGameServerInstanceStateRequest() + { + readFromValue(obj); + } + + ~FSetGameServerInstanceStateRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGameServerInstanceStateResult : public FPlayFabBaseModel + { + FSetGameServerInstanceStateResult() : + FPlayFabBaseModel() + {} + + FSetGameServerInstanceStateResult(const FSetGameServerInstanceStateResult& src) : + FPlayFabBaseModel() + {} + + FSetGameServerInstanceStateResult(const TSharedPtr& obj) : FSetGameServerInstanceStateResult() + { + readFromValue(obj); + } + + ~FSetGameServerInstanceStateResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGameServerInstanceTagsRequest : public FPlayFabBaseModel + { + // Unique identifier of the Game Server Instance to be updated. + FString LobbyId; + + /** + * Tags to set for the specified Game Server Instance. Note that this is the complete list of tags to be associated with + * the Game Server Instance. + */ + TMap Tags; + FSetGameServerInstanceTagsRequest() : + FPlayFabBaseModel(), + LobbyId(), + Tags() + {} + + FSetGameServerInstanceTagsRequest(const FSetGameServerInstanceTagsRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId), + Tags(src.Tags) + {} + + FSetGameServerInstanceTagsRequest(const TSharedPtr& obj) : FSetGameServerInstanceTagsRequest() + { + readFromValue(obj); + } + + ~FSetGameServerInstanceTagsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGameServerInstanceTagsResult : public FPlayFabBaseModel + { + FSetGameServerInstanceTagsResult() : + FPlayFabBaseModel() + {} + + FSetGameServerInstanceTagsResult(const FSetGameServerInstanceTagsResult& src) : + FPlayFabBaseModel() + {} + + FSetGameServerInstanceTagsResult(const TSharedPtr& obj) : FSetGameServerInstanceTagsResult() + { + readFromValue(obj); + } + + ~FSetGameServerInstanceTagsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPlayerSecretRequest : public FPlayFabBaseModel + { + // Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FSetPlayerSecretRequest() : + FPlayFabBaseModel(), + PlayerSecret(), + PlayFabId() + {} + + FSetPlayerSecretRequest(const FSetPlayerSecretRequest& src) : + FPlayFabBaseModel(), + PlayerSecret(src.PlayerSecret), + PlayFabId(src.PlayFabId) + {} + + FSetPlayerSecretRequest(const TSharedPtr& obj) : FSetPlayerSecretRequest() + { + readFromValue(obj); + } + + ~FSetPlayerSecretRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPlayerSecretResult : public FPlayFabBaseModel + { + FSetPlayerSecretResult() : + FPlayFabBaseModel() + {} + + FSetPlayerSecretResult(const FSetPlayerSecretResult& src) : + FPlayFabBaseModel() + {} + + FSetPlayerSecretResult(const TSharedPtr& obj) : FSetPlayerSecretResult() + { + readFromValue(obj); + } + + ~FSetPlayerSecretResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPublisherDataRequest : public FPlayFabBaseModel + { + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + FString Key; + + // [optional] new value to set. Set to null to remove a value + FString Value; + + FSetPublisherDataRequest() : + FPlayFabBaseModel(), + Key(), + Value() + {} + + FSetPublisherDataRequest(const FSetPublisherDataRequest& src) : + FPlayFabBaseModel(), + Key(src.Key), + Value(src.Value) + {} + + FSetPublisherDataRequest(const TSharedPtr& obj) : FSetPublisherDataRequest() + { + readFromValue(obj); + } + + ~FSetPublisherDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPublisherDataResult : public FPlayFabBaseModel + { + FSetPublisherDataResult() : + FPlayFabBaseModel() + {} + + FSetPublisherDataResult(const FSetPublisherDataResult& src) : + FPlayFabBaseModel() + {} + + FSetPublisherDataResult(const TSharedPtr& obj) : FSetPublisherDataResult() + { + readFromValue(obj); + } + + ~FSetPublisherDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetTitleDataRequest : public FPlayFabBaseModel + { + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + FString Key; + + // [optional] new value to set. Set to null to remove a value + FString Value; + + FSetTitleDataRequest() : + FPlayFabBaseModel(), + Key(), + Value() + {} + + FSetTitleDataRequest(const FSetTitleDataRequest& src) : + FPlayFabBaseModel(), + Key(src.Key), + Value(src.Value) + {} + + FSetTitleDataRequest(const TSharedPtr& obj) : FSetTitleDataRequest() + { + readFromValue(obj); + } + + ~FSetTitleDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetTitleDataResult : public FPlayFabBaseModel + { + FSetTitleDataResult() : + FPlayFabBaseModel() + {} + + FSetTitleDataResult(const FSetTitleDataResult& src) : + FPlayFabBaseModel() + {} + + FSetTitleDataResult(const TSharedPtr& obj) : FSetTitleDataResult() + { + readFromValue(obj); + } + + ~FSetTitleDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticUpdate : public FPlayFabBaseModel + { + // unique name of the statistic + FString StatisticName; + + // statistic value for the player + int32 Value; + + /** + * [optional] for updates to an existing statistic value for a player, the version of the statistic when it was loaded. Null when + * setting the statistic value for the first time. + */ + Boxed Version; + + FStatisticUpdate() : + FPlayFabBaseModel(), + StatisticName(), + Value(0), + Version() + {} + + FStatisticUpdate(const FStatisticUpdate& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName), + Value(src.Value), + Version(src.Version) + {} + + FStatisticUpdate(const TSharedPtr& obj) : FStatisticUpdate() + { + readFromValue(obj); + } + + ~FStatisticUpdate(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSubtractCharacterVirtualCurrencyRequest : public FPlayFabBaseModel + { + // Amount to be subtracted from the user balance of the specified virtual currency. + int32 Amount; + + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Name of the virtual currency which is to be decremented. + FString VirtualCurrency; + + FSubtractCharacterVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + CharacterId(), + PlayFabId(), + VirtualCurrency() + {} + + FSubtractCharacterVirtualCurrencyRequest(const FSubtractCharacterVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + CharacterId(src.CharacterId), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FSubtractCharacterVirtualCurrencyRequest(const TSharedPtr& obj) : FSubtractCharacterVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FSubtractCharacterVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSubtractUserVirtualCurrencyRequest : public FPlayFabBaseModel + { + // Amount to be subtracted from the user balance of the specified virtual currency. + int32 Amount; + + // PlayFab unique identifier of the user whose virtual currency balance is to be decreased. + FString PlayFabId; + + // Name of the virtual currency which is to be decremented. + FString VirtualCurrency; + + FSubtractUserVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + PlayFabId(), + VirtualCurrency() + {} + + FSubtractUserVirtualCurrencyRequest(const FSubtractUserVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FSubtractUserVirtualCurrencyRequest(const TSharedPtr& obj) : FSubtractUserVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FSubtractUserVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlockContainerInstanceRequest : public FPlayFabBaseModel + { + /** + * [optional] Specifies the catalog version that should be used to determine container contents. If unspecified, uses catalog + * associated with the item instance. + */ + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // ItemInstanceId of the container to unlock. + FString ContainerItemInstanceId; + + /** + * [optional] ItemInstanceId of the key that will be consumed by unlocking this container. If the container requires a key, this + * parameter is required. + */ + FString KeyItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUnlockContainerInstanceRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + ContainerItemInstanceId(), + KeyItemInstanceId(), + PlayFabId() + {} + + FUnlockContainerInstanceRequest(const FUnlockContainerInstanceRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + ContainerItemInstanceId(src.ContainerItemInstanceId), + KeyItemInstanceId(src.KeyItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FUnlockContainerInstanceRequest(const TSharedPtr& obj) : FUnlockContainerInstanceRequest() + { + readFromValue(obj); + } + + ~FUnlockContainerInstanceRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlockContainerItemRequest : public FPlayFabBaseModel + { + /** + * [optional] Specifies the catalog version that should be used to determine container contents. If unspecified, uses default/primary + * catalog. + */ + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Catalog ItemId of the container type to unlock. + FString ContainerItemId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUnlockContainerItemRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + ContainerItemId(), + PlayFabId() + {} + + FUnlockContainerItemRequest(const FUnlockContainerItemRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + ContainerItemId(src.ContainerItemId), + PlayFabId(src.PlayFabId) + {} + + FUnlockContainerItemRequest(const TSharedPtr& obj) : FUnlockContainerItemRequest() + { + readFromValue(obj); + } + + ~FUnlockContainerItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlockContainerItemResult : public FPlayFabBaseModel + { + // [optional] Items granted to the player as a result of unlocking the container. + TArray GrantedItems; + // [optional] Unique instance identifier of the container unlocked. + FString UnlockedItemInstanceId; + + // [optional] Unique instance identifier of the key used to unlock the container, if applicable. + FString UnlockedWithItemInstanceId; + + // [optional] Virtual currency granted to the player as a result of unlocking the container. + TMap VirtualCurrency; + FUnlockContainerItemResult() : + FPlayFabBaseModel(), + GrantedItems(), + UnlockedItemInstanceId(), + UnlockedWithItemInstanceId(), + VirtualCurrency() + {} + + FUnlockContainerItemResult(const FUnlockContainerItemResult& src) : + FPlayFabBaseModel(), + GrantedItems(src.GrantedItems), + UnlockedItemInstanceId(src.UnlockedItemInstanceId), + UnlockedWithItemInstanceId(src.UnlockedWithItemInstanceId), + VirtualCurrency(src.VirtualCurrency) + {} + + FUnlockContainerItemResult(const TSharedPtr& obj) : FUnlockContainerItemResult() + { + readFromValue(obj); + } + + ~FUnlockContainerItemResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateAvatarUrlRequest : public FPlayFabBaseModel + { + // URL of the avatar image. If empty, it removes the existing avatar URL. + FString ImageUrl; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateAvatarUrlRequest() : + FPlayFabBaseModel(), + ImageUrl(), + PlayFabId() + {} + + FUpdateAvatarUrlRequest(const FUpdateAvatarUrlRequest& src) : + FPlayFabBaseModel(), + ImageUrl(src.ImageUrl), + PlayFabId(src.PlayFabId) + {} + + FUpdateAvatarUrlRequest(const TSharedPtr& obj) : FUpdateAvatarUrlRequest() + { + readFromValue(obj); + } + + ~FUpdateAvatarUrlRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateBanRequest : public FPlayFabBaseModel + { + // [optional] The updated active state for the ban. Null for no change. + Boxed Active; + + // The id of the ban to be updated. + FString BanId; + + // [optional] The updated expiration date for the ban. Null for no change. + Boxed Expires; + + // [optional] The updated IP address for the ban. Null for no change. + FString IPAddress; + + // [optional] The updated MAC address for the ban. Null for no change. + FString MACAddress; + + // [optional] Whether to make this ban permanent. Set to true to make this ban permanent. This will not modify Active state. + Boxed Permanent; + + // [optional] The updated reason for the ban to be updated. Maximum 140 characters. Null for no change. + FString Reason; + + FUpdateBanRequest() : + FPlayFabBaseModel(), + Active(), + BanId(), + Expires(), + IPAddress(), + MACAddress(), + Permanent(), + Reason() + {} + + FUpdateBanRequest(const FUpdateBanRequest& src) : + FPlayFabBaseModel(), + Active(src.Active), + BanId(src.BanId), + Expires(src.Expires), + IPAddress(src.IPAddress), + MACAddress(src.MACAddress), + Permanent(src.Permanent), + Reason(src.Reason) + {} + + FUpdateBanRequest(const TSharedPtr& obj) : FUpdateBanRequest() + { + readFromValue(obj); + } + + ~FUpdateBanRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateBansRequest : public FPlayFabBaseModel + { + // List of bans to be updated. Maximum 100. + TArray Bans; + FUpdateBansRequest() : + FPlayFabBaseModel(), + Bans() + {} + + FUpdateBansRequest(const FUpdateBansRequest& src) : + FPlayFabBaseModel(), + Bans(src.Bans) + {} + + FUpdateBansRequest(const TSharedPtr& obj) : FUpdateBansRequest() + { + readFromValue(obj); + } + + ~FUpdateBansRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateBansResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were updated + TArray BanData; + FUpdateBansResult() : + FPlayFabBaseModel(), + BanData() + {} + + FUpdateBansResult(const FUpdateBansResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FUpdateBansResult(const TSharedPtr& obj) : FUpdateBansResult() + { + readFromValue(obj); + } + + ~FUpdateBansResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterDataRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // [optional] Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. + Boxed Permission; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateCharacterDataRequest() : + FPlayFabBaseModel(), + CharacterId(), + Data(), + KeysToRemove(), + Permission(), + PlayFabId() + {} + + FUpdateCharacterDataRequest(const FUpdateCharacterDataRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission), + PlayFabId(src.PlayFabId) + {} + + FUpdateCharacterDataRequest(const TSharedPtr& obj) : FUpdateCharacterDataRequest() + { + readFromValue(obj); + } + + ~FUpdateCharacterDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterDataResult : public FPlayFabBaseModel + { + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FUpdateCharacterDataResult() : + FPlayFabBaseModel(), + DataVersion(0) + {} + + FUpdateCharacterDataResult(const FUpdateCharacterDataResult& src) : + FPlayFabBaseModel(), + DataVersion(src.DataVersion) + {} + + FUpdateCharacterDataResult(const TSharedPtr& obj) : FUpdateCharacterDataResult() + { + readFromValue(obj); + } + + ~FUpdateCharacterDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterStatisticsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] Statistics to be updated with the provided values. + TMap CharacterStatistics; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateCharacterStatisticsRequest() : + FPlayFabBaseModel(), + CharacterId(), + CharacterStatistics(), + PlayFabId() + {} + + FUpdateCharacterStatisticsRequest(const FUpdateCharacterStatisticsRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterStatistics(src.CharacterStatistics), + PlayFabId(src.PlayFabId) + {} + + FUpdateCharacterStatisticsRequest(const TSharedPtr& obj) : FUpdateCharacterStatisticsRequest() + { + readFromValue(obj); + } + + ~FUpdateCharacterStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterStatisticsResult : public FPlayFabBaseModel + { + FUpdateCharacterStatisticsResult() : + FPlayFabBaseModel() + {} + + FUpdateCharacterStatisticsResult(const FUpdateCharacterStatisticsResult& src) : + FPlayFabBaseModel() + {} + + FUpdateCharacterStatisticsResult(const TSharedPtr& obj) : FUpdateCharacterStatisticsResult() + { + readFromValue(obj); + } + + ~FUpdateCharacterStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerStatisticsRequest : public FPlayFabBaseModel + { + /** + * [optional] Indicates whether the statistics provided should be set, regardless of the aggregation method set on the statistic. + * Default is false. + */ + Boxed ForceUpdate; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Statistics to be updated with the provided values + TArray Statistics; + FUpdatePlayerStatisticsRequest() : + FPlayFabBaseModel(), + ForceUpdate(), + PlayFabId(), + Statistics() + {} + + FUpdatePlayerStatisticsRequest(const FUpdatePlayerStatisticsRequest& src) : + FPlayFabBaseModel(), + ForceUpdate(src.ForceUpdate), + PlayFabId(src.PlayFabId), + Statistics(src.Statistics) + {} + + FUpdatePlayerStatisticsRequest(const TSharedPtr& obj) : FUpdatePlayerStatisticsRequest() + { + readFromValue(obj); + } + + ~FUpdatePlayerStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerStatisticsResult : public FPlayFabBaseModel + { + FUpdatePlayerStatisticsResult() : + FPlayFabBaseModel() + {} + + FUpdatePlayerStatisticsResult(const FUpdatePlayerStatisticsResult& src) : + FPlayFabBaseModel() + {} + + FUpdatePlayerStatisticsResult(const TSharedPtr& obj) : FUpdatePlayerStatisticsResult() + { + readFromValue(obj); + } + + ~FUpdatePlayerStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateSharedGroupDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // [optional] Permission to be applied to all user data keys in this request. + Boxed Permission; + + // Unique identifier for the shared group. + FString SharedGroupId; + + FUpdateSharedGroupDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + Permission(), + SharedGroupId() + {} + + FUpdateSharedGroupDataRequest(const FUpdateSharedGroupDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission), + SharedGroupId(src.SharedGroupId) + {} + + FUpdateSharedGroupDataRequest(const TSharedPtr& obj) : FUpdateSharedGroupDataRequest() + { + readFromValue(obj); + } + + ~FUpdateSharedGroupDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateSharedGroupDataResult : public FPlayFabBaseModel + { + FUpdateSharedGroupDataResult() : + FPlayFabBaseModel() + {} + + FUpdateSharedGroupDataResult(const FUpdateSharedGroupDataResult& src) : + FPlayFabBaseModel() + {} + + FUpdateSharedGroupDataResult(const TSharedPtr& obj) : FUpdateSharedGroupDataResult() + { + readFromValue(obj); + } + + ~FUpdateSharedGroupDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // [optional] Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. + Boxed Permission; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateUserDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + Permission(), + PlayFabId() + {} + + FUpdateUserDataRequest(const FUpdateUserDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission), + PlayFabId(src.PlayFabId) + {} + + FUpdateUserDataRequest(const TSharedPtr& obj) : FUpdateUserDataRequest() + { + readFromValue(obj); + } + + ~FUpdateUserDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserDataResult : public FPlayFabBaseModel + { + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FUpdateUserDataResult() : + FPlayFabBaseModel(), + DataVersion(0) + {} + + FUpdateUserDataResult(const FUpdateUserDataResult& src) : + FPlayFabBaseModel(), + DataVersion(src.DataVersion) + {} + + FUpdateUserDataResult(const TSharedPtr& obj) : FUpdateUserDataResult() + { + readFromValue(obj); + } + + ~FUpdateUserDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserInternalDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateUserInternalDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + PlayFabId() + {} + + FUpdateUserInternalDataRequest(const FUpdateUserInternalDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + PlayFabId(src.PlayFabId) + {} + + FUpdateUserInternalDataRequest(const TSharedPtr& obj) : FUpdateUserInternalDataRequest() + { + readFromValue(obj); + } + + ~FUpdateUserInternalDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserInventoryItemDataRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateUserInventoryItemDataRequest() : + FPlayFabBaseModel(), + CharacterId(), + Data(), + ItemInstanceId(), + KeysToRemove(), + PlayFabId() + {} + + FUpdateUserInventoryItemDataRequest(const FUpdateUserInventoryItemDataRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Data(src.Data), + ItemInstanceId(src.ItemInstanceId), + KeysToRemove(src.KeysToRemove), + PlayFabId(src.PlayFabId) + {} + + FUpdateUserInventoryItemDataRequest(const TSharedPtr& obj) : FUpdateUserInventoryItemDataRequest() + { + readFromValue(obj); + } + + ~FUpdateUserInventoryItemDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteEventResponse : public FPlayFabBaseModel + { + /** + * [optional] The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to + * any particular format. + */ + FString EventId; + + FWriteEventResponse() : + FPlayFabBaseModel(), + EventId() + {} + + FWriteEventResponse(const FWriteEventResponse& src) : + FPlayFabBaseModel(), + EventId(src.EventId) + {} + + FWriteEventResponse(const TSharedPtr& obj) : FWriteEventResponse() + { + readFromValue(obj); + } + + ~FWriteEventResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteServerCharacterEventRequest : public FPlayFabBaseModel + { + // [optional] Custom event properties. Each property consists of a name (string) and a value (JSON object). + TMap Body; + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + FString EventName; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] The time (in UTC) associated with this event. The value dafaults to the current time. + Boxed Timestamp; + + FWriteServerCharacterEventRequest() : + FPlayFabBaseModel(), + Body(), + CharacterId(), + EventName(), + PlayFabId(), + Timestamp() + {} + + FWriteServerCharacterEventRequest(const FWriteServerCharacterEventRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + CharacterId(src.CharacterId), + EventName(src.EventName), + PlayFabId(src.PlayFabId), + Timestamp(src.Timestamp) + {} + + FWriteServerCharacterEventRequest(const TSharedPtr& obj) : FWriteServerCharacterEventRequest() + { + readFromValue(obj); + } + + ~FWriteServerCharacterEventRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteServerPlayerEventRequest : public FPlayFabBaseModel + { + // [optional] Custom data properties associated with the event. Each property consists of a name (string) and a value (JSON object). + TMap Body; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + FString EventName; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] The time (in UTC) associated with this event. The value dafaults to the current time. + Boxed Timestamp; + + FWriteServerPlayerEventRequest() : + FPlayFabBaseModel(), + Body(), + EventName(), + PlayFabId(), + Timestamp() + {} + + FWriteServerPlayerEventRequest(const FWriteServerPlayerEventRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + EventName(src.EventName), + PlayFabId(src.PlayFabId), + Timestamp(src.Timestamp) + {} + + FWriteServerPlayerEventRequest(const TSharedPtr& obj) : FWriteServerPlayerEventRequest() + { + readFromValue(obj); + } + + ~FWriteServerPlayerEventRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteTitleEventRequest : public FPlayFabBaseModel + { + // [optional] Custom event properties. Each property consists of a name (string) and a value (JSON object). + TMap Body; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + FString EventName; + + // [optional] The time (in UTC) associated with this event. The value dafaults to the current time. + Boxed Timestamp; + + FWriteTitleEventRequest() : + FPlayFabBaseModel(), + Body(), + EventName(), + Timestamp() + {} + + FWriteTitleEventRequest(const FWriteTitleEventRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + EventName(src.EventName), + Timestamp(src.Timestamp) + {} + + FWriteTitleEventRequest(const TSharedPtr& obj) : FWriteTitleEventRequest() + { + readFromValue(obj); + } + + ~FWriteTitleEventRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabSettings.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabSettings.h new file mode 100644 index 000000000..9f28d4476 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabSettings.h @@ -0,0 +1,49 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" +#include "PlayFabError.h" + +namespace PlayFab +{ + class PlayFabSettings + { + public: + static const FString sdkVersion; + static const FString buildIdentifier; + static const FString versionString; + + static bool GetUseDevelopmentEnvironment(); + static FString GetServerURL(); + static FString GetDevelopmentEnvironmentURL(); + static FString GetProductionEnvironmentURL(); + static FString GetTitleId(); + static FString GetClientSessionTicket(); + static FString GetDeveloperSecretKey(); + static FString GetEntityToken(); + static FString GetAdvertisingIdType(); + static FString GetAdvertisingIdValue(); + static bool GetDisableAdvertising(); + + static void SetUseDevelopmentEnvironment(bool useDevelopmentEnvironment); + static void SetServerURL(const FString& serverURL); + static void SetDevelopmentEnvironmentURL(const FString& developmentEnvironmentURL); + static void SetProductionEnvironmentURL(const FString& productionEnvironmentURL); + static void SetTitleId(const FString& titleId); + static void SetClientSessionTicket(const FString& clientSessionTicket); + static void SetDeveloperSecretKey(const FString& developerSecretKey); + static void SetEntityToken(const FString& entityToken); + static void SetAdvertisingIdType(const FString& advertisingIdType); + static void SetAdvertisingIdValue(const FString& advertisingIdValue); + static void SetDisableAdvertising(bool disableAdvertising); + + static const FString AD_TYPE_IDFA; + static const FString AD_TYPE_ANDROID_ID; + + static FString GetUrl(const FString& callPath); + }; +} diff --git a/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/PlayFab.h b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/PlayFab.h new file mode 100644 index 000000000..3505acbf9 --- /dev/null +++ b/ExampleProject/Plugins/PlayFab/Source/PlayFabCpp/Public/PlayFab.h @@ -0,0 +1,83 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + + #pragma once + + #include "CoreMinimal.h" + #include "Modules/ModuleManager.h" + + DECLARE_LOG_CATEGORY_EXTERN(LogPlayFab, Log, All); + +// forward declaration of classes +namespace PlayFab +{ + class UPlayFabAdminAPI; + class UPlayFabClientAPI; + class UPlayFabMatchmakerAPI; + class UPlayFabServerAPI; + class UPlayFabAuthenticationAPI; + class UPlayFabCloudScriptAPI; + class UPlayFabDataAPI; + class UPlayFabEventsAPI; + class UPlayFabGroupsAPI; + class UPlayFabLocalizationAPI; + class UPlayFabProfilesAPI; +} + +typedef TSharedPtr PlayFabAdminPtr; +typedef TSharedPtr PlayFabClientPtr; +typedef TSharedPtr PlayFabMatchmakerPtr; +typedef TSharedPtr PlayFabServerPtr; +typedef TSharedPtr PlayFabAuthenticationPtr; +typedef TSharedPtr PlayFabCloudScriptPtr; +typedef TSharedPtr PlayFabDataPtr; +typedef TSharedPtr PlayFabEventsPtr; +typedef TSharedPtr PlayFabGroupsPtr; +typedef TSharedPtr PlayFabLocalizationPtr; +typedef TSharedPtr PlayFabProfilesPtr; + +/** +* The public interface to this module. In most cases, this interface is only public to sibling modules +* within this plugin. +*/ +class IPlayFabModuleInterface : public IModuleInterface +{ +public: + + /** + * Singleton-like access to this module's interface. This is just for convenience! + * Beware of calling this during the shutdown phase, though. Your module might have been unloaded already. + * + * @return Returns singleton instance, loading the module on demand if needed + */ + static inline IPlayFabModuleInterface& Get() + { + return FModuleManager::LoadModuleChecked< IPlayFabModuleInterface >("PlayFabCpp"); + } + + /** + * Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true. + * + * @return True if the module is loaded and ready to use + */ + static inline bool IsAvailable() + { + return FModuleManager::Get().IsModuleLoaded("PlayFabCpp"); + } + + virtual FString GetTitleId() const = 0; + virtual PlayFabAdminPtr GetAdminAPI() const = 0; + virtual PlayFabClientPtr GetClientAPI() const = 0; + virtual PlayFabMatchmakerPtr GetMatchmakerAPI() const = 0; + virtual PlayFabServerPtr GetServerAPI() const = 0; + virtual PlayFabAuthenticationPtr GetAuthenticationAPI() const = 0; + virtual PlayFabCloudScriptPtr GetCloudScriptAPI() const = 0; + virtual PlayFabDataPtr GetDataAPI() const = 0; + virtual PlayFabEventsPtr GetEventsAPI() const = 0; + virtual PlayFabGroupsPtr GetGroupsAPI() const = 0; + virtual PlayFabLocalizationPtr GetLocalizationAPI() const = 0; + virtual PlayFabProfilesPtr GetProfilesAPI() const = 0; + +}; diff --git a/ExampleProject/Source/ExampleProject.Target.cs b/ExampleProject/Source/ExampleProject.Target.cs new file mode 100644 index 000000000..42a77d4da --- /dev/null +++ b/ExampleProject/Source/ExampleProject.Target.cs @@ -0,0 +1,15 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +using UnrealBuildTool; +using System.Collections.Generic; + +public class ExampleProjectTarget : TargetRules +{ + public ExampleProjectTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Game; + ExtraModuleNames.AddRange(new string[] { "ExampleProject" }); + } +} diff --git a/ExampleProject/Source/ExampleProject/ExampleProject.Build.cs b/ExampleProject/Source/ExampleProject/ExampleProject.Build.cs new file mode 100644 index 000000000..a6ca97f83 --- /dev/null +++ b/ExampleProject/Source/ExampleProject/ExampleProject.Build.cs @@ -0,0 +1,18 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +using UnrealBuildTool; + +public class ExampleProject : ModuleRules +{ + public ExampleProject(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = PCHUsageMode.NoSharedPCHs; + + PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "PlayFab", "PlayFabCpp"}); + PublicDependencyModuleNames.AddRange(new string[] { "Json", "JsonUtilities" }); + + PrivateDependencyModuleNames.AddRange(new string[] { }); + } +} diff --git a/ExampleProject/Source/ExampleProject/ExampleProject.cpp b/ExampleProject/Source/ExampleProject/ExampleProject.cpp new file mode 100644 index 000000000..81cdac9e1 --- /dev/null +++ b/ExampleProject/Source/ExampleProject/ExampleProject.cpp @@ -0,0 +1,7 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +#include "ExampleProject.h" + +IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, ExampleProject, "ExampleProject" ); diff --git a/ExampleProject/Source/ExampleProject/ExampleProject.h b/ExampleProject/Source/ExampleProject/ExampleProject.h new file mode 100644 index 000000000..a24ae76e3 --- /dev/null +++ b/ExampleProject/Source/ExampleProject/ExampleProject.h @@ -0,0 +1,8 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +#pragma once + +#include "Engine.h" + diff --git a/ExampleProject/Source/ExampleProject/ExampleProjectGameMode.cpp b/ExampleProject/Source/ExampleProject/ExampleProjectGameMode.cpp new file mode 100644 index 000000000..726a56f21 --- /dev/null +++ b/ExampleProject/Source/ExampleProject/ExampleProjectGameMode.cpp @@ -0,0 +1,12 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +// Fill out your copyright notice in the Description page of Project Settings. + +#include "ExampleProject.h" +#include "ExampleProjectGameMode.h" + + + + diff --git a/ExampleProject/Source/ExampleProject/ExampleProjectGameMode.h b/ExampleProject/Source/ExampleProject/ExampleProjectGameMode.h new file mode 100644 index 000000000..b81c1bc01 --- /dev/null +++ b/ExampleProject/Source/ExampleProject/ExampleProjectGameMode.h @@ -0,0 +1,23 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "GameFramework/GameMode.h" +#include "ExampleProjectGameMode.generated.h" + +/** + * + */ +UCLASS() +class EXAMPLEPROJECT_API AExampleProjectGameMode : public AGameMode +{ + GENERATED_BODY() + + + + +}; diff --git a/ExampleProject/Source/ExampleProject/PlayFabApiTests.cpp b/ExampleProject/Source/ExampleProject/PlayFabApiTests.cpp new file mode 100644 index 000000000..e4ea80e32 --- /dev/null +++ b/ExampleProject/Source/ExampleProject/PlayFabApiTests.cpp @@ -0,0 +1,712 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +#include "ExampleProject.h" +#include "PlayFabApiTests.h" + +DEFINE_LOG_CATEGORY(LogPlayFabTest); // This is a separate project from the PlayFab plugin, so this has to be re-defined in this project - This is not standard, but these tests should log as playfab, even from another project + + /* + * ==== Test Suite ==== + */ +FString PlayFabApiTestSuite::playFabId; +FString PlayFabApiTestSuite::entityId; +FString PlayFabApiTestSuite::entityType; + +/* +* ==== LoginWithEmailAddress ==== +*/ +PlayFabApiTest_0LoginWithEmail::PlayFabApiTest_0LoginWithEmail(const FString& email, const FString& password) +{ + this->email = email; + this->password = password; +} + +bool PlayFabApiTest_0LoginWithEmail::Update() +{ + // Initialize, setup the call, and wait for the result + if (!clientAPI.IsValid()) + { + clientAPI = IPlayFabModuleInterface::Get().GetClientAPI(); + + PlayFab::ClientModels::FLoginWithEmailAddressRequest request; + request.Email = email; + request.Password = password; + + clientAPI->LoginWithEmailAddress(request + , PlayFab::UPlayFabClientAPI::FLoginWithEmailAddressDelegate::CreateRaw(this, &PlayFabApiTest_0LoginWithEmail::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_0LoginWithEmail::OnError) + ); + } + + // Return when the api call is resolved + return clientAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_0LoginWithEmail::OnSuccess(const PlayFab::ClientModels::FLoginResult& result) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("LoginWithEmailAddress Succeeded where it should have failed")); +} + +void PlayFabApiTest_0LoginWithEmail::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + if (ErrorResult.ErrorMessage.Find(TEXT("password")) == -1) // Check that we correctly received a notice about invalid password + { + UE_LOG(LogPlayFabTest, Error, TEXT("Non-password error with login")); + } +} + + + +/* +* ==== LoginWithCustomID ==== +*/ +PlayFabApiTest_0LoginWithCustomID::PlayFabApiTest_0LoginWithCustomID(const FString& customId) +{ + this->customId = customId; +} + +bool PlayFabApiTest_0LoginWithCustomID::Update() +{ + // Initialize, setup the call, and wait for the result + if (!clientAPI.IsValid()) + { + clientAPI = IPlayFabModuleInterface::Get().GetClientAPI(); + + PlayFab::ClientModels::FLoginWithCustomIDRequest request; + request.CustomId = customId; + request.CreateAccount = true; + + clientAPI->LoginWithCustomID(request + , PlayFab::UPlayFabClientAPI::FLoginWithCustomIDDelegate::CreateRaw(this, &PlayFabApiTest_0LoginWithCustomID::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_0LoginWithCustomID::OnError) + ); + } + + // Return when the api call is resolved + return clientAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_0LoginWithCustomID::OnSuccess(const PlayFab::ClientModels::FLoginResult& result) const +{ + PlayFabApiTestSuite::playFabId = result.PlayFabId; + UE_LOG(LogPlayFabTest, Log, TEXT("PlayFab login successful: %s, %s"), *PlayFabApiTestSuite::playFabId, *customId); +} + +void PlayFabApiTest_0LoginWithCustomID::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("Login failed")); +} + + +/* +* ==== LoginWithAdvertisingId ==== +*/ +PlayFabApiTest_0LoginWithAdvertisingId::PlayFabApiTest_0LoginWithAdvertisingId(const FString& customId) +{ + this->tickCounter = 0; + this->customId = customId; +} + +bool PlayFabApiTest_0LoginWithAdvertisingId::Update() +{ + if (!clientAPI.IsValid()) + { + clientAPI = IPlayFabModuleInterface::Get().GetClientAPI(); + clientAPI->SetAdvertId(TEXT("Adid"), TEXT("PlayFabTestId")); + + PlayFab::ClientModels::FLoginWithCustomIDRequest request; + request.CustomId = customId; + request.CreateAccount = true; + + clientAPI->LoginWithCustomID(request + , PlayFab::UPlayFabClientAPI::FLoginWithCustomIDDelegate::CreateRaw(this, &PlayFabApiTest_0LoginWithAdvertisingId::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_0LoginWithAdvertisingId::OnError) + ); + } + + tickCounter += 1; + bool success = clientAPI->AdvertIdSuccessful(); + bool failure = tickCounter > 300 && !success; + if (failure) + UE_LOG(LogPlayFabTest, Error, TEXT("advertisingId not submitted properly")); + + // Return when the api call is resolved + return clientAPI->GetPendingCalls() == 0 && (failure || success); +} + +void PlayFabApiTest_0LoginWithAdvertisingId::OnSuccess(const PlayFab::ClientModels::FLoginResult& result) const +{ + PlayFabApiTestSuite::playFabId = result.PlayFabId; + UE_LOG(LogPlayFabTest, Log, TEXT("PlayFab login successful: %s, %s"), *PlayFabApiTestSuite::playFabId, *customId); +} + +void PlayFabApiTest_0LoginWithAdvertisingId::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("LoginWithAdvertisingId Failed: %s"), *(ErrorResult.ErrorMessage)); +} + + +/* +* ==== GetUserData ==== +*/ +PlayFabApiTest_GetUserData::PlayFabApiTest_GetUserData(const FString& TEST_DATA_KEY_1, const FString& TEST_DATA_KEY_2, int expectedValue = -1) +{ + this->TEST_DATA_KEY_1 = TEST_DATA_KEY_1; + this->TEST_DATA_KEY_2 = TEST_DATA_KEY_2; + + this->expectedValue = expectedValue; +} + +bool PlayFabApiTest_GetUserData::Update() +{ + // Initialize, setup the call, and wait for the result + if (!clientAPI.IsValid()) + { + clientAPI = IPlayFabModuleInterface::Get().GetClientAPI(); + + PlayFab::ClientModels::FGetUserDataRequest request; + + clientAPI->GetUserData(request + , PlayFab::UPlayFabClientAPI::FGetUserDataDelegate::CreateRaw(this, &PlayFabApiTest_GetUserData::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_GetUserData::OnError) + ); + } + + // Return when the api call is resolved + return clientAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_GetUserData::OnSuccess(const PlayFab::ClientModels::FGetUserDataResult& result) const +{ + int actualValue = -1; + + const PlayFab::ClientModels::FUserDataRecord* target = result.Data.Find(TEST_DATA_KEY_1); + if (target != nullptr) + actualValue = FCString::Atoi(*(target->Value)); + + if (expectedValue != -1 && expectedValue != actualValue) + { + // If I know what value I'm expecting, and I did not get it, log an error + UE_LOG(LogPlayFabTest, Error, TEXT("GetUserData: Update value did not match new value %d!=%d"), expectedValue, actualValue); + } + else if (expectedValue != -1 && expectedValue == actualValue) + { + // If I know what value I'm expecting, and I got it, test passed, exit + CheckTimestamp(target->LastUpdated); // If the value was updated correctly, check the timestamp + UE_LOG(LogPlayFabTest, Log, TEXT("GetUserData Success")); + } + else if (expectedValue == -1) + { + // If I don't know what value I was expecting, Call Update with (actualValue + 1) + actualValue = (actualValue + 1) % 100; + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_UpdateUserData(TEST_DATA_KEY_1, TEST_DATA_KEY_2, actualValue)); + } +} + +void PlayFabApiTest_GetUserData::CheckTimestamp(const FDateTime& updateTime) const +{ + FDateTime utcNow = FDateTime::UtcNow(); + FTimespan delta = FTimespan(0, 5, 0); + FDateTime minTest = utcNow - delta; + FDateTime maxTest = utcNow + delta; + + if (minTest <= updateTime && updateTime <= maxTest) + { + UE_LOG(LogPlayFabTest, Log, TEXT("GetUserData: LastUpdated timestamp parsed as expected")); + } + else + { + UE_LOG(LogPlayFabTest, Error, TEXT("GetUserData: LastUpdated timestamp was not parsed correctly")); + } +} + +void PlayFabApiTest_GetUserData::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("GetUserData Failed: %s"), *(ErrorResult.ErrorMessage)); +} + +/* +* ==== UpdateUserData ==== +*/ +PlayFabApiTest_UpdateUserData::PlayFabApiTest_UpdateUserData(const FString& TEST_DATA_KEY_1, const FString& TEST_DATA_KEY_2, int updateValue) +{ + this->TEST_DATA_KEY_1 = TEST_DATA_KEY_1; + this->TEST_DATA_KEY_2 = TEST_DATA_KEY_2; + + this->updateValue = updateValue; +} + +bool PlayFabApiTest_UpdateUserData::Update() +{ + // Initialize, setup the call, and wait for the result + if (!clientAPI.IsValid()) + { + clientAPI = IPlayFabModuleInterface::Get().GetClientAPI(); + + FString strUpdateValue; + strUpdateValue.AppendInt(updateValue); + + PlayFab::ClientModels::FUpdateUserDataRequest request; + request.Data.Add(TEST_DATA_KEY_1, strUpdateValue); + + clientAPI->UpdateUserData(request + , PlayFab::UPlayFabClientAPI::FUpdateUserDataDelegate::CreateRaw(this, &PlayFabApiTest_UpdateUserData::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_UpdateUserData::OnError) + ); + } + + // Return when the api call is resolved + return clientAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_UpdateUserData::OnSuccess(const PlayFab::ClientModels::FUpdateUserDataResult& result) const +{ + // Update is always followed by another get w/ verification + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_GetUserData(TEST_DATA_KEY_1, TEST_DATA_KEY_2, updateValue)); +} + +void PlayFabApiTest_UpdateUserData::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("UpdateUserData Failed: %s"), *(ErrorResult.ErrorMessage)); +} + +/* +* ==== GetPlayerStatistics ==== +*/ +PlayFabApiTest_GetPlayerStatistics::PlayFabApiTest_GetPlayerStatistics(const FString& TEST_STAT_NAME, int expectedValue = -1) +{ + this->TEST_STAT_NAME = TEST_STAT_NAME; + + this->expectedValue = expectedValue; +} + +bool PlayFabApiTest_GetPlayerStatistics::Update() +{ + // Initialize, setup the call, and wait for the result + if (!clientAPI.IsValid()) + { + clientAPI = IPlayFabModuleInterface::Get().GetClientAPI(); + + PlayFab::ClientModels::FGetPlayerStatisticsRequest request; + clientAPI->GetPlayerStatistics( + request, + PlayFab::UPlayFabClientAPI::FGetPlayerStatisticsDelegate::CreateRaw(this, &PlayFabApiTest_GetPlayerStatistics::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_GetPlayerStatistics::OnError) + ); + } + + // Return when the api call is resolved + return clientAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_GetPlayerStatistics::OnSuccess(const PlayFab::ClientModels::FGetPlayerStatisticsResult& result) const +{ + int actualValue = -1000; + for (int i = 0; i < result.Statistics.Num(); i++) + if (result.Statistics[i].StatisticName == TEST_STAT_NAME) + actualValue = result.Statistics[i].Value; + + if (expectedValue != -1 && expectedValue != actualValue) + { + UE_LOG(LogPlayFabTest, Error, TEXT("GetPlayerStatistics: Update value did not match new value")); + } + else if (expectedValue != -1 && expectedValue == actualValue) + { + UE_LOG(LogPlayFabTest, Log, TEXT("GetPlayerStatistics Success")); + } + else if (expectedValue == -1) + { + // Call Update with (actualValue + 1) + actualValue = (actualValue + 1) % 100; + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_UpdatePlayerStatistics(TEST_STAT_NAME, actualValue)); + } +} + +void PlayFabApiTest_GetPlayerStatistics::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("GetPlayerStatistics Failed: %s"), *(ErrorResult.ErrorMessage)); +} + +/* +* ==== UpdatePlayerStatistics ==== +*/ +PlayFabApiTest_UpdatePlayerStatistics::PlayFabApiTest_UpdatePlayerStatistics(const FString& TEST_STAT_NAME, int updateValue) +{ + this->TEST_STAT_NAME = TEST_STAT_NAME; + + this->updateValue = updateValue; +} + +bool PlayFabApiTest_UpdatePlayerStatistics::Update() +{ + // Initialize, setup the call, and wait for the result + if (!clientAPI.IsValid()) + { + clientAPI = IPlayFabModuleInterface::Get().GetClientAPI(); + + PlayFab::ClientModels::FUpdatePlayerStatisticsRequest request; + PlayFab::ClientModels::FStatisticUpdate statUpdate; + statUpdate.StatisticName = TEST_STAT_NAME; + statUpdate.Value = updateValue; + request.Statistics.Add(statUpdate); + + clientAPI->UpdatePlayerStatistics(request + , PlayFab::UPlayFabClientAPI::FUpdatePlayerStatisticsDelegate::CreateRaw(this, &PlayFabApiTest_UpdatePlayerStatistics::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_UpdatePlayerStatistics::OnError) + ); + } + + // Return when the api call is resolved + return clientAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_UpdatePlayerStatistics::OnSuccess(const PlayFab::ClientModels::FUpdatePlayerStatisticsResult& result) const +{ + // Update is always followed by another get w/ verification + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_GetPlayerStatistics(TEST_STAT_NAME, updateValue)); +} + +void PlayFabApiTest_UpdatePlayerStatistics::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("UpdatePlayerStatistics Failed: %s"), *(ErrorResult.ErrorMessage)); +} + +/* +* ==== GetAllUsersCharacters ==== +*/ +PlayFabApiTest_GetAllUsersCharacters::PlayFabApiTest_GetAllUsersCharacters() +{ +} + +bool PlayFabApiTest_GetAllUsersCharacters::Update() +{ + // Initialize, setup the call, and wait for the result + if (!clientAPI.IsValid()) + { + clientAPI = IPlayFabModuleInterface::Get().GetClientAPI(); + + PlayFab::ClientModels::FListUsersCharactersRequest request; + + clientAPI->GetAllUsersCharacters(request + , PlayFab::UPlayFabClientAPI::FGetAllUsersCharactersDelegate::CreateRaw(this, &PlayFabApiTest_GetAllUsersCharacters::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_GetAllUsersCharacters::OnError) + ); + } + + // Return when the api call is resolved + return clientAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_GetAllUsersCharacters::OnSuccess(const PlayFab::ClientModels::FListUsersCharactersResult& result) const +{ + UE_LOG(LogPlayFabTest, Log, TEXT("GetAllUsersCharacters Success (Can't fail)")); +} + +void PlayFabApiTest_GetAllUsersCharacters::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("GetAllUsersCharacters Failed: %s"), *(ErrorResult.ErrorMessage)); +} + +/* +* ==== GetLeaderboard Client ==== +*/ +PlayFabApiTest_GetLeaderboardC::PlayFabApiTest_GetLeaderboardC(const FString& TEST_STAT_NAME) +{ + this->TEST_STAT_NAME = TEST_STAT_NAME; +} + +bool PlayFabApiTest_GetLeaderboardC::Update() +{ + // Initialize, setup the call, and wait for the result + if (!clientAPI.IsValid()) + { + clientAPI = IPlayFabModuleInterface::Get().GetClientAPI(); + + PlayFab::ClientModels::FGetLeaderboardRequest request; + request.MaxResultsCount = 3; + request.StatisticName = TEST_STAT_NAME; + + clientAPI->GetLeaderboard(request + , PlayFab::UPlayFabClientAPI::FGetLeaderboardDelegate::CreateRaw(this, &PlayFabApiTest_GetLeaderboardC::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_GetLeaderboardC::OnError) + ); + } + + // Return when the api call is resolved + return clientAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_GetLeaderboardC::OnSuccess(const PlayFab::ClientModels::FGetLeaderboardResult& result) const +{ + int count = result.Leaderboard.Num(); + + if (count > 0) + { + UE_LOG(LogPlayFabTest, Log, TEXT("GetLeaderboard Succeeded")); + } + else + { + UE_LOG(LogPlayFabTest, Error, TEXT("GetLeaderboard found zero results.")); + } +} + +void PlayFabApiTest_GetLeaderboardC::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("GetLeaderboard Failed: %s"), *(ErrorResult.ErrorMessage)); +} + +/* +* ==== GetLeaderboard Server ==== +*/ +PlayFabApiTest_GetLeaderboardS::PlayFabApiTest_GetLeaderboardS(const FString& TEST_STAT_NAME) +{ + this->TEST_STAT_NAME = TEST_STAT_NAME; +} + +bool PlayFabApiTest_GetLeaderboardS::Update() +{ + // Initialize, setup the call, and wait for the result + if (!serverAPI.IsValid()) + { + serverAPI = IPlayFabModuleInterface::Get().GetServerAPI(); + + PlayFab::ServerModels::FGetLeaderboardRequest request; + request.MaxResultsCount = 3; + request.StatisticName = TEST_STAT_NAME; + + serverAPI->GetLeaderboard(request + , PlayFab::UPlayFabServerAPI::FGetLeaderboardDelegate::CreateRaw(this, &PlayFabApiTest_GetLeaderboardS::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_GetLeaderboardS::OnError) + ); + } + + // Return when the api call is resolved + return serverAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_GetLeaderboardS::OnSuccess(const PlayFab::ServerModels::FGetLeaderboardResult& result) const +{ + int count = result.Leaderboard.Num(); + + if (count > 0) + { + UE_LOG(LogPlayFabTest, Log, TEXT("GetLeaderboard Succeeded")); + } + else + { + UE_LOG(LogPlayFabTest, Error, TEXT("GetLeaderboard found zero results.")); + } +} + +void PlayFabApiTest_GetLeaderboardS::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("GetLeaderboard Failed: %s"), *(ErrorResult.ErrorMessage)); +} + +/* +* ==== GetAccountInfo ==== +*/ +PlayFabApiTest_GetAccountInfo::PlayFabApiTest_GetAccountInfo() +{ +} + +bool PlayFabApiTest_GetAccountInfo::Update() +{ + // Initialize, setup the call, and wait for the result + if (!clientAPI.IsValid()) + { + clientAPI = IPlayFabModuleInterface::Get().GetClientAPI(); + + PlayFab::ClientModels::FGetAccountInfoRequest request; + + clientAPI->GetAccountInfo(request + , PlayFab::UPlayFabClientAPI::FGetAccountInfoDelegate::CreateRaw(this, &PlayFabApiTest_GetAccountInfo::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_GetAccountInfo::OnError) + ); + } + + // Return when the api call is resolved + return clientAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_GetAccountInfo::OnSuccess(const PlayFab::ClientModels::FGetAccountInfoResult& result) const +{ + auto origination = result.AccountInfo->TitleInfo->Origination.mValue; // C++ can't really do anything with this once fetched + UE_LOG(LogPlayFabTest, Log, TEXT("GetAccountInfo Succeeded")); +} + +void PlayFabApiTest_GetAccountInfo::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("GetAccountInfo Failed: %s"), *(ErrorResult.ErrorMessage)); +} + + +/* +* ==== ExecuteCloudScript ==== +*/ +PlayFabApiTest_ExecuteCloudScript::PlayFabApiTest_ExecuteCloudScript(const FString& functionName, bool expectFail) +{ + this->functionName = functionName; + this->expectFail = expectFail; +} + +bool PlayFabApiTest_ExecuteCloudScript::Update() +{ + // Initialize, setup the call, and wait for the result + if (!clientAPI.IsValid()) + { + clientAPI = IPlayFabModuleInterface::Get().GetClientAPI(); + + PlayFab::ClientModels::FExecuteCloudScriptRequest request; + request.FunctionName = functionName; + + clientAPI->ExecuteCloudScript(request + , PlayFab::UPlayFabClientAPI::FExecuteCloudScriptDelegate::CreateRaw(this, &PlayFabApiTest_ExecuteCloudScript::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_ExecuteCloudScript::OnError) + ); + } + + // Return when the api call is resolved + return clientAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_ExecuteCloudScript::OnSuccess(const PlayFab::ClientModels::FExecuteCloudScriptResult& result) const +{ + if (!expectFail == result.Error.IsValid()) { + UE_LOG(LogPlayFabTest, Error, TEXT("ExecuteCloudScript succeeded when it should have failed")); + } + else { + UE_LOG(LogPlayFabTest, Log, TEXT("ExecuteCloudScript Succeeded")); + } +} + +void PlayFabApiTest_ExecuteCloudScript::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + if (expectFail) { + UE_LOG(LogPlayFabTest, Log, TEXT("ExecuteCloudScript failed as expected")); + } + else { + UE_LOG(LogPlayFabTest, Error, TEXT("ExecuteCloudScript Failed: %s"), *(ErrorResult.ErrorMessage)); + } +} + + +/* +* ==== WriteEvent ==== +*/ +PlayFabApiTest_WriteEvent::PlayFabApiTest_WriteEvent() +{ +} + +bool PlayFabApiTest_WriteEvent::Update() +{ + // Initialize, setup the call, and wait for the result + if (!clientAPI.IsValid()) + { + clientAPI = IPlayFabModuleInterface::Get().GetClientAPI(); + + PlayFab::ClientModels::FWriteClientPlayerEventRequest request; + request.EventName = TEXT("ForumPostEvent"); + request.Body.Add(TEXT("Subject"), TEXT("My First Post")); + request.Body.Add(TEXT("Body"), TEXT("My awesome Post.")); + + clientAPI->WritePlayerEvent(request + , PlayFab::UPlayFabClientAPI::FWritePlayerEventDelegate::CreateRaw(this, &PlayFabApiTest_WriteEvent::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_WriteEvent::OnError) + ); + } + + // Return when the api call is resolved + return clientAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_WriteEvent::OnSuccess(const PlayFab::ClientModels::FWriteEventResponse& result) const +{ + UE_LOG(LogPlayFabTest, Log, TEXT("WriteEvent Succeeded")); +} + +void PlayFabApiTest_WriteEvent::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("WriteEvent Failed: %s"), *(ErrorResult.ErrorMessage)); +} + + +/* +* ==== GetEntityToken ==== +*/ +PlayFabApiTest_GetEntityToken::PlayFabApiTest_GetEntityToken() +{ +} + +bool PlayFabApiTest_GetEntityToken::Update() +{ + // Initialize, setup the call, and wait for the result + if (!authenticationAPI.IsValid()) + { + authenticationAPI = IPlayFabModuleInterface::Get().GetAuthenticationAPI(); + + PlayFab::AuthenticationModels::FGetEntityTokenRequest request; + authenticationAPI->GetEntityToken( + request, + PlayFab::UPlayFabAuthenticationAPI::FGetEntityTokenDelegate::CreateRaw(this, &PlayFabApiTest_GetEntityToken::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_GetEntityToken::OnError) + ); + } + + // Return when the api call is resolved + return authenticationAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_GetEntityToken::OnSuccess(const PlayFab::AuthenticationModels::FGetEntityTokenResponse& result) const +{ + PlayFabApiTestSuite::entityId = result.Entity->Id; + PlayFabApiTestSuite::entityType = result.Entity->Type; + UE_LOG(LogPlayFabTest, Log, TEXT("GetEntityToken Succeeded")); +} + +void PlayFabApiTest_GetEntityToken::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("GetEntityToken Failed: %s"), *(ErrorResult.ErrorMessage)); +} + + +/* +* ==== ObjectApi ==== +*/ +PlayFabApiTest_ObjectApi::PlayFabApiTest_ObjectApi() +{ +} + +bool PlayFabApiTest_ObjectApi::Update() +{ + // Initialize, setup the call, and wait for the result + if (!dataAPI.IsValid()) + { + dataAPI = IPlayFabModuleInterface::Get().GetDataAPI(); + + PlayFab::DataModels::FGetObjectsRequest request; + request.Entity.Id = PlayFabApiTestSuite::entityId; + request.Entity.Type = PlayFabApiTestSuite::entityType; + request.EscapeObject = true; + + dataAPI->GetObjects(request + , PlayFab::UPlayFabDataAPI::FGetObjectsDelegate::CreateRaw(this, &PlayFabApiTest_ObjectApi::OnSuccess) + , PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabApiTest_ObjectApi::OnError) + ); + } + + // Return when the api call is resolved + return dataAPI->GetPendingCalls() == 0; +} + +void PlayFabApiTest_ObjectApi::OnSuccess(const PlayFab::DataModels::FGetObjectsResponse& result) const +{ + UE_LOG(LogPlayFabTest, Log, TEXT("ObjectApi Succeeded")); +} + +void PlayFabApiTest_ObjectApi::OnError(const PlayFab::FPlayFabError& ErrorResult) const +{ + UE_LOG(LogPlayFabTest, Error, TEXT("ObjectApi Failed: %s"), *(ErrorResult.ErrorMessage)); +} diff --git a/ExampleProject/Source/ExampleProject/PlayFabApiTests.h b/ExampleProject/Source/ExampleProject/PlayFabApiTests.h new file mode 100644 index 000000000..2ee58b9e6 --- /dev/null +++ b/ExampleProject/Source/ExampleProject/PlayFabApiTests.h @@ -0,0 +1,533 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +#pragma once + +#include "CoreMisc.h" +#include "Runtime/Launch/Resources/Version.h" + +#include "PlayFab.h" +#include "Core/PlayFabAuthenticationDataModels.h" +#include "Core/PlayFabAuthenticationAPI.h" +#include "Core/PlayFabClientDataModels.h" +#include "Core/PlayFabClientAPI.h" +#include "Core/PlayFabDataDataModels.h" +#include "Core/PlayFabDataAPI.h" +#include "Core/PlayFabServerDataModels.h" +#include "Core/PlayFabServerAPI.h" + +#include "Misc/AutomationTest.h" + +DECLARE_LOG_CATEGORY_EXTERN(LogPlayFabTest, Log, All); + +// forward declaration +namespace PlayFab +{ + namespace ClientModels + { + struct FLoginResult; + } + + struct FPlayFabError; +} + +/* +* ==== LoginWithEmail ==== +*/ +class PlayFabApiTest_0LoginWithEmail : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_0LoginWithEmail(const FString& email, const FString& password); + + bool Update() override; +private: + void OnSuccess(const PlayFab::ClientModels::FLoginResult& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + FString email; + FString password; + PlayFabClientPtr clientAPI = nullptr; +}; + +/* +* ==== LoginWithCustomID ==== +*/ +class PlayFabApiTest_0LoginWithCustomID : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_0LoginWithCustomID(const FString& customId); + + bool Update() override; +private: + void OnSuccess(const PlayFab::ClientModels::FLoginResult& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + FString customId; + PlayFabClientPtr clientAPI = nullptr; +}; + +/* +* ==== LoginWithAdvertisingId ==== +*/ +class PlayFabApiTest_0LoginWithAdvertisingId : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_0LoginWithAdvertisingId(const FString& customId); + + bool Update() override; +private: + void OnSuccess(const PlayFab::ClientModels::FLoginResult& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + int tickCounter = 0; + FString customId; + PlayFabClientPtr clientAPI = nullptr; +}; + +/* +* ==== UserData ==== +*/ +class PlayFabApiTest_GetUserData : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_GetUserData(const FString& TEST_DATA_KEY_1, const FString& TEST_DATA_KEY_2, int expectedValue); + + bool Update() override; +private: + void OnSuccess(const PlayFab::ClientModels::FGetUserDataResult& result) const; + void CheckTimestamp(const FDateTime& updateTime) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + FString TEST_DATA_KEY_1; + FString TEST_DATA_KEY_2; + int expectedValue = -1; + + PlayFabClientPtr clientAPI = nullptr; +}; + +class PlayFabApiTest_UpdateUserData : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_UpdateUserData(const FString& TEST_DATA_KEY_1, const FString& TEST_DATA_KEY_2, int updateValue); + + bool Update() override; +private: + void OnSuccess(const PlayFab::ClientModels::FUpdateUserDataResult& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + FString TEST_DATA_KEY_1; + FString TEST_DATA_KEY_2; + int updateValue = -1; + + PlayFabClientPtr clientAPI = nullptr; +}; + +/* +* ==== PlayerStatistics ==== +*/ +class PlayFabApiTest_GetPlayerStatistics : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_GetPlayerStatistics(const FString& TEST_STAT_NAME, int expectedValue); + + bool Update() override; +private: + void OnSuccess(const PlayFab::ClientModels::FGetPlayerStatisticsResult& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + FString TEST_STAT_NAME; + int expectedValue = -1; + + PlayFabClientPtr clientAPI = nullptr; +}; + +class PlayFabApiTest_UpdatePlayerStatistics : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_UpdatePlayerStatistics(const FString& TEST_STAT_NAME, int updateValue); + + bool Update() override; +private: + void OnSuccess(const PlayFab::ClientModels::FUpdatePlayerStatisticsResult& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + FString TEST_STAT_NAME; + int updateValue = -1; + + PlayFabClientPtr clientAPI = nullptr; +}; + +/* +* ==== GetLeaderboard ==== +*/ +class PlayFabApiTest_GetLeaderboardC : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_GetLeaderboardC(const FString& TEST_STAT_NAME); + + bool Update() override; +private: + void OnSuccess(const PlayFab::ClientModels::FGetLeaderboardResult& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + FString TEST_STAT_NAME; + bool expectSuccess = false; + + PlayFabClientPtr clientAPI = nullptr; +}; + +class PlayFabApiTest_GetLeaderboardS : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_GetLeaderboardS(const FString& TEST_STAT_NAME); + + bool Update() override; +private: + void OnSuccess(const PlayFab::ServerModels::FGetLeaderboardResult& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + FString TEST_STAT_NAME; + + PlayFabServerPtr serverAPI = nullptr; +}; + +/* +* ==== GetAllUsersCharacters ==== +*/ +class PlayFabApiTest_GetAllUsersCharacters : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_GetAllUsersCharacters(); + + bool Update() override; +private: + void OnSuccess(const PlayFab::ClientModels::FListUsersCharactersResult& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + PlayFabClientPtr clientAPI = nullptr; +}; + +/* +* ==== GetAccountInfo ==== +*/ +class PlayFabApiTest_GetAccountInfo : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_GetAccountInfo(); + + bool Update() override; +private: + void OnSuccess(const PlayFab::ClientModels::FGetAccountInfoResult& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + PlayFabClientPtr clientAPI = nullptr; +}; + +/* +* ==== ExecuteCloudScript ==== +*/ +class PlayFabApiTest_ExecuteCloudScript : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_ExecuteCloudScript(const FString& functionName, bool expectFail); + + bool Update() override; +private: + void OnSuccess(const PlayFab::ClientModels::FExecuteCloudScriptResult& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + FString functionName; + bool expectFail; + + PlayFabClientPtr clientAPI = nullptr; +}; + +/* +* ==== WriteEvent ==== +*/ +class PlayFabApiTest_WriteEvent : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_WriteEvent(); + + bool Update() override; +private: + void OnSuccess(const PlayFab::ClientModels::FWriteEventResponse& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + FString functionName; + bool expectFail; + + PlayFabClientPtr clientAPI = nullptr; +}; + + +/* +* ==== GetEntityToken ==== +*/ +class PlayFabApiTest_GetEntityToken : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_GetEntityToken(); + + bool Update() override; +private: + void OnSuccess(const PlayFab::AuthenticationModels::FGetEntityTokenResponse& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + PlayFabAuthenticationPtr authenticationAPI = nullptr; +}; + + +/* +* ==== ObjectApi ==== +*/ +class PlayFabApiTest_ObjectApi : public IAutomationLatentCommand +{ +public: + PlayFabApiTest_ObjectApi(); + + bool Update() override; +private: + void OnSuccess(const PlayFab::DataModels::FGetObjectsResponse& result) const; + void OnError(const PlayFab::FPlayFabError& ErrorResult) const; + + PlayFabDataPtr dataAPI = nullptr; +}; + + +/* +* ==== Test Suite ==== +*/ +struct TestTitleData +{ +public: + FString titleId = TEXT("Your titleID"); + FString developerSecretKey = TEXT("For the security of your title, keep your secret key private!"); + FString userEmail = TEXT("An email associated with an existing user"); +}; + +#define ADD_TEST(Name) TestFunctions.Add(&PlayFabApiTestSuite::Name); TestFunctionNames.Add(TEXT(#Name)); +class PlayFabApiTestSuite : public FAutomationTestBase +{ + typedef bool (PlayFabApiTestSuite::*TestFunc)() const; + +public: + static FString playFabId; // Set by PlayFabApiTest_0LoginWithEmail upon successful login + static FString entityId; // Set by PlayFabApiTest_GetEntityToken if retrieved successfully + static FString entityType; // Set by PlayFabApiTest_GetEntityToken if retrieved successfully + + // TEST CONSTANTS + FString TEST_DATA_KEY_1 = TEXT("testCounter"); + FString TEST_DATA_KEY_2 = TEXT("deleteCounter"); + FString TEST_STAT_NAME = TEXT("str"); + FString INVALID_PASSWORD = TEXT("INVALID_PASSWORD"); + FString CLOUD_FUNCTION_HELLO_WORLD = TEXT("helloWorld"); + FString CLOUD_FUNCTION_THROW_ERROR = TEXT("throwError"); + + // Input from TestTitleData.json + TestTitleData testTitleData; + + PlayFabApiTestSuite(const FString& InName) + : FAutomationTestBase(InName, false) + { + if (!LoadTitleData()) + return; + // IPlayFabModuleInterface::Get().SetTitleInformationFromJson(//todo); + + ADD_TEST(InvalidLogin); + ADD_TEST(LoginOrRegister); + ADD_TEST(LoginWithAdvertisingId); + ADD_TEST(UserDataApi); + ADD_TEST(PlayerStatisticsApi); + ADD_TEST(UserCharacter); + ADD_TEST(LeaderBoard); + ADD_TEST(AccountInfo); + ADD_TEST(CloudScript); + ADD_TEST(CloudScriptError); + ADD_TEST(WriteEvent); + ADD_TEST(GetEntityToken); + ADD_TEST(ObjectApi); + } + +#if (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 11) + virtual uint32 GetTestFlags() const override { return EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter; } +#elif (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION == 9) + virtual uint32 GetTestFlags() const override { return EAutomationTestFlags::ATF_Editor; } +#endif + virtual bool IsStressTest() const { return false; } + virtual uint32 GetRequiredDeviceNum() const override { return 1; } + +protected: + bool LoadTitleData() + { + bool success = true; + + FString jsonInput; + FString filename = TEXT("testTitleData.json"); + + // Prefer to load path from environment variable, if present + char* envPath = nullptr; + size_t envPathStrLen; + errno_t err = _dupenv_s(&envPath, &envPathStrLen, "PF_TEST_TITLE_DATA_JSON"); + if (err == 0 && envPath != nullptr) + filename = FString(ANSI_TO_TCHAR(envPath)); + if (envPath != nullptr) + free(envPath); + + success &= FFileHelper::LoadFileToString(jsonInput, *filename); + + TSharedPtr jsonParsed = nullptr; + if (success) + { + TSharedRef> jsonReader = TJsonReaderFactory<>::Create(jsonInput); + success &= FJsonSerializer::Deserialize(jsonReader, jsonParsed); + } + + if (success) success &= jsonParsed->TryGetStringField("titleId", testTitleData.titleId); + if (success) success &= jsonParsed->TryGetStringField("developerSecretKey", testTitleData.developerSecretKey); + if (success) success &= jsonParsed->TryGetStringField("userEmail", testTitleData.userEmail); + + return success; + } + + virtual FString GetBeautifiedTestName() const override { return "PlayFabApiTests"; } + virtual void GetTests(TArray& OutBeautifiedNames, TArray & OutTestCommands) const override + { + for (const FString& pfTestName : TestFunctionNames) + { + OutBeautifiedNames.Add(pfTestName); + OutTestCommands.Add(pfTestName); + } + } + + bool RunTest(const FString& Parameters) override + { + clientAPI = IPlayFabModuleInterface::Get().GetClientAPI(); + serverAPI = IPlayFabModuleInterface::Get().GetServerAPI(); + TestTrue(TEXT("The clientAPI reports itself as invalid."), clientAPI.IsValid()); + TestTrue(TEXT("The serverAPI reports itself as invalid."), serverAPI.IsValid()); + serverAPI->SetTitleId(testTitleData.titleId); + serverAPI->SetDevSecretKey(testTitleData.developerSecretKey); + + if (clientAPI.IsValid() && serverAPI.IsValid()) + { + // find the matching test + for (int32 i = 0; i < TestFunctionNames.Num(); ++i) + { + if (TestFunctionNames[i] == Parameters) + { + TestFunc TestFunction = TestFunctions[i]; + return (this->*TestFunction)(); + } + } + } + return false; + } + + bool InvalidLogin() const + { + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_0LoginWithEmail(testTitleData.userEmail, INVALID_PASSWORD)); + + return true; + }; + + bool LoginOrRegister() const + { + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_0LoginWithCustomID(clientAPI->GetBuildIdentifier())); + + return true; + }; + + bool LoginWithAdvertisingId() const + { + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_0LoginWithAdvertisingId(clientAPI->GetBuildIdentifier())); + + return true; + }; + + bool UserDataApi() const + { + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_GetUserData(TEST_DATA_KEY_1, TEST_DATA_KEY_2, -1)); + + return true; + }; + + bool PlayerStatisticsApi() const + { + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_UpdatePlayerStatistics(TEST_STAT_NAME, -1)); + + return true; + }; + + bool UserCharacter() const + { + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_GetAllUsersCharacters()); + + return true; + }; + + bool LeaderBoard() const + { + // These are both read-only, and don't interfere, so they can be run in parallel + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_GetLeaderboardC(TEST_STAT_NAME)); + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_GetLeaderboardS(TEST_STAT_NAME)); + + return true; + }; + + bool AccountInfo() const + { + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_GetAccountInfo()); + + return true; + }; + + bool CloudScript() const + { + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_ExecuteCloudScript(CLOUD_FUNCTION_HELLO_WORLD, false)); + + return true; + }; + + bool CloudScriptError() const + { + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_ExecuteCloudScript(CLOUD_FUNCTION_THROW_ERROR, true)); + + return true; + }; + + bool WriteEvent() const + { + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_WriteEvent()); + + return true; + }; + + bool GetEntityToken() const + { + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_GetEntityToken()); + + return true; + }; + + bool ObjectApi() const + { + ADD_LATENT_AUTOMATION_COMMAND(PlayFabApiTest_ObjectApi()); + + return true; + }; + + PlayFabAuthenticationPtr authenticationAPI; + PlayFabClientPtr clientAPI; + PlayFabDataPtr dataAPI; + PlayFabServerPtr serverAPI; + TArray TestFunctions; + TArray TestFunctionNames; +}; + +namespace +{ + PlayFabApiTestSuite FPlayFabApiTestsAutomationTestInstance(TEXT("FPlayFabApiTests")); +} diff --git a/ExampleProject/Source/ExampleProjectEditor.Target.cs b/ExampleProject/Source/ExampleProjectEditor.Target.cs new file mode 100644 index 000000000..0ada2cc92 --- /dev/null +++ b/ExampleProject/Source/ExampleProjectEditor.Target.cs @@ -0,0 +1,15 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +using UnrealBuildTool; +using System.Collections.Generic; + +public class ExampleProjectEditorTarget : TargetRules +{ + public ExampleProjectEditorTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Editor; + ExtraModuleNames.AddRange(new string[] { "ExampleProject" }); + } +} diff --git a/PlayFabPlugin/PlayFab/Config/FilterPlugin.ini b/PlayFabPlugin/PlayFab/Config/FilterPlugin.ini new file mode 100644 index 000000000..ccebca2f3 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Config/FilterPlugin.ini @@ -0,0 +1,8 @@ +[FilterPlugin] +; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and +; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively. +; +; Examples: +; /README.txt +; /Extras/... +; /Binaries/ThirdParty/*.dll diff --git a/PlayFabPlugin/PlayFab/Content/pf_icon.uasset b/PlayFabPlugin/PlayFab/Content/pf_icon.uasset new file mode 100644 index 000000000..8d6aabc4f Binary files /dev/null and b/PlayFabPlugin/PlayFab/Content/pf_icon.uasset differ diff --git a/PlayFabPlugin/PlayFab/PlayFab.uplugin b/PlayFabPlugin/PlayFab/PlayFab.uplugin new file mode 100644 index 000000000..57a903a51 --- /dev/null +++ b/PlayFabPlugin/PlayFab/PlayFab.uplugin @@ -0,0 +1,34 @@ +{ + "FileVersion": 3, + "FriendlyName": "PlayFab Marketplace Plugin", + "Version": 0, + "EngineVersion": "4.20", + "VersionName": "1.1.180829", + "CreatedBy": "PlayFab and Phoenix Labs", + "CreatedByURL": "https://playfab.com/", + "DocsURL": "https://api.playfab.com/", + "SupportURL": "https://community.playfab.com/index.html", + "Category": "PlayFab", + "Description": "PlayFab Marketplace plugin for Unreal Engine 4.20 Current API version: 1.1.180829", + "MarketplaceURL": "com.epicgames.launcher://ue/marketplace/content/217fdf581b784571af03d3fb6580368f", + "Modules": [ + { + "Name": "PlayFabCpp", + "Type": "Runtime", + "LoadingPhase": "PreDefault", + "WhitelistPlatforms": [ "Win64", "Win32", "Mac", "IOS", "Android" ] + }, + { + "Name": "PlayFab", + "Type": "Runtime", + "LoadingPhase": "PreDefault", + "WhitelistPlatforms": [ "Win64", "Win32", "Mac", "IOS", "Android" ] + }, + { + "Name": "PlayFabCommon", + "Type": "Runtime", + "LoadingPhase": "PreDefault", + "WhitelistPlatforms": [ "Win64", "Win32", "Mac", "IOS", "Android" ] + } + ] +} diff --git a/PlayFabPlugin/PlayFab/Resources/Icon128.png b/PlayFabPlugin/PlayFab/Resources/Icon128.png new file mode 100644 index 000000000..3033ae0ed Binary files /dev/null and b/PlayFabPlugin/PlayFab/Resources/Icon128.png differ diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAdminAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAdminAPI.h new file mode 100644 index 000000000..c6757fd73 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAdminAPI.h @@ -0,0 +1,1661 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Admin +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabAdminModels.h" +#include "PlayFabAdminAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabAdminRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabAdminAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabAdminRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Admin API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessBanUsers, FAdminBanUsersResult, result, UObject*, customData); + + /** Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* BanUsers(FAdminBanUsersRequest request, + FDelegateOnSuccessBanUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperBanUsers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteMasterPlayerAccount, FAdminDeleteMasterPlayerAccountResult, result, UObject*, customData); + + /** Removes a master player account entirely from all titles and deletes all associated data */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeleteMasterPlayerAccount(FAdminDeleteMasterPlayerAccountRequest request, + FDelegateOnSuccessDeleteMasterPlayerAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteMasterPlayerAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeletePlayer, FAdminDeletePlayerResult, result, UObject*, customData); + + /** Removes a user's player account from a title and deletes all associated data */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeletePlayer(FAdminDeletePlayerRequest request, + FDelegateOnSuccessDeletePlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeletePlayer(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteTitle, FAdminDeleteTitleResult, result, UObject*, customData); + + /** Permanently deletes a title and all associated configuration */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeleteTitle(FAdminDeleteTitleRequest request, + FDelegateOnSuccessDeleteTitle onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteTitle(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessExportMasterPlayerData, FAdminExportMasterPlayerDataResult, result, UObject*, customData); + + /** Exports all associated data of a master player account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ExportMasterPlayerData(FAdminExportMasterPlayerDataRequest request, + FDelegateOnSuccessExportMasterPlayerData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperExportMasterPlayerData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayedTitleList, FAdminGetPlayedTitleListResult, result, UObject*, customData); + + /** Get the list of titles that the player has played */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayedTitleList(FAdminGetPlayedTitleListRequest request, + FDelegateOnSuccessGetPlayedTitleList onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayedTitleList(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerIdFromAuthToken, FAdminGetPlayerIdFromAuthTokenResult, result, UObject*, customData); + + /** Gets a player's ID from an auth token. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerIdFromAuthToken(FAdminGetPlayerIdFromAuthTokenRequest request, + FDelegateOnSuccessGetPlayerIdFromAuthToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerIdFromAuthToken(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerProfile, FAdminGetPlayerProfileResult, result, UObject*, customData); + + /** Retrieves the player's profile */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerProfile(FAdminGetPlayerProfileRequest request, + FDelegateOnSuccessGetPlayerProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerProfile(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserAccountInfo, FAdminLookupUserAccountInfoResult, result, UObject*, customData); + + /** Retrieves the relevant details for a specified user, based upon a match against a supplied unique identifier */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserAccountInfo(FAdminLookupUserAccountInfoRequest request, + FDelegateOnSuccessGetUserAccountInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserAccountInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserBans, FAdminGetUserBansResult, result, UObject*, customData); + + /** Gets all bans for a user. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserBans(FAdminGetUserBansRequest request, + FDelegateOnSuccessGetUserBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserBans(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessResetPassword, FAdminResetPasswordResult, result, UObject*, customData); + + /** Reset a player's password for a given title. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ResetPassword(FAdminResetPasswordRequest request, + FDelegateOnSuccessResetPassword onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperResetPassword(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeAllBansForUser, FAdminRevokeAllBansForUserResult, result, UObject*, customData); + + /** Revoke all active bans for a user. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RevokeAllBansForUser(FAdminRevokeAllBansForUserRequest request, + FDelegateOnSuccessRevokeAllBansForUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeAllBansForUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeBans, FAdminRevokeBansResult, result, UObject*, customData); + + /** Revoke all active bans specified with BanId. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RevokeBans(FAdminRevokeBansRequest request, + FDelegateOnSuccessRevokeBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeBans(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSendAccountRecoveryEmail, FAdminSendAccountRecoveryEmailResult, result, UObject*, customData); + + /** + * Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to + * change the password.If an account recovery email template ID is provided, an email using the custom email template will + * be used. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SendAccountRecoveryEmail(FAdminSendAccountRecoveryEmailRequest request, + FDelegateOnSuccessSendAccountRecoveryEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSendAccountRecoveryEmail(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateBans, FAdminUpdateBansResult, result, UObject*, customData); + + /** Updates information of a list of existing bans specified with Ban Ids. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateBans(FAdminUpdateBansRequest request, + FDelegateOnSuccessUpdateBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateBans(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserTitleDisplayName, FAdminUpdateUserTitleDisplayNameResult, result, UObject*, customData); + + /** Updates the title specific display name for a user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserTitleDisplayName(FAdminUpdateUserTitleDisplayNameRequest request, + FDelegateOnSuccessUpdateUserTitleDisplayName onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserTitleDisplayName(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreatePlayerSharedSecret, FAdminCreatePlayerSharedSecretResult, result, UObject*, customData); + + /** + * Creates a new Player Shared Secret Key. It may take up to 5 minutes for this key to become generally available after + * this API returns. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* CreatePlayerSharedSecret(FAdminCreatePlayerSharedSecretRequest request, + FDelegateOnSuccessCreatePlayerSharedSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreatePlayerSharedSecret(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeletePlayerSharedSecret, FAdminDeletePlayerSharedSecretResult, result, UObject*, customData); + + /** + * Deletes an existing Player Shared Secret Key. It may take up to 5 minutes for this delete to be reflected after this API + * returns. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeletePlayerSharedSecret(FAdminDeletePlayerSharedSecretRequest request, + FDelegateOnSuccessDeletePlayerSharedSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeletePlayerSharedSecret(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerSharedSecrets, FAdminGetPlayerSharedSecretsResult, result, UObject*, customData); + + /** Returns all Player Shared Secret Keys including disabled and expired. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerSharedSecrets(FAdminGetPlayerSharedSecretsRequest request, + FDelegateOnSuccessGetPlayerSharedSecrets onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerSharedSecrets(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPolicy, FAdminGetPolicyResponse, result, UObject*, customData); + + /** Gets the requested policy. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPolicy(FAdminGetPolicyRequest request, + FDelegateOnSuccessGetPolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPolicy(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetPlayerSecret, FAdminSetPlayerSecretResult, result, UObject*, customData); + + /** Sets or resets the player's secret. Player secrets are used to sign API requests. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetPlayerSecret(FAdminSetPlayerSecretRequest request, + FDelegateOnSuccessSetPlayerSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetPlayerSecret(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdatePlayerSharedSecret, FAdminUpdatePlayerSharedSecretResult, result, UObject*, customData); + + /** + * Updates a existing Player Shared Secret Key. It may take up to 5 minutes for this update to become generally available + * after this API returns. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdatePlayerSharedSecret(FAdminUpdatePlayerSharedSecretRequest request, + FDelegateOnSuccessUpdatePlayerSharedSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdatePlayerSharedSecret(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdatePolicy, FAdminUpdatePolicyResponse, result, UObject*, customData); + + /** Changes a policy for a title */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdatePolicy(FAdminUpdatePolicyRequest request, + FDelegateOnSuccessUpdatePolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdatePolicy(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Characters + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessResetCharacterStatistics, FAdminResetCharacterStatisticsResult, result, UObject*, customData); + + /** Completely removes all statistics for the specified character, for the current game */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ResetCharacterStatistics(FAdminResetCharacterStatisticsRequest request, + FDelegateOnSuccessResetCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperResetCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Content + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteContent, FAdminBlankResult, result, UObject*, customData); + + /** Delete a content file from the title. When deleting a file that does not exist, it returns success. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeleteContent(FAdminDeleteContentRequest request, + FDelegateOnSuccessDeleteContent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteContent(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetContentList, FAdminGetContentListResult, result, UObject*, customData); + + /** List all contents of the title and get statistics such as size */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetContentList(FAdminGetContentListRequest request, + FDelegateOnSuccessGetContentList onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetContentList(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetContentUploadUrl, FAdminGetContentUploadUrlResult, result, UObject*, customData); + + /** + * Retrieves the pre-signed URL for uploading a content file. A subsequent HTTP PUT to the returned URL uploads the + * content. Also, please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN + * rates apply. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetContentUploadUrl(FAdminGetContentUploadUrlRequest request, + FDelegateOnSuccessGetContentUploadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetContentUploadUrl(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Custom Server Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddServerBuild, FAdminAddServerBuildResult, result, UObject*, customData); + + /** + * Adds the game server executable specified (previously uploaded - see GetServerBuildUploadUrl) to the set of those a + * client is permitted to request in a call to StartGame + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* AddServerBuild(FAdminAddServerBuildRequest request, + FDelegateOnSuccessAddServerBuild onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddServerBuild(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetServerBuildInfo, FAdminGetServerBuildInfoResult, result, UObject*, customData); + + /** Retrieves the build details for the specified game server executable */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetServerBuildInfo(FAdminGetServerBuildInfoRequest request, + FDelegateOnSuccessGetServerBuildInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetServerBuildInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetServerBuildUploadUrl, FAdminGetServerBuildUploadURLResult, result, UObject*, customData); + + /** + * Retrieves the pre-authorized URL for uploading a game server package containing a build (does not enable the build for + * use - see AddServerBuild) + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetServerBuildUploadUrl(FAdminGetServerBuildUploadURLRequest request, + FDelegateOnSuccessGetServerBuildUploadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetServerBuildUploadUrl(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListServerBuilds, FAdminListBuildsResult, result, UObject*, customData); + + /** Retrieves the build details for all game server executables which are currently defined for the title */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ListServerBuilds(FAdminListBuildsRequest request, + FDelegateOnSuccessListServerBuilds onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListServerBuilds(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessModifyServerBuild, FAdminModifyServerBuildResult, result, UObject*, customData); + + /** Updates the build details for the specified game server executable */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ModifyServerBuild(FAdminModifyServerBuildRequest request, + FDelegateOnSuccessModifyServerBuild onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperModifyServerBuild(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveServerBuild, FAdminRemoveServerBuildResult, result, UObject*, customData); + + /** + * Removes the game server executable specified from the set of those a client is permitted to request in a call to + * StartGame + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RemoveServerBuild(FAdminRemoveServerBuildRequest request, + FDelegateOnSuccessRemoveServerBuild onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveServerBuild(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetMatchmakerGameInfo, FAdminGetMatchmakerGameInfoResult, result, UObject*, customData); + + /** Retrieves the details for a specific completed session, including links to standard out and standard error logs */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetMatchmakerGameInfo(FAdminGetMatchmakerGameInfoRequest request, + FDelegateOnSuccessGetMatchmakerGameInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetMatchmakerGameInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetMatchmakerGameModes, FAdminGetMatchmakerGameModesResult, result, UObject*, customData); + + /** Retrieves the details of defined game modes for the specified game server executable */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetMatchmakerGameModes(FAdminGetMatchmakerGameModesRequest request, + FDelegateOnSuccessGetMatchmakerGameModes onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetMatchmakerGameModes(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessModifyMatchmakerGameModes, FAdminModifyMatchmakerGameModesResult, result, UObject*, customData); + + /** Updates the game server mode details for the specified game server executable */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ModifyMatchmakerGameModes(FAdminModifyMatchmakerGameModesRequest request, + FDelegateOnSuccessModifyMatchmakerGameModes onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperModifyMatchmakerGameModes(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Player Data Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreatePlayerStatisticDefinition, FAdminCreatePlayerStatisticDefinitionResult, result, UObject*, customData); + + /** + * Adds a new player statistic configuration to the title, optionally allowing the developer to specify a reset interval + * and an aggregation method. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* CreatePlayerStatisticDefinition(FAdminCreatePlayerStatisticDefinitionRequest request, + FDelegateOnSuccessCreatePlayerStatisticDefinition onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreatePlayerStatisticDefinition(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetDataReport, FAdminGetDataReportResult, result, UObject*, customData); + + /** Retrieves a download URL for the requested report */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetDataReport(FAdminGetDataReportRequest request, + FDelegateOnSuccessGetDataReport onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetDataReport(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerStatisticDefinitions, FAdminGetPlayerStatisticDefinitionsResult, result, UObject*, customData); + + /** + * Retrieves the configuration information for all player statistics defined in the title, regardless of whether they have + * a reset interval. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerStatisticDefinitions(FAdminGetPlayerStatisticDefinitionsRequest request, + FDelegateOnSuccessGetPlayerStatisticDefinitions onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerStatisticDefinitions(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerStatisticVersions, FAdminGetPlayerStatisticVersionsResult, result, UObject*, customData); + + /** Retrieves the information on the available versions of the specified statistic. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerStatisticVersions(FAdminGetPlayerStatisticVersionsRequest request, + FDelegateOnSuccessGetPlayerStatisticVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerStatisticVersions(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserData, FAdminGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserInternalData, FAdminGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserInternalData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherData, FAdminGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserPublisherData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherInternalData, FAdminGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserPublisherInternalData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherReadOnlyData, FAdminGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserPublisherReadOnlyData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserReadOnlyData, FAdminGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserReadOnlyData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessIncrementPlayerStatisticVersion, FAdminIncrementPlayerStatisticVersionResult, result, UObject*, customData); + + /** Resets the indicated statistic, removing all player entries for it and backing up the old values. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* IncrementPlayerStatisticVersion(FAdminIncrementPlayerStatisticVersionRequest request, + FDelegateOnSuccessIncrementPlayerStatisticVersion onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperIncrementPlayerStatisticVersion(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRefundPurchase, FAdminRefundPurchaseResponse, result, UObject*, customData); + + /** Attempts to process an order refund through the original real money payment provider. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RefundPurchase(FAdminRefundPurchaseRequest request, + FDelegateOnSuccessRefundPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRefundPurchase(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessResetUserStatistics, FAdminResetUserStatisticsResult, result, UObject*, customData); + + /** Completely removes all statistics for the specified user, for the current game */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ResetUserStatistics(FAdminResetUserStatisticsRequest request, + FDelegateOnSuccessResetUserStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperResetUserStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessResolvePurchaseDispute, FAdminResolvePurchaseDisputeResponse, result, UObject*, customData); + + /** Attempts to resolve a dispute with the original order's payment provider. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ResolvePurchaseDispute(FAdminResolvePurchaseDisputeRequest request, + FDelegateOnSuccessResolvePurchaseDispute onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperResolvePurchaseDispute(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdatePlayerStatisticDefinition, FAdminUpdatePlayerStatisticDefinitionResult, result, UObject*, customData); + + /** Updates a player statistic configuration for the title, optionally allowing the developer to specify a reset interval. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdatePlayerStatisticDefinition(FAdminUpdatePlayerStatisticDefinitionRequest request, + FDelegateOnSuccessUpdatePlayerStatisticDefinition onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdatePlayerStatisticDefinition(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserData, FAdminUpdateUserDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserInternalData, FAdminUpdateUserDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserInternalData(FAdminUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherData, FAdminUpdateUserDataResult, result, UObject*, customData); + + /** Updates the publisher-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserPublisherData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherInternalData, FAdminUpdateUserDataResult, result, UObject*, customData); + + /** Updates the publisher-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserPublisherInternalData(FAdminUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherReadOnlyData, FAdminUpdateUserDataResult, result, UObject*, customData); + + /** Updates the publisher-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserPublisherReadOnlyData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserReadOnlyData, FAdminUpdateUserDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateUserReadOnlyData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Player Item Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddUserVirtualCurrency, FAdminModifyUserVirtualCurrencyResult, result, UObject*, customData); + + /** Increments the specified virtual currency by the stated amount */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* AddUserVirtualCurrency(FAdminAddUserVirtualCurrencyRequest request, + FDelegateOnSuccessAddUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCheckLimitedEditionItemAvailability, FAdminCheckLimitedEditionItemAvailabilityResult, result, UObject*, customData); + + /** Checks the global count for the limited edition item. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* CheckLimitedEditionItemAvailability(FAdminCheckLimitedEditionItemAvailabilityRequest request, + FDelegateOnSuccessCheckLimitedEditionItemAvailability onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCheckLimitedEditionItemAvailability(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserInventory, FAdminGetUserInventoryResult, result, UObject*, customData); + + /** Retrieves the specified user's current inventory of virtual goods */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetUserInventory(FAdminGetUserInventoryRequest request, + FDelegateOnSuccessGetUserInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserInventory(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGrantItemsToUsers, FAdminGrantItemsToUsersResult, result, UObject*, customData); + + /** Adds the specified items to the specified user inventories */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GrantItemsToUsers(FAdminGrantItemsToUsersRequest request, + FDelegateOnSuccessGrantItemsToUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGrantItemsToUsers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessIncrementLimitedEditionItemAvailability, FAdminIncrementLimitedEditionItemAvailabilityResult, result, UObject*, customData); + + /** Increases the global count for the given scarce resource. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* IncrementLimitedEditionItemAvailability(FAdminIncrementLimitedEditionItemAvailabilityRequest request, + FDelegateOnSuccessIncrementLimitedEditionItemAvailability onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperIncrementLimitedEditionItemAvailability(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeInventoryItem, FAdminRevokeInventoryResult, result, UObject*, customData); + + /** Revokes access to an item in a user's inventory */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RevokeInventoryItem(FAdminRevokeInventoryItemRequest request, + FDelegateOnSuccessRevokeInventoryItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeInventoryItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeInventoryItems, FAdminRevokeInventoryItemsResult, result, UObject*, customData); + + /** Revokes access for up to 25 items across multiple users and characters. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RevokeInventoryItems(FAdminRevokeInventoryItemsRequest request, + FDelegateOnSuccessRevokeInventoryItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeInventoryItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSubtractUserVirtualCurrency, FAdminModifyUserVirtualCurrencyResult, result, UObject*, customData); + + /** Decrements the specified virtual currency by the stated amount */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SubtractUserVirtualCurrency(FAdminSubtractUserVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSubtractUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // PlayStream + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddPlayerTag, FAdminAddPlayerTagResult, result, UObject*, customData); + + /** Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* AddPlayerTag(FAdminAddPlayerTagRequest request, + FDelegateOnSuccessAddPlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddPlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetAllSegments, FAdminGetAllSegmentsResult, result, UObject*, customData); + + /** + * Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as + * GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetAllSegments(FAdminGetAllSegmentsRequest request, + FDelegateOnSuccessGetAllSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetAllSegments(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerSegments, FAdminGetPlayerSegmentsResult, result, UObject*, customData); + + /** List all segments that a player currently belongs to at this moment in time. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerSegments(FAdminGetPlayersSegmentsRequest request, + FDelegateOnSuccessGetPlayerSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerSegments(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayersInSegment, FAdminGetPlayersInSegmentResult, result, UObject*, customData); + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match + * the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span + * on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected + * in the results. AB Test segments are currently not supported by this operation. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayersInSegment(FAdminGetPlayersInSegmentRequest request, + FDelegateOnSuccessGetPlayersInSegment onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayersInSegment(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerTags, FAdminGetPlayerTagsResult, result, UObject*, customData); + + /** Get all tags with a given Namespace (optional) from a player profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPlayerTags(FAdminGetPlayerTagsRequest request, + FDelegateOnSuccessGetPlayerTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerTags(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemovePlayerTag, FAdminRemovePlayerTagResult, result, UObject*, customData); + + /** Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RemovePlayerTag(FAdminRemovePlayerTagRequest request, + FDelegateOnSuccessRemovePlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemovePlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // ScheduledTask + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAbortTaskInstance, FAdminEmptyResponse, result, UObject*, customData); + + /** Abort an ongoing task instance. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* AbortTaskInstance(FAdminAbortTaskInstanceRequest request, + FDelegateOnSuccessAbortTaskInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAbortTaskInstance(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreateActionsOnPlayersInSegmentTask, FAdminCreateTaskResult, result, UObject*, customData); + + /** Create an ActionsOnPlayersInSegment task, which iterates through all players in a segment to execute action. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* CreateActionsOnPlayersInSegmentTask(FAdminCreateActionsOnPlayerSegmentTaskRequest request, + FDelegateOnSuccessCreateActionsOnPlayersInSegmentTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreateActionsOnPlayersInSegmentTask(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreateCloudScriptTask, FAdminCreateTaskResult, result, UObject*, customData); + + /** Create a CloudScript task, which can run a CloudScript on a schedule. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* CreateCloudScriptTask(FAdminCreateCloudScriptTaskRequest request, + FDelegateOnSuccessCreateCloudScriptTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreateCloudScriptTask(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteTask, FAdminEmptyResponse, result, UObject*, customData); + + /** Delete a task. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeleteTask(FAdminDeleteTaskRequest request, + FDelegateOnSuccessDeleteTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteTask(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetActionsOnPlayersInSegmentTaskInstance, FAdminGetActionsOnPlayersInSegmentTaskInstanceResult, result, UObject*, customData); + + /** Get information about a ActionsOnPlayersInSegment task instance. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetActionsOnPlayersInSegmentTaskInstance(FAdminGetTaskInstanceRequest request, + FDelegateOnSuccessGetActionsOnPlayersInSegmentTaskInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetActionsOnPlayersInSegmentTaskInstance(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCloudScriptTaskInstance, FAdminGetCloudScriptTaskInstanceResult, result, UObject*, customData); + + /** Get detail information about a CloudScript task instance. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetCloudScriptTaskInstance(FAdminGetTaskInstanceRequest request, + FDelegateOnSuccessGetCloudScriptTaskInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCloudScriptTaskInstance(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTaskInstances, FAdminGetTaskInstancesResult, result, UObject*, customData); + + /** Query for task instances by task, status, or time range. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetTaskInstances(FAdminGetTaskInstancesRequest request, + FDelegateOnSuccessGetTaskInstances onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTaskInstances(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTasks, FAdminGetTasksResult, result, UObject*, customData); + + /** Get definition information on a specified task or all tasks within a title. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetTasks(FAdminGetTasksRequest request, + FDelegateOnSuccessGetTasks onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTasks(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRunTask, FAdminRunTaskResult, result, UObject*, customData); + + /** Run a task immediately regardless of its schedule. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RunTask(FAdminRunTaskRequest request, + FDelegateOnSuccessRunTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRunTask(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateTask, FAdminEmptyResponse, result, UObject*, customData); + + /** Update an existing task. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateTask(FAdminUpdateTaskRequest request, + FDelegateOnSuccessUpdateTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateTask(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCloudScriptRevision, FAdminGetCloudScriptRevisionResult, result, UObject*, customData); + + /** Gets the contents and information of a specific Cloud Script revision. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetCloudScriptRevision(FAdminGetCloudScriptRevisionRequest request, + FDelegateOnSuccessGetCloudScriptRevision onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCloudScriptRevision(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCloudScriptVersions, FAdminGetCloudScriptVersionsResult, result, UObject*, customData); + + /** + * Lists all the current cloud script versions. For each version, information about the current published and latest + * revisions is also listed. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetCloudScriptVersions(FAdminGetCloudScriptVersionsRequest request, + FDelegateOnSuccessGetCloudScriptVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCloudScriptVersions(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetPublishedRevision, FAdminSetPublishedRevisionResult, result, UObject*, customData); + + /** Sets the currently published revision of a title Cloud Script */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetPublishedRevision(FAdminSetPublishedRevisionRequest request, + FDelegateOnSuccessSetPublishedRevision onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetPublishedRevision(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCloudScript, FAdminUpdateCloudScriptResult, result, UObject*, customData); + + /** + * Creates a new Cloud Script revision and uploads source code to it. Note that at this time, only one file should be + * submitted in the revision. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateCloudScript(FAdminUpdateCloudScriptRequest request, + FDelegateOnSuccessUpdateCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Shared Group Data + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetPublisherData, FAdminSetPublisherDataResult, result, UObject*, customData); + + /** Updates the key-value store of custom publisher settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetPublisherData(FAdminSetPublisherDataRequest request, + FDelegateOnSuccessSetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Title-Wide Data Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddNews, FAdminAddNewsResult, result, UObject*, customData); + + /** Adds a new news item to the title's news feed */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* AddNews(FAdminAddNewsRequest request, + FDelegateOnSuccessAddNews onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddNews(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddVirtualCurrencyTypes, FAdminBlankResult, result, UObject*, customData); + + /** + * Adds one or more virtual currencies to the set defined for the title. Virtual Currencies have a maximum value of + * 2,147,483,647 when granted to a player. Any value over that will be discarded. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* AddVirtualCurrencyTypes(FAdminAddVirtualCurrencyTypesRequest request, + FDelegateOnSuccessAddVirtualCurrencyTypes onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddVirtualCurrencyTypes(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteStore, FAdminDeleteStoreResult, result, UObject*, customData); + + /** Deletes an existing virtual item store */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* DeleteStore(FAdminDeleteStoreRequest request, + FDelegateOnSuccessDeleteStore onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteStore(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCatalogItems, FAdminGetCatalogItemsResult, result, UObject*, customData); + + /** Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetCatalogItems(FAdminGetCatalogItemsRequest request, + FDelegateOnSuccessGetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPublisherData, FAdminGetPublisherDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom publisher settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetPublisherData(FAdminGetPublisherDataRequest request, + FDelegateOnSuccessGetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetRandomResultTables, FAdminGetRandomResultTablesResult, result, UObject*, customData); + + /** Retrieves the random drop table configuration for the title */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetRandomResultTables(FAdminGetRandomResultTablesRequest request, + FDelegateOnSuccessGetRandomResultTables onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetRandomResultTables(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetStoreItems, FAdminGetStoreItemsResult, result, UObject*, customData); + + /** Retrieves the set of items defined for the specified store, including all prices defined */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetStoreItems(FAdminGetStoreItemsRequest request, + FDelegateOnSuccessGetStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleData, FAdminGetTitleDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom title settings which can be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetTitleData(FAdminGetTitleDataRequest request, + FDelegateOnSuccessGetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleInternalData, FAdminGetTitleDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom title settings which cannot be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* GetTitleInternalData(FAdminGetTitleDataRequest request, + FDelegateOnSuccessGetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListVirtualCurrencyTypes, FAdminListVirtualCurrencyTypesResult, result, UObject*, customData); + + /** Retuns the list of all defined virtual currencies for the title */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* ListVirtualCurrencyTypes(FAdminListVirtualCurrencyTypesRequest request, + FDelegateOnSuccessListVirtualCurrencyTypes onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListVirtualCurrencyTypes(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveVirtualCurrencyTypes, FAdminBlankResult, result, UObject*, customData); + + /** Removes one or more virtual currencies from the set defined for the title. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* RemoveVirtualCurrencyTypes(FAdminRemoveVirtualCurrencyTypesRequest request, + FDelegateOnSuccessRemoveVirtualCurrencyTypes onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveVirtualCurrencyTypes(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetCatalogItems, FAdminUpdateCatalogItemsResult, result, UObject*, customData); + + /** Creates the catalog configuration of all virtual goods for the specified catalog version */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetCatalogItems(FAdminUpdateCatalogItemsRequest request, + FDelegateOnSuccessSetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetStoreItems, FAdminUpdateStoreItemsResult, result, UObject*, customData); + + /** Sets all the items in one virtual store */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetStoreItems(FAdminUpdateStoreItemsRequest request, + FDelegateOnSuccessSetStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetTitleData, FAdminSetTitleDataResult, result, UObject*, customData); + + /** Creates and updates the key-value store of custom title settings which can be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetTitleData(FAdminSetTitleDataRequest request, + FDelegateOnSuccessSetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetTitleInternalData, FAdminSetTitleDataResult, result, UObject*, customData); + + /** Updates the key-value store of custom title settings which cannot be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetTitleInternalData(FAdminSetTitleDataRequest request, + FDelegateOnSuccessSetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetupPushNotification, FAdminSetupPushNotificationResult, result, UObject*, customData); + + /** + * Sets the Amazon Resource Name (ARN) for iOS and Android push notifications. Documentation on the exact restrictions can + * be found at: http://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformApplication.html. Currently, Amazon device + * Messaging is not supported. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* SetupPushNotification(FAdminSetupPushNotificationRequest request, + FDelegateOnSuccessSetupPushNotification onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetupPushNotification(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCatalogItems, FAdminUpdateCatalogItemsResult, result, UObject*, customData); + + /** Updates the catalog configuration for virtual goods in the specified catalog version */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateCatalogItems(FAdminUpdateCatalogItemsRequest request, + FDelegateOnSuccessUpdateCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateRandomResultTables, FAdminUpdateRandomResultTablesResult, result, UObject*, customData); + + /** Updates the random drop table configuration for the title */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateRandomResultTables(FAdminUpdateRandomResultTablesRequest request, + FDelegateOnSuccessUpdateRandomResultTables onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateRandomResultTables(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateStoreItems, FAdminUpdateStoreItemsResult, result, UObject*, customData); + + /** Updates an existing virtual item store with new or modified items */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAdminAPI* UpdateStoreItems(FAdminUpdateStoreItemsRequest request, + FDelegateOnSuccessUpdateStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAdminRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessBanUsers OnSuccessBanUsers; + FDelegateOnSuccessDeleteMasterPlayerAccount OnSuccessDeleteMasterPlayerAccount; + FDelegateOnSuccessDeletePlayer OnSuccessDeletePlayer; + FDelegateOnSuccessDeleteTitle OnSuccessDeleteTitle; + FDelegateOnSuccessExportMasterPlayerData OnSuccessExportMasterPlayerData; + FDelegateOnSuccessGetPlayedTitleList OnSuccessGetPlayedTitleList; + FDelegateOnSuccessGetPlayerIdFromAuthToken OnSuccessGetPlayerIdFromAuthToken; + FDelegateOnSuccessGetPlayerProfile OnSuccessGetPlayerProfile; + FDelegateOnSuccessGetUserAccountInfo OnSuccessGetUserAccountInfo; + FDelegateOnSuccessGetUserBans OnSuccessGetUserBans; + FDelegateOnSuccessResetPassword OnSuccessResetPassword; + FDelegateOnSuccessRevokeAllBansForUser OnSuccessRevokeAllBansForUser; + FDelegateOnSuccessRevokeBans OnSuccessRevokeBans; + FDelegateOnSuccessSendAccountRecoveryEmail OnSuccessSendAccountRecoveryEmail; + FDelegateOnSuccessUpdateBans OnSuccessUpdateBans; + FDelegateOnSuccessUpdateUserTitleDisplayName OnSuccessUpdateUserTitleDisplayName; + FDelegateOnSuccessCreatePlayerSharedSecret OnSuccessCreatePlayerSharedSecret; + FDelegateOnSuccessDeletePlayerSharedSecret OnSuccessDeletePlayerSharedSecret; + FDelegateOnSuccessGetPlayerSharedSecrets OnSuccessGetPlayerSharedSecrets; + FDelegateOnSuccessGetPolicy OnSuccessGetPolicy; + FDelegateOnSuccessSetPlayerSecret OnSuccessSetPlayerSecret; + FDelegateOnSuccessUpdatePlayerSharedSecret OnSuccessUpdatePlayerSharedSecret; + FDelegateOnSuccessUpdatePolicy OnSuccessUpdatePolicy; + FDelegateOnSuccessResetCharacterStatistics OnSuccessResetCharacterStatistics; + FDelegateOnSuccessDeleteContent OnSuccessDeleteContent; + FDelegateOnSuccessGetContentList OnSuccessGetContentList; + FDelegateOnSuccessGetContentUploadUrl OnSuccessGetContentUploadUrl; + FDelegateOnSuccessAddServerBuild OnSuccessAddServerBuild; + FDelegateOnSuccessGetServerBuildInfo OnSuccessGetServerBuildInfo; + FDelegateOnSuccessGetServerBuildUploadUrl OnSuccessGetServerBuildUploadUrl; + FDelegateOnSuccessListServerBuilds OnSuccessListServerBuilds; + FDelegateOnSuccessModifyServerBuild OnSuccessModifyServerBuild; + FDelegateOnSuccessRemoveServerBuild OnSuccessRemoveServerBuild; + FDelegateOnSuccessGetMatchmakerGameInfo OnSuccessGetMatchmakerGameInfo; + FDelegateOnSuccessGetMatchmakerGameModes OnSuccessGetMatchmakerGameModes; + FDelegateOnSuccessModifyMatchmakerGameModes OnSuccessModifyMatchmakerGameModes; + FDelegateOnSuccessCreatePlayerStatisticDefinition OnSuccessCreatePlayerStatisticDefinition; + FDelegateOnSuccessGetDataReport OnSuccessGetDataReport; + FDelegateOnSuccessGetPlayerStatisticDefinitions OnSuccessGetPlayerStatisticDefinitions; + FDelegateOnSuccessGetPlayerStatisticVersions OnSuccessGetPlayerStatisticVersions; + FDelegateOnSuccessGetUserData OnSuccessGetUserData; + FDelegateOnSuccessGetUserInternalData OnSuccessGetUserInternalData; + FDelegateOnSuccessGetUserPublisherData OnSuccessGetUserPublisherData; + FDelegateOnSuccessGetUserPublisherInternalData OnSuccessGetUserPublisherInternalData; + FDelegateOnSuccessGetUserPublisherReadOnlyData OnSuccessGetUserPublisherReadOnlyData; + FDelegateOnSuccessGetUserReadOnlyData OnSuccessGetUserReadOnlyData; + FDelegateOnSuccessIncrementPlayerStatisticVersion OnSuccessIncrementPlayerStatisticVersion; + FDelegateOnSuccessRefundPurchase OnSuccessRefundPurchase; + FDelegateOnSuccessResetUserStatistics OnSuccessResetUserStatistics; + FDelegateOnSuccessResolvePurchaseDispute OnSuccessResolvePurchaseDispute; + FDelegateOnSuccessUpdatePlayerStatisticDefinition OnSuccessUpdatePlayerStatisticDefinition; + FDelegateOnSuccessUpdateUserData OnSuccessUpdateUserData; + FDelegateOnSuccessUpdateUserInternalData OnSuccessUpdateUserInternalData; + FDelegateOnSuccessUpdateUserPublisherData OnSuccessUpdateUserPublisherData; + FDelegateOnSuccessUpdateUserPublisherInternalData OnSuccessUpdateUserPublisherInternalData; + FDelegateOnSuccessUpdateUserPublisherReadOnlyData OnSuccessUpdateUserPublisherReadOnlyData; + FDelegateOnSuccessUpdateUserReadOnlyData OnSuccessUpdateUserReadOnlyData; + FDelegateOnSuccessAddUserVirtualCurrency OnSuccessAddUserVirtualCurrency; + FDelegateOnSuccessCheckLimitedEditionItemAvailability OnSuccessCheckLimitedEditionItemAvailability; + FDelegateOnSuccessGetUserInventory OnSuccessGetUserInventory; + FDelegateOnSuccessGrantItemsToUsers OnSuccessGrantItemsToUsers; + FDelegateOnSuccessIncrementLimitedEditionItemAvailability OnSuccessIncrementLimitedEditionItemAvailability; + FDelegateOnSuccessRevokeInventoryItem OnSuccessRevokeInventoryItem; + FDelegateOnSuccessRevokeInventoryItems OnSuccessRevokeInventoryItems; + FDelegateOnSuccessSubtractUserVirtualCurrency OnSuccessSubtractUserVirtualCurrency; + FDelegateOnSuccessAddPlayerTag OnSuccessAddPlayerTag; + FDelegateOnSuccessGetAllSegments OnSuccessGetAllSegments; + FDelegateOnSuccessGetPlayerSegments OnSuccessGetPlayerSegments; + FDelegateOnSuccessGetPlayersInSegment OnSuccessGetPlayersInSegment; + FDelegateOnSuccessGetPlayerTags OnSuccessGetPlayerTags; + FDelegateOnSuccessRemovePlayerTag OnSuccessRemovePlayerTag; + FDelegateOnSuccessAbortTaskInstance OnSuccessAbortTaskInstance; + FDelegateOnSuccessCreateActionsOnPlayersInSegmentTask OnSuccessCreateActionsOnPlayersInSegmentTask; + FDelegateOnSuccessCreateCloudScriptTask OnSuccessCreateCloudScriptTask; + FDelegateOnSuccessDeleteTask OnSuccessDeleteTask; + FDelegateOnSuccessGetActionsOnPlayersInSegmentTaskInstance OnSuccessGetActionsOnPlayersInSegmentTaskInstance; + FDelegateOnSuccessGetCloudScriptTaskInstance OnSuccessGetCloudScriptTaskInstance; + FDelegateOnSuccessGetTaskInstances OnSuccessGetTaskInstances; + FDelegateOnSuccessGetTasks OnSuccessGetTasks; + FDelegateOnSuccessRunTask OnSuccessRunTask; + FDelegateOnSuccessUpdateTask OnSuccessUpdateTask; + FDelegateOnSuccessGetCloudScriptRevision OnSuccessGetCloudScriptRevision; + FDelegateOnSuccessGetCloudScriptVersions OnSuccessGetCloudScriptVersions; + FDelegateOnSuccessSetPublishedRevision OnSuccessSetPublishedRevision; + FDelegateOnSuccessUpdateCloudScript OnSuccessUpdateCloudScript; + FDelegateOnSuccessSetPublisherData OnSuccessSetPublisherData; + FDelegateOnSuccessAddNews OnSuccessAddNews; + FDelegateOnSuccessAddVirtualCurrencyTypes OnSuccessAddVirtualCurrencyTypes; + FDelegateOnSuccessDeleteStore OnSuccessDeleteStore; + FDelegateOnSuccessGetCatalogItems OnSuccessGetCatalogItems; + FDelegateOnSuccessGetPublisherData OnSuccessGetPublisherData; + FDelegateOnSuccessGetRandomResultTables OnSuccessGetRandomResultTables; + FDelegateOnSuccessGetStoreItems OnSuccessGetStoreItems; + FDelegateOnSuccessGetTitleData OnSuccessGetTitleData; + FDelegateOnSuccessGetTitleInternalData OnSuccessGetTitleInternalData; + FDelegateOnSuccessListVirtualCurrencyTypes OnSuccessListVirtualCurrencyTypes; + FDelegateOnSuccessRemoveVirtualCurrencyTypes OnSuccessRemoveVirtualCurrencyTypes; + FDelegateOnSuccessSetCatalogItems OnSuccessSetCatalogItems; + FDelegateOnSuccessSetStoreItems OnSuccessSetStoreItems; + FDelegateOnSuccessSetTitleData OnSuccessSetTitleData; + FDelegateOnSuccessSetTitleInternalData OnSuccessSetTitleInternalData; + FDelegateOnSuccessSetupPushNotification OnSuccessSetupPushNotification; + FDelegateOnSuccessUpdateCatalogItems OnSuccessUpdateCatalogItems; + FDelegateOnSuccessUpdateRandomResultTables OnSuccessUpdateRandomResultTables; + FDelegateOnSuccessUpdateStoreItems OnSuccessUpdateStoreItems; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAdminModelDecoder.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAdminModelDecoder.h new file mode 100644 index 000000000..c539b0768 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAdminModelDecoder.h @@ -0,0 +1,453 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Admin +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabAdminModels.h" +#include "PlayFabAdminModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabAdminModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Admin API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + + /** Decode the BanUsersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminBanUsersResult decodeBanUsersResultResponse(UPlayFabJsonObject* response); + + /** Decode the DeleteMasterPlayerAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminDeleteMasterPlayerAccountResult decodeDeleteMasterPlayerAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the DeletePlayerResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminDeletePlayerResult decodeDeletePlayerResultResponse(UPlayFabJsonObject* response); + + /** Decode the DeleteTitleResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminDeleteTitleResult decodeDeleteTitleResultResponse(UPlayFabJsonObject* response); + + /** Decode the ExportMasterPlayerDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminExportMasterPlayerDataResult decodeExportMasterPlayerDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayedTitleListResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminGetPlayedTitleListResult decodeGetPlayedTitleListResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerIdFromAuthTokenResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminGetPlayerIdFromAuthTokenResult decodeGetPlayerIdFromAuthTokenResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerProfileResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminGetPlayerProfileResult decodeGetPlayerProfileResultResponse(UPlayFabJsonObject* response); + + /** Decode the LookupUserAccountInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminLookupUserAccountInfoResult decodeLookupUserAccountInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserBansResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminGetUserBansResult decodeGetUserBansResultResponse(UPlayFabJsonObject* response); + + /** Decode the ResetPasswordResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminResetPasswordResult decodeResetPasswordResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeAllBansForUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminRevokeAllBansForUserResult decodeRevokeAllBansForUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeBansResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminRevokeBansResult decodeRevokeBansResultResponse(UPlayFabJsonObject* response); + + /** Decode the SendAccountRecoveryEmailResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminSendAccountRecoveryEmailResult decodeSendAccountRecoveryEmailResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateBansResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminUpdateBansResult decodeUpdateBansResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateUserTitleDisplayNameResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Account Management Models") + static FAdminUpdateUserTitleDisplayNameResult decodeUpdateUserTitleDisplayNameResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + + /** Decode the CreatePlayerSharedSecretResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminCreatePlayerSharedSecretResult decodeCreatePlayerSharedSecretResultResponse(UPlayFabJsonObject* response); + + /** Decode the DeletePlayerSharedSecretResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminDeletePlayerSharedSecretResult decodeDeletePlayerSharedSecretResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerSharedSecretsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminGetPlayerSharedSecretsResult decodeGetPlayerSharedSecretsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPolicyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminGetPolicyResponse decodeGetPolicyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the SetPlayerSecretResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminSetPlayerSecretResult decodeSetPlayerSecretResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdatePlayerSharedSecretResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminUpdatePlayerSharedSecretResult decodeUpdatePlayerSharedSecretResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdatePolicyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Authentication Models") + static FAdminUpdatePolicyResponse decodeUpdatePolicyResponseResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Characters + ////////////////////////////////////////////////////// + + /** Decode the ResetCharacterStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Characters Models") + static FAdminResetCharacterStatisticsResult decodeResetCharacterStatisticsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Content + ////////////////////////////////////////////////////// + + /** Decode the BlankResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content Models") + static FAdminBlankResult decodeBlankResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetContentListResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content Models") + static FAdminGetContentListResult decodeGetContentListResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetContentUploadUrlResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Content Models") + static FAdminGetContentUploadUrlResult decodeGetContentUploadUrlResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Custom Server Management + ////////////////////////////////////////////////////// + + /** Decode the AddServerBuildResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management Models") + static FAdminAddServerBuildResult decodeAddServerBuildResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetServerBuildInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management Models") + static FAdminGetServerBuildInfoResult decodeGetServerBuildInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetServerBuildUploadURLResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management Models") + static FAdminGetServerBuildUploadURLResult decodeGetServerBuildUploadURLResultResponse(UPlayFabJsonObject* response); + + /** Decode the ListBuildsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management Models") + static FAdminListBuildsResult decodeListBuildsResultResponse(UPlayFabJsonObject* response); + + /** Decode the ModifyServerBuildResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management Models") + static FAdminModifyServerBuildResult decodeModifyServerBuildResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemoveServerBuildResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Custom Server Management Models") + static FAdminRemoveServerBuildResult decodeRemoveServerBuildResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + + /** Decode the GetMatchmakerGameInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking Models") + static FAdminGetMatchmakerGameInfoResult decodeGetMatchmakerGameInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetMatchmakerGameModesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking Models") + static FAdminGetMatchmakerGameModesResult decodeGetMatchmakerGameModesResultResponse(UPlayFabJsonObject* response); + + /** Decode the ModifyMatchmakerGameModesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Matchmaking Models") + static FAdminModifyMatchmakerGameModesResult decodeModifyMatchmakerGameModesResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Player Data Management + ////////////////////////////////////////////////////// + + /** Decode the CreatePlayerStatisticDefinitionResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminCreatePlayerStatisticDefinitionResult decodeCreatePlayerStatisticDefinitionResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetDataReportResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminGetDataReportResult decodeGetDataReportResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerStatisticDefinitionsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminGetPlayerStatisticDefinitionsResult decodeGetPlayerStatisticDefinitionsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerStatisticVersionsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminGetPlayerStatisticVersionsResult decodeGetPlayerStatisticVersionsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminGetUserDataResult decodeGetUserDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the IncrementPlayerStatisticVersionResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminIncrementPlayerStatisticVersionResult decodeIncrementPlayerStatisticVersionResultResponse(UPlayFabJsonObject* response); + + /** Decode the RefundPurchaseResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminRefundPurchaseResponse decodeRefundPurchaseResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ResetUserStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminResetUserStatisticsResult decodeResetUserStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the ResolvePurchaseDisputeResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminResolvePurchaseDisputeResponse decodeResolvePurchaseDisputeResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UpdatePlayerStatisticDefinitionResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminUpdatePlayerStatisticDefinitionResult decodeUpdatePlayerStatisticDefinitionResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateUserDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Data Management Models") + static FAdminUpdateUserDataResult decodeUpdateUserDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Player Item Management + ////////////////////////////////////////////////////// + + /** Decode the ModifyUserVirtualCurrencyResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminModifyUserVirtualCurrencyResult decodeModifyUserVirtualCurrencyResultResponse(UPlayFabJsonObject* response); + + /** Decode the CheckLimitedEditionItemAvailabilityResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminCheckLimitedEditionItemAvailabilityResult decodeCheckLimitedEditionItemAvailabilityResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminGetUserInventoryResult decodeGetUserInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the GrantItemsToUsersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminGrantItemsToUsersResult decodeGrantItemsToUsersResultResponse(UPlayFabJsonObject* response); + + /** Decode the IncrementLimitedEditionItemAvailabilityResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminIncrementLimitedEditionItemAvailabilityResult decodeIncrementLimitedEditionItemAvailabilityResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminRevokeInventoryResult decodeRevokeInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeInventoryItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Player Item Management Models") + static FAdminRevokeInventoryItemsResult decodeRevokeInventoryItemsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // PlayStream + ////////////////////////////////////////////////////// + + /** Decode the AddPlayerTagResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream Models") + static FAdminAddPlayerTagResult decodeAddPlayerTagResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetAllSegmentsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream Models") + static FAdminGetAllSegmentsResult decodeGetAllSegmentsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerSegmentsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream Models") + static FAdminGetPlayerSegmentsResult decodeGetPlayerSegmentsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayersInSegmentResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream Models") + static FAdminGetPlayersInSegmentResult decodeGetPlayersInSegmentResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerTagsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream Models") + static FAdminGetPlayerTagsResult decodeGetPlayerTagsResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemovePlayerTagResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | PlayStream Models") + static FAdminRemovePlayerTagResult decodeRemovePlayerTagResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // ScheduledTask + ////////////////////////////////////////////////////// + + /** Decode the EmptyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminEmptyResponse decodeEmptyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the CreateTaskResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminCreateTaskResult decodeCreateTaskResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetActionsOnPlayersInSegmentTaskInstanceResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminGetActionsOnPlayersInSegmentTaskInstanceResult decodeGetActionsOnPlayersInSegmentTaskInstanceResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCloudScriptTaskInstanceResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminGetCloudScriptTaskInstanceResult decodeGetCloudScriptTaskInstanceResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTaskInstancesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminGetTaskInstancesResult decodeGetTaskInstancesResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTasksResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminGetTasksResult decodeGetTasksResultResponse(UPlayFabJsonObject* response); + + /** Decode the RunTaskResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | ScheduledTask Models") + static FAdminRunTaskResult decodeRunTaskResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + + /** Decode the GetCloudScriptRevisionResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + static FAdminGetCloudScriptRevisionResult decodeGetCloudScriptRevisionResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCloudScriptVersionsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + static FAdminGetCloudScriptVersionsResult decodeGetCloudScriptVersionsResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetPublishedRevisionResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + static FAdminSetPublishedRevisionResult decodeSetPublishedRevisionResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateCloudScriptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + static FAdminUpdateCloudScriptResult decodeUpdateCloudScriptResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Shared Group Data + ////////////////////////////////////////////////////// + + /** Decode the SetPublisherDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Shared Group Data Models") + static FAdminSetPublisherDataResult decodeSetPublisherDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Title-Wide Data Management + ////////////////////////////////////////////////////// + + /** Decode the AddNewsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminAddNewsResult decodeAddNewsResultResponse(UPlayFabJsonObject* response); + + /** Decode the DeleteStoreResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminDeleteStoreResult decodeDeleteStoreResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCatalogItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminGetCatalogItemsResult decodeGetCatalogItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPublisherDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminGetPublisherDataResult decodeGetPublisherDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetRandomResultTablesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminGetRandomResultTablesResult decodeGetRandomResultTablesResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetStoreItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminGetStoreItemsResult decodeGetStoreItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTitleDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminGetTitleDataResult decodeGetTitleDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the ListVirtualCurrencyTypesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminListVirtualCurrencyTypesResult decodeListVirtualCurrencyTypesResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateCatalogItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminUpdateCatalogItemsResult decodeUpdateCatalogItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateStoreItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminUpdateStoreItemsResult decodeUpdateStoreItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetTitleDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminSetTitleDataResult decodeSetTitleDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetupPushNotificationResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminSetupPushNotificationResult decodeSetupPushNotificationResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateRandomResultTablesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Admin | Title-Wide Data Management Models") + static FAdminUpdateRandomResultTablesResult decodeUpdateRandomResultTablesResultResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAdminModels.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAdminModels.h new file mode 100644 index 000000000..8357404bf --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAdminModels.h @@ -0,0 +1,2380 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Admin +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabAdminModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Admin API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminBanUsersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** List of ban requests to be applied. Maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray Bans; +}; + +USTRUCT(BlueprintType) +struct FAdminBanUsersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were applied */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteMasterPlayerAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteMasterPlayerAccountResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * A notification email with this job receipt Id will be sent to the title notification email address when deletion is + * complete. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString JobReceiptId; + /** List of titles from which the player's data will be deleted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString TitleIds; +}; + +USTRUCT(BlueprintType) +struct FAdminDeletePlayerRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminDeletePlayerResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteTitleRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteTitleResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminExportMasterPlayerDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminExportMasterPlayerDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * An email with this job receipt Id containing the export download link will be sent to the title notification email + * address when the export is complete. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString JobReceiptId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayedTitleListRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayedTitleListResult +{ + GENERATED_USTRUCT_BODY() +public: + /** List of titles the player has played */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString TitleIds; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerIdFromAuthTokenRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The auth token of the player requesting the password reset. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString Token; + /** The type of auth token of the player requesting the password reset. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + EAuthTokenType TokenType; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerIdFromAuthTokenResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The player ID from the token passed in */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerProfileRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerProfileResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The profile of the player. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + UPlayFabJsonObject* PlayerProfile = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminLookupUserAccountInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** User email address attached to their account */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString Email; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; + /** Title specific username to match against existing user accounts */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString TitleDisplayName; + /** PlayFab username for the account (3-20 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FAdminLookupUserAccountInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** User info for the user matching the request */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + UPlayFabJsonObject* UserInfo = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetUserBansRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetUserBansResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information about the bans */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FAdminResetPasswordRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The new password for the player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString Password; + /** The token of the player requesting the password reset. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString Token; +}; + +USTRUCT(BlueprintType) +struct FAdminResetPasswordResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeAllBansForUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeAllBansForUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were revoked. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeBansRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Ids of the bans to be revoked. Maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString BanIds; +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeBansResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were revoked */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FAdminSendAccountRecoveryEmailRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** User email address attached to their account */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString Email; + /** The email template id of the account recovery email template to send. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString EmailTemplateId; +}; + +USTRUCT(BlueprintType) +struct FAdminSendAccountRecoveryEmailResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateBansRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** List of bans to be updated. Maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray Bans; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateBansResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were updated */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateUserTitleDisplayNameRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** New title display name for the user - must be between 3 and 25 characters */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString DisplayName; + /** PlayFab unique identifier of the user whose title specific display name is to be changed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateUserTitleDisplayNameResult +{ + GENERATED_USTRUCT_BODY() +public: + /** current title display name for the user (this will be the original display name if the rename attempt failed) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Account Management Models") + FString DisplayName; +}; + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminCreatePlayerSharedSecretRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Friendly name for this key */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString FriendlyName; +}; + +USTRUCT(BlueprintType) +struct FAdminCreatePlayerSharedSecretResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The player shared secret to use when calling Client/GetTitlePublicKey */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString SecretKey; +}; + +USTRUCT(BlueprintType) +struct FAdminDeletePlayerSharedSecretRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The shared secret key to delete */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString SecretKey; +}; + +USTRUCT(BlueprintType) +struct FAdminDeletePlayerSharedSecretResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerSharedSecretsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerSharedSecretsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The player shared secret to use when calling Client/GetTitlePublicKey */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + TArray SharedSecrets; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPolicyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The name of the policy to read. Only supported name is 'ApiPolicy'. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString PolicyName; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPolicyResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The name of the policy read. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString PolicyName; + /** The statements in the requested policy. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + TArray Statements; +}; + +USTRUCT(BlueprintType) +struct FAdminSetPlayerSecretRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString PlayerSecret; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminSetPlayerSecretResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminUpdatePlayerSharedSecretRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Disable or Enable this key */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + bool Disabled = false; + /** Friendly name for this key */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString FriendlyName; + /** The shared secret key to update */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString SecretKey; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdatePlayerSharedSecretResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminUpdatePolicyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Whether to overwrite or append to the existing policy. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + bool OverwritePolicy = false; + /** The name of the policy being updated. Only supported name is 'ApiPolicy' */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString PolicyName; + /** The new statements to include in the policy. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + TArray Statements; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdatePolicyResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The name of the policy that was updated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + FString PolicyName; + /** The statements included in the new version of the policy. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Authentication Models") + TArray Statements; +}; + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminResetCharacterStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Characters Models") + FString CharacterId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminResetCharacterStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminBlankResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteContentRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Key of the content item to be deleted */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + FString Key; +}; + +USTRUCT(BlueprintType) +struct FAdminGetContentListRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Limits the response to keys that begin with the specified prefix. You can use prefixes to list contents under a folder, + * or for a specified version, etc. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + FString Prefix; +}; + +USTRUCT(BlueprintType) +struct FAdminGetContentListResult +{ + GENERATED_USTRUCT_BODY() +public: + /** List of content items. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + TArray Contents; + /** Number of content items returned. We currently have a maximum of 1000 items limit. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + int32 ItemCount = 0; + /** The total size of listed contents in bytes. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + int32 TotalSize = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminGetContentUploadUrlRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * A standard MIME type describing the format of the contents. The same MIME type has to be set in the header when + * uploading the content. If not specified, the MIME type is 'binary/octet-stream' by default. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + FString ContentType; + /** Key of the content item to upload, usually formatted as a path, e.g. images/a.png */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + FString Key; +}; + +USTRUCT(BlueprintType) +struct FAdminGetContentUploadUrlResult +{ + GENERATED_USTRUCT_BODY() +public: + /** URL for uploading content via HTTP PUT method. The URL will expire in approximately one hour. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Content Models") + FString URL; +}; + + +/////////////////////////////////////////////////////// +// Custom Server Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminAddServerBuildRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** server host regions in which this build should be running and available */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ActiveRegions; + /** unique identifier for the build executable */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; + /** appended to the end of the command line when starting game servers */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString CommandLineTemplate; + /** developer comment(s) for this build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Comment; + /** path to the game server executable. Defaults to gameserver.exe */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ExecutablePath; + /** maximum number of game server instances that can run on a single host machine */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MaxGamesPerHost = 0; + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MinFreeGameSlots = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminAddServerBuildResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of regions where this build can used, when it is active */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ActiveRegions; + /** unique identifier for this build executable */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; + /** appended to the end of the command line when starting game servers */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString CommandLineTemplate; + /** developer comment(s) for this build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Comment; + /** path to the game server executable. Defaults to gameserver.exe */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ExecutablePath; + /** maximum number of game server instances that can run on a single host machine */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MaxGamesPerHost = 0; + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MinFreeGameSlots = 0; + /** the current status of the build validation and processing steps */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + EGameBuildStatus Status; + /** time this build was last modified (or uploaded, if this build has never been modified) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Timestamp; + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString TitleId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetServerBuildInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique identifier of the previously uploaded build executable for which information is being requested */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; +}; + +/** Information about a particular server build */ +USTRUCT(BlueprintType) +struct FAdminGetServerBuildInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of regions where this build can used, when it is active */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ActiveRegions; + /** unique identifier for this build executable */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; + /** developer comment(s) for this build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Comment; + /** error message, if any, about this build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ErrorMessage; + /** maximum number of game server instances that can run on a single host machine */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MaxGamesPerHost = 0; + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MinFreeGameSlots = 0; + /** the current status of the build validation and processing steps */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + EGameBuildStatus Status; + /** time this build was last modified (or uploaded, if this build has never been modified) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Timestamp; + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString TitleId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetServerBuildUploadURLRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique identifier of the game server build to upload */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetServerBuildUploadURLResult +{ + GENERATED_USTRUCT_BODY() +public: + /** pre-authorized URL for uploading the game server build package */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString URL; +}; + +USTRUCT(BlueprintType) +struct FAdminListBuildsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminListBuildsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of uploaded game server builds */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + TArray Builds; +}; + +USTRUCT(BlueprintType) +struct FAdminModifyServerBuildRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** array of regions where this build can used, when it is active */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ActiveRegions; + /** unique identifier of the previously uploaded build executable to be updated */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; + /** appended to the end of the command line when starting game servers */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString CommandLineTemplate; + /** developer comment(s) for this build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Comment; + /** path to the game server executable. Defaults to gameserver.exe */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ExecutablePath; + /** maximum number of game server instances that can run on a single host machine */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MaxGamesPerHost = 0; + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MinFreeGameSlots = 0; + /** new timestamp */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Timestamp; +}; + +USTRUCT(BlueprintType) +struct FAdminModifyServerBuildResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of regions where this build can used, when it is active */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ActiveRegions; + /** unique identifier for this build executable */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; + /** appended to the end of the command line when starting game servers */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString CommandLineTemplate; + /** developer comment(s) for this build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Comment; + /** path to the game server executable. Defaults to gameserver.exe */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString ExecutablePath; + /** maximum number of game server instances that can run on a single host machine */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MaxGamesPerHost = 0; + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + int32 MinFreeGameSlots = 0; + /** the current status of the build validation and processing steps */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + EGameBuildStatus Status; + /** time this build was last modified (or uploaded, if this build has never been modified) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString Timestamp; + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString TitleId; +}; + +USTRUCT(BlueprintType) +struct FAdminRemoveServerBuildRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique identifier of the previously uploaded build executable to be removed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Custom Server Management Models") + FString BuildId; +}; + +USTRUCT(BlueprintType) +struct FAdminRemoveServerBuildResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminGetMatchmakerGameInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique identifier of the lobby for which info is being requested */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString LobbyId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetMatchmakerGameInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** version identifier of the game server executable binary being run */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString BuildVersion; + /** time when Game Server Instance is currently scheduled to end */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString EndTime; + /** unique identifier of the lobby */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString LobbyId; + /** game mode for this Game Server Instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString Mode; + /** array of unique PlayFab identifiers for users currently connected to this Game Server Instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString Players; + /** region in which the Game Server Instance is running */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + ERegion Region; + /** IPV4 address of the game server instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString ServerAddress; + /** IPV4 address of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString ServerIPV4Address; + /** IPV6 address of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString ServerIPV6Address; + /** communication port for this Game Server Instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + int32 ServerPort = 0; + /** Public DNS name (if any) of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString ServerPublicDNSName; + /** time when the Game Server Instance was created */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString StartTime; + /** unique identifier of the Game Server Instance for this lobby */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString TitleId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetMatchmakerGameModesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** previously uploaded build version for which game modes are being requested */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString BuildVersion; +}; + +USTRUCT(BlueprintType) +struct FAdminGetMatchmakerGameModesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of game modes available for the specified build */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + TArray GameModes; +}; + +USTRUCT(BlueprintType) +struct FAdminModifyMatchmakerGameModesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** previously uploaded build version for which game modes are being specified */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + FString BuildVersion; + /** array of game modes (Note: this will replace all game modes for the indicated build version) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Matchmaking Models") + TArray GameModes; +}; + +USTRUCT(BlueprintType) +struct FAdminModifyMatchmakerGameModesResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminCreatePlayerStatisticDefinitionRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** the aggregation method to use in updating the statistic (defaults to last) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + EStatisticAggregationMethod AggregationMethod; + /** unique name of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString StatisticName; + /** interval at which the values of the statistic for all players are reset (resets begin at the next interval boundary) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + EStatisticResetIntervalOption VersionChangeInterval; +}; + +USTRUCT(BlueprintType) +struct FAdminCreatePlayerStatisticDefinitionResult +{ + GENERATED_USTRUCT_BODY() +public: + /** created statistic definition */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + UPlayFabJsonObject* Statistic = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetDataReportRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Reporting year (UTC) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + int32 Day = 0; + /** Reporting month (UTC) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + int32 Month = 0; + /** Report name */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString ReportName; + /** Reporting year (UTC) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + int32 Year = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminGetDataReportResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The URL where the requested report can be downloaded. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString DownloadUrl; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerStatisticDefinitionsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerStatisticDefinitionsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** the player statistic definitions for the title */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + TArray Statistics; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerStatisticVersionsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique name of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerStatisticVersionsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** version change history of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + TArray StatisticVersions; +}; + +USTRUCT(BlueprintType) +struct FAdminGetUserDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + int32 IfChangedFromDataVersion = 0; + /** Specific keys to search for in the custom user data. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString Keys; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetUserDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** User specific data for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + UPlayFabJsonObject* Data = nullptr; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + int32 DataVersion = 0; + /** PlayFab unique identifier of the user whose custom data is being returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminIncrementPlayerStatisticVersionRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique name of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FAdminIncrementPlayerStatisticVersionResult +{ + GENERATED_USTRUCT_BODY() +public: + /** version change history of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + UPlayFabJsonObject* StatisticVersion = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminRefundPurchaseRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique order ID for the purchase in question. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString OrderId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; + /** + * The Reason parameter should correspond with the payment providers reason field, if they require one such as Facebook. In + * the case of Facebook this must match one of their refund or dispute resolution enums (See: + * https://developers.facebook.com/docs/payments/implementation-guide/handling-disputes-refunds) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString Reason; +}; + +USTRUCT(BlueprintType) +struct FAdminRefundPurchaseResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The order's updated purchase status. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PurchaseStatus; +}; + +USTRUCT(BlueprintType) +struct FAdminResetUserStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminResetUserStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminResolvePurchaseDisputeRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique order ID for the purchase in question. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString OrderId; + /** + * Enum for the desired purchase result state after notifying the payment provider. Valid values are Revoke, Reinstate and + * Manual. Manual will cause no change to the order state. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + EResolutionOutcome Outcome; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; + /** + * The Reason parameter should correspond with the payment providers reason field, if they require one such as Facebook. In + * the case of Facebook this must match one of their refund or dispute resolution enums (See: + * https://developers.facebook.com/docs/payments/implementation-guide/handling-disputes-refunds) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString Reason; +}; + +USTRUCT(BlueprintType) +struct FAdminResolvePurchaseDisputeResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The order's updated purchase status. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PurchaseStatus; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdatePlayerStatisticDefinitionRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** the aggregation method to use in updating the statistic (defaults to last) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + EStatisticAggregationMethod AggregationMethod; + /** unique name of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString StatisticName; + /** + * interval at which the values of the statistic for all players are reset (changes are effective at the next occurance of + * the new interval boundary) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + EStatisticResetIntervalOption VersionChangeInterval; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdatePlayerStatisticDefinitionResult +{ + GENERATED_USTRUCT_BODY() +public: + /** updated statistic definition */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + UPlayFabJsonObject* Statistic = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateUserDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString KeysToRemove; + /** Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + EUserDataPermission Permission; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateUserDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + int32 DataVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateUserInternalDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString KeysToRemove; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Data Management Models") + FString PlayFabId; +}; + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminAddUserVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Amount to be added to the user balance of the specified virtual currency. Maximum VC balance is Int32 (2,147,483,647). + * Any increase over this value will be discarded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + int32 Amount = 0; + /** PlayFab unique identifier of the user whose virtual currency balance is to be increased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which is to be incremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FAdminModifyUserVirtualCurrencyResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Balance of the virtual currency after modification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + int32 Balance = 0; + /** + * Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase + * over this value will be discarded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + int32 BalanceChange = 0; + /** User currency was subtracted from. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which was modified. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FAdminCheckLimitedEditionItemAvailabilityRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Which catalog is being updated. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString CatalogVersion; + /** The item to check for. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString ItemId; +}; + +USTRUCT(BlueprintType) +struct FAdminCheckLimitedEditionItemAvailabilityResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The amount of the specified resource remaining. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + int32 Amount = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminGetUserInventoryRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetUserInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of inventory items belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + TArray Inventory; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString PlayFabId; + /** Array of virtual currency balance(s) belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; + /** Array of remaining times and timestamps for virtual currencies. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrencyRechargeTimes = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGrantItemsToUsersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version from which items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString CatalogVersion; + /** Array of items to grant and the users to whom the items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + TArray ItemGrants; +}; + +USTRUCT(BlueprintType) +struct FAdminGrantItemsToUsersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items granted to users. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + TArray ItemGrantResults; +}; + +USTRUCT(BlueprintType) +struct FAdminIncrementLimitedEditionItemAvailabilityRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Amount to increase availability by. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + int32 Amount = 0; + /** Which catalog is being updated. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString CatalogVersion; + /** The item which needs more availability. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString ItemId; +}; + +USTRUCT(BlueprintType) +struct FAdminIncrementLimitedEditionItemAvailabilityResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeInventoryItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString CharacterId; + /** Unique PlayFab assigned instance identifier of the item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString ItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeInventoryItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of player items to revoke, between 1 and 25 items. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + TArray Items; +}; + +USTRUCT(BlueprintType) +struct FAdminRevokeInventoryItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Collection of any errors that occurred during processing. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + TArray Errors; +}; + +USTRUCT(BlueprintType) +struct FAdminSubtractUserVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Amount to be subtracted from the user balance of the specified virtual currency. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + int32 Amount = 0; + /** PlayFab unique identifier of the user whose virtual currency balance is to be decreased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which is to be decremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Player Item Management Models") + FString VirtualCurrency; +}; + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminAddPlayerTagRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString PlayFabId; + /** Unique tag for player profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString TagName; +}; + +USTRUCT(BlueprintType) +struct FAdminAddPlayerTagResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetAllSegmentsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetAllSegmentsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of segments for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + TArray Segments; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerSegmentsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of segments the requested player currently belongs to. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + TArray Segments; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayersSegmentsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayersInSegmentRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Continuation token if retrieving subsequent pages of results. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString ContinuationToken; + /** Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + int32 MaxBatchSize = 0; + /** + * Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging + * results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + int32 SecondsToLive = 0; + /** Unique identifier for this segment. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString SegmentId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayersInSegmentResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString ContinuationToken; + /** Array of player profiles in this segment. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + TArray PlayerProfiles; + /** Count of profiles matching this segment. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + int32 ProfilesInSegment = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerTagsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional namespace to filter results by */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString Namespace; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPlayerTagsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString PlayFabId; + /** Canonical tags (including namespace and tag's name) for the requested user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString Tags; +}; + +USTRUCT(BlueprintType) +struct FAdminRemovePlayerTagRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString PlayFabId; + /** Unique tag for player profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | PlayStream Models") + FString TagName; +}; + +USTRUCT(BlueprintType) +struct FAdminRemovePlayerTagResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// ScheduledTask +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminAbortTaskInstanceRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** ID of a task instance that is being aborted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString TaskInstanceId; +}; + +USTRUCT(BlueprintType) +struct FAdminEmptyResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminCreateActionsOnPlayerSegmentTaskRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Description the task */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Description; + /** Whether the schedule is active. Inactive schedule will not trigger task execution. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + bool IsActive = false; + /** Name of the task. This is a unique identifier for tasks in the title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Name; + /** Task details related to segment and action */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Parameter = nullptr; + /** Cron expression for the run schedule of the task. The expression should be in UTC. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Schedule; +}; + +USTRUCT(BlueprintType) +struct FAdminCreateTaskResult +{ + GENERATED_USTRUCT_BODY() +public: + /** ID of the task */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString TaskId; +}; + +USTRUCT(BlueprintType) +struct FAdminCreateCloudScriptTaskRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Description the task */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Description; + /** Whether the schedule is active. Inactive schedule will not trigger task execution. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + bool IsActive = false; + /** Name of the task. This is a unique identifier for tasks in the title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Name; + /** Task details related to CloudScript */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Parameter = nullptr; + /** Cron expression for the run schedule of the task. The expression should be in UTC. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Schedule; +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteTaskRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Specify either the task ID or the name of task to be deleted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Identifier = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetActionsOnPlayersInSegmentTaskInstanceResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Parameter of this task instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Parameter = nullptr; + /** Status summary of the actions-on-players-in-segment task instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Summary = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTaskInstanceRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** ID of the requested task instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString TaskInstanceId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetCloudScriptTaskInstanceResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Parameter of this task instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Parameter = nullptr; + /** Status summary of the CloudScript task instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Summary = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTaskInstancesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional range-from filter for task instances' StartedAt timestamp. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString StartedAtRangeFrom; + /** Optional range-to filter for task instances' StartedAt timestamp. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString StartedAtRangeTo; + /** Optional filter for task instances that are of a specific status. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + ETaskInstanceStatus StatusFilter; + /** + * Name or ID of the task whose instances are being queried. If not specified, return all task instances that satisfy + * conditions set by other filters. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* TaskIdentifier = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTaskInstancesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Basic status summaries of the queried task instances. Empty If no task instances meets the filter criteria. To get + * detailed status summary, use Get*TaskInstance API according to task type (e.g. + * GetActionsOnPlayersInSegmentTaskInstance). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + TArray Summaries; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTasksRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Provide either the task ID or the task name to get a specific task. If not specified, return all defined tasks. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Identifier = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTasksResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Result tasks. Empty if there is no task found. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + TArray Tasks; +}; + +USTRUCT(BlueprintType) +struct FAdminRunTaskRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Provide either the task ID or the task name to run a task. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Identifier = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminRunTaskResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * ID of the task instance that is started. This can be used in Get*TaskInstance (e.g. GetCloudScriptTaskInstance) API call + * to retrieve status for the task instance. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString TaskInstanceId; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateTaskRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Description the task */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Description; + /** Specify either the task ID or the name of the task to be updated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Identifier = nullptr; + /** Whether the schedule is active. Inactive schedule will not trigger task execution. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + bool IsActive = false; + /** Name of the task. This is a unique identifier for tasks in the title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Name; + /** Parameter object specific to the task type. See each task type's create API documentation for details. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + UPlayFabJsonObject* Parameter = nullptr; + /** Cron expression for the run schedule of the task. The expression should be in UTC. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + FString Schedule; + /** Task type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | ScheduledTask Models") + EScheduledTaskType Type; +}; + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminGetCloudScriptRevisionRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Revision number. If left null, defaults to the latest revision */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Revision = 0; + /** Version number. If left null, defaults to the latest version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminGetCloudScriptRevisionResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Time this revision was created */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + FString CreatedAt; + /** List of Cloud Script files in this revision. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + TArray Files; + /** True if this is the currently published revision */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + bool IsPublished = false; + /** Revision number. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Revision = 0; + /** Version number. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminGetCloudScriptVersionsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetCloudScriptVersionsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** List of versions */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + TArray Versions; +}; + +USTRUCT(BlueprintType) +struct FAdminSetPublishedRevisionRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Revision to make the current published revision */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Revision = 0; + /** Version number */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FAdminSetPublishedRevisionResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateCloudScriptRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab user ID of the developer initiating the request. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + FString DeveloperPlayFabId; + /** List of Cloud Script files to upload to create the new revision. Must have at least one file. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + TArray Files; + /** Immediately publish the new revision */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + bool Publish = false; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateCloudScriptResult +{ + GENERATED_USTRUCT_BODY() +public: + /** New revision number created */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Revision = 0; + /** Cloud Script version updated */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Server-Side Cloud Script Models") + int32 Version = 0; +}; + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminSetPublisherDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Shared Group Data Models") + FString Key; + /** new value to set. Set to null to remove a value */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Shared Group Data Models") + FString Value; +}; + +USTRUCT(BlueprintType) +struct FAdminSetPublisherDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAdminAddNewsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Body text of the news */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Body; + /** Time this news was published. If not set, defaults to now. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Timestamp; + /** Title (headline) of the news item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Title; +}; + +USTRUCT(BlueprintType) +struct FAdminAddNewsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique id of the new news item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString NewsId; +}; + +USTRUCT(BlueprintType) +struct FAdminAddVirtualCurrencyTypesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * List of virtual currencies and their initial deposits (the amount a user is granted when signing in for the first time) + * to the title + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray VirtualCurrencies; +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteStoreRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** catalog version of the store to delete. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; + /** unqiue identifier for the store which is to be deleted */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FAdminDeleteStoreResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminGetCatalogItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Which catalog is being requested. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; +}; + +USTRUCT(BlueprintType) +struct FAdminGetCatalogItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items which can be purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray Catalog; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPublisherDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** array of keys to get back data from the Publisher data blob, set by the admin tools */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Keys; +}; + +USTRUCT(BlueprintType) +struct FAdminGetPublisherDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** a dictionary object of key / value pairs */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + UPlayFabJsonObject* Data; +}; + +USTRUCT(BlueprintType) +struct FAdminGetRandomResultTablesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** catalog version to fetch tables from. Use default catalog version if null */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; +}; + +USTRUCT(BlueprintType) +struct FAdminGetRandomResultTablesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of random result tables currently available */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + UPlayFabJsonObject* Tables = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAdminGetStoreItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** catalog version to store items from. Use default catalog version if null */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; + /** Unqiue identifier for the store which is being requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetStoreItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The base catalog that this store is a part of. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; + /** Additional data about the store. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + UPlayFabJsonObject* MarketingData = nullptr; + /** How the store was last updated (Admin or a third party). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + EPfSourceType Source; + /** Array of items which can be purchased from this store. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray Store; + /** The ID of this store. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTitleDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Specific keys to search for in the title data (leave null to get all keys) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Keys; +}; + +USTRUCT(BlueprintType) +struct FAdminGetTitleDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** a dictionary object of key / value pairs */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + UPlayFabJsonObject* Data; +}; + +USTRUCT(BlueprintType) +struct FAdminListVirtualCurrencyTypesRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminListVirtualCurrencyTypesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** List of virtual currency names defined for this title */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray VirtualCurrencies; +}; + +USTRUCT(BlueprintType) +struct FAdminRemoveVirtualCurrencyTypesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** List of virtual currencies to delete */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray VirtualCurrencies; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateCatalogItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Array of catalog items to be submitted. Note that while CatalogItem has a parameter for CatalogVersion, it is not + * required and ignored in this call. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray Catalog; + /** Which catalog is being updated. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; + /** + * Should this catalog be set as the default catalog. Defaults to true. If there is currently no default catalog, this will + * always set it. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + bool SetAsDefaultCatalog = false; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateCatalogItemsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateStoreItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version of the store to update. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; + /** Additional data about the store */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + UPlayFabJsonObject* MarketingData = nullptr; + /** Array of store items - references to catalog items, with specific pricing - to be added */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray Store; + /** Unique identifier for the store which is to be updated */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateStoreItemsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminSetTitleDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Key; + /** new value to set. Set to null to remove a value */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Value; +}; + +USTRUCT(BlueprintType) +struct FAdminSetTitleDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FAdminSetupPushNotificationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Credential is the Private Key for APNS/APNS_SANDBOX, and the API Key for GCM */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Credential; + /** for APNS, this is the PlatformPrincipal (SSL Certificate) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Key; + /** + * name of the application sending the message (application names must be made up of only uppercase and lowercase ASCII + * letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString Name; + /** + * replace any existing ARN with the newly generated one. If this is set to false, an error will be returned if + * notifications have already setup for this platform. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + bool OverwriteOldARN = false; + /** + * supported notification platforms are Apple Push Notification Service (APNS and APNS_SANDBOX) for iOS and Google Cloud + * Messaging (GCM) for Android + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + EPushSetupPlatform Platform; +}; + +USTRUCT(BlueprintType) +struct FAdminSetupPushNotificationResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Amazon Resource Name for the created notification topic. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString ARN; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateRandomResultTablesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** which catalog is being updated. If null, update the current default catalog version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + FString CatalogVersion; + /** + * array of random result tables to make available (Note: specifying an existing TableId will result in overwriting that + * table, while any others will be added to the available set) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Admin | Title-Wide Data Management Models") + TArray Tables; +}; + +USTRUCT(BlueprintType) +struct FAdminUpdateRandomResultTablesResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationAPI.h new file mode 100644 index 000000000..5a306865b --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationAPI.h @@ -0,0 +1,107 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Authentication +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabAuthenticationModels.h" +#include "PlayFabAuthenticationAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabAuthenticationRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabAuthenticationAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabAuthenticationRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Authentication API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetEntityToken, FAuthenticationGetEntityTokenResponse, result, UObject*, customData); + + /** + * Method to exchange a legacy AuthenticationTicket or title SecretKey for an Entity Token or to refresh a still valid + * Entity Token. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Authentication | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabAuthenticationAPI* GetEntityToken(FAuthenticationGetEntityTokenRequest request, + FDelegateOnSuccessGetEntityToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabAuthenticationRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Authentication | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetEntityToken(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessGetEntityToken OnSuccessGetEntityToken; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationModelDecoder.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationModelDecoder.h new file mode 100644 index 000000000..af6f07bf1 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationModelDecoder.h @@ -0,0 +1,45 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Authentication +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabAuthenticationModels.h" +#include "PlayFabAuthenticationModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabAuthenticationModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Authentication API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + + /** Decode the GetEntityTokenResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Authentication | Authentication Models") + static FAuthenticationGetEntityTokenResponse decodeGetEntityTokenResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationModels.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationModels.h new file mode 100644 index 000000000..d6128d629 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabAuthenticationModels.h @@ -0,0 +1,56 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Authentication +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabAuthenticationModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Authentication API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FAuthenticationGetEntityTokenRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Authentication | Authentication Models") + UPlayFabJsonObject* Entity = nullptr; +}; + +USTRUCT(BlueprintType) +struct FAuthenticationGetEntityTokenResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Authentication | Authentication Models") + UPlayFabJsonObject* Entity = nullptr; + /** The token used to set X-EntityToken for all entity based API calls. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Authentication | Authentication Models") + FString EntityToken; + /** The time the token will expire, if it is an expiring token, in UTC. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Authentication | Authentication Models") + FString TokenExpiration; +}; + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabBaseModel.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabBaseModel.h new file mode 100644 index 000000000..121d28551 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabBaseModel.h @@ -0,0 +1,60 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// PlayFab Base Model Header. This file holds the base ustruct for the playfab models. +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "PlayFabBaseModel.generated.h" + +class UPlayFabJsonObject; + +USTRUCT(BlueprintType) +struct FPlayFabError +{ + GENERATED_USTRUCT_BODY() + + /** Is there an error */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + bool hasError; + + /** Holds the error code recieved from playfab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + int32 ErrorCode; + + /** Holds the error name recieved from playfab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + FString ErrorName; + + /** Holds the error message recieved from playfab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + FString ErrorMessage; + + /** Holds the error details recieved from playfab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + FString ErrorDetails; + + // Decode the error if there is one + void decodeError(UPlayFabJsonObject* responseData); + +}; + +USTRUCT(BlueprintType) +struct FPlayFabBaseModel +{ + GENERATED_USTRUCT_BODY() + + /** Holds the error USTRUCT recieved from playfab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + FPlayFabError responseError; + + /** Holds the full JSON recieved from playfab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Error | Models") + UPlayFabJsonObject* responseData; + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabClientAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabClientAPI.h new file mode 100644 index 000000000..991c8dc5f --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabClientAPI.h @@ -0,0 +1,2409 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Client +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabClientModels.h" +#include "PlayFabClientAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabClientRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabClientAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabClientRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Client API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddGenericID, FClientAddGenericIDResult, result, UObject*, customData); + + /** + * Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab + * ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as + * authentication credentials, as the intent is that it is easily accessible by other players. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AddGenericID(FClientAddGenericIDRequest request, + FDelegateOnSuccessAddGenericID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddGenericID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddOrUpdateContactEmail, FClientAddOrUpdateContactEmailResult, result, UObject*, customData); + + /** Adds or updates a contact email to the player's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AddOrUpdateContactEmail(FClientAddOrUpdateContactEmailRequest request, + FDelegateOnSuccessAddOrUpdateContactEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddOrUpdateContactEmail(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddUsernamePassword, FClientAddUsernamePasswordResult, result, UObject*, customData); + + /** + * Adds playfab username/password auth to an existing account created via an anonymous auth method, e.g. automatic device + * ID login. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AddUsernamePassword(FClientAddUsernamePasswordRequest request, + FDelegateOnSuccessAddUsernamePassword onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddUsernamePassword(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetAccountInfo, FClientGetAccountInfoResult, result, UObject*, customData); + + /** Retrieves the user's PlayFab account details */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetAccountInfo(FClientGetAccountInfoRequest request, + FDelegateOnSuccessGetAccountInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetAccountInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerCombinedInfo, FClientGetPlayerCombinedInfoResult, result, UObject*, customData); + + /** Retrieves all of the user's different kinds of info. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerCombinedInfo(FClientGetPlayerCombinedInfoRequest request, + FDelegateOnSuccessGetPlayerCombinedInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerCombinedInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerProfile, FClientGetPlayerProfileResult, result, UObject*, customData); + + /** Retrieves the player's profile */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerProfile(FClientGetPlayerProfileRequest request, + FDelegateOnSuccessGetPlayerProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerProfile(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs, FClientGetPlayFabIDsFromFacebookIDsResult, result, UObject*, customData); + + /** Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromFacebookIDs(FClientGetPlayFabIDsFromFacebookIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromFacebookIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds, FClientGetPlayFabIDsFromFacebookInstantGamesIdsResult, result, UObject*, customData); + + /** Retrieves the unique PlayFab identifiers for the given set of Facebook Instant Game identifiers. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromFacebookInstantGamesIds(FClientGetPlayFabIDsFromFacebookInstantGamesIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromFacebookInstantGamesIds(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromGameCenterIDs, FClientGetPlayFabIDsFromGameCenterIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of Game Center identifiers (referenced in the Game Center + * Programming Guide as the Player Identifier). + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromGameCenterIDs(FClientGetPlayFabIDsFromGameCenterIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromGameCenterIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromGameCenterIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromGenericIDs, FClientGetPlayFabIDsFromGenericIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the + * service name plus the service-specific ID for the player, as specified by the title when the generic identifier was + * added to the player account. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromGenericIDs(FClientGetPlayFabIDsFromGenericIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromGenericIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromGenericIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromGoogleIDs, FClientGetPlayFabIDsFromGoogleIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of Google identifiers. The Google identifiers are the IDs for + * the user accounts, available as "id" in the Google+ People API calls. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromGoogleIDs(FClientGetPlayFabIDsFromGoogleIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromGoogleIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromGoogleIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromKongregateIDs, FClientGetPlayFabIDsFromKongregateIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of Kongregate identifiers. The Kongregate identifiers are the + * IDs for the user accounts, available as "user_id" from the Kongregate API methods(ex: + * http://developers.kongregate.com/docs/client/getUserId). + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromKongregateIDs(FClientGetPlayFabIDsFromKongregateIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromKongregateIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromKongregateIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds, FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsResult, result, UObject*, customData); + + /** Retrieves the unique PlayFab identifiers for the given set of Nintendo Switch identifiers. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromNintendoSwitchDeviceIds(FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromNintendoSwitchDeviceIds(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromSteamIDs, FClientGetPlayFabIDsFromSteamIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile + * IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromSteamIDs(FClientGetPlayFabIDsFromSteamIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromSteamIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromSteamIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromTwitchIDs, FClientGetPlayFabIDsFromTwitchIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of Twitch identifiers. The Twitch identifiers are the IDs for + * the user accounts, available as "_id" from the Twitch API methods (ex: + * https://github.com/justintv/Twitch-API/blob/master/v3_resources/users.md#get-usersuser). + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayFabIDsFromTwitchIDs(FClientGetPlayFabIDsFromTwitchIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromTwitchIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromTwitchIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkAndroidDeviceID, FClientLinkAndroidDeviceIDResult, result, UObject*, customData); + + /** Links the Android device identifier to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkAndroidDeviceID(FClientLinkAndroidDeviceIDRequest request, + FDelegateOnSuccessLinkAndroidDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkAndroidDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkCustomID, FClientLinkCustomIDResult, result, UObject*, customData); + + /** Links the custom identifier, generated by the title, to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkCustomID(FClientLinkCustomIDRequest request, + FDelegateOnSuccessLinkCustomID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkCustomID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkFacebookAccount, FClientLinkFacebookAccountResult, result, UObject*, customData); + + /** Links the Facebook account associated with the provided Facebook access token to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkFacebookAccount(FClientLinkFacebookAccountRequest request, + FDelegateOnSuccessLinkFacebookAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkFacebookAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkFacebookInstantGamesId, FClientLinkFacebookInstantGamesIdResult, result, UObject*, customData); + + /** Links the Facebook Instant Games Id to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkFacebookInstantGamesId(FClientLinkFacebookInstantGamesIdRequest request, + FDelegateOnSuccessLinkFacebookInstantGamesId onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkFacebookInstantGamesId(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkGameCenterAccount, FClientLinkGameCenterAccountResult, result, UObject*, customData); + + /** Links the Game Center account associated with the provided Game Center ID to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkGameCenterAccount(FClientLinkGameCenterAccountRequest request, + FDelegateOnSuccessLinkGameCenterAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkGameCenterAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkGoogleAccount, FClientLinkGoogleAccountResult, result, UObject*, customData); + + /** Links the currently signed-in user account to their Google account, using their Google account credentials */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkGoogleAccount(FClientLinkGoogleAccountRequest request, + FDelegateOnSuccessLinkGoogleAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkGoogleAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkIOSDeviceID, FClientLinkIOSDeviceIDResult, result, UObject*, customData); + + /** Links the vendor-specific iOS device identifier to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkIOSDeviceID(FClientLinkIOSDeviceIDRequest request, + FDelegateOnSuccessLinkIOSDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkIOSDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkKongregate, FClientLinkKongregateAccountResult, result, UObject*, customData); + + /** Links the Kongregate identifier to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkKongregate(FClientLinkKongregateAccountRequest request, + FDelegateOnSuccessLinkKongregate onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkKongregate(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkNintendoSwitchDeviceId, FClientLinkNintendoSwitchDeviceIdResult, result, UObject*, customData); + + /** Links the NintendoSwitchDeviceId to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkNintendoSwitchDeviceId(FClientLinkNintendoSwitchDeviceIdRequest request, + FDelegateOnSuccessLinkNintendoSwitchDeviceId onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkNintendoSwitchDeviceId(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkSteamAccount, FClientLinkSteamAccountResult, result, UObject*, customData); + + /** Links the Steam account associated with the provided Steam authentication ticket to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkSteamAccount(FClientLinkSteamAccountRequest request, + FDelegateOnSuccessLinkSteamAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkSteamAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkTwitch, FClientLinkTwitchAccountResult, result, UObject*, customData); + + /** Links the Twitch account associated with the token to the user's PlayFab account. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkTwitch(FClientLinkTwitchAccountRequest request, + FDelegateOnSuccessLinkTwitch onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkTwitch(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkWindowsHello, FClientLinkWindowsHelloAccountResponse, result, UObject*, customData); + + /** Link Windows Hello authentication to the current PlayFab Account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkWindowsHello(FClientLinkWindowsHelloAccountRequest request, + FDelegateOnSuccessLinkWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLinkXboxAccount, FClientLinkXboxAccountResult, result, UObject*, customData); + + /** Links the Xbox Live account associated with the provided access code to the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LinkXboxAccount(FClientLinkXboxAccountRequest request, + FDelegateOnSuccessLinkXboxAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLinkXboxAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveContactEmail, FClientRemoveContactEmailResult, result, UObject*, customData); + + /** Removes a contact email from the player's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RemoveContactEmail(FClientRemoveContactEmailRequest request, + FDelegateOnSuccessRemoveContactEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveContactEmail(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveGenericID, FClientRemoveGenericIDResult, result, UObject*, customData); + + /** Removes the specified generic service identifier from the player's PlayFab account. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RemoveGenericID(FClientRemoveGenericIDRequest request, + FDelegateOnSuccessRemoveGenericID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveGenericID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessReportPlayer, FClientReportPlayerClientResult, result, UObject*, customData); + + /** + * Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title + * can take action concerning potentially toxic players. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ReportPlayer(FClientReportPlayerClientRequest request, + FDelegateOnSuccessReportPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperReportPlayer(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSendAccountRecoveryEmail, FClientSendAccountRecoveryEmailResult, result, UObject*, customData); + + /** + * Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to + * change the password.If an account recovery email template ID is provided, an email using the custom email template will + * be used. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* SendAccountRecoveryEmail(FClientSendAccountRecoveryEmailRequest request, + FDelegateOnSuccessSendAccountRecoveryEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSendAccountRecoveryEmail(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkAndroidDeviceID, FClientUnlinkAndroidDeviceIDResult, result, UObject*, customData); + + /** Unlinks the related Android device identifier from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkAndroidDeviceID(FClientUnlinkAndroidDeviceIDRequest request, + FDelegateOnSuccessUnlinkAndroidDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkAndroidDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkCustomID, FClientUnlinkCustomIDResult, result, UObject*, customData); + + /** Unlinks the related custom identifier from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkCustomID(FClientUnlinkCustomIDRequest request, + FDelegateOnSuccessUnlinkCustomID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkCustomID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkFacebookAccount, FClientUnlinkFacebookAccountResult, result, UObject*, customData); + + /** Unlinks the related Facebook account from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkFacebookAccount(FClientUnlinkFacebookAccountRequest request, + FDelegateOnSuccessUnlinkFacebookAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkFacebookAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkFacebookInstantGamesId, FClientUnlinkFacebookInstantGamesIdResult, result, UObject*, customData); + + /** Unlinks the related Facebook Instant Game Ids from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkFacebookInstantGamesId(FClientUnlinkFacebookInstantGamesIdRequest request, + FDelegateOnSuccessUnlinkFacebookInstantGamesId onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkFacebookInstantGamesId(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkGameCenterAccount, FClientUnlinkGameCenterAccountResult, result, UObject*, customData); + + /** Unlinks the related Game Center account from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkGameCenterAccount(FClientUnlinkGameCenterAccountRequest request, + FDelegateOnSuccessUnlinkGameCenterAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkGameCenterAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkGoogleAccount, FClientUnlinkGoogleAccountResult, result, UObject*, customData); + + /** + * Unlinks the related Google account from the user's PlayFab account + * (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods). + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkGoogleAccount(FClientUnlinkGoogleAccountRequest request, + FDelegateOnSuccessUnlinkGoogleAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkGoogleAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkIOSDeviceID, FClientUnlinkIOSDeviceIDResult, result, UObject*, customData); + + /** Unlinks the related iOS device identifier from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkIOSDeviceID(FClientUnlinkIOSDeviceIDRequest request, + FDelegateOnSuccessUnlinkIOSDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkIOSDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkKongregate, FClientUnlinkKongregateAccountResult, result, UObject*, customData); + + /** Unlinks the related Kongregate identifier from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkKongregate(FClientUnlinkKongregateAccountRequest request, + FDelegateOnSuccessUnlinkKongregate onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkKongregate(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkNintendoSwitchDeviceId, FClientUnlinkNintendoSwitchDeviceIdResult, result, UObject*, customData); + + /** Unlinks the related NintendoSwitchDeviceId from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkNintendoSwitchDeviceId(FClientUnlinkNintendoSwitchDeviceIdRequest request, + FDelegateOnSuccessUnlinkNintendoSwitchDeviceId onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkNintendoSwitchDeviceId(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkSteamAccount, FClientUnlinkSteamAccountResult, result, UObject*, customData); + + /** Unlinks the related Steam account from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkSteamAccount(FClientUnlinkSteamAccountRequest request, + FDelegateOnSuccessUnlinkSteamAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkSteamAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkTwitch, FClientUnlinkTwitchAccountResult, result, UObject*, customData); + + /** Unlinks the related Twitch account from the user's PlayFab account. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkTwitch(FClientUnlinkTwitchAccountRequest request, + FDelegateOnSuccessUnlinkTwitch onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkTwitch(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkWindowsHello, FClientUnlinkWindowsHelloAccountResponse, result, UObject*, customData); + + /** Unlink Windows Hello authentication from the current PlayFab Account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkWindowsHello(FClientUnlinkWindowsHelloAccountRequest request, + FDelegateOnSuccessUnlinkWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlinkXboxAccount, FClientUnlinkXboxAccountResult, result, UObject*, customData); + + /** Unlinks the related Xbox Live account from the user's PlayFab account */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlinkXboxAccount(FClientUnlinkXboxAccountRequest request, + FDelegateOnSuccessUnlinkXboxAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlinkXboxAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateAvatarUrl, FClientEmptyResponse, result, UObject*, customData); + + /** Update the avatar URL of the player */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateAvatarUrl(FClientUpdateAvatarUrlRequest request, + FDelegateOnSuccessUpdateAvatarUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateAvatarUrl(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserTitleDisplayName, FClientUpdateUserTitleDisplayNameResult, result, UObject*, customData); + + /** Updates the title specific display name for the user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateUserTitleDisplayName(FClientUpdateUserTitleDisplayNameRequest request, + FDelegateOnSuccessUpdateUserTitleDisplayName onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserTitleDisplayName(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Advertising + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAttributeInstall, FClientAttributeInstallResult, result, UObject*, customData); + + /** Attributes an install for advertisment. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Advertising ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AttributeInstall(FClientAttributeInstallRequest request, + FDelegateOnSuccessAttributeInstall onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Advertising ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAttributeInstall(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Analytics + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessReportDeviceInfo, FClientEmptyResponse, result, UObject*, customData); + + /** + * Write a PlayStream event to describe the provided player device information. This API method is not designed to be + * called directly by developers. Each PlayFab client SDK will eventually report this information automatically. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ReportDeviceInfo(FClientDeviceInfoRequest request, + FDelegateOnSuccessReportDeviceInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperReportDeviceInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWriteCharacterEvent, FClientWriteEventResponse, result, UObject*, customData); + + /** Writes a character-based event into PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* WriteCharacterEvent(FClientWriteClientCharacterEventRequest request, + FDelegateOnSuccessWriteCharacterEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWriteCharacterEvent(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWritePlayerEvent, FClientWriteEventResponse, result, UObject*, customData); + + /** Writes a player-based event into PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* WritePlayerEvent(FClientWriteClientPlayerEventRequest request, + FDelegateOnSuccessWritePlayerEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWritePlayerEvent(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWriteTitleEvent, FClientWriteEventResponse, result, UObject*, customData); + + /** Writes a title-based event into PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* WriteTitleEvent(FClientWriteTitleEventRequest request, + FDelegateOnSuccessWriteTitleEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWriteTitleEvent(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPhotonAuthenticationToken, FClientGetPhotonAuthenticationTokenResult, result, UObject*, customData); + + /** + * Gets a Photon custom authentication token that can be used to securely join the player into a Photon room. See + * https://api.playfab.com/docs/using-photon-with-playfab/ for more details. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPhotonAuthenticationToken(FClientGetPhotonAuthenticationTokenRequest request, + FDelegateOnSuccessGetPhotonAuthenticationToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPhotonAuthenticationToken(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitlePublicKey, FClientGetTitlePublicKeyResult, result, UObject*, customData); + + /** Returns the title's base 64 encoded RSA CSP blob. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetTitlePublicKey(FClientGetTitlePublicKeyRequest request, + FDelegateOnSuccessGetTitlePublicKey onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitlePublicKey(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetWindowsHelloChallenge, FClientGetWindowsHelloChallengeResponse, result, UObject*, customData); + + /** Requests a challenge from the server to be signed by Windows Hello Passport service to authenticate. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetWindowsHelloChallenge(FClientGetWindowsHelloChallengeRequest request, + FDelegateOnSuccessGetWindowsHelloChallenge onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetWindowsHelloChallenge(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithAndroidDeviceID, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using the Android device identifier, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithAndroidDeviceID(FClientLoginWithAndroidDeviceIDRequest request, + FDelegateOnSuccessLoginWithAndroidDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithAndroidDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithCustomID, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using a custom unique identifier generated by the title, returning a session identifier that can + * subsequently be used for API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithCustomID(FClientLoginWithCustomIDRequest request, + FDelegateOnSuccessLoginWithCustomID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithCustomID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithEmailAddress, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls + * which require an authenticated user. Unlike most other login API calls, LoginWithEmailAddress does not permit the + * creation of new accounts via the CreateAccountFlag. Email addresses may be used to create accounts via + * RegisterPlayFabUser. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithEmailAddress(FClientLoginWithEmailAddressRequest request, + FDelegateOnSuccessLoginWithEmailAddress onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithEmailAddress(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithFacebook, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using a Facebook access token, returning a session identifier that can subsequently be used for API + * calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithFacebook(FClientLoginWithFacebookRequest request, + FDelegateOnSuccessLoginWithFacebook onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithFacebook(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithFacebookInstantGamesId, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using a Facebook Instant Games ID, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user. Requires Facebook Instant Games to be configured. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithFacebookInstantGamesId(FClientLoginWithFacebookInstantGamesIdRequest request, + FDelegateOnSuccessLoginWithFacebookInstantGamesId onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithFacebookInstantGamesId(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithGameCenter, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using an iOS Game Center player identifier, returning a session identifier that can subsequently be + * used for API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithGameCenter(FClientLoginWithGameCenterRequest request, + FDelegateOnSuccessLoginWithGameCenter onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithGameCenter(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithGoogleAccount, FClientLoginResult, result, UObject*, customData); + + /** Signs the user in using their Google account credentials */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithGoogleAccount(FClientLoginWithGoogleAccountRequest request, + FDelegateOnSuccessLoginWithGoogleAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithGoogleAccount(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithIOSDeviceID, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using the vendor-specific iOS device identifier, returning a session identifier that can subsequently + * be used for API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithIOSDeviceID(FClientLoginWithIOSDeviceIDRequest request, + FDelegateOnSuccessLoginWithIOSDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithIOSDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithKongregate, FClientLoginResult, result, UObject*, customData); + + /** Signs the user in using a Kongregate player account. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithKongregate(FClientLoginWithKongregateRequest request, + FDelegateOnSuccessLoginWithKongregate onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithKongregate(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithNintendoSwitchDeviceId, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using a Nintendo Switch Device ID, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithNintendoSwitchDeviceId(FClientLoginWithNintendoSwitchDeviceIdRequest request, + FDelegateOnSuccessLoginWithNintendoSwitchDeviceId onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithNintendoSwitchDeviceId(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithPlayFab, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls + * which require an authenticated user. Unlike most other login API calls, LoginWithPlayFab does not permit the creation of + * new accounts via the CreateAccountFlag. Username/Password credentials may be used to create accounts via + * RegisterPlayFabUser, or added to existing accounts using AddUsernamePassword. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithPlayFab(FClientLoginWithPlayFabRequest request, + FDelegateOnSuccessLoginWithPlayFab onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithPlayFab(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithSteam, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using a Steam authentication ticket, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithSteam(FClientLoginWithSteamRequest request, + FDelegateOnSuccessLoginWithSteam onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithSteam(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithTwitch, FClientLoginResult, result, UObject*, customData); + + /** Signs the user in using a Twitch access token. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithTwitch(FClientLoginWithTwitchRequest request, + FDelegateOnSuccessLoginWithTwitch onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithTwitch(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithWindowsHello, FClientLoginResult, result, UObject*, customData); + + /** + * Completes the Windows Hello login flow by returning the signed value of the challange from GetWindowsHelloChallenge. + * Windows Hello has a 2 step client to server authentication scheme. Step one is to request from the server a challenge + * string. Step two is to request the user sign the string via Windows Hello and then send the signed value back to the + * server. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithWindowsHello(FClientLoginWithWindowsHelloRequest request, + FDelegateOnSuccessLoginWithWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessLoginWithXbox, FClientLoginResult, result, UObject*, customData); + + /** + * Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls + * which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* LoginWithXbox(FClientLoginWithXboxRequest request, + FDelegateOnSuccessLoginWithXbox onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperLoginWithXbox(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRegisterPlayFabUser, FClientRegisterPlayFabUserResult, result, UObject*, customData); + + /** + * Registers a new Playfab user account, returning a session identifier that can subsequently be used for API calls which + * require an authenticated user. You must supply either a username or an email address. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RegisterPlayFabUser(FClientRegisterPlayFabUserRequest request, + FDelegateOnSuccessRegisterPlayFabUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRegisterPlayFabUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRegisterWithWindowsHello, FClientLoginResult, result, UObject*, customData); + + /** + * Registers a new PlayFab user account using Windows Hello authentication, returning a session ticket that can + * subsequently be used for API calls which require an authenticated user + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RegisterWithWindowsHello(FClientRegisterWithWindowsHelloRequest request, + FDelegateOnSuccessRegisterWithWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRegisterWithWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetPlayerSecret, FClientSetPlayerSecretResult, result, UObject*, customData); + + /** + * Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's + * secret use the Admin or Server API method SetPlayerSecret. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* SetPlayerSecret(FClientSetPlayerSecretRequest request, + FDelegateOnSuccessSetPlayerSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetPlayerSecret(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Character Data + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterData, FClientGetCharacterDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the character which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCharacterData(FClientGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterReadOnlyData, FClientGetCharacterDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the character which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCharacterReadOnlyData(FClientGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCharacterData, FClientUpdateCharacterDataResult, result, UObject*, customData); + + /** Creates and updates the title-specific custom data for the user's character which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateCharacterData(FClientUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Characters + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetAllUsersCharacters, FClientListUsersCharactersResult, result, UObject*, customData); + + /** + * Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be + * evaluated with the parent PlayFabId to guarantee uniqueness. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetAllUsersCharacters(FClientListUsersCharactersRequest request, + FDelegateOnSuccessGetAllUsersCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetAllUsersCharacters(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterLeaderboard, FClientGetCharacterLeaderboardResult, result, UObject*, customData); + + /** Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCharacterLeaderboard(FClientGetCharacterLeaderboardRequest request, + FDelegateOnSuccessGetCharacterLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterStatistics, FClientGetCharacterStatisticsResult, result, UObject*, customData); + + /** Retrieves the details of all title-specific statistics for the user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCharacterStatistics(FClientGetCharacterStatisticsRequest request, + FDelegateOnSuccessGetCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboardAroundCharacter, FClientGetLeaderboardAroundCharacterResult, result, UObject*, customData); + + /** Retrieves a list of ranked characters for the given statistic, centered on the requested Character ID */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetLeaderboardAroundCharacter(FClientGetLeaderboardAroundCharacterRequest request, + FDelegateOnSuccessGetLeaderboardAroundCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboardAroundCharacter(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboardForUserCharacters, FClientGetLeaderboardForUsersCharactersResult, result, UObject*, customData); + + /** Retrieves a list of all of the user's characters for the given statistic. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetLeaderboardForUserCharacters(FClientGetLeaderboardForUsersCharactersRequest request, + FDelegateOnSuccessGetLeaderboardForUserCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboardForUserCharacters(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGrantCharacterToUser, FClientGrantCharacterToUserResult, result, UObject*, customData); + + /** + * Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated + * with the parent PlayFabId to guarantee uniqueness. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GrantCharacterToUser(FClientGrantCharacterToUserRequest request, + FDelegateOnSuccessGrantCharacterToUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGrantCharacterToUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCharacterStatistics, FClientUpdateCharacterStatisticsResult, result, UObject*, customData); + + /** + * Updates the values of the specified title-specific statistics for the specific character. By default, clients are not + * permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateCharacterStatistics(FClientUpdateCharacterStatisticsRequest request, + FDelegateOnSuccessUpdateCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Content + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetContentDownloadUrl, FClientGetContentDownloadUrlResult, result, UObject*, customData); + + /** + * This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned + * URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the + * content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, + * the query to retrieve the data will fail. See this post for more information: + * https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service. Also, + * please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Content ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetContentDownloadUrl(FClientGetContentDownloadUrlRequest request, + FDelegateOnSuccessGetContentDownloadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Content ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetContentDownloadUrl(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Friend List Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddFriend, FClientAddFriendResult, result, UObject*, customData); + + /** + * Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user. At + * least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AddFriend(FClientAddFriendRequest request, + FDelegateOnSuccessAddFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddFriend(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetFriendsList, FClientGetFriendsListResult, result, UObject*, customData); + + /** + * Retrieves the current friend list for the local user, constrained to users who have PlayFab accounts. Friends from + * linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetFriendsList(FClientGetFriendsListRequest request, + FDelegateOnSuccessGetFriendsList onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetFriendsList(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveFriend, FClientRemoveFriendResult, result, UObject*, customData); + + /** Removes a specified user from the friend list of the local user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RemoveFriend(FClientRemoveFriendRequest request, + FDelegateOnSuccessRemoveFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveFriend(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetFriendTags, FClientSetFriendTagsResult, result, UObject*, customData); + + /** Updates the tag list for a specified user in the friend list of the local user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* SetFriendTags(FClientSetFriendTagsRequest request, + FDelegateOnSuccessSetFriendTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetFriendTags(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCurrentGames, FClientCurrentGamesResult, result, UObject*, customData); + + /** Get details about all current running game servers matching the given parameters. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCurrentGames(FClientCurrentGamesRequest request, + FDelegateOnSuccessGetCurrentGames onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCurrentGames(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetGameServerRegions, FClientGameServerRegionsResult, result, UObject*, customData); + + /** Get details about the regions hosting game servers matching the given parameters. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetGameServerRegions(FClientGameServerRegionsRequest request, + FDelegateOnSuccessGetGameServerRegions onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetGameServerRegions(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessMatchmake, FClientMatchmakeResult, result, UObject*, customData); + + /** + * Attempts to locate a game session matching the given parameters. If the goal is to match the player into a specific + * active session, only the LobbyId is required. Otherwise, the BuildVersion, GameMode, and Region are all required + * parameters. Note that parameters specified in the search are required (they are not weighting factors). If a slot is + * found in a server instance matching the parameters, the slot will be assigned to that player, removing it from the + * availabe set. In that case, the information on the game session will be returned, otherwise the Status returned will be + * GameNotFound. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* Matchmake(FClientMatchmakeRequest request, + FDelegateOnSuccessMatchmake onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperMatchmake(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessStartGame, FClientStartGameResult, result, UObject*, customData); + + /** Start a new game server with a given configuration, add the current player and return the connection information. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* StartGame(FClientStartGameRequest request, + FDelegateOnSuccessStartGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperStartGame(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Platform Specific Methods + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAndroidDevicePushNotificationRegistration, FClientAndroidDevicePushNotificationRegistrationResult, result, UObject*, customData); + + /** Registers the Android device to receive push notifications */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AndroidDevicePushNotificationRegistration(FClientAndroidDevicePushNotificationRegistrationRequest request, + FDelegateOnSuccessAndroidDevicePushNotificationRegistration onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAndroidDevicePushNotificationRegistration(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessConsumeXboxEntitlements, FClientConsumeXboxEntitlementsResult, result, UObject*, customData); + + /** + * Grants the player's current entitlements from Xbox Live, consuming all availble items in Xbox and granting them to the + * player's PlayFab inventory. This call is idempotent and will not grant previously granted items to the player. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ConsumeXboxEntitlements(FClientConsumeXboxEntitlementsRequest request, + FDelegateOnSuccessConsumeXboxEntitlements onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperConsumeXboxEntitlements(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRegisterForIOSPushNotification, FClientRegisterForIOSPushNotificationResult, result, UObject*, customData); + + /** Registers the iOS device to receive push notifications */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RegisterForIOSPushNotification(FClientRegisterForIOSPushNotificationRequest request, + FDelegateOnSuccessRegisterForIOSPushNotification onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRegisterForIOSPushNotification(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRestoreIOSPurchases, FClientRestoreIOSPurchasesResult, result, UObject*, customData); + + /** Restores all in-app purchases based on the given restore receipt */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RestoreIOSPurchases(FClientRestoreIOSPurchasesRequest request, + FDelegateOnSuccessRestoreIOSPurchases onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRestoreIOSPurchases(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessValidateAmazonIAPReceipt, FClientValidateAmazonReceiptResult, result, UObject*, customData); + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the + * purchased catalog item + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ValidateAmazonIAPReceipt(FClientValidateAmazonReceiptRequest request, + FDelegateOnSuccessValidateAmazonIAPReceipt onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperValidateAmazonIAPReceipt(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessValidateGooglePlayPurchase, FClientValidateGooglePlayPurchaseResult, result, UObject*, customData); + + /** Validates a Google Play purchase and gives the corresponding item to the player. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ValidateGooglePlayPurchase(FClientValidateGooglePlayPurchaseRequest request, + FDelegateOnSuccessValidateGooglePlayPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperValidateGooglePlayPurchase(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessValidateIOSReceipt, FClientValidateIOSReceiptResult, result, UObject*, customData); + + /** + * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased + * catalog item + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ValidateIOSReceipt(FClientValidateIOSReceiptRequest request, + FDelegateOnSuccessValidateIOSReceipt onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperValidateIOSReceipt(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessValidateWindowsStoreReceipt, FClientValidateWindowsReceiptResult, result, UObject*, customData); + + /** + * Validates with Windows that the receipt for an Windows App Store in-app purchase is valid and that it matches the + * purchased catalog item + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ValidateWindowsStoreReceipt(FClientValidateWindowsReceiptRequest request, + FDelegateOnSuccessValidateWindowsStoreReceipt onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperValidateWindowsStoreReceipt(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Player Data Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetFriendLeaderboard, FClientGetLeaderboardResult, result, UObject*, customData); + + /** + * Retrieves a list of ranked friends of the current player for the given statistic, starting from the indicated point in + * the leaderboard + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetFriendLeaderboard(FClientGetFriendLeaderboardRequest request, + FDelegateOnSuccessGetFriendLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetFriendLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetFriendLeaderboardAroundPlayer, FClientGetFriendLeaderboardAroundPlayerResult, result, UObject*, customData); + + /** + * Retrieves a list of ranked friends of the current player for the given statistic, centered on the requested PlayFab + * user. If PlayFabId is empty or null will return currently logged in user. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetFriendLeaderboardAroundPlayer(FClientGetFriendLeaderboardAroundPlayerRequest request, + FDelegateOnSuccessGetFriendLeaderboardAroundPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetFriendLeaderboardAroundPlayer(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboard, FClientGetLeaderboardResult, result, UObject*, customData); + + /** Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetLeaderboard(FClientGetLeaderboardRequest request, + FDelegateOnSuccessGetLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboardAroundPlayer, FClientGetLeaderboardAroundPlayerResult, result, UObject*, customData); + + /** + * Retrieves a list of ranked users for the given statistic, centered on the requested player. If PlayFabId is empty or + * null will return currently logged in user. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetLeaderboardAroundPlayer(FClientGetLeaderboardAroundPlayerRequest request, + FDelegateOnSuccessGetLeaderboardAroundPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboardAroundPlayer(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerStatistics, FClientGetPlayerStatisticsResult, result, UObject*, customData); + + /** + * Retrieves the indicated statistics (current version and values for all statistics, if none are specified), for the local + * player. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerStatistics(FClientGetPlayerStatisticsRequest request, + FDelegateOnSuccessGetPlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerStatisticVersions, FClientGetPlayerStatisticVersionsResult, result, UObject*, customData); + + /** Retrieves the information on the available versions of the specified statistic. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerStatisticVersions(FClientGetPlayerStatisticVersionsRequest request, + FDelegateOnSuccessGetPlayerStatisticVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerStatisticVersions(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserData, FClientGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetUserData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherData, FClientGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetUserPublisherData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherReadOnlyData, FClientGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetUserPublisherReadOnlyData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserReadOnlyData, FClientGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetUserReadOnlyData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdatePlayerStatistics, FClientUpdatePlayerStatisticsResult, result, UObject*, customData); + + /** + * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to + * update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdatePlayerStatistics(FClientUpdatePlayerStatisticsRequest request, + FDelegateOnSuccessUpdatePlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdatePlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserData, FClientUpdateUserDataResult, result, UObject*, customData); + + /** Creates and updates the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateUserData(FClientUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherData, FClientUpdateUserDataResult, result, UObject*, customData); + + /** Creates and updates the publisher-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateUserPublisherData(FClientUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Player Item Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddUserVirtualCurrency, FClientModifyUserVirtualCurrencyResult, result, UObject*, customData); + + /** Increments the user's balance of the specified virtual currency by the stated amount */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AddUserVirtualCurrency(FClientAddUserVirtualCurrencyRequest request, + FDelegateOnSuccessAddUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessConfirmPurchase, FClientConfirmPurchaseResult, result, UObject*, customData); + + /** + * Confirms with the payment provider that the purchase was approved (if applicable) and adjusts inventory and virtual + * currency balances as appropriate + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ConfirmPurchase(FClientConfirmPurchaseRequest request, + FDelegateOnSuccessConfirmPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperConfirmPurchase(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessConsumeItem, FClientConsumeItemResult, result, UObject*, customData); + + /** Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ConsumeItem(FClientConsumeItemRequest request, + FDelegateOnSuccessConsumeItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperConsumeItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterInventory, FClientGetCharacterInventoryResult, result, UObject*, customData); + + /** Retrieves the specified character's current inventory of virtual goods */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCharacterInventory(FClientGetCharacterInventoryRequest request, + FDelegateOnSuccessGetCharacterInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterInventory(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPaymentToken, FClientGetPaymentTokenResult, result, UObject*, customData); + + /** + * For payments flows where the provider requires playfab (the fulfiller) to initiate the transaction, but the client + * completes the rest of the flow. In the Xsolla case, the token returned here will be passed to Xsolla by the client to + * create a cart. Poll GetPurchase using the returned OrderId once you've completed the payment. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPaymentToken(FClientGetPaymentTokenRequest request, + FDelegateOnSuccessGetPaymentToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPaymentToken(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPurchase, FClientGetPurchaseResult, result, UObject*, customData); + + /** + * Retrieves a purchase along with its current PlayFab status. Returns inventory items from the purchase that are still + * active. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPurchase(FClientGetPurchaseRequest request, + FDelegateOnSuccessGetPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPurchase(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserInventory, FClientGetUserInventoryResult, result, UObject*, customData); + + /** Retrieves the user's current inventory of virtual goods */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetUserInventory(FClientGetUserInventoryRequest request, + FDelegateOnSuccessGetUserInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserInventory(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessPayForPurchase, FClientPayForPurchaseResult, result, UObject*, customData); + + /** Selects a payment option for purchase order created via StartPurchase */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* PayForPurchase(FClientPayForPurchaseRequest request, + FDelegateOnSuccessPayForPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperPayForPurchase(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessPurchaseItem, FClientPurchaseItemResult, result, UObject*, customData); + + /** + * Buys a single item with virtual currency. You must specify both the virtual currency to use to purchase, as well as what + * the client believes the price to be. This lets the server fail the purchase if the price has changed. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* PurchaseItem(FClientPurchaseItemRequest request, + FDelegateOnSuccessPurchaseItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperPurchaseItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRedeemCoupon, FClientRedeemCouponResult, result, UObject*, customData); + + /** + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the + * Economy->Catalogs tab in the PlayFab Game Manager. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RedeemCoupon(FClientRedeemCouponRequest request, + FDelegateOnSuccessRedeemCoupon onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRedeemCoupon(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessStartPurchase, FClientStartPurchaseResult, result, UObject*, customData); + + /** Creates an order for a list of items from the title catalog */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* StartPurchase(FClientStartPurchaseRequest request, + FDelegateOnSuccessStartPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperStartPurchase(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSubtractUserVirtualCurrency, FClientModifyUserVirtualCurrencyResult, result, UObject*, customData); + + /** + * Decrements the user's balance of the specified virtual currency by the stated amount. It is possible to make a VC + * balance negative with this API. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* SubtractUserVirtualCurrency(FClientSubtractUserVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSubtractUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlockContainerInstance, FClientUnlockContainerItemResult, result, UObject*, customData); + + /** + * Opens the specified container, with the specified key (when required), and returns the contents of the opened container. + * If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, + * consistent with the operation of ConsumeItem. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlockContainerInstance(FClientUnlockContainerInstanceRequest request, + FDelegateOnSuccessUnlockContainerInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlockContainerInstance(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlockContainerItem, FClientUnlockContainerItemResult, result, UObject*, customData); + + /** + * Searches target inventory for an ItemInstance matching the given CatalogItemId, if necessary unlocks it using an + * appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are + * consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UnlockContainerItem(FClientUnlockContainerItemRequest request, + FDelegateOnSuccessUnlockContainerItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlockContainerItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // PlayStream + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerSegments, FClientGetPlayerSegmentsResult, result, UObject*, customData); + + /** List all segments that a player currently belongs to at this moment in time. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerSegments(FClientGetPlayerSegmentsRequest request, + FDelegateOnSuccessGetPlayerSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerSegments(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerTags, FClientGetPlayerTagsResult, result, UObject*, customData); + + /** Get all tags with a given Namespace (optional) from a player profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerTags(FClientGetPlayerTagsRequest request, + FDelegateOnSuccessGetPlayerTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerTags(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessExecuteCloudScript, FClientExecuteCloudScriptResult, result, UObject*, customData); + + /** Executes a CloudScript function, with the 'currentPlayerId' set to the PlayFab ID of the authenticated player. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* ExecuteCloudScript(FClientExecuteCloudScriptRequest request, + FDelegateOnSuccessExecuteCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperExecuteCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Shared Group Data + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddSharedGroupMembers, FClientAddSharedGroupMembersResult, result, UObject*, customData); + + /** + * Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users + * in the group can add new members. Shared Groups are designed for sharing data between a very small number of players, + * please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AddSharedGroupMembers(FClientAddSharedGroupMembersRequest request, + FDelegateOnSuccessAddSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreateSharedGroup, FClientCreateSharedGroupResult, result, UObject*, customData); + + /** + * Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the + * group. Upon creation, the current user will be the only member of the group. Shared Groups are designed for sharing data + * between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* CreateSharedGroup(FClientCreateSharedGroupRequest request, + FDelegateOnSuccessCreateSharedGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreateSharedGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetSharedGroupData, FClientGetSharedGroupDataResult, result, UObject*, customData); + + /** + * Retrieves data stored in a shared group object, as well as the list of members in the group. Non-members of the group + * may use this to retrieve group data, including membership, but they will not receive data for keys marked as private. + * Shared Groups are designed for sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetSharedGroupData(FClientGetSharedGroupDataRequest request, + FDelegateOnSuccessGetSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveSharedGroupMembers, FClientRemoveSharedGroupMembersResult, result, UObject*, customData); + + /** + * Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the + * group can remove members. If as a result of the call, zero users remain with access, the group and its associated data + * will be deleted. Shared Groups are designed for sharing data between a very small number of players, please see our + * guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* RemoveSharedGroupMembers(FClientRemoveSharedGroupMembersRequest request, + FDelegateOnSuccessRemoveSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateSharedGroupData, FClientUpdateSharedGroupDataResult, result, UObject*, customData); + + /** + * Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated + * or added in this call will be readable by users not in the group. By default, data permissions are set to Private. + * Regardless of the permission setting, only members of the group can update the data. Shared Groups are designed for + * sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* UpdateSharedGroupData(FClientUpdateSharedGroupDataRequest request, + FDelegateOnSuccessUpdateSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Title-Wide Data Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCatalogItems, FClientGetCatalogItemsResult, result, UObject*, customData); + + /** Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetCatalogItems(FClientGetCatalogItemsRequest request, + FDelegateOnSuccessGetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPublisherData, FClientGetPublisherDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom publisher settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPublisherData(FClientGetPublisherDataRequest request, + FDelegateOnSuccessGetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetStoreItems, FClientGetStoreItemsResult, result, UObject*, customData); + + /** Retrieves the set of items defined for the specified store, including all prices defined */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetStoreItems(FClientGetStoreItemsRequest request, + FDelegateOnSuccessGetStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTime, FClientGetTimeResult, result, UObject*, customData); + + /** Retrieves the current server time */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetTime(FClientGetTimeRequest request, + FDelegateOnSuccessGetTime onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTime(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleData, FClientGetTitleDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom title settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetTitleData(FClientGetTitleDataRequest request, + FDelegateOnSuccessGetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleNews, FClientGetTitleNewsResult, result, UObject*, customData); + + /** Retrieves the title news feed, as configured in the developer portal */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetTitleNews(FClientGetTitleNewsRequest request, + FDelegateOnSuccessGetTitleNews onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleNews(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Trading + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAcceptTrade, FClientAcceptTradeResponse, result, UObject*, customData); + + /** + * Accepts an open trade (one that has not yet been accepted or cancelled), if the locally signed-in player is in the + * allowed player list for the trade, or it is open to all players. If the call is successful, the offered and accepted + * items will be swapped between the two players' inventories. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* AcceptTrade(FClientAcceptTradeRequest request, + FDelegateOnSuccessAcceptTrade onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAcceptTrade(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCancelTrade, FClientCancelTradeResponse, result, UObject*, customData); + + /** + * Cancels an open trade (one that has not yet been accepted or cancelled). Note that only the player who created the trade + * can cancel it via this API call, to prevent griefing of the trade system (cancelling trades in order to prevent other + * players from accepting them, for trades that can be claimed by more than one player). + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* CancelTrade(FClientCancelTradeRequest request, + FDelegateOnSuccessCancelTrade onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCancelTrade(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerTrades, FClientGetPlayerTradesResponse, result, UObject*, customData); + + /** Gets all trades the player has either opened or accepted, optionally filtered by trade status. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetPlayerTrades(FClientGetPlayerTradesRequest request, + FDelegateOnSuccessGetPlayerTrades onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerTrades(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTradeStatus, FClientGetTradeStatusResponse, result, UObject*, customData); + + /** Gets the current status of an existing trade. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* GetTradeStatus(FClientGetTradeStatusRequest request, + FDelegateOnSuccessGetTradeStatus onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTradeStatus(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessOpenTrade, FClientOpenTradeResponse, result, UObject*, customData); + + /** Opens a new outstanding trade. Note that a given item instance may only be in one open trade at a time. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabClientAPI* OpenTrade(FClientOpenTradeRequest request, + FDelegateOnSuccessOpenTrade onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabClientRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading ", meta = (BlueprintInternalUseOnly = "true")) + void HelperOpenTrade(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessAddGenericID OnSuccessAddGenericID; + FDelegateOnSuccessAddOrUpdateContactEmail OnSuccessAddOrUpdateContactEmail; + FDelegateOnSuccessAddUsernamePassword OnSuccessAddUsernamePassword; + FDelegateOnSuccessGetAccountInfo OnSuccessGetAccountInfo; + FDelegateOnSuccessGetPlayerCombinedInfo OnSuccessGetPlayerCombinedInfo; + FDelegateOnSuccessGetPlayerProfile OnSuccessGetPlayerProfile; + FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs OnSuccessGetPlayFabIDsFromFacebookIDs; + FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds; + FDelegateOnSuccessGetPlayFabIDsFromGameCenterIDs OnSuccessGetPlayFabIDsFromGameCenterIDs; + FDelegateOnSuccessGetPlayFabIDsFromGenericIDs OnSuccessGetPlayFabIDsFromGenericIDs; + FDelegateOnSuccessGetPlayFabIDsFromGoogleIDs OnSuccessGetPlayFabIDsFromGoogleIDs; + FDelegateOnSuccessGetPlayFabIDsFromKongregateIDs OnSuccessGetPlayFabIDsFromKongregateIDs; + FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds; + FDelegateOnSuccessGetPlayFabIDsFromSteamIDs OnSuccessGetPlayFabIDsFromSteamIDs; + FDelegateOnSuccessGetPlayFabIDsFromTwitchIDs OnSuccessGetPlayFabIDsFromTwitchIDs; + FDelegateOnSuccessLinkAndroidDeviceID OnSuccessLinkAndroidDeviceID; + FDelegateOnSuccessLinkCustomID OnSuccessLinkCustomID; + FDelegateOnSuccessLinkFacebookAccount OnSuccessLinkFacebookAccount; + FDelegateOnSuccessLinkFacebookInstantGamesId OnSuccessLinkFacebookInstantGamesId; + FDelegateOnSuccessLinkGameCenterAccount OnSuccessLinkGameCenterAccount; + FDelegateOnSuccessLinkGoogleAccount OnSuccessLinkGoogleAccount; + FDelegateOnSuccessLinkIOSDeviceID OnSuccessLinkIOSDeviceID; + FDelegateOnSuccessLinkKongregate OnSuccessLinkKongregate; + FDelegateOnSuccessLinkNintendoSwitchDeviceId OnSuccessLinkNintendoSwitchDeviceId; + FDelegateOnSuccessLinkSteamAccount OnSuccessLinkSteamAccount; + FDelegateOnSuccessLinkTwitch OnSuccessLinkTwitch; + FDelegateOnSuccessLinkWindowsHello OnSuccessLinkWindowsHello; + FDelegateOnSuccessLinkXboxAccount OnSuccessLinkXboxAccount; + FDelegateOnSuccessRemoveContactEmail OnSuccessRemoveContactEmail; + FDelegateOnSuccessRemoveGenericID OnSuccessRemoveGenericID; + FDelegateOnSuccessReportPlayer OnSuccessReportPlayer; + FDelegateOnSuccessSendAccountRecoveryEmail OnSuccessSendAccountRecoveryEmail; + FDelegateOnSuccessUnlinkAndroidDeviceID OnSuccessUnlinkAndroidDeviceID; + FDelegateOnSuccessUnlinkCustomID OnSuccessUnlinkCustomID; + FDelegateOnSuccessUnlinkFacebookAccount OnSuccessUnlinkFacebookAccount; + FDelegateOnSuccessUnlinkFacebookInstantGamesId OnSuccessUnlinkFacebookInstantGamesId; + FDelegateOnSuccessUnlinkGameCenterAccount OnSuccessUnlinkGameCenterAccount; + FDelegateOnSuccessUnlinkGoogleAccount OnSuccessUnlinkGoogleAccount; + FDelegateOnSuccessUnlinkIOSDeviceID OnSuccessUnlinkIOSDeviceID; + FDelegateOnSuccessUnlinkKongregate OnSuccessUnlinkKongregate; + FDelegateOnSuccessUnlinkNintendoSwitchDeviceId OnSuccessUnlinkNintendoSwitchDeviceId; + FDelegateOnSuccessUnlinkSteamAccount OnSuccessUnlinkSteamAccount; + FDelegateOnSuccessUnlinkTwitch OnSuccessUnlinkTwitch; + FDelegateOnSuccessUnlinkWindowsHello OnSuccessUnlinkWindowsHello; + FDelegateOnSuccessUnlinkXboxAccount OnSuccessUnlinkXboxAccount; + FDelegateOnSuccessUpdateAvatarUrl OnSuccessUpdateAvatarUrl; + FDelegateOnSuccessUpdateUserTitleDisplayName OnSuccessUpdateUserTitleDisplayName; + FDelegateOnSuccessAttributeInstall OnSuccessAttributeInstall; + FDelegateOnSuccessReportDeviceInfo OnSuccessReportDeviceInfo; + FDelegateOnSuccessWriteCharacterEvent OnSuccessWriteCharacterEvent; + FDelegateOnSuccessWritePlayerEvent OnSuccessWritePlayerEvent; + FDelegateOnSuccessWriteTitleEvent OnSuccessWriteTitleEvent; + FDelegateOnSuccessGetPhotonAuthenticationToken OnSuccessGetPhotonAuthenticationToken; + FDelegateOnSuccessGetTitlePublicKey OnSuccessGetTitlePublicKey; + FDelegateOnSuccessGetWindowsHelloChallenge OnSuccessGetWindowsHelloChallenge; + FDelegateOnSuccessLoginWithAndroidDeviceID OnSuccessLoginWithAndroidDeviceID; + FDelegateOnSuccessLoginWithCustomID OnSuccessLoginWithCustomID; + FDelegateOnSuccessLoginWithEmailAddress OnSuccessLoginWithEmailAddress; + FDelegateOnSuccessLoginWithFacebook OnSuccessLoginWithFacebook; + FDelegateOnSuccessLoginWithFacebookInstantGamesId OnSuccessLoginWithFacebookInstantGamesId; + FDelegateOnSuccessLoginWithGameCenter OnSuccessLoginWithGameCenter; + FDelegateOnSuccessLoginWithGoogleAccount OnSuccessLoginWithGoogleAccount; + FDelegateOnSuccessLoginWithIOSDeviceID OnSuccessLoginWithIOSDeviceID; + FDelegateOnSuccessLoginWithKongregate OnSuccessLoginWithKongregate; + FDelegateOnSuccessLoginWithNintendoSwitchDeviceId OnSuccessLoginWithNintendoSwitchDeviceId; + FDelegateOnSuccessLoginWithPlayFab OnSuccessLoginWithPlayFab; + FDelegateOnSuccessLoginWithSteam OnSuccessLoginWithSteam; + FDelegateOnSuccessLoginWithTwitch OnSuccessLoginWithTwitch; + FDelegateOnSuccessLoginWithWindowsHello OnSuccessLoginWithWindowsHello; + FDelegateOnSuccessLoginWithXbox OnSuccessLoginWithXbox; + FDelegateOnSuccessRegisterPlayFabUser OnSuccessRegisterPlayFabUser; + FDelegateOnSuccessRegisterWithWindowsHello OnSuccessRegisterWithWindowsHello; + FDelegateOnSuccessSetPlayerSecret OnSuccessSetPlayerSecret; + FDelegateOnSuccessGetCharacterData OnSuccessGetCharacterData; + FDelegateOnSuccessGetCharacterReadOnlyData OnSuccessGetCharacterReadOnlyData; + FDelegateOnSuccessUpdateCharacterData OnSuccessUpdateCharacterData; + FDelegateOnSuccessGetAllUsersCharacters OnSuccessGetAllUsersCharacters; + FDelegateOnSuccessGetCharacterLeaderboard OnSuccessGetCharacterLeaderboard; + FDelegateOnSuccessGetCharacterStatistics OnSuccessGetCharacterStatistics; + FDelegateOnSuccessGetLeaderboardAroundCharacter OnSuccessGetLeaderboardAroundCharacter; + FDelegateOnSuccessGetLeaderboardForUserCharacters OnSuccessGetLeaderboardForUserCharacters; + FDelegateOnSuccessGrantCharacterToUser OnSuccessGrantCharacterToUser; + FDelegateOnSuccessUpdateCharacterStatistics OnSuccessUpdateCharacterStatistics; + FDelegateOnSuccessGetContentDownloadUrl OnSuccessGetContentDownloadUrl; + FDelegateOnSuccessAddFriend OnSuccessAddFriend; + FDelegateOnSuccessGetFriendsList OnSuccessGetFriendsList; + FDelegateOnSuccessRemoveFriend OnSuccessRemoveFriend; + FDelegateOnSuccessSetFriendTags OnSuccessSetFriendTags; + FDelegateOnSuccessGetCurrentGames OnSuccessGetCurrentGames; + FDelegateOnSuccessGetGameServerRegions OnSuccessGetGameServerRegions; + FDelegateOnSuccessMatchmake OnSuccessMatchmake; + FDelegateOnSuccessStartGame OnSuccessStartGame; + FDelegateOnSuccessAndroidDevicePushNotificationRegistration OnSuccessAndroidDevicePushNotificationRegistration; + FDelegateOnSuccessConsumeXboxEntitlements OnSuccessConsumeXboxEntitlements; + FDelegateOnSuccessRegisterForIOSPushNotification OnSuccessRegisterForIOSPushNotification; + FDelegateOnSuccessRestoreIOSPurchases OnSuccessRestoreIOSPurchases; + FDelegateOnSuccessValidateAmazonIAPReceipt OnSuccessValidateAmazonIAPReceipt; + FDelegateOnSuccessValidateGooglePlayPurchase OnSuccessValidateGooglePlayPurchase; + FDelegateOnSuccessValidateIOSReceipt OnSuccessValidateIOSReceipt; + FDelegateOnSuccessValidateWindowsStoreReceipt OnSuccessValidateWindowsStoreReceipt; + FDelegateOnSuccessGetFriendLeaderboard OnSuccessGetFriendLeaderboard; + FDelegateOnSuccessGetFriendLeaderboardAroundPlayer OnSuccessGetFriendLeaderboardAroundPlayer; + FDelegateOnSuccessGetLeaderboard OnSuccessGetLeaderboard; + FDelegateOnSuccessGetLeaderboardAroundPlayer OnSuccessGetLeaderboardAroundPlayer; + FDelegateOnSuccessGetPlayerStatistics OnSuccessGetPlayerStatistics; + FDelegateOnSuccessGetPlayerStatisticVersions OnSuccessGetPlayerStatisticVersions; + FDelegateOnSuccessGetUserData OnSuccessGetUserData; + FDelegateOnSuccessGetUserPublisherData OnSuccessGetUserPublisherData; + FDelegateOnSuccessGetUserPublisherReadOnlyData OnSuccessGetUserPublisherReadOnlyData; + FDelegateOnSuccessGetUserReadOnlyData OnSuccessGetUserReadOnlyData; + FDelegateOnSuccessUpdatePlayerStatistics OnSuccessUpdatePlayerStatistics; + FDelegateOnSuccessUpdateUserData OnSuccessUpdateUserData; + FDelegateOnSuccessUpdateUserPublisherData OnSuccessUpdateUserPublisherData; + FDelegateOnSuccessAddUserVirtualCurrency OnSuccessAddUserVirtualCurrency; + FDelegateOnSuccessConfirmPurchase OnSuccessConfirmPurchase; + FDelegateOnSuccessConsumeItem OnSuccessConsumeItem; + FDelegateOnSuccessGetCharacterInventory OnSuccessGetCharacterInventory; + FDelegateOnSuccessGetPaymentToken OnSuccessGetPaymentToken; + FDelegateOnSuccessGetPurchase OnSuccessGetPurchase; + FDelegateOnSuccessGetUserInventory OnSuccessGetUserInventory; + FDelegateOnSuccessPayForPurchase OnSuccessPayForPurchase; + FDelegateOnSuccessPurchaseItem OnSuccessPurchaseItem; + FDelegateOnSuccessRedeemCoupon OnSuccessRedeemCoupon; + FDelegateOnSuccessStartPurchase OnSuccessStartPurchase; + FDelegateOnSuccessSubtractUserVirtualCurrency OnSuccessSubtractUserVirtualCurrency; + FDelegateOnSuccessUnlockContainerInstance OnSuccessUnlockContainerInstance; + FDelegateOnSuccessUnlockContainerItem OnSuccessUnlockContainerItem; + FDelegateOnSuccessGetPlayerSegments OnSuccessGetPlayerSegments; + FDelegateOnSuccessGetPlayerTags OnSuccessGetPlayerTags; + FDelegateOnSuccessExecuteCloudScript OnSuccessExecuteCloudScript; + FDelegateOnSuccessAddSharedGroupMembers OnSuccessAddSharedGroupMembers; + FDelegateOnSuccessCreateSharedGroup OnSuccessCreateSharedGroup; + FDelegateOnSuccessGetSharedGroupData OnSuccessGetSharedGroupData; + FDelegateOnSuccessRemoveSharedGroupMembers OnSuccessRemoveSharedGroupMembers; + FDelegateOnSuccessUpdateSharedGroupData OnSuccessUpdateSharedGroupData; + FDelegateOnSuccessGetCatalogItems OnSuccessGetCatalogItems; + FDelegateOnSuccessGetPublisherData OnSuccessGetPublisherData; + FDelegateOnSuccessGetStoreItems OnSuccessGetStoreItems; + FDelegateOnSuccessGetTime OnSuccessGetTime; + FDelegateOnSuccessGetTitleData OnSuccessGetTitleData; + FDelegateOnSuccessGetTitleNews OnSuccessGetTitleNews; + FDelegateOnSuccessAcceptTrade OnSuccessAcceptTrade; + FDelegateOnSuccessCancelTrade OnSuccessCancelTrade; + FDelegateOnSuccessGetPlayerTrades OnSuccessGetPlayerTrades; + FDelegateOnSuccessGetTradeStatus OnSuccessGetTradeStatus; + FDelegateOnSuccessOpenTrade OnSuccessOpenTrade; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabClientModelDecoder.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabClientModelDecoder.h new file mode 100644 index 000000000..64c5771be --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabClientModelDecoder.h @@ -0,0 +1,617 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Client +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabClientModels.h" +#include "PlayFabClientModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabClientModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Client API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + + /** Decode the AddGenericIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientAddGenericIDResult decodeAddGenericIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the AddOrUpdateContactEmailResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientAddOrUpdateContactEmailResult decodeAddOrUpdateContactEmailResultResponse(UPlayFabJsonObject* response); + + /** Decode the AddUsernamePasswordResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientAddUsernamePasswordResult decodeAddUsernamePasswordResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetAccountInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetAccountInfoResult decodeGetAccountInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerCombinedInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayerCombinedInfoResult decodeGetPlayerCombinedInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerProfileResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayerProfileResult decodeGetPlayerProfileResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromFacebookIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromFacebookIDsResult decodeGetPlayFabIDsFromFacebookIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromFacebookInstantGamesIdsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromFacebookInstantGamesIdsResult decodeGetPlayFabIDsFromFacebookInstantGamesIdsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromGameCenterIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromGameCenterIDsResult decodeGetPlayFabIDsFromGameCenterIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromGenericIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromGenericIDsResult decodeGetPlayFabIDsFromGenericIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromGoogleIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromGoogleIDsResult decodeGetPlayFabIDsFromGoogleIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromKongregateIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromKongregateIDsResult decodeGetPlayFabIDsFromKongregateIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromNintendoSwitchDeviceIdsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsResult decodeGetPlayFabIDsFromNintendoSwitchDeviceIdsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromSteamIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromSteamIDsResult decodeGetPlayFabIDsFromSteamIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromTwitchIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientGetPlayFabIDsFromTwitchIDsResult decodeGetPlayFabIDsFromTwitchIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkAndroidDeviceIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkAndroidDeviceIDResult decodeLinkAndroidDeviceIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkCustomIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkCustomIDResult decodeLinkCustomIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkFacebookAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkFacebookAccountResult decodeLinkFacebookAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkFacebookInstantGamesIdResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkFacebookInstantGamesIdResult decodeLinkFacebookInstantGamesIdResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkGameCenterAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkGameCenterAccountResult decodeLinkGameCenterAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkGoogleAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkGoogleAccountResult decodeLinkGoogleAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkIOSDeviceIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkIOSDeviceIDResult decodeLinkIOSDeviceIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkKongregateAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkKongregateAccountResult decodeLinkKongregateAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkNintendoSwitchDeviceIdResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkNintendoSwitchDeviceIdResult decodeLinkNintendoSwitchDeviceIdResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkSteamAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkSteamAccountResult decodeLinkSteamAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkTwitchAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkTwitchAccountResult decodeLinkTwitchAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the LinkWindowsHelloAccountResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkWindowsHelloAccountResponse decodeLinkWindowsHelloAccountResponseResponse(UPlayFabJsonObject* response); + + /** Decode the LinkXboxAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientLinkXboxAccountResult decodeLinkXboxAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemoveContactEmailResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientRemoveContactEmailResult decodeRemoveContactEmailResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemoveGenericIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientRemoveGenericIDResult decodeRemoveGenericIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the ReportPlayerClientResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientReportPlayerClientResult decodeReportPlayerClientResultResponse(UPlayFabJsonObject* response); + + /** Decode the SendAccountRecoveryEmailResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientSendAccountRecoveryEmailResult decodeSendAccountRecoveryEmailResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkAndroidDeviceIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkAndroidDeviceIDResult decodeUnlinkAndroidDeviceIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkCustomIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkCustomIDResult decodeUnlinkCustomIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkFacebookAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkFacebookAccountResult decodeUnlinkFacebookAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkFacebookInstantGamesIdResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkFacebookInstantGamesIdResult decodeUnlinkFacebookInstantGamesIdResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkGameCenterAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkGameCenterAccountResult decodeUnlinkGameCenterAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkGoogleAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkGoogleAccountResult decodeUnlinkGoogleAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkIOSDeviceIDResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkIOSDeviceIDResult decodeUnlinkIOSDeviceIDResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkKongregateAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkKongregateAccountResult decodeUnlinkKongregateAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkNintendoSwitchDeviceIdResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkNintendoSwitchDeviceIdResult decodeUnlinkNintendoSwitchDeviceIdResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkSteamAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkSteamAccountResult decodeUnlinkSteamAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkTwitchAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkTwitchAccountResult decodeUnlinkTwitchAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkWindowsHelloAccountResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkWindowsHelloAccountResponse decodeUnlinkWindowsHelloAccountResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UnlinkXboxAccountResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUnlinkXboxAccountResult decodeUnlinkXboxAccountResultResponse(UPlayFabJsonObject* response); + + /** Decode the EmptyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientEmptyResponse decodeEmptyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateUserTitleDisplayNameResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") + static FClientUpdateUserTitleDisplayNameResult decodeUpdateUserTitleDisplayNameResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Advertising + ////////////////////////////////////////////////////// + + /** Decode the AttributeInstallResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Advertising Models") + static FClientAttributeInstallResult decodeAttributeInstallResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Analytics + ////////////////////////////////////////////////////// + + /** Decode the WriteEventResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics Models") + static FClientWriteEventResponse decodeWriteEventResponseResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + + /** Decode the GetPhotonAuthenticationTokenResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") + static FClientGetPhotonAuthenticationTokenResult decodeGetPhotonAuthenticationTokenResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTitlePublicKeyResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") + static FClientGetTitlePublicKeyResult decodeGetTitlePublicKeyResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetWindowsHelloChallengeResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") + static FClientGetWindowsHelloChallengeResponse decodeGetWindowsHelloChallengeResponseResponse(UPlayFabJsonObject* response); + + /** Decode the LoginResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") + static FClientLoginResult decodeLoginResultResponse(UPlayFabJsonObject* response); + + /** Decode the RegisterPlayFabUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") + static FClientRegisterPlayFabUserResult decodeRegisterPlayFabUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetPlayerSecretResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") + static FClientSetPlayerSecretResult decodeSetPlayerSecretResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Character Data + ////////////////////////////////////////////////////// + + /** Decode the GetCharacterDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data Models") + static FClientGetCharacterDataResult decodeGetCharacterDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateCharacterDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data Models") + static FClientUpdateCharacterDataResult decodeUpdateCharacterDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Characters + ////////////////////////////////////////////////////// + + /** Decode the ListUsersCharactersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientListUsersCharactersResult decodeListUsersCharactersResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCharacterLeaderboardResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientGetCharacterLeaderboardResult decodeGetCharacterLeaderboardResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCharacterStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientGetCharacterStatisticsResult decodeGetCharacterStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardAroundCharacterResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientGetLeaderboardAroundCharacterResult decodeGetLeaderboardAroundCharacterResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardForUsersCharactersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientGetLeaderboardForUsersCharactersResult decodeGetLeaderboardForUsersCharactersResultResponse(UPlayFabJsonObject* response); + + /** Decode the GrantCharacterToUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientGrantCharacterToUserResult decodeGrantCharacterToUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateCharacterStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") + static FClientUpdateCharacterStatisticsResult decodeUpdateCharacterStatisticsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Content + ////////////////////////////////////////////////////// + + /** Decode the GetContentDownloadUrlResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Content Models") + static FClientGetContentDownloadUrlResult decodeGetContentDownloadUrlResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Friend List Management + ////////////////////////////////////////////////////// + + /** Decode the AddFriendResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management Models") + static FClientAddFriendResult decodeAddFriendResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetFriendsListResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management Models") + static FClientGetFriendsListResult decodeGetFriendsListResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemoveFriendResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management Models") + static FClientRemoveFriendResult decodeRemoveFriendResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetFriendTagsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management Models") + static FClientSetFriendTagsResult decodeSetFriendTagsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + + /** Decode the CurrentGamesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking Models") + static FClientCurrentGamesResult decodeCurrentGamesResultResponse(UPlayFabJsonObject* response); + + /** Decode the GameServerRegionsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking Models") + static FClientGameServerRegionsResult decodeGameServerRegionsResultResponse(UPlayFabJsonObject* response); + + /** Decode the MatchmakeResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking Models") + static FClientMatchmakeResult decodeMatchmakeResultResponse(UPlayFabJsonObject* response); + + /** Decode the StartGameResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking Models") + static FClientStartGameResult decodeStartGameResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Platform Specific Methods + ////////////////////////////////////////////////////// + + /** Decode the AndroidDevicePushNotificationRegistrationResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientAndroidDevicePushNotificationRegistrationResult decodeAndroidDevicePushNotificationRegistrationResultResponse(UPlayFabJsonObject* response); + + /** Decode the ConsumeXboxEntitlementsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientConsumeXboxEntitlementsResult decodeConsumeXboxEntitlementsResultResponse(UPlayFabJsonObject* response); + + /** Decode the RegisterForIOSPushNotificationResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientRegisterForIOSPushNotificationResult decodeRegisterForIOSPushNotificationResultResponse(UPlayFabJsonObject* response); + + /** Decode the RestoreIOSPurchasesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientRestoreIOSPurchasesResult decodeRestoreIOSPurchasesResultResponse(UPlayFabJsonObject* response); + + /** Decode the ValidateAmazonReceiptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientValidateAmazonReceiptResult decodeValidateAmazonReceiptResultResponse(UPlayFabJsonObject* response); + + /** Decode the ValidateGooglePlayPurchaseResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientValidateGooglePlayPurchaseResult decodeValidateGooglePlayPurchaseResultResponse(UPlayFabJsonObject* response); + + /** Decode the ValidateIOSReceiptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientValidateIOSReceiptResult decodeValidateIOSReceiptResultResponse(UPlayFabJsonObject* response); + + /** Decode the ValidateWindowsReceiptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") + static FClientValidateWindowsReceiptResult decodeValidateWindowsReceiptResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Player Data Management + ////////////////////////////////////////////////////// + + /** Decode the GetLeaderboardResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientGetLeaderboardResult decodeGetLeaderboardResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetFriendLeaderboardAroundPlayerResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientGetFriendLeaderboardAroundPlayerResult decodeGetFriendLeaderboardAroundPlayerResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardAroundPlayerResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientGetLeaderboardAroundPlayerResult decodeGetLeaderboardAroundPlayerResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientGetPlayerStatisticsResult decodeGetPlayerStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerStatisticVersionsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientGetPlayerStatisticVersionsResult decodeGetPlayerStatisticVersionsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientGetUserDataResult decodeGetUserDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdatePlayerStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientUpdatePlayerStatisticsResult decodeUpdatePlayerStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateUserDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") + static FClientUpdateUserDataResult decodeUpdateUserDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Player Item Management + ////////////////////////////////////////////////////// + + /** Decode the ModifyUserVirtualCurrencyResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientModifyUserVirtualCurrencyResult decodeModifyUserVirtualCurrencyResultResponse(UPlayFabJsonObject* response); + + /** Decode the ConfirmPurchaseResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientConfirmPurchaseResult decodeConfirmPurchaseResultResponse(UPlayFabJsonObject* response); + + /** Decode the ConsumeItemResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientConsumeItemResult decodeConsumeItemResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCharacterInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientGetCharacterInventoryResult decodeGetCharacterInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPaymentTokenResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientGetPaymentTokenResult decodeGetPaymentTokenResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPurchaseResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientGetPurchaseResult decodeGetPurchaseResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientGetUserInventoryResult decodeGetUserInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the PayForPurchaseResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientPayForPurchaseResult decodePayForPurchaseResultResponse(UPlayFabJsonObject* response); + + /** Decode the PurchaseItemResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientPurchaseItemResult decodePurchaseItemResultResponse(UPlayFabJsonObject* response); + + /** Decode the RedeemCouponResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientRedeemCouponResult decodeRedeemCouponResultResponse(UPlayFabJsonObject* response); + + /** Decode the StartPurchaseResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientStartPurchaseResult decodeStartPurchaseResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlockContainerItemResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") + static FClientUnlockContainerItemResult decodeUnlockContainerItemResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // PlayStream + ////////////////////////////////////////////////////// + + /** Decode the GetPlayerSegmentsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream Models") + static FClientGetPlayerSegmentsResult decodeGetPlayerSegmentsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerTagsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream Models") + static FClientGetPlayerTagsResult decodeGetPlayerTagsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + + /** Decode the ExecuteCloudScriptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Server-Side Cloud Script Models") + static FClientExecuteCloudScriptResult decodeExecuteCloudScriptResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Shared Group Data + ////////////////////////////////////////////////////// + + /** Decode the AddSharedGroupMembersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") + static FClientAddSharedGroupMembersResult decodeAddSharedGroupMembersResultResponse(UPlayFabJsonObject* response); + + /** Decode the CreateSharedGroupResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") + static FClientCreateSharedGroupResult decodeCreateSharedGroupResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetSharedGroupDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") + static FClientGetSharedGroupDataResult decodeGetSharedGroupDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemoveSharedGroupMembersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") + static FClientRemoveSharedGroupMembersResult decodeRemoveSharedGroupMembersResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateSharedGroupDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") + static FClientUpdateSharedGroupDataResult decodeUpdateSharedGroupDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Title-Wide Data Management + ////////////////////////////////////////////////////// + + /** Decode the GetCatalogItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") + static FClientGetCatalogItemsResult decodeGetCatalogItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPublisherDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") + static FClientGetPublisherDataResult decodeGetPublisherDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetStoreItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") + static FClientGetStoreItemsResult decodeGetStoreItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTimeResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") + static FClientGetTimeResult decodeGetTimeResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTitleDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") + static FClientGetTitleDataResult decodeGetTitleDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTitleNewsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") + static FClientGetTitleNewsResult decodeGetTitleNewsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Trading + ////////////////////////////////////////////////////// + + /** Decode the AcceptTradeResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") + static FClientAcceptTradeResponse decodeAcceptTradeResponseResponse(UPlayFabJsonObject* response); + + /** Decode the CancelTradeResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") + static FClientCancelTradeResponse decodeCancelTradeResponseResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerTradesResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") + static FClientGetPlayerTradesResponse decodeGetPlayerTradesResponseResponse(UPlayFabJsonObject* response); + + /** Decode the GetTradeStatusResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") + static FClientGetTradeStatusResponse decodeGetTradeStatusResponseResponse(UPlayFabJsonObject* response); + + /** Decode the OpenTradeResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") + static FClientOpenTradeResponse decodeOpenTradeResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabClientModels.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabClientModels.h new file mode 100644 index 000000000..ce42f3d99 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabClientModels.h @@ -0,0 +1,3752 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Client +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabClientModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Client API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAddGenericIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Generic service identifier to add to the player account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* GenericId = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientAddGenericIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientAddOrUpdateContactEmailRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The new contact email to associate with the player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString EmailAddress; +}; + +USTRUCT(BlueprintType) +struct FClientAddOrUpdateContactEmailResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientAddUsernamePasswordRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** User email address attached to their account */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Email; + /** Password for the PlayFab account (6-100 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Password; + /** PlayFab username for the account (3-20 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FClientAddUsernamePasswordResult +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab unique user name. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FClientGetAccountInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** User email address for the account to find (if no Username is specified). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Email; + /** + * Unique PlayFab identifier of the user whose info is being requested. Optional, defaults to the authenticated user if no + * other lookup identifier set. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString PlayFabId; + /** + * Title-specific username for the account to find (if no Email is set). Note that if the non-unique Title Display Names + * option is enabled for the title, attempts to look up users by Title Display Name will always return AccountNotFound. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString TitleDisplayName; + /** PlayFab Username for the account to find (if no PlayFabId is specified). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FClientGetAccountInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Account information for the local user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* AccountInfo = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerCombinedInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** PlayFabId of the user whose data will be returned. If not filled included, we return the data for the calling player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerCombinedInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Results for requested info. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* InfoResultPayload = nullptr; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerProfileRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerProfileResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The profile of the player. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* PlayerProfile = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromFacebookIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString FacebookIDs; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromFacebookIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Facebook identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromFacebookInstantGamesIdsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Facebook Instant Games identifiers for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString FacebookInstantGamesIds; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromFacebookInstantGamesIdsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Facebook Instant Games identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromGameCenterIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Game Center identifiers (the Player Identifier) for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString GameCenterIDs; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromGameCenterIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Game Center identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromGenericIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Array of unique generic service identifiers for which the title needs to get PlayFab identifiers. Currently limited to a + * maximum of 10 in a single request. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray GenericIDs; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromGenericIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of generic service identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromGoogleIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Google identifiers (Google+ user IDs) for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString GoogleIDs; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromGoogleIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Google identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromKongregateIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Kongregate identifiers (Kongregate's user_id) for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString KongregateIDs; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromKongregateIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Kongregate identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Nintendo Switch Device identifiers for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString NintendoSwitchDeviceIds; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Nintendo Switch Device identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromSteamIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString SteamStringIDs; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromSteamIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Steam identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromTwitchIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Twitch identifiers (Twitch's _id) for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString TwitchIds; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayFabIDsFromTwitchIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Twitch identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FClientLinkAndroidDeviceIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Specific model of the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString AndroidDevice; + /** Android device identifier for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString AndroidDeviceId; + /** If another user is already linked to the device, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** Specific Operating System version for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString OS; +}; + +USTRUCT(BlueprintType) +struct FClientLinkAndroidDeviceIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkCustomIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom unique identifier for the user, generated by the title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString CustomId; + /** If another user is already linked to the custom ID, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; +}; + +USTRUCT(BlueprintType) +struct FClientLinkCustomIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkFacebookAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier from Facebook for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString AccessToken; + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; +}; + +USTRUCT(BlueprintType) +struct FClientLinkFacebookAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkFacebookInstantGamesIdRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Facebook Instant Games signature for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString FacebookInstantGamesSignature; + /** If another user is already linked to the Facebook Instant Games ID, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; +}; + +USTRUCT(BlueprintType) +struct FClientLinkFacebookInstantGamesIdResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkGameCenterAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** Game Center identifier for the player account to be linked. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString GameCenterId; +}; + +USTRUCT(BlueprintType) +struct FClientLinkGameCenterAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkGoogleAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** + * Server authentication code obtained on the client by calling getServerAuthCode() + * (https://developers.google.com/identity/sign-in/android/offline-access) from Google Play for the user. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString ServerAuthCode; +}; + +USTRUCT(BlueprintType) +struct FClientLinkGoogleAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkIOSDeviceIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Vendor-specific iOS identifier for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString DeviceId; + /** Specific model of the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString DeviceModel; + /** If another user is already linked to the device, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** Specific Operating System version for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString OS; +}; + +USTRUCT(BlueprintType) +struct FClientLinkIOSDeviceIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkKongregateAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Valid session auth ticket issued by Kongregate */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString AuthTicket; + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** Numeric user ID assigned by Kongregate */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString KongregateId; +}; + +USTRUCT(BlueprintType) +struct FClientLinkKongregateAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkNintendoSwitchDeviceIdRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If another user is already linked to the Nintendo Switch Device ID, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** Nintendo Switch unique identifier for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString NintendoSwitchDeviceId; +}; + +USTRUCT(BlueprintType) +struct FClientLinkNintendoSwitchDeviceIdResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkSteamAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** + * Authentication token for the user, returned as a byte array from Steam, and converted to a string (for example, the byte + * 0x08 should become "08"). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString SteamTicket; +}; + +USTRUCT(BlueprintType) +struct FClientLinkSteamAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkTwitchAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Valid token issued by Twitch */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString AccessToken; + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; +}; + +USTRUCT(BlueprintType) +struct FClientLinkTwitchAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkWindowsHelloAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Device name. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString DeviceName; + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** PublicKey generated by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString PublicKey; + /** Player's user named used by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString UserName; +}; + +USTRUCT(BlueprintType) +struct FClientLinkWindowsHelloAccountResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientLinkXboxAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If another user is already linked to the account, unlink the other user and re-link. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + bool ForceLink = false; + /** Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientLinkXboxAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientRemoveContactEmailRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientRemoveContactEmailResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientRemoveGenericIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Generic service identifier to be removed from the player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + UPlayFabJsonObject* GenericId = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientRemoveGenericIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientReportPlayerClientRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional additional comment by reporting player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Comment; + /** Unique PlayFab identifier of the reported player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString ReporteeId; +}; + +USTRUCT(BlueprintType) +struct FClientReportPlayerClientResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The number of remaining reports which may be filed today. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + int32 SubmissionsRemaining = 0; +}; + +USTRUCT(BlueprintType) +struct FClientSendAccountRecoveryEmailRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** User email address attached to their account */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString Email; + /** The email template id of the account recovery email template to send. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString EmailTemplateId; +}; + +USTRUCT(BlueprintType) +struct FClientSendAccountRecoveryEmailResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkAndroidDeviceIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Android device identifier for the user's device. If not specified, the most recently signed in Android Device ID will be + * used. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString AndroidDeviceId; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkAndroidDeviceIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkCustomIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Custom unique identifier for the user, generated by the title. If not specified, the most recently signed in Custom ID + * will be used. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString CustomId; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkCustomIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkFacebookAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkFacebookAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkFacebookInstantGamesIdRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Facebook Instant Games identifier for the user. If not specified, the most recently signed in ID will be used. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString FacebookInstantGamesId; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkFacebookInstantGamesIdResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkGameCenterAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkGameCenterAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkGoogleAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkGoogleAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkIOSDeviceIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Vendor-specific iOS identifier for the user's device. If not specified, the most recently signed in iOS Device ID will + * be used. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString DeviceId; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkIOSDeviceIDResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkKongregateAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkKongregateAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkNintendoSwitchDeviceIdRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Nintendo Switch Device identifier for the user. If not specified, the most recently signed in device ID will be used. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString NintendoSwitchDeviceId; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkNintendoSwitchDeviceIdResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkSteamAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkSteamAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkTwitchAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkTwitchAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkWindowsHelloAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** SHA256 hash of the PublicKey generated by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString PublicKeyHint; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkWindowsHelloAccountResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkXboxAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientUnlinkXboxAccountResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientEmptyResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUpdateAvatarUrlRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** URL of the avatar image. If empty, it removes the existing avatar URL. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString ImageUrl; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateUserTitleDisplayNameRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** New title display name for the user - must be between 3 and 25 characters. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString DisplayName; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateUserTitleDisplayNameResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Current title display name for the user (this will be the original display name if the rename attempt failed). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Account Management Models") + FString DisplayName; +}; + + +/////////////////////////////////////////////////////// +// Advertising +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAttributeInstallRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The adid for this device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Advertising Models") + FString Adid; + /** The IdentifierForAdvertisers for iOS Devices. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Advertising Models") + FString Idfa; +}; + +USTRUCT(BlueprintType) +struct FClientAttributeInstallResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Analytics +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientDeviceInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Information posted to the PlayStream Event. Currently arbitrary, and specific to the environment sending it. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + UPlayFabJsonObject* Info = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientWriteClientCharacterEventRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom event properties. Each property consists of a name (string) and a value (JSON object). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + UPlayFabJsonObject* Body = nullptr; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString CharacterId; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString EventName; + /** The time (in UTC) associated with this event. The value dafaults to the current time. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString Timestamp; +}; + +USTRUCT(BlueprintType) +struct FClientWriteEventResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to + * any particular format. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString EventId; +}; + +USTRUCT(BlueprintType) +struct FClientWriteClientPlayerEventRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom data properties associated with the event. Each property consists of a name (string) and a value (JSON object). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + UPlayFabJsonObject* Body = nullptr; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString EventName; + /** The time (in UTC) associated with this event. The value dafaults to the current time. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString Timestamp; +}; + +USTRUCT(BlueprintType) +struct FClientWriteTitleEventRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom event properties. Each property consists of a name (string) and a value (JSON object). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + UPlayFabJsonObject* Body = nullptr; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString EventName; + /** The time (in UTC) associated with this event. The value dafaults to the current time. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Analytics Models") + FString Timestamp; +}; + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientGetPhotonAuthenticationTokenRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The Photon applicationId for the game you wish to log into. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PhotonApplicationId; +}; + +USTRUCT(BlueprintType) +struct FClientGetPhotonAuthenticationTokenResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The Photon authentication token for this game-session. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PhotonCustomAuthenticationToken; +}; + +USTRUCT(BlueprintType) +struct FClientGetTitlePublicKeyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The shared secret key for this title */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString TitleSharedSecret; +}; + +USTRUCT(BlueprintType) +struct FClientGetTitlePublicKeyResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Base64 encoded RSA CSP byte array blob containing the title's public RSA key */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString RSAPublicKey; +}; + +USTRUCT(BlueprintType) +struct FClientGetWindowsHelloChallengeRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** SHA256 hash of the PublicKey generated by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PublicKeyHint; +}; + +USTRUCT(BlueprintType) +struct FClientGetWindowsHelloChallengeResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Server generated challenge to be signed by the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Challenge; +}; + +USTRUCT(BlueprintType) +struct FClientLoginResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * If LoginTitlePlayerAccountEntity flag is set on the login request the title_player_account will also be logged in and + * returned. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* EntityToken = nullptr; + /** Results for requested info. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoResultPayload = nullptr; + /** The time of this user's previous login. If there was no previous login, then it's DateTime.MinValue */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString LastLoginTime; + /** True if the account was newly created on this login. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool NewlyCreated = false; + /** Player's unique PlayFabId. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayFabId; + /** Unique token authorizing the user and game at the server level, for the current session. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString SessionTicket; + /** Settings specific to this user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* SettingsForUser = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithAndroidDeviceIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Specific model of the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString AndroidDevice; + /** Android device identifier for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString AndroidDeviceId; + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Specific Operating System version for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString OS; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithCustomIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Custom unique identifier for the user, generated by the title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString CustomId; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithEmailAddressRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Email address for the account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Email; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Password for the PlayFab account (6-100 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Password; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithFacebookRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier from Facebook for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString AccessToken; + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithFacebookInstantGamesIdRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Facebook Instant Games signature for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString FacebookInstantGamesSignature; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithGameCenterRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Unique Game Center player id. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerId; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithGoogleAccountRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; + /** + * OAuth 2.0 server authentication code obtained on the client by calling the getServerAuthCode() + * (https://developers.google.com/identity/sign-in/android/offline-access) Google client API. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString ServerAuthCode; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithIOSDeviceIDRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Vendor-specific iOS identifier for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString DeviceId; + /** Specific model of the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString DeviceModel; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Specific Operating System version for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString OS; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithKongregateRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Token issued by Kongregate's client API for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString AuthTicket; + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Numeric user ID assigned by Kongregate */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString KongregateId; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithNintendoSwitchDeviceIdRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Nintendo Switch unique identifier for the user's device. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString NintendoSwitchDeviceId; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithPlayFabRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Password for the PlayFab account (6-100 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Password; + /** PlayFab username for the account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithSteamRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; + /** + * Authentication token for the user, returned as a byte array from Steam, and converted to a string (for example, the byte + * 0x08 should become "08"). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString SteamTicket; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithTwitchRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Token issued by Twitch's API for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString AccessToken; + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithWindowsHelloRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The signed response from the user for the Challenge. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString ChallengeSignature; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** SHA256 hash of the PublicKey generated by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PublicKeyHint; +}; + +USTRUCT(BlueprintType) +struct FClientLoginWithXboxRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Automatically create a PlayFab account if one is not currently linked to this ID. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool CreateAccount = false; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; + /** Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientRegisterPlayFabUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** An optional parameter for setting the display name for this title (3-25 characters). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString DisplayName; + /** User email address attached to their account */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Email; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Password for the PlayFab account (6-100 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Password; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; + /** + * An optional parameter that specifies whether both the username and email parameters are required. If true, both + * parameters are required; if false, the user must supply either the username or email parameter. The default value is + * true. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool RequireBothUsernameAndEmail = false; + /** PlayFab username for the account (3-20 characters) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FClientRegisterPlayFabUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * If LoginTitlePlayerAccountEntity flag is set on the login request the title_player_account will also be logged in and + * returned. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* EntityToken = nullptr; + /** PlayFab unique identifier for this newly created account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayFabId; + /** Unique token identifying the user and game at the server level, for the current session. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString SessionTicket; + /** Settings specific to this user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* SettingsForUser = nullptr; + /** PlayFab unique user name. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FClientRegisterWithWindowsHelloRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Device name. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString DeviceName; + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + bool LoginTitlePlayerAccountEntity = false; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; + /** PublicKey generated by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PublicKey; + /** Player's user name used by Windows Hello. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString UserName; +}; + +USTRUCT(BlueprintType) +struct FClientSetPlayerSecretRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString EncryptedRequest; + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Authentication Models") + FString PlayerSecret; +}; + +USTRUCT(BlueprintType) +struct FClientSetPlayerSecretResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Character Data +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientGetCharacterDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + FString CharacterId; + /** + * The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + int32 IfChangedFromDataVersion = 0; + /** Specific keys to search for in the custom user data. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + FString Keys; + /** Unique PlayFab identifier of the user to load data for. Optional, defaults to yourself if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + FString CharacterId; + /** User specific data for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + UPlayFabJsonObject* Data = nullptr; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + int32 DataVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateCharacterDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + FString CharacterId; + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + FString KeysToRemove; + /** Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + EUserDataPermission Permission; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateCharacterDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Character Data Models") + int32 DataVersion = 0; +}; + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientListUsersCharactersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientListUsersCharactersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list of characters. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + TArray Characters; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterLeaderboardRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional character type on which to filter the leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterType; + /** Maximum number of entries to retrieve. Default 10, maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + int32 MaxResultsCount = 0; + /** First entry in the leaderboard to be retrieved. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + int32 StartPosition = 0; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterLeaderboardResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered list of leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + TArray Leaderboard; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterId; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested character statistics. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + UPlayFabJsonObject* CharacterStatistics; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardAroundCharacterRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character on which to center the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterId; + /** Optional character type on which to filter the leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterType; + /** Maximum number of entries to retrieve. Default 10, maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + int32 MaxResultsCount = 0; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardAroundCharacterResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered list of leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + TArray Leaderboard; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardForUsersCharactersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + int32 MaxResultsCount = 0; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardForUsersCharactersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered list of leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + TArray Leaderboard; +}; + +USTRUCT(BlueprintType) +struct FClientGrantCharacterToUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version from which items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CatalogVersion; + /** Non-unique display name of the character being granted (1-20 characters in length). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterName; + /** + * Catalog item identifier of the item in the user's inventory that corresponds to the character in the catalog to be + * created. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString ItemId; +}; + +USTRUCT(BlueprintType) +struct FClientGrantCharacterToUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier tagged to this character. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterId; + /** Type of character that was created. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterType; + /** Indicates whether this character was created successfully. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + bool Result = false; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateCharacterStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + FString CharacterId; + /** Statistics to be updated with the provided values. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Characters Models") + UPlayFabJsonObject* CharacterStatistics; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateCharacterStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientGetContentDownloadUrlRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** HTTP method to fetch item - GET or HEAD. Use HEAD when only fetching metadata. Default is GET. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Content Models") + FString HttpMethod; + /** Key of the content item to fetch, usually formatted as a path, e.g. images/a.png */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Content Models") + FString Key; + /** + * True to download through CDN. CDN provides higher download bandwidth and lower latency. However, if you want the latest, + * non-cached version of the content during development, set this to false. Default is true. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Content Models") + bool ThruCDN = false; +}; + +USTRUCT(BlueprintType) +struct FClientGetContentDownloadUrlResult +{ + GENERATED_USTRUCT_BODY() +public: + /** URL for downloading content via HTTP GET or HEAD method. The URL will expire in approximately one hour. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Content Models") + FString URL; +}; + + +/////////////////////////////////////////////////////// +// Friend List Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAddFriendRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Email address of the user to attempt to add to the local user's friend list. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString FriendEmail; + /** PlayFab identifier of the user to attempt to add to the local user's friend list. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString FriendPlayFabId; + /** Title-specific display name of the user to attempt to add to the local user's friend list. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString FriendTitleDisplayName; + /** PlayFab username of the user to attempt to add to the local user's friend list. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString FriendUsername; +}; + +USTRUCT(BlueprintType) +struct FClientAddFriendResult +{ + GENERATED_USTRUCT_BODY() +public: + /** True if the friend request was processed successfully. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + bool Created = false; +}; + +USTRUCT(BlueprintType) +struct FClientGetFriendsListRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Indicates whether Facebook friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + bool IncludeFacebookFriends = false; + /** Indicates whether Steam service friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + bool IncludeSteamFriends = false; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientGetFriendsListResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of friends found. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + TArray Friends; +}; + +USTRUCT(BlueprintType) +struct FClientRemoveFriendRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab identifier of the friend account which is to be removed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString FriendPlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientRemoveFriendResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientSetFriendTagsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab identifier of the friend account to which the tag(s) should be applied. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString FriendPlayFabId; + /** Array of tags to set on the friend account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Friend List Management Models") + FString Tags; +}; + +USTRUCT(BlueprintType) +struct FClientSetFriendTagsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientCurrentGamesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Build to match against. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString BuildVersion; + /** Game mode to look for. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString GameMode; + /** Region to check for Game Server Instances. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + ERegion Region; + /** Statistic name to find statistic-based matches. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString StatisticName; + /** Filter to include and/or exclude Game Server Instances associated with certain tags. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + UPlayFabJsonObject* TagFilter = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientCurrentGamesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** number of games running */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + int32 GameCount = 0; + /** array of games found */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + TArray Games; + /** total number of players across all servers */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + int32 PlayerCount = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGameServerRegionsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** version of game server for which stats are being requested */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString BuildVersion; +}; + +USTRUCT(BlueprintType) +struct FClientGameServerRegionsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of regions found matching the request parameters */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + TArray Regions; +}; + +USTRUCT(BlueprintType) +struct FClientMatchmakeRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Build version to match against. [Note: Required if LobbyId is not specified] */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString BuildVersion; + /** Character to use for stats based matching. Leave null to use account stats. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString CharacterId; + /** Game mode to match make against. [Note: Required if LobbyId is not specified] */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString GameMode; + /** Lobby identifier to match make against. This is used to select a specific Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString LobbyId; + /** Region to match make against. [Note: Required if LobbyId is not specified] */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + ERegion Region; + /** Start a game session if one with an open slot is not found. Defaults to true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + bool StartNewIfNoneFound = false; + /** Player statistic to use in finding a match. May be null for no stat-based matching. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString StatisticName; + /** Filter to include and/or exclude Game Server Instances associated with certain Tags */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + UPlayFabJsonObject* TagFilter = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientMatchmakeResult +{ + GENERATED_USTRUCT_BODY() +public: + /** timestamp for when the server will expire, if applicable */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString Expires; + /** unique lobby identifier of the server matched */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString LobbyID; + /** time in milliseconds the application is configured to wait on matchmaking results */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + int32 PollWaitTimeMS = 0; + /** IPV4 address of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerHostname; + /** IPV4 address of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerIPV4Address; + /** IPV6 address of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerIPV6Address; + /** port number to use for non-http communications with the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + int32 ServerPort = 0; + /** Public DNS name (if any) of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerPublicDNSName; + /** result of match making process */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + EMatchmakeStatus Status; + /** server authorization ticket (used by RedeemMatchmakerTicket to validate user insertion into the game) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString Ticket; +}; + +USTRUCT(BlueprintType) +struct FClientStartGameRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** version information for the build of the game server which is to be started */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString BuildVersion; + /** character to use for stats based matching. Leave null to use account stats */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString CharacterId; + /** custom command line argument when starting game server process */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString CustomCommandLineData; + /** the title-defined game mode this server is to be running (defaults to 0 if there is only one mode) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString GameMode; + /** the region to associate this server with for match filtering */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + ERegion Region; + /** player statistic for others to use in finding this game. May be null for no stat-based matching */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FClientStartGameResult +{ + GENERATED_USTRUCT_BODY() +public: + /** timestamp for when the server should expire, if applicable */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString Expires; + /** unique identifier for the lobby of the server started */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString LobbyID; + /** password required to log into the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString Password; + /** server IPV4 address */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerHostname; + /** server IPV4 address */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerIPV4Address; + /** server IPV6 address */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerIPV6Address; + /** port on the server to be used for communication */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + int32 ServerPort = 0; + /** server public DNS name */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString ServerPublicDNSName; + /** unique identifier for the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Matchmaking Models") + FString Ticket; +}; + + +/////////////////////////////////////////////////////// +// Platform Specific Methods +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAndroidDevicePushNotificationRegistrationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Message to display when confirming push notification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString ConfirmationMessage; + /** + * Registration ID provided by the Google Cloud Messaging service when the title registered to receive push notifications + * (see the GCM documentation, here: http://developer.android.com/google/gcm/client.html). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString DeviceToken; + /** If true, send a test push message immediately after sucessful registration. Defaults to false. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + bool SendPushNotificationConfirmation = false; +}; + +USTRUCT(BlueprintType) +struct FClientAndroidDevicePushNotificationRegistrationResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientConsumeXboxEntitlementsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version to use */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CatalogVersion; + /** Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientConsumeXboxEntitlementsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Details for the items purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + TArray Items; +}; + +USTRUCT(BlueprintType) +struct FClientRegisterForIOSPushNotificationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Message to display when confirming push notification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString ConfirmationMessage; + /** Unique token generated by the Apple Push Notification service when the title registered to receive push notifications. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString DeviceToken; + /** If true, send a test push message immediately after sucessful registration. Defaults to false. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + bool SendPushNotificationConfirmation = false; +}; + +USTRUCT(BlueprintType) +struct FClientRegisterForIOSPushNotificationResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientRestoreIOSPurchasesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Base64 encoded receipt data, passed back by the App Store as a result of a successful purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString ReceiptData; +}; + +USTRUCT(BlueprintType) +struct FClientRestoreIOSPurchasesResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientValidateAmazonReceiptRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version to use when granting receipt item. If null, defaults to primary catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CatalogVersion; + /** Currency used for the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CurrencyCode; + /** Amount of the stated currency paid for the object. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + int32 PurchasePrice = 0; + /** ReceiptId returned by the Amazon App Store in-app purchase API */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString ReceiptId; + /** AmazonId of the user making the purchase as returned by the Amazon App Store in-app purchase API */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString UserId; +}; + +USTRUCT(BlueprintType) +struct FClientValidateAmazonReceiptResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientValidateGooglePlayPurchaseRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Currency used for the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CurrencyCode; + /** Amount of the stated currency paid for the object. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + int32 PurchasePrice = 0; + /** Original JSON string returned by the Google Play IAB API. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString ReceiptJson; + /** Signature returned by the Google Play IAB API. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString Signature; +}; + +USTRUCT(BlueprintType) +struct FClientValidateGooglePlayPurchaseResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientValidateIOSReceiptRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Currency used for the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CurrencyCode; + /** Amount of the stated currency paid for the object. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + int32 PurchasePrice = 0; + /** Base64 encoded receipt data, passed back by the App Store as a result of a successful purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString ReceiptData; +}; + +USTRUCT(BlueprintType) +struct FClientValidateIOSReceiptResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientValidateWindowsReceiptRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version to use when granting receipt item. If null, defaults to primary catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CatalogVersion; + /** Currency used for the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString CurrencyCode; + /** Amount of the stated currency paid for the object. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + int32 PurchasePrice = 0; + /** XML Receipt returned by the Windows App Store in-app purchase API */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Platform Specific Methods Models") + FString Receipt; +}; + +USTRUCT(BlueprintType) +struct FClientValidateWindowsReceiptResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientGetFriendLeaderboardRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Indicates whether Facebook friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool IncludeFacebookFriends = false; + /** Indicates whether Steam service friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool IncludeSteamFriends = false; + /** Maximum number of entries to retrieve. Default 10, maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 MaxResultsCount = 0; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Position in the leaderboard to start this listing (defaults to the first entry). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 StartPosition = 0; + /** Statistic used to rank friends for this leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; + /** Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered listing of users and their positions in the requested leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray Leaderboard; + /** The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString NextReset; + /** The version of the leaderboard returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetFriendLeaderboardAroundPlayerRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Indicates whether Facebook friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool IncludeFacebookFriends = false; + /** Indicates whether Steam service friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool IncludeSteamFriends = false; + /** Maximum number of entries to retrieve. Default 10, maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 MaxResultsCount = 0; + /** PlayFab unique identifier of the user to center the leaderboard around. If null will center on the logged in user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Statistic used to rank players for this leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; + /** Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FClientGetFriendLeaderboardAroundPlayerResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered listing of users and their positions in the requested leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray Leaderboard; + /** The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString NextReset; + /** The version of the leaderboard returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Maximum number of entries to retrieve. Default 10, maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 MaxResultsCount = 0; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Position in the leaderboard to start this listing (defaults to the first entry). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 StartPosition = 0; + /** Statistic used to rank players for this leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardAroundPlayerRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Maximum number of entries to retrieve. Default 10, maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 MaxResultsCount = 0; + /** PlayFab unique identifier of the user to center the leaderboard around. If null will center on the logged in user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Statistic used to rank players for this leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetLeaderboardAroundPlayerResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered listing of users and their positions in the requested leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray Leaderboard; + /** The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString NextReset; + /** The version of the leaderboard returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** statistics to return (current version will be returned for each) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString StatisticNames; + /** + * statistics to return, if StatisticNames is not set (only statistics which have a version matching that provided will be + * returned) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray StatisticNameVersions; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** User statistics for the requested user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray Statistics; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerStatisticVersionsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique name of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerStatisticVersionsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** version change history of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray StatisticVersions; +}; + +USTRUCT(BlueprintType) +struct FClientGetUserDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 IfChangedFromDataVersion = 0; + /** List of unique keys to load from. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString Keys; + /** + * Unique PlayFab identifier of the user to load data for. Optional, defaults to yourself if not set. When specified to a + * PlayFab id of another player, then this will only return public keys for that account. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientGetUserDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** User specific data for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + UPlayFabJsonObject* Data = nullptr; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 DataVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FClientUpdatePlayerStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Statistics to be updated with the provided values */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + TArray Statistics; +}; + +USTRUCT(BlueprintType) +struct FClientUpdatePlayerStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUpdateUserDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + FString KeysToRemove; + /** + * Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. This is used + * for requests by one player for information about another player; those requests will only return Public keys. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + EUserDataPermission Permission; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateUserDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Data Management Models") + int32 DataVersion = 0; +}; + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAddUserVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Amount to be added to the user balance of the specified virtual currency. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 Amount = 0; + /** Name of the virtual currency which is to be incremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FClientModifyUserVirtualCurrencyResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Balance of the virtual currency after modification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 Balance = 0; + /** + * Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase + * over this value will be discarded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 BalanceChange = 0; + /** User currency was subtracted from. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which was modified. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FClientConfirmPurchaseRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Purchase order identifier returned from StartPurchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; +}; + +USTRUCT(BlueprintType) +struct FClientConfirmPurchaseResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray Items; + /** Purchase order identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; + /** Date and time of the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString PurchaseDate; +}; + +USTRUCT(BlueprintType) +struct FClientConsumeItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; + /** Number of uses to consume from the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 ConsumeCount = 0; + /** Unique instance identifier of the item to be consumed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ItemInstanceId; +}; + +USTRUCT(BlueprintType) +struct FClientConsumeItemResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique instance identifier of the item with uses consumed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ItemInstanceId; + /** Number of uses remaining on the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 RemainingUses = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterInventoryRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Used to limit results to only those from a specific catalog version. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; +}; + +USTRUCT(BlueprintType) +struct FClientGetCharacterInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the character for this inventory. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; + /** Array of inventory items belonging to the character. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray Inventory; + /** Array of virtual currency balance(s) belonging to the character. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; + /** Array of remaining times and timestamps for virtual currencies. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrencyRechargeTimes = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientGetPaymentTokenRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The name of service to provide the payment token. Allowed Values are: xsolla */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString TokenProvider; +}; + +USTRUCT(BlueprintType) +struct FClientGetPaymentTokenResult +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab's purchase order identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; + /** The token from provider. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ProviderToken; +}; + +USTRUCT(BlueprintType) +struct FClientGetPurchaseRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Purchase order identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; +}; + +USTRUCT(BlueprintType) +struct FClientGetPurchaseResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Purchase order identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; + /** Payment provider used for transaction (If not VC) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString PaymentProvider; + /** Date and time of the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString PurchaseDate; + /** Provider transaction ID (If not VC) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString TransactionId; + /** PlayFab transaction status */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString TransactionStatus; +}; + +USTRUCT(BlueprintType) +struct FClientGetUserInventoryRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientGetUserInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of inventory items belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray Inventory; + /** Array of virtual currency balance(s) belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; + /** Array of remaining times and timestamps for virtual currencies. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrencyRechargeTimes = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientPayForPurchaseRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Currency to use to fund the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString Currency; + /** Purchase order identifier returned from StartPurchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; + /** Payment provider to use to fund the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ProviderName; + /** Payment provider transaction identifier. Required for Facebook Payments. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ProviderTransactionId; +}; + +USTRUCT(BlueprintType) +struct FClientPayForPurchaseResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Local credit applied to the transaction (provider specific). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 CreditApplied = 0; + /** Purchase order identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; + /** Provider used for the transaction. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ProviderData; + /** A token generated by the provider to authenticate the request (provider-specific). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ProviderToken; + /** URL to the purchase provider page that details the purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString PurchaseConfirmationPageURL; + /** Currency for the transaction, may be a virtual currency or real money. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString PurchaseCurrency; + /** Cost of the transaction. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 PurchasePrice = 0; + /** Status of the transaction. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + ETransactionStatus Status; + /** Virtual currencies granted by the transaction, if any. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VCAmount; + /** Current virtual currency balances for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FClientPurchaseItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version for the items to be purchased (defaults to most recent version. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; + /** Unique identifier of the item to purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ItemId; + /** Price the client expects to pay for the item (in case a new catalog or store was uploaded, with new prices). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 Price = 0; + /** Store to buy this item through. If not set, prices default to those in the catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString StoreId; + /** Virtual currency to use to purchase the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FClientPurchaseItemResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Details for the items purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray Items; +}; + +USTRUCT(BlueprintType) +struct FClientRedeemCouponRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version of the coupon. If null, uses the default catalog */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CatalogVersion; + /** Optional identifier for the Character that should receive the item. If null, item is added to the player */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; + /** Generated coupon code to redeem. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CouponCode; +}; + +USTRUCT(BlueprintType) +struct FClientRedeemCouponResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Items granted to the player as a result of redeeming the coupon. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray GrantedItems; +}; + +USTRUCT(BlueprintType) +struct FClientStartPurchaseRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version for the items to be purchased. Defaults to most recent catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CatalogVersion; + /** Array of items to purchase. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray Items; + /** Store through which to purchase items. If not set, prices will be pulled from the catalog itself. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FClientStartPurchaseResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Cart items to be purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray Contents; + /** Purchase order identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString OrderId; + /** Available methods by which the user can pay. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray PaymentOptions; + /** Current virtual currency totals for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrencyBalances; +}; + +USTRUCT(BlueprintType) +struct FClientSubtractUserVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Amount to be subtracted from the user balance of the specified virtual currency. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + int32 Amount = 0; + /** Name of the virtual currency which is to be decremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FClientUnlockContainerInstanceRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Specifies the catalog version that should be used to determine container contents. If unspecified, uses catalog + * associated with the item instance. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; + /** ItemInstanceId of the container to unlock. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ContainerItemInstanceId; + /** + * ItemInstanceId of the key that will be consumed by unlocking this container. If the container requires a key, this + * parameter is required. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString KeyItemInstanceId; +}; + +USTRUCT(BlueprintType) +struct FClientUnlockContainerItemResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Items granted to the player as a result of unlocking the container. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + TArray GrantedItems; + /** Unique instance identifier of the container unlocked. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString UnlockedItemInstanceId; + /** Unique instance identifier of the key used to unlock the container, if applicable. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString UnlockedWithItemInstanceId; + /** Virtual currency granted to the player as a result of unlocking the container. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FClientUnlockContainerItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Specifies the catalog version that should be used to determine container contents. If unspecified, uses default/primary + * catalog. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString CharacterId; + /** Catalog ItemId of the container type to unlock. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Player Item Management Models") + FString ContainerItemId; +}; + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientGetPlayerSegmentsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerSegmentsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of segments the requested player currently belongs to. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | PlayStream Models") + TArray Segments; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerTagsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional namespace to filter results by */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | PlayStream Models") + FString Namespace; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | PlayStream Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerTagsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | PlayStream Models") + FString PlayFabId; + /** Canonical tags (including namespace and tag's name) for the requested user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | PlayStream Models") + FString Tags; +}; + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientExecuteCloudScriptRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The name of the CloudScript function to execute */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + FString FunctionName; + /** Object that is passed in to the function as the first argument */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + UPlayFabJsonObject* FunctionParameter = nullptr; + /** + * Generate a 'player_executed_cloudscript' PlayStream event containing the results of the function execution and other + * contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + bool GeneratePlayStreamEvent = false; + /** + * Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' + * executes the current live, published revision, and 'Specific' executes the specified revision. The default value is + * 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + ECloudScriptRevisionOption RevisionSelection; + /** The specivic revision to execute, when RevisionSelection is set to 'Specific' */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 SpecificRevision = 0; +}; + +USTRUCT(BlueprintType) +struct FClientExecuteCloudScriptResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Number of PlayFab API requests issued by the CloudScript function */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 APIRequestsIssued = 0; + /** Information about the error, if any, that occurred during execution */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + UPlayFabJsonObject* Error = nullptr; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 ExecutionTimeSeconds = 0; + /** The name of the function that executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + FString FunctionName; + /** The object returned from the CloudScript function, if any */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + UPlayFabJsonObject* FunctionResult = nullptr; + /** + * Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + bool FunctionResultTooLarge = false; + /** Number of external HTTP requests issued by the CloudScript function */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 HttpRequestsIssued = 0; + /** + * Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + TArray Logs; + /** + * Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + bool LogsTooLarge = false; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 MemoryConsumedBytes = 0; + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 ProcessorTimeSeconds = 0; + /** The revision of the CloudScript that executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Server-Side Cloud Script Models") + int32 Revision = 0; +}; + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAddSharedGroupMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** An array of unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString PlayFabIds; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FClientAddSharedGroupMembersResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientCreateSharedGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the shared group (a random identifier will be assigned, if one is not specified). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FClientCreateSharedGroupResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FClientGetSharedGroupDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If true, return the list of all members of the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + bool GetMembers = false; + /** + * Specific keys to retrieve from the shared group (if not specified, all keys will be returned, while an empty array + * indicates that no keys should be returned). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString Keys; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FClientGetSharedGroupDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Data for the requested keys. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + UPlayFabJsonObject* Data = nullptr; + /** List of PlayFabId identifiers for the members of this group, if requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString Members; +}; + +USTRUCT(BlueprintType) +struct FClientRemoveSharedGroupMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** An array of unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString PlayFabIds; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FClientRemoveSharedGroupMembersResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientUpdateSharedGroupDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString KeysToRemove; + /** Permission to be applied to all user data keys in this request. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + EUserDataPermission Permission; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FClientUpdateSharedGroupDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientGetCatalogItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Which catalog is being requested. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString CatalogVersion; +}; + +USTRUCT(BlueprintType) +struct FClientGetCatalogItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items which can be purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + TArray Catalog; +}; + +USTRUCT(BlueprintType) +struct FClientGetPublisherDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** array of keys to get back data from the Publisher data blob, set by the admin tools */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString Keys; +}; + +USTRUCT(BlueprintType) +struct FClientGetPublisherDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** a dictionary object of key / value pairs */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + UPlayFabJsonObject* Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetStoreItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** catalog version to store items from. Use default catalog version if null */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString CatalogVersion; + /** Unqiue identifier for the store which is being requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FClientGetStoreItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The base catalog that this store is a part of. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString CatalogVersion; + /** Additional data about the store. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + UPlayFabJsonObject* MarketingData = nullptr; + /** How the store was last updated (Admin or a third party). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + EPfSourceType Source; + /** Array of items which can be purchased from this store. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + TArray Store; + /** The ID of this store. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString StoreId; +}; + +USTRUCT(BlueprintType) +struct FClientGetTimeRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FClientGetTimeResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Current server time when the request was received, in UTC */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString Time; +}; + +USTRUCT(BlueprintType) +struct FClientGetTitleDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Specific keys to search for in the title data (leave null to get all keys) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + FString Keys; +}; + +USTRUCT(BlueprintType) +struct FClientGetTitleDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** a dictionary object of key / value pairs */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + UPlayFabJsonObject* Data; +}; + +USTRUCT(BlueprintType) +struct FClientGetTitleNewsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Limits the results to the last n entries. Defaults to 10 if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + int32 Count = 0; +}; + +USTRUCT(BlueprintType) +struct FClientGetTitleNewsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of news items. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Title-Wide Data Management Models") + TArray News; +}; + + +/////////////////////////////////////////////////////// +// Trading +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FClientAcceptTradeRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Items from the accepting player's inventory in exchange for the offered items in the trade. In the case of a gift, this + * will be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString AcceptedInventoryInstanceIds; + /** Player who opened the trade. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString OfferingPlayerId; + /** Trade identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString TradeId; +}; + +USTRUCT(BlueprintType) +struct FClientAcceptTradeResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Details about trade which was just accepted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + UPlayFabJsonObject* Trade = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientCancelTradeRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Trade identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString TradeId; +}; + +USTRUCT(BlueprintType) +struct FClientCancelTradeResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Details about trade which was just canceled. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + UPlayFabJsonObject* Trade = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerTradesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Returns only trades with the given status. If null, returns all trades. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + ETradeStatus StatusFilter; +}; + +USTRUCT(BlueprintType) +struct FClientGetPlayerTradesResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** History of trades which this player has accepted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + TArray AcceptedTrades; + /** The trades for this player which are currently available to be accepted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + TArray OpenedTrades; +}; + +USTRUCT(BlueprintType) +struct FClientGetTradeStatusRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Player who opened trade. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString OfferingPlayerId; + /** Trade identifier as returned by OpenTradeOffer. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString TradeId; +}; + +USTRUCT(BlueprintType) +struct FClientGetTradeStatusResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Information about the requested trade. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + UPlayFabJsonObject* Trade = nullptr; +}; + +USTRUCT(BlueprintType) +struct FClientOpenTradeRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Players who are allowed to accept the trade. If null, the trade may be accepted by any player. If empty, the trade may + * not be accepted by any player. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString AllowedPlayerIds; + /** Player inventory items offered for trade. If not set, the trade is effectively a gift request */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString OfferedInventoryInstanceIds; + /** Catalog items accepted for the trade. If not set, the trade is effectively a gift. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + FString RequestedCatalogItemIds; +}; + +USTRUCT(BlueprintType) +struct FClientOpenTradeResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The information about the trade that was just opened. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Client | Trading Models") + UPlayFabJsonObject* Trade = nullptr; +}; + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptAPI.h new file mode 100644 index 000000000..7ba1e4349 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptAPI.h @@ -0,0 +1,107 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: CloudScript +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabCloudScriptModels.h" +#include "PlayFabCloudScriptAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabCloudScriptRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabCloudScriptAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabCloudScriptRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab CloudScript API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessExecuteEntityCloudScript, FCloudScriptExecuteCloudScriptResult, result, UObject*, customData); + + /** + * Cloud Script is one of PlayFab's most versatile features. It allows client code to request execution of any kind of + * custom server-side functionality you can implement, and it can be used in conjunction with virtually anything. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | CloudScript | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabCloudScriptAPI* ExecuteEntityCloudScript(FCloudScriptExecuteEntityCloudScriptRequest request, + FDelegateOnSuccessExecuteEntityCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabCloudScriptRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | CloudScript | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperExecuteEntityCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessExecuteEntityCloudScript OnSuccessExecuteEntityCloudScript; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptModelDecoder.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptModelDecoder.h new file mode 100644 index 000000000..813dbee2d --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptModelDecoder.h @@ -0,0 +1,45 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: CloudScript +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabCloudScriptModels.h" +#include "PlayFabCloudScriptModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabCloudScriptModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab CloudScript API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + + /** Decode the ExecuteCloudScriptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + static FCloudScriptExecuteCloudScriptResult decodeExecuteCloudScriptResultResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptModels.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptModels.h new file mode 100644 index 000000000..794687d78 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabCloudScriptModels.h @@ -0,0 +1,115 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: CloudScript +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabCloudScriptModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab CloudScript API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FCloudScriptExecuteCloudScriptResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Number of PlayFab API requests issued by the CloudScript function */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 APIRequestsIssued = 0; + /** Information about the error, if any, that occurred during execution */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + UPlayFabJsonObject* Error = nullptr; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 ExecutionTimeSeconds = 0; + /** The name of the function that executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + FString FunctionName; + /** The object returned from the CloudScript function, if any */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + UPlayFabJsonObject* FunctionResult = nullptr; + /** + * Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + bool FunctionResultTooLarge = false; + /** Number of external HTTP requests issued by the CloudScript function */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 HttpRequestsIssued = 0; + /** + * Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + TArray Logs; + /** + * Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + bool LogsTooLarge = false; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 MemoryConsumedBytes = 0; + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 ProcessorTimeSeconds = 0; + /** The revision of the CloudScript that executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 Revision = 0; +}; + +USTRUCT(BlueprintType) +struct FCloudScriptExecuteEntityCloudScriptRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + UPlayFabJsonObject* Entity = nullptr; + /** The name of the CloudScript function to execute */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + FString FunctionName; + /** Object that is passed in to the function as the first argument */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + UPlayFabJsonObject* FunctionParameter = nullptr; + /** + * Generate a 'entity_executed_cloudscript' PlayStream event containing the results of the function execution and other + * contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + bool GeneratePlayStreamEvent = false; + /** + * Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' + * executes the current live, published revision, and 'Specific' executes the specified revision. The default value is + * 'Specific', if the SpecificRevision parameter is specified, otherwise it is 'Live'. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + ECloudScriptRevisionOption RevisionSelection; + /** The specific revision to execute, when RevisionSelection is set to 'Specific' */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | CloudScript | Server-Side Cloud Script Models") + int32 SpecificRevision = 0; +}; + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabDataAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabDataAPI.h new file mode 100644 index 000000000..cdd178049 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabDataAPI.h @@ -0,0 +1,192 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Data +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabDataModels.h" +#include "PlayFabDataAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabDataRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabDataAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabDataRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Data API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // File + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAbortFileUploads, FDataAbortFileUploadsResponse, result, UObject*, customData); + + /** Abort pending file uploads to an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* AbortFileUploads(FDataAbortFileUploadsRequest request, + FDelegateOnSuccessAbortFileUploads onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAbortFileUploads(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteFiles, FDataDeleteFilesResponse, result, UObject*, customData); + + /** Delete files on an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* DeleteFiles(FDataDeleteFilesRequest request, + FDelegateOnSuccessDeleteFiles onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteFiles(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessFinalizeFileUploads, FDataFinalizeFileUploadsResponse, result, UObject*, customData); + + /** Finalize file uploads to an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* FinalizeFileUploads(FDataFinalizeFileUploadsRequest request, + FDelegateOnSuccessFinalizeFileUploads onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + void HelperFinalizeFileUploads(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetFiles, FDataGetFilesResponse, result, UObject*, customData); + + /** Retrieves file metadata from an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* GetFiles(FDataGetFilesRequest request, + FDelegateOnSuccessGetFiles onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetFiles(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessInitiateFileUploads, FDataInitiateFileUploadsResponse, result, UObject*, customData); + + /** Initiates file uploads to an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* InitiateFileUploads(FDataInitiateFileUploadsRequest request, + FDelegateOnSuccessInitiateFileUploads onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File ", meta = (BlueprintInternalUseOnly = "true")) + void HelperInitiateFileUploads(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Object + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetObjects, FDataGetObjectsResponse, result, UObject*, customData); + + /** Retrieves objects from an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | Object ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* GetObjects(FDataGetObjectsRequest request, + FDelegateOnSuccessGetObjects onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | Object ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetObjects(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetObjects, FDataSetObjectsResponse, result, UObject*, customData); + + /** Sets objects on an entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | Object ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabDataAPI* SetObjects(FDataSetObjectsRequest request, + FDelegateOnSuccessSetObjects onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabDataRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | Object ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetObjects(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessAbortFileUploads OnSuccessAbortFileUploads; + FDelegateOnSuccessDeleteFiles OnSuccessDeleteFiles; + FDelegateOnSuccessFinalizeFileUploads OnSuccessFinalizeFileUploads; + FDelegateOnSuccessGetFiles OnSuccessGetFiles; + FDelegateOnSuccessInitiateFileUploads OnSuccessInitiateFileUploads; + FDelegateOnSuccessGetObjects OnSuccessGetObjects; + FDelegateOnSuccessSetObjects OnSuccessSetObjects; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabDataModelDecoder.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabDataModelDecoder.h new file mode 100644 index 000000000..670913120 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabDataModelDecoder.h @@ -0,0 +1,75 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Data +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabDataModels.h" +#include "PlayFabDataModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabDataModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Data API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // File + ////////////////////////////////////////////////////// + + /** Decode the AbortFileUploadsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File Models") + static FDataAbortFileUploadsResponse decodeAbortFileUploadsResponseResponse(UPlayFabJsonObject* response); + + /** Decode the DeleteFilesResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File Models") + static FDataDeleteFilesResponse decodeDeleteFilesResponseResponse(UPlayFabJsonObject* response); + + /** Decode the FinalizeFileUploadsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File Models") + static FDataFinalizeFileUploadsResponse decodeFinalizeFileUploadsResponseResponse(UPlayFabJsonObject* response); + + /** Decode the GetFilesResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File Models") + static FDataGetFilesResponse decodeGetFilesResponseResponse(UPlayFabJsonObject* response); + + /** Decode the InitiateFileUploadsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | File Models") + static FDataInitiateFileUploadsResponse decodeInitiateFileUploadsResponseResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Object + ////////////////////////////////////////////////////// + + /** Decode the GetObjectsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | Object Models") + static FDataGetObjectsResponse decodeGetObjectsResponseResponse(UPlayFabJsonObject* response); + + /** Decode the SetObjectsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Data | Object Models") + static FDataSetObjectsResponse decodeSetObjectsResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabDataModels.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabDataModels.h new file mode 100644 index 000000000..1e3025b35 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabDataModels.h @@ -0,0 +1,254 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Data +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabDataModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Data API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// File +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FDataAbortFileUploadsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** Names of the files to have their pending uploads aborted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + FString FileNames; + /** + * The expected version of the profile, if set and doesn't match the current version of the profile the operation will not + * be performed. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataAbortFileUploadsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataDeleteFilesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** Names of the files to be deleted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + FString FileNames; + /** + * The expected version of the profile, if set and doesn't match the current version of the profile the operation will not + * be performed. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataDeleteFilesResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataFinalizeFileUploadsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** Names of the files to be finalized. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + FString FileNames; +}; + +USTRUCT(BlueprintType) +struct FDataFinalizeFileUploadsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** Collection of metadata for the entity's files */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Metadata = nullptr; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataGetFilesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; +}; + +USTRUCT(BlueprintType) +struct FDataGetFilesResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** Collection of metadata for the entity's files */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Metadata = nullptr; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataInitiateFileUploadsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** Names of the files to be set. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + FString FileNames; + /** + * The expected version of the profile, if set and doesn't match the current version of the profile the operation will not + * be performed. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataInitiateFileUploadsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + UPlayFabJsonObject* Entity = nullptr; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + int32 ProfileVersion = 0; + /** Collection of file names and upload urls */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | File Models") + TArray UploadDetails; +}; + + +/////////////////////////////////////////////////////// +// Object +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FDataGetObjectsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + UPlayFabJsonObject* Entity = nullptr; + /** + * Determines whether the object will be returned as an escaped JSON string or as a un-escaped JSON object. Default is JSON + * object. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + bool EscapeObject = false; +}; + +USTRUCT(BlueprintType) +struct FDataGetObjectsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity id and type. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + UPlayFabJsonObject* Entity = nullptr; + /** Requested objects that the calling entity has access to */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + UPlayFabJsonObject* Objects = nullptr; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + int32 ProfileVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FDataSetObjectsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + UPlayFabJsonObject* Entity = nullptr; + /** + * Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from + * GetProfile API, you can ensure that the object set will only be performed if the profile has not been updated by any + * other clients since the version you last loaded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + int32 ExpectedProfileVersion = 0; + /** Collection of objects to set on the profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + TArray Objects; +}; + +USTRUCT(BlueprintType) +struct FDataSetObjectsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** New version of the entity profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + int32 ProfileVersion = 0; + /** New version of the entity profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Data | Object Models") + TArray SetResults; +}; + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabEnums.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabEnums.h new file mode 100644 index 000000000..a468b1d0c --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabEnums.h @@ -0,0 +1,867 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" +#include +#include "PlayFabJsonObject.h" +#include "PlayFabEnums.generated.h" + +// PlayFab enums start with "pfenum_" in order to avoid code-name conflicts - For JSON, remove that prefix, and send only the expected portion (the display name is not fetchable when compiled) + static const FString prefix = TEXT("pfenum_"); + +template +static FORCEINLINE bool GetEnumValueFromString(const FString& enumTypeName, const FString& input, EnumType& output) +{ + UEnum* enumPtr = FindObject(ANY_PACKAGE, *enumTypeName, true); + if (!enumPtr) + { + output = EnumType(0); + return false; + } + + FString fullInput; + if (!input.StartsWith(*prefix)) + fullInput = prefix + input; + else + fullInput = input; +#if ENGINE_MINOR_VERSION < 16 + output = (EnumType)enumPtr->FindEnumIndex(FName(*fullInput)); +#else + output = (EnumType)enumPtr->GetIndexByName(FName(*fullInput)); +#endif + return true; +} + +template +static FORCEINLINE bool GetEnumValueToString(const FString& enumTypeName, const EnumType& input, FString& output) +{ + const UEnum* enumPtr = FindObject(ANY_PACKAGE, *enumTypeName, true); + if (!enumPtr) + { + output = FString("0"); + return false; + } + +#if ENGINE_MINOR_VERSION < 16 + output = enumPtr->GetEnumName((int32)input); +#else + output = enumPtr->GetNameStringByIndex((int32)input); +#endif + if (output.StartsWith(*prefix)) + output.RemoveAt(0, 7, false); + return true; +} + + +/** AuthTokenType */ + +UENUM(BlueprintType) +enum class EAuthTokenType : uint8 +{ + pfenum_Email UMETA(DisplayName = "Email"), +}; + +/** Conditionals */ + +UENUM(BlueprintType) +enum class EConditionals : uint8 +{ + pfenum_Any UMETA(DisplayName = "Any"), + pfenum_True UMETA(DisplayName = "True"), + pfenum_False UMETA(DisplayName = "False"), +}; + +/** ContinentCode */ + +UENUM(BlueprintType) +enum class EContinentCode : uint8 +{ + pfenum_AF UMETA(DisplayName = "AF"), + pfenum_AN UMETA(DisplayName = "AN"), + pfenum_AS UMETA(DisplayName = "AS"), + pfenum_EU UMETA(DisplayName = "EU"), + pfenum_NA UMETA(DisplayName = "NA"), + pfenum_OC UMETA(DisplayName = "OC"), + pfenum_SA UMETA(DisplayName = "SA"), +}; + +/** CountryCode */ + +UENUM(BlueprintType) +enum class ECountryCode : uint8 +{ + pfenum_AF UMETA(DisplayName = "AF"), + pfenum_AX UMETA(DisplayName = "AX"), + pfenum_AL UMETA(DisplayName = "AL"), + pfenum_DZ UMETA(DisplayName = "DZ"), + pfenum_AS UMETA(DisplayName = "AS"), + pfenum_AD UMETA(DisplayName = "AD"), + pfenum_AO UMETA(DisplayName = "AO"), + pfenum_AI UMETA(DisplayName = "AI"), + pfenum_AQ UMETA(DisplayName = "AQ"), + pfenum_AG UMETA(DisplayName = "AG"), + pfenum_AR UMETA(DisplayName = "AR"), + pfenum_AM UMETA(DisplayName = "AM"), + pfenum_AW UMETA(DisplayName = "AW"), + pfenum_AU UMETA(DisplayName = "AU"), + pfenum_AT UMETA(DisplayName = "AT"), + pfenum_AZ UMETA(DisplayName = "AZ"), + pfenum_BS UMETA(DisplayName = "BS"), + pfenum_BH UMETA(DisplayName = "BH"), + pfenum_BD UMETA(DisplayName = "BD"), + pfenum_BB UMETA(DisplayName = "BB"), + pfenum_BY UMETA(DisplayName = "BY"), + pfenum_BE UMETA(DisplayName = "BE"), + pfenum_BZ UMETA(DisplayName = "BZ"), + pfenum_BJ UMETA(DisplayName = "BJ"), + pfenum_BM UMETA(DisplayName = "BM"), + pfenum_BT UMETA(DisplayName = "BT"), + pfenum_BO UMETA(DisplayName = "BO"), + pfenum_BQ UMETA(DisplayName = "BQ"), + pfenum_BA UMETA(DisplayName = "BA"), + pfenum_BW UMETA(DisplayName = "BW"), + pfenum_BV UMETA(DisplayName = "BV"), + pfenum_BR UMETA(DisplayName = "BR"), + pfenum_IO UMETA(DisplayName = "IO"), + pfenum_BN UMETA(DisplayName = "BN"), + pfenum_BG UMETA(DisplayName = "BG"), + pfenum_BF UMETA(DisplayName = "BF"), + pfenum_BI UMETA(DisplayName = "BI"), + pfenum_KH UMETA(DisplayName = "KH"), + pfenum_CM UMETA(DisplayName = "CM"), + pfenum_CA UMETA(DisplayName = "CA"), + pfenum_CV UMETA(DisplayName = "CV"), + pfenum_KY UMETA(DisplayName = "KY"), + pfenum_CF UMETA(DisplayName = "CF"), + pfenum_TD UMETA(DisplayName = "TD"), + pfenum_CL UMETA(DisplayName = "CL"), + pfenum_CN UMETA(DisplayName = "CN"), + pfenum_CX UMETA(DisplayName = "CX"), + pfenum_CC UMETA(DisplayName = "CC"), + pfenum_CO UMETA(DisplayName = "CO"), + pfenum_KM UMETA(DisplayName = "KM"), + pfenum_CG UMETA(DisplayName = "CG"), + pfenum_CD UMETA(DisplayName = "CD"), + pfenum_CK UMETA(DisplayName = "CK"), + pfenum_CR UMETA(DisplayName = "CR"), + pfenum_CI UMETA(DisplayName = "CI"), + pfenum_HR UMETA(DisplayName = "HR"), + pfenum_CU UMETA(DisplayName = "CU"), + pfenum_CW UMETA(DisplayName = "CW"), + pfenum_CY UMETA(DisplayName = "CY"), + pfenum_CZ UMETA(DisplayName = "CZ"), + pfenum_DK UMETA(DisplayName = "DK"), + pfenum_DJ UMETA(DisplayName = "DJ"), + pfenum_DM UMETA(DisplayName = "DM"), + pfenum_DO UMETA(DisplayName = "DO"), + pfenum_EC UMETA(DisplayName = "EC"), + pfenum_EG UMETA(DisplayName = "EG"), + pfenum_SV UMETA(DisplayName = "SV"), + pfenum_GQ UMETA(DisplayName = "GQ"), + pfenum_ER UMETA(DisplayName = "ER"), + pfenum_EE UMETA(DisplayName = "EE"), + pfenum_ET UMETA(DisplayName = "ET"), + pfenum_FK UMETA(DisplayName = "FK"), + pfenum_FO UMETA(DisplayName = "FO"), + pfenum_FJ UMETA(DisplayName = "FJ"), + pfenum_FI UMETA(DisplayName = "FI"), + pfenum_FR UMETA(DisplayName = "FR"), + pfenum_GF UMETA(DisplayName = "GF"), + pfenum_PF UMETA(DisplayName = "PF"), + pfenum_TF UMETA(DisplayName = "TF"), + pfenum_GA UMETA(DisplayName = "GA"), + pfenum_GM UMETA(DisplayName = "GM"), + pfenum_GE UMETA(DisplayName = "GE"), + pfenum_DE UMETA(DisplayName = "DE"), + pfenum_GH UMETA(DisplayName = "GH"), + pfenum_GI UMETA(DisplayName = "GI"), + pfenum_GR UMETA(DisplayName = "GR"), + pfenum_GL UMETA(DisplayName = "GL"), + pfenum_GD UMETA(DisplayName = "GD"), + pfenum_GP UMETA(DisplayName = "GP"), + pfenum_GU UMETA(DisplayName = "GU"), + pfenum_GT UMETA(DisplayName = "GT"), + pfenum_GG UMETA(DisplayName = "GG"), + pfenum_GN UMETA(DisplayName = "GN"), + pfenum_GW UMETA(DisplayName = "GW"), + pfenum_GY UMETA(DisplayName = "GY"), + pfenum_HT UMETA(DisplayName = "HT"), + pfenum_HM UMETA(DisplayName = "HM"), + pfenum_VA UMETA(DisplayName = "VA"), + pfenum_HN UMETA(DisplayName = "HN"), + pfenum_HK UMETA(DisplayName = "HK"), + pfenum_HU UMETA(DisplayName = "HU"), + pfenum_IS UMETA(DisplayName = "IS"), + pfenum_IN UMETA(DisplayName = "IN"), + pfenum_ID UMETA(DisplayName = "ID"), + pfenum_IR UMETA(DisplayName = "IR"), + pfenum_IQ UMETA(DisplayName = "IQ"), + pfenum_IE UMETA(DisplayName = "IE"), + pfenum_IM UMETA(DisplayName = "IM"), + pfenum_IL UMETA(DisplayName = "IL"), + pfenum_IT UMETA(DisplayName = "IT"), + pfenum_JM UMETA(DisplayName = "JM"), + pfenum_JP UMETA(DisplayName = "JP"), + pfenum_JE UMETA(DisplayName = "JE"), + pfenum_JO UMETA(DisplayName = "JO"), + pfenum_KZ UMETA(DisplayName = "KZ"), + pfenum_KE UMETA(DisplayName = "KE"), + pfenum_KI UMETA(DisplayName = "KI"), + pfenum_KP UMETA(DisplayName = "KP"), + pfenum_KR UMETA(DisplayName = "KR"), + pfenum_KW UMETA(DisplayName = "KW"), + pfenum_KG UMETA(DisplayName = "KG"), + pfenum_LA UMETA(DisplayName = "LA"), + pfenum_LV UMETA(DisplayName = "LV"), + pfenum_LB UMETA(DisplayName = "LB"), + pfenum_LS UMETA(DisplayName = "LS"), + pfenum_LR UMETA(DisplayName = "LR"), + pfenum_LY UMETA(DisplayName = "LY"), + pfenum_LI UMETA(DisplayName = "LI"), + pfenum_LT UMETA(DisplayName = "LT"), + pfenum_LU UMETA(DisplayName = "LU"), + pfenum_MO UMETA(DisplayName = "MO"), + pfenum_MK UMETA(DisplayName = "MK"), + pfenum_MG UMETA(DisplayName = "MG"), + pfenum_MW UMETA(DisplayName = "MW"), + pfenum_MY UMETA(DisplayName = "MY"), + pfenum_MV UMETA(DisplayName = "MV"), + pfenum_ML UMETA(DisplayName = "ML"), + pfenum_MT UMETA(DisplayName = "MT"), + pfenum_MH UMETA(DisplayName = "MH"), + pfenum_MQ UMETA(DisplayName = "MQ"), + pfenum_MR UMETA(DisplayName = "MR"), + pfenum_MU UMETA(DisplayName = "MU"), + pfenum_YT UMETA(DisplayName = "YT"), + pfenum_MX UMETA(DisplayName = "MX"), + pfenum_FM UMETA(DisplayName = "FM"), + pfenum_MD UMETA(DisplayName = "MD"), + pfenum_MC UMETA(DisplayName = "MC"), + pfenum_MN UMETA(DisplayName = "MN"), + pfenum_ME UMETA(DisplayName = "ME"), + pfenum_MS UMETA(DisplayName = "MS"), + pfenum_MA UMETA(DisplayName = "MA"), + pfenum_MZ UMETA(DisplayName = "MZ"), + pfenum_MM UMETA(DisplayName = "MM"), + pfenum_NA UMETA(DisplayName = "NA"), + pfenum_NR UMETA(DisplayName = "NR"), + pfenum_NP UMETA(DisplayName = "NP"), + pfenum_NL UMETA(DisplayName = "NL"), + pfenum_NC UMETA(DisplayName = "NC"), + pfenum_NZ UMETA(DisplayName = "NZ"), + pfenum_NI UMETA(DisplayName = "NI"), + pfenum_NE UMETA(DisplayName = "NE"), + pfenum_NG UMETA(DisplayName = "NG"), + pfenum_NU UMETA(DisplayName = "NU"), + pfenum_NF UMETA(DisplayName = "NF"), + pfenum_MP UMETA(DisplayName = "MP"), + pfenum_NO UMETA(DisplayName = "NO"), + pfenum_OM UMETA(DisplayName = "OM"), + pfenum_PK UMETA(DisplayName = "PK"), + pfenum_PW UMETA(DisplayName = "PW"), + pfenum_PS UMETA(DisplayName = "PS"), + pfenum_PA UMETA(DisplayName = "PA"), + pfenum_PG UMETA(DisplayName = "PG"), + pfenum_PY UMETA(DisplayName = "PY"), + pfenum_PE UMETA(DisplayName = "PE"), + pfenum_PH UMETA(DisplayName = "PH"), + pfenum_PN UMETA(DisplayName = "PN"), + pfenum_PL UMETA(DisplayName = "PL"), + pfenum_PT UMETA(DisplayName = "PT"), + pfenum_PR UMETA(DisplayName = "PR"), + pfenum_QA UMETA(DisplayName = "QA"), + pfenum_RE UMETA(DisplayName = "RE"), + pfenum_RO UMETA(DisplayName = "RO"), + pfenum_RU UMETA(DisplayName = "RU"), + pfenum_RW UMETA(DisplayName = "RW"), + pfenum_BL UMETA(DisplayName = "BL"), + pfenum_SH UMETA(DisplayName = "SH"), + pfenum_KN UMETA(DisplayName = "KN"), + pfenum_LC UMETA(DisplayName = "LC"), + pfenum_MF UMETA(DisplayName = "MF"), + pfenum_PM UMETA(DisplayName = "PM"), + pfenum_VC UMETA(DisplayName = "VC"), + pfenum_WS UMETA(DisplayName = "WS"), + pfenum_SM UMETA(DisplayName = "SM"), + pfenum_ST UMETA(DisplayName = "ST"), + pfenum_SA UMETA(DisplayName = "SA"), + pfenum_SN UMETA(DisplayName = "SN"), + pfenum_RS UMETA(DisplayName = "RS"), + pfenum_SC UMETA(DisplayName = "SC"), + pfenum_SL UMETA(DisplayName = "SL"), + pfenum_SG UMETA(DisplayName = "SG"), + pfenum_SX UMETA(DisplayName = "SX"), + pfenum_SK UMETA(DisplayName = "SK"), + pfenum_SI UMETA(DisplayName = "SI"), + pfenum_SB UMETA(DisplayName = "SB"), + pfenum_SO UMETA(DisplayName = "SO"), + pfenum_ZA UMETA(DisplayName = "ZA"), + pfenum_GS UMETA(DisplayName = "GS"), + pfenum_SS UMETA(DisplayName = "SS"), + pfenum_ES UMETA(DisplayName = "ES"), + pfenum_LK UMETA(DisplayName = "LK"), + pfenum_SD UMETA(DisplayName = "SD"), + pfenum_SR UMETA(DisplayName = "SR"), + pfenum_SJ UMETA(DisplayName = "SJ"), + pfenum_SZ UMETA(DisplayName = "SZ"), + pfenum_SE UMETA(DisplayName = "SE"), + pfenum_CH UMETA(DisplayName = "CH"), + pfenum_SY UMETA(DisplayName = "SY"), + pfenum_TW UMETA(DisplayName = "TW"), + pfenum_TJ UMETA(DisplayName = "TJ"), + pfenum_TZ UMETA(DisplayName = "TZ"), + pfenum_TH UMETA(DisplayName = "TH"), + pfenum_TL UMETA(DisplayName = "TL"), + pfenum_TG UMETA(DisplayName = "TG"), + pfenum_TK UMETA(DisplayName = "TK"), + pfenum_TO UMETA(DisplayName = "TO"), + pfenum_TT UMETA(DisplayName = "TT"), + pfenum_TN UMETA(DisplayName = "TN"), + pfenum_TR UMETA(DisplayName = "TR"), + pfenum_TM UMETA(DisplayName = "TM"), + pfenum_TC UMETA(DisplayName = "TC"), + pfenum_TV UMETA(DisplayName = "TV"), + pfenum_UG UMETA(DisplayName = "UG"), + pfenum_UA UMETA(DisplayName = "UA"), + pfenum_AE UMETA(DisplayName = "AE"), + pfenum_GB UMETA(DisplayName = "GB"), + pfenum_US UMETA(DisplayName = "US"), + pfenum_UM UMETA(DisplayName = "UM"), + pfenum_UY UMETA(DisplayName = "UY"), + pfenum_UZ UMETA(DisplayName = "UZ"), + pfenum_VU UMETA(DisplayName = "VU"), + pfenum_VE UMETA(DisplayName = "VE"), + pfenum_VN UMETA(DisplayName = "VN"), + pfenum_VG UMETA(DisplayName = "VG"), + pfenum_VI UMETA(DisplayName = "VI"), + pfenum_WF UMETA(DisplayName = "WF"), + pfenum_EH UMETA(DisplayName = "EH"), + pfenum_YE UMETA(DisplayName = "YE"), + pfenum_ZM UMETA(DisplayName = "ZM"), + pfenum_ZW UMETA(DisplayName = "ZW"), +}; + +/** Currency */ + +UENUM(BlueprintType) +enum class ECurrency : uint8 +{ + pfenum_AED UMETA(DisplayName = "AED"), + pfenum_AFN UMETA(DisplayName = "AFN"), + pfenum_ALL UMETA(DisplayName = "ALL"), + pfenum_AMD UMETA(DisplayName = "AMD"), + pfenum_ANG UMETA(DisplayName = "ANG"), + pfenum_AOA UMETA(DisplayName = "AOA"), + pfenum_ARS UMETA(DisplayName = "ARS"), + pfenum_AUD UMETA(DisplayName = "AUD"), + pfenum_AWG UMETA(DisplayName = "AWG"), + pfenum_AZN UMETA(DisplayName = "AZN"), + pfenum_BAM UMETA(DisplayName = "BAM"), + pfenum_BBD UMETA(DisplayName = "BBD"), + pfenum_BDT UMETA(DisplayName = "BDT"), + pfenum_BGN UMETA(DisplayName = "BGN"), + pfenum_BHD UMETA(DisplayName = "BHD"), + pfenum_BIF UMETA(DisplayName = "BIF"), + pfenum_BMD UMETA(DisplayName = "BMD"), + pfenum_BND UMETA(DisplayName = "BND"), + pfenum_BOB UMETA(DisplayName = "BOB"), + pfenum_BRL UMETA(DisplayName = "BRL"), + pfenum_BSD UMETA(DisplayName = "BSD"), + pfenum_BTN UMETA(DisplayName = "BTN"), + pfenum_BWP UMETA(DisplayName = "BWP"), + pfenum_BYR UMETA(DisplayName = "BYR"), + pfenum_BZD UMETA(DisplayName = "BZD"), + pfenum_CAD UMETA(DisplayName = "CAD"), + pfenum_CDF UMETA(DisplayName = "CDF"), + pfenum_CHF UMETA(DisplayName = "CHF"), + pfenum_CLP UMETA(DisplayName = "CLP"), + pfenum_CNY UMETA(DisplayName = "CNY"), + pfenum_COP UMETA(DisplayName = "COP"), + pfenum_CRC UMETA(DisplayName = "CRC"), + pfenum_CUC UMETA(DisplayName = "CUC"), + pfenum_CUP UMETA(DisplayName = "CUP"), + pfenum_CVE UMETA(DisplayName = "CVE"), + pfenum_CZK UMETA(DisplayName = "CZK"), + pfenum_DJF UMETA(DisplayName = "DJF"), + pfenum_DKK UMETA(DisplayName = "DKK"), + pfenum_DOP UMETA(DisplayName = "DOP"), + pfenum_DZD UMETA(DisplayName = "DZD"), + pfenum_EGP UMETA(DisplayName = "EGP"), + pfenum_ERN UMETA(DisplayName = "ERN"), + pfenum_ETB UMETA(DisplayName = "ETB"), + pfenum_EUR UMETA(DisplayName = "EUR"), + pfenum_FJD UMETA(DisplayName = "FJD"), + pfenum_FKP UMETA(DisplayName = "FKP"), + pfenum_GBP UMETA(DisplayName = "GBP"), + pfenum_GEL UMETA(DisplayName = "GEL"), + pfenum_GGP UMETA(DisplayName = "GGP"), + pfenum_GHS UMETA(DisplayName = "GHS"), + pfenum_GIP UMETA(DisplayName = "GIP"), + pfenum_GMD UMETA(DisplayName = "GMD"), + pfenum_GNF UMETA(DisplayName = "GNF"), + pfenum_GTQ UMETA(DisplayName = "GTQ"), + pfenum_GYD UMETA(DisplayName = "GYD"), + pfenum_HKD UMETA(DisplayName = "HKD"), + pfenum_HNL UMETA(DisplayName = "HNL"), + pfenum_HRK UMETA(DisplayName = "HRK"), + pfenum_HTG UMETA(DisplayName = "HTG"), + pfenum_HUF UMETA(DisplayName = "HUF"), + pfenum_IDR UMETA(DisplayName = "IDR"), + pfenum_ILS UMETA(DisplayName = "ILS"), + pfenum_IMP UMETA(DisplayName = "IMP"), + pfenum_INR UMETA(DisplayName = "INR"), + pfenum_IQD UMETA(DisplayName = "IQD"), + pfenum_IRR UMETA(DisplayName = "IRR"), + pfenum_ISK UMETA(DisplayName = "ISK"), + pfenum_JEP UMETA(DisplayName = "JEP"), + pfenum_JMD UMETA(DisplayName = "JMD"), + pfenum_JOD UMETA(DisplayName = "JOD"), + pfenum_JPY UMETA(DisplayName = "JPY"), + pfenum_KES UMETA(DisplayName = "KES"), + pfenum_KGS UMETA(DisplayName = "KGS"), + pfenum_KHR UMETA(DisplayName = "KHR"), + pfenum_KMF UMETA(DisplayName = "KMF"), + pfenum_KPW UMETA(DisplayName = "KPW"), + pfenum_KRW UMETA(DisplayName = "KRW"), + pfenum_KWD UMETA(DisplayName = "KWD"), + pfenum_KYD UMETA(DisplayName = "KYD"), + pfenum_KZT UMETA(DisplayName = "KZT"), + pfenum_LAK UMETA(DisplayName = "LAK"), + pfenum_LBP UMETA(DisplayName = "LBP"), + pfenum_LKR UMETA(DisplayName = "LKR"), + pfenum_LRD UMETA(DisplayName = "LRD"), + pfenum_LSL UMETA(DisplayName = "LSL"), + pfenum_LYD UMETA(DisplayName = "LYD"), + pfenum_MAD UMETA(DisplayName = "MAD"), + pfenum_MDL UMETA(DisplayName = "MDL"), + pfenum_MGA UMETA(DisplayName = "MGA"), + pfenum_MKD UMETA(DisplayName = "MKD"), + pfenum_MMK UMETA(DisplayName = "MMK"), + pfenum_MNT UMETA(DisplayName = "MNT"), + pfenum_MOP UMETA(DisplayName = "MOP"), + pfenum_MRO UMETA(DisplayName = "MRO"), + pfenum_MUR UMETA(DisplayName = "MUR"), + pfenum_MVR UMETA(DisplayName = "MVR"), + pfenum_MWK UMETA(DisplayName = "MWK"), + pfenum_MXN UMETA(DisplayName = "MXN"), + pfenum_MYR UMETA(DisplayName = "MYR"), + pfenum_MZN UMETA(DisplayName = "MZN"), + pfenum_NAD UMETA(DisplayName = "NAD"), + pfenum_NGN UMETA(DisplayName = "NGN"), + pfenum_NIO UMETA(DisplayName = "NIO"), + pfenum_NOK UMETA(DisplayName = "NOK"), + pfenum_NPR UMETA(DisplayName = "NPR"), + pfenum_NZD UMETA(DisplayName = "NZD"), + pfenum_OMR UMETA(DisplayName = "OMR"), + pfenum_PAB UMETA(DisplayName = "PAB"), + pfenum_PEN UMETA(DisplayName = "PEN"), + pfenum_PGK UMETA(DisplayName = "PGK"), + pfenum_PHP UMETA(DisplayName = "PHP"), + pfenum_PKR UMETA(DisplayName = "PKR"), + pfenum_PLN UMETA(DisplayName = "PLN"), + pfenum_PYG UMETA(DisplayName = "PYG"), + pfenum_QAR UMETA(DisplayName = "QAR"), + pfenum_RON UMETA(DisplayName = "RON"), + pfenum_RSD UMETA(DisplayName = "RSD"), + pfenum_RUB UMETA(DisplayName = "RUB"), + pfenum_RWF UMETA(DisplayName = "RWF"), + pfenum_SAR UMETA(DisplayName = "SAR"), + pfenum_SBD UMETA(DisplayName = "SBD"), + pfenum_SCR UMETA(DisplayName = "SCR"), + pfenum_SDG UMETA(DisplayName = "SDG"), + pfenum_SEK UMETA(DisplayName = "SEK"), + pfenum_SGD UMETA(DisplayName = "SGD"), + pfenum_SHP UMETA(DisplayName = "SHP"), + pfenum_SLL UMETA(DisplayName = "SLL"), + pfenum_SOS UMETA(DisplayName = "SOS"), + pfenum_SPL UMETA(DisplayName = "SPL"), + pfenum_SRD UMETA(DisplayName = "SRD"), + pfenum_STD UMETA(DisplayName = "STD"), + pfenum_SVC UMETA(DisplayName = "SVC"), + pfenum_SYP UMETA(DisplayName = "SYP"), + pfenum_SZL UMETA(DisplayName = "SZL"), + pfenum_THB UMETA(DisplayName = "THB"), + pfenum_TJS UMETA(DisplayName = "TJS"), + pfenum_TMT UMETA(DisplayName = "TMT"), + pfenum_TND UMETA(DisplayName = "TND"), + pfenum_TOP UMETA(DisplayName = "TOP"), + pfenum_TRY UMETA(DisplayName = "TRY"), + pfenum_TTD UMETA(DisplayName = "TTD"), + pfenum_TVD UMETA(DisplayName = "TVD"), + pfenum_TWD UMETA(DisplayName = "TWD"), + pfenum_TZS UMETA(DisplayName = "TZS"), + pfenum_UAH UMETA(DisplayName = "UAH"), + pfenum_UGX UMETA(DisplayName = "UGX"), + pfenum_USD UMETA(DisplayName = "USD"), + pfenum_UYU UMETA(DisplayName = "UYU"), + pfenum_UZS UMETA(DisplayName = "UZS"), + pfenum_VEF UMETA(DisplayName = "VEF"), + pfenum_VND UMETA(DisplayName = "VND"), + pfenum_VUV UMETA(DisplayName = "VUV"), + pfenum_WST UMETA(DisplayName = "WST"), + pfenum_XAF UMETA(DisplayName = "XAF"), + pfenum_XCD UMETA(DisplayName = "XCD"), + pfenum_XDR UMETA(DisplayName = "XDR"), + pfenum_XOF UMETA(DisplayName = "XOF"), + pfenum_XPF UMETA(DisplayName = "XPF"), + pfenum_YER UMETA(DisplayName = "YER"), + pfenum_ZAR UMETA(DisplayName = "ZAR"), + pfenum_ZMW UMETA(DisplayName = "ZMW"), + pfenum_ZWD UMETA(DisplayName = "ZWD"), +}; + +/** EffectType */ + +UENUM(BlueprintType) +enum class EEffectType : uint8 +{ + pfenum_Allow UMETA(DisplayName = "Allow"), + pfenum_Deny UMETA(DisplayName = "Deny"), +}; + +/** EmailVerificationStatus */ + +UENUM(BlueprintType) +enum class EEmailVerificationStatus : uint8 +{ + pfenum_Unverified UMETA(DisplayName = "Unverified"), + pfenum_Pending UMETA(DisplayName = "Pending"), + pfenum_Confirmed UMETA(DisplayName = "Confirmed"), +}; + +/** GameBuildStatus */ + +UENUM(BlueprintType) +enum class EGameBuildStatus : uint8 +{ + pfenum_Available UMETA(DisplayName = "Available"), + pfenum_Validating UMETA(DisplayName = "Validating"), + pfenum_InvalidBuildPackage UMETA(DisplayName = "InvalidBuildPackage"), + pfenum_Processing UMETA(DisplayName = "Processing"), + pfenum_FailedToProcess UMETA(DisplayName = "FailedToProcess"), +}; + +/** LoginIdentityProvider */ + +UENUM(BlueprintType) +enum class ELoginIdentityProvider : uint8 +{ + pfenum_Unknown UMETA(DisplayName = "Unknown"), + pfenum_PlayFab UMETA(DisplayName = "PlayFab"), + pfenum_Custom UMETA(DisplayName = "Custom"), + pfenum_GameCenter UMETA(DisplayName = "GameCenter"), + pfenum_GooglePlay UMETA(DisplayName = "GooglePlay"), + pfenum_Steam UMETA(DisplayName = "Steam"), + pfenum_XBoxLive UMETA(DisplayName = "XBoxLive"), + pfenum_PSN UMETA(DisplayName = "PSN"), + pfenum_Kongregate UMETA(DisplayName = "Kongregate"), + pfenum_Facebook UMETA(DisplayName = "Facebook"), + pfenum_IOSDevice UMETA(DisplayName = "IOSDevice"), + pfenum_AndroidDevice UMETA(DisplayName = "AndroidDevice"), + pfenum_Twitch UMETA(DisplayName = "Twitch"), + pfenum_WindowsHello UMETA(DisplayName = "WindowsHello"), + pfenum_GameServer UMETA(DisplayName = "GameServer"), + pfenum_CustomServer UMETA(DisplayName = "CustomServer"), + pfenum_NintendoSwitch UMETA(DisplayName = "NintendoSwitch"), + pfenum_FacebookInstantGames UMETA(DisplayName = "FacebookInstantGames"), + pfenum_OpenIdConnect UMETA(DisplayName = "OpenIdConnect"), +}; + +/** PushNotificationPlatform */ + +UENUM(BlueprintType) +enum class EPushNotificationPlatform : uint8 +{ + pfenum_ApplePushNotificationService UMETA(DisplayName = "ApplePushNotificationService"), + pfenum_GoogleCloudMessaging UMETA(DisplayName = "GoogleCloudMessaging"), +}; + +/** PushSetupPlatform */ + +UENUM(BlueprintType) +enum class EPushSetupPlatform : uint8 +{ + pfenum_GCM UMETA(DisplayName = "GCM"), + pfenum_APNS UMETA(DisplayName = "APNS"), + pfenum_APNS_SANDBOX UMETA(DisplayName = "APNS_SANDBOX"), +}; + +/** Region */ + +UENUM(BlueprintType) +enum class ERegion : uint8 +{ + pfenum_USCentral UMETA(DisplayName = "USCentral"), + pfenum_USEast UMETA(DisplayName = "USEast"), + pfenum_EUWest UMETA(DisplayName = "EUWest"), + pfenum_Singapore UMETA(DisplayName = "Singapore"), + pfenum_Japan UMETA(DisplayName = "Japan"), + pfenum_Brazil UMETA(DisplayName = "Brazil"), + pfenum_Australia UMETA(DisplayName = "Australia"), +}; + +/** ResolutionOutcome */ + +UENUM(BlueprintType) +enum class EResolutionOutcome : uint8 +{ + pfenum_Revoke UMETA(DisplayName = "Revoke"), + pfenum_Reinstate UMETA(DisplayName = "Reinstate"), + pfenum_Manual UMETA(DisplayName = "Manual"), +}; + +/** ResultTableNodeType */ + +UENUM(BlueprintType) +enum class EResultTableNodeType : uint8 +{ + pfenum_ItemId UMETA(DisplayName = "ItemId"), + pfenum_TableId UMETA(DisplayName = "TableId"), +}; + +/** ScheduledTaskType */ + +UENUM(BlueprintType) +enum class EScheduledTaskType : uint8 +{ + pfenum_CloudScript UMETA(DisplayName = "CloudScript"), + pfenum_ActionsOnPlayerSegment UMETA(DisplayName = "ActionsOnPlayerSegment"), +}; + +/** SourceType */ + +UENUM(BlueprintType) +enum class EPfSourceType : uint8 +{ + pfenum_Admin UMETA(DisplayName = "Admin"), + pfenum_BackEnd UMETA(DisplayName = "BackEnd"), + pfenum_GameClient UMETA(DisplayName = "GameClient"), + pfenum_GameServer UMETA(DisplayName = "GameServer"), + pfenum_Partner UMETA(DisplayName = "Partner"), + pfenum_Custom UMETA(DisplayName = "Custom"), + pfenum_API UMETA(DisplayName = "API"), +}; + +/** StatisticAggregationMethod */ + +UENUM(BlueprintType) +enum class EStatisticAggregationMethod : uint8 +{ + pfenum_Last UMETA(DisplayName = "Last"), + pfenum_Min UMETA(DisplayName = "Min"), + pfenum_Max UMETA(DisplayName = "Max"), + pfenum_Sum UMETA(DisplayName = "Sum"), +}; + +/** StatisticResetIntervalOption */ + +UENUM(BlueprintType) +enum class EStatisticResetIntervalOption : uint8 +{ + pfenum_Never UMETA(DisplayName = "Never"), + pfenum_Hour UMETA(DisplayName = "Hour"), + pfenum_Day UMETA(DisplayName = "Day"), + pfenum_Week UMETA(DisplayName = "Week"), + pfenum_Month UMETA(DisplayName = "Month"), +}; + +/** StatisticVersionArchivalStatus */ + +UENUM(BlueprintType) +enum class EStatisticVersionArchivalStatus : uint8 +{ + pfenum_NotScheduled UMETA(DisplayName = "NotScheduled"), + pfenum_Scheduled UMETA(DisplayName = "Scheduled"), + pfenum_Queued UMETA(DisplayName = "Queued"), + pfenum_InProgress UMETA(DisplayName = "InProgress"), + pfenum_Complete UMETA(DisplayName = "Complete"), +}; + +/** StatisticVersionStatus */ + +UENUM(BlueprintType) +enum class EStatisticVersionStatus : uint8 +{ + pfenum_Active UMETA(DisplayName = "Active"), + pfenum_SnapshotPending UMETA(DisplayName = "SnapshotPending"), + pfenum_Snapshot UMETA(DisplayName = "Snapshot"), + pfenum_ArchivalPending UMETA(DisplayName = "ArchivalPending"), + pfenum_Archived UMETA(DisplayName = "Archived"), +}; + +/** SubscriptionProviderStatus */ + +UENUM(BlueprintType) +enum class ESubscriptionProviderStatus : uint8 +{ + pfenum_NoError UMETA(DisplayName = "NoError"), + pfenum_Cancelled UMETA(DisplayName = "Cancelled"), + pfenum_UnknownError UMETA(DisplayName = "UnknownError"), + pfenum_BillingError UMETA(DisplayName = "BillingError"), + pfenum_ProductUnavailable UMETA(DisplayName = "ProductUnavailable"), + pfenum_CustomerDidNotAcceptPriceChange UMETA(DisplayName = "CustomerDidNotAcceptPriceChange"), + pfenum_FreeTrial UMETA(DisplayName = "FreeTrial"), + pfenum_PaymentPending UMETA(DisplayName = "PaymentPending"), +}; + +/** TaskInstanceStatus */ + +UENUM(BlueprintType) +enum class ETaskInstanceStatus : uint8 +{ + pfenum_Succeeded UMETA(DisplayName = "Succeeded"), + pfenum_Starting UMETA(DisplayName = "Starting"), + pfenum_InProgress UMETA(DisplayName = "InProgress"), + pfenum_Failed UMETA(DisplayName = "Failed"), + pfenum_Aborted UMETA(DisplayName = "Aborted"), + pfenum_Pending UMETA(DisplayName = "Pending"), +}; + +/** TitleActivationStatus */ + +UENUM(BlueprintType) +enum class ETitleActivationStatus : uint8 +{ + pfenum_None UMETA(DisplayName = "None"), + pfenum_ActivatedTitleKey UMETA(DisplayName = "ActivatedTitleKey"), + pfenum_PendingSteam UMETA(DisplayName = "PendingSteam"), + pfenum_ActivatedSteam UMETA(DisplayName = "ActivatedSteam"), + pfenum_RevokedSteam UMETA(DisplayName = "RevokedSteam"), +}; + +/** UserDataPermission */ + +UENUM(BlueprintType) +enum class EUserDataPermission : uint8 +{ + pfenum_Private UMETA(DisplayName = "Private"), + pfenum_Public UMETA(DisplayName = "Public"), +}; + +/** UserOrigination */ + +UENUM(BlueprintType) +enum class EUserOrigination : uint8 +{ + pfenum_Organic UMETA(DisplayName = "Organic"), + pfenum_Steam UMETA(DisplayName = "Steam"), + pfenum_Google UMETA(DisplayName = "Google"), + pfenum_Amazon UMETA(DisplayName = "Amazon"), + pfenum_Facebook UMETA(DisplayName = "Facebook"), + pfenum_Kongregate UMETA(DisplayName = "Kongregate"), + pfenum_GamersFirst UMETA(DisplayName = "GamersFirst"), + pfenum_Unknown UMETA(DisplayName = "Unknown"), + pfenum_IOS UMETA(DisplayName = "IOS"), + pfenum_LoadTest UMETA(DisplayName = "LoadTest"), + pfenum_Android UMETA(DisplayName = "Android"), + pfenum_PSN UMETA(DisplayName = "PSN"), + pfenum_GameCenter UMETA(DisplayName = "GameCenter"), + pfenum_CustomId UMETA(DisplayName = "CustomId"), + pfenum_XboxLive UMETA(DisplayName = "XboxLive"), + pfenum_Parse UMETA(DisplayName = "Parse"), + pfenum_Twitch UMETA(DisplayName = "Twitch"), + pfenum_WindowsHello UMETA(DisplayName = "WindowsHello"), + pfenum_ServerCustomId UMETA(DisplayName = "ServerCustomId"), + pfenum_NintendoSwitchDeviceId UMETA(DisplayName = "NintendoSwitchDeviceId"), + pfenum_FacebookInstantGamesId UMETA(DisplayName = "FacebookInstantGamesId"), + pfenum_OpenIdConnect UMETA(DisplayName = "OpenIdConnect"), +}; + +/** CloudScriptRevisionOption */ + +UENUM(BlueprintType) +enum class ECloudScriptRevisionOption : uint8 +{ + pfenum_Live UMETA(DisplayName = "Live"), + pfenum_Latest UMETA(DisplayName = "Latest"), + pfenum_Specific UMETA(DisplayName = "Specific"), +}; + +/** GameInstanceState */ + +UENUM(BlueprintType) +enum class EGameInstanceState : uint8 +{ + pfenum_Open UMETA(DisplayName = "Open"), + pfenum_Closed UMETA(DisplayName = "Closed"), +}; + +/** MatchmakeStatus */ + +UENUM(BlueprintType) +enum class EMatchmakeStatus : uint8 +{ + pfenum_Complete UMETA(DisplayName = "Complete"), + pfenum_Waiting UMETA(DisplayName = "Waiting"), + pfenum_GameNotFound UMETA(DisplayName = "GameNotFound"), + pfenum_NoAvailableSlots UMETA(DisplayName = "NoAvailableSlots"), + pfenum_SessionClosed UMETA(DisplayName = "SessionClosed"), +}; + +/** TradeStatus */ + +UENUM(BlueprintType) +enum class ETradeStatus : uint8 +{ + pfenum_Invalid UMETA(DisplayName = "Invalid"), + pfenum_Opening UMETA(DisplayName = "Opening"), + pfenum_Open UMETA(DisplayName = "Open"), + pfenum_Accepting UMETA(DisplayName = "Accepting"), + pfenum_Accepted UMETA(DisplayName = "Accepted"), + pfenum_Filled UMETA(DisplayName = "Filled"), + pfenum_Cancelled UMETA(DisplayName = "Cancelled"), +}; + +/** TransactionStatus */ + +UENUM(BlueprintType) +enum class ETransactionStatus : uint8 +{ + pfenum_CreateCart UMETA(DisplayName = "CreateCart"), + pfenum_Init UMETA(DisplayName = "Init"), + pfenum_Approved UMETA(DisplayName = "Approved"), + pfenum_Succeeded UMETA(DisplayName = "Succeeded"), + pfenum_FailedByProvider UMETA(DisplayName = "FailedByProvider"), + pfenum_DisputePending UMETA(DisplayName = "DisputePending"), + pfenum_RefundPending UMETA(DisplayName = "RefundPending"), + pfenum_Refunded UMETA(DisplayName = "Refunded"), + pfenum_RefundFailed UMETA(DisplayName = "RefundFailed"), + pfenum_ChargedBack UMETA(DisplayName = "ChargedBack"), + pfenum_FailedByUber UMETA(DisplayName = "FailedByUber"), + pfenum_FailedByPlayFab UMETA(DisplayName = "FailedByPlayFab"), + pfenum_Revoked UMETA(DisplayName = "Revoked"), + pfenum_TradePending UMETA(DisplayName = "TradePending"), + pfenum_Traded UMETA(DisplayName = "Traded"), + pfenum_Upgraded UMETA(DisplayName = "Upgraded"), + pfenum_StackPending UMETA(DisplayName = "StackPending"), + pfenum_Stacked UMETA(DisplayName = "Stacked"), + pfenum_Other UMETA(DisplayName = "Other"), + pfenum_Failed UMETA(DisplayName = "Failed"), +}; + +/** PlayerConnectionState */ + +UENUM(BlueprintType) +enum class EPlayerConnectionState : uint8 +{ + pfenum_Unassigned UMETA(DisplayName = "Unassigned"), + pfenum_Connecting UMETA(DisplayName = "Connecting"), + pfenum_Participating UMETA(DisplayName = "Participating"), + pfenum_Participated UMETA(DisplayName = "Participated"), +}; + +/** OperationTypes */ + +UENUM(BlueprintType) +enum class EOperationTypes : uint8 +{ + pfenum_Created UMETA(DisplayName = "Created"), + pfenum_Updated UMETA(DisplayName = "Updated"), + pfenum_Deleted UMETA(DisplayName = "Deleted"), + pfenum_None UMETA(DisplayName = "None"), +}; + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabEventsAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabEventsAPI.h new file mode 100644 index 000000000..c3e5a9375 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabEventsAPI.h @@ -0,0 +1,104 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Events +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabEventsModels.h" +#include "PlayFabEventsAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabEventsRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabEventsAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabEventsRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Events API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // PlayStream Events + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWriteEvents, FEventsWriteEventsResponse, result, UObject*, customData); + + /** Write batches of entity based events to PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Events | PlayStream Events ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabEventsAPI* WriteEvents(FEventsWriteEventsRequest request, + FDelegateOnSuccessWriteEvents onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabEventsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Events | PlayStream Events ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWriteEvents(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessWriteEvents OnSuccessWriteEvents; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabEventsModelDecoder.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabEventsModelDecoder.h new file mode 100644 index 000000000..1ce385ff3 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabEventsModelDecoder.h @@ -0,0 +1,45 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Events +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabEventsModels.h" +#include "PlayFabEventsModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabEventsModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Events API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // PlayStream Events + ////////////////////////////////////////////////////// + + /** Decode the WriteEventsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Events | PlayStream Events Models") + static FEventsWriteEventsResponse decodeWriteEventsResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabEventsModels.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabEventsModels.h new file mode 100644 index 000000000..5d356cc10 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabEventsModels.h @@ -0,0 +1,53 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Events +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabEventsModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Events API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// PlayStream Events +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FEventsWriteEventsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Collection of events to write to PlayStream. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Events | PlayStream Events Models") + TArray Events; +}; + +USTRUCT(BlueprintType) +struct FEventsWriteEventsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The unique identifiers assigned by the server to the events, in the same order as the events in the request. Only + * returned if FlushToPlayStream option is true. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Events | PlayStream Events Models") + FString AssignedEventIds; +}; + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabGroupsAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabGroupsAPI.h new file mode 100644 index 000000000..14864e5f2 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabGroupsAPI.h @@ -0,0 +1,440 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Groups +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabGroupsModels.h" +#include "PlayFabGroupsAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabGroupsRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabGroupsAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabGroupsRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Groups API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Groups + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAcceptGroupApplication, FGroupsEmptyResponse, result, UObject*, customData); + + /** Accepts an outstanding invitation to to join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* AcceptGroupApplication(FGroupsAcceptGroupApplicationRequest request, + FDelegateOnSuccessAcceptGroupApplication onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAcceptGroupApplication(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAcceptGroupInvitation, FGroupsEmptyResponse, result, UObject*, customData); + + /** Accepts an invitation to join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* AcceptGroupInvitation(FGroupsAcceptGroupInvitationRequest request, + FDelegateOnSuccessAcceptGroupInvitation onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAcceptGroupInvitation(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddMembers, FGroupsEmptyResponse, result, UObject*, customData); + + /** Adds members to a group or role. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* AddMembers(FGroupsAddMembersRequest request, + FDelegateOnSuccessAddMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessApplyToGroup, FGroupsApplyToGroupResponse, result, UObject*, customData); + + /** Applies to join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ApplyToGroup(FGroupsApplyToGroupRequest request, + FDelegateOnSuccessApplyToGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperApplyToGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessBlockEntity, FGroupsEmptyResponse, result, UObject*, customData); + + /** Blocks a list of entities from joining a group. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* BlockEntity(FGroupsBlockEntityRequest request, + FDelegateOnSuccessBlockEntity onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperBlockEntity(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessChangeMemberRole, FGroupsEmptyResponse, result, UObject*, customData); + + /** Changes the role membership of a list of entities from one role to another. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ChangeMemberRole(FGroupsChangeMemberRoleRequest request, + FDelegateOnSuccessChangeMemberRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperChangeMemberRole(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreateGroup, FGroupsCreateGroupResponse, result, UObject*, customData); + + /** Creates a new group. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* CreateGroup(FGroupsCreateGroupRequest request, + FDelegateOnSuccessCreateGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreateGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreateRole, FGroupsCreateGroupRoleResponse, result, UObject*, customData); + + /** Creates a new group role. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* CreateRole(FGroupsCreateGroupRoleRequest request, + FDelegateOnSuccessCreateRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreateRole(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteGroup, FGroupsEmptyResponse, result, UObject*, customData); + + /** Deletes a group and all roles, invitations, join requests, and blocks associated with it. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* DeleteGroup(FGroupsDeleteGroupRequest request, + FDelegateOnSuccessDeleteGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteRole, FGroupsEmptyResponse, result, UObject*, customData); + + /** Deletes an existing role in a group. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* DeleteRole(FGroupsDeleteRoleRequest request, + FDelegateOnSuccessDeleteRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteRole(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetGroup, FGroupsGetGroupResponse, result, UObject*, customData); + + /** Gets information about a group and its roles */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* GetGroup(FGroupsGetGroupRequest request, + FDelegateOnSuccessGetGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessInviteToGroup, FGroupsInviteToGroupResponse, result, UObject*, customData); + + /** Invites a player to join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* InviteToGroup(FGroupsInviteToGroupRequest request, + FDelegateOnSuccessInviteToGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperInviteToGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessIsMember, FGroupsIsMemberResponse, result, UObject*, customData); + + /** Checks to see if an entity is a member of a group or role within the group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* IsMember(FGroupsIsMemberRequest request, + FDelegateOnSuccessIsMember onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperIsMember(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListGroupApplications, FGroupsListGroupApplicationsResponse, result, UObject*, customData); + + /** Lists all outstanding requests to join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ListGroupApplications(FGroupsListGroupApplicationsRequest request, + FDelegateOnSuccessListGroupApplications onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListGroupApplications(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListGroupBlocks, FGroupsListGroupBlocksResponse, result, UObject*, customData); + + /** Lists all entities blocked from joining a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ListGroupBlocks(FGroupsListGroupBlocksRequest request, + FDelegateOnSuccessListGroupBlocks onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListGroupBlocks(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListGroupInvitations, FGroupsListGroupInvitationsResponse, result, UObject*, customData); + + /** Lists all outstanding invitations for a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ListGroupInvitations(FGroupsListGroupInvitationsRequest request, + FDelegateOnSuccessListGroupInvitations onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListGroupInvitations(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListGroupMembers, FGroupsListGroupMembersResponse, result, UObject*, customData); + + /** Lists all members for a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ListGroupMembers(FGroupsListGroupMembersRequest request, + FDelegateOnSuccessListGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListMembership, FGroupsListMembershipResponse, result, UObject*, customData); + + /** Lists all groups and roles for an entity */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ListMembership(FGroupsListMembershipRequest request, + FDelegateOnSuccessListMembership onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListMembership(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessListMembershipOpportunities, FGroupsListMembershipOpportunitiesResponse, result, UObject*, customData); + + /** Lists all outstanding invitations and group applications for an entity */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* ListMembershipOpportunities(FGroupsListMembershipOpportunitiesRequest request, + FDelegateOnSuccessListMembershipOpportunities onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperListMembershipOpportunities(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveGroupApplication, FGroupsEmptyResponse, result, UObject*, customData); + + /** Removes an application to join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* RemoveGroupApplication(FGroupsRemoveGroupApplicationRequest request, + FDelegateOnSuccessRemoveGroupApplication onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveGroupApplication(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveGroupInvitation, FGroupsEmptyResponse, result, UObject*, customData); + + /** Removes an invitation join a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* RemoveGroupInvitation(FGroupsRemoveGroupInvitationRequest request, + FDelegateOnSuccessRemoveGroupInvitation onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveGroupInvitation(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveMembers, FGroupsEmptyResponse, result, UObject*, customData); + + /** Removes members from a group. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* RemoveMembers(FGroupsRemoveMembersRequest request, + FDelegateOnSuccessRemoveMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnblockEntity, FGroupsEmptyResponse, result, UObject*, customData); + + /** Unblocks a list of entities from joining a group */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* UnblockEntity(FGroupsUnblockEntityRequest request, + FDelegateOnSuccessUnblockEntity onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnblockEntity(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateGroup, FGroupsUpdateGroupResponse, result, UObject*, customData); + + /** Updates non-membership data about a group. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* UpdateGroup(FGroupsUpdateGroupRequest request, + FDelegateOnSuccessUpdateGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateRole, FGroupsUpdateGroupRoleResponse, result, UObject*, customData); + + /** Updates metadata about a role. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabGroupsAPI* UpdateRole(FGroupsUpdateGroupRoleRequest request, + FDelegateOnSuccessUpdateRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabGroupsRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateRole(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessAcceptGroupApplication OnSuccessAcceptGroupApplication; + FDelegateOnSuccessAcceptGroupInvitation OnSuccessAcceptGroupInvitation; + FDelegateOnSuccessAddMembers OnSuccessAddMembers; + FDelegateOnSuccessApplyToGroup OnSuccessApplyToGroup; + FDelegateOnSuccessBlockEntity OnSuccessBlockEntity; + FDelegateOnSuccessChangeMemberRole OnSuccessChangeMemberRole; + FDelegateOnSuccessCreateGroup OnSuccessCreateGroup; + FDelegateOnSuccessCreateRole OnSuccessCreateRole; + FDelegateOnSuccessDeleteGroup OnSuccessDeleteGroup; + FDelegateOnSuccessDeleteRole OnSuccessDeleteRole; + FDelegateOnSuccessGetGroup OnSuccessGetGroup; + FDelegateOnSuccessInviteToGroup OnSuccessInviteToGroup; + FDelegateOnSuccessIsMember OnSuccessIsMember; + FDelegateOnSuccessListGroupApplications OnSuccessListGroupApplications; + FDelegateOnSuccessListGroupBlocks OnSuccessListGroupBlocks; + FDelegateOnSuccessListGroupInvitations OnSuccessListGroupInvitations; + FDelegateOnSuccessListGroupMembers OnSuccessListGroupMembers; + FDelegateOnSuccessListMembership OnSuccessListMembership; + FDelegateOnSuccessListMembershipOpportunities OnSuccessListMembershipOpportunities; + FDelegateOnSuccessRemoveGroupApplication OnSuccessRemoveGroupApplication; + FDelegateOnSuccessRemoveGroupInvitation OnSuccessRemoveGroupInvitation; + FDelegateOnSuccessRemoveMembers OnSuccessRemoveMembers; + FDelegateOnSuccessUnblockEntity OnSuccessUnblockEntity; + FDelegateOnSuccessUpdateGroup OnSuccessUpdateGroup; + FDelegateOnSuccessUpdateRole OnSuccessUpdateRole; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabGroupsModelDecoder.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabGroupsModelDecoder.h new file mode 100644 index 000000000..c42762b32 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabGroupsModelDecoder.h @@ -0,0 +1,101 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Groups +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabGroupsModels.h" +#include "PlayFabGroupsModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabGroupsModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Groups API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Groups + ////////////////////////////////////////////////////// + + /** Decode the EmptyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsEmptyResponse decodeEmptyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ApplyToGroupResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsApplyToGroupResponse decodeApplyToGroupResponseResponse(UPlayFabJsonObject* response); + + /** Decode the CreateGroupResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsCreateGroupResponse decodeCreateGroupResponseResponse(UPlayFabJsonObject* response); + + /** Decode the CreateGroupRoleResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsCreateGroupRoleResponse decodeCreateGroupRoleResponseResponse(UPlayFabJsonObject* response); + + /** Decode the GetGroupResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsGetGroupResponse decodeGetGroupResponseResponse(UPlayFabJsonObject* response); + + /** Decode the InviteToGroupResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsInviteToGroupResponse decodeInviteToGroupResponseResponse(UPlayFabJsonObject* response); + + /** Decode the IsMemberResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsIsMemberResponse decodeIsMemberResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ListGroupApplicationsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsListGroupApplicationsResponse decodeListGroupApplicationsResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ListGroupBlocksResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsListGroupBlocksResponse decodeListGroupBlocksResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ListGroupInvitationsResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsListGroupInvitationsResponse decodeListGroupInvitationsResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ListGroupMembersResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsListGroupMembersResponse decodeListGroupMembersResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ListMembershipResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsListMembershipResponse decodeListMembershipResponseResponse(UPlayFabJsonObject* response); + + /** Decode the ListMembershipOpportunitiesResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsListMembershipOpportunitiesResponse decodeListMembershipOpportunitiesResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateGroupResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsUpdateGroupResponse decodeUpdateGroupResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateGroupRoleResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Groups | Groups Models") + static FGroupsUpdateGroupRoleResponse decodeUpdateGroupRoleResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabGroupsModels.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabGroupsModels.h new file mode 100644 index 000000000..ade743bce --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabGroupsModels.h @@ -0,0 +1,632 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Groups +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabGroupsModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Groups API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Groups +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FGroupsAcceptGroupApplicationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Optional. Type of the entity to accept as. If specified, must be the same entity as the claimant or an entity that is a + * child of the claimant entity. Defaults to the claimant entity. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsEmptyResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FGroupsAcceptGroupInvitationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsAddMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** List of entities to add to the group. Only entities of type title_player_account and character may be added to groups. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Members; + /** + * Optional: The ID of the existing role to add the entities to. If this is not specified, the default member role for the + * group will be used. Role IDs must be between 1 and 64 characters long. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsApplyToGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional, default true. Automatically accept an outstanding invitation if one exists instead of creating an application */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + bool AutoAcceptOutstandingInvite = false; + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +/** Describes an application to join a group */ +USTRUCT(BlueprintType) +struct FGroupsApplyToGroupResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Type of entity that requested membership */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** When the application to join will expire and be deleted */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString Expires; + /** ID of the group that the entity requesting membership to */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsBlockEntityRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsChangeMemberRoleRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The ID of the role that the entities will become a member of. This must be an existing role. Role IDs must be between 1 + * and 64 characters long. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString DestinationRoleId; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** + * List of entities to move between roles in the group. All entities in this list must be members of the group and origin + * role. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Members; + /** The ID of the role that the entities currently are a member of. Role IDs must be between 1 and 64 characters long. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString OriginRoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsCreateGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The name of the group. This is unique at the title level by default. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString GroupName; +}; + +USTRUCT(BlueprintType) +struct FGroupsCreateGroupResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The ID of the administrator role for the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString AdminRoleId; + /** The server date and time the group was created. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString Created; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** The name of the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString GroupName; + /** The ID of the default member role for the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString MemberRoleId; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ProfileVersion = 0; + /** The list of roles and names that belong to the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Roles; +}; + +USTRUCT(BlueprintType) +struct FGroupsCreateGroupRoleRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** + * The ID of the role. This must be unique within the group and cannot be changed. Role IDs must be between 1 and 64 + * characters long. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; + /** + * The name of the role. This must be unique within the group and can be changed later. Role names must be between 1 and + * 100 characters long + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleName; +}; + +USTRUCT(BlueprintType) +struct FGroupsCreateGroupRoleResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The current version of the group profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ProfileVersion = 0; + /** ID for the role */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; + /** The name of the role */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleName; +}; + +USTRUCT(BlueprintType) +struct FGroupsDeleteGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** ID of the group or role to remove */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsDeleteRoleRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** The ID of the role to delete. Role IDs must be between 1 and 64 characters long. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsGetGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** The full name of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString GroupName; +}; + +USTRUCT(BlueprintType) +struct FGroupsGetGroupResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The ID of the administrator role for the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString AdminRoleId; + /** The server date and time the group was created. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString Created; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** The name of the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString GroupName; + /** The ID of the default member role for the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString MemberRoleId; + /** The current version of the profile, can be used for concurrency control during updates. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ProfileVersion = 0; + /** The list of roles and names that belong to the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Roles; +}; + +USTRUCT(BlueprintType) +struct FGroupsInviteToGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional, default true. Automatically accept an application if one exists instead of creating an invitation */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + bool AutoAcceptOutstandingApplication = false; + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** + * Optional. ID of an existing a role in the group to assign the user to. The group's default member role is used if this + * is not specified. Role IDs must be between 1 and 64 characters long. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; +}; + +/** Describes an invitation to a group. */ +USTRUCT(BlueprintType) +struct FGroupsInviteToGroupResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** When the invitation will expire and be deleted */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString Expires; + /** The group that the entity invited to */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** The entity that created the invitation */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* InvitedByEntity = nullptr; + /** The entity that is invited */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* InvitedEntity = nullptr; + /** ID of the role in the group to assign the user to. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsIsMemberRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** + * Optional: ID of the role to check membership of. Defaults to any role (that is, check to see if the entity is a member + * of the group in any capacity) if not specified. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsIsMemberResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** A value indicating whether or not the entity is a member. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + bool IsMember = false; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupApplicationsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupApplicationsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list of applications to the group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Applications; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupBlocksRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupBlocksResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list blocked entities. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray BlockedEntities; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupInvitationsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupInvitationsResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list of group invitations. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Invitations; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** ID of the group to list the members and roles for */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsListGroupMembersResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list of roles and member entity IDs. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Members; +}; + +USTRUCT(BlueprintType) +struct FGroupsListMembershipRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsListMembershipResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The list of groups */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Groups; +}; + +USTRUCT(BlueprintType) +struct FGroupsListMembershipOpportunitiesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsListMembershipOpportunitiesResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list of group applications. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Applications; + /** The requested list of group invitations. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Invitations; +}; + +USTRUCT(BlueprintType) +struct FGroupsRemoveGroupApplicationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsRemoveGroupInvitationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsRemoveMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** List of entities to remove */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + TArray Members; + /** The ID of the role to remove the entities from. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsUnblockEntityRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Entity = nullptr; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; +}; + +USTRUCT(BlueprintType) +struct FGroupsUpdateGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional: the ID of an existing role to set as the new administrator role for the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString AdminRoleId; + /** + * Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from the + * GetGroup API, you can ensure that the group data update will only be performed if the group has not been updated by any + * other clients since the version you last loaded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ExpectedProfileVersion = 0; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** Optional: the new name of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString GroupName; + /** Optional: the ID of an existing role to set as the new member role for the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString MemberRoleId; +}; + +USTRUCT(BlueprintType) +struct FGroupsUpdateGroupResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional reason to explain why the operation was the result that it was. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString OperationReason; + /** New version of the group data. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ProfileVersion = 0; + /** Indicates which operation was completed, either Created, Updated, Deleted or None. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + EOperationTypes SetResult; +}; + +USTRUCT(BlueprintType) +struct FGroupsUpdateGroupRoleRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from the + * GetGroup API, you can ensure that the group data update will only be performed if the group has not been updated by any + * other clients since the version you last loaded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ExpectedProfileVersion = 0; + /** The identifier of the group */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + UPlayFabJsonObject* Group = nullptr; + /** ID of the role to update. Role IDs must be between 1 and 64 characters long. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleId; + /** The new name of the role */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString RoleName; +}; + +USTRUCT(BlueprintType) +struct FGroupsUpdateGroupRoleResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional reason to explain why the operation was the result that it was. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + FString OperationReason; + /** New version of the role data. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + int32 ProfileVersion = 0; + /** Indicates which operation was completed, either Created, Updated, Deleted or None. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Groups | Groups Models") + EOperationTypes SetResult; +}; + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabJsonObject.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabJsonObject.h new file mode 100644 index 000000000..403cb9a8b --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabJsonObject.h @@ -0,0 +1,179 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// JSon Objects +// These are used as a wrapper for the internal json objects. +// Originally wriiten by Vladimir Alyamkin. +// Updated by Joshua Lyons to include null values +//////////////////////////////////////////////////////////// + +#pragma once + +#include "CoreMinimal.h" +#include "Json.h" +#include "PlayFabJsonObject.generated.h" + +class UPlayFabJsonValue; + +/** + * Blueprintable FJsonObject wrapper + */ +UCLASS(BlueprintType, Blueprintable) +class PLAYFAB_API UPlayFabJsonObject : public UObject +{ + GENERATED_UCLASS_BODY() + + /** Create new Json object */ + UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Object", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "PlayFab | Json") + static UPlayFabJsonObject* ConstructJsonObject(UObject* WorldContextObject); + + /** Reset all internal data */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void Reset(); + + /** Get the root Json object */ + TSharedPtr& GetRootObject(); + + /** Set the root Json object */ + void SetRootObject(TSharedPtr& JsonObject); + + + ////////////////////////////////////////////////////////////////////////// + // Serialization + + /** Serialize Json to string */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + FString EncodeJson() const; + + /** Construct Json object from string */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + bool DecodeJson(const FString& JsonString); + + + ////////////////////////////////////////////////////////////////////////// + // FJsonObject API + + /** Returns a list of field names that exist in the object */ + UFUNCTION(BlueprintPure, Category = "PlayFab | Json") + TArray GetFieldNames(); + + /** Checks to see if the FieldName exists in the object */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + bool HasField(const FString& FieldName) const; + + /** Remove field named FieldName */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void RemoveField(const FString& FieldName); + + /** Get the field named FieldName as a JsonValue */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + UPlayFabJsonValue* GetField(const FString& FieldName) const; + + /** Add a field named FieldName with a Value */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetField(const FString& FieldName, UPlayFabJsonValue* JsonValue); + + /** Add a field named FieldName with a null value */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetFieldNull(const FString& FieldName); + + /** Get the field named FieldName as a Json Array */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + TArray GetArrayField(const FString& FieldName); + + /** Set an ObjectField named FieldName and value of Json Array */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetArrayField(const FString& FieldName, const TArray& InArray); + + /** Adds all of the fields from one json object to this one */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void MergeJsonObject(UPlayFabJsonObject* InJsonObject, bool Overwrite); + + + ////////////////////////////////////////////////////////////////////////// + // FJsonObject API Helpers (easy to use with simple Json objects) + + /** Get the field named FieldName as a number. Ensures that the field is present and is of type Json number. + * Attn.!! float used instead of double to make the function blueprintable! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + float GetNumberField(const FString& FieldName) const; + + /** Add a field named FieldName with Number as value + * Attn.!! float used instead of double to make the function blueprintable! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetNumberField(const FString& FieldName, float Number); + + /** Get the field named FieldName as a string. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + FString GetStringField(const FString& FieldName) const; + + /** Add a field named FieldName with value of StringValue */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetStringField(const FString& FieldName, const FString& StringValue); + + /** Get the field named FieldName as a boolean. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + bool GetBoolField(const FString& FieldName) const; + + /** Set a boolean field named FieldName and value of InValue */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetBoolField(const FString& FieldName, bool InValue); + + /** Get the field named FieldName as a Json object. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + UPlayFabJsonObject* GetObjectField(const FString& FieldName) const; + + /** Set an ObjectField named FieldName and value of JsonObject */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetObjectField(const FString& FieldName, UPlayFabJsonObject* JsonObject); + + + ////////////////////////////////////////////////////////////////////////// + // Array fields helpers (uniform arrays) + + /** Get the field named FieldName as a Number Array. Use it only if you're sure that array is uniform! + * Attn.!! float used instead of double to make the function blueprintable! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + TArray GetNumberArrayField(const FString& FieldName); + + /** Set an ObjectField named FieldName and value of Number Array + * Attn.!! float used instead of double to make the function blueprintable! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetNumberArrayField(const FString& FieldName, const TArray& NumberArray); + + /** Get the field named FieldName as a String Array. Use it only if you're sure that array is uniform! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + TArray GetStringArrayField(const FString& FieldName); + + /** Set an ObjectField named FieldName and value of String Array */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetStringArrayField(const FString& FieldName, const TArray& StringArray); + + /** Get the field named FieldName as a Bool Array. Use it only if you're sure that array is uniform! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + TArray GetBoolArrayField(const FString& FieldName); + + /** Set an ObjectField named FieldName and value of Bool Array */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetBoolArrayField(const FString& FieldName, const TArray& BoolArray); + + /** Get the field named FieldName as an Object Array. Use it only if you're sure that array is uniform! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + TArray GetObjectArrayField(const FString& FieldName); + + /** Set an ObjectField named FieldName and value of Ob Array */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + void SetObjectArrayField(const FString& FieldName, const TArray& ObjectArray); + + + ////////////////////////////////////////////////////////////////////////// + // Data + +private: + /** Internal JSON data */ + TSharedPtr JsonObj; + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabJsonValue.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabJsonValue.h new file mode 100644 index 000000000..6284ca074 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabJsonValue.h @@ -0,0 +1,129 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// JSonValue Objects +// These are used as a wrapper for the internal json values. +// Originally wriiten by Vladimir Alyamkin. +//////////////////////////////////////////////////////////// + +#pragma once + +#include "CoreMinimal.h" +#include "Json.h" +#include "PlayFabJsonValue.generated.h" + +class UPlayFabJsonObject; + +/** + * Represents all the types a Json Value can be. + */ +UENUM(BlueprintType) +namespace EPFJson +{ + enum Type + { + None, + Null, + String, + Number, + Boolean, + Array, + Object, + }; +} + +/** + * Blueprintable FJsonValue wrapper + */ +UCLASS(BlueprintType, Blueprintable) +class PLAYFAB_API UPlayFabJsonValue : public UObject +{ + GENERATED_UCLASS_BODY() + + /** Create new Json Number value + * Attn.!! float used instead of double to make the function blueprintable! */ + UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Number Value", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "PlayFab | Json") + static UPlayFabJsonValue* ConstructJsonValueNumber(UObject* WorldContextObject, float Number); + + /** Create new Json String value */ + UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json String Value", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "PlayFab | Json") + static UPlayFabJsonValue* ConstructJsonValueString(UObject* WorldContextObject, const FString& StringValue); + + /** Create new Json Bool value */ + UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Bool Value", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "PlayFab | Json") + static UPlayFabJsonValue* ConstructJsonValueBool(UObject* WorldContextObject, bool InValue); + + /** Create new Json Array value */ + UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Array Value", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "PlayFab | Json") + static UPlayFabJsonValue* ConstructJsonValueArray(UObject* WorldContextObject, const TArray& InArray); + + /** Create new Json Object value */ + UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Object Value", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "PlayFab | Json") + static UPlayFabJsonValue* ConstructJsonValueObject(UObject* WorldContextObject, UPlayFabJsonObject *JsonObject); + + /** Create new Json value from FJsonValue (to be used from PlayFabJsonObject) */ + static UPlayFabJsonValue* ConstructJsonValue(UObject* WorldContextObject, const TSharedPtr& InValue); + + /** Get the root Json value */ + TSharedPtr& GetRootValue(); + + /** Set the root Json value */ + void SetRootValue(TSharedPtr& JsonValue); + + + ////////////////////////////////////////////////////////////////////////// + // FJsonValue API + + /** Get type of Json value (Enum) */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + EPFJson::Type GetType() const; + + /** Get type of Json value (String) */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + FString GetTypeString() const; + + /** Returns true if this value is a 'null' */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + bool IsNull() const; + + /** Returns this value as a double, throwing an error if this is not an Json Number + * Attn.!! float used instead of double to make the function blueprintable! */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + float AsNumber() const; + + /** Returns this value as a number, throwing an error if this is not an Json String */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + FString AsString() const; + + /** Returns this value as a boolean, throwing an error if this is not an Json Bool */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + bool AsBool() const; + + /** Returns this value as an array, throwing an error if this is not an Json Array */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + TArray AsArray() const; + + /** Returns this value as an object, throwing an error if this is not an Json Object */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Json") + UPlayFabJsonObject* AsObject(); + + + ////////////////////////////////////////////////////////////////////////// + // Data + +private: + /** Internal JSON data */ + TSharedPtr JsonVal; + + + ////////////////////////////////////////////////////////////////////////// + // Helpers + +protected: + /** Simple error logger */ + void ErrorMessage(const FString& InType) const; + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationAPI.h new file mode 100644 index 000000000..95b86b4ff --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationAPI.h @@ -0,0 +1,104 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Localization +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabLocalizationModels.h" +#include "PlayFabLocalizationAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabLocalizationRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabLocalizationAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabLocalizationRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Localization API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Localization + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLanguageList, FLocalizationGetLanguageListResponse, result, UObject*, customData); + + /** Retrieves the list of allowed languages, only accessible by title entities */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Localization | Localization ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabLocalizationAPI* GetLanguageList(FLocalizationGetLanguageListRequest request, + FDelegateOnSuccessGetLanguageList onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabLocalizationRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Localization | Localization ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLanguageList(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessGetLanguageList OnSuccessGetLanguageList; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationModelDecoder.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationModelDecoder.h new file mode 100644 index 000000000..07bf12408 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationModelDecoder.h @@ -0,0 +1,45 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Localization +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabLocalizationModels.h" +#include "PlayFabLocalizationModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabLocalizationModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Localization API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Localization + ////////////////////////////////////////////////////// + + /** Decode the GetLanguageListResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Localization | Localization Models") + static FLocalizationGetLanguageListResponse decodeGetLanguageListResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationModels.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationModels.h new file mode 100644 index 000000000..fa32d424e --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabLocalizationModels.h @@ -0,0 +1,47 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Localization +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabLocalizationModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Localization API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Localization +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FLocalizationGetLanguageListRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FLocalizationGetLanguageListResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The list of Playfab-supported languages */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Localization | Localization Models") + FString LanguageList; +}; + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerAPI.h new file mode 100644 index 000000000..0164b9bb8 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerAPI.h @@ -0,0 +1,163 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Matchmaker +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabMatchmakerModels.h" +#include "PlayFabMatchmakerAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabMatchmakerRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabMatchmakerAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabMatchmakerRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Matchmaker API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAuthUser, FMatchmakerAuthUserResponse, result, UObject*, customData); + + /** Validates a user with the PlayFab service */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabMatchmakerAPI* AuthUser(FMatchmakerAuthUserRequest request, + FDelegateOnSuccessAuthUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabMatchmakerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAuthUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessPlayerJoined, FMatchmakerPlayerJoinedResponse, result, UObject*, customData); + + /** Informs the PlayFab game server hosting service that the indicated user has joined the Game Server Instance specified */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabMatchmakerAPI* PlayerJoined(FMatchmakerPlayerJoinedRequest request, + FDelegateOnSuccessPlayerJoined onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabMatchmakerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperPlayerJoined(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessPlayerLeft, FMatchmakerPlayerLeftResponse, result, UObject*, customData); + + /** Informs the PlayFab game server hosting service that the indicated user has left the Game Server Instance specified */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabMatchmakerAPI* PlayerLeft(FMatchmakerPlayerLeftRequest request, + FDelegateOnSuccessPlayerLeft onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabMatchmakerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperPlayerLeft(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessStartGame, FMatchmakerStartGameResponse, result, UObject*, customData); + + /** Instructs the PlayFab game server hosting service to instantiate a new Game Server Instance */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabMatchmakerAPI* StartGame(FMatchmakerStartGameRequest request, + FDelegateOnSuccessStartGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabMatchmakerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperStartGame(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUserInfo, FMatchmakerUserInfoResponse, result, UObject*, customData); + + /** + * Retrieves the relevant details for a specified user, which the external match-making service can then use to compute + * effective matches + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabMatchmakerAPI* UserInfo(FMatchmakerUserInfoRequest request, + FDelegateOnSuccessUserInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabMatchmakerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUserInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessAuthUser OnSuccessAuthUser; + FDelegateOnSuccessPlayerJoined OnSuccessPlayerJoined; + FDelegateOnSuccessPlayerLeft OnSuccessPlayerLeft; + FDelegateOnSuccessStartGame OnSuccessStartGame; + FDelegateOnSuccessUserInfo OnSuccessUserInfo; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerModelDecoder.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerModelDecoder.h new file mode 100644 index 000000000..f4df43e96 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerModelDecoder.h @@ -0,0 +1,61 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Matchmaker +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabMatchmakerModels.h" +#include "PlayFabMatchmakerModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabMatchmakerModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Matchmaker API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + + /** Decode the AuthUserResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking Models") + static FMatchmakerAuthUserResponse decodeAuthUserResponseResponse(UPlayFabJsonObject* response); + + /** Decode the PlayerJoinedResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking Models") + static FMatchmakerPlayerJoinedResponse decodePlayerJoinedResponseResponse(UPlayFabJsonObject* response); + + /** Decode the PlayerLeftResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking Models") + static FMatchmakerPlayerLeftResponse decodePlayerLeftResponseResponse(UPlayFabJsonObject* response); + + /** Decode the StartGameResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking Models") + static FMatchmakerStartGameResponse decodeStartGameResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UserInfoResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Matchmaker | Matchmaking Models") + static FMatchmakerUserInfoResponse decodeUserInfoResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerModels.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerModels.h new file mode 100644 index 000000000..3db054cb5 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabMatchmakerModels.h @@ -0,0 +1,197 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Matchmaker +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabMatchmakerModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Matchmaker API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FMatchmakerAuthUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Session Ticket provided by the client. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString AuthorizationTicket; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerAuthUserResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Boolean indicating if the user has been authorized to use the external match-making service. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + bool Authorized = false; + /** PlayFab unique identifier of the account that has been authorized. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerPlayerJoinedRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Unique identifier of the Game Server Instance the user is joining. This must be a Game Server Instance started with the + * Matchmaker/StartGame API. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString LobbyId; + /** PlayFab unique identifier for the player joining. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerPlayerJoinedResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FMatchmakerPlayerLeftRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Unique identifier of the Game Server Instance the user is leaving. This must be a Game Server Instance started with the + * Matchmaker/StartGame API. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString LobbyId; + /** PlayFab unique identifier for the player leaving. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerPlayerLeftResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FMatchmakerStartGameRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the previously uploaded build executable which is to be started. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString Build; + /** Custom command line argument when starting game server process. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString CustomCommandLineData; + /** + * HTTP endpoint URL for receiving game status events, if using an external matchmaker. When the game ends, PlayFab will + * make a POST request to this URL with the X-SecretKey header set to the value of the game's secret and an + * application/json body of { "EventName": "game_ended", "GameID": "" }. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString ExternalMatchmakerEventEndpoint; + /** Game mode for this Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString GameMode; + /** Region with which to associate the server, for filtering. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + ERegion Region; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerStartGameResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the game/lobby in the new Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString GameID; + /** IPV4 address of the new Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString ServerHostname; + /** IPV4 address of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString ServerIPV4Address; + /** IPV6 address of the new Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString ServerIPV6Address; + /** Port number for communication with the Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + int32 ServerPort = 0; + /** Public DNS name (if any) of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString ServerPublicDNSName; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerUserInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Minimum catalog version for which data is requested (filters the results to only contain inventory items which have a + * catalog version of this or higher). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + int32 MinCatalogVersion = 0; + /** PlayFab unique identifier of the user whose information is being requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FMatchmakerUserInfoResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of inventory items in the user's current inventory. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + TArray Inventory; + /** Boolean indicating whether the user is a developer. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + bool IsDeveloper = false; + /** PlayFab unique identifier of the user whose information was requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString PlayFabId; + /** Steam unique identifier, if the user has an associated Steam account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString SteamId; + /** Title specific display name, if set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString TitleDisplayName; + /** PlayFab unique user name. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + FString Username; + /** Array of virtual currency balance(s) belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + UPlayFabJsonObject* VirtualCurrency; + /** Array of remaining times and timestamps for virtual currencies. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Matchmaker | Matchmaking Models") + UPlayFabJsonObject* VirtualCurrencyRechargeTimes = nullptr; +}; + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabProfilesAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabProfilesAPI.h new file mode 100644 index 000000000..4a7a22704 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabProfilesAPI.h @@ -0,0 +1,174 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Profiles +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabProfilesModels.h" +#include "PlayFabProfilesAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabProfilesRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabProfilesAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabProfilesRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Profiles API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetGlobalPolicy, FProfilesGetGlobalPolicyResponse, result, UObject*, customData); + + /** Gets the global title access policy */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabProfilesAPI* GetGlobalPolicy(FProfilesGetGlobalPolicyRequest request, + FDelegateOnSuccessGetGlobalPolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabProfilesRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetGlobalPolicy(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetProfile, FProfilesGetEntityProfileResponse, result, UObject*, customData); + + /** Retrieves the entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabProfilesAPI* GetProfile(FProfilesGetEntityProfileRequest request, + FDelegateOnSuccessGetProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabProfilesRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetProfile(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetProfiles, FProfilesGetEntityProfilesResponse, result, UObject*, customData); + + /** Retrieves the entity's profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabProfilesAPI* GetProfiles(FProfilesGetEntityProfilesRequest request, + FDelegateOnSuccessGetProfiles onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabProfilesRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetProfiles(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetGlobalPolicy, FProfilesSetGlobalPolicyResponse, result, UObject*, customData); + + /** Sets the global title access policy */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabProfilesAPI* SetGlobalPolicy(FProfilesSetGlobalPolicyRequest request, + FDelegateOnSuccessSetGlobalPolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabProfilesRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetGlobalPolicy(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetProfileLanguage, FProfilesSetProfileLanguageResponse, result, UObject*, customData); + + /** Updates the entity's language */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabProfilesAPI* SetProfileLanguage(FProfilesSetProfileLanguageRequest request, + FDelegateOnSuccessSetProfileLanguage onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabProfilesRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetProfileLanguage(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetProfilePolicy, FProfilesSetEntityProfilePolicyResponse, result, UObject*, customData); + + /** Sets the profiles access policy */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabProfilesAPI* SetProfilePolicy(FProfilesSetEntityProfilePolicyRequest request, + FDelegateOnSuccessSetProfilePolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabProfilesRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetProfilePolicy(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessGetGlobalPolicy OnSuccessGetGlobalPolicy; + FDelegateOnSuccessGetProfile OnSuccessGetProfile; + FDelegateOnSuccessGetProfiles OnSuccessGetProfiles; + FDelegateOnSuccessSetGlobalPolicy OnSuccessSetGlobalPolicy; + FDelegateOnSuccessSetProfileLanguage OnSuccessSetProfileLanguage; + FDelegateOnSuccessSetProfilePolicy OnSuccessSetProfilePolicy; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabProfilesModelDecoder.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabProfilesModelDecoder.h new file mode 100644 index 000000000..b8ed1ec3f --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabProfilesModelDecoder.h @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Profiles +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabProfilesModels.h" +#include "PlayFabProfilesModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabProfilesModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Profiles API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + + /** Decode the GetGlobalPolicyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management Models") + static FProfilesGetGlobalPolicyResponse decodeGetGlobalPolicyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the GetEntityProfileResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management Models") + static FProfilesGetEntityProfileResponse decodeGetEntityProfileResponseResponse(UPlayFabJsonObject* response); + + /** Decode the GetEntityProfilesResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management Models") + static FProfilesGetEntityProfilesResponse decodeGetEntityProfilesResponseResponse(UPlayFabJsonObject* response); + + /** Decode the SetGlobalPolicyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management Models") + static FProfilesSetGlobalPolicyResponse decodeSetGlobalPolicyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the SetProfileLanguageResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management Models") + static FProfilesSetProfileLanguageResponse decodeSetProfileLanguageResponseResponse(UPlayFabJsonObject* response); + + /** Decode the SetEntityProfilePolicyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Profiles | Account Management Models") + static FProfilesSetEntityProfilePolicyResponse decodeSetEntityProfilePolicyResponseResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabProfilesModels.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabProfilesModels.h new file mode 100644 index 000000000..14a6d616e --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabProfilesModels.h @@ -0,0 +1,171 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Profiles +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabProfilesModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Profiles API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FProfilesGetGlobalPolicyRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FProfilesGetGlobalPolicyResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The permissions that govern access to all entities under this title or namespace. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + TArray Permissions; +}; + +USTRUCT(BlueprintType) +struct FProfilesGetEntityProfileRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Determines whether the objects will be returned as an escaped JSON string or as a un-escaped JSON object. Default is + * JSON string. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + bool DataAsObject = false; + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + UPlayFabJsonObject* Entity = nullptr; +}; + +USTRUCT(BlueprintType) +struct FProfilesGetEntityProfileResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Entity profile */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + UPlayFabJsonObject* Profile = nullptr; +}; + +USTRUCT(BlueprintType) +struct FProfilesGetEntityProfilesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Determines whether the objects will be returned as an escaped JSON string or as a un-escaped JSON object. Default is + * JSON string. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + bool DataAsObject = false; + /** Entity keys of the profiles to load. Must be between 1 and 25 */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + TArray Entities; +}; + +USTRUCT(BlueprintType) +struct FProfilesGetEntityProfilesResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** Entity profiles */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + TArray Profiles; +}; + +USTRUCT(BlueprintType) +struct FProfilesSetGlobalPolicyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The permissions that govern access to all entities under this title or namespace. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + TArray Permissions; +}; + +USTRUCT(BlueprintType) +struct FProfilesSetGlobalPolicyResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FProfilesSetProfileLanguageRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + UPlayFabJsonObject* Entity = nullptr; + /** The expected version of a profile to perform this update on */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + int32 ExpectedVersion = 0; + /** The language to set on the given entity. Deletes the profile's language if passed in a null string. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + FString Language; +}; + +USTRUCT(BlueprintType) +struct FProfilesSetProfileLanguageResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** The type of operation that occured on the profile's language */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + EOperationTypes OperationResult; + /** The updated version of the profile after the language update */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + int32 VersionNumber = 0; +}; + +USTRUCT(BlueprintType) +struct FProfilesSetEntityProfilePolicyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The entity to perform this action on. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + UPlayFabJsonObject* Entity = nullptr; + /** The statements to include in the access policy. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + TArray Statements; +}; + +USTRUCT(BlueprintType) +struct FProfilesSetEntityProfilePolicyResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The permissions that govern access to this entity profile and its properties. Only includes permissions set on this + * profile, not global statements from titles and namespaces. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Profiles | Account Management Models") + TArray Permissions; +}; + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabServerAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabServerAPI.h new file mode 100644 index 000000000..d8bd44f82 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabServerAPI.h @@ -0,0 +1,1828 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the function definitions. +// +// API: Server +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Http.h" +#include "Net/OnlineBlueprintCallProxyBase.h" +#include "PlayFabBaseModel.h" +#include "PlayFabServerModels.h" +#include "PlayFabServerAPI.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnPlayFabServerRequestCompleted, FPlayFabBaseModel, response, UObject*, customData, bool, successful); + +UCLASS(Blueprintable, BlueprintType) +class UPlayFabServerAPI : public UOnlineBlueprintCallProxyBase +{ + GENERATED_UCLASS_BODY() + +public: + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnFailurePlayFabError, FPlayFabError, error, UObject*, customData); + + UPROPERTY(BlueprintAssignable) + FOnPlayFabServerRequestCompleted OnPlayFabResponse; + + /** Set the Request Json object */ + void SetRequestObject(UPlayFabJsonObject* JsonObject); + + /** Get the Response Json object */ + UPlayFabJsonObject* GetResponseObject(); + + /** Applies percent-encoding to text */ + static FString PercentEncode(const FString& Text); + + /** Reset saved response data */ + void ResetResponseData(); + + /** UOnlineBlueprintCallProxyBase interface */ + virtual void Activate() override; + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Server API Functions + ////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessBanUsers, FServerBanUsersResult, result, UObject*, customData); + + /** Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* BanUsers(FServerBanUsersRequest request, + FDelegateOnSuccessBanUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperBanUsers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerProfile, FServerGetPlayerProfileResult, result, UObject*, customData); + + /** Retrieves the player's profile */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayerProfile(FServerGetPlayerProfileRequest request, + FDelegateOnSuccessGetPlayerProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerProfile(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs, FServerGetPlayFabIDsFromFacebookIDsResult, result, UObject*, customData); + + /** Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayFabIDsFromFacebookIDs(FServerGetPlayFabIDsFromFacebookIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromFacebookIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds, FServerGetPlayFabIDsFromFacebookInstantGamesIdsResult, result, UObject*, customData); + + /** Retrieves the unique PlayFab identifiers for the given set of Facebook Instant Games identifiers. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayFabIDsFromFacebookInstantGamesIds(FServerGetPlayFabIDsFromFacebookInstantGamesIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromFacebookInstantGamesIds(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds, FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsResult, result, UObject*, customData); + + /** Retrieves the unique PlayFab identifiers for the given set of Nintendo Switch Device identifiers. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayFabIDsFromNintendoSwitchDeviceIds(FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromNintendoSwitchDeviceIds(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayFabIDsFromSteamIDs, FServerGetPlayFabIDsFromSteamIDsResult, result, UObject*, customData); + + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile + * IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayFabIDsFromSteamIDs(FServerGetPlayFabIDsFromSteamIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromSteamIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayFabIDsFromSteamIDs(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserAccountInfo, FServerGetUserAccountInfoResult, result, UObject*, customData); + + /** Retrieves the relevant details for a specified user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserAccountInfo(FServerGetUserAccountInfoRequest request, + FDelegateOnSuccessGetUserAccountInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserAccountInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserBans, FServerGetUserBansResult, result, UObject*, customData); + + /** Gets all bans for a user. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserBans(FServerGetUserBansRequest request, + FDelegateOnSuccessGetUserBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserBans(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeAllBansForUser, FServerRevokeAllBansForUserResult, result, UObject*, customData); + + /** Revoke all active bans for a user. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RevokeAllBansForUser(FServerRevokeAllBansForUserRequest request, + FDelegateOnSuccessRevokeAllBansForUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeAllBansForUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeBans, FServerRevokeBansResult, result, UObject*, customData); + + /** Revoke all active bans specified with BanId. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RevokeBans(FServerRevokeBansRequest request, + FDelegateOnSuccessRevokeBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeBans(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSendCustomAccountRecoveryEmail, FServerSendCustomAccountRecoveryEmailResult, result, UObject*, customData); + + /** + * Forces an email to be sent to the registered contact email address for the user's account based on an account recovery + * email template + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SendCustomAccountRecoveryEmail(FServerSendCustomAccountRecoveryEmailRequest request, + FDelegateOnSuccessSendCustomAccountRecoveryEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSendCustomAccountRecoveryEmail(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSendEmailFromTemplate, FServerSendEmailFromTemplateResult, result, UObject*, customData); + + /** Sends an email based on an email template to a player's contact email */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SendEmailFromTemplate(FServerSendEmailFromTemplateRequest request, + FDelegateOnSuccessSendEmailFromTemplate onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSendEmailFromTemplate(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSendPushNotification, FServerSendPushNotificationResult, result, UObject*, customData); + + /** + * Sends an iOS/Android Push Notification to a specific user, if that user's device has been configured for Push + * Notifications in PlayFab. If a user has linked both Android and iOS devices, both will be notified. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SendPushNotification(FServerSendPushNotificationRequest request, + FDelegateOnSuccessSendPushNotification onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSendPushNotification(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateAvatarUrl, FServerEmptyResponse, result, UObject*, customData); + + /** Update the avatar URL of the specified player */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateAvatarUrl(FServerUpdateAvatarUrlRequest request, + FDelegateOnSuccessUpdateAvatarUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateAvatarUrl(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateBans, FServerUpdateBansResult, result, UObject*, customData); + + /** Updates information of a list of existing bans specified with Ban Ids. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateBans(FServerUpdateBansRequest request, + FDelegateOnSuccessUpdateBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateBans(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Analytics + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWriteCharacterEvent, FServerWriteEventResponse, result, UObject*, customData); + + /** Writes a character-based event into PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* WriteCharacterEvent(FServerWriteServerCharacterEventRequest request, + FDelegateOnSuccessWriteCharacterEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWriteCharacterEvent(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWritePlayerEvent, FServerWriteEventResponse, result, UObject*, customData); + + /** Writes a player-based event into PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* WritePlayerEvent(FServerWriteServerPlayerEventRequest request, + FDelegateOnSuccessWritePlayerEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWritePlayerEvent(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessWriteTitleEvent, FServerWriteEventResponse, result, UObject*, customData); + + /** Writes a title-based event into PlayStream. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* WriteTitleEvent(FServerWriteTitleEventRequest request, + FDelegateOnSuccessWriteTitleEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics ", meta = (BlueprintInternalUseOnly = "true")) + void HelperWriteTitleEvent(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAuthenticateSessionTicket, FServerAuthenticateSessionTicketResult, result, UObject*, customData); + + /** Validated a client's session ticket, and if successful, returns details for that user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AuthenticateSessionTicket(FServerAuthenticateSessionTicketRequest request, + FDelegateOnSuccessAuthenticateSessionTicket onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAuthenticateSessionTicket(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetPlayerSecret, FServerSetPlayerSecretResult, result, UObject*, customData); + + /** + * Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's + * secret use the Admin or Server API method SetPlayerSecret. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetPlayerSecret(FServerSetPlayerSecretRequest request, + FDelegateOnSuccessSetPlayerSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Authentication ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetPlayerSecret(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Character Data + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterData, FServerGetCharacterDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCharacterData(FServerGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterInternalData, FServerGetCharacterDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user's character which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCharacterInternalData(FServerGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterReadOnlyData, FServerGetCharacterDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user's character which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCharacterReadOnlyData(FServerGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCharacterData, FServerUpdateCharacterDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user's character which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateCharacterData(FServerUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCharacterInternalData, FServerUpdateCharacterDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user's character which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateCharacterInternalData(FServerUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCharacterInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCharacterReadOnlyData, FServerUpdateCharacterDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user's character which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateCharacterReadOnlyData(FServerUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCharacterReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Characters + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteCharacterFromUser, FServerDeleteCharacterFromUserResult, result, UObject*, customData); + + /** Deletes the specific character ID from the specified user. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* DeleteCharacterFromUser(FServerDeleteCharacterFromUserRequest request, + FDelegateOnSuccessDeleteCharacterFromUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteCharacterFromUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetAllUsersCharacters, FServerListUsersCharactersResult, result, UObject*, customData); + + /** + * Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be + * evaluated with the parent PlayFabId to guarantee uniqueness. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetAllUsersCharacters(FServerListUsersCharactersRequest request, + FDelegateOnSuccessGetAllUsersCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetAllUsersCharacters(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterLeaderboard, FServerGetCharacterLeaderboardResult, result, UObject*, customData); + + /** Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCharacterLeaderboard(FServerGetCharacterLeaderboardRequest request, + FDelegateOnSuccessGetCharacterLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterStatistics, FServerGetCharacterStatisticsResult, result, UObject*, customData); + + /** Retrieves the details of all title-specific statistics for the specific character */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCharacterStatistics(FServerGetCharacterStatisticsRequest request, + FDelegateOnSuccessGetCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboardAroundCharacter, FServerGetLeaderboardAroundCharacterResult, result, UObject*, customData); + + /** Retrieves a list of ranked characters for the given statistic, centered on the requested user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetLeaderboardAroundCharacter(FServerGetLeaderboardAroundCharacterRequest request, + FDelegateOnSuccessGetLeaderboardAroundCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboardAroundCharacter(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboardForUserCharacters, FServerGetLeaderboardForUsersCharactersResult, result, UObject*, customData); + + /** Retrieves a list of all of the user's characters for the given statistic. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetLeaderboardForUserCharacters(FServerGetLeaderboardForUsersCharactersRequest request, + FDelegateOnSuccessGetLeaderboardForUserCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboardForUserCharacters(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGrantCharacterToUser, FServerGrantCharacterToUserResult, result, UObject*, customData); + + /** + * Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated + * with the parent PlayFabId to guarantee uniqueness. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GrantCharacterToUser(FServerGrantCharacterToUserRequest request, + FDelegateOnSuccessGrantCharacterToUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGrantCharacterToUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateCharacterStatistics, FServerUpdateCharacterStatisticsResult, result, UObject*, customData); + + /** Updates the values of the specified title-specific statistics for the specific character */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateCharacterStatistics(FServerUpdateCharacterStatisticsRequest request, + FDelegateOnSuccessUpdateCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Content + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetContentDownloadUrl, FServerGetContentDownloadUrlResult, result, UObject*, customData); + + /** + * This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned + * URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the + * content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, + * the query to retrieve the data will fail. See this post for more information: + * https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service. Also, + * please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Content ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetContentDownloadUrl(FServerGetContentDownloadUrlRequest request, + FDelegateOnSuccessGetContentDownloadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Content ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetContentDownloadUrl(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Friend List Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddFriend, FServerEmptyResponse, result, UObject*, customData); + + /** + * Adds the Friend user to the friendlist of the user with PlayFabId. At least one of + * FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AddFriend(FServerAddFriendRequest request, + FDelegateOnSuccessAddFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddFriend(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetFriendsList, FServerGetFriendsListResult, result, UObject*, customData); + + /** + * Retrieves the current friends for the user with PlayFabId, constrained to users who have PlayFab accounts. Friends from + * linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetFriendsList(FServerGetFriendsListRequest request, + FDelegateOnSuccessGetFriendsList onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetFriendsList(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveFriend, FServerEmptyResponse, result, UObject*, customData); + + /** Removes the specified friend from the the user's friend list */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RemoveFriend(FServerRemoveFriendRequest request, + FDelegateOnSuccessRemoveFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveFriend(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetFriendTags, FServerEmptyResponse, result, UObject*, customData); + + /** Updates the tag list for a specified user in the friend list of another user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetFriendTags(FServerSetFriendTagsRequest request, + FDelegateOnSuccessSetFriendTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetFriendTags(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeregisterGame, FServerDeregisterGameResponse, result, UObject*, customData); + + /** Inform the matchmaker that a Game Server Instance is removed. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* DeregisterGame(FServerDeregisterGameRequest request, + FDelegateOnSuccessDeregisterGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeregisterGame(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessNotifyMatchmakerPlayerLeft, FServerNotifyMatchmakerPlayerLeftResult, result, UObject*, customData); + + /** Informs the PlayFab match-making service that the user specified has left the Game Server Instance */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* NotifyMatchmakerPlayerLeft(FServerNotifyMatchmakerPlayerLeftRequest request, + FDelegateOnSuccessNotifyMatchmakerPlayerLeft onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperNotifyMatchmakerPlayerLeft(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRedeemMatchmakerTicket, FServerRedeemMatchmakerTicketResult, result, UObject*, customData); + + /** Validates a Game Server session ticket and returns details about the user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RedeemMatchmakerTicket(FServerRedeemMatchmakerTicketRequest request, + FDelegateOnSuccessRedeemMatchmakerTicket onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRedeemMatchmakerTicket(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRefreshGameServerInstanceHeartbeat, FServerRefreshGameServerInstanceHeartbeatResult, result, UObject*, customData); + + /** Set the state of the indicated Game Server Instance. Also update the heartbeat for the instance. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RefreshGameServerInstanceHeartbeat(FServerRefreshGameServerInstanceHeartbeatRequest request, + FDelegateOnSuccessRefreshGameServerInstanceHeartbeat onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRefreshGameServerInstanceHeartbeat(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRegisterGame, FServerRegisterGameResponse, result, UObject*, customData); + + /** Inform the matchmaker that a new Game Server Instance is added. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RegisterGame(FServerRegisterGameRequest request, + FDelegateOnSuccessRegisterGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRegisterGame(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetGameServerInstanceData, FServerSetGameServerInstanceDataResult, result, UObject*, customData); + + /** Sets the custom data of the indicated Game Server Instance */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetGameServerInstanceData(FServerSetGameServerInstanceDataRequest request, + FDelegateOnSuccessSetGameServerInstanceData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetGameServerInstanceData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetGameServerInstanceState, FServerSetGameServerInstanceStateResult, result, UObject*, customData); + + /** Set the state of the indicated Game Server Instance. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetGameServerInstanceState(FServerSetGameServerInstanceStateRequest request, + FDelegateOnSuccessSetGameServerInstanceState onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetGameServerInstanceState(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetGameServerInstanceTags, FServerSetGameServerInstanceTagsResult, result, UObject*, customData); + + /** Set custom tags for the specified Game Server Instance */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetGameServerInstanceTags(FServerSetGameServerInstanceTagsRequest request, + FDelegateOnSuccessSetGameServerInstanceTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetGameServerInstanceTags(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Platform Specific Methods + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAwardSteamAchievement, FServerAwardSteamAchievementResult, result, UObject*, customData); + + /** Awards the specified users the specified Steam achievements */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AwardSteamAchievement(FServerAwardSteamAchievementRequest request, + FDelegateOnSuccessAwardSteamAchievement onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Platform Specific Methods ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAwardSteamAchievement(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Player Data Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteUsers, FServerDeleteUsersResult, result, UObject*, customData); + + /** Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* DeleteUsers(FServerDeleteUsersRequest request, + FDelegateOnSuccessDeleteUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteUsers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetFriendLeaderboard, FServerGetLeaderboardResult, result, UObject*, customData); + + /** + * Retrieves a list of ranked friends of the given player for the given statistic, starting from the indicated point in the + * leaderboard + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetFriendLeaderboard(FServerGetFriendLeaderboardRequest request, + FDelegateOnSuccessGetFriendLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetFriendLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboard, FServerGetLeaderboardResult, result, UObject*, customData); + + /** Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetLeaderboard(FServerGetLeaderboardRequest request, + FDelegateOnSuccessGetLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetLeaderboardAroundUser, FServerGetLeaderboardAroundUserResult, result, UObject*, customData); + + /** Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetLeaderboardAroundUser(FServerGetLeaderboardAroundUserRequest request, + FDelegateOnSuccessGetLeaderboardAroundUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetLeaderboardAroundUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerCombinedInfo, FServerGetPlayerCombinedInfoResult, result, UObject*, customData); + + /** + * Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be + * returned. All parameters default to false. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayerCombinedInfo(FServerGetPlayerCombinedInfoRequest request, + FDelegateOnSuccessGetPlayerCombinedInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerCombinedInfo(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerStatistics, FServerGetPlayerStatisticsResult, result, UObject*, customData); + + /** Retrieves the current version and values for the indicated statistics, for the local player. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayerStatistics(FServerGetPlayerStatisticsRequest request, + FDelegateOnSuccessGetPlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerStatisticVersions, FServerGetPlayerStatisticVersionsResult, result, UObject*, customData); + + /** Retrieves the information on the available versions of the specified statistic. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayerStatisticVersions(FServerGetPlayerStatisticVersionsRequest request, + FDelegateOnSuccessGetPlayerStatisticVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerStatisticVersions(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserData, FServerGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserInternalData, FServerGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserInternalData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherData, FServerGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserPublisherData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherInternalData, FServerGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserPublisherInternalData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserPublisherReadOnlyData, FServerGetUserDataResult, result, UObject*, customData); + + /** Retrieves the publisher-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserPublisherReadOnlyData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserReadOnlyData, FServerGetUserDataResult, result, UObject*, customData); + + /** Retrieves the title-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserReadOnlyData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdatePlayerStatistics, FServerUpdatePlayerStatisticsResult, result, UObject*, customData); + + /** Updates the values of the specified title-specific statistics for the user */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdatePlayerStatistics(FServerUpdatePlayerStatisticsRequest request, + FDelegateOnSuccessUpdatePlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdatePlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserData, FServerUpdateUserDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserInternalData, FServerUpdateUserDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserInternalData(FServerUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherData, FServerUpdateUserDataResult, result, UObject*, customData); + + /** Updates the publisher-specific custom data for the user which is readable and writable by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserPublisherData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherInternalData, FServerUpdateUserDataResult, result, UObject*, customData); + + /** Updates the publisher-specific custom data for the user which cannot be accessed by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserPublisherInternalData(FServerUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserPublisherReadOnlyData, FServerUpdateUserDataResult, result, UObject*, customData); + + /** Updates the publisher-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserPublisherReadOnlyData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserReadOnlyData, FServerUpdateUserDataResult, result, UObject*, customData); + + /** Updates the title-specific custom data for the user which can only be read by the client */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserReadOnlyData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Player Item Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddCharacterVirtualCurrency, FServerModifyCharacterVirtualCurrencyResult, result, UObject*, customData); + + /** Increments the character's balance of the specified virtual currency by the stated amount */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AddCharacterVirtualCurrency(FServerAddCharacterVirtualCurrencyRequest request, + FDelegateOnSuccessAddCharacterVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddCharacterVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddUserVirtualCurrency, FServerModifyUserVirtualCurrencyResult, result, UObject*, customData); + + /** Increments the user's balance of the specified virtual currency by the stated amount */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AddUserVirtualCurrency(FServerAddUserVirtualCurrencyRequest request, + FDelegateOnSuccessAddUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessConsumeItem, FServerConsumeItemResult, result, UObject*, customData); + + /** Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* ConsumeItem(FServerConsumeItemRequest request, + FDelegateOnSuccessConsumeItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperConsumeItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessEvaluateRandomResultTable, FServerEvaluateRandomResultTableResult, result, UObject*, customData); + + /** + * Returns the result of an evaluation of a Random Result Table - the ItemId from the game Catalog which would have been + * added to the player inventory, if the Random Result Table were added via a Bundle or a call to UnlockContainer. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* EvaluateRandomResultTable(FServerEvaluateRandomResultTableRequest request, + FDelegateOnSuccessEvaluateRandomResultTable onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperEvaluateRandomResultTable(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCharacterInventory, FServerGetCharacterInventoryResult, result, UObject*, customData); + + /** Retrieves the specified character's current inventory of virtual goods */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCharacterInventory(FServerGetCharacterInventoryRequest request, + FDelegateOnSuccessGetCharacterInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCharacterInventory(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetRandomResultTables, FServerGetRandomResultTablesResult, result, UObject*, customData); + + /** + * Retrieves the configuration information for the specified random results tables for the title, including all ItemId + * values and weights + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetRandomResultTables(FServerGetRandomResultTablesRequest request, + FDelegateOnSuccessGetRandomResultTables onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetRandomResultTables(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetUserInventory, FServerGetUserInventoryResult, result, UObject*, customData); + + /** Retrieves the specified user's current inventory of virtual goods */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetUserInventory(FServerGetUserInventoryRequest request, + FDelegateOnSuccessGetUserInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetUserInventory(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGrantItemsToCharacter, FServerGrantItemsToCharacterResult, result, UObject*, customData); + + /** Adds the specified items to the specified character's inventory */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GrantItemsToCharacter(FServerGrantItemsToCharacterRequest request, + FDelegateOnSuccessGrantItemsToCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGrantItemsToCharacter(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGrantItemsToUser, FServerGrantItemsToUserResult, result, UObject*, customData); + + /** Adds the specified items to the specified user's inventory */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GrantItemsToUser(FServerGrantItemsToUserRequest request, + FDelegateOnSuccessGrantItemsToUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGrantItemsToUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGrantItemsToUsers, FServerGrantItemsToUsersResult, result, UObject*, customData); + + /** Adds the specified items to the specified user inventories */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GrantItemsToUsers(FServerGrantItemsToUsersRequest request, + FDelegateOnSuccessGrantItemsToUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGrantItemsToUsers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessModifyItemUses, FServerModifyItemUsesResult, result, UObject*, customData); + + /** Modifies the number of remaining uses of a player's inventory item */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* ModifyItemUses(FServerModifyItemUsesRequest request, + FDelegateOnSuccessModifyItemUses onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperModifyItemUses(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessMoveItemToCharacterFromCharacter, FServerMoveItemToCharacterFromCharacterResult, result, UObject*, customData); + + /** Moves an item from a character's inventory into another of the users's character's inventory. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* MoveItemToCharacterFromCharacter(FServerMoveItemToCharacterFromCharacterRequest request, + FDelegateOnSuccessMoveItemToCharacterFromCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperMoveItemToCharacterFromCharacter(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessMoveItemToCharacterFromUser, FServerMoveItemToCharacterFromUserResult, result, UObject*, customData); + + /** Moves an item from a user's inventory into their character's inventory. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* MoveItemToCharacterFromUser(FServerMoveItemToCharacterFromUserRequest request, + FDelegateOnSuccessMoveItemToCharacterFromUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperMoveItemToCharacterFromUser(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessMoveItemToUserFromCharacter, FServerMoveItemToUserFromCharacterResult, result, UObject*, customData); + + /** Moves an item from a character's inventory into the owning user's inventory. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* MoveItemToUserFromCharacter(FServerMoveItemToUserFromCharacterRequest request, + FDelegateOnSuccessMoveItemToUserFromCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperMoveItemToUserFromCharacter(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRedeemCoupon, FServerRedeemCouponResult, result, UObject*, customData); + + /** + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the + * Economy->Catalogs tab in the PlayFab Game Manager. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RedeemCoupon(FServerRedeemCouponRequest request, + FDelegateOnSuccessRedeemCoupon onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRedeemCoupon(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessReportPlayer, FServerReportPlayerServerResult, result, UObject*, customData); + + /** + * Submit a report about a player (due to bad bahavior, etc.) on behalf of another player, so that customer service + * representatives for the title can take action concerning potentially toxic players. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* ReportPlayer(FServerReportPlayerServerRequest request, + FDelegateOnSuccessReportPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperReportPlayer(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeInventoryItem, FServerRevokeInventoryResult, result, UObject*, customData); + + /** Revokes access to an item in a user's inventory */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RevokeInventoryItem(FServerRevokeInventoryItemRequest request, + FDelegateOnSuccessRevokeInventoryItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeInventoryItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRevokeInventoryItems, FServerRevokeInventoryItemsResult, result, UObject*, customData); + + /** Revokes access for up to 25 items across multiple users and characters. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RevokeInventoryItems(FServerRevokeInventoryItemsRequest request, + FDelegateOnSuccessRevokeInventoryItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRevokeInventoryItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSubtractCharacterVirtualCurrency, FServerModifyCharacterVirtualCurrencyResult, result, UObject*, customData); + + /** + * Decrements the character's balance of the specified virtual currency by the stated amount. It is possible to make a VC + * balance negative with this API. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SubtractCharacterVirtualCurrency(FServerSubtractCharacterVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractCharacterVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSubtractCharacterVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSubtractUserVirtualCurrency, FServerModifyUserVirtualCurrencyResult, result, UObject*, customData); + + /** + * Decrements the user's balance of the specified virtual currency by the stated amount. It is possible to make a VC + * balance negative with this API. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SubtractUserVirtualCurrency(FServerSubtractUserVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSubtractUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlockContainerInstance, FServerUnlockContainerItemResult, result, UObject*, customData); + + /** + * Opens a specific container (ContainerItemInstanceId), with a specific key (KeyItemInstanceId, when required), and + * returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > + * 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UnlockContainerInstance(FServerUnlockContainerInstanceRequest request, + FDelegateOnSuccessUnlockContainerInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlockContainerInstance(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUnlockContainerItem, FServerUnlockContainerItemResult, result, UObject*, customData); + + /** + * Searches Player or Character inventory for any ItemInstance matching the given CatalogItemId, if necessary unlocks it + * using any appropriate key, and returns the contents of the opened container. If the container (and key when relevant) + * are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of + * ConsumeItem. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UnlockContainerItem(FServerUnlockContainerItemRequest request, + FDelegateOnSuccessUnlockContainerItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUnlockContainerItem(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateUserInventoryItemCustomData, FServerEmptyResponse, result, UObject*, customData); + + /** Updates the key-value pair data tagged to the specified item, which is read-only from the client. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateUserInventoryItemCustomData(FServerUpdateUserInventoryItemDataRequest request, + FDelegateOnSuccessUpdateUserInventoryItemCustomData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateUserInventoryItemCustomData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // PlayStream + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddPlayerTag, FServerAddPlayerTagResult, result, UObject*, customData); + + /** Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AddPlayerTag(FServerAddPlayerTagRequest request, + FDelegateOnSuccessAddPlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddPlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetAllSegments, FServerGetAllSegmentsResult, result, UObject*, customData); + + /** + * Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as + * GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetAllSegments(FServerGetAllSegmentsRequest request, + FDelegateOnSuccessGetAllSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetAllSegments(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerSegments, FServerGetPlayerSegmentsResult, result, UObject*, customData); + + /** List all segments that a player currently belongs to at this moment in time. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayerSegments(FServerGetPlayersSegmentsRequest request, + FDelegateOnSuccessGetPlayerSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerSegments(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayersInSegment, FServerGetPlayersInSegmentResult, result, UObject*, customData); + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match + * the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span + * on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected + * in the results. AB Test segments are currently not supported by this operation. + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayersInSegment(FServerGetPlayersInSegmentRequest request, + FDelegateOnSuccessGetPlayersInSegment onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayersInSegment(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPlayerTags, FServerGetPlayerTagsResult, result, UObject*, customData); + + /** Get all tags with a given Namespace (optional) from a player profile. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPlayerTags(FServerGetPlayerTagsRequest request, + FDelegateOnSuccessGetPlayerTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPlayerTags(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemovePlayerTag, FServerRemovePlayerTagResult, result, UObject*, customData); + + /** Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RemovePlayerTag(FServerRemovePlayerTagRequest request, + FDelegateOnSuccessRemovePlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemovePlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessExecuteCloudScript, FServerExecuteCloudScriptResult, result, UObject*, customData); + + /** Executes a CloudScript function, with the 'currentPlayerId' variable set to the specified PlayFabId parameter value. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* ExecuteCloudScript(FServerExecuteCloudScriptServerRequest request, + FDelegateOnSuccessExecuteCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Server-Side Cloud Script ", meta = (BlueprintInternalUseOnly = "true")) + void HelperExecuteCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Shared Group Data + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessAddSharedGroupMembers, FServerAddSharedGroupMembersResult, result, UObject*, customData); + + /** + * Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users + * in the group (and the server) can add new members. Shared Groups are designed for sharing data between a very small + * number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* AddSharedGroupMembers(FServerAddSharedGroupMembersRequest request, + FDelegateOnSuccessAddSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperAddSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessCreateSharedGroup, FServerCreateSharedGroupResult, result, UObject*, customData); + + /** + * Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the + * group. When created by a server, the group will initially have no members. Shared Groups are designed for sharing data + * between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* CreateSharedGroup(FServerCreateSharedGroupRequest request, + FDelegateOnSuccessCreateSharedGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperCreateSharedGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessDeleteSharedGroup, FServerEmptyResponse, result, UObject*, customData); + + /** + * Deletes a shared group, freeing up the shared group ID to be reused for a new group. Shared Groups are designed for + * sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* DeleteSharedGroup(FServerDeleteSharedGroupRequest request, + FDelegateOnSuccessDeleteSharedGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperDeleteSharedGroup(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetSharedGroupData, FServerGetSharedGroupDataResult, result, UObject*, customData); + + /** + * Retrieves data stored in a shared group object, as well as the list of members in the group. The server can access all + * public and private group data. Shared Groups are designed for sharing data between a very small number of players, + * please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetSharedGroupData(FServerGetSharedGroupDataRequest request, + FDelegateOnSuccessGetSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessRemoveSharedGroupMembers, FServerRemoveSharedGroupMembersResult, result, UObject*, customData); + + /** + * Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the + * group can remove members. If as a result of the call, zero users remain with access, the group and its associated data + * will be deleted. Shared Groups are designed for sharing data between a very small number of players, please see our + * guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* RemoveSharedGroupMembers(FServerRemoveSharedGroupMembersRequest request, + FDelegateOnSuccessRemoveSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperRemoveSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessUpdateSharedGroupData, FServerUpdateSharedGroupDataResult, result, UObject*, customData); + + /** + * Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated + * or added in this call will be readable by users not in the group. By default, data permissions are set to Private. + * Regardless of the permission setting, only members of the group (and the server) can update the data. Shared Groups are + * designed for sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* UpdateSharedGroupData(FServerUpdateSharedGroupDataRequest request, + FDelegateOnSuccessUpdateSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data ", meta = (BlueprintInternalUseOnly = "true")) + void HelperUpdateSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + /////////////////////////////////////////////////////// + // Title-Wide Data Management + ////////////////////////////////////////////////////// + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetCatalogItems, FServerGetCatalogItemsResult, result, UObject*, customData); + + /** Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetCatalogItems(FServerGetCatalogItemsRequest request, + FDelegateOnSuccessGetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetPublisherData, FServerGetPublisherDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom publisher settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetPublisherData(FServerGetPublisherDataRequest request, + FDelegateOnSuccessGetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTime, FServerGetTimeResult, result, UObject*, customData); + + /** Retrieves the current server time */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetTime(FServerGetTimeRequest request, + FDelegateOnSuccessGetTime onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTime(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleData, FServerGetTitleDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom title settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetTitleData(FServerGetTitleDataRequest request, + FDelegateOnSuccessGetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleInternalData, FServerGetTitleDataResult, result, UObject*, customData); + + /** Retrieves the key-value store of custom internal title settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetTitleInternalData(FServerGetTitleDataRequest request, + FDelegateOnSuccessGetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessGetTitleNews, FServerGetTitleNewsResult, result, UObject*, customData); + + /** Retrieves the title news feed, as configured in the developer portal */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* GetTitleNews(FServerGetTitleNewsRequest request, + FDelegateOnSuccessGetTitleNews onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperGetTitleNews(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetPublisherData, FServerSetPublisherDataResult, result, UObject*, customData); + + /** Updates the key-value store of custom publisher settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetPublisherData(FServerSetPublisherDataRequest request, + FDelegateOnSuccessSetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetTitleData, FServerSetTitleDataResult, result, UObject*, customData); + + /** Updates the key-value store of custom title settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetTitleData(FServerSetTitleDataRequest request, + FDelegateOnSuccessSetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful); + + // callbacks + DECLARE_DYNAMIC_DELEGATE_TwoParams(FDelegateOnSuccessSetTitleInternalData, FServerSetTitleDataResult, result, UObject*, customData); + + /** Updates the key-value store of custom title settings */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + static UPlayFabServerAPI* SetTitleInternalData(FServerSetTitleDataRequest request, + FDelegateOnSuccessSetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, UObject* customData); + + // Implements FOnPlayFabServerRequestCompleted + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management ", meta = (BlueprintInternalUseOnly = "true")) + void HelperSetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful); + + + + /** PlayFab Request Info */ + FString PlayFabRequestURL; + bool useEntityToken = false; + bool useSecretKey = false; + bool useSessionTicket = false; + bool returnsSessionTicket = false; + bool returnsEntityToken = false; + + /** Is the response valid JSON? */ + bool bIsValidJsonResponse; + FString ResponseContent; + int32 ResponseCode; + UObject* mCustomData; + + FDelegateOnFailurePlayFabError OnFailure; + FDelegateOnSuccessBanUsers OnSuccessBanUsers; + FDelegateOnSuccessGetPlayerProfile OnSuccessGetPlayerProfile; + FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs OnSuccessGetPlayFabIDsFromFacebookIDs; + FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds; + FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds; + FDelegateOnSuccessGetPlayFabIDsFromSteamIDs OnSuccessGetPlayFabIDsFromSteamIDs; + FDelegateOnSuccessGetUserAccountInfo OnSuccessGetUserAccountInfo; + FDelegateOnSuccessGetUserBans OnSuccessGetUserBans; + FDelegateOnSuccessRevokeAllBansForUser OnSuccessRevokeAllBansForUser; + FDelegateOnSuccessRevokeBans OnSuccessRevokeBans; + FDelegateOnSuccessSendCustomAccountRecoveryEmail OnSuccessSendCustomAccountRecoveryEmail; + FDelegateOnSuccessSendEmailFromTemplate OnSuccessSendEmailFromTemplate; + FDelegateOnSuccessSendPushNotification OnSuccessSendPushNotification; + FDelegateOnSuccessUpdateAvatarUrl OnSuccessUpdateAvatarUrl; + FDelegateOnSuccessUpdateBans OnSuccessUpdateBans; + FDelegateOnSuccessWriteCharacterEvent OnSuccessWriteCharacterEvent; + FDelegateOnSuccessWritePlayerEvent OnSuccessWritePlayerEvent; + FDelegateOnSuccessWriteTitleEvent OnSuccessWriteTitleEvent; + FDelegateOnSuccessAuthenticateSessionTicket OnSuccessAuthenticateSessionTicket; + FDelegateOnSuccessSetPlayerSecret OnSuccessSetPlayerSecret; + FDelegateOnSuccessGetCharacterData OnSuccessGetCharacterData; + FDelegateOnSuccessGetCharacterInternalData OnSuccessGetCharacterInternalData; + FDelegateOnSuccessGetCharacterReadOnlyData OnSuccessGetCharacterReadOnlyData; + FDelegateOnSuccessUpdateCharacterData OnSuccessUpdateCharacterData; + FDelegateOnSuccessUpdateCharacterInternalData OnSuccessUpdateCharacterInternalData; + FDelegateOnSuccessUpdateCharacterReadOnlyData OnSuccessUpdateCharacterReadOnlyData; + FDelegateOnSuccessDeleteCharacterFromUser OnSuccessDeleteCharacterFromUser; + FDelegateOnSuccessGetAllUsersCharacters OnSuccessGetAllUsersCharacters; + FDelegateOnSuccessGetCharacterLeaderboard OnSuccessGetCharacterLeaderboard; + FDelegateOnSuccessGetCharacterStatistics OnSuccessGetCharacterStatistics; + FDelegateOnSuccessGetLeaderboardAroundCharacter OnSuccessGetLeaderboardAroundCharacter; + FDelegateOnSuccessGetLeaderboardForUserCharacters OnSuccessGetLeaderboardForUserCharacters; + FDelegateOnSuccessGrantCharacterToUser OnSuccessGrantCharacterToUser; + FDelegateOnSuccessUpdateCharacterStatistics OnSuccessUpdateCharacterStatistics; + FDelegateOnSuccessGetContentDownloadUrl OnSuccessGetContentDownloadUrl; + FDelegateOnSuccessAddFriend OnSuccessAddFriend; + FDelegateOnSuccessGetFriendsList OnSuccessGetFriendsList; + FDelegateOnSuccessRemoveFriend OnSuccessRemoveFriend; + FDelegateOnSuccessSetFriendTags OnSuccessSetFriendTags; + FDelegateOnSuccessDeregisterGame OnSuccessDeregisterGame; + FDelegateOnSuccessNotifyMatchmakerPlayerLeft OnSuccessNotifyMatchmakerPlayerLeft; + FDelegateOnSuccessRedeemMatchmakerTicket OnSuccessRedeemMatchmakerTicket; + FDelegateOnSuccessRefreshGameServerInstanceHeartbeat OnSuccessRefreshGameServerInstanceHeartbeat; + FDelegateOnSuccessRegisterGame OnSuccessRegisterGame; + FDelegateOnSuccessSetGameServerInstanceData OnSuccessSetGameServerInstanceData; + FDelegateOnSuccessSetGameServerInstanceState OnSuccessSetGameServerInstanceState; + FDelegateOnSuccessSetGameServerInstanceTags OnSuccessSetGameServerInstanceTags; + FDelegateOnSuccessAwardSteamAchievement OnSuccessAwardSteamAchievement; + FDelegateOnSuccessDeleteUsers OnSuccessDeleteUsers; + FDelegateOnSuccessGetFriendLeaderboard OnSuccessGetFriendLeaderboard; + FDelegateOnSuccessGetLeaderboard OnSuccessGetLeaderboard; + FDelegateOnSuccessGetLeaderboardAroundUser OnSuccessGetLeaderboardAroundUser; + FDelegateOnSuccessGetPlayerCombinedInfo OnSuccessGetPlayerCombinedInfo; + FDelegateOnSuccessGetPlayerStatistics OnSuccessGetPlayerStatistics; + FDelegateOnSuccessGetPlayerStatisticVersions OnSuccessGetPlayerStatisticVersions; + FDelegateOnSuccessGetUserData OnSuccessGetUserData; + FDelegateOnSuccessGetUserInternalData OnSuccessGetUserInternalData; + FDelegateOnSuccessGetUserPublisherData OnSuccessGetUserPublisherData; + FDelegateOnSuccessGetUserPublisherInternalData OnSuccessGetUserPublisherInternalData; + FDelegateOnSuccessGetUserPublisherReadOnlyData OnSuccessGetUserPublisherReadOnlyData; + FDelegateOnSuccessGetUserReadOnlyData OnSuccessGetUserReadOnlyData; + FDelegateOnSuccessUpdatePlayerStatistics OnSuccessUpdatePlayerStatistics; + FDelegateOnSuccessUpdateUserData OnSuccessUpdateUserData; + FDelegateOnSuccessUpdateUserInternalData OnSuccessUpdateUserInternalData; + FDelegateOnSuccessUpdateUserPublisherData OnSuccessUpdateUserPublisherData; + FDelegateOnSuccessUpdateUserPublisherInternalData OnSuccessUpdateUserPublisherInternalData; + FDelegateOnSuccessUpdateUserPublisherReadOnlyData OnSuccessUpdateUserPublisherReadOnlyData; + FDelegateOnSuccessUpdateUserReadOnlyData OnSuccessUpdateUserReadOnlyData; + FDelegateOnSuccessAddCharacterVirtualCurrency OnSuccessAddCharacterVirtualCurrency; + FDelegateOnSuccessAddUserVirtualCurrency OnSuccessAddUserVirtualCurrency; + FDelegateOnSuccessConsumeItem OnSuccessConsumeItem; + FDelegateOnSuccessEvaluateRandomResultTable OnSuccessEvaluateRandomResultTable; + FDelegateOnSuccessGetCharacterInventory OnSuccessGetCharacterInventory; + FDelegateOnSuccessGetRandomResultTables OnSuccessGetRandomResultTables; + FDelegateOnSuccessGetUserInventory OnSuccessGetUserInventory; + FDelegateOnSuccessGrantItemsToCharacter OnSuccessGrantItemsToCharacter; + FDelegateOnSuccessGrantItemsToUser OnSuccessGrantItemsToUser; + FDelegateOnSuccessGrantItemsToUsers OnSuccessGrantItemsToUsers; + FDelegateOnSuccessModifyItemUses OnSuccessModifyItemUses; + FDelegateOnSuccessMoveItemToCharacterFromCharacter OnSuccessMoveItemToCharacterFromCharacter; + FDelegateOnSuccessMoveItemToCharacterFromUser OnSuccessMoveItemToCharacterFromUser; + FDelegateOnSuccessMoveItemToUserFromCharacter OnSuccessMoveItemToUserFromCharacter; + FDelegateOnSuccessRedeemCoupon OnSuccessRedeemCoupon; + FDelegateOnSuccessReportPlayer OnSuccessReportPlayer; + FDelegateOnSuccessRevokeInventoryItem OnSuccessRevokeInventoryItem; + FDelegateOnSuccessRevokeInventoryItems OnSuccessRevokeInventoryItems; + FDelegateOnSuccessSubtractCharacterVirtualCurrency OnSuccessSubtractCharacterVirtualCurrency; + FDelegateOnSuccessSubtractUserVirtualCurrency OnSuccessSubtractUserVirtualCurrency; + FDelegateOnSuccessUnlockContainerInstance OnSuccessUnlockContainerInstance; + FDelegateOnSuccessUnlockContainerItem OnSuccessUnlockContainerItem; + FDelegateOnSuccessUpdateUserInventoryItemCustomData OnSuccessUpdateUserInventoryItemCustomData; + FDelegateOnSuccessAddPlayerTag OnSuccessAddPlayerTag; + FDelegateOnSuccessGetAllSegments OnSuccessGetAllSegments; + FDelegateOnSuccessGetPlayerSegments OnSuccessGetPlayerSegments; + FDelegateOnSuccessGetPlayersInSegment OnSuccessGetPlayersInSegment; + FDelegateOnSuccessGetPlayerTags OnSuccessGetPlayerTags; + FDelegateOnSuccessRemovePlayerTag OnSuccessRemovePlayerTag; + FDelegateOnSuccessExecuteCloudScript OnSuccessExecuteCloudScript; + FDelegateOnSuccessAddSharedGroupMembers OnSuccessAddSharedGroupMembers; + FDelegateOnSuccessCreateSharedGroup OnSuccessCreateSharedGroup; + FDelegateOnSuccessDeleteSharedGroup OnSuccessDeleteSharedGroup; + FDelegateOnSuccessGetSharedGroupData OnSuccessGetSharedGroupData; + FDelegateOnSuccessRemoveSharedGroupMembers OnSuccessRemoveSharedGroupMembers; + FDelegateOnSuccessUpdateSharedGroupData OnSuccessUpdateSharedGroupData; + FDelegateOnSuccessGetCatalogItems OnSuccessGetCatalogItems; + FDelegateOnSuccessGetPublisherData OnSuccessGetPublisherData; + FDelegateOnSuccessGetTime OnSuccessGetTime; + FDelegateOnSuccessGetTitleData OnSuccessGetTitleData; + FDelegateOnSuccessGetTitleInternalData OnSuccessGetTitleInternalData; + FDelegateOnSuccessGetTitleNews OnSuccessGetTitleNews; + FDelegateOnSuccessSetPublisherData OnSuccessSetPublisherData; + FDelegateOnSuccessSetTitleData OnSuccessSetTitleData; + FDelegateOnSuccessSetTitleInternalData OnSuccessSetTitleInternalData; + +private: + /** Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event */ + void OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); + +protected: + /** Internal request data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* RequestJsonObj; + + /** Response data stored as JSON */ + UPROPERTY() + UPlayFabJsonObject* ResponseJsonObj; + + /** Mapping of header section to values. Used to generate final header string for request */ + TMap RequestHeaders; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabServerModelDecoder.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabServerModelDecoder.h new file mode 100644 index 000000000..14b2f3d1e --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabServerModelDecoder.h @@ -0,0 +1,469 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Server +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabServerModels.h" +#include "PlayFabServerModelDecoder.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabServerModelDecoder : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + ////////////////////////////////////////////////////////////////////////// + // Generated PlayFab Server API Functions + ////////////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////// + // Account Management + ////////////////////////////////////////////////////// + + /** Decode the BanUsersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerBanUsersResult decodeBanUsersResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerProfileResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetPlayerProfileResult decodeGetPlayerProfileResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromFacebookIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetPlayFabIDsFromFacebookIDsResult decodeGetPlayFabIDsFromFacebookIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromFacebookInstantGamesIdsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetPlayFabIDsFromFacebookInstantGamesIdsResult decodeGetPlayFabIDsFromFacebookInstantGamesIdsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromNintendoSwitchDeviceIdsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsResult decodeGetPlayFabIDsFromNintendoSwitchDeviceIdsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayFabIDsFromSteamIDsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetPlayFabIDsFromSteamIDsResult decodeGetPlayFabIDsFromSteamIDsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserAccountInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetUserAccountInfoResult decodeGetUserAccountInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserBansResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerGetUserBansResult decodeGetUserBansResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeAllBansForUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerRevokeAllBansForUserResult decodeRevokeAllBansForUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeBansResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerRevokeBansResult decodeRevokeBansResultResponse(UPlayFabJsonObject* response); + + /** Decode the SendCustomAccountRecoveryEmailResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerSendCustomAccountRecoveryEmailResult decodeSendCustomAccountRecoveryEmailResultResponse(UPlayFabJsonObject* response); + + /** Decode the SendEmailFromTemplateResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerSendEmailFromTemplateResult decodeSendEmailFromTemplateResultResponse(UPlayFabJsonObject* response); + + /** Decode the SendPushNotificationResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerSendPushNotificationResult decodeSendPushNotificationResultResponse(UPlayFabJsonObject* response); + + /** Decode the EmptyResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerEmptyResponse decodeEmptyResponseResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateBansResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Account Management Models") + static FServerUpdateBansResult decodeUpdateBansResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Analytics + ////////////////////////////////////////////////////// + + /** Decode the WriteEventResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Analytics Models") + static FServerWriteEventResponse decodeWriteEventResponseResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Authentication + ////////////////////////////////////////////////////// + + /** Decode the AuthenticateSessionTicketResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Authentication Models") + static FServerAuthenticateSessionTicketResult decodeAuthenticateSessionTicketResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetPlayerSecretResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Authentication Models") + static FServerSetPlayerSecretResult decodeSetPlayerSecretResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Character Data + ////////////////////////////////////////////////////// + + /** Decode the GetCharacterDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data Models") + static FServerGetCharacterDataResult decodeGetCharacterDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateCharacterDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Character Data Models") + static FServerUpdateCharacterDataResult decodeUpdateCharacterDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Characters + ////////////////////////////////////////////////////// + + /** Decode the DeleteCharacterFromUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerDeleteCharacterFromUserResult decodeDeleteCharacterFromUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the ListUsersCharactersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerListUsersCharactersResult decodeListUsersCharactersResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCharacterLeaderboardResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerGetCharacterLeaderboardResult decodeGetCharacterLeaderboardResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCharacterStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerGetCharacterStatisticsResult decodeGetCharacterStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardAroundCharacterResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerGetLeaderboardAroundCharacterResult decodeGetLeaderboardAroundCharacterResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardForUsersCharactersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerGetLeaderboardForUsersCharactersResult decodeGetLeaderboardForUsersCharactersResultResponse(UPlayFabJsonObject* response); + + /** Decode the GrantCharacterToUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerGrantCharacterToUserResult decodeGrantCharacterToUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateCharacterStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Characters Models") + static FServerUpdateCharacterStatisticsResult decodeUpdateCharacterStatisticsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Content + ////////////////////////////////////////////////////// + + /** Decode the GetContentDownloadUrlResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Content Models") + static FServerGetContentDownloadUrlResult decodeGetContentDownloadUrlResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Friend List Management + ////////////////////////////////////////////////////// + + /** Decode the GetFriendsListResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Friend List Management Models") + static FServerGetFriendsListResult decodeGetFriendsListResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Matchmaking + ////////////////////////////////////////////////////// + + /** Decode the DeregisterGameResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerDeregisterGameResponse decodeDeregisterGameResponseResponse(UPlayFabJsonObject* response); + + /** Decode the NotifyMatchmakerPlayerLeftResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerNotifyMatchmakerPlayerLeftResult decodeNotifyMatchmakerPlayerLeftResultResponse(UPlayFabJsonObject* response); + + /** Decode the RedeemMatchmakerTicketResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerRedeemMatchmakerTicketResult decodeRedeemMatchmakerTicketResultResponse(UPlayFabJsonObject* response); + + /** Decode the RefreshGameServerInstanceHeartbeatResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerRefreshGameServerInstanceHeartbeatResult decodeRefreshGameServerInstanceHeartbeatResultResponse(UPlayFabJsonObject* response); + + /** Decode the RegisterGameResponse response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerRegisterGameResponse decodeRegisterGameResponseResponse(UPlayFabJsonObject* response); + + /** Decode the SetGameServerInstanceDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerSetGameServerInstanceDataResult decodeSetGameServerInstanceDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetGameServerInstanceStateResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerSetGameServerInstanceStateResult decodeSetGameServerInstanceStateResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetGameServerInstanceTagsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Matchmaking Models") + static FServerSetGameServerInstanceTagsResult decodeSetGameServerInstanceTagsResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Platform Specific Methods + ////////////////////////////////////////////////////// + + /** Decode the AwardSteamAchievementResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Platform Specific Methods Models") + static FServerAwardSteamAchievementResult decodeAwardSteamAchievementResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Player Data Management + ////////////////////////////////////////////////////// + + /** Decode the DeleteUsersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerDeleteUsersResult decodeDeleteUsersResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerGetLeaderboardResult decodeGetLeaderboardResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetLeaderboardAroundUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerGetLeaderboardAroundUserResult decodeGetLeaderboardAroundUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerCombinedInfoResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerGetPlayerCombinedInfoResult decodeGetPlayerCombinedInfoResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerGetPlayerStatisticsResult decodeGetPlayerStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerStatisticVersionsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerGetPlayerStatisticVersionsResult decodeGetPlayerStatisticVersionsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerGetUserDataResult decodeGetUserDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdatePlayerStatisticsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerUpdatePlayerStatisticsResult decodeUpdatePlayerStatisticsResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateUserDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Data Management Models") + static FServerUpdateUserDataResult decodeUpdateUserDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Player Item Management + ////////////////////////////////////////////////////// + + /** Decode the ModifyCharacterVirtualCurrencyResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerModifyCharacterVirtualCurrencyResult decodeModifyCharacterVirtualCurrencyResultResponse(UPlayFabJsonObject* response); + + /** Decode the ModifyUserVirtualCurrencyResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerModifyUserVirtualCurrencyResult decodeModifyUserVirtualCurrencyResultResponse(UPlayFabJsonObject* response); + + /** Decode the ConsumeItemResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerConsumeItemResult decodeConsumeItemResultResponse(UPlayFabJsonObject* response); + + /** Decode the EvaluateRandomResultTableResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerEvaluateRandomResultTableResult decodeEvaluateRandomResultTableResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetCharacterInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerGetCharacterInventoryResult decodeGetCharacterInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetRandomResultTablesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerGetRandomResultTablesResult decodeGetRandomResultTablesResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetUserInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerGetUserInventoryResult decodeGetUserInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the GrantItemsToCharacterResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerGrantItemsToCharacterResult decodeGrantItemsToCharacterResultResponse(UPlayFabJsonObject* response); + + /** Decode the GrantItemsToUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerGrantItemsToUserResult decodeGrantItemsToUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the GrantItemsToUsersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerGrantItemsToUsersResult decodeGrantItemsToUsersResultResponse(UPlayFabJsonObject* response); + + /** Decode the ModifyItemUsesResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerModifyItemUsesResult decodeModifyItemUsesResultResponse(UPlayFabJsonObject* response); + + /** Decode the MoveItemToCharacterFromCharacterResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerMoveItemToCharacterFromCharacterResult decodeMoveItemToCharacterFromCharacterResultResponse(UPlayFabJsonObject* response); + + /** Decode the MoveItemToCharacterFromUserResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerMoveItemToCharacterFromUserResult decodeMoveItemToCharacterFromUserResultResponse(UPlayFabJsonObject* response); + + /** Decode the MoveItemToUserFromCharacterResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerMoveItemToUserFromCharacterResult decodeMoveItemToUserFromCharacterResultResponse(UPlayFabJsonObject* response); + + /** Decode the RedeemCouponResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerRedeemCouponResult decodeRedeemCouponResultResponse(UPlayFabJsonObject* response); + + /** Decode the ReportPlayerServerResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerReportPlayerServerResult decodeReportPlayerServerResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeInventoryResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerRevokeInventoryResult decodeRevokeInventoryResultResponse(UPlayFabJsonObject* response); + + /** Decode the RevokeInventoryItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerRevokeInventoryItemsResult decodeRevokeInventoryItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the UnlockContainerItemResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Player Item Management Models") + static FServerUnlockContainerItemResult decodeUnlockContainerItemResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // PlayStream + ////////////////////////////////////////////////////// + + /** Decode the AddPlayerTagResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream Models") + static FServerAddPlayerTagResult decodeAddPlayerTagResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetAllSegmentsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream Models") + static FServerGetAllSegmentsResult decodeGetAllSegmentsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerSegmentsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream Models") + static FServerGetPlayerSegmentsResult decodeGetPlayerSegmentsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayersInSegmentResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream Models") + static FServerGetPlayersInSegmentResult decodeGetPlayersInSegmentResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPlayerTagsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream Models") + static FServerGetPlayerTagsResult decodeGetPlayerTagsResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemovePlayerTagResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | PlayStream Models") + static FServerRemovePlayerTagResult decodeRemovePlayerTagResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Server-Side Cloud Script + ////////////////////////////////////////////////////// + + /** Decode the ExecuteCloudScriptResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Server-Side Cloud Script Models") + static FServerExecuteCloudScriptResult decodeExecuteCloudScriptResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Shared Group Data + ////////////////////////////////////////////////////// + + /** Decode the AddSharedGroupMembersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data Models") + static FServerAddSharedGroupMembersResult decodeAddSharedGroupMembersResultResponse(UPlayFabJsonObject* response); + + /** Decode the CreateSharedGroupResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data Models") + static FServerCreateSharedGroupResult decodeCreateSharedGroupResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetSharedGroupDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data Models") + static FServerGetSharedGroupDataResult decodeGetSharedGroupDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the RemoveSharedGroupMembersResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data Models") + static FServerRemoveSharedGroupMembersResult decodeRemoveSharedGroupMembersResultResponse(UPlayFabJsonObject* response); + + /** Decode the UpdateSharedGroupDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Shared Group Data Models") + static FServerUpdateSharedGroupDataResult decodeUpdateSharedGroupDataResultResponse(UPlayFabJsonObject* response); + + + + /////////////////////////////////////////////////////// + // Title-Wide Data Management + ////////////////////////////////////////////////////// + + /** Decode the GetCatalogItemsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerGetCatalogItemsResult decodeGetCatalogItemsResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetPublisherDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerGetPublisherDataResult decodeGetPublisherDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTimeResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerGetTimeResult decodeGetTimeResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTitleDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerGetTitleDataResult decodeGetTitleDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the GetTitleNewsResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerGetTitleNewsResult decodeGetTitleNewsResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetPublisherDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerSetPublisherDataResult decodeSetPublisherDataResultResponse(UPlayFabJsonObject* response); + + /** Decode the SetTitleDataResult response object*/ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Server | Title-Wide Data Management Models") + static FServerSetTitleDataResult decodeSetTitleDataResultResponse(UPlayFabJsonObject* response); + + + +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabServerModels.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabServerModels.h new file mode 100644 index 000000000..9ee11d1cd --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabServerModels.h @@ -0,0 +1,2682 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated model file for the UE4 PlayFab plugin. +// This model file contains the request and response USTRUCTS +// +// API: Server +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabEnums.h" +#include "PlayFabServerModels.generated.h" + +class UPlayFabJsonObject; + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Server API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerBanUsersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** List of ban requests to be applied. Maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray Bans; +}; + +USTRUCT(BlueprintType) +struct FServerBanUsersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were applied */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerProfileRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerProfileResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The profile of the player. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + UPlayFabJsonObject* PlayerProfile = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromFacebookIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString FacebookIDs; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromFacebookIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Facebook identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromFacebookInstantGamesIdsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Facebook Instant Games identifiers for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString FacebookInstantGamesIds; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromFacebookInstantGamesIdsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Facebook Instant Games identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Nintendo Switch Device identifiers for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString NintendoSwitchDeviceIds; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Nintendo Switch Device identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromSteamIDsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString SteamStringIDs; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayFabIDsFromSteamIDsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Mapping of Steam identifiers to PlayFab identifiers. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray Data; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserAccountInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserAccountInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Account details for the user whose information was requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + UPlayFabJsonObject* UserInfo = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserBansRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserBansResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information about the bans */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeAllBansForUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeAllBansForUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were revoked. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeBansRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Ids of the bans to be revoked. Maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString BanIds; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeBansResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were revoked */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray BanData; +}; + +USTRUCT(BlueprintType) +struct FServerSendCustomAccountRecoveryEmailRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** User email address attached to their account */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString Email; + /** The email template id of the account recovery email template to send. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString EmailTemplateId; + /** The user's username requesting an account recovery. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString Username; +}; + +USTRUCT(BlueprintType) +struct FServerSendCustomAccountRecoveryEmailResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerSendEmailFromTemplateRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The email template id of the email template to send. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString EmailTemplateId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerSendEmailFromTemplateResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerSendPushNotificationRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Allows you to provide precisely formatted json to target devices. This is an advanced feature, allowing you to deliver + * to custom plugin logic, fields, or functionality not natively supported by PlayFab. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray AdvancedPlatformDelivery; + /** Text of message to send. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString Message; + /** + * Defines all possible push attributes like message, title, icon, etc. Some parameters are device specific - please see + * the PushNotificationPackage documentation for details. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + UPlayFabJsonObject* Package = nullptr; + /** PlayFabId of the recipient of the push notification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString Recipient; + /** Subject of message to send (may not be displayed in all platforms) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString Subject; + /** Target Platforms that should receive the Message or Package. If omitted, we will send to all available platforms. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString TargetPlatforms; +}; + +USTRUCT(BlueprintType) +struct FServerSendPushNotificationResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerEmptyResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerUpdateAvatarUrlRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** URL of the avatar image. If empty, it removes the existing avatar URL. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString ImageUrl; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateBansRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** List of bans to be updated. Maximum 100. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray Bans; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateBansResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Information on the bans that were updated */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Account Management Models") + TArray BanData; +}; + + +/////////////////////////////////////////////////////// +// Analytics +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerWriteEventResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to + * any particular format. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString EventId; +}; + +USTRUCT(BlueprintType) +struct FServerWriteServerCharacterEventRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom event properties. Each property consists of a name (string) and a value (JSON object). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + UPlayFabJsonObject* Body = nullptr; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString CharacterId; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString EventName; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString PlayFabId; + /** The time (in UTC) associated with this event. The value dafaults to the current time. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString Timestamp; +}; + +USTRUCT(BlueprintType) +struct FServerWriteServerPlayerEventRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom data properties associated with the event. Each property consists of a name (string) and a value (JSON object). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + UPlayFabJsonObject* Body = nullptr; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString EventName; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString PlayFabId; + /** The time (in UTC) associated with this event. The value dafaults to the current time. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString Timestamp; +}; + +USTRUCT(BlueprintType) +struct FServerWriteTitleEventRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom event properties. Each property consists of a name (string) and a value (JSON object). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + UPlayFabJsonObject* Body = nullptr; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString EventName; + /** The time (in UTC) associated with this event. The value dafaults to the current time. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Analytics Models") + FString Timestamp; +}; + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerAuthenticateSessionTicketRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Session ticket as issued by a PlayFab client login API. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Authentication Models") + FString SessionTicket; +}; + +USTRUCT(BlueprintType) +struct FServerAuthenticateSessionTicketResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Account info for the user whose session ticket was supplied. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Authentication Models") + UPlayFabJsonObject* UserInfo = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerSetPlayerSecretRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Player secret that is used to verify API request signatures (Enterprise Only). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Authentication Models") + FString PlayerSecret; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Authentication Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerSetPlayerSecretResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Character Data +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerGetCharacterDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString CharacterId; + /** + * The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + int32 IfChangedFromDataVersion = 0; + /** Specific keys to search for in the custom user data. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString Keys; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString CharacterId; + /** User specific data for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + UPlayFabJsonObject* Data = nullptr; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + int32 DataVersion = 0; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateCharacterDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString CharacterId; + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString KeysToRemove; + /** Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + EUserDataPermission Permission; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateCharacterDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Character Data Models") + int32 DataVersion = 0; +}; + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerDeleteCharacterFromUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; + /** + * If true, the character's inventory will be transferred up to the owning user; otherwise, this request will purge those + * items. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + bool SaveCharacterInventory = false; +}; + +USTRUCT(BlueprintType) +struct FServerDeleteCharacterFromUserResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerListUsersCharactersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerListUsersCharactersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The requested list of characters. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + TArray Characters; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterLeaderboardRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional character type on which to filter the leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterType; + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + int32 MaxResultsCount = 0; + /** First entry in the leaderboard to be retrieved. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + int32 StartPosition = 0; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterLeaderboardResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered list of leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + TArray Leaderboard; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the character for the statistics. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterId; + /** Character statistics for the requested user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + UPlayFabJsonObject* CharacterStatistics; + /** PlayFab unique identifier of the user whose character statistics are being returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardAroundCharacterRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterId; + /** Optional character type on which to filter the leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterType; + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + int32 MaxResultsCount = 0; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardAroundCharacterResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered list of leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + TArray Leaderboard; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardForUsersCharactersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + int32 MaxResultsCount = 0; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardForUsersCharactersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered list of leaderboard entries. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + TArray Leaderboard; +}; + +USTRUCT(BlueprintType) +struct FServerGrantCharacterToUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Non-unique display name of the character being granted (1-20 characters in length). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterName; + /** Type of the character being granted; statistics can be sliced based on this value. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterType; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGrantCharacterToUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier tagged to this character. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateCharacterStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString CharacterId; + /** Statistics to be updated with the provided values. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + UPlayFabJsonObject* CharacterStatistics; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Characters Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateCharacterStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerGetContentDownloadUrlRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** HTTP method to fetch item - GET or HEAD. Use HEAD when only fetching metadata. Default is GET. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Content Models") + FString HttpMethod; + /** Key of the content item to fetch, usually formatted as a path, e.g. images/a.png */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Content Models") + FString Key; + /** + * True to download through CDN. CDN provides higher download bandwidth and lower latency. However, if you want the latest, + * non-cached version of the content during development, set this to false. Default is true. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Content Models") + bool ThruCDN = false; +}; + +USTRUCT(BlueprintType) +struct FServerGetContentDownloadUrlResult +{ + GENERATED_USTRUCT_BODY() +public: + /** URL for downloading content via HTTP GET or HEAD method. The URL will expire in approximately one hour. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Content Models") + FString URL; +}; + + +/////////////////////////////////////////////////////// +// Friend List Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerAddFriendRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Email address of the user being added. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString FriendEmail; + /** The PlayFab identifier of the user being added. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString FriendPlayFabId; + /** Title-specific display name of the user to being added. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString FriendTitleDisplayName; + /** The PlayFab username of the user being added */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString FriendUsername; + /** PlayFab identifier of the player to add a new friend. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetFriendsListRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Indicates whether Facebook friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + bool IncludeFacebookFriends = false; + /** Indicates whether Steam service friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + bool IncludeSteamFriends = false; + /** PlayFab identifier of the player whose friend list to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FServerGetFriendsListResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of friends found. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + TArray Friends; +}; + +USTRUCT(BlueprintType) +struct FServerRemoveFriendRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab identifier of the friend account which is to be removed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString FriendPlayFabId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerSetFriendTagsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab identifier of the friend account to which the tag(s) should be applied. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString FriendPlayFabId; + /** PlayFab identifier of the player whose friend is to be updated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString PlayFabId; + /** Array of tags to set on the friend account. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Friend List Management Models") + FString Tags; +}; + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerDeregisterGameRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the Game Server Instance that is being deregistered. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; +}; + +USTRUCT(BlueprintType) +struct FServerDeregisterGameResponse +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerNotifyMatchmakerPlayerLeftRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the Game Instance the user is leaving. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerNotifyMatchmakerPlayerLeftResult +{ + GENERATED_USTRUCT_BODY() +public: + /** State of user leaving the Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + EPlayerConnectionState PlayerState; +}; + +USTRUCT(BlueprintType) +struct FServerRedeemMatchmakerTicketRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the Game Server Instance that is asking for validation of the authorization ticket. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; + /** Server authorization ticket passed back from a call to Matchmake or StartGame. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString Ticket; +}; + +USTRUCT(BlueprintType) +struct FServerRedeemMatchmakerTicketResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Error value if the ticket was not validated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString Error; + /** Boolean indicating whether the ticket was validated by the PlayFab service. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + bool TicketIsValid = false; + /** User account information for the user validated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + UPlayFabJsonObject* UserInfo = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerRefreshGameServerInstanceHeartbeatRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the Game Server Instance for which the heartbeat is updated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; +}; + +USTRUCT(BlueprintType) +struct FServerRefreshGameServerInstanceHeartbeatResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerRegisterGameRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the build running on the Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString Build; + /** + * Game Mode the Game Server instance is running. Note that this must be defined in the Game Modes tab in the PlayFab Game + * Manager, along with the Build ID (the same Game Mode can be defined for multiple Build IDs). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString GameMode; + /** Previous lobby id if re-registering an existing game. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; + /** + * Region in which the Game Server Instance is running. For matchmaking using non-AWS region names, set this to any AWS + * region and use Tags (below) to specify your custom region. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + ERegion Region; + /** IPV4 address of the Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString ServerHost; + /** IPV4 address of the game server instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString ServerIPV4Address; + /** IPV6 address (if any) of the game server instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString ServerIPV6Address; + /** Port number for communication with the Game Server Instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString ServerPort; + /** Public DNS name (if any) of the server */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString ServerPublicDNSName; + /** Tags for the Game Server Instance */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + UPlayFabJsonObject* Tags; +}; + +USTRUCT(BlueprintType) +struct FServerRegisterGameResponse +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Unique identifier generated for the Game Server Instance that is registered. If LobbyId is specified in request and the + * game still exists in PlayFab, the LobbyId in request is returned. Otherwise a new lobby id will be returned. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; +}; + +USTRUCT(BlueprintType) +struct FServerSetGameServerInstanceDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Custom data to set for the specified game server instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString GameServerData; + /** Unique identifier of the Game Instance to be updated, in decimal format. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; +}; + +USTRUCT(BlueprintType) +struct FServerSetGameServerInstanceDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerSetGameServerInstanceStateRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the Game Instance to be updated, in decimal format. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; + /** State to set for the specified game server instance. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + EGameInstanceState State; +}; + +USTRUCT(BlueprintType) +struct FServerSetGameServerInstanceStateResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerSetGameServerInstanceTagsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the Game Server Instance to be updated. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + FString LobbyId; + /** + * Tags to set for the specified Game Server Instance. Note that this is the complete list of tags to be associated with + * the Game Server Instance. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Matchmaking Models") + UPlayFabJsonObject* Tags; +}; + +USTRUCT(BlueprintType) +struct FServerSetGameServerInstanceTagsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Platform Specific Methods +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerAwardSteamAchievementRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of achievements to grant and the users to whom they are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Platform Specific Methods Models") + TArray Achievements; +}; + +USTRUCT(BlueprintType) +struct FServerAwardSteamAchievementResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of achievements granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Platform Specific Methods Models") + TArray AchievementResults; +}; + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerDeleteUsersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** An array of unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabIds; +}; + +USTRUCT(BlueprintType) +struct FServerDeleteUsersResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerGetFriendLeaderboardRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Indicates whether Facebook friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + bool IncludeFacebookFriends = false; + /** Indicates whether Steam service friends should be included in the response. Default is true. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + bool IncludeSteamFriends = false; + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 MaxResultsCount = 0; + /** The player whose friend leaderboard to get */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Position in the leaderboard to start this listing (defaults to the first entry). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 StartPosition = 0; + /** Statistic used to rank friends for this leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 Version = 0; + /** Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString XboxToken; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered listing of users and their positions in the requested leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + TArray Leaderboard; + /** The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString NextReset; + /** The version of the leaderboard returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 MaxResultsCount = 0; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** First entry in the leaderboard to be retrieved. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 StartPosition = 0; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardAroundUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Maximum number of entries to retrieve. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 MaxResultsCount = 0; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; + /** + * If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* ProfileConstraints = nullptr; + /** Unique identifier for the title-specific statistic for the leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString StatisticName; + /** If set to false, Version is considered null. If true, uses the specified Version */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + bool UseSpecificVersion = false; + /** The version of the leaderboard to get. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FServerGetLeaderboardAroundUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Ordered listing of users and their positions in the requested leaderboard. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + TArray Leaderboard; + /** The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString NextReset; + /** The version of the leaderboard returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 Version = 0; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerCombinedInfoRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Flags for which pieces of info to return for the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* InfoRequestParameters = nullptr; + /** PlayFabId of the user whose data will be returned */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerCombinedInfoResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Results for requested info. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* InfoResultPayload = nullptr; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** user for whom statistics are being requested */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; + /** statistics to return */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString StatisticNames; + /** + * statistics to return, if StatisticNames is not set (only statistics which have a version matching that provided will be + * returned) + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + TArray StatisticNameVersions; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** PlayFab unique identifier of the user whose statistics are being returned */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; + /** User statistics for the requested user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + TArray Statistics; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerStatisticVersionsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** unique name of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString StatisticName; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerStatisticVersionsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** version change history of the statistic */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + TArray StatisticVersions; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 IfChangedFromDataVersion = 0; + /** Specific keys to search for in the custom user data. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString Keys; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** User specific data for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* Data = nullptr; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 DataVersion = 0; + /** PlayFab unique identifier of the user whose custom data is being returned. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdatePlayerStatisticsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Indicates whether the statistics provided should be set, regardless of the aggregation method set on the statistic. + * Default is false. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + bool ForceUpdate = false; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; + /** Statistics to be updated with the provided values */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + TArray Statistics; +}; + +USTRUCT(BlueprintType) +struct FServerUpdatePlayerStatisticsResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerUpdateUserDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString KeysToRemove; + /** Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + EUserDataPermission Permission; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateUserDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + int32 DataVersion = 0; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateUserInternalDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString KeysToRemove; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Data Management Models") + FString PlayFabId; +}; + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerAddCharacterVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Amount to be added to the character balance of the specified virtual currency. Maximum VC balance is Int32 + * (2,147,483,647). Any increase over this value will be discarded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 Amount = 0; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** PlayFab unique identifier of the user whose virtual currency balance is to be incremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which is to be incremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerModifyCharacterVirtualCurrencyResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Balance of the virtual currency after modification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 Balance = 0; + /** Name of the virtual currency which was modified. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerAddUserVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Amount to be added to the user balance of the specified virtual currency. Maximum VC balance is Int32 (2,147,483,647). + * Any increase over this value will be discarded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 Amount = 0; + /** PlayFab unique identifier of the user whose virtual currency balance is to be increased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which is to be incremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerModifyUserVirtualCurrencyResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Balance of the virtual currency after modification. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 Balance = 0; + /** + * Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase + * over this value will be discarded. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 BalanceChange = 0; + /** User currency was subtracted from. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which was modified. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerConsumeItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Number of uses to consume from the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 ConsumeCount = 0; + /** Unique instance identifier of the item to be consumed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerConsumeItemResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique instance identifier of the item with uses consumed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Number of uses remaining on the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 RemainingUses = 0; +}; + +USTRUCT(BlueprintType) +struct FServerEvaluateRandomResultTableRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Specifies the catalog version that should be used to evaluate the Random Result Table. If unspecified, uses + * default/primary catalog. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** The unique identifier of the Random Result Table to use. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString TableId; +}; + +USTRUCT(BlueprintType) +struct FServerEvaluateRandomResultTableResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the item returned from the Random Result Table evaluation, for the given catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ResultItemId; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterInventoryRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Used to limit results to only those from a specific catalog version. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetCharacterInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the character for this inventory. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Array of inventory items belonging to the character. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray Inventory; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Array of virtual currency balance(s) belonging to the character. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; + /** Array of remaining times and timestamps for virtual currencies. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrencyRechargeTimes = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerGetRandomResultTablesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Specifies the catalog version that should be used to retrieve the Random Result Tables. If unspecified, uses + * default/primary catalog. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** The unique identifier of the Random Result Table to use. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString TableIDs; +}; + +USTRUCT(BlueprintType) +struct FServerGetRandomResultTablesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** array of random result tables currently available */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* Tables = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserInventoryRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetUserInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of inventory items belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray Inventory; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Array of virtual currency balance(s) belonging to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; + /** Array of remaining times and timestamps for virtual currencies. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrencyRechargeTimes = nullptr; +}; + +USTRUCT(BlueprintType) +struct FServerGrantItemsToCharacterRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** String detailing any additional information concerning this operation. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString Annotation; + /** Catalog version from which items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Array of itemIds to grant to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemIds; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGrantItemsToCharacterResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items granted to users. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray ItemGrantResults; +}; + +USTRUCT(BlueprintType) +struct FServerGrantItemsToUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** String detailing any additional information concerning this operation. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString Annotation; + /** Catalog version from which items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Array of itemIds to grant to the user. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemIds; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGrantItemsToUserResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items granted to users. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray ItemGrantResults; +}; + +USTRUCT(BlueprintType) +struct FServerGrantItemsToUsersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version from which items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Array of items to grant and the users to whom the items are to be granted. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray ItemGrants; +}; + +USTRUCT(BlueprintType) +struct FServerGrantItemsToUsersResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items granted to users. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray ItemGrantResults; +}; + +USTRUCT(BlueprintType) +struct FServerModifyItemUsesRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique instance identifier of the item to be modified. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** PlayFab unique identifier of the user whose item is being modified. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Number of uses to add to the item. Can be negative to remove uses. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 UsesToAdd = 0; +}; + +USTRUCT(BlueprintType) +struct FServerModifyItemUsesResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique instance identifier of the item with uses consumed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Number of uses remaining on the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 RemainingUses = 0; +}; + +USTRUCT(BlueprintType) +struct FServerMoveItemToCharacterFromCharacterRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier of the character that currently has the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString GivingCharacterId; + /** Unique PlayFab assigned instance identifier of the item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Unique identifier of the character that will be receiving the item. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ReceivingCharacterId; +}; + +USTRUCT(BlueprintType) +struct FServerMoveItemToCharacterFromCharacterResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerMoveItemToCharacterFromUserRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Unique PlayFab assigned instance identifier of the item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerMoveItemToCharacterFromUserResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerMoveItemToUserFromCharacterRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Unique PlayFab assigned instance identifier of the item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerMoveItemToUserFromCharacterResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerRedeemCouponRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Catalog version of the coupon. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Optional identifier for the Character that should receive the item. If null, item is added to the player */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Generated coupon code to redeem. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CouponCode; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerRedeemCouponResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Items granted to the player as a result of redeeming the coupon. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray GrantedItems; +}; + +USTRUCT(BlueprintType) +struct FServerReportPlayerServerRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional additional comment by reporting player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString Comment; + /** Unique PlayFab identifier of the reported player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ReporteeId; + /** PlayFabId of the reporting player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ReporterId; +}; + +USTRUCT(BlueprintType) +struct FServerReportPlayerServerResult +{ + GENERATED_USTRUCT_BODY() +public: + /** The number of remaining reports which may be filed today by this reporting player. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 SubmissionsRemaining = 0; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeInventoryItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Unique PlayFab assigned instance identifier of the item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeInventoryResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerRevokeInventoryItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of player items to revoke, between 1 and 25 items. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray Items; +}; + +USTRUCT(BlueprintType) +struct FServerRevokeInventoryItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Collection of any errors that occurred during processing. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray Errors; +}; + +USTRUCT(BlueprintType) +struct FServerSubtractCharacterVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Amount to be subtracted from the user balance of the specified virtual currency. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 Amount = 0; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which is to be decremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerSubtractUserVirtualCurrencyRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Amount to be subtracted from the user balance of the specified virtual currency. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + int32 Amount = 0; + /** PlayFab unique identifier of the user whose virtual currency balance is to be decreased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; + /** Name of the virtual currency which is to be decremented. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerUnlockContainerInstanceRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Specifies the catalog version that should be used to determine container contents. If unspecified, uses catalog + * associated with the item instance. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** ItemInstanceId of the container to unlock. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ContainerItemInstanceId; + /** + * ItemInstanceId of the key that will be consumed by unlocking this container. If the container requires a key, this + * parameter is required. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString KeyItemInstanceId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUnlockContainerItemResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Items granted to the player as a result of unlocking the container. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + TArray GrantedItems; + /** Unique instance identifier of the container unlocked. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString UnlockedItemInstanceId; + /** Unique instance identifier of the key used to unlock the container, if applicable. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString UnlockedWithItemInstanceId; + /** Virtual currency granted to the player as a result of unlocking the container. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* VirtualCurrency; +}; + +USTRUCT(BlueprintType) +struct FServerUnlockContainerItemRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Specifies the catalog version that should be used to determine container contents. If unspecified, uses default/primary + * catalog. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CatalogVersion; + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** Catalog ItemId of the container type to unlock. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ContainerItemId; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateUserInventoryItemDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID for a specific character owned by a user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString CharacterId; + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + UPlayFabJsonObject* Data; + /** Unique PlayFab assigned instance identifier of the item */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString ItemInstanceId; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString KeysToRemove; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Player Item Management Models") + FString PlayFabId; +}; + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerAddPlayerTagRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString PlayFabId; + /** Unique tag for player profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString TagName; +}; + +USTRUCT(BlueprintType) +struct FServerAddPlayerTagResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerGetAllSegmentsRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerGetAllSegmentsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of segments for this title. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + TArray Segments; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerSegmentsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of segments the requested player currently belongs to. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + TArray Segments; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayersSegmentsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayersInSegmentRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Continuation token if retrieving subsequent pages of results. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString ContinuationToken; + /** Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + int32 MaxBatchSize = 0; + /** + * Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging + * results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + int32 SecondsToLive = 0; + /** Unique identifier for this segment. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString SegmentId; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayersInSegmentResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString ContinuationToken; + /** Array of player profiles in this segment. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + TArray PlayerProfiles; + /** Count of profiles matching this segment. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + int32 ProfilesInSegment = 0; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerTagsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Optional namespace to filter results by */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString Namespace; + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString PlayFabId; +}; + +USTRUCT(BlueprintType) +struct FServerGetPlayerTagsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString PlayFabId; + /** Canonical tags (including namespace and tag's name) for the requested user */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString Tags; +}; + +USTRUCT(BlueprintType) +struct FServerRemovePlayerTagRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString PlayFabId; + /** Unique tag for player profile. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | PlayStream Models") + FString TagName; +}; + +USTRUCT(BlueprintType) +struct FServerRemovePlayerTagResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerExecuteCloudScriptResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Number of PlayFab API requests issued by the CloudScript function */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 APIRequestsIssued = 0; + /** Information about the error, if any, that occurred during execution */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + UPlayFabJsonObject* Error = nullptr; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 ExecutionTimeSeconds = 0; + /** The name of the function that executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + FString FunctionName; + /** The object returned from the CloudScript function, if any */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + UPlayFabJsonObject* FunctionResult = nullptr; + /** + * Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + bool FunctionResultTooLarge = false; + /** Number of external HTTP requests issued by the CloudScript function */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 HttpRequestsIssued = 0; + /** + * Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + TArray Logs; + /** + * Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + bool LogsTooLarge = false; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 MemoryConsumedBytes = 0; + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 ProcessorTimeSeconds = 0; + /** The revision of the CloudScript that executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 Revision = 0; +}; + +USTRUCT(BlueprintType) +struct FServerExecuteCloudScriptServerRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** The name of the CloudScript function to execute */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + FString FunctionName; + /** Object that is passed in to the function as the first argument */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + UPlayFabJsonObject* FunctionParameter = nullptr; + /** + * Generate a 'player_executed_cloudscript' PlayStream event containing the results of the function execution and other + * contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + bool GeneratePlayStreamEvent = false; + /** The unique user identifier for the player on whose behalf the script is being run */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + FString PlayFabId; + /** + * Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' + * executes the current live, published revision, and 'Specific' executes the specified revision. The default value is + * 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + ECloudScriptRevisionOption RevisionSelection; + /** The specivic revision to execute, when RevisionSelection is set to 'Specific' */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Server-Side Cloud Script Models") + int32 SpecificRevision = 0; +}; + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerAddSharedGroupMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** An array of unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString PlayFabIds; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerAddSharedGroupMembersResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerCreateSharedGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the shared group (a random identifier will be assigned, if one is not specified). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerCreateSharedGroupResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerDeleteSharedGroupRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerGetSharedGroupDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** If true, return the list of all members of the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + bool GetMembers = false; + /** + * Specific keys to retrieve from the shared group (if not specified, all keys will be returned, while an empty array + * indicates that no keys should be returned). + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString Keys; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerGetSharedGroupDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Data for the requested keys. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + UPlayFabJsonObject* Data = nullptr; + /** List of PlayFabId identifiers for the members of this group, if requested. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString Members; +}; + +USTRUCT(BlueprintType) +struct FServerRemoveSharedGroupMembersRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** An array of unique PlayFab assigned ID of the user on whom the operation will be performed. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString PlayFabIds; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerRemoveSharedGroupMembersResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerUpdateSharedGroupDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + UPlayFabJsonObject* Data; + /** + * Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString KeysToRemove; + /** Permission to be applied to all user data keys in this request. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + EUserDataPermission Permission; + /** Unique identifier for the shared group. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Shared Group Data Models") + FString SharedGroupId; +}; + +USTRUCT(BlueprintType) +struct FServerUpdateSharedGroupDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FServerGetCatalogItemsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Which catalog is being requested. If null, uses the default catalog. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString CatalogVersion; +}; + +USTRUCT(BlueprintType) +struct FServerGetCatalogItemsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of items which can be purchased. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + TArray Catalog; +}; + +USTRUCT(BlueprintType) +struct FServerGetPublisherDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** array of keys to get back data from the Publisher data blob, set by the admin tools */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Keys; +}; + +USTRUCT(BlueprintType) +struct FServerGetPublisherDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** a dictionary object of key / value pairs */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + UPlayFabJsonObject* Data; +}; + +USTRUCT(BlueprintType) +struct FServerGetTimeRequest +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerGetTimeResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Current server time when the request was received, in UTC */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Time; +}; + +USTRUCT(BlueprintType) +struct FServerGetTitleDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Specific keys to search for in the title data (leave null to get all keys) */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Keys; +}; + +USTRUCT(BlueprintType) +struct FServerGetTitleDataResult +{ + GENERATED_USTRUCT_BODY() +public: + /** a dictionary object of key / value pairs */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + UPlayFabJsonObject* Data; +}; + +USTRUCT(BlueprintType) +struct FServerGetTitleNewsRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** Limits the results to the last n entries. Defaults to 10 if not set. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + int32 Count = 0; +}; + +USTRUCT(BlueprintType) +struct FServerGetTitleNewsResult +{ + GENERATED_USTRUCT_BODY() +public: + /** Array of news items. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + TArray News; +}; + +USTRUCT(BlueprintType) +struct FServerSetPublisherDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Key; + /** new value to set. Set to null to remove a value */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Value; +}; + +USTRUCT(BlueprintType) +struct FServerSetPublisherDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + +USTRUCT(BlueprintType) +struct FServerSetTitleDataRequest +{ + GENERATED_USTRUCT_BODY() +public: + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Key; + /** new value to set. Set to null to remove a value */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PlayFab | Server | Title-Wide Data Management Models") + FString Value; +}; + +USTRUCT(BlueprintType) +struct FServerSetTitleDataResult +{ + GENERATED_USTRUCT_BODY() +public: +}; + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabUtilities.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabUtilities.h new file mode 100644 index 000000000..5b3482ae4 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabUtilities.h @@ -0,0 +1,36 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated header file for the UE4 PlayFab plugin. +// This header file contains the utilities functions that supports the plugin. +// +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "PlayFabUtilities.generated.h" + +class UPlayFabJsonObject; + +UCLASS() +class PLAYFAB_API UPlayFabUtilities : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() +public: + /** Setup the PlayFab settings used throughout the plugin. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Settings") + static void setPlayFabSettings(FString GameTitleId, FString PlayFabSecretApiKey = "", FString PhotonRealtimeAppId = "", FString PhotonTurnbasedAppId = "", FString PhotonChatAppId = ""); + + /** Returns the error code text given the error code */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Errors") + static FString getErrorText(int32 code); + + /** Returns the requested photon application id. */ + UFUNCTION(BlueprintCallable, Category = "PlayFab | Photon | Authentication") + static FString getPhotonAppId(bool Realtime = false, bool Chat = false, bool Turnbased = false); +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/PlayFab.Build.cs b/PlayFabPlugin/PlayFab/Source/PlayFab/PlayFab.Build.cs new file mode 100644 index 000000000..848635a69 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/PlayFab.Build.cs @@ -0,0 +1,33 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +using UnrealBuildTool; +using System.IO; + +namespace UnrealBuildTool.Rules +{ + public class PlayFab : ModuleRules + { + public PlayFab(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public")); + + PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private")); + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "CoreUObject", + "Engine", + "HTTP", + "Json", + "PlayFabCommon" + } + ); + } + } +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFab.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFab.cpp new file mode 100644 index 000000000..0719ce70e --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFab.cpp @@ -0,0 +1,60 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// This cpp file is the main cpp file for the plugin. We set up globals here. +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "CoreMinimal.h" +#include "PlayFabPrivate.h" +#include "PlayFabJsonValue.h" +#include "PlayFabJsonObject.h" + + +#include "PlayFabAdminAPI.h" +#include "PlayFabClientAPI.h" +#include "PlayFabMatchmakerAPI.h" +#include "PlayFabServerAPI.h" +#include "PlayFabAuthenticationAPI.h" +#include "PlayFabCloudScriptAPI.h" +#include "PlayFabDataAPI.h" +#include "PlayFabEventsAPI.h" +#include "PlayFabGroupsAPI.h" +#include "PlayFabLocalizationAPI.h" +#include "PlayFabProfilesAPI.h" + +class FPlayFab : public IPlayFab +{ + /** IModuleInterface implementation */ + virtual void StartupModule() override + { + //Force classes to be compiled on shipping build + UPlayFabJsonObject::StaticClass(); + UPlayFabJsonValue::StaticClass(); + + UPlayFabAdminAPI::StaticClass(); + UPlayFabClientAPI::StaticClass(); + UPlayFabMatchmakerAPI::StaticClass(); + UPlayFabServerAPI::StaticClass(); + UPlayFabAuthenticationAPI::StaticClass(); + UPlayFabCloudScriptAPI::StaticClass(); + UPlayFabDataAPI::StaticClass(); + UPlayFabEventsAPI::StaticClass(); + UPlayFabGroupsAPI::StaticClass(); + UPlayFabLocalizationAPI::StaticClass(); + UPlayFabProfilesAPI::StaticClass(); + } + + virtual void ShutdownModule() override + { + + } + +}; + +IMPLEMENT_MODULE(FPlayFab, PlayFab) + +DEFINE_LOG_CATEGORY(LogPlayFab); diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAdminAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAdminAPI.cpp new file mode 100644 index 000000000..cc549b214 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAdminAPI.cpp @@ -0,0 +1,5929 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Admin +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabAdminAPI.h" +#include "PlayFabAdminModels.h" +#include "PlayFabAdminModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabAdminAPI::UPlayFabAdminAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabAdminAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabAdminAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabAdminAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Admin API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// +/** Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::BanUsers(FAdminBanUsersRequest request, + FDelegateOnSuccessBanUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessBanUsers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperBanUsers); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/BanUsers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Bans.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Bans")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Bans"), request.Bans); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperBanUsers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessBanUsers.IsBound()) + { + FAdminBanUsersResult result = UPlayFabAdminModelDecoder::decodeBanUsersResultResponse(response.responseData); + OnSuccessBanUsers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes a master player account entirely from all titles and deletes all associated data */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeleteMasterPlayerAccount(FAdminDeleteMasterPlayerAccountRequest request, + FDelegateOnSuccessDeleteMasterPlayerAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteMasterPlayerAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeleteMasterPlayerAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeleteMasterPlayerAccount"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeleteMasterPlayerAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteMasterPlayerAccount.IsBound()) + { + FAdminDeleteMasterPlayerAccountResult result = UPlayFabAdminModelDecoder::decodeDeleteMasterPlayerAccountResultResponse(response.responseData); + OnSuccessDeleteMasterPlayerAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes a user's player account from a title and deletes all associated data */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeletePlayer(FAdminDeletePlayerRequest request, + FDelegateOnSuccessDeletePlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeletePlayer = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeletePlayer); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeletePlayer"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeletePlayer(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeletePlayer.IsBound()) + { + FAdminDeletePlayerResult result = UPlayFabAdminModelDecoder::decodeDeletePlayerResultResponse(response.responseData); + OnSuccessDeletePlayer.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Permanently deletes a title and all associated configuration */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeleteTitle(FAdminDeleteTitleRequest request, + FDelegateOnSuccessDeleteTitle onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteTitle = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeleteTitle); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeleteTitle"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeleteTitle(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteTitle.IsBound()) + { + FAdminDeleteTitleResult result = UPlayFabAdminModelDecoder::decodeDeleteTitleResultResponse(response.responseData); + OnSuccessDeleteTitle.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Exports all associated data of a master player account */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ExportMasterPlayerData(FAdminExportMasterPlayerDataRequest request, + FDelegateOnSuccessExportMasterPlayerData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessExportMasterPlayerData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperExportMasterPlayerData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ExportMasterPlayerData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperExportMasterPlayerData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessExportMasterPlayerData.IsBound()) + { + FAdminExportMasterPlayerDataResult result = UPlayFabAdminModelDecoder::decodeExportMasterPlayerDataResultResponse(response.responseData); + OnSuccessExportMasterPlayerData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get the list of titles that the player has played */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayedTitleList(FAdminGetPlayedTitleListRequest request, + FDelegateOnSuccessGetPlayedTitleList onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayedTitleList = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayedTitleList); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayedTitleList"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayedTitleList(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayedTitleList.IsBound()) + { + FAdminGetPlayedTitleListResult result = UPlayFabAdminModelDecoder::decodeGetPlayedTitleListResultResponse(response.responseData); + OnSuccessGetPlayedTitleList.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets a player's ID from an auth token. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerIdFromAuthToken(FAdminGetPlayerIdFromAuthTokenRequest request, + FDelegateOnSuccessGetPlayerIdFromAuthToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerIdFromAuthToken = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerIdFromAuthToken); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerIdFromAuthToken"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Token.IsEmpty() || request.Token == "") { + OutRestJsonObj->SetFieldNull(TEXT("Token")); + } else { + OutRestJsonObj->SetStringField(TEXT("Token"), request.Token); + } + FString temp_TokenType; + if (GetEnumValueToString(TEXT("EAuthTokenType"), request.TokenType, temp_TokenType)) + OutRestJsonObj->SetStringField(TEXT("TokenType"), temp_TokenType); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerIdFromAuthToken(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerIdFromAuthToken.IsBound()) + { + FAdminGetPlayerIdFromAuthTokenResult result = UPlayFabAdminModelDecoder::decodeGetPlayerIdFromAuthTokenResultResponse(response.responseData); + OnSuccessGetPlayerIdFromAuthToken.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the player's profile */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerProfile(FAdminGetPlayerProfileRequest request, + FDelegateOnSuccessGetPlayerProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerProfile = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerProfile); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerProfile"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerProfile(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerProfile.IsBound()) + { + FAdminGetPlayerProfileResult result = UPlayFabAdminModelDecoder::decodeGetPlayerProfileResultResponse(response.responseData); + OnSuccessGetPlayerProfile.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the relevant details for a specified user, based upon a match against a supplied unique identifier */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserAccountInfo(FAdminLookupUserAccountInfoRequest request, + FDelegateOnSuccessGetUserAccountInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserAccountInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserAccountInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserAccountInfo"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.TitleDisplayName.IsEmpty() || request.TitleDisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("TitleDisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("TitleDisplayName"), request.TitleDisplayName); + } + if (request.Username.IsEmpty() || request.Username == "") { + OutRestJsonObj->SetFieldNull(TEXT("Username")); + } else { + OutRestJsonObj->SetStringField(TEXT("Username"), request.Username); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserAccountInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserAccountInfo.IsBound()) + { + FAdminLookupUserAccountInfoResult result = UPlayFabAdminModelDecoder::decodeLookupUserAccountInfoResultResponse(response.responseData); + OnSuccessGetUserAccountInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets all bans for a user. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserBans(FAdminGetUserBansRequest request, + FDelegateOnSuccessGetUserBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserBans = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserBans); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserBans"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserBans(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserBans.IsBound()) + { + FAdminGetUserBansResult result = UPlayFabAdminModelDecoder::decodeGetUserBansResultResponse(response.responseData); + OnSuccessGetUserBans.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Reset a player's password for a given title. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ResetPassword(FAdminResetPasswordRequest request, + FDelegateOnSuccessResetPassword onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessResetPassword = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperResetPassword); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ResetPassword"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Password.IsEmpty() || request.Password == "") { + OutRestJsonObj->SetFieldNull(TEXT("Password")); + } else { + OutRestJsonObj->SetStringField(TEXT("Password"), request.Password); + } + if (request.Token.IsEmpty() || request.Token == "") { + OutRestJsonObj->SetFieldNull(TEXT("Token")); + } else { + OutRestJsonObj->SetStringField(TEXT("Token"), request.Token); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperResetPassword(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessResetPassword.IsBound()) + { + FAdminResetPasswordResult result = UPlayFabAdminModelDecoder::decodeResetPasswordResultResponse(response.responseData); + OnSuccessResetPassword.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revoke all active bans for a user. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RevokeAllBansForUser(FAdminRevokeAllBansForUserRequest request, + FDelegateOnSuccessRevokeAllBansForUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeAllBansForUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRevokeAllBansForUser); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RevokeAllBansForUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRevokeAllBansForUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeAllBansForUser.IsBound()) + { + FAdminRevokeAllBansForUserResult result = UPlayFabAdminModelDecoder::decodeRevokeAllBansForUserResultResponse(response.responseData); + OnSuccessRevokeAllBansForUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revoke all active bans specified with BanId. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RevokeBans(FAdminRevokeBansRequest request, + FDelegateOnSuccessRevokeBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeBans = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRevokeBans); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RevokeBans"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.BanIds.IsEmpty() || request.BanIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("BanIds")); + } else { + TArray BanIdsArray; + FString(request.BanIds).ParseIntoArray(BanIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("BanIds"), BanIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRevokeBans(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeBans.IsBound()) + { + FAdminRevokeBansResult result = UPlayFabAdminModelDecoder::decodeRevokeBansResultResponse(response.responseData); + OnSuccessRevokeBans.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to change the password.If an account recovery email template ID is provided, an email using the custom email template will be used. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SendAccountRecoveryEmail(FAdminSendAccountRecoveryEmailRequest request, + FDelegateOnSuccessSendAccountRecoveryEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSendAccountRecoveryEmail = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSendAccountRecoveryEmail); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SendAccountRecoveryEmail"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.EmailTemplateId.IsEmpty() || request.EmailTemplateId == "") { + OutRestJsonObj->SetFieldNull(TEXT("EmailTemplateId")); + } else { + OutRestJsonObj->SetStringField(TEXT("EmailTemplateId"), request.EmailTemplateId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSendAccountRecoveryEmail(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSendAccountRecoveryEmail.IsBound()) + { + FAdminSendAccountRecoveryEmailResult result = UPlayFabAdminModelDecoder::decodeSendAccountRecoveryEmailResultResponse(response.responseData); + OnSuccessSendAccountRecoveryEmail.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates information of a list of existing bans specified with Ban Ids. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateBans(FAdminUpdateBansRequest request, + FDelegateOnSuccessUpdateBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateBans = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateBans); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateBans"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Bans.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Bans")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Bans"), request.Bans); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateBans(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateBans.IsBound()) + { + FAdminUpdateBansResult result = UPlayFabAdminModelDecoder::decodeUpdateBansResultResponse(response.responseData); + OnSuccessUpdateBans.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title specific display name for a user */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserTitleDisplayName(FAdminUpdateUserTitleDisplayNameRequest request, + FDelegateOnSuccessUpdateUserTitleDisplayName onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserTitleDisplayName = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserTitleDisplayName); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserTitleDisplayName"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.DisplayName.IsEmpty() || request.DisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("DisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("DisplayName"), request.DisplayName); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserTitleDisplayName(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserTitleDisplayName.IsBound()) + { + FAdminUpdateUserTitleDisplayNameResult result = UPlayFabAdminModelDecoder::decodeUpdateUserTitleDisplayNameResultResponse(response.responseData); + OnSuccessUpdateUserTitleDisplayName.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// +/** Creates a new Player Shared Secret Key. It may take up to 5 minutes for this key to become generally available after this API returns. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::CreatePlayerSharedSecret(FAdminCreatePlayerSharedSecretRequest request, + FDelegateOnSuccessCreatePlayerSharedSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreatePlayerSharedSecret = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperCreatePlayerSharedSecret); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/CreatePlayerSharedSecret"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.FriendlyName.IsEmpty() || request.FriendlyName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendlyName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendlyName"), request.FriendlyName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperCreatePlayerSharedSecret(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreatePlayerSharedSecret.IsBound()) + { + FAdminCreatePlayerSharedSecretResult result = UPlayFabAdminModelDecoder::decodeCreatePlayerSharedSecretResultResponse(response.responseData); + OnSuccessCreatePlayerSharedSecret.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Deletes an existing Player Shared Secret Key. It may take up to 5 minutes for this delete to be reflected after this API returns. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeletePlayerSharedSecret(FAdminDeletePlayerSharedSecretRequest request, + FDelegateOnSuccessDeletePlayerSharedSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeletePlayerSharedSecret = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeletePlayerSharedSecret); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeletePlayerSharedSecret"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.SecretKey.IsEmpty() || request.SecretKey == "") { + OutRestJsonObj->SetFieldNull(TEXT("SecretKey")); + } else { + OutRestJsonObj->SetStringField(TEXT("SecretKey"), request.SecretKey); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeletePlayerSharedSecret(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeletePlayerSharedSecret.IsBound()) + { + FAdminDeletePlayerSharedSecretResult result = UPlayFabAdminModelDecoder::decodeDeletePlayerSharedSecretResultResponse(response.responseData); + OnSuccessDeletePlayerSharedSecret.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Returns all Player Shared Secret Keys including disabled and expired. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerSharedSecrets(FAdminGetPlayerSharedSecretsRequest request, + FDelegateOnSuccessGetPlayerSharedSecrets onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerSharedSecrets = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerSharedSecrets); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerSharedSecrets"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerSharedSecrets(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerSharedSecrets.IsBound()) + { + FAdminGetPlayerSharedSecretsResult result = UPlayFabAdminModelDecoder::decodeGetPlayerSharedSecretsResultResponse(response.responseData); + OnSuccessGetPlayerSharedSecrets.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets the requested policy. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPolicy(FAdminGetPolicyRequest request, + FDelegateOnSuccessGetPolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPolicy = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPolicy); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPolicy"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PolicyName.IsEmpty() || request.PolicyName == "") { + OutRestJsonObj->SetFieldNull(TEXT("PolicyName")); + } else { + OutRestJsonObj->SetStringField(TEXT("PolicyName"), request.PolicyName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPolicy(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPolicy.IsBound()) + { + FAdminGetPolicyResponse result = UPlayFabAdminModelDecoder::decodeGetPolicyResponseResponse(response.responseData); + OnSuccessGetPolicy.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets or resets the player's secret. Player secrets are used to sign API requests. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetPlayerSecret(FAdminSetPlayerSecretRequest request, + FDelegateOnSuccessSetPlayerSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetPlayerSecret = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetPlayerSecret); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetPlayerSecret"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetPlayerSecret(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetPlayerSecret.IsBound()) + { + FAdminSetPlayerSecretResult result = UPlayFabAdminModelDecoder::decodeSetPlayerSecretResultResponse(response.responseData); + OnSuccessSetPlayerSecret.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates a existing Player Shared Secret Key. It may take up to 5 minutes for this update to become generally available after this API returns. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdatePlayerSharedSecret(FAdminUpdatePlayerSharedSecretRequest request, + FDelegateOnSuccessUpdatePlayerSharedSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdatePlayerSharedSecret = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdatePlayerSharedSecret); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdatePlayerSharedSecret"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("Disabled"), request.Disabled); + if (request.FriendlyName.IsEmpty() || request.FriendlyName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendlyName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendlyName"), request.FriendlyName); + } + if (request.SecretKey.IsEmpty() || request.SecretKey == "") { + OutRestJsonObj->SetFieldNull(TEXT("SecretKey")); + } else { + OutRestJsonObj->SetStringField(TEXT("SecretKey"), request.SecretKey); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdatePlayerSharedSecret(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdatePlayerSharedSecret.IsBound()) + { + FAdminUpdatePlayerSharedSecretResult result = UPlayFabAdminModelDecoder::decodeUpdatePlayerSharedSecretResultResponse(response.responseData); + OnSuccessUpdatePlayerSharedSecret.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Changes a policy for a title */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdatePolicy(FAdminUpdatePolicyRequest request, + FDelegateOnSuccessUpdatePolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdatePolicy = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdatePolicy); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdatePolicy"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("OverwritePolicy"), request.OverwritePolicy); + if (request.PolicyName.IsEmpty() || request.PolicyName == "") { + OutRestJsonObj->SetFieldNull(TEXT("PolicyName")); + } else { + OutRestJsonObj->SetStringField(TEXT("PolicyName"), request.PolicyName); + } + if (request.Statements.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Statements")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Statements"), request.Statements); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdatePolicy(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdatePolicy.IsBound()) + { + FAdminUpdatePolicyResponse result = UPlayFabAdminModelDecoder::decodeUpdatePolicyResponseResponse(response.responseData); + OnSuccessUpdatePolicy.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// +/** Completely removes all statistics for the specified character, for the current game */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ResetCharacterStatistics(FAdminResetCharacterStatisticsRequest request, + FDelegateOnSuccessResetCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessResetCharacterStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperResetCharacterStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ResetCharacterStatistics"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperResetCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessResetCharacterStatistics.IsBound()) + { + FAdminResetCharacterStatisticsResult result = UPlayFabAdminModelDecoder::decodeResetCharacterStatisticsResultResponse(response.responseData); + OnSuccessResetCharacterStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// +/** Delete a content file from the title. When deleting a file that does not exist, it returns success. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeleteContent(FAdminDeleteContentRequest request, + FDelegateOnSuccessDeleteContent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteContent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeleteContent); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeleteContent"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeleteContent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteContent.IsBound()) + { + FAdminBlankResult result = UPlayFabAdminModelDecoder::decodeBlankResultResponse(response.responseData); + OnSuccessDeleteContent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** List all contents of the title and get statistics such as size */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetContentList(FAdminGetContentListRequest request, + FDelegateOnSuccessGetContentList onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetContentList = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetContentList); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetContentList"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Prefix.IsEmpty() || request.Prefix == "") { + OutRestJsonObj->SetFieldNull(TEXT("Prefix")); + } else { + OutRestJsonObj->SetStringField(TEXT("Prefix"), request.Prefix); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetContentList(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetContentList.IsBound()) + { + FAdminGetContentListResult result = UPlayFabAdminModelDecoder::decodeGetContentListResultResponse(response.responseData); + OnSuccessGetContentList.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the pre-signed URL for uploading a content file. A subsequent HTTP PUT to the returned URL uploads the content. Also, please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetContentUploadUrl(FAdminGetContentUploadUrlRequest request, + FDelegateOnSuccessGetContentUploadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetContentUploadUrl = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetContentUploadUrl); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetContentUploadUrl"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.ContentType.IsEmpty() || request.ContentType == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContentType")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContentType"), request.ContentType); + } + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetContentUploadUrl(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetContentUploadUrl.IsBound()) + { + FAdminGetContentUploadUrlResult result = UPlayFabAdminModelDecoder::decodeGetContentUploadUrlResultResponse(response.responseData); + OnSuccessGetContentUploadUrl.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Custom Server Management +////////////////////////////////////////////////////// +/** Adds the game server executable specified (previously uploaded - see GetServerBuildUploadUrl) to the set of those a client is permitted to request in a call to StartGame */ +UPlayFabAdminAPI* UPlayFabAdminAPI::AddServerBuild(FAdminAddServerBuildRequest request, + FDelegateOnSuccessAddServerBuild onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddServerBuild = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperAddServerBuild); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/AddServerBuild"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.ActiveRegions.IsEmpty() || request.ActiveRegions == "") { + OutRestJsonObj->SetFieldNull(TEXT("ActiveRegions")); + } else { + TArray ActiveRegionsArray; + FString(request.ActiveRegions).ParseIntoArray(ActiveRegionsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("ActiveRegions"), ActiveRegionsArray); + } + if (request.BuildId.IsEmpty() || request.BuildId == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildId")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildId"), request.BuildId); + } + if (request.CommandLineTemplate.IsEmpty() || request.CommandLineTemplate == "") { + OutRestJsonObj->SetFieldNull(TEXT("CommandLineTemplate")); + } else { + OutRestJsonObj->SetStringField(TEXT("CommandLineTemplate"), request.CommandLineTemplate); + } + if (request.Comment.IsEmpty() || request.Comment == "") { + OutRestJsonObj->SetFieldNull(TEXT("Comment")); + } else { + OutRestJsonObj->SetStringField(TEXT("Comment"), request.Comment); + } + if (request.ExecutablePath.IsEmpty() || request.ExecutablePath == "") { + OutRestJsonObj->SetFieldNull(TEXT("ExecutablePath")); + } else { + OutRestJsonObj->SetStringField(TEXT("ExecutablePath"), request.ExecutablePath); + } + OutRestJsonObj->SetNumberField(TEXT("MaxGamesPerHost"), request.MaxGamesPerHost); + OutRestJsonObj->SetNumberField(TEXT("MinFreeGameSlots"), request.MinFreeGameSlots); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperAddServerBuild(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddServerBuild.IsBound()) + { + FAdminAddServerBuildResult result = UPlayFabAdminModelDecoder::decodeAddServerBuildResultResponse(response.responseData); + OnSuccessAddServerBuild.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the build details for the specified game server executable */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetServerBuildInfo(FAdminGetServerBuildInfoRequest request, + FDelegateOnSuccessGetServerBuildInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetServerBuildInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetServerBuildInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetServerBuildInfo"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.BuildId.IsEmpty() || request.BuildId == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildId")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildId"), request.BuildId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetServerBuildInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetServerBuildInfo.IsBound()) + { + FAdminGetServerBuildInfoResult result = UPlayFabAdminModelDecoder::decodeGetServerBuildInfoResultResponse(response.responseData); + OnSuccessGetServerBuildInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the pre-authorized URL for uploading a game server package containing a build (does not enable the build for use - see AddServerBuild) */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetServerBuildUploadUrl(FAdminGetServerBuildUploadURLRequest request, + FDelegateOnSuccessGetServerBuildUploadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetServerBuildUploadUrl = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetServerBuildUploadUrl); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetServerBuildUploadUrl"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.BuildId.IsEmpty() || request.BuildId == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildId")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildId"), request.BuildId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetServerBuildUploadUrl(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetServerBuildUploadUrl.IsBound()) + { + FAdminGetServerBuildUploadURLResult result = UPlayFabAdminModelDecoder::decodeGetServerBuildUploadURLResultResponse(response.responseData); + OnSuccessGetServerBuildUploadUrl.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the build details for all game server executables which are currently defined for the title */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ListServerBuilds(FAdminListBuildsRequest request, + FDelegateOnSuccessListServerBuilds onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListServerBuilds = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperListServerBuilds); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ListServerBuilds"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperListServerBuilds(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListServerBuilds.IsBound()) + { + FAdminListBuildsResult result = UPlayFabAdminModelDecoder::decodeListBuildsResultResponse(response.responseData); + OnSuccessListServerBuilds.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the build details for the specified game server executable */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ModifyServerBuild(FAdminModifyServerBuildRequest request, + FDelegateOnSuccessModifyServerBuild onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessModifyServerBuild = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperModifyServerBuild); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ModifyServerBuild"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.ActiveRegions.IsEmpty() || request.ActiveRegions == "") { + OutRestJsonObj->SetFieldNull(TEXT("ActiveRegions")); + } else { + TArray ActiveRegionsArray; + FString(request.ActiveRegions).ParseIntoArray(ActiveRegionsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("ActiveRegions"), ActiveRegionsArray); + } + if (request.BuildId.IsEmpty() || request.BuildId == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildId")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildId"), request.BuildId); + } + if (request.CommandLineTemplate.IsEmpty() || request.CommandLineTemplate == "") { + OutRestJsonObj->SetFieldNull(TEXT("CommandLineTemplate")); + } else { + OutRestJsonObj->SetStringField(TEXT("CommandLineTemplate"), request.CommandLineTemplate); + } + if (request.Comment.IsEmpty() || request.Comment == "") { + OutRestJsonObj->SetFieldNull(TEXT("Comment")); + } else { + OutRestJsonObj->SetStringField(TEXT("Comment"), request.Comment); + } + if (request.ExecutablePath.IsEmpty() || request.ExecutablePath == "") { + OutRestJsonObj->SetFieldNull(TEXT("ExecutablePath")); + } else { + OutRestJsonObj->SetStringField(TEXT("ExecutablePath"), request.ExecutablePath); + } + OutRestJsonObj->SetNumberField(TEXT("MaxGamesPerHost"), request.MaxGamesPerHost); + OutRestJsonObj->SetNumberField(TEXT("MinFreeGameSlots"), request.MinFreeGameSlots); + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperModifyServerBuild(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessModifyServerBuild.IsBound()) + { + FAdminModifyServerBuildResult result = UPlayFabAdminModelDecoder::decodeModifyServerBuildResultResponse(response.responseData); + OnSuccessModifyServerBuild.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes the game server executable specified from the set of those a client is permitted to request in a call to StartGame */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RemoveServerBuild(FAdminRemoveServerBuildRequest request, + FDelegateOnSuccessRemoveServerBuild onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveServerBuild = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRemoveServerBuild); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RemoveServerBuild"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.BuildId.IsEmpty() || request.BuildId == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildId")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildId"), request.BuildId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRemoveServerBuild(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveServerBuild.IsBound()) + { + FAdminRemoveServerBuildResult result = UPlayFabAdminModelDecoder::decodeRemoveServerBuildResultResponse(response.responseData); + OnSuccessRemoveServerBuild.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// +/** Retrieves the details for a specific completed session, including links to standard out and standard error logs */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetMatchmakerGameInfo(FAdminGetMatchmakerGameInfoRequest request, + FDelegateOnSuccessGetMatchmakerGameInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetMatchmakerGameInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetMatchmakerGameInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetMatchmakerGameInfo"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetMatchmakerGameInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetMatchmakerGameInfo.IsBound()) + { + FAdminGetMatchmakerGameInfoResult result = UPlayFabAdminModelDecoder::decodeGetMatchmakerGameInfoResultResponse(response.responseData); + OnSuccessGetMatchmakerGameInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the details of defined game modes for the specified game server executable */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetMatchmakerGameModes(FAdminGetMatchmakerGameModesRequest request, + FDelegateOnSuccessGetMatchmakerGameModes onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetMatchmakerGameModes = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetMatchmakerGameModes); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetMatchmakerGameModes"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.BuildVersion.IsEmpty() || request.BuildVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildVersion"), request.BuildVersion); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetMatchmakerGameModes(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetMatchmakerGameModes.IsBound()) + { + FAdminGetMatchmakerGameModesResult result = UPlayFabAdminModelDecoder::decodeGetMatchmakerGameModesResultResponse(response.responseData); + OnSuccessGetMatchmakerGameModes.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the game server mode details for the specified game server executable */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ModifyMatchmakerGameModes(FAdminModifyMatchmakerGameModesRequest request, + FDelegateOnSuccessModifyMatchmakerGameModes onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessModifyMatchmakerGameModes = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperModifyMatchmakerGameModes); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ModifyMatchmakerGameModes"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.BuildVersion.IsEmpty() || request.BuildVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildVersion"), request.BuildVersion); + } + if (request.GameModes.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("GameModes")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("GameModes"), request.GameModes); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperModifyMatchmakerGameModes(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessModifyMatchmakerGameModes.IsBound()) + { + FAdminModifyMatchmakerGameModesResult result = UPlayFabAdminModelDecoder::decodeModifyMatchmakerGameModesResultResponse(response.responseData); + OnSuccessModifyMatchmakerGameModes.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// +/** Adds a new player statistic configuration to the title, optionally allowing the developer to specify a reset interval and an aggregation method. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::CreatePlayerStatisticDefinition(FAdminCreatePlayerStatisticDefinitionRequest request, + FDelegateOnSuccessCreatePlayerStatisticDefinition onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreatePlayerStatisticDefinition = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperCreatePlayerStatisticDefinition); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/CreatePlayerStatisticDefinition"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + FString temp_AggregationMethod; + if (GetEnumValueToString(TEXT("EStatisticAggregationMethod"), request.AggregationMethod, temp_AggregationMethod)) + OutRestJsonObj->SetStringField(TEXT("AggregationMethod"), temp_AggregationMethod); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + FString temp_VersionChangeInterval; + if (GetEnumValueToString(TEXT("EStatisticResetIntervalOption"), request.VersionChangeInterval, temp_VersionChangeInterval)) + OutRestJsonObj->SetStringField(TEXT("VersionChangeInterval"), temp_VersionChangeInterval); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperCreatePlayerStatisticDefinition(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreatePlayerStatisticDefinition.IsBound()) + { + FAdminCreatePlayerStatisticDefinitionResult result = UPlayFabAdminModelDecoder::decodeCreatePlayerStatisticDefinitionResultResponse(response.responseData); + OnSuccessCreatePlayerStatisticDefinition.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a download URL for the requested report */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetDataReport(FAdminGetDataReportRequest request, + FDelegateOnSuccessGetDataReport onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetDataReport = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetDataReport); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetDataReport"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Day"), request.Day); + OutRestJsonObj->SetNumberField(TEXT("Month"), request.Month); + if (request.ReportName.IsEmpty() || request.ReportName == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReportName")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReportName"), request.ReportName); + } + OutRestJsonObj->SetNumberField(TEXT("Year"), request.Year); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetDataReport(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetDataReport.IsBound()) + { + FAdminGetDataReportResult result = UPlayFabAdminModelDecoder::decodeGetDataReportResultResponse(response.responseData); + OnSuccessGetDataReport.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the configuration information for all player statistics defined in the title, regardless of whether they have a reset interval. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerStatisticDefinitions(FAdminGetPlayerStatisticDefinitionsRequest request, + FDelegateOnSuccessGetPlayerStatisticDefinitions onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerStatisticDefinitions = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerStatisticDefinitions); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerStatisticDefinitions"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerStatisticDefinitions(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerStatisticDefinitions.IsBound()) + { + FAdminGetPlayerStatisticDefinitionsResult result = UPlayFabAdminModelDecoder::decodeGetPlayerStatisticDefinitionsResultResponse(response.responseData); + OnSuccessGetPlayerStatisticDefinitions.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the information on the available versions of the specified statistic. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerStatisticVersions(FAdminGetPlayerStatisticVersionsRequest request, + FDelegateOnSuccessGetPlayerStatisticVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerStatisticVersions = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerStatisticVersions); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerStatisticVersions"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerStatisticVersions(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerStatisticVersions.IsBound()) + { + FAdminGetPlayerStatisticVersionsResult result = UPlayFabAdminModelDecoder::decodeGetPlayerStatisticVersionsResultResponse(response.responseData); + OnSuccessGetPlayerStatisticVersions.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserData.IsBound()) + { + FAdminGetUserDataResult result = UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which cannot be accessed by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserInternalData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserInternalData.IsBound()) + { + FAdminGetUserDataResult result = UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserPublisherData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherData.IsBound()) + { + FAdminGetUserDataResult result = UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which cannot be accessed by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserPublisherInternalData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserPublisherInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserPublisherInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherInternalData.IsBound()) + { + FAdminGetUserDataResult result = UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which can only be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserPublisherReadOnlyData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserPublisherReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserPublisherReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherReadOnlyData.IsBound()) + { + FAdminGetUserDataResult result = UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which can only be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserReadOnlyData(FAdminGetUserDataRequest request, + FDelegateOnSuccessGetUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserReadOnlyData.IsBound()) + { + FAdminGetUserDataResult result = UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Resets the indicated statistic, removing all player entries for it and backing up the old values. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::IncrementPlayerStatisticVersion(FAdminIncrementPlayerStatisticVersionRequest request, + FDelegateOnSuccessIncrementPlayerStatisticVersion onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessIncrementPlayerStatisticVersion = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperIncrementPlayerStatisticVersion); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/IncrementPlayerStatisticVersion"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperIncrementPlayerStatisticVersion(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessIncrementPlayerStatisticVersion.IsBound()) + { + FAdminIncrementPlayerStatisticVersionResult result = UPlayFabAdminModelDecoder::decodeIncrementPlayerStatisticVersionResultResponse(response.responseData); + OnSuccessIncrementPlayerStatisticVersion.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Attempts to process an order refund through the original real money payment provider. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RefundPurchase(FAdminRefundPurchaseRequest request, + FDelegateOnSuccessRefundPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRefundPurchase = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRefundPurchase); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RefundPurchase"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.OrderId.IsEmpty() || request.OrderId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OrderId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OrderId"), request.OrderId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.Reason.IsEmpty() || request.Reason == "") { + OutRestJsonObj->SetFieldNull(TEXT("Reason")); + } else { + OutRestJsonObj->SetStringField(TEXT("Reason"), request.Reason); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRefundPurchase(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRefundPurchase.IsBound()) + { + FAdminRefundPurchaseResponse result = UPlayFabAdminModelDecoder::decodeRefundPurchaseResponseResponse(response.responseData); + OnSuccessRefundPurchase.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Completely removes all statistics for the specified user, for the current game */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ResetUserStatistics(FAdminResetUserStatisticsRequest request, + FDelegateOnSuccessResetUserStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessResetUserStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperResetUserStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ResetUserStatistics"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperResetUserStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessResetUserStatistics.IsBound()) + { + FAdminResetUserStatisticsResult result = UPlayFabAdminModelDecoder::decodeResetUserStatisticsResultResponse(response.responseData); + OnSuccessResetUserStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Attempts to resolve a dispute with the original order's payment provider. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ResolvePurchaseDispute(FAdminResolvePurchaseDisputeRequest request, + FDelegateOnSuccessResolvePurchaseDispute onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessResolvePurchaseDispute = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperResolvePurchaseDispute); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ResolvePurchaseDispute"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.OrderId.IsEmpty() || request.OrderId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OrderId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OrderId"), request.OrderId); + } + FString temp_Outcome; + if (GetEnumValueToString(TEXT("EResolutionOutcome"), request.Outcome, temp_Outcome)) + OutRestJsonObj->SetStringField(TEXT("Outcome"), temp_Outcome); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.Reason.IsEmpty() || request.Reason == "") { + OutRestJsonObj->SetFieldNull(TEXT("Reason")); + } else { + OutRestJsonObj->SetStringField(TEXT("Reason"), request.Reason); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperResolvePurchaseDispute(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessResolvePurchaseDispute.IsBound()) + { + FAdminResolvePurchaseDisputeResponse result = UPlayFabAdminModelDecoder::decodeResolvePurchaseDisputeResponseResponse(response.responseData); + OnSuccessResolvePurchaseDispute.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates a player statistic configuration for the title, optionally allowing the developer to specify a reset interval. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdatePlayerStatisticDefinition(FAdminUpdatePlayerStatisticDefinitionRequest request, + FDelegateOnSuccessUpdatePlayerStatisticDefinition onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdatePlayerStatisticDefinition = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdatePlayerStatisticDefinition); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdatePlayerStatisticDefinition"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + FString temp_AggregationMethod; + if (GetEnumValueToString(TEXT("EStatisticAggregationMethod"), request.AggregationMethod, temp_AggregationMethod)) + OutRestJsonObj->SetStringField(TEXT("AggregationMethod"), temp_AggregationMethod); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + FString temp_VersionChangeInterval; + if (GetEnumValueToString(TEXT("EStatisticResetIntervalOption"), request.VersionChangeInterval, temp_VersionChangeInterval)) + OutRestJsonObj->SetStringField(TEXT("VersionChangeInterval"), temp_VersionChangeInterval); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdatePlayerStatisticDefinition(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdatePlayerStatisticDefinition.IsBound()) + { + FAdminUpdatePlayerStatisticDefinitionResult result = UPlayFabAdminModelDecoder::decodeUpdatePlayerStatisticDefinitionResultResponse(response.responseData); + OnSuccessUpdatePlayerStatisticDefinition.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserData.IsBound()) + { + FAdminUpdateUserDataResult result = UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user which cannot be accessed by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserInternalData(FAdminUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserInternalData.IsBound()) + { + FAdminUpdateUserDataResult result = UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the publisher-specific custom data for the user which is readable and writable by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserPublisherData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherData.IsBound()) + { + FAdminUpdateUserDataResult result = UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the publisher-specific custom data for the user which cannot be accessed by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserPublisherInternalData(FAdminUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserPublisherInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserPublisherInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherInternalData.IsBound()) + { + FAdminUpdateUserDataResult result = UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the publisher-specific custom data for the user which can only be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserPublisherReadOnlyData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserPublisherReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserPublisherReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherReadOnlyData.IsBound()) + { + FAdminUpdateUserDataResult result = UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user which can only be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateUserReadOnlyData(FAdminUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateUserReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateUserReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserReadOnlyData.IsBound()) + { + FAdminUpdateUserDataResult result = UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// +/** Increments the specified virtual currency by the stated amount */ +UPlayFabAdminAPI* UPlayFabAdminAPI::AddUserVirtualCurrency(FAdminAddUserVirtualCurrencyRequest request, + FDelegateOnSuccessAddUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddUserVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperAddUserVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/AddUserVirtualCurrency"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperAddUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddUserVirtualCurrency.IsBound()) + { + FAdminModifyUserVirtualCurrencyResult result = UPlayFabAdminModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(response.responseData); + OnSuccessAddUserVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Checks the global count for the limited edition item. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::CheckLimitedEditionItemAvailability(FAdminCheckLimitedEditionItemAvailabilityRequest request, + FDelegateOnSuccessCheckLimitedEditionItemAvailability onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCheckLimitedEditionItemAvailability = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperCheckLimitedEditionItemAvailability); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/CheckLimitedEditionItemAvailability"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.ItemId.IsEmpty() || request.ItemId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemId"), request.ItemId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperCheckLimitedEditionItemAvailability(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCheckLimitedEditionItemAvailability.IsBound()) + { + FAdminCheckLimitedEditionItemAvailabilityResult result = UPlayFabAdminModelDecoder::decodeCheckLimitedEditionItemAvailabilityResultResponse(response.responseData); + OnSuccessCheckLimitedEditionItemAvailability.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the specified user's current inventory of virtual goods */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetUserInventory(FAdminGetUserInventoryRequest request, + FDelegateOnSuccessGetUserInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserInventory = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetUserInventory); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetUserInventory"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetUserInventory(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserInventory.IsBound()) + { + FAdminGetUserInventoryResult result = UPlayFabAdminModelDecoder::decodeGetUserInventoryResultResponse(response.responseData); + OnSuccessGetUserInventory.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds the specified items to the specified user inventories */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GrantItemsToUsers(FAdminGrantItemsToUsersRequest request, + FDelegateOnSuccessGrantItemsToUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGrantItemsToUsers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGrantItemsToUsers); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GrantItemsToUsers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.ItemGrants.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("ItemGrants")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("ItemGrants"), request.ItemGrants); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGrantItemsToUsers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGrantItemsToUsers.IsBound()) + { + FAdminGrantItemsToUsersResult result = UPlayFabAdminModelDecoder::decodeGrantItemsToUsersResultResponse(response.responseData); + OnSuccessGrantItemsToUsers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Increases the global count for the given scarce resource. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::IncrementLimitedEditionItemAvailability(FAdminIncrementLimitedEditionItemAvailabilityRequest request, + FDelegateOnSuccessIncrementLimitedEditionItemAvailability onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessIncrementLimitedEditionItemAvailability = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperIncrementLimitedEditionItemAvailability); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/IncrementLimitedEditionItemAvailability"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.ItemId.IsEmpty() || request.ItemId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemId"), request.ItemId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperIncrementLimitedEditionItemAvailability(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessIncrementLimitedEditionItemAvailability.IsBound()) + { + FAdminIncrementLimitedEditionItemAvailabilityResult result = UPlayFabAdminModelDecoder::decodeIncrementLimitedEditionItemAvailabilityResultResponse(response.responseData); + OnSuccessIncrementLimitedEditionItemAvailability.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revokes access to an item in a user's inventory */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RevokeInventoryItem(FAdminRevokeInventoryItemRequest request, + FDelegateOnSuccessRevokeInventoryItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeInventoryItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRevokeInventoryItem); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RevokeInventoryItem"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRevokeInventoryItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeInventoryItem.IsBound()) + { + FAdminRevokeInventoryResult result = UPlayFabAdminModelDecoder::decodeRevokeInventoryResultResponse(response.responseData); + OnSuccessRevokeInventoryItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revokes access for up to 25 items across multiple users and characters. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RevokeInventoryItems(FAdminRevokeInventoryItemsRequest request, + FDelegateOnSuccessRevokeInventoryItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeInventoryItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRevokeInventoryItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RevokeInventoryItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Items.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Items")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Items"), request.Items); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRevokeInventoryItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeInventoryItems.IsBound()) + { + FAdminRevokeInventoryItemsResult result = UPlayFabAdminModelDecoder::decodeRevokeInventoryItemsResultResponse(response.responseData); + OnSuccessRevokeInventoryItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Decrements the specified virtual currency by the stated amount */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SubtractUserVirtualCurrency(FAdminSubtractUserVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSubtractUserVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSubtractUserVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SubtractUserVirtualCurrency"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSubtractUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSubtractUserVirtualCurrency.IsBound()) + { + FAdminModifyUserVirtualCurrencyResult result = UPlayFabAdminModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(response.responseData); + OnSuccessSubtractUserVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// +/** Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::AddPlayerTag(FAdminAddPlayerTagRequest request, + FDelegateOnSuccessAddPlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddPlayerTag = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperAddPlayerTag); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/AddPlayerTag"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.TagName.IsEmpty() || request.TagName == "") { + OutRestJsonObj->SetFieldNull(TEXT("TagName")); + } else { + OutRestJsonObj->SetStringField(TEXT("TagName"), request.TagName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperAddPlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddPlayerTag.IsBound()) + { + FAdminAddPlayerTagResult result = UPlayFabAdminModelDecoder::decodeAddPlayerTagResultResponse(response.responseData); + OnSuccessAddPlayerTag.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetAllSegments(FAdminGetAllSegmentsRequest request, + FDelegateOnSuccessGetAllSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetAllSegments = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetAllSegments); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetAllSegments"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetAllSegments(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetAllSegments.IsBound()) + { + FAdminGetAllSegmentsResult result = UPlayFabAdminModelDecoder::decodeGetAllSegmentsResultResponse(response.responseData); + OnSuccessGetAllSegments.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** List all segments that a player currently belongs to at this moment in time. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerSegments(FAdminGetPlayersSegmentsRequest request, + FDelegateOnSuccessGetPlayerSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerSegments = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerSegments); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerSegments"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerSegments(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerSegments.IsBound()) + { + FAdminGetPlayerSegmentsResult result = UPlayFabAdminModelDecoder::decodeGetPlayerSegmentsResultResponse(response.responseData); + OnSuccessGetPlayerSegments.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayersInSegment(FAdminGetPlayersInSegmentRequest request, + FDelegateOnSuccessGetPlayersInSegment onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayersInSegment = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayersInSegment); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayersInSegment"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.ContinuationToken.IsEmpty() || request.ContinuationToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContinuationToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContinuationToken"), request.ContinuationToken); + } + OutRestJsonObj->SetNumberField(TEXT("MaxBatchSize"), request.MaxBatchSize); + OutRestJsonObj->SetNumberField(TEXT("SecondsToLive"), request.SecondsToLive); + if (request.SegmentId.IsEmpty() || request.SegmentId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SegmentId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SegmentId"), request.SegmentId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayersInSegment(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayersInSegment.IsBound()) + { + FAdminGetPlayersInSegmentResult result = UPlayFabAdminModelDecoder::decodeGetPlayersInSegmentResultResponse(response.responseData); + OnSuccessGetPlayersInSegment.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get all tags with a given Namespace (optional) from a player profile. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPlayerTags(FAdminGetPlayerTagsRequest request, + FDelegateOnSuccessGetPlayerTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerTags = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPlayerTags); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPlayerTags"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Namespace.IsEmpty() || request.Namespace == "") { + OutRestJsonObj->SetFieldNull(TEXT("Namespace")); + } else { + OutRestJsonObj->SetStringField(TEXT("Namespace"), request.Namespace); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPlayerTags(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerTags.IsBound()) + { + FAdminGetPlayerTagsResult result = UPlayFabAdminModelDecoder::decodeGetPlayerTagsResultResponse(response.responseData); + OnSuccessGetPlayerTags.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RemovePlayerTag(FAdminRemovePlayerTagRequest request, + FDelegateOnSuccessRemovePlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemovePlayerTag = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRemovePlayerTag); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RemovePlayerTag"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.TagName.IsEmpty() || request.TagName == "") { + OutRestJsonObj->SetFieldNull(TEXT("TagName")); + } else { + OutRestJsonObj->SetStringField(TEXT("TagName"), request.TagName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRemovePlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemovePlayerTag.IsBound()) + { + FAdminRemovePlayerTagResult result = UPlayFabAdminModelDecoder::decodeRemovePlayerTagResultResponse(response.responseData); + OnSuccessRemovePlayerTag.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// ScheduledTask +////////////////////////////////////////////////////// +/** Abort an ongoing task instance. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::AbortTaskInstance(FAdminAbortTaskInstanceRequest request, + FDelegateOnSuccessAbortTaskInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAbortTaskInstance = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperAbortTaskInstance); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/AbortTaskInstance"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.TaskInstanceId.IsEmpty() || request.TaskInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TaskInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TaskInstanceId"), request.TaskInstanceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperAbortTaskInstance(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAbortTaskInstance.IsBound()) + { + FAdminEmptyResponse result = UPlayFabAdminModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessAbortTaskInstance.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Create an ActionsOnPlayersInSegment task, which iterates through all players in a segment to execute action. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::CreateActionsOnPlayersInSegmentTask(FAdminCreateActionsOnPlayerSegmentTaskRequest request, + FDelegateOnSuccessCreateActionsOnPlayersInSegmentTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreateActionsOnPlayersInSegmentTask = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperCreateActionsOnPlayersInSegmentTask); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/CreateActionsOnPlayersInSegmentTask"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Description.IsEmpty() || request.Description == "") { + OutRestJsonObj->SetFieldNull(TEXT("Description")); + } else { + OutRestJsonObj->SetStringField(TEXT("Description"), request.Description); + } + OutRestJsonObj->SetBoolField(TEXT("IsActive"), request.IsActive); + if (request.Name.IsEmpty() || request.Name == "") { + OutRestJsonObj->SetFieldNull(TEXT("Name")); + } else { + OutRestJsonObj->SetStringField(TEXT("Name"), request.Name); + } + if (request.Parameter != nullptr) OutRestJsonObj->SetObjectField(TEXT("Parameter"), request.Parameter); + if (request.Schedule.IsEmpty() || request.Schedule == "") { + OutRestJsonObj->SetFieldNull(TEXT("Schedule")); + } else { + OutRestJsonObj->SetStringField(TEXT("Schedule"), request.Schedule); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperCreateActionsOnPlayersInSegmentTask(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreateActionsOnPlayersInSegmentTask.IsBound()) + { + FAdminCreateTaskResult result = UPlayFabAdminModelDecoder::decodeCreateTaskResultResponse(response.responseData); + OnSuccessCreateActionsOnPlayersInSegmentTask.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Create a CloudScript task, which can run a CloudScript on a schedule. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::CreateCloudScriptTask(FAdminCreateCloudScriptTaskRequest request, + FDelegateOnSuccessCreateCloudScriptTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreateCloudScriptTask = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperCreateCloudScriptTask); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/CreateCloudScriptTask"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Description.IsEmpty() || request.Description == "") { + OutRestJsonObj->SetFieldNull(TEXT("Description")); + } else { + OutRestJsonObj->SetStringField(TEXT("Description"), request.Description); + } + OutRestJsonObj->SetBoolField(TEXT("IsActive"), request.IsActive); + if (request.Name.IsEmpty() || request.Name == "") { + OutRestJsonObj->SetFieldNull(TEXT("Name")); + } else { + OutRestJsonObj->SetStringField(TEXT("Name"), request.Name); + } + if (request.Parameter != nullptr) OutRestJsonObj->SetObjectField(TEXT("Parameter"), request.Parameter); + if (request.Schedule.IsEmpty() || request.Schedule == "") { + OutRestJsonObj->SetFieldNull(TEXT("Schedule")); + } else { + OutRestJsonObj->SetStringField(TEXT("Schedule"), request.Schedule); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperCreateCloudScriptTask(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreateCloudScriptTask.IsBound()) + { + FAdminCreateTaskResult result = UPlayFabAdminModelDecoder::decodeCreateTaskResultResponse(response.responseData); + OnSuccessCreateCloudScriptTask.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Delete a task. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeleteTask(FAdminDeleteTaskRequest request, + FDelegateOnSuccessDeleteTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteTask = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeleteTask); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeleteTask"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Identifier != nullptr) OutRestJsonObj->SetObjectField(TEXT("Identifier"), request.Identifier); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeleteTask(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteTask.IsBound()) + { + FAdminEmptyResponse result = UPlayFabAdminModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessDeleteTask.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get information about a ActionsOnPlayersInSegment task instance. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetActionsOnPlayersInSegmentTaskInstance(FAdminGetTaskInstanceRequest request, + FDelegateOnSuccessGetActionsOnPlayersInSegmentTaskInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetActionsOnPlayersInSegmentTaskInstance = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetActionsOnPlayersInSegmentTaskInstance); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetActionsOnPlayersInSegmentTaskInstance"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.TaskInstanceId.IsEmpty() || request.TaskInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TaskInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TaskInstanceId"), request.TaskInstanceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetActionsOnPlayersInSegmentTaskInstance(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetActionsOnPlayersInSegmentTaskInstance.IsBound()) + { + FAdminGetActionsOnPlayersInSegmentTaskInstanceResult result = UPlayFabAdminModelDecoder::decodeGetActionsOnPlayersInSegmentTaskInstanceResultResponse(response.responseData); + OnSuccessGetActionsOnPlayersInSegmentTaskInstance.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get detail information about a CloudScript task instance. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetCloudScriptTaskInstance(FAdminGetTaskInstanceRequest request, + FDelegateOnSuccessGetCloudScriptTaskInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCloudScriptTaskInstance = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetCloudScriptTaskInstance); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetCloudScriptTaskInstance"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.TaskInstanceId.IsEmpty() || request.TaskInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TaskInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TaskInstanceId"), request.TaskInstanceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetCloudScriptTaskInstance(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCloudScriptTaskInstance.IsBound()) + { + FAdminGetCloudScriptTaskInstanceResult result = UPlayFabAdminModelDecoder::decodeGetCloudScriptTaskInstanceResultResponse(response.responseData); + OnSuccessGetCloudScriptTaskInstance.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Query for task instances by task, status, or time range. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetTaskInstances(FAdminGetTaskInstancesRequest request, + FDelegateOnSuccessGetTaskInstances onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTaskInstances = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetTaskInstances); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetTaskInstances"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.StartedAtRangeFrom.IsEmpty() || request.StartedAtRangeFrom == "") { + OutRestJsonObj->SetFieldNull(TEXT("StartedAtRangeFrom")); + } else { + OutRestJsonObj->SetStringField(TEXT("StartedAtRangeFrom"), request.StartedAtRangeFrom); + } + if (request.StartedAtRangeTo.IsEmpty() || request.StartedAtRangeTo == "") { + OutRestJsonObj->SetFieldNull(TEXT("StartedAtRangeTo")); + } else { + OutRestJsonObj->SetStringField(TEXT("StartedAtRangeTo"), request.StartedAtRangeTo); + } + FString temp_StatusFilter; + if (GetEnumValueToString(TEXT("ETaskInstanceStatus"), request.StatusFilter, temp_StatusFilter)) + OutRestJsonObj->SetStringField(TEXT("StatusFilter"), temp_StatusFilter); + if (request.TaskIdentifier != nullptr) OutRestJsonObj->SetObjectField(TEXT("TaskIdentifier"), request.TaskIdentifier); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetTaskInstances(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTaskInstances.IsBound()) + { + FAdminGetTaskInstancesResult result = UPlayFabAdminModelDecoder::decodeGetTaskInstancesResultResponse(response.responseData); + OnSuccessGetTaskInstances.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get definition information on a specified task or all tasks within a title. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetTasks(FAdminGetTasksRequest request, + FDelegateOnSuccessGetTasks onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTasks = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetTasks); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetTasks"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Identifier != nullptr) OutRestJsonObj->SetObjectField(TEXT("Identifier"), request.Identifier); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetTasks(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTasks.IsBound()) + { + FAdminGetTasksResult result = UPlayFabAdminModelDecoder::decodeGetTasksResultResponse(response.responseData); + OnSuccessGetTasks.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Run a task immediately regardless of its schedule. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RunTask(FAdminRunTaskRequest request, + FDelegateOnSuccessRunTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRunTask = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRunTask); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RunTask"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Identifier != nullptr) OutRestJsonObj->SetObjectField(TEXT("Identifier"), request.Identifier); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRunTask(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRunTask.IsBound()) + { + FAdminRunTaskResult result = UPlayFabAdminModelDecoder::decodeRunTaskResultResponse(response.responseData); + OnSuccessRunTask.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Update an existing task. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateTask(FAdminUpdateTaskRequest request, + FDelegateOnSuccessUpdateTask onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateTask = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateTask); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateTask"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Description.IsEmpty() || request.Description == "") { + OutRestJsonObj->SetFieldNull(TEXT("Description")); + } else { + OutRestJsonObj->SetStringField(TEXT("Description"), request.Description); + } + if (request.Identifier != nullptr) OutRestJsonObj->SetObjectField(TEXT("Identifier"), request.Identifier); + OutRestJsonObj->SetBoolField(TEXT("IsActive"), request.IsActive); + if (request.Name.IsEmpty() || request.Name == "") { + OutRestJsonObj->SetFieldNull(TEXT("Name")); + } else { + OutRestJsonObj->SetStringField(TEXT("Name"), request.Name); + } + if (request.Parameter != nullptr) OutRestJsonObj->SetObjectField(TEXT("Parameter"), request.Parameter); + if (request.Schedule.IsEmpty() || request.Schedule == "") { + OutRestJsonObj->SetFieldNull(TEXT("Schedule")); + } else { + OutRestJsonObj->SetStringField(TEXT("Schedule"), request.Schedule); + } + FString temp_Type; + if (GetEnumValueToString(TEXT("EScheduledTaskType"), request.Type, temp_Type)) + OutRestJsonObj->SetStringField(TEXT("Type"), temp_Type); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateTask(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateTask.IsBound()) + { + FAdminEmptyResponse result = UPlayFabAdminModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessUpdateTask.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// +/** Gets the contents and information of a specific Cloud Script revision. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetCloudScriptRevision(FAdminGetCloudScriptRevisionRequest request, + FDelegateOnSuccessGetCloudScriptRevision onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCloudScriptRevision = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetCloudScriptRevision); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetCloudScriptRevision"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Revision"), request.Revision); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetCloudScriptRevision(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCloudScriptRevision.IsBound()) + { + FAdminGetCloudScriptRevisionResult result = UPlayFabAdminModelDecoder::decodeGetCloudScriptRevisionResultResponse(response.responseData); + OnSuccessGetCloudScriptRevision.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all the current cloud script versions. For each version, information about the current published and latest revisions is also listed. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetCloudScriptVersions(FAdminGetCloudScriptVersionsRequest request, + FDelegateOnSuccessGetCloudScriptVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCloudScriptVersions = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetCloudScriptVersions); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetCloudScriptVersions"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetCloudScriptVersions(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCloudScriptVersions.IsBound()) + { + FAdminGetCloudScriptVersionsResult result = UPlayFabAdminModelDecoder::decodeGetCloudScriptVersionsResultResponse(response.responseData); + OnSuccessGetCloudScriptVersions.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the currently published revision of a title Cloud Script */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetPublishedRevision(FAdminSetPublishedRevisionRequest request, + FDelegateOnSuccessSetPublishedRevision onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetPublishedRevision = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetPublishedRevision); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetPublishedRevision"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Revision"), request.Revision); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetPublishedRevision(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetPublishedRevision.IsBound()) + { + FAdminSetPublishedRevisionResult result = UPlayFabAdminModelDecoder::decodeSetPublishedRevisionResultResponse(response.responseData); + OnSuccessSetPublishedRevision.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates a new Cloud Script revision and uploads source code to it. Note that at this time, only one file should be submitted in the revision. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateCloudScript(FAdminUpdateCloudScriptRequest request, + FDelegateOnSuccessUpdateCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCloudScript = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateCloudScript); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateCloudScript"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.DeveloperPlayFabId.IsEmpty() || request.DeveloperPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeveloperPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeveloperPlayFabId"), request.DeveloperPlayFabId); + } + if (request.Files.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Files")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Files"), request.Files); + } + OutRestJsonObj->SetBoolField(TEXT("Publish"), request.Publish); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCloudScript.IsBound()) + { + FAdminUpdateCloudScriptResult result = UPlayFabAdminModelDecoder::decodeUpdateCloudScriptResultResponse(response.responseData); + OnSuccessUpdateCloudScript.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// +/** Updates the key-value store of custom publisher settings */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetPublisherData(FAdminSetPublisherDataRequest request, + FDelegateOnSuccessSetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Value.IsEmpty() || request.Value == "") { + OutRestJsonObj->SetFieldNull(TEXT("Value")); + } else { + OutRestJsonObj->SetStringField(TEXT("Value"), request.Value); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetPublisherData.IsBound()) + { + FAdminSetPublisherDataResult result = UPlayFabAdminModelDecoder::decodeSetPublisherDataResultResponse(response.responseData); + OnSuccessSetPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// +/** Adds a new news item to the title's news feed */ +UPlayFabAdminAPI* UPlayFabAdminAPI::AddNews(FAdminAddNewsRequest request, + FDelegateOnSuccessAddNews onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddNews = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperAddNews); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/AddNews"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Body.IsEmpty() || request.Body == "") { + OutRestJsonObj->SetFieldNull(TEXT("Body")); + } else { + OutRestJsonObj->SetStringField(TEXT("Body"), request.Body); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + if (request.Title.IsEmpty() || request.Title == "") { + OutRestJsonObj->SetFieldNull(TEXT("Title")); + } else { + OutRestJsonObj->SetStringField(TEXT("Title"), request.Title); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperAddNews(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddNews.IsBound()) + { + FAdminAddNewsResult result = UPlayFabAdminModelDecoder::decodeAddNewsResultResponse(response.responseData); + OnSuccessAddNews.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds one or more virtual currencies to the set defined for the title. Virtual Currencies have a maximum value of 2,147,483,647 when granted to a player. Any value over that will be discarded. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::AddVirtualCurrencyTypes(FAdminAddVirtualCurrencyTypesRequest request, + FDelegateOnSuccessAddVirtualCurrencyTypes onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddVirtualCurrencyTypes = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperAddVirtualCurrencyTypes); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/AddVirtualCurrencyTypes"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.VirtualCurrencies.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrencies")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("VirtualCurrencies"), request.VirtualCurrencies); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperAddVirtualCurrencyTypes(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddVirtualCurrencyTypes.IsBound()) + { + FAdminBlankResult result = UPlayFabAdminModelDecoder::decodeBlankResultResponse(response.responseData); + OnSuccessAddVirtualCurrencyTypes.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Deletes an existing virtual item store */ +UPlayFabAdminAPI* UPlayFabAdminAPI::DeleteStore(FAdminDeleteStoreRequest request, + FDelegateOnSuccessDeleteStore onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteStore = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperDeleteStore); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/DeleteStore"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperDeleteStore(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteStore.IsBound()) + { + FAdminDeleteStoreResult result = UPlayFabAdminModelDecoder::decodeDeleteStoreResultResponse(response.responseData); + OnSuccessDeleteStore.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetCatalogItems(FAdminGetCatalogItemsRequest request, + FDelegateOnSuccessGetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCatalogItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetCatalogItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetCatalogItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCatalogItems.IsBound()) + { + FAdminGetCatalogItemsResult result = UPlayFabAdminModelDecoder::decodeGetCatalogItemsResultResponse(response.responseData); + OnSuccessGetCatalogItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom publisher settings */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetPublisherData(FAdminGetPublisherDataRequest request, + FDelegateOnSuccessGetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPublisherData.IsBound()) + { + FAdminGetPublisherDataResult result = UPlayFabAdminModelDecoder::decodeGetPublisherDataResultResponse(response.responseData); + OnSuccessGetPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the random drop table configuration for the title */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetRandomResultTables(FAdminGetRandomResultTablesRequest request, + FDelegateOnSuccessGetRandomResultTables onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetRandomResultTables = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetRandomResultTables); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetRandomResultTables"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetRandomResultTables(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetRandomResultTables.IsBound()) + { + FAdminGetRandomResultTablesResult result = UPlayFabAdminModelDecoder::decodeGetRandomResultTablesResultResponse(response.responseData); + OnSuccessGetRandomResultTables.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the set of items defined for the specified store, including all prices defined */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetStoreItems(FAdminGetStoreItemsRequest request, + FDelegateOnSuccessGetStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetStoreItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetStoreItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetStoreItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetStoreItems.IsBound()) + { + FAdminGetStoreItemsResult result = UPlayFabAdminModelDecoder::decodeGetStoreItemsResultResponse(response.responseData); + OnSuccessGetStoreItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom title settings which can be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetTitleData(FAdminGetTitleDataRequest request, + FDelegateOnSuccessGetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetTitleData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetTitleData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleData.IsBound()) + { + FAdminGetTitleDataResult result = UPlayFabAdminModelDecoder::decodeGetTitleDataResultResponse(response.responseData); + OnSuccessGetTitleData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom title settings which cannot be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::GetTitleInternalData(FAdminGetTitleDataRequest request, + FDelegateOnSuccessGetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperGetTitleInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/GetTitleInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperGetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleInternalData.IsBound()) + { + FAdminGetTitleDataResult result = UPlayFabAdminModelDecoder::decodeGetTitleDataResultResponse(response.responseData); + OnSuccessGetTitleInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retuns the list of all defined virtual currencies for the title */ +UPlayFabAdminAPI* UPlayFabAdminAPI::ListVirtualCurrencyTypes(FAdminListVirtualCurrencyTypesRequest request, + FDelegateOnSuccessListVirtualCurrencyTypes onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListVirtualCurrencyTypes = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperListVirtualCurrencyTypes); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/ListVirtualCurrencyTypes"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperListVirtualCurrencyTypes(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListVirtualCurrencyTypes.IsBound()) + { + FAdminListVirtualCurrencyTypesResult result = UPlayFabAdminModelDecoder::decodeListVirtualCurrencyTypesResultResponse(response.responseData); + OnSuccessListVirtualCurrencyTypes.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes one or more virtual currencies from the set defined for the title. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::RemoveVirtualCurrencyTypes(FAdminRemoveVirtualCurrencyTypesRequest request, + FDelegateOnSuccessRemoveVirtualCurrencyTypes onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveVirtualCurrencyTypes = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperRemoveVirtualCurrencyTypes); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/RemoveVirtualCurrencyTypes"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.VirtualCurrencies.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrencies")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("VirtualCurrencies"), request.VirtualCurrencies); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperRemoveVirtualCurrencyTypes(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveVirtualCurrencyTypes.IsBound()) + { + FAdminBlankResult result = UPlayFabAdminModelDecoder::decodeBlankResultResponse(response.responseData); + OnSuccessRemoveVirtualCurrencyTypes.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates the catalog configuration of all virtual goods for the specified catalog version */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetCatalogItems(FAdminUpdateCatalogItemsRequest request, + FDelegateOnSuccessSetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetCatalogItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetCatalogItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetCatalogItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Catalog.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Catalog")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Catalog"), request.Catalog); + } + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + OutRestJsonObj->SetBoolField(TEXT("SetAsDefaultCatalog"), request.SetAsDefaultCatalog); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetCatalogItems.IsBound()) + { + FAdminUpdateCatalogItemsResult result = UPlayFabAdminModelDecoder::decodeUpdateCatalogItemsResultResponse(response.responseData); + OnSuccessSetCatalogItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets all the items in one virtual store */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetStoreItems(FAdminUpdateStoreItemsRequest request, + FDelegateOnSuccessSetStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetStoreItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetStoreItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetStoreItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.MarketingData != nullptr) OutRestJsonObj->SetObjectField(TEXT("MarketingData"), request.MarketingData); + if (request.Store.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Store")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Store"), request.Store); + } + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetStoreItems.IsBound()) + { + FAdminUpdateStoreItemsResult result = UPlayFabAdminModelDecoder::decodeUpdateStoreItemsResultResponse(response.responseData); + OnSuccessSetStoreItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates and updates the key-value store of custom title settings which can be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetTitleData(FAdminSetTitleDataRequest request, + FDelegateOnSuccessSetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetTitleData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetTitleData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetTitleData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Value.IsEmpty() || request.Value == "") { + OutRestJsonObj->SetFieldNull(TEXT("Value")); + } else { + OutRestJsonObj->SetStringField(TEXT("Value"), request.Value); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetTitleData.IsBound()) + { + FAdminSetTitleDataResult result = UPlayFabAdminModelDecoder::decodeSetTitleDataResultResponse(response.responseData); + OnSuccessSetTitleData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the key-value store of custom title settings which cannot be read by the client */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetTitleInternalData(FAdminSetTitleDataRequest request, + FDelegateOnSuccessSetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetTitleInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetTitleInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetTitleInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Value.IsEmpty() || request.Value == "") { + OutRestJsonObj->SetFieldNull(TEXT("Value")); + } else { + OutRestJsonObj->SetStringField(TEXT("Value"), request.Value); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetTitleInternalData.IsBound()) + { + FAdminSetTitleDataResult result = UPlayFabAdminModelDecoder::decodeSetTitleDataResultResponse(response.responseData); + OnSuccessSetTitleInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the Amazon Resource Name (ARN) for iOS and Android push notifications. Documentation on the exact restrictions can be found at: http://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformApplication.html. Currently, Amazon device Messaging is not supported. */ +UPlayFabAdminAPI* UPlayFabAdminAPI::SetupPushNotification(FAdminSetupPushNotificationRequest request, + FDelegateOnSuccessSetupPushNotification onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetupPushNotification = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperSetupPushNotification); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/SetupPushNotification"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Credential.IsEmpty() || request.Credential == "") { + OutRestJsonObj->SetFieldNull(TEXT("Credential")); + } else { + OutRestJsonObj->SetStringField(TEXT("Credential"), request.Credential); + } + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Name.IsEmpty() || request.Name == "") { + OutRestJsonObj->SetFieldNull(TEXT("Name")); + } else { + OutRestJsonObj->SetStringField(TEXT("Name"), request.Name); + } + OutRestJsonObj->SetBoolField(TEXT("OverwriteOldARN"), request.OverwriteOldARN); + FString temp_Platform; + if (GetEnumValueToString(TEXT("EPushSetupPlatform"), request.Platform, temp_Platform)) + OutRestJsonObj->SetStringField(TEXT("Platform"), temp_Platform); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperSetupPushNotification(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetupPushNotification.IsBound()) + { + FAdminSetupPushNotificationResult result = UPlayFabAdminModelDecoder::decodeSetupPushNotificationResultResponse(response.responseData); + OnSuccessSetupPushNotification.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the catalog configuration for virtual goods in the specified catalog version */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateCatalogItems(FAdminUpdateCatalogItemsRequest request, + FDelegateOnSuccessUpdateCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCatalogItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateCatalogItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateCatalogItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Catalog.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Catalog")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Catalog"), request.Catalog); + } + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + OutRestJsonObj->SetBoolField(TEXT("SetAsDefaultCatalog"), request.SetAsDefaultCatalog); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCatalogItems.IsBound()) + { + FAdminUpdateCatalogItemsResult result = UPlayFabAdminModelDecoder::decodeUpdateCatalogItemsResultResponse(response.responseData); + OnSuccessUpdateCatalogItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the random drop table configuration for the title */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateRandomResultTables(FAdminUpdateRandomResultTablesRequest request, + FDelegateOnSuccessUpdateRandomResultTables onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateRandomResultTables = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateRandomResultTables); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateRandomResultTables"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.Tables.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Tables")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Tables"), request.Tables); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateRandomResultTables(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateRandomResultTables.IsBound()) + { + FAdminUpdateRandomResultTablesResult result = UPlayFabAdminModelDecoder::decodeUpdateRandomResultTablesResultResponse(response.responseData); + OnSuccessUpdateRandomResultTables.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates an existing virtual item store with new or modified items */ +UPlayFabAdminAPI* UPlayFabAdminAPI::UpdateStoreItems(FAdminUpdateStoreItemsRequest request, + FDelegateOnSuccessUpdateStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAdminAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateStoreItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAdminAPI::HelperUpdateStoreItems); + + // Setup the request + manager->PlayFabRequestURL = "/Admin/UpdateStoreItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.MarketingData != nullptr) OutRestJsonObj->SetObjectField(TEXT("MarketingData"), request.MarketingData); + if (request.Store.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Store")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Store"), request.Store); + } + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAdminRequestCompleted +void UPlayFabAdminAPI::HelperUpdateStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateStoreItems.IsBound()) + { + FAdminUpdateStoreItemsResult result = UPlayFabAdminModelDecoder::decodeUpdateStoreItemsResultResponse(response.responseData); + OnSuccessUpdateStoreItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabAdminAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabAdminAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabAdminAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAdminModelDecoder.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAdminModelDecoder.cpp new file mode 100644 index 000000000..78afd9e4b --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAdminModelDecoder.cpp @@ -0,0 +1,1048 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Admin +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabAdminModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Admin API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +FAdminBanUsersResult UPlayFabAdminModelDecoder::decodeBanUsersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminBanUsersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FAdminDeleteMasterPlayerAccountResult UPlayFabAdminModelDecoder::decodeDeleteMasterPlayerAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminDeleteMasterPlayerAccountResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.JobReceiptId = !(dataObj->HasField("JobReceiptId")) ? TEXT("") : dataObj->GetStringField("JobReceiptId"); + tempStruct.TitleIds = !(dataObj->HasField("TitleIds")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("TitleIds"), TEXT(",")); + + return tempStruct; +} + +FAdminDeletePlayerResult UPlayFabAdminModelDecoder::decodeDeletePlayerResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminDeletePlayerResult tempStruct; + + + return tempStruct; +} + +FAdminDeleteTitleResult UPlayFabAdminModelDecoder::decodeDeleteTitleResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminDeleteTitleResult tempStruct; + + + return tempStruct; +} + +FAdminExportMasterPlayerDataResult UPlayFabAdminModelDecoder::decodeExportMasterPlayerDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminExportMasterPlayerDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.JobReceiptId = !(dataObj->HasField("JobReceiptId")) ? TEXT("") : dataObj->GetStringField("JobReceiptId"); + + return tempStruct; +} + +FAdminGetPlayedTitleListResult UPlayFabAdminModelDecoder::decodeGetPlayedTitleListResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayedTitleListResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.TitleIds = !(dataObj->HasField("TitleIds")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("TitleIds"), TEXT(",")); + + return tempStruct; +} + +FAdminGetPlayerIdFromAuthTokenResult UPlayFabAdminModelDecoder::decodeGetPlayerIdFromAuthTokenResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerIdFromAuthTokenResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FAdminGetPlayerProfileResult UPlayFabAdminModelDecoder::decodeGetPlayerProfileResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerProfileResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayerProfile = !(dataObj->HasField("PlayerProfile")) ? nullptr : dataObj->GetObjectField("PlayerProfile"); + + return tempStruct; +} + +FAdminLookupUserAccountInfoResult UPlayFabAdminModelDecoder::decodeLookupUserAccountInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminLookupUserAccountInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.UserInfo = !(dataObj->HasField("UserInfo")) ? nullptr : dataObj->GetObjectField("UserInfo"); + + return tempStruct; +} + +FAdminGetUserBansResult UPlayFabAdminModelDecoder::decodeGetUserBansResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetUserBansResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FAdminResetPasswordResult UPlayFabAdminModelDecoder::decodeResetPasswordResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminResetPasswordResult tempStruct; + + + return tempStruct; +} + +FAdminRevokeAllBansForUserResult UPlayFabAdminModelDecoder::decodeRevokeAllBansForUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRevokeAllBansForUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FAdminRevokeBansResult UPlayFabAdminModelDecoder::decodeRevokeBansResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRevokeBansResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FAdminSendAccountRecoveryEmailResult UPlayFabAdminModelDecoder::decodeSendAccountRecoveryEmailResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminSendAccountRecoveryEmailResult tempStruct; + + + return tempStruct; +} + +FAdminUpdateBansResult UPlayFabAdminModelDecoder::decodeUpdateBansResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateBansResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FAdminUpdateUserTitleDisplayNameResult UPlayFabAdminModelDecoder::decodeUpdateUserTitleDisplayNameResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateUserTitleDisplayNameResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DisplayName = !(dataObj->HasField("DisplayName")) ? TEXT("") : dataObj->GetStringField("DisplayName"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +FAdminCreatePlayerSharedSecretResult UPlayFabAdminModelDecoder::decodeCreatePlayerSharedSecretResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminCreatePlayerSharedSecretResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.SecretKey = !(dataObj->HasField("SecretKey")) ? TEXT("") : dataObj->GetStringField("SecretKey"); + + return tempStruct; +} + +FAdminDeletePlayerSharedSecretResult UPlayFabAdminModelDecoder::decodeDeletePlayerSharedSecretResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminDeletePlayerSharedSecretResult tempStruct; + + + return tempStruct; +} + +FAdminGetPlayerSharedSecretsResult UPlayFabAdminModelDecoder::decodeGetPlayerSharedSecretsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerSharedSecretsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.SharedSecrets = !(dataObj->HasField("SharedSecrets")) ? TArray() : dataObj->GetObjectArrayField("SharedSecrets"); + + return tempStruct; +} + +FAdminGetPolicyResponse UPlayFabAdminModelDecoder::decodeGetPolicyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPolicyResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PolicyName = !(dataObj->HasField("PolicyName")) ? TEXT("") : dataObj->GetStringField("PolicyName"); + tempStruct.Statements = !(dataObj->HasField("Statements")) ? TArray() : dataObj->GetObjectArrayField("Statements"); + + return tempStruct; +} + +FAdminSetPlayerSecretResult UPlayFabAdminModelDecoder::decodeSetPlayerSecretResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminSetPlayerSecretResult tempStruct; + + + return tempStruct; +} + +FAdminUpdatePlayerSharedSecretResult UPlayFabAdminModelDecoder::decodeUpdatePlayerSharedSecretResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdatePlayerSharedSecretResult tempStruct; + + + return tempStruct; +} + +FAdminUpdatePolicyResponse UPlayFabAdminModelDecoder::decodeUpdatePolicyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdatePolicyResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PolicyName = !(dataObj->HasField("PolicyName")) ? TEXT("") : dataObj->GetStringField("PolicyName"); + tempStruct.Statements = !(dataObj->HasField("Statements")) ? TArray() : dataObj->GetObjectArrayField("Statements"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// + +FAdminResetCharacterStatisticsResult UPlayFabAdminModelDecoder::decodeResetCharacterStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminResetCharacterStatisticsResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// + +FAdminBlankResult UPlayFabAdminModelDecoder::decodeBlankResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminBlankResult tempStruct; + + + return tempStruct; +} + +FAdminGetContentListResult UPlayFabAdminModelDecoder::decodeGetContentListResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetContentListResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Contents = !(dataObj->HasField("Contents")) ? TArray() : dataObj->GetObjectArrayField("Contents"); + tempStruct.ItemCount = !(dataObj->HasField("ItemCount")) ? 0 : int(dataObj->GetNumberField("ItemCount")); + tempStruct.TotalSize = !(dataObj->HasField("TotalSize")) ? 0 : int(dataObj->GetNumberField("TotalSize")); + + return tempStruct; +} + +FAdminGetContentUploadUrlResult UPlayFabAdminModelDecoder::decodeGetContentUploadUrlResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetContentUploadUrlResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.URL = !(dataObj->HasField("URL")) ? TEXT("") : dataObj->GetStringField("URL"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Custom Server Management +////////////////////////////////////////////////////// + +FAdminAddServerBuildResult UPlayFabAdminModelDecoder::decodeAddServerBuildResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminAddServerBuildResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ActiveRegions = !(dataObj->HasField("ActiveRegions")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("ActiveRegions"), TEXT(",")); + tempStruct.BuildId = !(dataObj->HasField("BuildId")) ? TEXT("") : dataObj->GetStringField("BuildId"); + tempStruct.CommandLineTemplate = !(dataObj->HasField("CommandLineTemplate")) ? TEXT("") : dataObj->GetStringField("CommandLineTemplate"); + tempStruct.Comment = !(dataObj->HasField("Comment")) ? TEXT("") : dataObj->GetStringField("Comment"); + tempStruct.ExecutablePath = !(dataObj->HasField("ExecutablePath")) ? TEXT("") : dataObj->GetStringField("ExecutablePath"); + tempStruct.MaxGamesPerHost = !(dataObj->HasField("MaxGamesPerHost")) ? 0 : int(dataObj->GetNumberField("MaxGamesPerHost")); + tempStruct.MinFreeGameSlots = !(dataObj->HasField("MinFreeGameSlots")) ? 0 : int(dataObj->GetNumberField("MinFreeGameSlots")); + GetEnumValueFromString(TEXT("EGameBuildStatus"), dataObj->GetStringField("Status"), tempStruct.Status); + tempStruct.Timestamp = !(dataObj->HasField("Timestamp")) ? TEXT("") : dataObj->GetStringField("Timestamp"); + tempStruct.TitleId = !(dataObj->HasField("TitleId")) ? TEXT("") : dataObj->GetStringField("TitleId"); + + return tempStruct; +} + +FAdminGetServerBuildInfoResult UPlayFabAdminModelDecoder::decodeGetServerBuildInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetServerBuildInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ActiveRegions = !(dataObj->HasField("ActiveRegions")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("ActiveRegions"), TEXT(",")); + tempStruct.BuildId = !(dataObj->HasField("BuildId")) ? TEXT("") : dataObj->GetStringField("BuildId"); + tempStruct.Comment = !(dataObj->HasField("Comment")) ? TEXT("") : dataObj->GetStringField("Comment"); + tempStruct.ErrorMessage = !(dataObj->HasField("ErrorMessage")) ? TEXT("") : dataObj->GetStringField("ErrorMessage"); + tempStruct.MaxGamesPerHost = !(dataObj->HasField("MaxGamesPerHost")) ? 0 : int(dataObj->GetNumberField("MaxGamesPerHost")); + tempStruct.MinFreeGameSlots = !(dataObj->HasField("MinFreeGameSlots")) ? 0 : int(dataObj->GetNumberField("MinFreeGameSlots")); + GetEnumValueFromString(TEXT("EGameBuildStatus"), dataObj->GetStringField("Status"), tempStruct.Status); + tempStruct.Timestamp = !(dataObj->HasField("Timestamp")) ? TEXT("") : dataObj->GetStringField("Timestamp"); + tempStruct.TitleId = !(dataObj->HasField("TitleId")) ? TEXT("") : dataObj->GetStringField("TitleId"); + + return tempStruct; +} + +FAdminGetServerBuildUploadURLResult UPlayFabAdminModelDecoder::decodeGetServerBuildUploadURLResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetServerBuildUploadURLResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.URL = !(dataObj->HasField("URL")) ? TEXT("") : dataObj->GetStringField("URL"); + + return tempStruct; +} + +FAdminListBuildsResult UPlayFabAdminModelDecoder::decodeListBuildsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminListBuildsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Builds = !(dataObj->HasField("Builds")) ? TArray() : dataObj->GetObjectArrayField("Builds"); + + return tempStruct; +} + +FAdminModifyServerBuildResult UPlayFabAdminModelDecoder::decodeModifyServerBuildResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminModifyServerBuildResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ActiveRegions = !(dataObj->HasField("ActiveRegions")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("ActiveRegions"), TEXT(",")); + tempStruct.BuildId = !(dataObj->HasField("BuildId")) ? TEXT("") : dataObj->GetStringField("BuildId"); + tempStruct.CommandLineTemplate = !(dataObj->HasField("CommandLineTemplate")) ? TEXT("") : dataObj->GetStringField("CommandLineTemplate"); + tempStruct.Comment = !(dataObj->HasField("Comment")) ? TEXT("") : dataObj->GetStringField("Comment"); + tempStruct.ExecutablePath = !(dataObj->HasField("ExecutablePath")) ? TEXT("") : dataObj->GetStringField("ExecutablePath"); + tempStruct.MaxGamesPerHost = !(dataObj->HasField("MaxGamesPerHost")) ? 0 : int(dataObj->GetNumberField("MaxGamesPerHost")); + tempStruct.MinFreeGameSlots = !(dataObj->HasField("MinFreeGameSlots")) ? 0 : int(dataObj->GetNumberField("MinFreeGameSlots")); + GetEnumValueFromString(TEXT("EGameBuildStatus"), dataObj->GetStringField("Status"), tempStruct.Status); + tempStruct.Timestamp = !(dataObj->HasField("Timestamp")) ? TEXT("") : dataObj->GetStringField("Timestamp"); + tempStruct.TitleId = !(dataObj->HasField("TitleId")) ? TEXT("") : dataObj->GetStringField("TitleId"); + + return tempStruct; +} + +FAdminRemoveServerBuildResult UPlayFabAdminModelDecoder::decodeRemoveServerBuildResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRemoveServerBuildResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +FAdminGetMatchmakerGameInfoResult UPlayFabAdminModelDecoder::decodeGetMatchmakerGameInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetMatchmakerGameInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BuildVersion = !(dataObj->HasField("BuildVersion")) ? TEXT("") : dataObj->GetStringField("BuildVersion"); + tempStruct.EndTime = !(dataObj->HasField("EndTime")) ? TEXT("") : dataObj->GetStringField("EndTime"); + tempStruct.LobbyId = !(dataObj->HasField("LobbyId")) ? TEXT("") : dataObj->GetStringField("LobbyId"); + tempStruct.Mode = !(dataObj->HasField("Mode")) ? TEXT("") : dataObj->GetStringField("Mode"); + tempStruct.Players = !(dataObj->HasField("Players")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("Players"), TEXT(",")); + GetEnumValueFromString(TEXT("ERegion"), dataObj->GetStringField("Region"), tempStruct.Region); + tempStruct.ServerAddress = !(dataObj->HasField("ServerAddress")) ? TEXT("") : dataObj->GetStringField("ServerAddress"); + tempStruct.ServerIPV4Address = !(dataObj->HasField("ServerIPV4Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV4Address"); + tempStruct.ServerIPV6Address = !(dataObj->HasField("ServerIPV6Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV6Address"); + tempStruct.ServerPort = !(dataObj->HasField("ServerPort")) ? 0 : int(dataObj->GetNumberField("ServerPort")); + tempStruct.ServerPublicDNSName = !(dataObj->HasField("ServerPublicDNSName")) ? TEXT("") : dataObj->GetStringField("ServerPublicDNSName"); + tempStruct.StartTime = !(dataObj->HasField("StartTime")) ? TEXT("") : dataObj->GetStringField("StartTime"); + tempStruct.TitleId = !(dataObj->HasField("TitleId")) ? TEXT("") : dataObj->GetStringField("TitleId"); + + return tempStruct; +} + +FAdminGetMatchmakerGameModesResult UPlayFabAdminModelDecoder::decodeGetMatchmakerGameModesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetMatchmakerGameModesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GameModes = !(dataObj->HasField("GameModes")) ? TArray() : dataObj->GetObjectArrayField("GameModes"); + + return tempStruct; +} + +FAdminModifyMatchmakerGameModesResult UPlayFabAdminModelDecoder::decodeModifyMatchmakerGameModesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminModifyMatchmakerGameModesResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// + +FAdminCreatePlayerStatisticDefinitionResult UPlayFabAdminModelDecoder::decodeCreatePlayerStatisticDefinitionResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminCreatePlayerStatisticDefinitionResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Statistic = !(dataObj->HasField("Statistic")) ? nullptr : dataObj->GetObjectField("Statistic"); + + return tempStruct; +} + +FAdminGetDataReportResult UPlayFabAdminModelDecoder::decodeGetDataReportResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetDataReportResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DownloadUrl = !(dataObj->HasField("DownloadUrl")) ? TEXT("") : dataObj->GetStringField("DownloadUrl"); + + return tempStruct; +} + +FAdminGetPlayerStatisticDefinitionsResult UPlayFabAdminModelDecoder::decodeGetPlayerStatisticDefinitionsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerStatisticDefinitionsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Statistics = !(dataObj->HasField("Statistics")) ? TArray() : dataObj->GetObjectArrayField("Statistics"); + + return tempStruct; +} + +FAdminGetPlayerStatisticVersionsResult UPlayFabAdminModelDecoder::decodeGetPlayerStatisticVersionsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerStatisticVersionsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.StatisticVersions = !(dataObj->HasField("StatisticVersions")) ? TArray() : dataObj->GetObjectArrayField("StatisticVersions"); + + return tempStruct; +} + +FAdminGetUserDataResult UPlayFabAdminModelDecoder::decodeGetUserDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetUserDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FAdminIncrementPlayerStatisticVersionResult UPlayFabAdminModelDecoder::decodeIncrementPlayerStatisticVersionResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminIncrementPlayerStatisticVersionResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.StatisticVersion = !(dataObj->HasField("StatisticVersion")) ? nullptr : dataObj->GetObjectField("StatisticVersion"); + + return tempStruct; +} + +FAdminRefundPurchaseResponse UPlayFabAdminModelDecoder::decodeRefundPurchaseResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRefundPurchaseResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PurchaseStatus = !(dataObj->HasField("PurchaseStatus")) ? TEXT("") : dataObj->GetStringField("PurchaseStatus"); + + return tempStruct; +} + +FAdminResetUserStatisticsResult UPlayFabAdminModelDecoder::decodeResetUserStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminResetUserStatisticsResult tempStruct; + + + return tempStruct; +} + +FAdminResolvePurchaseDisputeResponse UPlayFabAdminModelDecoder::decodeResolvePurchaseDisputeResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminResolvePurchaseDisputeResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PurchaseStatus = !(dataObj->HasField("PurchaseStatus")) ? TEXT("") : dataObj->GetStringField("PurchaseStatus"); + + return tempStruct; +} + +FAdminUpdatePlayerStatisticDefinitionResult UPlayFabAdminModelDecoder::decodeUpdatePlayerStatisticDefinitionResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdatePlayerStatisticDefinitionResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Statistic = !(dataObj->HasField("Statistic")) ? nullptr : dataObj->GetObjectField("Statistic"); + + return tempStruct; +} + +FAdminUpdateUserDataResult UPlayFabAdminModelDecoder::decodeUpdateUserDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateUserDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// + +FAdminModifyUserVirtualCurrencyResult UPlayFabAdminModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminModifyUserVirtualCurrencyResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Balance = !(dataObj->HasField("Balance")) ? 0 : int(dataObj->GetNumberField("Balance")); + tempStruct.BalanceChange = !(dataObj->HasField("BalanceChange")) ? 0 : int(dataObj->GetNumberField("BalanceChange")); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? TEXT("") : dataObj->GetStringField("VirtualCurrency"); + + return tempStruct; +} + +FAdminCheckLimitedEditionItemAvailabilityResult UPlayFabAdminModelDecoder::decodeCheckLimitedEditionItemAvailabilityResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminCheckLimitedEditionItemAvailabilityResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Amount = !(dataObj->HasField("Amount")) ? 0 : int(dataObj->GetNumberField("Amount")); + + return tempStruct; +} + +FAdminGetUserInventoryResult UPlayFabAdminModelDecoder::decodeGetUserInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetUserInventoryResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Inventory = !(dataObj->HasField("Inventory")) ? TArray() : dataObj->GetObjectArrayField("Inventory"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + tempStruct.VirtualCurrencyRechargeTimes = !(dataObj->HasField("VirtualCurrencyRechargeTimes")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyRechargeTimes"); + + return tempStruct; +} + +FAdminGrantItemsToUsersResult UPlayFabAdminModelDecoder::decodeGrantItemsToUsersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGrantItemsToUsersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemGrantResults = !(dataObj->HasField("ItemGrantResults")) ? TArray() : dataObj->GetObjectArrayField("ItemGrantResults"); + + return tempStruct; +} + +FAdminIncrementLimitedEditionItemAvailabilityResult UPlayFabAdminModelDecoder::decodeIncrementLimitedEditionItemAvailabilityResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminIncrementLimitedEditionItemAvailabilityResult tempStruct; + + + return tempStruct; +} + +FAdminRevokeInventoryResult UPlayFabAdminModelDecoder::decodeRevokeInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRevokeInventoryResult tempStruct; + + + return tempStruct; +} + +FAdminRevokeInventoryItemsResult UPlayFabAdminModelDecoder::decodeRevokeInventoryItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRevokeInventoryItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Errors = !(dataObj->HasField("Errors")) ? TArray() : dataObj->GetObjectArrayField("Errors"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// + +FAdminAddPlayerTagResult UPlayFabAdminModelDecoder::decodeAddPlayerTagResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminAddPlayerTagResult tempStruct; + + + return tempStruct; +} + +FAdminGetAllSegmentsResult UPlayFabAdminModelDecoder::decodeGetAllSegmentsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetAllSegmentsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Segments = !(dataObj->HasField("Segments")) ? TArray() : dataObj->GetObjectArrayField("Segments"); + + return tempStruct; +} + +FAdminGetPlayerSegmentsResult UPlayFabAdminModelDecoder::decodeGetPlayerSegmentsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerSegmentsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Segments = !(dataObj->HasField("Segments")) ? TArray() : dataObj->GetObjectArrayField("Segments"); + + return tempStruct; +} + +FAdminGetPlayersInSegmentResult UPlayFabAdminModelDecoder::decodeGetPlayersInSegmentResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayersInSegmentResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ContinuationToken = !(dataObj->HasField("ContinuationToken")) ? TEXT("") : dataObj->GetStringField("ContinuationToken"); + tempStruct.PlayerProfiles = !(dataObj->HasField("PlayerProfiles")) ? TArray() : dataObj->GetObjectArrayField("PlayerProfiles"); + tempStruct.ProfilesInSegment = !(dataObj->HasField("ProfilesInSegment")) ? 0 : int(dataObj->GetNumberField("ProfilesInSegment")); + + return tempStruct; +} + +FAdminGetPlayerTagsResult UPlayFabAdminModelDecoder::decodeGetPlayerTagsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPlayerTagsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.Tags = !(dataObj->HasField("Tags")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("Tags"), TEXT(",")); + + return tempStruct; +} + +FAdminRemovePlayerTagResult UPlayFabAdminModelDecoder::decodeRemovePlayerTagResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRemovePlayerTagResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// ScheduledTask +////////////////////////////////////////////////////// + +FAdminEmptyResponse UPlayFabAdminModelDecoder::decodeEmptyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminEmptyResponse tempStruct; + + + return tempStruct; +} + +FAdminCreateTaskResult UPlayFabAdminModelDecoder::decodeCreateTaskResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminCreateTaskResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.TaskId = !(dataObj->HasField("TaskId")) ? TEXT("") : dataObj->GetStringField("TaskId"); + + return tempStruct; +} + +FAdminGetActionsOnPlayersInSegmentTaskInstanceResult UPlayFabAdminModelDecoder::decodeGetActionsOnPlayersInSegmentTaskInstanceResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetActionsOnPlayersInSegmentTaskInstanceResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Parameter = !(dataObj->HasField("Parameter")) ? nullptr : dataObj->GetObjectField("Parameter"); + tempStruct.Summary = !(dataObj->HasField("Summary")) ? nullptr : dataObj->GetObjectField("Summary"); + + return tempStruct; +} + +FAdminGetCloudScriptTaskInstanceResult UPlayFabAdminModelDecoder::decodeGetCloudScriptTaskInstanceResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetCloudScriptTaskInstanceResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Parameter = !(dataObj->HasField("Parameter")) ? nullptr : dataObj->GetObjectField("Parameter"); + tempStruct.Summary = !(dataObj->HasField("Summary")) ? nullptr : dataObj->GetObjectField("Summary"); + + return tempStruct; +} + +FAdminGetTaskInstancesResult UPlayFabAdminModelDecoder::decodeGetTaskInstancesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetTaskInstancesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Summaries = !(dataObj->HasField("Summaries")) ? TArray() : dataObj->GetObjectArrayField("Summaries"); + + return tempStruct; +} + +FAdminGetTasksResult UPlayFabAdminModelDecoder::decodeGetTasksResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetTasksResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Tasks = !(dataObj->HasField("Tasks")) ? TArray() : dataObj->GetObjectArrayField("Tasks"); + + return tempStruct; +} + +FAdminRunTaskResult UPlayFabAdminModelDecoder::decodeRunTaskResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminRunTaskResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.TaskInstanceId = !(dataObj->HasField("TaskInstanceId")) ? TEXT("") : dataObj->GetStringField("TaskInstanceId"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +FAdminGetCloudScriptRevisionResult UPlayFabAdminModelDecoder::decodeGetCloudScriptRevisionResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetCloudScriptRevisionResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CreatedAt = !(dataObj->HasField("CreatedAt")) ? TEXT("") : dataObj->GetStringField("CreatedAt"); + tempStruct.Files = !(dataObj->HasField("Files")) ? TArray() : dataObj->GetObjectArrayField("Files"); + tempStruct.IsPublished = !(dataObj->HasField("IsPublished")) ? false : dataObj->GetBoolField("IsPublished"); + tempStruct.Revision = !(dataObj->HasField("Revision")) ? 0 : int(dataObj->GetNumberField("Revision")); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + +FAdminGetCloudScriptVersionsResult UPlayFabAdminModelDecoder::decodeGetCloudScriptVersionsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetCloudScriptVersionsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Versions = !(dataObj->HasField("Versions")) ? TArray() : dataObj->GetObjectArrayField("Versions"); + + return tempStruct; +} + +FAdminSetPublishedRevisionResult UPlayFabAdminModelDecoder::decodeSetPublishedRevisionResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminSetPublishedRevisionResult tempStruct; + + + return tempStruct; +} + +FAdminUpdateCloudScriptResult UPlayFabAdminModelDecoder::decodeUpdateCloudScriptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateCloudScriptResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Revision = !(dataObj->HasField("Revision")) ? 0 : int(dataObj->GetNumberField("Revision")); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// + +FAdminSetPublisherDataResult UPlayFabAdminModelDecoder::decodeSetPublisherDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminSetPublisherDataResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// + +FAdminAddNewsResult UPlayFabAdminModelDecoder::decodeAddNewsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminAddNewsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.NewsId = !(dataObj->HasField("NewsId")) ? TEXT("") : dataObj->GetStringField("NewsId"); + + return tempStruct; +} + +FAdminDeleteStoreResult UPlayFabAdminModelDecoder::decodeDeleteStoreResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminDeleteStoreResult tempStruct; + + + return tempStruct; +} + +FAdminGetCatalogItemsResult UPlayFabAdminModelDecoder::decodeGetCatalogItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetCatalogItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Catalog = !(dataObj->HasField("Catalog")) ? TArray() : dataObj->GetObjectArrayField("Catalog"); + + return tempStruct; +} + +FAdminGetPublisherDataResult UPlayFabAdminModelDecoder::decodeGetPublisherDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetPublisherDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + + return tempStruct; +} + +FAdminGetRandomResultTablesResult UPlayFabAdminModelDecoder::decodeGetRandomResultTablesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetRandomResultTablesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Tables = !(dataObj->HasField("Tables")) ? nullptr : dataObj->GetObjectField("Tables"); + + return tempStruct; +} + +FAdminGetStoreItemsResult UPlayFabAdminModelDecoder::decodeGetStoreItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetStoreItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CatalogVersion = !(dataObj->HasField("CatalogVersion")) ? TEXT("") : dataObj->GetStringField("CatalogVersion"); + tempStruct.MarketingData = !(dataObj->HasField("MarketingData")) ? nullptr : dataObj->GetObjectField("MarketingData"); + GetEnumValueFromString(TEXT("EPfSourceType"), dataObj->GetStringField("Source"), tempStruct.Source); + tempStruct.Store = !(dataObj->HasField("Store")) ? TArray() : dataObj->GetObjectArrayField("Store"); + tempStruct.StoreId = !(dataObj->HasField("StoreId")) ? TEXT("") : dataObj->GetStringField("StoreId"); + + return tempStruct; +} + +FAdminGetTitleDataResult UPlayFabAdminModelDecoder::decodeGetTitleDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminGetTitleDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + + return tempStruct; +} + +FAdminListVirtualCurrencyTypesResult UPlayFabAdminModelDecoder::decodeListVirtualCurrencyTypesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminListVirtualCurrencyTypesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.VirtualCurrencies = !(dataObj->HasField("VirtualCurrencies")) ? TArray() : dataObj->GetObjectArrayField("VirtualCurrencies"); + + return tempStruct; +} + +FAdminUpdateCatalogItemsResult UPlayFabAdminModelDecoder::decodeUpdateCatalogItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateCatalogItemsResult tempStruct; + + + return tempStruct; +} + +FAdminUpdateStoreItemsResult UPlayFabAdminModelDecoder::decodeUpdateStoreItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateStoreItemsResult tempStruct; + + + return tempStruct; +} + +FAdminSetTitleDataResult UPlayFabAdminModelDecoder::decodeSetTitleDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminSetTitleDataResult tempStruct; + + + return tempStruct; +} + +FAdminSetupPushNotificationResult UPlayFabAdminModelDecoder::decodeSetupPushNotificationResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminSetupPushNotificationResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ARN = !(dataObj->HasField("ARN")) ? TEXT("") : dataObj->GetStringField("ARN"); + + return tempStruct; +} + +FAdminUpdateRandomResultTablesResult UPlayFabAdminModelDecoder::decodeUpdateRandomResultTablesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAdminUpdateRandomResultTablesResult tempStruct; + + + return tempStruct; +} + + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAdminModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAdminModels.cpp new file mode 100644 index 000000000..d54935ec1 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAdminModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Admin +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabAdminModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationAPI.cpp new file mode 100644 index 000000000..4b4ddf7e0 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationAPI.cpp @@ -0,0 +1,239 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Authentication +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabAuthenticationAPI.h" +#include "PlayFabAuthenticationModels.h" +#include "PlayFabAuthenticationModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabAuthenticationAPI::UPlayFabAuthenticationAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabAuthenticationAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabAuthenticationAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabAuthenticationAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Authentication API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// +/** Method to exchange a legacy AuthenticationTicket or title SecretKey for an Entity Token or to refresh a still valid Entity Token. */ +UPlayFabAuthenticationAPI* UPlayFabAuthenticationAPI::GetEntityToken(FAuthenticationGetEntityTokenRequest request, + FDelegateOnSuccessGetEntityToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabAuthenticationAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetEntityToken = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabAuthenticationAPI::HelperGetEntityToken); + + // Setup the request + manager->PlayFabRequestURL = "/Authentication/GetEntityToken"; + manager->useEntityToken = true; + manager->useSecretKey = true; + manager->useSessionTicket = true; + manager->returnsEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabAuthenticationRequestCompleted +void UPlayFabAuthenticationAPI::HelperGetEntityToken(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetEntityToken.IsBound()) + { + FAuthenticationGetEntityTokenResponse result = UPlayFabAuthenticationModelDecoder::decodeGetEntityTokenResponseResponse(response.responseData); + OnSuccessGetEntityToken.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabAuthenticationAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabAuthenticationAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabAuthenticationAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabAuthenticationAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationModelDecoder.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationModelDecoder.cpp new file mode 100644 index 000000000..ba7cbb466 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationModelDecoder.cpp @@ -0,0 +1,37 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Authentication +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabAuthenticationModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Authentication API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +FAuthenticationGetEntityTokenResponse UPlayFabAuthenticationModelDecoder::decodeGetEntityTokenResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FAuthenticationGetEntityTokenResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.EntityToken = !(dataObj->HasField("EntityToken")) ? TEXT("") : dataObj->GetStringField("EntityToken"); + tempStruct.TokenExpiration = !(dataObj->HasField("TokenExpiration")) ? TEXT("") : dataObj->GetStringField("TokenExpiration"); + + return tempStruct; +} + + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationModels.cpp new file mode 100644 index 000000000..1558efcc5 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Authentication +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabAuthenticationModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabBaseModel.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabBaseModel.cpp new file mode 100644 index 000000000..fe048f739 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabBaseModel.cpp @@ -0,0 +1,49 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// This files holds the code for the play fab base model. +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabBaseModel.h" +#include "PlayFabPrivate.h" + +const int ERROR_DETAILS_INIT_BUFFER_SIZE = 10000; + +void FPlayFabError::decodeError(UPlayFabJsonObject* responseData) +{ + // Check if we have an error + if (!responseData->HasField("code") || int(responseData->GetNumberField("code")) != 200) // We have an error + { + hasError = true; + ErrorCode = int(responseData->GetNumberField("errorCode")); + ErrorName = responseData->GetStringField("error"); + ErrorMessage = responseData->GetStringField("errorMessage"); + if (responseData->HasField("errorDetails")) + { + ErrorDetails.Empty(ERROR_DETAILS_INIT_BUFFER_SIZE); + auto detailsObj = responseData->GetObjectField("errorDetails"); + int count = 0; + for (auto detailParamPair = detailsObj->GetRootObject()->Values.CreateConstIterator(); detailParamPair; ++detailParamPair) + { + auto errorArray = detailParamPair->Value->AsArray(); + for (auto paramMsg = errorArray.CreateConstIterator(); paramMsg; ++paramMsg) + { + if (count != 0) + ErrorDetails += "\n"; + ErrorDetails += detailParamPair->Key; + ErrorDetails += ": "; + ErrorDetails += paramMsg->Get()->AsString(); + count++; + } + } + } + else + { + ErrorDetails.Empty(0); + } + } + else { hasError = false; } +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabClientAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabClientAPI.cpp new file mode 100644 index 000000000..d4d42c62a --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabClientAPI.cpp @@ -0,0 +1,8443 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Client +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabClientAPI.h" +#include "PlayFabClientModels.h" +#include "PlayFabClientModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabClientAPI::UPlayFabClientAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabClientAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabClientAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabClientAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Client API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// +/** Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as authentication credentials, as the intent is that it is easily accessible by other players. */ +UPlayFabClientAPI* UPlayFabClientAPI::AddGenericID(FClientAddGenericIDRequest request, + FDelegateOnSuccessAddGenericID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddGenericID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAddGenericID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AddGenericID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.GenericId != nullptr) OutRestJsonObj->SetObjectField(TEXT("GenericId"), request.GenericId); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAddGenericID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddGenericID.IsBound()) + { + FClientAddGenericIDResult result = UPlayFabClientModelDecoder::decodeAddGenericIDResultResponse(response.responseData); + OnSuccessAddGenericID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds or updates a contact email to the player's profile. */ +UPlayFabClientAPI* UPlayFabClientAPI::AddOrUpdateContactEmail(FClientAddOrUpdateContactEmailRequest request, + FDelegateOnSuccessAddOrUpdateContactEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddOrUpdateContactEmail = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAddOrUpdateContactEmail); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AddOrUpdateContactEmail"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.EmailAddress.IsEmpty() || request.EmailAddress == "") { + OutRestJsonObj->SetFieldNull(TEXT("EmailAddress")); + } else { + OutRestJsonObj->SetStringField(TEXT("EmailAddress"), request.EmailAddress); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAddOrUpdateContactEmail(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddOrUpdateContactEmail.IsBound()) + { + FClientAddOrUpdateContactEmailResult result = UPlayFabClientModelDecoder::decodeAddOrUpdateContactEmailResultResponse(response.responseData); + OnSuccessAddOrUpdateContactEmail.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds playfab username/password auth to an existing account created via an anonymous auth method, e.g. automatic device ID login. */ +UPlayFabClientAPI* UPlayFabClientAPI::AddUsernamePassword(FClientAddUsernamePasswordRequest request, + FDelegateOnSuccessAddUsernamePassword onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddUsernamePassword = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAddUsernamePassword); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AddUsernamePassword"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.Password.IsEmpty() || request.Password == "") { + OutRestJsonObj->SetFieldNull(TEXT("Password")); + } else { + OutRestJsonObj->SetStringField(TEXT("Password"), request.Password); + } + if (request.Username.IsEmpty() || request.Username == "") { + OutRestJsonObj->SetFieldNull(TEXT("Username")); + } else { + OutRestJsonObj->SetStringField(TEXT("Username"), request.Username); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAddUsernamePassword(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddUsernamePassword.IsBound()) + { + FClientAddUsernamePasswordResult result = UPlayFabClientModelDecoder::decodeAddUsernamePasswordResultResponse(response.responseData); + OnSuccessAddUsernamePassword.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the user's PlayFab account details */ +UPlayFabClientAPI* UPlayFabClientAPI::GetAccountInfo(FClientGetAccountInfoRequest request, + FDelegateOnSuccessGetAccountInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetAccountInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetAccountInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetAccountInfo"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.TitleDisplayName.IsEmpty() || request.TitleDisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("TitleDisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("TitleDisplayName"), request.TitleDisplayName); + } + if (request.Username.IsEmpty() || request.Username == "") { + OutRestJsonObj->SetFieldNull(TEXT("Username")); + } else { + OutRestJsonObj->SetStringField(TEXT("Username"), request.Username); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetAccountInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetAccountInfo.IsBound()) + { + FClientGetAccountInfoResult result = UPlayFabClientModelDecoder::decodeGetAccountInfoResultResponse(response.responseData); + OnSuccessGetAccountInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves all of the user's different kinds of info. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerCombinedInfo(FClientGetPlayerCombinedInfoRequest request, + FDelegateOnSuccessGetPlayerCombinedInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerCombinedInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerCombinedInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerCombinedInfo"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerCombinedInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerCombinedInfo.IsBound()) + { + FClientGetPlayerCombinedInfoResult result = UPlayFabClientModelDecoder::decodeGetPlayerCombinedInfoResultResponse(response.responseData); + OnSuccessGetPlayerCombinedInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the player's profile */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerProfile(FClientGetPlayerProfileRequest request, + FDelegateOnSuccessGetPlayerProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerProfile = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerProfile); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerProfile"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerProfile(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerProfile.IsBound()) + { + FClientGetPlayerProfileResult result = UPlayFabClientModelDecoder::decodeGetPlayerProfileResultResponse(response.responseData); + OnSuccessGetPlayerProfile.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromFacebookIDs(FClientGetPlayFabIDsFromFacebookIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromFacebookIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromFacebookIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromFacebookIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.FacebookIDs.IsEmpty() || request.FacebookIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookIDs")); + } else { + TArray FacebookIDsArray; + FString(request.FacebookIDs).ParseIntoArray(FacebookIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FacebookIDs"), FacebookIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromFacebookIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromFacebookIDs.IsBound()) + { + FClientGetPlayFabIDsFromFacebookIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromFacebookIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromFacebookIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Facebook Instant Game identifiers. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromFacebookInstantGamesIds(FClientGetPlayFabIDsFromFacebookInstantGamesIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromFacebookInstantGamesIds); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromFacebookInstantGamesIds"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.FacebookInstantGamesIds.IsEmpty() || request.FacebookInstantGamesIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookInstantGamesIds")); + } else { + TArray FacebookInstantGamesIdsArray; + FString(request.FacebookInstantGamesIds).ParseIntoArray(FacebookInstantGamesIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FacebookInstantGamesIds"), FacebookInstantGamesIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromFacebookInstantGamesIds(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds.IsBound()) + { + FClientGetPlayFabIDsFromFacebookInstantGamesIdsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromFacebookInstantGamesIdsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Game Center identifiers (referenced in the Game Center Programming Guide as the Player Identifier). */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromGameCenterIDs(FClientGetPlayFabIDsFromGameCenterIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromGameCenterIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromGameCenterIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromGameCenterIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromGameCenterIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.GameCenterIDs.IsEmpty() || request.GameCenterIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameCenterIDs")); + } else { + TArray GameCenterIDsArray; + FString(request.GameCenterIDs).ParseIntoArray(GameCenterIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("GameCenterIDs"), GameCenterIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromGameCenterIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromGameCenterIDs.IsBound()) + { + FClientGetPlayFabIDsFromGameCenterIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromGameCenterIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromGameCenterIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the service name plus the service-specific ID for the player, as specified by the title when the generic identifier was added to the player account. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromGenericIDs(FClientGetPlayFabIDsFromGenericIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromGenericIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromGenericIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromGenericIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromGenericIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.GenericIDs.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("GenericIDs")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("GenericIDs"), request.GenericIDs); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromGenericIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromGenericIDs.IsBound()) + { + FClientGetPlayFabIDsFromGenericIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromGenericIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromGenericIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Google identifiers. The Google identifiers are the IDs for the user accounts, available as "id" in the Google+ People API calls. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromGoogleIDs(FClientGetPlayFabIDsFromGoogleIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromGoogleIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromGoogleIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromGoogleIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromGoogleIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.GoogleIDs.IsEmpty() || request.GoogleIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("GoogleIDs")); + } else { + TArray GoogleIDsArray; + FString(request.GoogleIDs).ParseIntoArray(GoogleIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("GoogleIDs"), GoogleIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromGoogleIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromGoogleIDs.IsBound()) + { + FClientGetPlayFabIDsFromGoogleIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromGoogleIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromGoogleIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Kongregate identifiers. The Kongregate identifiers are the IDs for the user accounts, available as "user_id" from the Kongregate API methods(ex: http://developers.kongregate.com/docs/client/getUserId). */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromKongregateIDs(FClientGetPlayFabIDsFromKongregateIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromKongregateIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromKongregateIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromKongregateIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromKongregateIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.KongregateIDs.IsEmpty() || request.KongregateIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("KongregateIDs")); + } else { + TArray KongregateIDsArray; + FString(request.KongregateIDs).ParseIntoArray(KongregateIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KongregateIDs"), KongregateIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromKongregateIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromKongregateIDs.IsBound()) + { + FClientGetPlayFabIDsFromKongregateIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromKongregateIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromKongregateIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Nintendo Switch identifiers. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromNintendoSwitchDeviceIds(FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromNintendoSwitchDeviceIds); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromNintendoSwitchDeviceIds"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.NintendoSwitchDeviceIds.IsEmpty() || request.NintendoSwitchDeviceIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("NintendoSwitchDeviceIds")); + } else { + TArray NintendoSwitchDeviceIdsArray; + FString(request.NintendoSwitchDeviceIds).ParseIntoArray(NintendoSwitchDeviceIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("NintendoSwitchDeviceIds"), NintendoSwitchDeviceIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromNintendoSwitchDeviceIds(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds.IsBound()) + { + FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromNintendoSwitchDeviceIdsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromSteamIDs(FClientGetPlayFabIDsFromSteamIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromSteamIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromSteamIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromSteamIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromSteamIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.SteamStringIDs.IsEmpty() || request.SteamStringIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("SteamStringIDs")); + } else { + TArray SteamStringIDsArray; + FString(request.SteamStringIDs).ParseIntoArray(SteamStringIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("SteamStringIDs"), SteamStringIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromSteamIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromSteamIDs.IsBound()) + { + FClientGetPlayFabIDsFromSteamIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromSteamIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromSteamIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Twitch identifiers. The Twitch identifiers are the IDs for the user accounts, available as "_id" from the Twitch API methods (ex: https://github.com/justintv/Twitch-API/blob/master/v3_resources/users.md#get-usersuser). */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayFabIDsFromTwitchIDs(FClientGetPlayFabIDsFromTwitchIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromTwitchIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromTwitchIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayFabIDsFromTwitchIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayFabIDsFromTwitchIDs"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.TwitchIds.IsEmpty() || request.TwitchIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("TwitchIds")); + } else { + TArray TwitchIdsArray; + FString(request.TwitchIds).ParseIntoArray(TwitchIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("TwitchIds"), TwitchIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayFabIDsFromTwitchIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromTwitchIDs.IsBound()) + { + FClientGetPlayFabIDsFromTwitchIDsResult result = UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromTwitchIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromTwitchIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Android device identifier to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkAndroidDeviceID(FClientLinkAndroidDeviceIDRequest request, + FDelegateOnSuccessLinkAndroidDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkAndroidDeviceID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkAndroidDeviceID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkAndroidDeviceID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.AndroidDevice.IsEmpty() || request.AndroidDevice == "") { + OutRestJsonObj->SetFieldNull(TEXT("AndroidDevice")); + } else { + OutRestJsonObj->SetStringField(TEXT("AndroidDevice"), request.AndroidDevice); + } + if (request.AndroidDeviceId.IsEmpty() || request.AndroidDeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("AndroidDeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("AndroidDeviceId"), request.AndroidDeviceId); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.OS.IsEmpty() || request.OS == "") { + OutRestJsonObj->SetFieldNull(TEXT("OS")); + } else { + OutRestJsonObj->SetStringField(TEXT("OS"), request.OS); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkAndroidDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkAndroidDeviceID.IsBound()) + { + FClientLinkAndroidDeviceIDResult result = UPlayFabClientModelDecoder::decodeLinkAndroidDeviceIDResultResponse(response.responseData); + OnSuccessLinkAndroidDeviceID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the custom identifier, generated by the title, to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkCustomID(FClientLinkCustomIDRequest request, + FDelegateOnSuccessLinkCustomID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkCustomID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkCustomID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkCustomID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CustomId.IsEmpty() || request.CustomId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CustomId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CustomId"), request.CustomId); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkCustomID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkCustomID.IsBound()) + { + FClientLinkCustomIDResult result = UPlayFabClientModelDecoder::decodeLinkCustomIDResultResponse(response.responseData); + OnSuccessLinkCustomID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Facebook account associated with the provided Facebook access token to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkFacebookAccount(FClientLinkFacebookAccountRequest request, + FDelegateOnSuccessLinkFacebookAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkFacebookAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkFacebookAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkFacebookAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.AccessToken.IsEmpty() || request.AccessToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("AccessToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("AccessToken"), request.AccessToken); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkFacebookAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkFacebookAccount.IsBound()) + { + FClientLinkFacebookAccountResult result = UPlayFabClientModelDecoder::decodeLinkFacebookAccountResultResponse(response.responseData); + OnSuccessLinkFacebookAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Facebook Instant Games Id to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkFacebookInstantGamesId(FClientLinkFacebookInstantGamesIdRequest request, + FDelegateOnSuccessLinkFacebookInstantGamesId onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkFacebookInstantGamesId = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkFacebookInstantGamesId); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkFacebookInstantGamesId"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.FacebookInstantGamesSignature.IsEmpty() || request.FacebookInstantGamesSignature == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookInstantGamesSignature")); + } else { + OutRestJsonObj->SetStringField(TEXT("FacebookInstantGamesSignature"), request.FacebookInstantGamesSignature); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkFacebookInstantGamesId(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkFacebookInstantGamesId.IsBound()) + { + FClientLinkFacebookInstantGamesIdResult result = UPlayFabClientModelDecoder::decodeLinkFacebookInstantGamesIdResultResponse(response.responseData); + OnSuccessLinkFacebookInstantGamesId.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Game Center account associated with the provided Game Center ID to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkGameCenterAccount(FClientLinkGameCenterAccountRequest request, + FDelegateOnSuccessLinkGameCenterAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkGameCenterAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkGameCenterAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkGameCenterAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.GameCenterId.IsEmpty() || request.GameCenterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameCenterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameCenterId"), request.GameCenterId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkGameCenterAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkGameCenterAccount.IsBound()) + { + FClientLinkGameCenterAccountResult result = UPlayFabClientModelDecoder::decodeLinkGameCenterAccountResultResponse(response.responseData); + OnSuccessLinkGameCenterAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the currently signed-in user account to their Google account, using their Google account credentials */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkGoogleAccount(FClientLinkGoogleAccountRequest request, + FDelegateOnSuccessLinkGoogleAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkGoogleAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkGoogleAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkGoogleAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.ServerAuthCode.IsEmpty() || request.ServerAuthCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerAuthCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerAuthCode"), request.ServerAuthCode); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkGoogleAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkGoogleAccount.IsBound()) + { + FClientLinkGoogleAccountResult result = UPlayFabClientModelDecoder::decodeLinkGoogleAccountResultResponse(response.responseData); + OnSuccessLinkGoogleAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the vendor-specific iOS device identifier to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkIOSDeviceID(FClientLinkIOSDeviceIDRequest request, + FDelegateOnSuccessLinkIOSDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkIOSDeviceID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkIOSDeviceID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkIOSDeviceID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.DeviceId.IsEmpty() || request.DeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceId"), request.DeviceId); + } + if (request.DeviceModel.IsEmpty() || request.DeviceModel == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceModel")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceModel"), request.DeviceModel); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.OS.IsEmpty() || request.OS == "") { + OutRestJsonObj->SetFieldNull(TEXT("OS")); + } else { + OutRestJsonObj->SetStringField(TEXT("OS"), request.OS); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkIOSDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkIOSDeviceID.IsBound()) + { + FClientLinkIOSDeviceIDResult result = UPlayFabClientModelDecoder::decodeLinkIOSDeviceIDResultResponse(response.responseData); + OnSuccessLinkIOSDeviceID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Kongregate identifier to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkKongregate(FClientLinkKongregateAccountRequest request, + FDelegateOnSuccessLinkKongregate onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkKongregate = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkKongregate); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkKongregate"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.AuthTicket.IsEmpty() || request.AuthTicket == "") { + OutRestJsonObj->SetFieldNull(TEXT("AuthTicket")); + } else { + OutRestJsonObj->SetStringField(TEXT("AuthTicket"), request.AuthTicket); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.KongregateId.IsEmpty() || request.KongregateId == "") { + OutRestJsonObj->SetFieldNull(TEXT("KongregateId")); + } else { + OutRestJsonObj->SetStringField(TEXT("KongregateId"), request.KongregateId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkKongregate(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkKongregate.IsBound()) + { + FClientLinkKongregateAccountResult result = UPlayFabClientModelDecoder::decodeLinkKongregateAccountResultResponse(response.responseData); + OnSuccessLinkKongregate.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the NintendoSwitchDeviceId to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkNintendoSwitchDeviceId(FClientLinkNintendoSwitchDeviceIdRequest request, + FDelegateOnSuccessLinkNintendoSwitchDeviceId onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkNintendoSwitchDeviceId = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkNintendoSwitchDeviceId); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkNintendoSwitchDeviceId"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.NintendoSwitchDeviceId.IsEmpty() || request.NintendoSwitchDeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("NintendoSwitchDeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("NintendoSwitchDeviceId"), request.NintendoSwitchDeviceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkNintendoSwitchDeviceId(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkNintendoSwitchDeviceId.IsBound()) + { + FClientLinkNintendoSwitchDeviceIdResult result = UPlayFabClientModelDecoder::decodeLinkNintendoSwitchDeviceIdResultResponse(response.responseData); + OnSuccessLinkNintendoSwitchDeviceId.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Steam account associated with the provided Steam authentication ticket to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkSteamAccount(FClientLinkSteamAccountRequest request, + FDelegateOnSuccessLinkSteamAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkSteamAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkSteamAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkSteamAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.SteamTicket.IsEmpty() || request.SteamTicket == "") { + OutRestJsonObj->SetFieldNull(TEXT("SteamTicket")); + } else { + OutRestJsonObj->SetStringField(TEXT("SteamTicket"), request.SteamTicket); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkSteamAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkSteamAccount.IsBound()) + { + FClientLinkSteamAccountResult result = UPlayFabClientModelDecoder::decodeLinkSteamAccountResultResponse(response.responseData); + OnSuccessLinkSteamAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Twitch account associated with the token to the user's PlayFab account. */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkTwitch(FClientLinkTwitchAccountRequest request, + FDelegateOnSuccessLinkTwitch onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkTwitch = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkTwitch); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkTwitch"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.AccessToken.IsEmpty() || request.AccessToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("AccessToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("AccessToken"), request.AccessToken); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkTwitch(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkTwitch.IsBound()) + { + FClientLinkTwitchAccountResult result = UPlayFabClientModelDecoder::decodeLinkTwitchAccountResultResponse(response.responseData); + OnSuccessLinkTwitch.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Link Windows Hello authentication to the current PlayFab Account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkWindowsHello(FClientLinkWindowsHelloAccountRequest request, + FDelegateOnSuccessLinkWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkWindowsHello = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkWindowsHello); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkWindowsHello"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.DeviceName.IsEmpty() || request.DeviceName == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceName")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceName"), request.DeviceName); + } + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.PublicKey.IsEmpty() || request.PublicKey == "") { + OutRestJsonObj->SetFieldNull(TEXT("PublicKey")); + } else { + OutRestJsonObj->SetStringField(TEXT("PublicKey"), request.PublicKey); + } + if (request.UserName.IsEmpty() || request.UserName == "") { + OutRestJsonObj->SetFieldNull(TEXT("UserName")); + } else { + OutRestJsonObj->SetStringField(TEXT("UserName"), request.UserName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkWindowsHello.IsBound()) + { + FClientLinkWindowsHelloAccountResponse result = UPlayFabClientModelDecoder::decodeLinkWindowsHelloAccountResponseResponse(response.responseData); + OnSuccessLinkWindowsHello.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Links the Xbox Live account associated with the provided access code to the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::LinkXboxAccount(FClientLinkXboxAccountRequest request, + FDelegateOnSuccessLinkXboxAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLinkXboxAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLinkXboxAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LinkXboxAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("ForceLink"), request.ForceLink); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLinkXboxAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLinkXboxAccount.IsBound()) + { + FClientLinkXboxAccountResult result = UPlayFabClientModelDecoder::decodeLinkXboxAccountResultResponse(response.responseData); + OnSuccessLinkXboxAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes a contact email from the player's profile. */ +UPlayFabClientAPI* UPlayFabClientAPI::RemoveContactEmail(FClientRemoveContactEmailRequest request, + FDelegateOnSuccessRemoveContactEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveContactEmail = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRemoveContactEmail); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RemoveContactEmail"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRemoveContactEmail(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveContactEmail.IsBound()) + { + FClientRemoveContactEmailResult result = UPlayFabClientModelDecoder::decodeRemoveContactEmailResultResponse(response.responseData); + OnSuccessRemoveContactEmail.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes the specified generic service identifier from the player's PlayFab account. */ +UPlayFabClientAPI* UPlayFabClientAPI::RemoveGenericID(FClientRemoveGenericIDRequest request, + FDelegateOnSuccessRemoveGenericID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveGenericID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRemoveGenericID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RemoveGenericID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.GenericId != nullptr) OutRestJsonObj->SetObjectField(TEXT("GenericId"), request.GenericId); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRemoveGenericID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveGenericID.IsBound()) + { + FClientRemoveGenericIDResult result = UPlayFabClientModelDecoder::decodeRemoveGenericIDResultResponse(response.responseData); + OnSuccessRemoveGenericID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title can take action concerning potentially toxic players. */ +UPlayFabClientAPI* UPlayFabClientAPI::ReportPlayer(FClientReportPlayerClientRequest request, + FDelegateOnSuccessReportPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessReportPlayer = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperReportPlayer); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ReportPlayer"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Comment.IsEmpty() || request.Comment == "") { + OutRestJsonObj->SetFieldNull(TEXT("Comment")); + } else { + OutRestJsonObj->SetStringField(TEXT("Comment"), request.Comment); + } + if (request.ReporteeId.IsEmpty() || request.ReporteeId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReporteeId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReporteeId"), request.ReporteeId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperReportPlayer(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessReportPlayer.IsBound()) + { + FClientReportPlayerClientResult result = UPlayFabClientModelDecoder::decodeReportPlayerClientResultResponse(response.responseData); + OnSuccessReportPlayer.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to change the password.If an account recovery email template ID is provided, an email using the custom email template will be used. */ +UPlayFabClientAPI* UPlayFabClientAPI::SendAccountRecoveryEmail(FClientSendAccountRecoveryEmailRequest request, + FDelegateOnSuccessSendAccountRecoveryEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSendAccountRecoveryEmail = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperSendAccountRecoveryEmail); + + // Setup the request + manager->PlayFabRequestURL = "/Client/SendAccountRecoveryEmail"; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.EmailTemplateId.IsEmpty() || request.EmailTemplateId == "") { + OutRestJsonObj->SetFieldNull(TEXT("EmailTemplateId")); + } else { + OutRestJsonObj->SetStringField(TEXT("EmailTemplateId"), request.EmailTemplateId); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperSendAccountRecoveryEmail(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSendAccountRecoveryEmail.IsBound()) + { + FClientSendAccountRecoveryEmailResult result = UPlayFabClientModelDecoder::decodeSendAccountRecoveryEmailResultResponse(response.responseData); + OnSuccessSendAccountRecoveryEmail.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Android device identifier from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkAndroidDeviceID(FClientUnlinkAndroidDeviceIDRequest request, + FDelegateOnSuccessUnlinkAndroidDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkAndroidDeviceID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkAndroidDeviceID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkAndroidDeviceID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.AndroidDeviceId.IsEmpty() || request.AndroidDeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("AndroidDeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("AndroidDeviceId"), request.AndroidDeviceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkAndroidDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkAndroidDeviceID.IsBound()) + { + FClientUnlinkAndroidDeviceIDResult result = UPlayFabClientModelDecoder::decodeUnlinkAndroidDeviceIDResultResponse(response.responseData); + OnSuccessUnlinkAndroidDeviceID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related custom identifier from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkCustomID(FClientUnlinkCustomIDRequest request, + FDelegateOnSuccessUnlinkCustomID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkCustomID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkCustomID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkCustomID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CustomId.IsEmpty() || request.CustomId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CustomId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CustomId"), request.CustomId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkCustomID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkCustomID.IsBound()) + { + FClientUnlinkCustomIDResult result = UPlayFabClientModelDecoder::decodeUnlinkCustomIDResultResponse(response.responseData); + OnSuccessUnlinkCustomID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Facebook account from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkFacebookAccount(FClientUnlinkFacebookAccountRequest request, + FDelegateOnSuccessUnlinkFacebookAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkFacebookAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkFacebookAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkFacebookAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkFacebookAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkFacebookAccount.IsBound()) + { + FClientUnlinkFacebookAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkFacebookAccountResultResponse(response.responseData); + OnSuccessUnlinkFacebookAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Facebook Instant Game Ids from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkFacebookInstantGamesId(FClientUnlinkFacebookInstantGamesIdRequest request, + FDelegateOnSuccessUnlinkFacebookInstantGamesId onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkFacebookInstantGamesId = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkFacebookInstantGamesId); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkFacebookInstantGamesId"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.FacebookInstantGamesId.IsEmpty() || request.FacebookInstantGamesId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookInstantGamesId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FacebookInstantGamesId"), request.FacebookInstantGamesId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkFacebookInstantGamesId(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkFacebookInstantGamesId.IsBound()) + { + FClientUnlinkFacebookInstantGamesIdResult result = UPlayFabClientModelDecoder::decodeUnlinkFacebookInstantGamesIdResultResponse(response.responseData); + OnSuccessUnlinkFacebookInstantGamesId.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Game Center account from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkGameCenterAccount(FClientUnlinkGameCenterAccountRequest request, + FDelegateOnSuccessUnlinkGameCenterAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkGameCenterAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkGameCenterAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkGameCenterAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkGameCenterAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkGameCenterAccount.IsBound()) + { + FClientUnlinkGameCenterAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkGameCenterAccountResultResponse(response.responseData); + OnSuccessUnlinkGameCenterAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Google account from the user's PlayFab account (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods). */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkGoogleAccount(FClientUnlinkGoogleAccountRequest request, + FDelegateOnSuccessUnlinkGoogleAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkGoogleAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkGoogleAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkGoogleAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkGoogleAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkGoogleAccount.IsBound()) + { + FClientUnlinkGoogleAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkGoogleAccountResultResponse(response.responseData); + OnSuccessUnlinkGoogleAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related iOS device identifier from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkIOSDeviceID(FClientUnlinkIOSDeviceIDRequest request, + FDelegateOnSuccessUnlinkIOSDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkIOSDeviceID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkIOSDeviceID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkIOSDeviceID"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.DeviceId.IsEmpty() || request.DeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceId"), request.DeviceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkIOSDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkIOSDeviceID.IsBound()) + { + FClientUnlinkIOSDeviceIDResult result = UPlayFabClientModelDecoder::decodeUnlinkIOSDeviceIDResultResponse(response.responseData); + OnSuccessUnlinkIOSDeviceID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Kongregate identifier from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkKongregate(FClientUnlinkKongregateAccountRequest request, + FDelegateOnSuccessUnlinkKongregate onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkKongregate = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkKongregate); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkKongregate"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkKongregate(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkKongregate.IsBound()) + { + FClientUnlinkKongregateAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkKongregateAccountResultResponse(response.responseData); + OnSuccessUnlinkKongregate.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related NintendoSwitchDeviceId from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkNintendoSwitchDeviceId(FClientUnlinkNintendoSwitchDeviceIdRequest request, + FDelegateOnSuccessUnlinkNintendoSwitchDeviceId onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkNintendoSwitchDeviceId = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkNintendoSwitchDeviceId); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkNintendoSwitchDeviceId"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.NintendoSwitchDeviceId.IsEmpty() || request.NintendoSwitchDeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("NintendoSwitchDeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("NintendoSwitchDeviceId"), request.NintendoSwitchDeviceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkNintendoSwitchDeviceId(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkNintendoSwitchDeviceId.IsBound()) + { + FClientUnlinkNintendoSwitchDeviceIdResult result = UPlayFabClientModelDecoder::decodeUnlinkNintendoSwitchDeviceIdResultResponse(response.responseData); + OnSuccessUnlinkNintendoSwitchDeviceId.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Steam account from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkSteamAccount(FClientUnlinkSteamAccountRequest request, + FDelegateOnSuccessUnlinkSteamAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkSteamAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkSteamAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkSteamAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkSteamAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkSteamAccount.IsBound()) + { + FClientUnlinkSteamAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkSteamAccountResultResponse(response.responseData); + OnSuccessUnlinkSteamAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Twitch account from the user's PlayFab account. */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkTwitch(FClientUnlinkTwitchAccountRequest request, + FDelegateOnSuccessUnlinkTwitch onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkTwitch = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkTwitch); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkTwitch"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkTwitch(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkTwitch.IsBound()) + { + FClientUnlinkTwitchAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkTwitchAccountResultResponse(response.responseData); + OnSuccessUnlinkTwitch.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlink Windows Hello authentication from the current PlayFab Account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkWindowsHello(FClientUnlinkWindowsHelloAccountRequest request, + FDelegateOnSuccessUnlinkWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkWindowsHello = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkWindowsHello); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkWindowsHello"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.PublicKeyHint.IsEmpty() || request.PublicKeyHint == "") { + OutRestJsonObj->SetFieldNull(TEXT("PublicKeyHint")); + } else { + OutRestJsonObj->SetStringField(TEXT("PublicKeyHint"), request.PublicKeyHint); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkWindowsHello.IsBound()) + { + FClientUnlinkWindowsHelloAccountResponse result = UPlayFabClientModelDecoder::decodeUnlinkWindowsHelloAccountResponseResponse(response.responseData); + OnSuccessUnlinkWindowsHello.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unlinks the related Xbox Live account from the user's PlayFab account */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlinkXboxAccount(FClientUnlinkXboxAccountRequest request, + FDelegateOnSuccessUnlinkXboxAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlinkXboxAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlinkXboxAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlinkXboxAccount"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlinkXboxAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlinkXboxAccount.IsBound()) + { + FClientUnlinkXboxAccountResult result = UPlayFabClientModelDecoder::decodeUnlinkXboxAccountResultResponse(response.responseData); + OnSuccessUnlinkXboxAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Update the avatar URL of the player */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateAvatarUrl(FClientUpdateAvatarUrlRequest request, + FDelegateOnSuccessUpdateAvatarUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateAvatarUrl = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateAvatarUrl); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateAvatarUrl"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.ImageUrl.IsEmpty() || request.ImageUrl == "") { + OutRestJsonObj->SetFieldNull(TEXT("ImageUrl")); + } else { + OutRestJsonObj->SetStringField(TEXT("ImageUrl"), request.ImageUrl); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateAvatarUrl(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateAvatarUrl.IsBound()) + { + FClientEmptyResponse result = UPlayFabClientModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessUpdateAvatarUrl.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title specific display name for the user */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateUserTitleDisplayName(FClientUpdateUserTitleDisplayNameRequest request, + FDelegateOnSuccessUpdateUserTitleDisplayName onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserTitleDisplayName = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateUserTitleDisplayName); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateUserTitleDisplayName"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.DisplayName.IsEmpty() || request.DisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("DisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("DisplayName"), request.DisplayName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateUserTitleDisplayName(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserTitleDisplayName.IsBound()) + { + FClientUpdateUserTitleDisplayNameResult result = UPlayFabClientModelDecoder::decodeUpdateUserTitleDisplayNameResultResponse(response.responseData); + OnSuccessUpdateUserTitleDisplayName.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Advertising +////////////////////////////////////////////////////// +/** Attributes an install for advertisment. */ +UPlayFabClientAPI* UPlayFabClientAPI::AttributeInstall(FClientAttributeInstallRequest request, + FDelegateOnSuccessAttributeInstall onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAttributeInstall = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAttributeInstall); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AttributeInstall"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Adid.IsEmpty() || request.Adid == "") { + OutRestJsonObj->SetFieldNull(TEXT("Adid")); + } else { + OutRestJsonObj->SetStringField(TEXT("Adid"), request.Adid); + } + if (request.Idfa.IsEmpty() || request.Idfa == "") { + OutRestJsonObj->SetFieldNull(TEXT("Idfa")); + } else { + OutRestJsonObj->SetStringField(TEXT("Idfa"), request.Idfa); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAttributeInstall(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAttributeInstall.IsBound()) + { + FClientAttributeInstallResult result = UPlayFabClientModelDecoder::decodeAttributeInstallResultResponse(response.responseData); + OnSuccessAttributeInstall.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Analytics +////////////////////////////////////////////////////// +/** Write a PlayStream event to describe the provided player device information. This API method is not designed to be called directly by developers. Each PlayFab client SDK will eventually report this information automatically. */ +UPlayFabClientAPI* UPlayFabClientAPI::ReportDeviceInfo(FClientDeviceInfoRequest request, + FDelegateOnSuccessReportDeviceInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessReportDeviceInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperReportDeviceInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ReportDeviceInfo"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Info != nullptr) OutRestJsonObj->SetObjectField(TEXT("Info"), request.Info); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperReportDeviceInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessReportDeviceInfo.IsBound()) + { + FClientEmptyResponse result = UPlayFabClientModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessReportDeviceInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Writes a character-based event into PlayStream. */ +UPlayFabClientAPI* UPlayFabClientAPI::WriteCharacterEvent(FClientWriteClientCharacterEventRequest request, + FDelegateOnSuccessWriteCharacterEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWriteCharacterEvent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperWriteCharacterEvent); + + // Setup the request + manager->PlayFabRequestURL = "/Client/WriteCharacterEvent"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Body != nullptr) OutRestJsonObj->SetObjectField(TEXT("Body"), request.Body); + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.EventName.IsEmpty() || request.EventName == "") { + OutRestJsonObj->SetFieldNull(TEXT("EventName")); + } else { + OutRestJsonObj->SetStringField(TEXT("EventName"), request.EventName); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperWriteCharacterEvent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWriteCharacterEvent.IsBound()) + { + FClientWriteEventResponse result = UPlayFabClientModelDecoder::decodeWriteEventResponseResponse(response.responseData); + OnSuccessWriteCharacterEvent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Writes a player-based event into PlayStream. */ +UPlayFabClientAPI* UPlayFabClientAPI::WritePlayerEvent(FClientWriteClientPlayerEventRequest request, + FDelegateOnSuccessWritePlayerEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWritePlayerEvent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperWritePlayerEvent); + + // Setup the request + manager->PlayFabRequestURL = "/Client/WritePlayerEvent"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Body != nullptr) OutRestJsonObj->SetObjectField(TEXT("Body"), request.Body); + if (request.EventName.IsEmpty() || request.EventName == "") { + OutRestJsonObj->SetFieldNull(TEXT("EventName")); + } else { + OutRestJsonObj->SetStringField(TEXT("EventName"), request.EventName); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperWritePlayerEvent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWritePlayerEvent.IsBound()) + { + FClientWriteEventResponse result = UPlayFabClientModelDecoder::decodeWriteEventResponseResponse(response.responseData); + OnSuccessWritePlayerEvent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Writes a title-based event into PlayStream. */ +UPlayFabClientAPI* UPlayFabClientAPI::WriteTitleEvent(FClientWriteTitleEventRequest request, + FDelegateOnSuccessWriteTitleEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWriteTitleEvent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperWriteTitleEvent); + + // Setup the request + manager->PlayFabRequestURL = "/Client/WriteTitleEvent"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Body != nullptr) OutRestJsonObj->SetObjectField(TEXT("Body"), request.Body); + if (request.EventName.IsEmpty() || request.EventName == "") { + OutRestJsonObj->SetFieldNull(TEXT("EventName")); + } else { + OutRestJsonObj->SetStringField(TEXT("EventName"), request.EventName); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperWriteTitleEvent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWriteTitleEvent.IsBound()) + { + FClientWriteEventResponse result = UPlayFabClientModelDecoder::decodeWriteEventResponseResponse(response.responseData); + OnSuccessWriteTitleEvent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// +/** Gets a Photon custom authentication token that can be used to securely join the player into a Photon room. See https://api.playfab.com/docs/using-photon-with-playfab/ for more details. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPhotonAuthenticationToken(FClientGetPhotonAuthenticationTokenRequest request, + FDelegateOnSuccessGetPhotonAuthenticationToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPhotonAuthenticationToken = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPhotonAuthenticationToken); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPhotonAuthenticationToken"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.PhotonApplicationId.IsEmpty() || request.PhotonApplicationId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PhotonApplicationId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PhotonApplicationId"), request.PhotonApplicationId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPhotonAuthenticationToken(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPhotonAuthenticationToken.IsBound()) + { + FClientGetPhotonAuthenticationTokenResult result = UPlayFabClientModelDecoder::decodeGetPhotonAuthenticationTokenResultResponse(response.responseData); + OnSuccessGetPhotonAuthenticationToken.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Returns the title's base 64 encoded RSA CSP blob. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetTitlePublicKey(FClientGetTitlePublicKeyRequest request, + FDelegateOnSuccessGetTitlePublicKey onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitlePublicKey = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetTitlePublicKey); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetTitlePublicKey"; + + // Serialize all the request properties to json + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + if (request.TitleSharedSecret.IsEmpty() || request.TitleSharedSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("TitleSharedSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("TitleSharedSecret"), request.TitleSharedSecret); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetTitlePublicKey(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitlePublicKey.IsBound()) + { + FClientGetTitlePublicKeyResult result = UPlayFabClientModelDecoder::decodeGetTitlePublicKeyResultResponse(response.responseData); + OnSuccessGetTitlePublicKey.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Requests a challenge from the server to be signed by Windows Hello Passport service to authenticate. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetWindowsHelloChallenge(FClientGetWindowsHelloChallengeRequest request, + FDelegateOnSuccessGetWindowsHelloChallenge onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetWindowsHelloChallenge = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetWindowsHelloChallenge); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetWindowsHelloChallenge"; + + // Serialize all the request properties to json + if (request.PublicKeyHint.IsEmpty() || request.PublicKeyHint == "") { + OutRestJsonObj->SetFieldNull(TEXT("PublicKeyHint")); + } else { + OutRestJsonObj->SetStringField(TEXT("PublicKeyHint"), request.PublicKeyHint); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetWindowsHelloChallenge(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetWindowsHelloChallenge.IsBound()) + { + FClientGetWindowsHelloChallengeResponse result = UPlayFabClientModelDecoder::decodeGetWindowsHelloChallengeResponseResponse(response.responseData); + OnSuccessGetWindowsHelloChallenge.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using the Android device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithAndroidDeviceID(FClientLoginWithAndroidDeviceIDRequest request, + FDelegateOnSuccessLoginWithAndroidDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithAndroidDeviceID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithAndroidDeviceID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithAndroidDeviceID"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.AndroidDevice.IsEmpty() || request.AndroidDevice == "") { + OutRestJsonObj->SetFieldNull(TEXT("AndroidDevice")); + } else { + OutRestJsonObj->SetStringField(TEXT("AndroidDevice"), request.AndroidDevice); + } + if (request.AndroidDeviceId.IsEmpty() || request.AndroidDeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("AndroidDeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("AndroidDeviceId"), request.AndroidDeviceId); + } + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.OS.IsEmpty() || request.OS == "") { + OutRestJsonObj->SetFieldNull(TEXT("OS")); + } else { + OutRestJsonObj->SetStringField(TEXT("OS"), request.OS); + } + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithAndroidDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithAndroidDeviceID.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithAndroidDeviceID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a custom unique identifier generated by the title, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithCustomID(FClientLoginWithCustomIDRequest request, + FDelegateOnSuccessLoginWithCustomID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithCustomID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithCustomID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithCustomID"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.CustomId.IsEmpty() || request.CustomId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CustomId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CustomId"), request.CustomId); + } + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithCustomID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithCustomID.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithCustomID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. Unlike most other login API calls, LoginWithEmailAddress does not permit the creation of new accounts via the CreateAccountFlag. Email addresses may be used to create accounts via RegisterPlayFabUser. */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithEmailAddress(FClientLoginWithEmailAddressRequest request, + FDelegateOnSuccessLoginWithEmailAddress onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithEmailAddress = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithEmailAddress); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithEmailAddress"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.Password.IsEmpty() || request.Password == "") { + OutRestJsonObj->SetFieldNull(TEXT("Password")); + } else { + OutRestJsonObj->SetStringField(TEXT("Password"), request.Password); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithEmailAddress(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithEmailAddress.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithEmailAddress.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Facebook access token, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithFacebook(FClientLoginWithFacebookRequest request, + FDelegateOnSuccessLoginWithFacebook onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithFacebook = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithFacebook); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithFacebook"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.AccessToken.IsEmpty() || request.AccessToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("AccessToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("AccessToken"), request.AccessToken); + } + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithFacebook(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithFacebook.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithFacebook.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Facebook Instant Games ID, returning a session identifier that can subsequently be used for API calls which require an authenticated user. Requires Facebook Instant Games to be configured. */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithFacebookInstantGamesId(FClientLoginWithFacebookInstantGamesIdRequest request, + FDelegateOnSuccessLoginWithFacebookInstantGamesId onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithFacebookInstantGamesId = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithFacebookInstantGamesId); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithFacebookInstantGamesId"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.FacebookInstantGamesSignature.IsEmpty() || request.FacebookInstantGamesSignature == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookInstantGamesSignature")); + } else { + OutRestJsonObj->SetStringField(TEXT("FacebookInstantGamesSignature"), request.FacebookInstantGamesSignature); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithFacebookInstantGamesId(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithFacebookInstantGamesId.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithFacebookInstantGamesId.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using an iOS Game Center player identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithGameCenter(FClientLoginWithGameCenterRequest request, + FDelegateOnSuccessLoginWithGameCenter onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithGameCenter = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithGameCenter); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithGameCenter"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerId.IsEmpty() || request.PlayerId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerId"), request.PlayerId); + } + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithGameCenter(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithGameCenter.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithGameCenter.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using their Google account credentials */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithGoogleAccount(FClientLoginWithGoogleAccountRequest request, + FDelegateOnSuccessLoginWithGoogleAccount onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithGoogleAccount = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithGoogleAccount); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithGoogleAccount"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + if (request.ServerAuthCode.IsEmpty() || request.ServerAuthCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerAuthCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerAuthCode"), request.ServerAuthCode); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithGoogleAccount(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithGoogleAccount.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithGoogleAccount.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using the vendor-specific iOS device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithIOSDeviceID(FClientLoginWithIOSDeviceIDRequest request, + FDelegateOnSuccessLoginWithIOSDeviceID onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithIOSDeviceID = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithIOSDeviceID); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithIOSDeviceID"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.DeviceId.IsEmpty() || request.DeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceId"), request.DeviceId); + } + if (request.DeviceModel.IsEmpty() || request.DeviceModel == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceModel")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceModel"), request.DeviceModel); + } + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.OS.IsEmpty() || request.OS == "") { + OutRestJsonObj->SetFieldNull(TEXT("OS")); + } else { + OutRestJsonObj->SetStringField(TEXT("OS"), request.OS); + } + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithIOSDeviceID(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithIOSDeviceID.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithIOSDeviceID.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Kongregate player account. */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithKongregate(FClientLoginWithKongregateRequest request, + FDelegateOnSuccessLoginWithKongregate onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithKongregate = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithKongregate); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithKongregate"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.AuthTicket.IsEmpty() || request.AuthTicket == "") { + OutRestJsonObj->SetFieldNull(TEXT("AuthTicket")); + } else { + OutRestJsonObj->SetStringField(TEXT("AuthTicket"), request.AuthTicket); + } + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + if (request.KongregateId.IsEmpty() || request.KongregateId == "") { + OutRestJsonObj->SetFieldNull(TEXT("KongregateId")); + } else { + OutRestJsonObj->SetStringField(TEXT("KongregateId"), request.KongregateId); + } + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithKongregate(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithKongregate.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithKongregate.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Nintendo Switch Device ID, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithNintendoSwitchDeviceId(FClientLoginWithNintendoSwitchDeviceIdRequest request, + FDelegateOnSuccessLoginWithNintendoSwitchDeviceId onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithNintendoSwitchDeviceId = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithNintendoSwitchDeviceId); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithNintendoSwitchDeviceId"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.NintendoSwitchDeviceId.IsEmpty() || request.NintendoSwitchDeviceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("NintendoSwitchDeviceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("NintendoSwitchDeviceId"), request.NintendoSwitchDeviceId); + } + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithNintendoSwitchDeviceId(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithNintendoSwitchDeviceId.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithNintendoSwitchDeviceId.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. Unlike most other login API calls, LoginWithPlayFab does not permit the creation of new accounts via the CreateAccountFlag. Username/Password credentials may be used to create accounts via RegisterPlayFabUser, or added to existing accounts using AddUsernamePassword. */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithPlayFab(FClientLoginWithPlayFabRequest request, + FDelegateOnSuccessLoginWithPlayFab onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithPlayFab = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithPlayFab); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithPlayFab"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.Password.IsEmpty() || request.Password == "") { + OutRestJsonObj->SetFieldNull(TEXT("Password")); + } else { + OutRestJsonObj->SetStringField(TEXT("Password"), request.Password); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + if (request.Username.IsEmpty() || request.Username == "") { + OutRestJsonObj->SetFieldNull(TEXT("Username")); + } else { + OutRestJsonObj->SetStringField(TEXT("Username"), request.Username); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithPlayFab(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithPlayFab.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithPlayFab.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Steam authentication ticket, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithSteam(FClientLoginWithSteamRequest request, + FDelegateOnSuccessLoginWithSteam onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithSteam = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithSteam); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithSteam"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + if (request.SteamTicket.IsEmpty() || request.SteamTicket == "") { + OutRestJsonObj->SetFieldNull(TEXT("SteamTicket")); + } else { + OutRestJsonObj->SetStringField(TEXT("SteamTicket"), request.SteamTicket); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithSteam(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithSteam.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithSteam.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Twitch access token. */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithTwitch(FClientLoginWithTwitchRequest request, + FDelegateOnSuccessLoginWithTwitch onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithTwitch = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithTwitch); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithTwitch"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.AccessToken.IsEmpty() || request.AccessToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("AccessToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("AccessToken"), request.AccessToken); + } + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithTwitch(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithTwitch.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithTwitch.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Completes the Windows Hello login flow by returning the signed value of the challange from GetWindowsHelloChallenge. Windows Hello has a 2 step client to server authentication scheme. Step one is to request from the server a challenge string. Step two is to request the user sign the string via Windows Hello and then send the signed value back to the server. */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithWindowsHello(FClientLoginWithWindowsHelloRequest request, + FDelegateOnSuccessLoginWithWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithWindowsHello = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithWindowsHello); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithWindowsHello"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.ChallengeSignature.IsEmpty() || request.ChallengeSignature == "") { + OutRestJsonObj->SetFieldNull(TEXT("ChallengeSignature")); + } else { + OutRestJsonObj->SetStringField(TEXT("ChallengeSignature"), request.ChallengeSignature); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PublicKeyHint.IsEmpty() || request.PublicKeyHint == "") { + OutRestJsonObj->SetFieldNull(TEXT("PublicKeyHint")); + } else { + OutRestJsonObj->SetStringField(TEXT("PublicKeyHint"), request.PublicKeyHint); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithWindowsHello.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithWindowsHello.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::LoginWithXbox(FClientLoginWithXboxRequest request, + FDelegateOnSuccessLoginWithXbox onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessLoginWithXbox = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperLoginWithXbox); + + // Setup the request + manager->PlayFabRequestURL = "/Client/LoginWithXbox"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("CreateAccount"), request.CreateAccount); + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperLoginWithXbox(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessLoginWithXbox.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessLoginWithXbox.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Registers a new Playfab user account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. You must supply either a username or an email address. */ +UPlayFabClientAPI* UPlayFabClientAPI::RegisterPlayFabUser(FClientRegisterPlayFabUserRequest request, + FDelegateOnSuccessRegisterPlayFabUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRegisterPlayFabUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRegisterPlayFabUser); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RegisterPlayFabUser"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.DisplayName.IsEmpty() || request.DisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("DisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("DisplayName"), request.DisplayName); + } + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.Password.IsEmpty() || request.Password == "") { + OutRestJsonObj->SetFieldNull(TEXT("Password")); + } else { + OutRestJsonObj->SetStringField(TEXT("Password"), request.Password); + } + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + OutRestJsonObj->SetBoolField(TEXT("RequireBothUsernameAndEmail"), request.RequireBothUsernameAndEmail); + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + if (request.Username.IsEmpty() || request.Username == "") { + OutRestJsonObj->SetFieldNull(TEXT("Username")); + } else { + OutRestJsonObj->SetStringField(TEXT("Username"), request.Username); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRegisterPlayFabUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRegisterPlayFabUser.IsBound()) + { + FClientRegisterPlayFabUserResult result = UPlayFabClientModelDecoder::decodeRegisterPlayFabUserResultResponse(response.responseData); + OnSuccessRegisterPlayFabUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Registers a new PlayFab user account using Windows Hello authentication, returning a session ticket that can subsequently be used for API calls which require an authenticated user */ +UPlayFabClientAPI* UPlayFabClientAPI::RegisterWithWindowsHello(FClientRegisterWithWindowsHelloRequest request, + FDelegateOnSuccessRegisterWithWindowsHello onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRegisterWithWindowsHello = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRegisterWithWindowsHello); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RegisterWithWindowsHello"; + manager->returnsSessionTicket = true; + + // Serialize all the request properties to json + if (request.DeviceName.IsEmpty() || request.DeviceName == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceName")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceName"), request.DeviceName); + } + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + OutRestJsonObj->SetBoolField(TEXT("LoginTitlePlayerAccountEntity"), request.LoginTitlePlayerAccountEntity); + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + if (request.PublicKey.IsEmpty() || request.PublicKey == "") { + OutRestJsonObj->SetFieldNull(TEXT("PublicKey")); + } else { + OutRestJsonObj->SetStringField(TEXT("PublicKey"), request.PublicKey); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + if (request.UserName.IsEmpty() || request.UserName == "") { + OutRestJsonObj->SetFieldNull(TEXT("UserName")); + } else { + OutRestJsonObj->SetStringField(TEXT("UserName"), request.UserName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRegisterWithWindowsHello(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRegisterWithWindowsHello.IsBound()) + { + FClientLoginResult result = UPlayFabClientModelDecoder::decodeLoginResultResponse(response.responseData); + OnSuccessRegisterWithWindowsHello.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's secret use the Admin or Server API method SetPlayerSecret. */ +UPlayFabClientAPI* UPlayFabClientAPI::SetPlayerSecret(FClientSetPlayerSecretRequest request, + FDelegateOnSuccessSetPlayerSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetPlayerSecret = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperSetPlayerSecret); + + // Setup the request + manager->PlayFabRequestURL = "/Client/SetPlayerSecret"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.EncryptedRequest.IsEmpty() || request.EncryptedRequest == "") { + OutRestJsonObj->SetFieldNull(TEXT("EncryptedRequest")); + } else { + OutRestJsonObj->SetStringField(TEXT("EncryptedRequest"), request.EncryptedRequest); + } + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperSetPlayerSecret(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetPlayerSecret.IsBound()) + { + FClientSetPlayerSecretResult result = UPlayFabClientModelDecoder::decodeSetPlayerSecretResultResponse(response.responseData); + OnSuccessSetPlayerSecret.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Character Data +////////////////////////////////////////////////////// +/** Retrieves the title-specific custom data for the character which is readable and writable by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCharacterData(FClientGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCharacterData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCharacterData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterData.IsBound()) + { + FClientGetCharacterDataResult result = UPlayFabClientModelDecoder::decodeGetCharacterDataResultResponse(response.responseData); + OnSuccessGetCharacterData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the character which can only be read by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCharacterReadOnlyData(FClientGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCharacterReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCharacterReadOnlyData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCharacterReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterReadOnlyData.IsBound()) + { + FClientGetCharacterDataResult result = UPlayFabClientModelDecoder::decodeGetCharacterDataResultResponse(response.responseData); + OnSuccessGetCharacterReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates and updates the title-specific custom data for the user's character which is readable and writable by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateCharacterData(FClientUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCharacterData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateCharacterData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateCharacterData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCharacterData.IsBound()) + { + FClientUpdateCharacterDataResult result = UPlayFabClientModelDecoder::decodeUpdateCharacterDataResultResponse(response.responseData); + OnSuccessUpdateCharacterData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// +/** Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetAllUsersCharacters(FClientListUsersCharactersRequest request, + FDelegateOnSuccessGetAllUsersCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetAllUsersCharacters = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetAllUsersCharacters); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetAllUsersCharacters"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetAllUsersCharacters(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetAllUsersCharacters.IsBound()) + { + FClientListUsersCharactersResult result = UPlayFabClientModelDecoder::decodeListUsersCharactersResultResponse(response.responseData); + OnSuccessGetAllUsersCharacters.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCharacterLeaderboard(FClientGetCharacterLeaderboardRequest request, + FDelegateOnSuccessGetCharacterLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterLeaderboard = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCharacterLeaderboard); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCharacterLeaderboard"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterType.IsEmpty() || request.CharacterType == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterType")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterType"), request.CharacterType); + } + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + OutRestJsonObj->SetNumberField(TEXT("StartPosition"), request.StartPosition); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCharacterLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterLeaderboard.IsBound()) + { + FClientGetCharacterLeaderboardResult result = UPlayFabClientModelDecoder::decodeGetCharacterLeaderboardResultResponse(response.responseData); + OnSuccessGetCharacterLeaderboard.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the details of all title-specific statistics for the user */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCharacterStatistics(FClientGetCharacterStatisticsRequest request, + FDelegateOnSuccessGetCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCharacterStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCharacterStatistics"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterStatistics.IsBound()) + { + FClientGetCharacterStatisticsResult result = UPlayFabClientModelDecoder::decodeGetCharacterStatisticsResultResponse(response.responseData); + OnSuccessGetCharacterStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked characters for the given statistic, centered on the requested Character ID */ +UPlayFabClientAPI* UPlayFabClientAPI::GetLeaderboardAroundCharacter(FClientGetLeaderboardAroundCharacterRequest request, + FDelegateOnSuccessGetLeaderboardAroundCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboardAroundCharacter = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetLeaderboardAroundCharacter); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetLeaderboardAroundCharacter"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CharacterType.IsEmpty() || request.CharacterType == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterType")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterType"), request.CharacterType); + } + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetLeaderboardAroundCharacter(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboardAroundCharacter.IsBound()) + { + FClientGetLeaderboardAroundCharacterResult result = UPlayFabClientModelDecoder::decodeGetLeaderboardAroundCharacterResultResponse(response.responseData); + OnSuccessGetLeaderboardAroundCharacter.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of all of the user's characters for the given statistic. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetLeaderboardForUserCharacters(FClientGetLeaderboardForUsersCharactersRequest request, + FDelegateOnSuccessGetLeaderboardForUserCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboardForUserCharacters = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetLeaderboardForUserCharacters); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetLeaderboardForUserCharacters"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetLeaderboardForUserCharacters(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboardForUserCharacters.IsBound()) + { + FClientGetLeaderboardForUsersCharactersResult result = UPlayFabClientModelDecoder::decodeGetLeaderboardForUsersCharactersResultResponse(response.responseData); + OnSuccessGetLeaderboardForUserCharacters.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness. */ +UPlayFabClientAPI* UPlayFabClientAPI::GrantCharacterToUser(FClientGrantCharacterToUserRequest request, + FDelegateOnSuccessGrantCharacterToUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGrantCharacterToUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGrantCharacterToUser); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GrantCharacterToUser"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterName.IsEmpty() || request.CharacterName == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterName")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterName"), request.CharacterName); + } + if (request.ItemId.IsEmpty() || request.ItemId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemId"), request.ItemId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGrantCharacterToUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGrantCharacterToUser.IsBound()) + { + FClientGrantCharacterToUserResult result = UPlayFabClientModelDecoder::decodeGrantCharacterToUserResultResponse(response.responseData); + OnSuccessGrantCharacterToUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the values of the specified title-specific statistics for the specific character. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateCharacterStatistics(FClientUpdateCharacterStatisticsRequest request, + FDelegateOnSuccessUpdateCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCharacterStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateCharacterStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateCharacterStatistics"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CharacterStatistics != nullptr) OutRestJsonObj->SetObjectField(TEXT("CharacterStatistics"), request.CharacterStatistics); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCharacterStatistics.IsBound()) + { + FClientUpdateCharacterStatisticsResult result = UPlayFabClientModelDecoder::decodeUpdateCharacterStatisticsResultResponse(response.responseData); + OnSuccessUpdateCharacterStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// +/** This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service. Also, please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetContentDownloadUrl(FClientGetContentDownloadUrlRequest request, + FDelegateOnSuccessGetContentDownloadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetContentDownloadUrl = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetContentDownloadUrl); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetContentDownloadUrl"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.HttpMethod.IsEmpty() || request.HttpMethod == "") { + OutRestJsonObj->SetFieldNull(TEXT("HttpMethod")); + } else { + OutRestJsonObj->SetStringField(TEXT("HttpMethod"), request.HttpMethod); + } + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + OutRestJsonObj->SetBoolField(TEXT("ThruCDN"), request.ThruCDN); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetContentDownloadUrl(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetContentDownloadUrl.IsBound()) + { + FClientGetContentDownloadUrlResult result = UPlayFabClientModelDecoder::decodeGetContentDownloadUrlResultResponse(response.responseData); + OnSuccessGetContentDownloadUrl.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Friend List Management +////////////////////////////////////////////////////// +/** Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user. At least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. */ +UPlayFabClientAPI* UPlayFabClientAPI::AddFriend(FClientAddFriendRequest request, + FDelegateOnSuccessAddFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddFriend = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAddFriend); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AddFriend"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.FriendEmail.IsEmpty() || request.FriendEmail == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendEmail")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendEmail"), request.FriendEmail); + } + if (request.FriendPlayFabId.IsEmpty() || request.FriendPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendPlayFabId"), request.FriendPlayFabId); + } + if (request.FriendTitleDisplayName.IsEmpty() || request.FriendTitleDisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendTitleDisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendTitleDisplayName"), request.FriendTitleDisplayName); + } + if (request.FriendUsername.IsEmpty() || request.FriendUsername == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendUsername")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendUsername"), request.FriendUsername); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAddFriend(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddFriend.IsBound()) + { + FClientAddFriendResult result = UPlayFabClientModelDecoder::decodeAddFriendResultResponse(response.responseData); + OnSuccessAddFriend.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the current friend list for the local user, constrained to users who have PlayFab accounts. Friends from linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetFriendsList(FClientGetFriendsListRequest request, + FDelegateOnSuccessGetFriendsList onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetFriendsList = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetFriendsList); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetFriendsList"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("IncludeFacebookFriends"), request.IncludeFacebookFriends); + OutRestJsonObj->SetBoolField(TEXT("IncludeSteamFriends"), request.IncludeSteamFriends); + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetFriendsList(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetFriendsList.IsBound()) + { + FClientGetFriendsListResult result = UPlayFabClientModelDecoder::decodeGetFriendsListResultResponse(response.responseData); + OnSuccessGetFriendsList.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes a specified user from the friend list of the local user */ +UPlayFabClientAPI* UPlayFabClientAPI::RemoveFriend(FClientRemoveFriendRequest request, + FDelegateOnSuccessRemoveFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveFriend = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRemoveFriend); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RemoveFriend"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.FriendPlayFabId.IsEmpty() || request.FriendPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendPlayFabId"), request.FriendPlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRemoveFriend(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveFriend.IsBound()) + { + FClientRemoveFriendResult result = UPlayFabClientModelDecoder::decodeRemoveFriendResultResponse(response.responseData); + OnSuccessRemoveFriend.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the tag list for a specified user in the friend list of the local user */ +UPlayFabClientAPI* UPlayFabClientAPI::SetFriendTags(FClientSetFriendTagsRequest request, + FDelegateOnSuccessSetFriendTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetFriendTags = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperSetFriendTags); + + // Setup the request + manager->PlayFabRequestURL = "/Client/SetFriendTags"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.FriendPlayFabId.IsEmpty() || request.FriendPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendPlayFabId"), request.FriendPlayFabId); + } + // Check to see if string is empty + if (request.Tags.IsEmpty() || request.Tags == "") { + OutRestJsonObj->SetFieldNull(TEXT("Tags")); + } else { + TArray TagsArray; + FString(request.Tags).ParseIntoArray(TagsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Tags"), TagsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperSetFriendTags(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetFriendTags.IsBound()) + { + FClientSetFriendTagsResult result = UPlayFabClientModelDecoder::decodeSetFriendTagsResultResponse(response.responseData); + OnSuccessSetFriendTags.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// +/** Get details about all current running game servers matching the given parameters. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCurrentGames(FClientCurrentGamesRequest request, + FDelegateOnSuccessGetCurrentGames onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCurrentGames = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCurrentGames); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCurrentGames"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.BuildVersion.IsEmpty() || request.BuildVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildVersion"), request.BuildVersion); + } + if (request.GameMode.IsEmpty() || request.GameMode == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameMode")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameMode"), request.GameMode); + } + FString temp_Region; + if (GetEnumValueToString(TEXT("ERegion"), request.Region, temp_Region)) + OutRestJsonObj->SetStringField(TEXT("Region"), temp_Region); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + if (request.TagFilter != nullptr) OutRestJsonObj->SetObjectField(TEXT("TagFilter"), request.TagFilter); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCurrentGames(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCurrentGames.IsBound()) + { + FClientCurrentGamesResult result = UPlayFabClientModelDecoder::decodeCurrentGamesResultResponse(response.responseData); + OnSuccessGetCurrentGames.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get details about the regions hosting game servers matching the given parameters. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetGameServerRegions(FClientGameServerRegionsRequest request, + FDelegateOnSuccessGetGameServerRegions onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetGameServerRegions = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetGameServerRegions); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetGameServerRegions"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.BuildVersion.IsEmpty() || request.BuildVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildVersion"), request.BuildVersion); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetGameServerRegions(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetGameServerRegions.IsBound()) + { + FClientGameServerRegionsResult result = UPlayFabClientModelDecoder::decodeGameServerRegionsResultResponse(response.responseData); + OnSuccessGetGameServerRegions.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Attempts to locate a game session matching the given parameters. If the goal is to match the player into a specific active session, only the LobbyId is required. Otherwise, the BuildVersion, GameMode, and Region are all required parameters. Note that parameters specified in the search are required (they are not weighting factors). If a slot is found in a server instance matching the parameters, the slot will be assigned to that player, removing it from the availabe set. In that case, the information on the game session will be returned, otherwise the Status returned will be GameNotFound. */ +UPlayFabClientAPI* UPlayFabClientAPI::Matchmake(FClientMatchmakeRequest request, + FDelegateOnSuccessMatchmake onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessMatchmake = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperMatchmake); + + // Setup the request + manager->PlayFabRequestURL = "/Client/Matchmake"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.BuildVersion.IsEmpty() || request.BuildVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildVersion"), request.BuildVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.GameMode.IsEmpty() || request.GameMode == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameMode")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameMode"), request.GameMode); + } + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + FString temp_Region; + if (GetEnumValueToString(TEXT("ERegion"), request.Region, temp_Region)) + OutRestJsonObj->SetStringField(TEXT("Region"), temp_Region); + OutRestJsonObj->SetBoolField(TEXT("StartNewIfNoneFound"), request.StartNewIfNoneFound); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + if (request.TagFilter != nullptr) OutRestJsonObj->SetObjectField(TEXT("TagFilter"), request.TagFilter); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperMatchmake(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessMatchmake.IsBound()) + { + FClientMatchmakeResult result = UPlayFabClientModelDecoder::decodeMatchmakeResultResponse(response.responseData); + OnSuccessMatchmake.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Start a new game server with a given configuration, add the current player and return the connection information. */ +UPlayFabClientAPI* UPlayFabClientAPI::StartGame(FClientStartGameRequest request, + FDelegateOnSuccessStartGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessStartGame = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperStartGame); + + // Setup the request + manager->PlayFabRequestURL = "/Client/StartGame"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.BuildVersion.IsEmpty() || request.BuildVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("BuildVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("BuildVersion"), request.BuildVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CustomCommandLineData.IsEmpty() || request.CustomCommandLineData == "") { + OutRestJsonObj->SetFieldNull(TEXT("CustomCommandLineData")); + } else { + OutRestJsonObj->SetStringField(TEXT("CustomCommandLineData"), request.CustomCommandLineData); + } + if (request.GameMode.IsEmpty() || request.GameMode == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameMode")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameMode"), request.GameMode); + } + FString temp_Region; + if (GetEnumValueToString(TEXT("ERegion"), request.Region, temp_Region)) + OutRestJsonObj->SetStringField(TEXT("Region"), temp_Region); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperStartGame(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessStartGame.IsBound()) + { + FClientStartGameResult result = UPlayFabClientModelDecoder::decodeStartGameResultResponse(response.responseData); + OnSuccessStartGame.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Platform Specific Methods +////////////////////////////////////////////////////// +/** Registers the Android device to receive push notifications */ +UPlayFabClientAPI* UPlayFabClientAPI::AndroidDevicePushNotificationRegistration(FClientAndroidDevicePushNotificationRegistrationRequest request, + FDelegateOnSuccessAndroidDevicePushNotificationRegistration onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAndroidDevicePushNotificationRegistration = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAndroidDevicePushNotificationRegistration); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AndroidDevicePushNotificationRegistration"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.ConfirmationMessage.IsEmpty() || request.ConfirmationMessage == "") { + OutRestJsonObj->SetFieldNull(TEXT("ConfirmationMessage")); + } else { + OutRestJsonObj->SetStringField(TEXT("ConfirmationMessage"), request.ConfirmationMessage); + } + if (request.DeviceToken.IsEmpty() || request.DeviceToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceToken"), request.DeviceToken); + } + OutRestJsonObj->SetBoolField(TEXT("SendPushNotificationConfirmation"), request.SendPushNotificationConfirmation); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAndroidDevicePushNotificationRegistration(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAndroidDevicePushNotificationRegistration.IsBound()) + { + FClientAndroidDevicePushNotificationRegistrationResult result = UPlayFabClientModelDecoder::decodeAndroidDevicePushNotificationRegistrationResultResponse(response.responseData); + OnSuccessAndroidDevicePushNotificationRegistration.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Grants the player's current entitlements from Xbox Live, consuming all availble items in Xbox and granting them to the player's PlayFab inventory. This call is idempotent and will not grant previously granted items to the player. */ +UPlayFabClientAPI* UPlayFabClientAPI::ConsumeXboxEntitlements(FClientConsumeXboxEntitlementsRequest request, + FDelegateOnSuccessConsumeXboxEntitlements onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessConsumeXboxEntitlements = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperConsumeXboxEntitlements); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ConsumeXboxEntitlements"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperConsumeXboxEntitlements(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessConsumeXboxEntitlements.IsBound()) + { + FClientConsumeXboxEntitlementsResult result = UPlayFabClientModelDecoder::decodeConsumeXboxEntitlementsResultResponse(response.responseData); + OnSuccessConsumeXboxEntitlements.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Registers the iOS device to receive push notifications */ +UPlayFabClientAPI* UPlayFabClientAPI::RegisterForIOSPushNotification(FClientRegisterForIOSPushNotificationRequest request, + FDelegateOnSuccessRegisterForIOSPushNotification onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRegisterForIOSPushNotification = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRegisterForIOSPushNotification); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RegisterForIOSPushNotification"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.ConfirmationMessage.IsEmpty() || request.ConfirmationMessage == "") { + OutRestJsonObj->SetFieldNull(TEXT("ConfirmationMessage")); + } else { + OutRestJsonObj->SetStringField(TEXT("ConfirmationMessage"), request.ConfirmationMessage); + } + if (request.DeviceToken.IsEmpty() || request.DeviceToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("DeviceToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("DeviceToken"), request.DeviceToken); + } + OutRestJsonObj->SetBoolField(TEXT("SendPushNotificationConfirmation"), request.SendPushNotificationConfirmation); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRegisterForIOSPushNotification(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRegisterForIOSPushNotification.IsBound()) + { + FClientRegisterForIOSPushNotificationResult result = UPlayFabClientModelDecoder::decodeRegisterForIOSPushNotificationResultResponse(response.responseData); + OnSuccessRegisterForIOSPushNotification.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Restores all in-app purchases based on the given restore receipt */ +UPlayFabClientAPI* UPlayFabClientAPI::RestoreIOSPurchases(FClientRestoreIOSPurchasesRequest request, + FDelegateOnSuccessRestoreIOSPurchases onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRestoreIOSPurchases = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRestoreIOSPurchases); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RestoreIOSPurchases"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.ReceiptData.IsEmpty() || request.ReceiptData == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReceiptData")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReceiptData"), request.ReceiptData); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRestoreIOSPurchases(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRestoreIOSPurchases.IsBound()) + { + FClientRestoreIOSPurchasesResult result = UPlayFabClientModelDecoder::decodeRestoreIOSPurchasesResultResponse(response.responseData); + OnSuccessRestoreIOSPurchases.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item */ +UPlayFabClientAPI* UPlayFabClientAPI::ValidateAmazonIAPReceipt(FClientValidateAmazonReceiptRequest request, + FDelegateOnSuccessValidateAmazonIAPReceipt onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessValidateAmazonIAPReceipt = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperValidateAmazonIAPReceipt); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ValidateAmazonIAPReceipt"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CurrencyCode.IsEmpty() || request.CurrencyCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("CurrencyCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("CurrencyCode"), request.CurrencyCode); + } + OutRestJsonObj->SetNumberField(TEXT("PurchasePrice"), request.PurchasePrice); + if (request.ReceiptId.IsEmpty() || request.ReceiptId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReceiptId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReceiptId"), request.ReceiptId); + } + if (request.UserId.IsEmpty() || request.UserId == "") { + OutRestJsonObj->SetFieldNull(TEXT("UserId")); + } else { + OutRestJsonObj->SetStringField(TEXT("UserId"), request.UserId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperValidateAmazonIAPReceipt(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessValidateAmazonIAPReceipt.IsBound()) + { + FClientValidateAmazonReceiptResult result = UPlayFabClientModelDecoder::decodeValidateAmazonReceiptResultResponse(response.responseData); + OnSuccessValidateAmazonIAPReceipt.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Validates a Google Play purchase and gives the corresponding item to the player. */ +UPlayFabClientAPI* UPlayFabClientAPI::ValidateGooglePlayPurchase(FClientValidateGooglePlayPurchaseRequest request, + FDelegateOnSuccessValidateGooglePlayPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessValidateGooglePlayPurchase = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperValidateGooglePlayPurchase); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ValidateGooglePlayPurchase"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CurrencyCode.IsEmpty() || request.CurrencyCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("CurrencyCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("CurrencyCode"), request.CurrencyCode); + } + OutRestJsonObj->SetNumberField(TEXT("PurchasePrice"), request.PurchasePrice); + if (request.ReceiptJson.IsEmpty() || request.ReceiptJson == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReceiptJson")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReceiptJson"), request.ReceiptJson); + } + if (request.Signature.IsEmpty() || request.Signature == "") { + OutRestJsonObj->SetFieldNull(TEXT("Signature")); + } else { + OutRestJsonObj->SetStringField(TEXT("Signature"), request.Signature); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperValidateGooglePlayPurchase(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessValidateGooglePlayPurchase.IsBound()) + { + FClientValidateGooglePlayPurchaseResult result = UPlayFabClientModelDecoder::decodeValidateGooglePlayPurchaseResultResponse(response.responseData); + OnSuccessValidateGooglePlayPurchase.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item */ +UPlayFabClientAPI* UPlayFabClientAPI::ValidateIOSReceipt(FClientValidateIOSReceiptRequest request, + FDelegateOnSuccessValidateIOSReceipt onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessValidateIOSReceipt = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperValidateIOSReceipt); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ValidateIOSReceipt"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CurrencyCode.IsEmpty() || request.CurrencyCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("CurrencyCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("CurrencyCode"), request.CurrencyCode); + } + OutRestJsonObj->SetNumberField(TEXT("PurchasePrice"), request.PurchasePrice); + if (request.ReceiptData.IsEmpty() || request.ReceiptData == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReceiptData")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReceiptData"), request.ReceiptData); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperValidateIOSReceipt(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessValidateIOSReceipt.IsBound()) + { + FClientValidateIOSReceiptResult result = UPlayFabClientModelDecoder::decodeValidateIOSReceiptResultResponse(response.responseData); + OnSuccessValidateIOSReceipt.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Validates with Windows that the receipt for an Windows App Store in-app purchase is valid and that it matches the purchased catalog item */ +UPlayFabClientAPI* UPlayFabClientAPI::ValidateWindowsStoreReceipt(FClientValidateWindowsReceiptRequest request, + FDelegateOnSuccessValidateWindowsStoreReceipt onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessValidateWindowsStoreReceipt = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperValidateWindowsStoreReceipt); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ValidateWindowsStoreReceipt"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CurrencyCode.IsEmpty() || request.CurrencyCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("CurrencyCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("CurrencyCode"), request.CurrencyCode); + } + OutRestJsonObj->SetNumberField(TEXT("PurchasePrice"), request.PurchasePrice); + if (request.Receipt.IsEmpty() || request.Receipt == "") { + OutRestJsonObj->SetFieldNull(TEXT("Receipt")); + } else { + OutRestJsonObj->SetStringField(TEXT("Receipt"), request.Receipt); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperValidateWindowsStoreReceipt(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessValidateWindowsStoreReceipt.IsBound()) + { + FClientValidateWindowsReceiptResult result = UPlayFabClientModelDecoder::decodeValidateWindowsReceiptResultResponse(response.responseData); + OnSuccessValidateWindowsStoreReceipt.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// +/** Retrieves a list of ranked friends of the current player for the given statistic, starting from the indicated point in the leaderboard */ +UPlayFabClientAPI* UPlayFabClientAPI::GetFriendLeaderboard(FClientGetFriendLeaderboardRequest request, + FDelegateOnSuccessGetFriendLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetFriendLeaderboard = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetFriendLeaderboard); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetFriendLeaderboard"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("IncludeFacebookFriends"), request.IncludeFacebookFriends); + OutRestJsonObj->SetBoolField(TEXT("IncludeSteamFriends"), request.IncludeSteamFriends); + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + OutRestJsonObj->SetNumberField(TEXT("StartPosition"), request.StartPosition); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetFriendLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetFriendLeaderboard.IsBound()) + { + FClientGetLeaderboardResult result = UPlayFabClientModelDecoder::decodeGetLeaderboardResultResponse(response.responseData); + OnSuccessGetFriendLeaderboard.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked friends of the current player for the given statistic, centered on the requested PlayFab user. If PlayFabId is empty or null will return currently logged in user. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetFriendLeaderboardAroundPlayer(FClientGetFriendLeaderboardAroundPlayerRequest request, + FDelegateOnSuccessGetFriendLeaderboardAroundPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetFriendLeaderboardAroundPlayer = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetFriendLeaderboardAroundPlayer); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetFriendLeaderboardAroundPlayer"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("IncludeFacebookFriends"), request.IncludeFacebookFriends); + OutRestJsonObj->SetBoolField(TEXT("IncludeSteamFriends"), request.IncludeSteamFriends); + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetFriendLeaderboardAroundPlayer(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetFriendLeaderboardAroundPlayer.IsBound()) + { + FClientGetFriendLeaderboardAroundPlayerResult result = UPlayFabClientModelDecoder::decodeGetFriendLeaderboardAroundPlayerResultResponse(response.responseData); + OnSuccessGetFriendLeaderboardAroundPlayer.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard */ +UPlayFabClientAPI* UPlayFabClientAPI::GetLeaderboard(FClientGetLeaderboardRequest request, + FDelegateOnSuccessGetLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboard = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetLeaderboard); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetLeaderboard"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + OutRestJsonObj->SetNumberField(TEXT("StartPosition"), request.StartPosition); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboard.IsBound()) + { + FClientGetLeaderboardResult result = UPlayFabClientModelDecoder::decodeGetLeaderboardResultResponse(response.responseData); + OnSuccessGetLeaderboard.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked users for the given statistic, centered on the requested player. If PlayFabId is empty or null will return currently logged in user. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetLeaderboardAroundPlayer(FClientGetLeaderboardAroundPlayerRequest request, + FDelegateOnSuccessGetLeaderboardAroundPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboardAroundPlayer = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetLeaderboardAroundPlayer); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetLeaderboardAroundPlayer"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetLeaderboardAroundPlayer(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboardAroundPlayer.IsBound()) + { + FClientGetLeaderboardAroundPlayerResult result = UPlayFabClientModelDecoder::decodeGetLeaderboardAroundPlayerResultResponse(response.responseData); + OnSuccessGetLeaderboardAroundPlayer.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the indicated statistics (current version and values for all statistics, if none are specified), for the local player. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerStatistics(FClientGetPlayerStatisticsRequest request, + FDelegateOnSuccessGetPlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerStatistics"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.StatisticNames.IsEmpty() || request.StatisticNames == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticNames")); + } else { + TArray StatisticNamesArray; + FString(request.StatisticNames).ParseIntoArray(StatisticNamesArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("StatisticNames"), StatisticNamesArray); + } + if (request.StatisticNameVersions.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("StatisticNameVersions")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("StatisticNameVersions"), request.StatisticNameVersions); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerStatistics.IsBound()) + { + FClientGetPlayerStatisticsResult result = UPlayFabClientModelDecoder::decodeGetPlayerStatisticsResultResponse(response.responseData); + OnSuccessGetPlayerStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the information on the available versions of the specified statistic. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerStatisticVersions(FClientGetPlayerStatisticVersionsRequest request, + FDelegateOnSuccessGetPlayerStatisticVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerStatisticVersions = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerStatisticVersions); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerStatisticVersions"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerStatisticVersions(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerStatisticVersions.IsBound()) + { + FClientGetPlayerStatisticVersionsResult result = UPlayFabClientModelDecoder::decodeGetPlayerStatisticVersionsResultResponse(response.responseData); + OnSuccessGetPlayerStatisticVersions.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::GetUserData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetUserData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetUserData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetUserData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserData.IsBound()) + { + FClientGetUserDataResult result = UPlayFabClientModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::GetUserPublisherData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetUserPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetUserPublisherData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherData.IsBound()) + { + FClientGetUserDataResult result = UPlayFabClientModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which can only be read by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::GetUserPublisherReadOnlyData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetUserPublisherReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetUserPublisherReadOnlyData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherReadOnlyData.IsBound()) + { + FClientGetUserDataResult result = UPlayFabClientModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which can only be read by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::GetUserReadOnlyData(FClientGetUserDataRequest request, + FDelegateOnSuccessGetUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetUserReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetUserReadOnlyData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserReadOnlyData.IsBound()) + { + FClientGetUserDataResult result = UPlayFabClientModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdatePlayerStatistics(FClientUpdatePlayerStatisticsRequest request, + FDelegateOnSuccessUpdatePlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdatePlayerStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdatePlayerStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdatePlayerStatistics"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Statistics.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Statistics")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Statistics"), request.Statistics); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdatePlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdatePlayerStatistics.IsBound()) + { + FClientUpdatePlayerStatisticsResult result = UPlayFabClientModelDecoder::decodeUpdatePlayerStatisticsResultResponse(response.responseData); + OnSuccessUpdatePlayerStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates and updates the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateUserData(FClientUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateUserData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateUserData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateUserData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserData.IsBound()) + { + FClientUpdateUserDataResult result = UPlayFabClientModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates and updates the publisher-specific custom data for the user which is readable and writable by the client */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateUserPublisherData(FClientUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateUserPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateUserPublisherData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherData.IsBound()) + { + FClientUpdateUserDataResult result = UPlayFabClientModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// +/** Increments the user's balance of the specified virtual currency by the stated amount */ +UPlayFabClientAPI* UPlayFabClientAPI::AddUserVirtualCurrency(FClientAddUserVirtualCurrencyRequest request, + FDelegateOnSuccessAddUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddUserVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAddUserVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AddUserVirtualCurrency"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAddUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddUserVirtualCurrency.IsBound()) + { + FClientModifyUserVirtualCurrencyResult result = UPlayFabClientModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(response.responseData); + OnSuccessAddUserVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Confirms with the payment provider that the purchase was approved (if applicable) and adjusts inventory and virtual currency balances as appropriate */ +UPlayFabClientAPI* UPlayFabClientAPI::ConfirmPurchase(FClientConfirmPurchaseRequest request, + FDelegateOnSuccessConfirmPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessConfirmPurchase = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperConfirmPurchase); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ConfirmPurchase"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.OrderId.IsEmpty() || request.OrderId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OrderId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OrderId"), request.OrderId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperConfirmPurchase(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessConfirmPurchase.IsBound()) + { + FClientConfirmPurchaseResult result = UPlayFabClientModelDecoder::decodeConfirmPurchaseResultResponse(response.responseData); + OnSuccessConfirmPurchase.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. */ +UPlayFabClientAPI* UPlayFabClientAPI::ConsumeItem(FClientConsumeItemRequest request, + FDelegateOnSuccessConsumeItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessConsumeItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperConsumeItem); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ConsumeItem"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("ConsumeCount"), request.ConsumeCount); + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperConsumeItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessConsumeItem.IsBound()) + { + FClientConsumeItemResult result = UPlayFabClientModelDecoder::decodeConsumeItemResultResponse(response.responseData); + OnSuccessConsumeItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the specified character's current inventory of virtual goods */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCharacterInventory(FClientGetCharacterInventoryRequest request, + FDelegateOnSuccessGetCharacterInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterInventory = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCharacterInventory); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCharacterInventory"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCharacterInventory(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterInventory.IsBound()) + { + FClientGetCharacterInventoryResult result = UPlayFabClientModelDecoder::decodeGetCharacterInventoryResultResponse(response.responseData); + OnSuccessGetCharacterInventory.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** For payments flows where the provider requires playfab (the fulfiller) to initiate the transaction, but the client completes the rest of the flow. In the Xsolla case, the token returned here will be passed to Xsolla by the client to create a cart. Poll GetPurchase using the returned OrderId once you've completed the payment. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPaymentToken(FClientGetPaymentTokenRequest request, + FDelegateOnSuccessGetPaymentToken onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPaymentToken = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPaymentToken); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPaymentToken"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.TokenProvider.IsEmpty() || request.TokenProvider == "") { + OutRestJsonObj->SetFieldNull(TEXT("TokenProvider")); + } else { + OutRestJsonObj->SetStringField(TEXT("TokenProvider"), request.TokenProvider); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPaymentToken(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPaymentToken.IsBound()) + { + FClientGetPaymentTokenResult result = UPlayFabClientModelDecoder::decodeGetPaymentTokenResultResponse(response.responseData); + OnSuccessGetPaymentToken.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a purchase along with its current PlayFab status. Returns inventory items from the purchase that are still active. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPurchase(FClientGetPurchaseRequest request, + FDelegateOnSuccessGetPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPurchase = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPurchase); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPurchase"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.OrderId.IsEmpty() || request.OrderId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OrderId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OrderId"), request.OrderId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPurchase(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPurchase.IsBound()) + { + FClientGetPurchaseResult result = UPlayFabClientModelDecoder::decodeGetPurchaseResultResponse(response.responseData); + OnSuccessGetPurchase.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the user's current inventory of virtual goods */ +UPlayFabClientAPI* UPlayFabClientAPI::GetUserInventory(FClientGetUserInventoryRequest request, + FDelegateOnSuccessGetUserInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserInventory = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetUserInventory); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetUserInventory"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetUserInventory(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserInventory.IsBound()) + { + FClientGetUserInventoryResult result = UPlayFabClientModelDecoder::decodeGetUserInventoryResultResponse(response.responseData); + OnSuccessGetUserInventory.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Selects a payment option for purchase order created via StartPurchase */ +UPlayFabClientAPI* UPlayFabClientAPI::PayForPurchase(FClientPayForPurchaseRequest request, + FDelegateOnSuccessPayForPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessPayForPurchase = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperPayForPurchase); + + // Setup the request + manager->PlayFabRequestURL = "/Client/PayForPurchase"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Currency.IsEmpty() || request.Currency == "") { + OutRestJsonObj->SetFieldNull(TEXT("Currency")); + } else { + OutRestJsonObj->SetStringField(TEXT("Currency"), request.Currency); + } + if (request.OrderId.IsEmpty() || request.OrderId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OrderId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OrderId"), request.OrderId); + } + if (request.ProviderName.IsEmpty() || request.ProviderName == "") { + OutRestJsonObj->SetFieldNull(TEXT("ProviderName")); + } else { + OutRestJsonObj->SetStringField(TEXT("ProviderName"), request.ProviderName); + } + if (request.ProviderTransactionId.IsEmpty() || request.ProviderTransactionId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ProviderTransactionId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ProviderTransactionId"), request.ProviderTransactionId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperPayForPurchase(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessPayForPurchase.IsBound()) + { + FClientPayForPurchaseResult result = UPlayFabClientModelDecoder::decodePayForPurchaseResultResponse(response.responseData); + OnSuccessPayForPurchase.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Buys a single item with virtual currency. You must specify both the virtual currency to use to purchase, as well as what the client believes the price to be. This lets the server fail the purchase if the price has changed. */ +UPlayFabClientAPI* UPlayFabClientAPI::PurchaseItem(FClientPurchaseItemRequest request, + FDelegateOnSuccessPurchaseItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessPurchaseItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperPurchaseItem); + + // Setup the request + manager->PlayFabRequestURL = "/Client/PurchaseItem"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ItemId.IsEmpty() || request.ItemId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemId"), request.ItemId); + } + OutRestJsonObj->SetNumberField(TEXT("Price"), request.Price); + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperPurchaseItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessPurchaseItem.IsBound()) + { + FClientPurchaseItemResult result = UPlayFabClientModelDecoder::decodePurchaseItemResultResponse(response.responseData); + OnSuccessPurchaseItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ +UPlayFabClientAPI* UPlayFabClientAPI::RedeemCoupon(FClientRedeemCouponRequest request, + FDelegateOnSuccessRedeemCoupon onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRedeemCoupon = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRedeemCoupon); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RedeemCoupon"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CouponCode.IsEmpty() || request.CouponCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("CouponCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("CouponCode"), request.CouponCode); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRedeemCoupon(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRedeemCoupon.IsBound()) + { + FClientRedeemCouponResult result = UPlayFabClientModelDecoder::decodeRedeemCouponResultResponse(response.responseData); + OnSuccessRedeemCoupon.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates an order for a list of items from the title catalog */ +UPlayFabClientAPI* UPlayFabClientAPI::StartPurchase(FClientStartPurchaseRequest request, + FDelegateOnSuccessStartPurchase onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessStartPurchase = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperStartPurchase); + + // Setup the request + manager->PlayFabRequestURL = "/Client/StartPurchase"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.Items.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Items")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Items"), request.Items); + } + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperStartPurchase(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessStartPurchase.IsBound()) + { + FClientStartPurchaseResult result = UPlayFabClientModelDecoder::decodeStartPurchaseResultResponse(response.responseData); + OnSuccessStartPurchase.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Decrements the user's balance of the specified virtual currency by the stated amount. It is possible to make a VC balance negative with this API. */ +UPlayFabClientAPI* UPlayFabClientAPI::SubtractUserVirtualCurrency(FClientSubtractUserVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSubtractUserVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperSubtractUserVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Client/SubtractUserVirtualCurrency"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperSubtractUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSubtractUserVirtualCurrency.IsBound()) + { + FClientModifyUserVirtualCurrencyResult result = UPlayFabClientModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(response.responseData); + OnSuccessSubtractUserVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Opens the specified container, with the specified key (when required), and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlockContainerInstance(FClientUnlockContainerInstanceRequest request, + FDelegateOnSuccessUnlockContainerInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlockContainerInstance = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlockContainerInstance); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlockContainerInstance"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ContainerItemInstanceId.IsEmpty() || request.ContainerItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContainerItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContainerItemInstanceId"), request.ContainerItemInstanceId); + } + if (request.KeyItemInstanceId.IsEmpty() || request.KeyItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeyItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("KeyItemInstanceId"), request.KeyItemInstanceId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlockContainerInstance(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlockContainerInstance.IsBound()) + { + FClientUnlockContainerItemResult result = UPlayFabClientModelDecoder::decodeUnlockContainerItemResultResponse(response.responseData); + OnSuccessUnlockContainerInstance.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Searches target inventory for an ItemInstance matching the given CatalogItemId, if necessary unlocks it using an appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. */ +UPlayFabClientAPI* UPlayFabClientAPI::UnlockContainerItem(FClientUnlockContainerItemRequest request, + FDelegateOnSuccessUnlockContainerItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlockContainerItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUnlockContainerItem); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UnlockContainerItem"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ContainerItemId.IsEmpty() || request.ContainerItemId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContainerItemId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContainerItemId"), request.ContainerItemId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUnlockContainerItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlockContainerItem.IsBound()) + { + FClientUnlockContainerItemResult result = UPlayFabClientModelDecoder::decodeUnlockContainerItemResultResponse(response.responseData); + OnSuccessUnlockContainerItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// +/** List all segments that a player currently belongs to at this moment in time. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerSegments(FClientGetPlayerSegmentsRequest request, + FDelegateOnSuccessGetPlayerSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerSegments = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerSegments); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerSegments"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerSegments(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerSegments.IsBound()) + { + FClientGetPlayerSegmentsResult result = UPlayFabClientModelDecoder::decodeGetPlayerSegmentsResultResponse(response.responseData); + OnSuccessGetPlayerSegments.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get all tags with a given Namespace (optional) from a player profile. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerTags(FClientGetPlayerTagsRequest request, + FDelegateOnSuccessGetPlayerTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerTags = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerTags); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerTags"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Namespace.IsEmpty() || request.Namespace == "") { + OutRestJsonObj->SetFieldNull(TEXT("Namespace")); + } else { + OutRestJsonObj->SetStringField(TEXT("Namespace"), request.Namespace); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerTags(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerTags.IsBound()) + { + FClientGetPlayerTagsResult result = UPlayFabClientModelDecoder::decodeGetPlayerTagsResultResponse(response.responseData); + OnSuccessGetPlayerTags.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// +/** Executes a CloudScript function, with the 'currentPlayerId' set to the PlayFab ID of the authenticated player. */ +UPlayFabClientAPI* UPlayFabClientAPI::ExecuteCloudScript(FClientExecuteCloudScriptRequest request, + FDelegateOnSuccessExecuteCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessExecuteCloudScript = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperExecuteCloudScript); + + // Setup the request + manager->PlayFabRequestURL = "/Client/ExecuteCloudScript"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.FunctionName.IsEmpty() || request.FunctionName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FunctionName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FunctionName"), request.FunctionName); + } + if (request.FunctionParameter != nullptr) OutRestJsonObj->SetObjectField(TEXT("FunctionParameter"), request.FunctionParameter); + OutRestJsonObj->SetBoolField(TEXT("GeneratePlayStreamEvent"), request.GeneratePlayStreamEvent); + FString temp_RevisionSelection; + if (GetEnumValueToString(TEXT("ECloudScriptRevisionOption"), request.RevisionSelection, temp_RevisionSelection)) + OutRestJsonObj->SetStringField(TEXT("RevisionSelection"), temp_RevisionSelection); + OutRestJsonObj->SetNumberField(TEXT("SpecificRevision"), request.SpecificRevision); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperExecuteCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessExecuteCloudScript.IsBound()) + { + FClientExecuteCloudScriptResult result = UPlayFabClientModelDecoder::decodeExecuteCloudScriptResultResponse(response.responseData); + OnSuccessExecuteCloudScript.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// +/** Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users in the group can add new members. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabClientAPI* UPlayFabClientAPI::AddSharedGroupMembers(FClientAddSharedGroupMembersRequest request, + FDelegateOnSuccessAddSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddSharedGroupMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAddSharedGroupMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AddSharedGroupMembers"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.PlayFabIds.IsEmpty() || request.PlayFabIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabIds")); + } else { + TArray PlayFabIdsArray; + FString(request.PlayFabIds).ParseIntoArray(PlayFabIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("PlayFabIds"), PlayFabIdsArray); + } + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAddSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddSharedGroupMembers.IsBound()) + { + FClientAddSharedGroupMembersResult result = UPlayFabClientModelDecoder::decodeAddSharedGroupMembersResultResponse(response.responseData); + OnSuccessAddSharedGroupMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the group. Upon creation, the current user will be the only member of the group. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabClientAPI* UPlayFabClientAPI::CreateSharedGroup(FClientCreateSharedGroupRequest request, + FDelegateOnSuccessCreateSharedGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreateSharedGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperCreateSharedGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Client/CreateSharedGroup"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperCreateSharedGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreateSharedGroup.IsBound()) + { + FClientCreateSharedGroupResult result = UPlayFabClientModelDecoder::decodeCreateSharedGroupResultResponse(response.responseData); + OnSuccessCreateSharedGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves data stored in a shared group object, as well as the list of members in the group. Non-members of the group may use this to retrieve group data, including membership, but they will not receive data for keys marked as private. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabClientAPI* UPlayFabClientAPI::GetSharedGroupData(FClientGetSharedGroupDataRequest request, + FDelegateOnSuccessGetSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetSharedGroupData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetSharedGroupData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetSharedGroupData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("GetMembers"), request.GetMembers); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetSharedGroupData.IsBound()) + { + FClientGetSharedGroupDataResult result = UPlayFabClientModelDecoder::decodeGetSharedGroupDataResultResponse(response.responseData); + OnSuccessGetSharedGroupData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the group can remove members. If as a result of the call, zero users remain with access, the group and its associated data will be deleted. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabClientAPI* UPlayFabClientAPI::RemoveSharedGroupMembers(FClientRemoveSharedGroupMembersRequest request, + FDelegateOnSuccessRemoveSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveSharedGroupMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperRemoveSharedGroupMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Client/RemoveSharedGroupMembers"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.PlayFabIds.IsEmpty() || request.PlayFabIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabIds")); + } else { + TArray PlayFabIdsArray; + FString(request.PlayFabIds).ParseIntoArray(PlayFabIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("PlayFabIds"), PlayFabIdsArray); + } + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperRemoveSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveSharedGroupMembers.IsBound()) + { + FClientRemoveSharedGroupMembersResult result = UPlayFabClientModelDecoder::decodeRemoveSharedGroupMembersResultResponse(response.responseData); + OnSuccessRemoveSharedGroupMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated or added in this call will be readable by users not in the group. By default, data permissions are set to Private. Regardless of the permission setting, only members of the group can update the data. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabClientAPI* UPlayFabClientAPI::UpdateSharedGroupData(FClientUpdateSharedGroupDataRequest request, + FDelegateOnSuccessUpdateSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateSharedGroupData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperUpdateSharedGroupData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/UpdateSharedGroupData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperUpdateSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateSharedGroupData.IsBound()) + { + FClientUpdateSharedGroupDataResult result = UPlayFabClientModelDecoder::decodeUpdateSharedGroupDataResultResponse(response.responseData); + OnSuccessUpdateSharedGroupData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// +/** Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ +UPlayFabClientAPI* UPlayFabClientAPI::GetCatalogItems(FClientGetCatalogItemsRequest request, + FDelegateOnSuccessGetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCatalogItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetCatalogItems); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetCatalogItems"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCatalogItems.IsBound()) + { + FClientGetCatalogItemsResult result = UPlayFabClientModelDecoder::decodeGetCatalogItemsResultResponse(response.responseData); + OnSuccessGetCatalogItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom publisher settings */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPublisherData(FClientGetPublisherDataRequest request, + FDelegateOnSuccessGetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPublisherData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPublisherData.IsBound()) + { + FClientGetPublisherDataResult result = UPlayFabClientModelDecoder::decodeGetPublisherDataResultResponse(response.responseData); + OnSuccessGetPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the set of items defined for the specified store, including all prices defined */ +UPlayFabClientAPI* UPlayFabClientAPI::GetStoreItems(FClientGetStoreItemsRequest request, + FDelegateOnSuccessGetStoreItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetStoreItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetStoreItems); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetStoreItems"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.StoreId.IsEmpty() || request.StoreId == "") { + OutRestJsonObj->SetFieldNull(TEXT("StoreId")); + } else { + OutRestJsonObj->SetStringField(TEXT("StoreId"), request.StoreId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetStoreItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetStoreItems.IsBound()) + { + FClientGetStoreItemsResult result = UPlayFabClientModelDecoder::decodeGetStoreItemsResultResponse(response.responseData); + OnSuccessGetStoreItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the current server time */ +UPlayFabClientAPI* UPlayFabClientAPI::GetTime(FClientGetTimeRequest request, + FDelegateOnSuccessGetTime onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTime = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetTime); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetTime"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetTime(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTime.IsBound()) + { + FClientGetTimeResult result = UPlayFabClientModelDecoder::decodeGetTimeResultResponse(response.responseData); + OnSuccessGetTime.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom title settings */ +UPlayFabClientAPI* UPlayFabClientAPI::GetTitleData(FClientGetTitleDataRequest request, + FDelegateOnSuccessGetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetTitleData); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetTitleData"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleData.IsBound()) + { + FClientGetTitleDataResult result = UPlayFabClientModelDecoder::decodeGetTitleDataResultResponse(response.responseData); + OnSuccessGetTitleData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title news feed, as configured in the developer portal */ +UPlayFabClientAPI* UPlayFabClientAPI::GetTitleNews(FClientGetTitleNewsRequest request, + FDelegateOnSuccessGetTitleNews onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleNews = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetTitleNews); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetTitleNews"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Count"), request.Count); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetTitleNews(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleNews.IsBound()) + { + FClientGetTitleNewsResult result = UPlayFabClientModelDecoder::decodeGetTitleNewsResultResponse(response.responseData); + OnSuccessGetTitleNews.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Trading +////////////////////////////////////////////////////// +/** Accepts an open trade (one that has not yet been accepted or cancelled), if the locally signed-in player is in the allowed player list for the trade, or it is open to all players. If the call is successful, the offered and accepted items will be swapped between the two players' inventories. */ +UPlayFabClientAPI* UPlayFabClientAPI::AcceptTrade(FClientAcceptTradeRequest request, + FDelegateOnSuccessAcceptTrade onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAcceptTrade = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperAcceptTrade); + + // Setup the request + manager->PlayFabRequestURL = "/Client/AcceptTrade"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.AcceptedInventoryInstanceIds.IsEmpty() || request.AcceptedInventoryInstanceIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("AcceptedInventoryInstanceIds")); + } else { + TArray AcceptedInventoryInstanceIdsArray; + FString(request.AcceptedInventoryInstanceIds).ParseIntoArray(AcceptedInventoryInstanceIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("AcceptedInventoryInstanceIds"), AcceptedInventoryInstanceIdsArray); + } + if (request.OfferingPlayerId.IsEmpty() || request.OfferingPlayerId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OfferingPlayerId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OfferingPlayerId"), request.OfferingPlayerId); + } + if (request.TradeId.IsEmpty() || request.TradeId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TradeId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TradeId"), request.TradeId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperAcceptTrade(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAcceptTrade.IsBound()) + { + FClientAcceptTradeResponse result = UPlayFabClientModelDecoder::decodeAcceptTradeResponseResponse(response.responseData); + OnSuccessAcceptTrade.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Cancels an open trade (one that has not yet been accepted or cancelled). Note that only the player who created the trade can cancel it via this API call, to prevent griefing of the trade system (cancelling trades in order to prevent other players from accepting them, for trades that can be claimed by more than one player). */ +UPlayFabClientAPI* UPlayFabClientAPI::CancelTrade(FClientCancelTradeRequest request, + FDelegateOnSuccessCancelTrade onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCancelTrade = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperCancelTrade); + + // Setup the request + manager->PlayFabRequestURL = "/Client/CancelTrade"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.TradeId.IsEmpty() || request.TradeId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TradeId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TradeId"), request.TradeId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperCancelTrade(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCancelTrade.IsBound()) + { + FClientCancelTradeResponse result = UPlayFabClientModelDecoder::decodeCancelTradeResponseResponse(response.responseData); + OnSuccessCancelTrade.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets all trades the player has either opened or accepted, optionally filtered by trade status. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetPlayerTrades(FClientGetPlayerTradesRequest request, + FDelegateOnSuccessGetPlayerTrades onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerTrades = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetPlayerTrades); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetPlayerTrades"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + FString temp_StatusFilter; + if (GetEnumValueToString(TEXT("ETradeStatus"), request.StatusFilter, temp_StatusFilter)) + OutRestJsonObj->SetStringField(TEXT("StatusFilter"), temp_StatusFilter); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetPlayerTrades(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerTrades.IsBound()) + { + FClientGetPlayerTradesResponse result = UPlayFabClientModelDecoder::decodeGetPlayerTradesResponseResponse(response.responseData); + OnSuccessGetPlayerTrades.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets the current status of an existing trade. */ +UPlayFabClientAPI* UPlayFabClientAPI::GetTradeStatus(FClientGetTradeStatusRequest request, + FDelegateOnSuccessGetTradeStatus onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTradeStatus = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperGetTradeStatus); + + // Setup the request + manager->PlayFabRequestURL = "/Client/GetTradeStatus"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + if (request.OfferingPlayerId.IsEmpty() || request.OfferingPlayerId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OfferingPlayerId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OfferingPlayerId"), request.OfferingPlayerId); + } + if (request.TradeId.IsEmpty() || request.TradeId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TradeId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TradeId"), request.TradeId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperGetTradeStatus(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTradeStatus.IsBound()) + { + FClientGetTradeStatusResponse result = UPlayFabClientModelDecoder::decodeGetTradeStatusResponseResponse(response.responseData); + OnSuccessGetTradeStatus.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Opens a new outstanding trade. Note that a given item instance may only be in one open trade at a time. */ +UPlayFabClientAPI* UPlayFabClientAPI::OpenTrade(FClientOpenTradeRequest request, + FDelegateOnSuccessOpenTrade onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabClientAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessOpenTrade = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabClientAPI::HelperOpenTrade); + + // Setup the request + manager->PlayFabRequestURL = "/Client/OpenTrade"; + manager->useSessionTicket = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.AllowedPlayerIds.IsEmpty() || request.AllowedPlayerIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("AllowedPlayerIds")); + } else { + TArray AllowedPlayerIdsArray; + FString(request.AllowedPlayerIds).ParseIntoArray(AllowedPlayerIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("AllowedPlayerIds"), AllowedPlayerIdsArray); + } + // Check to see if string is empty + if (request.OfferedInventoryInstanceIds.IsEmpty() || request.OfferedInventoryInstanceIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("OfferedInventoryInstanceIds")); + } else { + TArray OfferedInventoryInstanceIdsArray; + FString(request.OfferedInventoryInstanceIds).ParseIntoArray(OfferedInventoryInstanceIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("OfferedInventoryInstanceIds"), OfferedInventoryInstanceIdsArray); + } + // Check to see if string is empty + if (request.RequestedCatalogItemIds.IsEmpty() || request.RequestedCatalogItemIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("RequestedCatalogItemIds")); + } else { + TArray RequestedCatalogItemIdsArray; + FString(request.RequestedCatalogItemIds).ParseIntoArray(RequestedCatalogItemIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("RequestedCatalogItemIds"), RequestedCatalogItemIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabClientRequestCompleted +void UPlayFabClientAPI::HelperOpenTrade(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessOpenTrade.IsBound()) + { + FClientOpenTradeResponse result = UPlayFabClientModelDecoder::decodeOpenTradeResponseResponse(response.responseData); + OnSuccessOpenTrade.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabClientAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsSessionTicket && !myResponse.responseError.hasError) + { + // Auth Tokens + auto response = myResponse.responseData->GetObjectField("data"); + pfSettings->setSessionTicket(response->GetStringField("SessionTicket")); + if (response->HasField("EntityToken")) + pfSettings->setEntityToken(response->GetObjectField("EntityToken")->GetStringField("EntityToken")); + + // IDFA Attribution when relevant + bool needsAttribution = myResponse.responseData->GetObjectField("data")->GetBoolField("SessionTicket"); + if (needsAttribution && !pfSettings->getDisableAdvertising() && !pfSettings->getAdvertisingIdType().IsEmpty() && !pfSettings->getAdvertisingIdValue().IsEmpty()) + { + FClientAttributeInstallRequest request; + bool makeAttrCall = true; + if (pfSettings->getAdvertisingIdType() == pfSettings->getAD_TYPE_IDFA()) + request.Idfa = pfSettings->getAdvertisingIdValue(); + else if (pfSettings->getAdvertisingIdType() == pfSettings->getAD_TYPE_ANDROID_ID()) + request.Adid = pfSettings->getAdvertisingIdValue(); + else + makeAttrCall = false; + if (makeAttrCall) + { + FDelegateOnSuccessAttributeInstall onSuccess; + FDelegateOnFailurePlayFabError onFailure; + UPlayFabClientAPI* callObj = AttributeInstall(request, onSuccess, onFailure, mCustomData); + callObj->Activate(); + } + } + } + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabClientAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabClientAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabClientModelDecoder.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabClientModelDecoder.cpp new file mode 100644 index 000000000..0ad0989d6 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabClientModelDecoder.cpp @@ -0,0 +1,1434 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Client +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabClientModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Client API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +FClientAddGenericIDResult UPlayFabClientModelDecoder::decodeAddGenericIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAddGenericIDResult tempStruct; + + + return tempStruct; +} + +FClientAddOrUpdateContactEmailResult UPlayFabClientModelDecoder::decodeAddOrUpdateContactEmailResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAddOrUpdateContactEmailResult tempStruct; + + + return tempStruct; +} + +FClientAddUsernamePasswordResult UPlayFabClientModelDecoder::decodeAddUsernamePasswordResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAddUsernamePasswordResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Username = !(dataObj->HasField("Username")) ? TEXT("") : dataObj->GetStringField("Username"); + + return tempStruct; +} + +FClientGetAccountInfoResult UPlayFabClientModelDecoder::decodeGetAccountInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetAccountInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.AccountInfo = !(dataObj->HasField("AccountInfo")) ? nullptr : dataObj->GetObjectField("AccountInfo"); + + return tempStruct; +} + +FClientGetPlayerCombinedInfoResult UPlayFabClientModelDecoder::decodeGetPlayerCombinedInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerCombinedInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.InfoResultPayload = !(dataObj->HasField("InfoResultPayload")) ? nullptr : dataObj->GetObjectField("InfoResultPayload"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FClientGetPlayerProfileResult UPlayFabClientModelDecoder::decodeGetPlayerProfileResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerProfileResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayerProfile = !(dataObj->HasField("PlayerProfile")) ? nullptr : dataObj->GetObjectField("PlayerProfile"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromFacebookIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromFacebookIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromFacebookIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromFacebookInstantGamesIdsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromFacebookInstantGamesIdsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromFacebookInstantGamesIdsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromGameCenterIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromGameCenterIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromGameCenterIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromGenericIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromGenericIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromGenericIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromGoogleIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromGoogleIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromGoogleIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromKongregateIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromKongregateIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromKongregateIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromNintendoSwitchDeviceIdsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromSteamIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromSteamIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromSteamIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientGetPlayFabIDsFromTwitchIDsResult UPlayFabClientModelDecoder::decodeGetPlayFabIDsFromTwitchIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayFabIDsFromTwitchIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FClientLinkAndroidDeviceIDResult UPlayFabClientModelDecoder::decodeLinkAndroidDeviceIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkAndroidDeviceIDResult tempStruct; + + + return tempStruct; +} + +FClientLinkCustomIDResult UPlayFabClientModelDecoder::decodeLinkCustomIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkCustomIDResult tempStruct; + + + return tempStruct; +} + +FClientLinkFacebookAccountResult UPlayFabClientModelDecoder::decodeLinkFacebookAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkFacebookAccountResult tempStruct; + + + return tempStruct; +} + +FClientLinkFacebookInstantGamesIdResult UPlayFabClientModelDecoder::decodeLinkFacebookInstantGamesIdResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkFacebookInstantGamesIdResult tempStruct; + + + return tempStruct; +} + +FClientLinkGameCenterAccountResult UPlayFabClientModelDecoder::decodeLinkGameCenterAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkGameCenterAccountResult tempStruct; + + + return tempStruct; +} + +FClientLinkGoogleAccountResult UPlayFabClientModelDecoder::decodeLinkGoogleAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkGoogleAccountResult tempStruct; + + + return tempStruct; +} + +FClientLinkIOSDeviceIDResult UPlayFabClientModelDecoder::decodeLinkIOSDeviceIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkIOSDeviceIDResult tempStruct; + + + return tempStruct; +} + +FClientLinkKongregateAccountResult UPlayFabClientModelDecoder::decodeLinkKongregateAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkKongregateAccountResult tempStruct; + + + return tempStruct; +} + +FClientLinkNintendoSwitchDeviceIdResult UPlayFabClientModelDecoder::decodeLinkNintendoSwitchDeviceIdResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkNintendoSwitchDeviceIdResult tempStruct; + + + return tempStruct; +} + +FClientLinkSteamAccountResult UPlayFabClientModelDecoder::decodeLinkSteamAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkSteamAccountResult tempStruct; + + + return tempStruct; +} + +FClientLinkTwitchAccountResult UPlayFabClientModelDecoder::decodeLinkTwitchAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkTwitchAccountResult tempStruct; + + + return tempStruct; +} + +FClientLinkWindowsHelloAccountResponse UPlayFabClientModelDecoder::decodeLinkWindowsHelloAccountResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkWindowsHelloAccountResponse tempStruct; + + + return tempStruct; +} + +FClientLinkXboxAccountResult UPlayFabClientModelDecoder::decodeLinkXboxAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLinkXboxAccountResult tempStruct; + + + return tempStruct; +} + +FClientRemoveContactEmailResult UPlayFabClientModelDecoder::decodeRemoveContactEmailResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRemoveContactEmailResult tempStruct; + + + return tempStruct; +} + +FClientRemoveGenericIDResult UPlayFabClientModelDecoder::decodeRemoveGenericIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRemoveGenericIDResult tempStruct; + + + return tempStruct; +} + +FClientReportPlayerClientResult UPlayFabClientModelDecoder::decodeReportPlayerClientResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientReportPlayerClientResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.SubmissionsRemaining = !(dataObj->HasField("SubmissionsRemaining")) ? 0 : int(dataObj->GetNumberField("SubmissionsRemaining")); + + return tempStruct; +} + +FClientSendAccountRecoveryEmailResult UPlayFabClientModelDecoder::decodeSendAccountRecoveryEmailResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientSendAccountRecoveryEmailResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkAndroidDeviceIDResult UPlayFabClientModelDecoder::decodeUnlinkAndroidDeviceIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkAndroidDeviceIDResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkCustomIDResult UPlayFabClientModelDecoder::decodeUnlinkCustomIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkCustomIDResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkFacebookAccountResult UPlayFabClientModelDecoder::decodeUnlinkFacebookAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkFacebookAccountResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkFacebookInstantGamesIdResult UPlayFabClientModelDecoder::decodeUnlinkFacebookInstantGamesIdResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkFacebookInstantGamesIdResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkGameCenterAccountResult UPlayFabClientModelDecoder::decodeUnlinkGameCenterAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkGameCenterAccountResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkGoogleAccountResult UPlayFabClientModelDecoder::decodeUnlinkGoogleAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkGoogleAccountResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkIOSDeviceIDResult UPlayFabClientModelDecoder::decodeUnlinkIOSDeviceIDResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkIOSDeviceIDResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkKongregateAccountResult UPlayFabClientModelDecoder::decodeUnlinkKongregateAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkKongregateAccountResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkNintendoSwitchDeviceIdResult UPlayFabClientModelDecoder::decodeUnlinkNintendoSwitchDeviceIdResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkNintendoSwitchDeviceIdResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkSteamAccountResult UPlayFabClientModelDecoder::decodeUnlinkSteamAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkSteamAccountResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkTwitchAccountResult UPlayFabClientModelDecoder::decodeUnlinkTwitchAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkTwitchAccountResult tempStruct; + + + return tempStruct; +} + +FClientUnlinkWindowsHelloAccountResponse UPlayFabClientModelDecoder::decodeUnlinkWindowsHelloAccountResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkWindowsHelloAccountResponse tempStruct; + + + return tempStruct; +} + +FClientUnlinkXboxAccountResult UPlayFabClientModelDecoder::decodeUnlinkXboxAccountResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlinkXboxAccountResult tempStruct; + + + return tempStruct; +} + +FClientEmptyResponse UPlayFabClientModelDecoder::decodeEmptyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientEmptyResponse tempStruct; + + + return tempStruct; +} + +FClientUpdateUserTitleDisplayNameResult UPlayFabClientModelDecoder::decodeUpdateUserTitleDisplayNameResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUpdateUserTitleDisplayNameResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DisplayName = !(dataObj->HasField("DisplayName")) ? TEXT("") : dataObj->GetStringField("DisplayName"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Advertising +////////////////////////////////////////////////////// + +FClientAttributeInstallResult UPlayFabClientModelDecoder::decodeAttributeInstallResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAttributeInstallResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Analytics +////////////////////////////////////////////////////// + +FClientWriteEventResponse UPlayFabClientModelDecoder::decodeWriteEventResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientWriteEventResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.EventId = !(dataObj->HasField("EventId")) ? TEXT("") : dataObj->GetStringField("EventId"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +FClientGetPhotonAuthenticationTokenResult UPlayFabClientModelDecoder::decodeGetPhotonAuthenticationTokenResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPhotonAuthenticationTokenResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PhotonCustomAuthenticationToken = !(dataObj->HasField("PhotonCustomAuthenticationToken")) ? TEXT("") : dataObj->GetStringField("PhotonCustomAuthenticationToken"); + + return tempStruct; +} + +FClientGetTitlePublicKeyResult UPlayFabClientModelDecoder::decodeGetTitlePublicKeyResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetTitlePublicKeyResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.RSAPublicKey = !(dataObj->HasField("RSAPublicKey")) ? TEXT("") : dataObj->GetStringField("RSAPublicKey"); + + return tempStruct; +} + +FClientGetWindowsHelloChallengeResponse UPlayFabClientModelDecoder::decodeGetWindowsHelloChallengeResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetWindowsHelloChallengeResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Challenge = !(dataObj->HasField("Challenge")) ? TEXT("") : dataObj->GetStringField("Challenge"); + + return tempStruct; +} + +FClientLoginResult UPlayFabClientModelDecoder::decodeLoginResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientLoginResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.EntityToken = !(dataObj->HasField("EntityToken")) ? nullptr : dataObj->GetObjectField("EntityToken"); + tempStruct.InfoResultPayload = !(dataObj->HasField("InfoResultPayload")) ? nullptr : dataObj->GetObjectField("InfoResultPayload"); + tempStruct.LastLoginTime = !(dataObj->HasField("LastLoginTime")) ? TEXT("") : dataObj->GetStringField("LastLoginTime"); + tempStruct.NewlyCreated = !(dataObj->HasField("NewlyCreated")) ? false : dataObj->GetBoolField("NewlyCreated"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.SessionTicket = !(dataObj->HasField("SessionTicket")) ? TEXT("") : dataObj->GetStringField("SessionTicket"); + tempStruct.SettingsForUser = !(dataObj->HasField("SettingsForUser")) ? nullptr : dataObj->GetObjectField("SettingsForUser"); + + return tempStruct; +} + +FClientRegisterPlayFabUserResult UPlayFabClientModelDecoder::decodeRegisterPlayFabUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRegisterPlayFabUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.EntityToken = !(dataObj->HasField("EntityToken")) ? nullptr : dataObj->GetObjectField("EntityToken"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.SessionTicket = !(dataObj->HasField("SessionTicket")) ? TEXT("") : dataObj->GetStringField("SessionTicket"); + tempStruct.SettingsForUser = !(dataObj->HasField("SettingsForUser")) ? nullptr : dataObj->GetObjectField("SettingsForUser"); + tempStruct.Username = !(dataObj->HasField("Username")) ? TEXT("") : dataObj->GetStringField("Username"); + + return tempStruct; +} + +FClientSetPlayerSecretResult UPlayFabClientModelDecoder::decodeSetPlayerSecretResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientSetPlayerSecretResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Character Data +////////////////////////////////////////////////////// + +FClientGetCharacterDataResult UPlayFabClientModelDecoder::decodeGetCharacterDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetCharacterDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + +FClientUpdateCharacterDataResult UPlayFabClientModelDecoder::decodeUpdateCharacterDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUpdateCharacterDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// + +FClientListUsersCharactersResult UPlayFabClientModelDecoder::decodeListUsersCharactersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientListUsersCharactersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Characters = !(dataObj->HasField("Characters")) ? TArray() : dataObj->GetObjectArrayField("Characters"); + + return tempStruct; +} + +FClientGetCharacterLeaderboardResult UPlayFabClientModelDecoder::decodeGetCharacterLeaderboardResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetCharacterLeaderboardResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + + return tempStruct; +} + +FClientGetCharacterStatisticsResult UPlayFabClientModelDecoder::decodeGetCharacterStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetCharacterStatisticsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterStatistics = !(dataObj->HasField("CharacterStatistics")) ? nullptr : dataObj->GetObjectField("CharacterStatistics"); + + return tempStruct; +} + +FClientGetLeaderboardAroundCharacterResult UPlayFabClientModelDecoder::decodeGetLeaderboardAroundCharacterResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetLeaderboardAroundCharacterResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + + return tempStruct; +} + +FClientGetLeaderboardForUsersCharactersResult UPlayFabClientModelDecoder::decodeGetLeaderboardForUsersCharactersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetLeaderboardForUsersCharactersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + + return tempStruct; +} + +FClientGrantCharacterToUserResult UPlayFabClientModelDecoder::decodeGrantCharacterToUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGrantCharacterToUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + tempStruct.CharacterType = !(dataObj->HasField("CharacterType")) ? TEXT("") : dataObj->GetStringField("CharacterType"); + tempStruct.Result = !(dataObj->HasField("Result")) ? false : dataObj->GetBoolField("Result"); + + return tempStruct; +} + +FClientUpdateCharacterStatisticsResult UPlayFabClientModelDecoder::decodeUpdateCharacterStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUpdateCharacterStatisticsResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// + +FClientGetContentDownloadUrlResult UPlayFabClientModelDecoder::decodeGetContentDownloadUrlResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetContentDownloadUrlResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.URL = !(dataObj->HasField("URL")) ? TEXT("") : dataObj->GetStringField("URL"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Friend List Management +////////////////////////////////////////////////////// + +FClientAddFriendResult UPlayFabClientModelDecoder::decodeAddFriendResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAddFriendResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Created = !(dataObj->HasField("Created")) ? false : dataObj->GetBoolField("Created"); + + return tempStruct; +} + +FClientGetFriendsListResult UPlayFabClientModelDecoder::decodeGetFriendsListResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetFriendsListResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Friends = !(dataObj->HasField("Friends")) ? TArray() : dataObj->GetObjectArrayField("Friends"); + + return tempStruct; +} + +FClientRemoveFriendResult UPlayFabClientModelDecoder::decodeRemoveFriendResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRemoveFriendResult tempStruct; + + + return tempStruct; +} + +FClientSetFriendTagsResult UPlayFabClientModelDecoder::decodeSetFriendTagsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientSetFriendTagsResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +FClientCurrentGamesResult UPlayFabClientModelDecoder::decodeCurrentGamesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientCurrentGamesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GameCount = !(dataObj->HasField("GameCount")) ? 0 : int(dataObj->GetNumberField("GameCount")); + tempStruct.Games = !(dataObj->HasField("Games")) ? TArray() : dataObj->GetObjectArrayField("Games"); + tempStruct.PlayerCount = !(dataObj->HasField("PlayerCount")) ? 0 : int(dataObj->GetNumberField("PlayerCount")); + + return tempStruct; +} + +FClientGameServerRegionsResult UPlayFabClientModelDecoder::decodeGameServerRegionsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGameServerRegionsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Regions = !(dataObj->HasField("Regions")) ? TArray() : dataObj->GetObjectArrayField("Regions"); + + return tempStruct; +} + +FClientMatchmakeResult UPlayFabClientModelDecoder::decodeMatchmakeResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientMatchmakeResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Expires = !(dataObj->HasField("Expires")) ? TEXT("") : dataObj->GetStringField("Expires"); + tempStruct.LobbyID = !(dataObj->HasField("LobbyID")) ? TEXT("") : dataObj->GetStringField("LobbyID"); + tempStruct.PollWaitTimeMS = !(dataObj->HasField("PollWaitTimeMS")) ? 0 : int(dataObj->GetNumberField("PollWaitTimeMS")); + tempStruct.ServerHostname = !(dataObj->HasField("ServerHostname")) ? TEXT("") : dataObj->GetStringField("ServerHostname"); + tempStruct.ServerIPV4Address = !(dataObj->HasField("ServerIPV4Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV4Address"); + tempStruct.ServerIPV6Address = !(dataObj->HasField("ServerIPV6Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV6Address"); + tempStruct.ServerPort = !(dataObj->HasField("ServerPort")) ? 0 : int(dataObj->GetNumberField("ServerPort")); + tempStruct.ServerPublicDNSName = !(dataObj->HasField("ServerPublicDNSName")) ? TEXT("") : dataObj->GetStringField("ServerPublicDNSName"); + GetEnumValueFromString(TEXT("EMatchmakeStatus"), dataObj->GetStringField("Status"), tempStruct.Status); + tempStruct.Ticket = !(dataObj->HasField("Ticket")) ? TEXT("") : dataObj->GetStringField("Ticket"); + + return tempStruct; +} + +FClientStartGameResult UPlayFabClientModelDecoder::decodeStartGameResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientStartGameResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Expires = !(dataObj->HasField("Expires")) ? TEXT("") : dataObj->GetStringField("Expires"); + tempStruct.LobbyID = !(dataObj->HasField("LobbyID")) ? TEXT("") : dataObj->GetStringField("LobbyID"); + tempStruct.Password = !(dataObj->HasField("Password")) ? TEXT("") : dataObj->GetStringField("Password"); + tempStruct.ServerHostname = !(dataObj->HasField("ServerHostname")) ? TEXT("") : dataObj->GetStringField("ServerHostname"); + tempStruct.ServerIPV4Address = !(dataObj->HasField("ServerIPV4Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV4Address"); + tempStruct.ServerIPV6Address = !(dataObj->HasField("ServerIPV6Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV6Address"); + tempStruct.ServerPort = !(dataObj->HasField("ServerPort")) ? 0 : int(dataObj->GetNumberField("ServerPort")); + tempStruct.ServerPublicDNSName = !(dataObj->HasField("ServerPublicDNSName")) ? TEXT("") : dataObj->GetStringField("ServerPublicDNSName"); + tempStruct.Ticket = !(dataObj->HasField("Ticket")) ? TEXT("") : dataObj->GetStringField("Ticket"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Platform Specific Methods +////////////////////////////////////////////////////// + +FClientAndroidDevicePushNotificationRegistrationResult UPlayFabClientModelDecoder::decodeAndroidDevicePushNotificationRegistrationResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAndroidDevicePushNotificationRegistrationResult tempStruct; + + + return tempStruct; +} + +FClientConsumeXboxEntitlementsResult UPlayFabClientModelDecoder::decodeConsumeXboxEntitlementsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientConsumeXboxEntitlementsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Items = !(dataObj->HasField("Items")) ? TArray() : dataObj->GetObjectArrayField("Items"); + + return tempStruct; +} + +FClientRegisterForIOSPushNotificationResult UPlayFabClientModelDecoder::decodeRegisterForIOSPushNotificationResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRegisterForIOSPushNotificationResult tempStruct; + + + return tempStruct; +} + +FClientRestoreIOSPurchasesResult UPlayFabClientModelDecoder::decodeRestoreIOSPurchasesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRestoreIOSPurchasesResult tempStruct; + + + return tempStruct; +} + +FClientValidateAmazonReceiptResult UPlayFabClientModelDecoder::decodeValidateAmazonReceiptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientValidateAmazonReceiptResult tempStruct; + + + return tempStruct; +} + +FClientValidateGooglePlayPurchaseResult UPlayFabClientModelDecoder::decodeValidateGooglePlayPurchaseResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientValidateGooglePlayPurchaseResult tempStruct; + + + return tempStruct; +} + +FClientValidateIOSReceiptResult UPlayFabClientModelDecoder::decodeValidateIOSReceiptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientValidateIOSReceiptResult tempStruct; + + + return tempStruct; +} + +FClientValidateWindowsReceiptResult UPlayFabClientModelDecoder::decodeValidateWindowsReceiptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientValidateWindowsReceiptResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// + +FClientGetLeaderboardResult UPlayFabClientModelDecoder::decodeGetLeaderboardResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetLeaderboardResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + tempStruct.NextReset = !(dataObj->HasField("NextReset")) ? TEXT("") : dataObj->GetStringField("NextReset"); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + +FClientGetFriendLeaderboardAroundPlayerResult UPlayFabClientModelDecoder::decodeGetFriendLeaderboardAroundPlayerResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetFriendLeaderboardAroundPlayerResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + tempStruct.NextReset = !(dataObj->HasField("NextReset")) ? TEXT("") : dataObj->GetStringField("NextReset"); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + +FClientGetLeaderboardAroundPlayerResult UPlayFabClientModelDecoder::decodeGetLeaderboardAroundPlayerResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetLeaderboardAroundPlayerResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + tempStruct.NextReset = !(dataObj->HasField("NextReset")) ? TEXT("") : dataObj->GetStringField("NextReset"); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + +FClientGetPlayerStatisticsResult UPlayFabClientModelDecoder::decodeGetPlayerStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerStatisticsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Statistics = !(dataObj->HasField("Statistics")) ? TArray() : dataObj->GetObjectArrayField("Statistics"); + + return tempStruct; +} + +FClientGetPlayerStatisticVersionsResult UPlayFabClientModelDecoder::decodeGetPlayerStatisticVersionsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerStatisticVersionsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.StatisticVersions = !(dataObj->HasField("StatisticVersions")) ? TArray() : dataObj->GetObjectArrayField("StatisticVersions"); + + return tempStruct; +} + +FClientGetUserDataResult UPlayFabClientModelDecoder::decodeGetUserDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetUserDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + +FClientUpdatePlayerStatisticsResult UPlayFabClientModelDecoder::decodeUpdatePlayerStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUpdatePlayerStatisticsResult tempStruct; + + + return tempStruct; +} + +FClientUpdateUserDataResult UPlayFabClientModelDecoder::decodeUpdateUserDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUpdateUserDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// + +FClientModifyUserVirtualCurrencyResult UPlayFabClientModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientModifyUserVirtualCurrencyResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Balance = !(dataObj->HasField("Balance")) ? 0 : int(dataObj->GetNumberField("Balance")); + tempStruct.BalanceChange = !(dataObj->HasField("BalanceChange")) ? 0 : int(dataObj->GetNumberField("BalanceChange")); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? TEXT("") : dataObj->GetStringField("VirtualCurrency"); + + return tempStruct; +} + +FClientConfirmPurchaseResult UPlayFabClientModelDecoder::decodeConfirmPurchaseResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientConfirmPurchaseResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Items = !(dataObj->HasField("Items")) ? TArray() : dataObj->GetObjectArrayField("Items"); + tempStruct.OrderId = !(dataObj->HasField("OrderId")) ? TEXT("") : dataObj->GetStringField("OrderId"); + tempStruct.PurchaseDate = !(dataObj->HasField("PurchaseDate")) ? TEXT("") : dataObj->GetStringField("PurchaseDate"); + + return tempStruct; +} + +FClientConsumeItemResult UPlayFabClientModelDecoder::decodeConsumeItemResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientConsumeItemResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemInstanceId = !(dataObj->HasField("ItemInstanceId")) ? TEXT("") : dataObj->GetStringField("ItemInstanceId"); + tempStruct.RemainingUses = !(dataObj->HasField("RemainingUses")) ? 0 : int(dataObj->GetNumberField("RemainingUses")); + + return tempStruct; +} + +FClientGetCharacterInventoryResult UPlayFabClientModelDecoder::decodeGetCharacterInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetCharacterInventoryResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + tempStruct.Inventory = !(dataObj->HasField("Inventory")) ? TArray() : dataObj->GetObjectArrayField("Inventory"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + tempStruct.VirtualCurrencyRechargeTimes = !(dataObj->HasField("VirtualCurrencyRechargeTimes")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyRechargeTimes"); + + return tempStruct; +} + +FClientGetPaymentTokenResult UPlayFabClientModelDecoder::decodeGetPaymentTokenResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPaymentTokenResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.OrderId = !(dataObj->HasField("OrderId")) ? TEXT("") : dataObj->GetStringField("OrderId"); + tempStruct.ProviderToken = !(dataObj->HasField("ProviderToken")) ? TEXT("") : dataObj->GetStringField("ProviderToken"); + + return tempStruct; +} + +FClientGetPurchaseResult UPlayFabClientModelDecoder::decodeGetPurchaseResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPurchaseResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.OrderId = !(dataObj->HasField("OrderId")) ? TEXT("") : dataObj->GetStringField("OrderId"); + tempStruct.PaymentProvider = !(dataObj->HasField("PaymentProvider")) ? TEXT("") : dataObj->GetStringField("PaymentProvider"); + tempStruct.PurchaseDate = !(dataObj->HasField("PurchaseDate")) ? TEXT("") : dataObj->GetStringField("PurchaseDate"); + tempStruct.TransactionId = !(dataObj->HasField("TransactionId")) ? TEXT("") : dataObj->GetStringField("TransactionId"); + tempStruct.TransactionStatus = !(dataObj->HasField("TransactionStatus")) ? TEXT("") : dataObj->GetStringField("TransactionStatus"); + + return tempStruct; +} + +FClientGetUserInventoryResult UPlayFabClientModelDecoder::decodeGetUserInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetUserInventoryResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Inventory = !(dataObj->HasField("Inventory")) ? TArray() : dataObj->GetObjectArrayField("Inventory"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + tempStruct.VirtualCurrencyRechargeTimes = !(dataObj->HasField("VirtualCurrencyRechargeTimes")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyRechargeTimes"); + + return tempStruct; +} + +FClientPayForPurchaseResult UPlayFabClientModelDecoder::decodePayForPurchaseResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientPayForPurchaseResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CreditApplied = !(dataObj->HasField("CreditApplied")) ? 0 : int(dataObj->GetNumberField("CreditApplied")); + tempStruct.OrderId = !(dataObj->HasField("OrderId")) ? TEXT("") : dataObj->GetStringField("OrderId"); + tempStruct.ProviderData = !(dataObj->HasField("ProviderData")) ? TEXT("") : dataObj->GetStringField("ProviderData"); + tempStruct.ProviderToken = !(dataObj->HasField("ProviderToken")) ? TEXT("") : dataObj->GetStringField("ProviderToken"); + tempStruct.PurchaseConfirmationPageURL = !(dataObj->HasField("PurchaseConfirmationPageURL")) ? TEXT("") : dataObj->GetStringField("PurchaseConfirmationPageURL"); + tempStruct.PurchaseCurrency = !(dataObj->HasField("PurchaseCurrency")) ? TEXT("") : dataObj->GetStringField("PurchaseCurrency"); + tempStruct.PurchasePrice = !(dataObj->HasField("PurchasePrice")) ? 0 : int(dataObj->GetNumberField("PurchasePrice")); + GetEnumValueFromString(TEXT("ETransactionStatus"), dataObj->GetStringField("Status"), tempStruct.Status); + tempStruct.VCAmount = !(dataObj->HasField("VCAmount")) ? nullptr : dataObj->GetObjectField("VCAmount"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + + return tempStruct; +} + +FClientPurchaseItemResult UPlayFabClientModelDecoder::decodePurchaseItemResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientPurchaseItemResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Items = !(dataObj->HasField("Items")) ? TArray() : dataObj->GetObjectArrayField("Items"); + + return tempStruct; +} + +FClientRedeemCouponResult UPlayFabClientModelDecoder::decodeRedeemCouponResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRedeemCouponResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GrantedItems = !(dataObj->HasField("GrantedItems")) ? TArray() : dataObj->GetObjectArrayField("GrantedItems"); + + return tempStruct; +} + +FClientStartPurchaseResult UPlayFabClientModelDecoder::decodeStartPurchaseResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientStartPurchaseResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Contents = !(dataObj->HasField("Contents")) ? TArray() : dataObj->GetObjectArrayField("Contents"); + tempStruct.OrderId = !(dataObj->HasField("OrderId")) ? TEXT("") : dataObj->GetStringField("OrderId"); + tempStruct.PaymentOptions = !(dataObj->HasField("PaymentOptions")) ? TArray() : dataObj->GetObjectArrayField("PaymentOptions"); + tempStruct.VirtualCurrencyBalances = !(dataObj->HasField("VirtualCurrencyBalances")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyBalances"); + + return tempStruct; +} + +FClientUnlockContainerItemResult UPlayFabClientModelDecoder::decodeUnlockContainerItemResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUnlockContainerItemResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GrantedItems = !(dataObj->HasField("GrantedItems")) ? TArray() : dataObj->GetObjectArrayField("GrantedItems"); + tempStruct.UnlockedItemInstanceId = !(dataObj->HasField("UnlockedItemInstanceId")) ? TEXT("") : dataObj->GetStringField("UnlockedItemInstanceId"); + tempStruct.UnlockedWithItemInstanceId = !(dataObj->HasField("UnlockedWithItemInstanceId")) ? TEXT("") : dataObj->GetStringField("UnlockedWithItemInstanceId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// + +FClientGetPlayerSegmentsResult UPlayFabClientModelDecoder::decodeGetPlayerSegmentsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerSegmentsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Segments = !(dataObj->HasField("Segments")) ? TArray() : dataObj->GetObjectArrayField("Segments"); + + return tempStruct; +} + +FClientGetPlayerTagsResult UPlayFabClientModelDecoder::decodeGetPlayerTagsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerTagsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.Tags = !(dataObj->HasField("Tags")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("Tags"), TEXT(",")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +FClientExecuteCloudScriptResult UPlayFabClientModelDecoder::decodeExecuteCloudScriptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientExecuteCloudScriptResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.APIRequestsIssued = !(dataObj->HasField("APIRequestsIssued")) ? 0 : int(dataObj->GetNumberField("APIRequestsIssued")); + tempStruct.Error = !(dataObj->HasField("Error")) ? nullptr : dataObj->GetObjectField("Error"); + tempStruct.ExecutionTimeSeconds = !(dataObj->HasField("ExecutionTimeSeconds")) ? 0 : int(dataObj->GetNumberField("ExecutionTimeSeconds")); + tempStruct.FunctionName = !(dataObj->HasField("FunctionName")) ? TEXT("") : dataObj->GetStringField("FunctionName"); + tempStruct.FunctionResult = !(dataObj->HasField("FunctionResult")) ? nullptr : dataObj->GetObjectField("FunctionResult"); + tempStruct.FunctionResultTooLarge = !(dataObj->HasField("FunctionResultTooLarge")) ? false : dataObj->GetBoolField("FunctionResultTooLarge"); + tempStruct.HttpRequestsIssued = !(dataObj->HasField("HttpRequestsIssued")) ? 0 : int(dataObj->GetNumberField("HttpRequestsIssued")); + tempStruct.Logs = !(dataObj->HasField("Logs")) ? TArray() : dataObj->GetObjectArrayField("Logs"); + tempStruct.LogsTooLarge = !(dataObj->HasField("LogsTooLarge")) ? false : dataObj->GetBoolField("LogsTooLarge"); + tempStruct.MemoryConsumedBytes = !(dataObj->HasField("MemoryConsumedBytes")) ? 0 : int(dataObj->GetNumberField("MemoryConsumedBytes")); + tempStruct.ProcessorTimeSeconds = !(dataObj->HasField("ProcessorTimeSeconds")) ? 0 : int(dataObj->GetNumberField("ProcessorTimeSeconds")); + tempStruct.Revision = !(dataObj->HasField("Revision")) ? 0 : int(dataObj->GetNumberField("Revision")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// + +FClientAddSharedGroupMembersResult UPlayFabClientModelDecoder::decodeAddSharedGroupMembersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAddSharedGroupMembersResult tempStruct; + + + return tempStruct; +} + +FClientCreateSharedGroupResult UPlayFabClientModelDecoder::decodeCreateSharedGroupResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientCreateSharedGroupResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.SharedGroupId = !(dataObj->HasField("SharedGroupId")) ? TEXT("") : dataObj->GetStringField("SharedGroupId"); + + return tempStruct; +} + +FClientGetSharedGroupDataResult UPlayFabClientModelDecoder::decodeGetSharedGroupDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetSharedGroupDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.Members = !(dataObj->HasField("Members")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("Members"), TEXT(",")); + + return tempStruct; +} + +FClientRemoveSharedGroupMembersResult UPlayFabClientModelDecoder::decodeRemoveSharedGroupMembersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientRemoveSharedGroupMembersResult tempStruct; + + + return tempStruct; +} + +FClientUpdateSharedGroupDataResult UPlayFabClientModelDecoder::decodeUpdateSharedGroupDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientUpdateSharedGroupDataResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// + +FClientGetCatalogItemsResult UPlayFabClientModelDecoder::decodeGetCatalogItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetCatalogItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Catalog = !(dataObj->HasField("Catalog")) ? TArray() : dataObj->GetObjectArrayField("Catalog"); + + return tempStruct; +} + +FClientGetPublisherDataResult UPlayFabClientModelDecoder::decodeGetPublisherDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPublisherDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + + return tempStruct; +} + +FClientGetStoreItemsResult UPlayFabClientModelDecoder::decodeGetStoreItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetStoreItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CatalogVersion = !(dataObj->HasField("CatalogVersion")) ? TEXT("") : dataObj->GetStringField("CatalogVersion"); + tempStruct.MarketingData = !(dataObj->HasField("MarketingData")) ? nullptr : dataObj->GetObjectField("MarketingData"); + GetEnumValueFromString(TEXT("EPfSourceType"), dataObj->GetStringField("Source"), tempStruct.Source); + tempStruct.Store = !(dataObj->HasField("Store")) ? TArray() : dataObj->GetObjectArrayField("Store"); + tempStruct.StoreId = !(dataObj->HasField("StoreId")) ? TEXT("") : dataObj->GetStringField("StoreId"); + + return tempStruct; +} + +FClientGetTimeResult UPlayFabClientModelDecoder::decodeGetTimeResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetTimeResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Time = !(dataObj->HasField("Time")) ? TEXT("") : dataObj->GetStringField("Time"); + + return tempStruct; +} + +FClientGetTitleDataResult UPlayFabClientModelDecoder::decodeGetTitleDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetTitleDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + + return tempStruct; +} + +FClientGetTitleNewsResult UPlayFabClientModelDecoder::decodeGetTitleNewsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetTitleNewsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.News = !(dataObj->HasField("News")) ? TArray() : dataObj->GetObjectArrayField("News"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Trading +////////////////////////////////////////////////////// + +FClientAcceptTradeResponse UPlayFabClientModelDecoder::decodeAcceptTradeResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientAcceptTradeResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Trade = !(dataObj->HasField("Trade")) ? nullptr : dataObj->GetObjectField("Trade"); + + return tempStruct; +} + +FClientCancelTradeResponse UPlayFabClientModelDecoder::decodeCancelTradeResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientCancelTradeResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Trade = !(dataObj->HasField("Trade")) ? nullptr : dataObj->GetObjectField("Trade"); + + return tempStruct; +} + +FClientGetPlayerTradesResponse UPlayFabClientModelDecoder::decodeGetPlayerTradesResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetPlayerTradesResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.AcceptedTrades = !(dataObj->HasField("AcceptedTrades")) ? TArray() : dataObj->GetObjectArrayField("AcceptedTrades"); + tempStruct.OpenedTrades = !(dataObj->HasField("OpenedTrades")) ? TArray() : dataObj->GetObjectArrayField("OpenedTrades"); + + return tempStruct; +} + +FClientGetTradeStatusResponse UPlayFabClientModelDecoder::decodeGetTradeStatusResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientGetTradeStatusResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Trade = !(dataObj->HasField("Trade")) ? nullptr : dataObj->GetObjectField("Trade"); + + return tempStruct; +} + +FClientOpenTradeResponse UPlayFabClientModelDecoder::decodeOpenTradeResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FClientOpenTradeResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Trade = !(dataObj->HasField("Trade")) ? nullptr : dataObj->GetObjectField("Trade"); + + return tempStruct; +} + + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabClientModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabClientModels.cpp new file mode 100644 index 000000000..18f32c944 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabClientModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Client +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabClientModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptAPI.cpp new file mode 100644 index 000000000..1dec889be --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptAPI.cpp @@ -0,0 +1,247 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: CloudScript +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabCloudScriptAPI.h" +#include "PlayFabCloudScriptModels.h" +#include "PlayFabCloudScriptModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabCloudScriptAPI::UPlayFabCloudScriptAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabCloudScriptAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabCloudScriptAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabCloudScriptAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab CloudScript API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// +/** Cloud Script is one of PlayFab's most versatile features. It allows client code to request execution of any kind of custom server-side functionality you can implement, and it can be used in conjunction with virtually anything. */ +UPlayFabCloudScriptAPI* UPlayFabCloudScriptAPI::ExecuteEntityCloudScript(FCloudScriptExecuteEntityCloudScriptRequest request, + FDelegateOnSuccessExecuteEntityCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabCloudScriptAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessExecuteEntityCloudScript = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabCloudScriptAPI::HelperExecuteEntityCloudScript); + + // Setup the request + manager->PlayFabRequestURL = "/CloudScript/ExecuteEntityCloudScript"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.FunctionName.IsEmpty() || request.FunctionName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FunctionName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FunctionName"), request.FunctionName); + } + if (request.FunctionParameter != nullptr) OutRestJsonObj->SetObjectField(TEXT("FunctionParameter"), request.FunctionParameter); + OutRestJsonObj->SetBoolField(TEXT("GeneratePlayStreamEvent"), request.GeneratePlayStreamEvent); + FString temp_RevisionSelection; + if (GetEnumValueToString(TEXT("ECloudScriptRevisionOption"), request.RevisionSelection, temp_RevisionSelection)) + OutRestJsonObj->SetStringField(TEXT("RevisionSelection"), temp_RevisionSelection); + OutRestJsonObj->SetNumberField(TEXT("SpecificRevision"), request.SpecificRevision); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabCloudScriptRequestCompleted +void UPlayFabCloudScriptAPI::HelperExecuteEntityCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessExecuteEntityCloudScript.IsBound()) + { + FCloudScriptExecuteCloudScriptResult result = UPlayFabCloudScriptModelDecoder::decodeExecuteCloudScriptResultResponse(response.responseData); + OnSuccessExecuteEntityCloudScript.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabCloudScriptAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabCloudScriptAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabCloudScriptAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabCloudScriptAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptModelDecoder.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptModelDecoder.cpp new file mode 100644 index 000000000..c97fe86d6 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptModelDecoder.cpp @@ -0,0 +1,46 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: CloudScript +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabCloudScriptModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab CloudScript API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +FCloudScriptExecuteCloudScriptResult UPlayFabCloudScriptModelDecoder::decodeExecuteCloudScriptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FCloudScriptExecuteCloudScriptResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.APIRequestsIssued = !(dataObj->HasField("APIRequestsIssued")) ? 0 : int(dataObj->GetNumberField("APIRequestsIssued")); + tempStruct.Error = !(dataObj->HasField("Error")) ? nullptr : dataObj->GetObjectField("Error"); + tempStruct.ExecutionTimeSeconds = !(dataObj->HasField("ExecutionTimeSeconds")) ? 0 : int(dataObj->GetNumberField("ExecutionTimeSeconds")); + tempStruct.FunctionName = !(dataObj->HasField("FunctionName")) ? TEXT("") : dataObj->GetStringField("FunctionName"); + tempStruct.FunctionResult = !(dataObj->HasField("FunctionResult")) ? nullptr : dataObj->GetObjectField("FunctionResult"); + tempStruct.FunctionResultTooLarge = !(dataObj->HasField("FunctionResultTooLarge")) ? false : dataObj->GetBoolField("FunctionResultTooLarge"); + tempStruct.HttpRequestsIssued = !(dataObj->HasField("HttpRequestsIssued")) ? 0 : int(dataObj->GetNumberField("HttpRequestsIssued")); + tempStruct.Logs = !(dataObj->HasField("Logs")) ? TArray() : dataObj->GetObjectArrayField("Logs"); + tempStruct.LogsTooLarge = !(dataObj->HasField("LogsTooLarge")) ? false : dataObj->GetBoolField("LogsTooLarge"); + tempStruct.MemoryConsumedBytes = !(dataObj->HasField("MemoryConsumedBytes")) ? 0 : int(dataObj->GetNumberField("MemoryConsumedBytes")); + tempStruct.ProcessorTimeSeconds = !(dataObj->HasField("ProcessorTimeSeconds")) ? 0 : int(dataObj->GetNumberField("ProcessorTimeSeconds")); + tempStruct.Revision = !(dataObj->HasField("Revision")) ? 0 : int(dataObj->GetNumberField("Revision")); + + return tempStruct; +} + + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptModels.cpp new file mode 100644 index 000000000..34034c003 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabCloudScriptModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: CloudScript +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabCloudScriptModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabDataAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabDataAPI.cpp new file mode 100644 index 000000000..16310fd05 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabDataAPI.cpp @@ -0,0 +1,558 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Data +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabDataAPI.h" +#include "PlayFabDataModels.h" +#include "PlayFabDataModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabDataAPI::UPlayFabDataAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabDataAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabDataAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabDataAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Data API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// File +////////////////////////////////////////////////////// +/** Abort pending file uploads to an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::AbortFileUploads(FDataAbortFileUploadsRequest request, + FDelegateOnSuccessAbortFileUploads onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAbortFileUploads = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperAbortFileUploads); + + // Setup the request + manager->PlayFabRequestURL = "/File/AbortFileUploads"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + // Check to see if string is empty + if (request.FileNames.IsEmpty() || request.FileNames == "") { + OutRestJsonObj->SetFieldNull(TEXT("FileNames")); + } else { + TArray FileNamesArray; + FString(request.FileNames).ParseIntoArray(FileNamesArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FileNames"), FileNamesArray); + } + OutRestJsonObj->SetNumberField(TEXT("ProfileVersion"), request.ProfileVersion); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperAbortFileUploads(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAbortFileUploads.IsBound()) + { + FDataAbortFileUploadsResponse result = UPlayFabDataModelDecoder::decodeAbortFileUploadsResponseResponse(response.responseData); + OnSuccessAbortFileUploads.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Delete files on an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::DeleteFiles(FDataDeleteFilesRequest request, + FDelegateOnSuccessDeleteFiles onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteFiles = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperDeleteFiles); + + // Setup the request + manager->PlayFabRequestURL = "/File/DeleteFiles"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + // Check to see if string is empty + if (request.FileNames.IsEmpty() || request.FileNames == "") { + OutRestJsonObj->SetFieldNull(TEXT("FileNames")); + } else { + TArray FileNamesArray; + FString(request.FileNames).ParseIntoArray(FileNamesArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FileNames"), FileNamesArray); + } + OutRestJsonObj->SetNumberField(TEXT("ProfileVersion"), request.ProfileVersion); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperDeleteFiles(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteFiles.IsBound()) + { + FDataDeleteFilesResponse result = UPlayFabDataModelDecoder::decodeDeleteFilesResponseResponse(response.responseData); + OnSuccessDeleteFiles.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Finalize file uploads to an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::FinalizeFileUploads(FDataFinalizeFileUploadsRequest request, + FDelegateOnSuccessFinalizeFileUploads onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessFinalizeFileUploads = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperFinalizeFileUploads); + + // Setup the request + manager->PlayFabRequestURL = "/File/FinalizeFileUploads"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + // Check to see if string is empty + if (request.FileNames.IsEmpty() || request.FileNames == "") { + OutRestJsonObj->SetFieldNull(TEXT("FileNames")); + } else { + TArray FileNamesArray; + FString(request.FileNames).ParseIntoArray(FileNamesArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FileNames"), FileNamesArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperFinalizeFileUploads(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessFinalizeFileUploads.IsBound()) + { + FDataFinalizeFileUploadsResponse result = UPlayFabDataModelDecoder::decodeFinalizeFileUploadsResponseResponse(response.responseData); + OnSuccessFinalizeFileUploads.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves file metadata from an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::GetFiles(FDataGetFilesRequest request, + FDelegateOnSuccessGetFiles onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetFiles = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperGetFiles); + + // Setup the request + manager->PlayFabRequestURL = "/File/GetFiles"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperGetFiles(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetFiles.IsBound()) + { + FDataGetFilesResponse result = UPlayFabDataModelDecoder::decodeGetFilesResponseResponse(response.responseData); + OnSuccessGetFiles.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Initiates file uploads to an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::InitiateFileUploads(FDataInitiateFileUploadsRequest request, + FDelegateOnSuccessInitiateFileUploads onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessInitiateFileUploads = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperInitiateFileUploads); + + // Setup the request + manager->PlayFabRequestURL = "/File/InitiateFileUploads"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + // Check to see if string is empty + if (request.FileNames.IsEmpty() || request.FileNames == "") { + OutRestJsonObj->SetFieldNull(TEXT("FileNames")); + } else { + TArray FileNamesArray; + FString(request.FileNames).ParseIntoArray(FileNamesArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FileNames"), FileNamesArray); + } + OutRestJsonObj->SetNumberField(TEXT("ProfileVersion"), request.ProfileVersion); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperInitiateFileUploads(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessInitiateFileUploads.IsBound()) + { + FDataInitiateFileUploadsResponse result = UPlayFabDataModelDecoder::decodeInitiateFileUploadsResponseResponse(response.responseData); + OnSuccessInitiateFileUploads.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Object +////////////////////////////////////////////////////// +/** Retrieves objects from an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::GetObjects(FDataGetObjectsRequest request, + FDelegateOnSuccessGetObjects onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetObjects = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperGetObjects); + + // Setup the request + manager->PlayFabRequestURL = "/Object/GetObjects"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + OutRestJsonObj->SetBoolField(TEXT("EscapeObject"), request.EscapeObject); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperGetObjects(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetObjects.IsBound()) + { + FDataGetObjectsResponse result = UPlayFabDataModelDecoder::decodeGetObjectsResponseResponse(response.responseData); + OnSuccessGetObjects.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets objects on an entity's profile. */ +UPlayFabDataAPI* UPlayFabDataAPI::SetObjects(FDataSetObjectsRequest request, + FDelegateOnSuccessSetObjects onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabDataAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetObjects = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabDataAPI::HelperSetObjects); + + // Setup the request + manager->PlayFabRequestURL = "/Object/SetObjects"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + OutRestJsonObj->SetNumberField(TEXT("ExpectedProfileVersion"), request.ExpectedProfileVersion); + if (request.Objects.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Objects")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Objects"), request.Objects); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabDataRequestCompleted +void UPlayFabDataAPI::HelperSetObjects(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetObjects.IsBound()) + { + FDataSetObjectsResponse result = UPlayFabDataModelDecoder::decodeSetObjectsResponseResponse(response.responseData); + OnSuccessSetObjects.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabDataAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabDataAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabDataAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabDataModelDecoder.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabDataModelDecoder.cpp new file mode 100644 index 000000000..3d698daee --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabDataModelDecoder.cpp @@ -0,0 +1,118 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Data +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabDataModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Data API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// File +////////////////////////////////////////////////////// + +FDataAbortFileUploadsResponse UPlayFabDataModelDecoder::decodeAbortFileUploadsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataAbortFileUploadsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + + return tempStruct; +} + +FDataDeleteFilesResponse UPlayFabDataModelDecoder::decodeDeleteFilesResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataDeleteFilesResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + + return tempStruct; +} + +FDataFinalizeFileUploadsResponse UPlayFabDataModelDecoder::decodeFinalizeFileUploadsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataFinalizeFileUploadsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.Metadata = !(dataObj->HasField("Metadata")) ? nullptr : dataObj->GetObjectField("Metadata"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + + return tempStruct; +} + +FDataGetFilesResponse UPlayFabDataModelDecoder::decodeGetFilesResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataGetFilesResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.Metadata = !(dataObj->HasField("Metadata")) ? nullptr : dataObj->GetObjectField("Metadata"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + + return tempStruct; +} + +FDataInitiateFileUploadsResponse UPlayFabDataModelDecoder::decodeInitiateFileUploadsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataInitiateFileUploadsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + tempStruct.UploadDetails = !(dataObj->HasField("UploadDetails")) ? TArray() : dataObj->GetObjectArrayField("UploadDetails"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Object +////////////////////////////////////////////////////// + +FDataGetObjectsResponse UPlayFabDataModelDecoder::decodeGetObjectsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataGetObjectsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.Objects = !(dataObj->HasField("Objects")) ? nullptr : dataObj->GetObjectField("Objects"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + + return tempStruct; +} + +FDataSetObjectsResponse UPlayFabDataModelDecoder::decodeSetObjectsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FDataSetObjectsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + tempStruct.SetResults = !(dataObj->HasField("SetResults")) ? TArray() : dataObj->GetObjectArrayField("SetResults"); + + return tempStruct; +} + + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabDataModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabDataModels.cpp new file mode 100644 index 000000000..ac6a72388 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabDataModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Data +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabDataModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabEventsAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabEventsAPI.cpp new file mode 100644 index 000000000..f6d950a0a --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabEventsAPI.cpp @@ -0,0 +1,240 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Events +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabEventsAPI.h" +#include "PlayFabEventsModels.h" +#include "PlayFabEventsModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabEventsAPI::UPlayFabEventsAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabEventsAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabEventsAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabEventsAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Events API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// PlayStream Events +////////////////////////////////////////////////////// +/** Write batches of entity based events to PlayStream. */ +UPlayFabEventsAPI* UPlayFabEventsAPI::WriteEvents(FEventsWriteEventsRequest request, + FDelegateOnSuccessWriteEvents onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabEventsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWriteEvents = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabEventsAPI::HelperWriteEvents); + + // Setup the request + manager->PlayFabRequestURL = "/Event/WriteEvents"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Events.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Events")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Events"), request.Events); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabEventsRequestCompleted +void UPlayFabEventsAPI::HelperWriteEvents(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWriteEvents.IsBound()) + { + FEventsWriteEventsResponse result = UPlayFabEventsModelDecoder::decodeWriteEventsResponseResponse(response.responseData); + OnSuccessWriteEvents.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabEventsAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabEventsAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabEventsAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabEventsAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabEventsModelDecoder.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabEventsModelDecoder.cpp new file mode 100644 index 000000000..02bdf7f21 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabEventsModelDecoder.cpp @@ -0,0 +1,35 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Events +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabEventsModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Events API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// PlayStream Events +////////////////////////////////////////////////////// + +FEventsWriteEventsResponse UPlayFabEventsModelDecoder::decodeWriteEventsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FEventsWriteEventsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.AssignedEventIds = !(dataObj->HasField("AssignedEventIds")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("AssignedEventIds"), TEXT(",")); + + return tempStruct; +} + + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabEventsModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabEventsModels.cpp new file mode 100644 index 000000000..bdc11df91 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabEventsModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Events +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabEventsModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabGroupsAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabGroupsAPI.cpp new file mode 100644 index 000000000..49086353a --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabGroupsAPI.cpp @@ -0,0 +1,1448 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Groups +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabGroupsAPI.h" +#include "PlayFabGroupsModels.h" +#include "PlayFabGroupsModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabGroupsAPI::UPlayFabGroupsAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabGroupsAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabGroupsAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabGroupsAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Groups API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Groups +////////////////////////////////////////////////////// +/** Accepts an outstanding invitation to to join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::AcceptGroupApplication(FGroupsAcceptGroupApplicationRequest request, + FDelegateOnSuccessAcceptGroupApplication onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAcceptGroupApplication = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperAcceptGroupApplication); + + // Setup the request + manager->PlayFabRequestURL = "/Group/AcceptGroupApplication"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperAcceptGroupApplication(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAcceptGroupApplication.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessAcceptGroupApplication.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Accepts an invitation to join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::AcceptGroupInvitation(FGroupsAcceptGroupInvitationRequest request, + FDelegateOnSuccessAcceptGroupInvitation onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAcceptGroupInvitation = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperAcceptGroupInvitation); + + // Setup the request + manager->PlayFabRequestURL = "/Group/AcceptGroupInvitation"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperAcceptGroupInvitation(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAcceptGroupInvitation.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessAcceptGroupInvitation.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds members to a group or role. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::AddMembers(FGroupsAddMembersRequest request, + FDelegateOnSuccessAddMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperAddMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Group/AddMembers"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.Members.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Members")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Members"), request.Members); + } + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperAddMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddMembers.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessAddMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Applies to join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ApplyToGroup(FGroupsApplyToGroupRequest request, + FDelegateOnSuccessApplyToGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessApplyToGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperApplyToGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ApplyToGroup"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("AutoAcceptOutstandingInvite"), request.AutoAcceptOutstandingInvite); + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperApplyToGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessApplyToGroup.IsBound()) + { + FGroupsApplyToGroupResponse result = UPlayFabGroupsModelDecoder::decodeApplyToGroupResponseResponse(response.responseData); + OnSuccessApplyToGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Blocks a list of entities from joining a group. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::BlockEntity(FGroupsBlockEntityRequest request, + FDelegateOnSuccessBlockEntity onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessBlockEntity = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperBlockEntity); + + // Setup the request + manager->PlayFabRequestURL = "/Group/BlockEntity"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperBlockEntity(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessBlockEntity.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessBlockEntity.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Changes the role membership of a list of entities from one role to another. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ChangeMemberRole(FGroupsChangeMemberRoleRequest request, + FDelegateOnSuccessChangeMemberRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessChangeMemberRole = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperChangeMemberRole); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ChangeMemberRole"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.DestinationRoleId.IsEmpty() || request.DestinationRoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("DestinationRoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("DestinationRoleId"), request.DestinationRoleId); + } + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.Members.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Members")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Members"), request.Members); + } + if (request.OriginRoleId.IsEmpty() || request.OriginRoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("OriginRoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("OriginRoleId"), request.OriginRoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperChangeMemberRole(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessChangeMemberRole.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessChangeMemberRole.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates a new group. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::CreateGroup(FGroupsCreateGroupRequest request, + FDelegateOnSuccessCreateGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreateGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperCreateGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Group/CreateGroup"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.GroupName.IsEmpty() || request.GroupName == "") { + OutRestJsonObj->SetFieldNull(TEXT("GroupName")); + } else { + OutRestJsonObj->SetStringField(TEXT("GroupName"), request.GroupName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperCreateGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreateGroup.IsBound()) + { + FGroupsCreateGroupResponse result = UPlayFabGroupsModelDecoder::decodeCreateGroupResponseResponse(response.responseData); + OnSuccessCreateGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Creates a new group role. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::CreateRole(FGroupsCreateGroupRoleRequest request, + FDelegateOnSuccessCreateRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreateRole = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperCreateRole); + + // Setup the request + manager->PlayFabRequestURL = "/Group/CreateRole"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + if (request.RoleName.IsEmpty() || request.RoleName == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleName")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleName"), request.RoleName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperCreateRole(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreateRole.IsBound()) + { + FGroupsCreateGroupRoleResponse result = UPlayFabGroupsModelDecoder::decodeCreateGroupRoleResponseResponse(response.responseData); + OnSuccessCreateRole.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Deletes a group and all roles, invitations, join requests, and blocks associated with it. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::DeleteGroup(FGroupsDeleteGroupRequest request, + FDelegateOnSuccessDeleteGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperDeleteGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Group/DeleteGroup"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperDeleteGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteGroup.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessDeleteGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Deletes an existing role in a group. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::DeleteRole(FGroupsDeleteRoleRequest request, + FDelegateOnSuccessDeleteRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteRole = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperDeleteRole); + + // Setup the request + manager->PlayFabRequestURL = "/Group/DeleteRole"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperDeleteRole(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteRole.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessDeleteRole.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets information about a group and its roles */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::GetGroup(FGroupsGetGroupRequest request, + FDelegateOnSuccessGetGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperGetGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Group/GetGroup"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.GroupName.IsEmpty() || request.GroupName == "") { + OutRestJsonObj->SetFieldNull(TEXT("GroupName")); + } else { + OutRestJsonObj->SetStringField(TEXT("GroupName"), request.GroupName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperGetGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetGroup.IsBound()) + { + FGroupsGetGroupResponse result = UPlayFabGroupsModelDecoder::decodeGetGroupResponseResponse(response.responseData); + OnSuccessGetGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Invites a player to join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::InviteToGroup(FGroupsInviteToGroupRequest request, + FDelegateOnSuccessInviteToGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessInviteToGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperInviteToGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Group/InviteToGroup"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("AutoAcceptOutstandingApplication"), request.AutoAcceptOutstandingApplication); + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperInviteToGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessInviteToGroup.IsBound()) + { + FGroupsInviteToGroupResponse result = UPlayFabGroupsModelDecoder::decodeInviteToGroupResponseResponse(response.responseData); + OnSuccessInviteToGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Checks to see if an entity is a member of a group or role within the group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::IsMember(FGroupsIsMemberRequest request, + FDelegateOnSuccessIsMember onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessIsMember = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperIsMember); + + // Setup the request + manager->PlayFabRequestURL = "/Group/IsMember"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperIsMember(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessIsMember.IsBound()) + { + FGroupsIsMemberResponse result = UPlayFabGroupsModelDecoder::decodeIsMemberResponseResponse(response.responseData); + OnSuccessIsMember.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all outstanding requests to join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ListGroupApplications(FGroupsListGroupApplicationsRequest request, + FDelegateOnSuccessListGroupApplications onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListGroupApplications = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperListGroupApplications); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ListGroupApplications"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperListGroupApplications(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListGroupApplications.IsBound()) + { + FGroupsListGroupApplicationsResponse result = UPlayFabGroupsModelDecoder::decodeListGroupApplicationsResponseResponse(response.responseData); + OnSuccessListGroupApplications.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all entities blocked from joining a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ListGroupBlocks(FGroupsListGroupBlocksRequest request, + FDelegateOnSuccessListGroupBlocks onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListGroupBlocks = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperListGroupBlocks); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ListGroupBlocks"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperListGroupBlocks(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListGroupBlocks.IsBound()) + { + FGroupsListGroupBlocksResponse result = UPlayFabGroupsModelDecoder::decodeListGroupBlocksResponseResponse(response.responseData); + OnSuccessListGroupBlocks.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all outstanding invitations for a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ListGroupInvitations(FGroupsListGroupInvitationsRequest request, + FDelegateOnSuccessListGroupInvitations onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListGroupInvitations = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperListGroupInvitations); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ListGroupInvitations"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperListGroupInvitations(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListGroupInvitations.IsBound()) + { + FGroupsListGroupInvitationsResponse result = UPlayFabGroupsModelDecoder::decodeListGroupInvitationsResponseResponse(response.responseData); + OnSuccessListGroupInvitations.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all members for a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ListGroupMembers(FGroupsListGroupMembersRequest request, + FDelegateOnSuccessListGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListGroupMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperListGroupMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ListGroupMembers"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperListGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListGroupMembers.IsBound()) + { + FGroupsListGroupMembersResponse result = UPlayFabGroupsModelDecoder::decodeListGroupMembersResponseResponse(response.responseData); + OnSuccessListGroupMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all groups and roles for an entity */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ListMembership(FGroupsListMembershipRequest request, + FDelegateOnSuccessListMembership onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListMembership = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperListMembership); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ListMembership"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperListMembership(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListMembership.IsBound()) + { + FGroupsListMembershipResponse result = UPlayFabGroupsModelDecoder::decodeListMembershipResponseResponse(response.responseData); + OnSuccessListMembership.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all outstanding invitations and group applications for an entity */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::ListMembershipOpportunities(FGroupsListMembershipOpportunitiesRequest request, + FDelegateOnSuccessListMembershipOpportunities onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessListMembershipOpportunities = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperListMembershipOpportunities); + + // Setup the request + manager->PlayFabRequestURL = "/Group/ListMembershipOpportunities"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperListMembershipOpportunities(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessListMembershipOpportunities.IsBound()) + { + FGroupsListMembershipOpportunitiesResponse result = UPlayFabGroupsModelDecoder::decodeListMembershipOpportunitiesResponseResponse(response.responseData); + OnSuccessListMembershipOpportunities.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes an application to join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::RemoveGroupApplication(FGroupsRemoveGroupApplicationRequest request, + FDelegateOnSuccessRemoveGroupApplication onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveGroupApplication = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperRemoveGroupApplication); + + // Setup the request + manager->PlayFabRequestURL = "/Group/RemoveGroupApplication"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperRemoveGroupApplication(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveGroupApplication.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessRemoveGroupApplication.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes an invitation join a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::RemoveGroupInvitation(FGroupsRemoveGroupInvitationRequest request, + FDelegateOnSuccessRemoveGroupInvitation onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveGroupInvitation = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperRemoveGroupInvitation); + + // Setup the request + manager->PlayFabRequestURL = "/Group/RemoveGroupInvitation"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperRemoveGroupInvitation(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveGroupInvitation.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessRemoveGroupInvitation.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes members from a group. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::RemoveMembers(FGroupsRemoveMembersRequest request, + FDelegateOnSuccessRemoveMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperRemoveMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Group/RemoveMembers"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.Members.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Members")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Members"), request.Members); + } + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperRemoveMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveMembers.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessRemoveMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Unblocks a list of entities from joining a group */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::UnblockEntity(FGroupsUnblockEntityRequest request, + FDelegateOnSuccessUnblockEntity onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnblockEntity = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperUnblockEntity); + + // Setup the request + manager->PlayFabRequestURL = "/Group/UnblockEntity"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperUnblockEntity(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnblockEntity.IsBound()) + { + FGroupsEmptyResponse result = UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessUnblockEntity.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates non-membership data about a group. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::UpdateGroup(FGroupsUpdateGroupRequest request, + FDelegateOnSuccessUpdateGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperUpdateGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Group/UpdateGroup"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.AdminRoleId.IsEmpty() || request.AdminRoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("AdminRoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("AdminRoleId"), request.AdminRoleId); + } + OutRestJsonObj->SetNumberField(TEXT("ExpectedProfileVersion"), request.ExpectedProfileVersion); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.GroupName.IsEmpty() || request.GroupName == "") { + OutRestJsonObj->SetFieldNull(TEXT("GroupName")); + } else { + OutRestJsonObj->SetStringField(TEXT("GroupName"), request.GroupName); + } + if (request.MemberRoleId.IsEmpty() || request.MemberRoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("MemberRoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("MemberRoleId"), request.MemberRoleId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperUpdateGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateGroup.IsBound()) + { + FGroupsUpdateGroupResponse result = UPlayFabGroupsModelDecoder::decodeUpdateGroupResponseResponse(response.responseData); + OnSuccessUpdateGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates metadata about a role. */ +UPlayFabGroupsAPI* UPlayFabGroupsAPI::UpdateRole(FGroupsUpdateGroupRoleRequest request, + FDelegateOnSuccessUpdateRole onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabGroupsAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateRole = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabGroupsAPI::HelperUpdateRole); + + // Setup the request + manager->PlayFabRequestURL = "/Group/UpdateRole"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("ExpectedProfileVersion"), request.ExpectedProfileVersion); + if (request.Group != nullptr) OutRestJsonObj->SetObjectField(TEXT("Group"), request.Group); + if (request.RoleId.IsEmpty() || request.RoleId == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleId")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleId"), request.RoleId); + } + if (request.RoleName.IsEmpty() || request.RoleName == "") { + OutRestJsonObj->SetFieldNull(TEXT("RoleName")); + } else { + OutRestJsonObj->SetStringField(TEXT("RoleName"), request.RoleName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabGroupsRequestCompleted +void UPlayFabGroupsAPI::HelperUpdateRole(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateRole.IsBound()) + { + FGroupsUpdateGroupRoleResponse result = UPlayFabGroupsModelDecoder::decodeUpdateGroupRoleResponseResponse(response.responseData); + OnSuccessUpdateRole.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabGroupsAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabGroupsAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabGroupsAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabGroupsModelDecoder.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabGroupsModelDecoder.cpp new file mode 100644 index 000000000..eb297ea64 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabGroupsModelDecoder.cpp @@ -0,0 +1,212 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Groups +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabGroupsModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Groups API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Groups +////////////////////////////////////////////////////// + +FGroupsEmptyResponse UPlayFabGroupsModelDecoder::decodeEmptyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsEmptyResponse tempStruct; + + + return tempStruct; +} + +FGroupsApplyToGroupResponse UPlayFabGroupsModelDecoder::decodeApplyToGroupResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsApplyToGroupResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Entity = !(dataObj->HasField("Entity")) ? nullptr : dataObj->GetObjectField("Entity"); + tempStruct.Expires = !(dataObj->HasField("Expires")) ? TEXT("") : dataObj->GetStringField("Expires"); + tempStruct.Group = !(dataObj->HasField("Group")) ? nullptr : dataObj->GetObjectField("Group"); + + return tempStruct; +} + +FGroupsCreateGroupResponse UPlayFabGroupsModelDecoder::decodeCreateGroupResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsCreateGroupResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.AdminRoleId = !(dataObj->HasField("AdminRoleId")) ? TEXT("") : dataObj->GetStringField("AdminRoleId"); + tempStruct.Created = !(dataObj->HasField("Created")) ? TEXT("") : dataObj->GetStringField("Created"); + tempStruct.Group = !(dataObj->HasField("Group")) ? nullptr : dataObj->GetObjectField("Group"); + tempStruct.GroupName = !(dataObj->HasField("GroupName")) ? TEXT("") : dataObj->GetStringField("GroupName"); + tempStruct.MemberRoleId = !(dataObj->HasField("MemberRoleId")) ? TEXT("") : dataObj->GetStringField("MemberRoleId"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + tempStruct.Roles = !(dataObj->HasField("Roles")) ? nullptr : dataObj->GetObjectField("Roles"); + + return tempStruct; +} + +FGroupsCreateGroupRoleResponse UPlayFabGroupsModelDecoder::decodeCreateGroupRoleResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsCreateGroupRoleResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + tempStruct.RoleId = !(dataObj->HasField("RoleId")) ? TEXT("") : dataObj->GetStringField("RoleId"); + tempStruct.RoleName = !(dataObj->HasField("RoleName")) ? TEXT("") : dataObj->GetStringField("RoleName"); + + return tempStruct; +} + +FGroupsGetGroupResponse UPlayFabGroupsModelDecoder::decodeGetGroupResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsGetGroupResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.AdminRoleId = !(dataObj->HasField("AdminRoleId")) ? TEXT("") : dataObj->GetStringField("AdminRoleId"); + tempStruct.Created = !(dataObj->HasField("Created")) ? TEXT("") : dataObj->GetStringField("Created"); + tempStruct.Group = !(dataObj->HasField("Group")) ? nullptr : dataObj->GetObjectField("Group"); + tempStruct.GroupName = !(dataObj->HasField("GroupName")) ? TEXT("") : dataObj->GetStringField("GroupName"); + tempStruct.MemberRoleId = !(dataObj->HasField("MemberRoleId")) ? TEXT("") : dataObj->GetStringField("MemberRoleId"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + tempStruct.Roles = !(dataObj->HasField("Roles")) ? nullptr : dataObj->GetObjectField("Roles"); + + return tempStruct; +} + +FGroupsInviteToGroupResponse UPlayFabGroupsModelDecoder::decodeInviteToGroupResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsInviteToGroupResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Expires = !(dataObj->HasField("Expires")) ? TEXT("") : dataObj->GetStringField("Expires"); + tempStruct.Group = !(dataObj->HasField("Group")) ? nullptr : dataObj->GetObjectField("Group"); + tempStruct.InvitedByEntity = !(dataObj->HasField("InvitedByEntity")) ? nullptr : dataObj->GetObjectField("InvitedByEntity"); + tempStruct.InvitedEntity = !(dataObj->HasField("InvitedEntity")) ? nullptr : dataObj->GetObjectField("InvitedEntity"); + tempStruct.RoleId = !(dataObj->HasField("RoleId")) ? TEXT("") : dataObj->GetStringField("RoleId"); + + return tempStruct; +} + +FGroupsIsMemberResponse UPlayFabGroupsModelDecoder::decodeIsMemberResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsIsMemberResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.IsMember = !(dataObj->HasField("IsMember")) ? false : dataObj->GetBoolField("IsMember"); + + return tempStruct; +} + +FGroupsListGroupApplicationsResponse UPlayFabGroupsModelDecoder::decodeListGroupApplicationsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsListGroupApplicationsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Applications = !(dataObj->HasField("Applications")) ? TArray() : dataObj->GetObjectArrayField("Applications"); + + return tempStruct; +} + +FGroupsListGroupBlocksResponse UPlayFabGroupsModelDecoder::decodeListGroupBlocksResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsListGroupBlocksResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BlockedEntities = !(dataObj->HasField("BlockedEntities")) ? TArray() : dataObj->GetObjectArrayField("BlockedEntities"); + + return tempStruct; +} + +FGroupsListGroupInvitationsResponse UPlayFabGroupsModelDecoder::decodeListGroupInvitationsResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsListGroupInvitationsResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Invitations = !(dataObj->HasField("Invitations")) ? TArray() : dataObj->GetObjectArrayField("Invitations"); + + return tempStruct; +} + +FGroupsListGroupMembersResponse UPlayFabGroupsModelDecoder::decodeListGroupMembersResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsListGroupMembersResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Members = !(dataObj->HasField("Members")) ? TArray() : dataObj->GetObjectArrayField("Members"); + + return tempStruct; +} + +FGroupsListMembershipResponse UPlayFabGroupsModelDecoder::decodeListMembershipResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsListMembershipResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Groups = !(dataObj->HasField("Groups")) ? TArray() : dataObj->GetObjectArrayField("Groups"); + + return tempStruct; +} + +FGroupsListMembershipOpportunitiesResponse UPlayFabGroupsModelDecoder::decodeListMembershipOpportunitiesResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsListMembershipOpportunitiesResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Applications = !(dataObj->HasField("Applications")) ? TArray() : dataObj->GetObjectArrayField("Applications"); + tempStruct.Invitations = !(dataObj->HasField("Invitations")) ? TArray() : dataObj->GetObjectArrayField("Invitations"); + + return tempStruct; +} + +FGroupsUpdateGroupResponse UPlayFabGroupsModelDecoder::decodeUpdateGroupResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsUpdateGroupResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.OperationReason = !(dataObj->HasField("OperationReason")) ? TEXT("") : dataObj->GetStringField("OperationReason"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + GetEnumValueFromString(TEXT("EOperationTypes"), dataObj->GetStringField("SetResult"), tempStruct.SetResult); + + return tempStruct; +} + +FGroupsUpdateGroupRoleResponse UPlayFabGroupsModelDecoder::decodeUpdateGroupRoleResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FGroupsUpdateGroupRoleResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.OperationReason = !(dataObj->HasField("OperationReason")) ? TEXT("") : dataObj->GetStringField("OperationReason"); + tempStruct.ProfileVersion = !(dataObj->HasField("ProfileVersion")) ? 0 : int(dataObj->GetNumberField("ProfileVersion")); + GetEnumValueFromString(TEXT("EOperationTypes"), dataObj->GetStringField("SetResult"), tempStruct.SetResult); + + return tempStruct; +} + + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabGroupsModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabGroupsModels.cpp new file mode 100644 index 000000000..d99c0b6a4 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabGroupsModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Groups +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabGroupsModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabJsonObject.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabJsonObject.cpp new file mode 100644 index 000000000..46db52485 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabJsonObject.cpp @@ -0,0 +1,481 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// JSon Objects +// These are used as a wrapper for the internal json objects. +// Originally wriiten by Vladimir Alyamkin. +// Updated by Joshua Lyons to include null values +//////////////////////////////////////////////////////////// + +#include "PlayFabJsonObject.h" +#include "PlayFabJsonValue.h" +#include "PlayFabPrivate.h" + +typedef TJsonWriterFactory< TCHAR, TCondensedJsonPrintPolicy > FCondensedJsonStringWriterFactory; +typedef TJsonWriter< TCHAR, TCondensedJsonPrintPolicy > FCondensedJsonStringWriter; + +UPlayFabJsonObject::UPlayFabJsonObject(const class FObjectInitializer& PCIP) + : Super(PCIP) +{ + Reset(); +} + +UPlayFabJsonObject* UPlayFabJsonObject::ConstructJsonObject(UObject* WorldContextObject) +{ + return NewObject(); +} + +void UPlayFabJsonObject::Reset() +{ + if (JsonObj.IsValid()) + { + JsonObj.Reset(); + } + + JsonObj = MakeShareable(new FJsonObject()); +} + +TSharedPtr& UPlayFabJsonObject::GetRootObject() +{ + return JsonObj; +} + +void UPlayFabJsonObject::SetRootObject(TSharedPtr& JsonObject) +{ + JsonObj = JsonObject; +} + + +////////////////////////////////////////////////////////////////////////// +// Serialization + +FString UPlayFabJsonObject::EncodeJson() const +{ + if (!JsonObj.IsValid()) + { + return TEXT(""); + } + + FString OutputString; + TSharedRef< FCondensedJsonStringWriter > Writer = FCondensedJsonStringWriterFactory::Create(&OutputString); + FJsonSerializer::Serialize(JsonObj.ToSharedRef(), Writer); + + return OutputString; +} + +bool UPlayFabJsonObject::DecodeJson(const FString& JsonString) +{ + TSharedRef< TJsonReader<> > Reader = TJsonReaderFactory<>::Create(*JsonString); + if (FJsonSerializer::Deserialize(Reader, JsonObj) && JsonObj.IsValid()) + { + return true; + } + + // If we've failed to deserialize the string, we should clear our internal data + Reset(); + + UE_LOG(LogPlayFab, Error, TEXT("Json decoding failed for: %s"), *JsonString); + + return false; +} + + +////////////////////////////////////////////////////////////////////////// +// FJsonObject API + +TArray UPlayFabJsonObject::GetFieldNames() +{ + TArray Result; + + if (!JsonObj.IsValid()) + { + return Result; + } + + JsonObj->Values.GetKeys(Result); + + return Result; +} + +bool UPlayFabJsonObject::HasField(const FString& FieldName) const +{ + if (!JsonObj.IsValid()) + { + return false; + } + + return JsonObj->HasField(FieldName); +} + +void UPlayFabJsonObject::RemoveField(const FString& FieldName) +{ + if (!JsonObj.IsValid()) + { + return; + } + + JsonObj->RemoveField(FieldName); +} + +UPlayFabJsonValue* UPlayFabJsonObject::GetField(const FString& FieldName) const +{ + if (!JsonObj.IsValid()) + { + return nullptr; + } + + TSharedPtr NewVal = JsonObj->TryGetField(FieldName); + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +void UPlayFabJsonObject::SetField(const FString& FieldName, UPlayFabJsonValue* JsonValue) +{ + if (!JsonObj.IsValid()) + { + return; + } + + JsonObj->SetField(FieldName, JsonValue->GetRootValue()); +} + +void UPlayFabJsonObject::SetFieldNull(const FString& FieldName) +{ + if (!JsonObj.IsValid()) + { + return; + } + + TSharedPtr myNull = MakeShareable(new FJsonValueNull()); + + JsonObj->SetField(FieldName, myNull); +} + +////////////////////////////////////////////////////////////////////////// +// FJsonObject API Helpers (easy to use with simple Json objects) + +float UPlayFabJsonObject::GetNumberField(const FString& FieldName) const +{ + if (!JsonObj.IsValid()) + { + return 0.0f; + } + + return JsonObj->GetNumberField(FieldName); +} + +void UPlayFabJsonObject::SetNumberField(const FString& FieldName, float Number) +{ + if (!JsonObj.IsValid()) + { + return; + } + + JsonObj->SetNumberField(FieldName, Number); +} + +FString UPlayFabJsonObject::GetStringField(const FString& FieldName) const +{ + if (!JsonObj.IsValid()) + { + return TEXT(""); + } + + return JsonObj->GetStringField(FieldName); +} + +void UPlayFabJsonObject::SetStringField(const FString& FieldName, const FString& StringValue) +{ + if (!JsonObj.IsValid()) + { + return; + } + + JsonObj->SetStringField(FieldName, StringValue); +} + +bool UPlayFabJsonObject::GetBoolField(const FString& FieldName) const +{ + if (!JsonObj.IsValid()) + { + return false; + } + + return JsonObj->GetBoolField(FieldName); +} + +void UPlayFabJsonObject::SetBoolField(const FString& FieldName, bool InValue) +{ + if (!JsonObj.IsValid()) + { + return; + } + + JsonObj->SetBoolField(FieldName, InValue); +} + +TArray UPlayFabJsonObject::GetArrayField(const FString& FieldName) +{ + TArray OutArray; + if (!JsonObj.IsValid()) + { + return OutArray; + } + + TArray< TSharedPtr > ValArray = JsonObj->GetArrayField(FieldName); + for (auto Value : ValArray) + { + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(Value); + + OutArray.Add(NewValue); + } + + return OutArray; +} + +void UPlayFabJsonObject::SetArrayField(const FString& FieldName, const TArray& InArray) +{ + if (!JsonObj.IsValid()) + { + return; + } + + TArray< TSharedPtr > ValArray; + + // Process input array and COPY original values + for (auto InVal : InArray) + { + TSharedPtr JsonVal = InVal->GetRootValue(); + + switch (InVal->GetType()) + { + case EPFJson::None: + break; + + case EPFJson::Null: + ValArray.Add(MakeShareable(new FJsonValueNull())); + break; + + case EPFJson::String: + ValArray.Add(MakeShareable(new FJsonValueString(JsonVal->AsString()))); + break; + + case EPFJson::Number: + ValArray.Add(MakeShareable(new FJsonValueNumber(JsonVal->AsNumber()))); + break; + + case EPFJson::Boolean: + ValArray.Add(MakeShareable(new FJsonValueBoolean(JsonVal->AsBool()))); + break; + + case EPFJson::Array: + ValArray.Add(MakeShareable(new FJsonValueArray(JsonVal->AsArray()))); + break; + + case EPFJson::Object: + ValArray.Add(MakeShareable(new FJsonValueObject(JsonVal->AsObject()))); + break; + + default: + break; + } + } + + JsonObj->SetArrayField(FieldName, ValArray); +} + +void UPlayFabJsonObject::MergeJsonObject(UPlayFabJsonObject* InJsonObject, bool Overwrite) +{ + TArray Keys = InJsonObject->GetFieldNames(); + + for (auto Key : Keys) + { + if (Overwrite == false && HasField(Key)) + { + continue; + } + + SetField(Key, InJsonObject->GetField(Key)); + } +} + +UPlayFabJsonObject* UPlayFabJsonObject::GetObjectField(const FString& FieldName) const +{ + if (!JsonObj.IsValid()) + { + return nullptr; + } + + TSharedPtr JsonObjField = JsonObj->GetObjectField(FieldName); + + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + OutRestJsonObj->SetRootObject(JsonObjField); + + return OutRestJsonObj; +} + +void UPlayFabJsonObject::SetObjectField(const FString& FieldName, UPlayFabJsonObject* JsonObject) +{ + if (!JsonObj.IsValid()) + { + return; + } + + JsonObj->SetObjectField(FieldName, JsonObject->GetRootObject()); +} + + +////////////////////////////////////////////////////////////////////////// +// Array fields helpers (uniform arrays) + +TArray UPlayFabJsonObject::GetNumberArrayField(const FString& FieldName) +{ + TArray NumberArray; + + if (!JsonObj.IsValid()) + { + return NumberArray; + } + + TArray > JsonArrayValues = JsonObj->GetArrayField(FieldName); + for (TArray >::TConstIterator It(JsonArrayValues); It; ++It) + { + NumberArray.Add((*It)->AsNumber()); + } + + return NumberArray; +} + +void UPlayFabJsonObject::SetNumberArrayField(const FString& FieldName, const TArray& NumberArray) +{ + if (!JsonObj.IsValid()) + { + return; + } + + TArray< TSharedPtr > EntriesArray; + + for (auto Number : NumberArray) + { + EntriesArray.Add(MakeShareable(new FJsonValueNumber(Number))); + } + + JsonObj->SetArrayField(FieldName, EntriesArray); +} + +TArray UPlayFabJsonObject::GetStringArrayField(const FString& FieldName) +{ + TArray StringArray; + + if (!JsonObj.IsValid()) + { + return StringArray; + } + + TArray > JsonArrayValues = JsonObj->GetArrayField(FieldName); + for (TArray >::TConstIterator It(JsonArrayValues); It; ++It) + { + StringArray.Add((*It)->AsString()); + } + + return StringArray; +} + +void UPlayFabJsonObject::SetStringArrayField(const FString& FieldName, const TArray& StringArray) +{ + if (!JsonObj.IsValid()) + { + return; + } + + TArray< TSharedPtr > EntriesArray; + + for (auto String : StringArray) + { + EntriesArray.Add(MakeShareable(new FJsonValueString(String))); + } + + JsonObj->SetArrayField(FieldName, EntriesArray); +} + +TArray UPlayFabJsonObject::GetBoolArrayField(const FString& FieldName) +{ + TArray BoolArray; + + if (!JsonObj.IsValid()) + { + return BoolArray; + } + + TArray > JsonArrayValues = JsonObj->GetArrayField(FieldName); + for (TArray >::TConstIterator It(JsonArrayValues); It; ++It) + { + BoolArray.Add((*It)->AsBool()); + } + + return BoolArray; +} + +void UPlayFabJsonObject::SetBoolArrayField(const FString& FieldName, const TArray& BoolArray) +{ + if (!JsonObj.IsValid()) + { + return; + } + + TArray< TSharedPtr > EntriesArray; + + for (auto Boolean : BoolArray) + { + EntriesArray.Add(MakeShareable(new FJsonValueBoolean(Boolean))); + } + + JsonObj->SetArrayField(FieldName, EntriesArray); +} + +TArray UPlayFabJsonObject::GetObjectArrayField(const FString& FieldName) +{ + TArray OutArray; + + if (!JsonObj.IsValid()) + { + return OutArray; + } + + TArray< TSharedPtr > ValArray = JsonObj->GetArrayField(FieldName); + for (auto Value : ValArray) + { + TSharedPtr NewObj = Value->AsObject(); + + UPlayFabJsonObject* NewJson = NewObject(); + NewJson->SetRootObject(NewObj); + + OutArray.Add(NewJson); + } + + return OutArray; +} + +void UPlayFabJsonObject::SetObjectArrayField(const FString& FieldName, const TArray& ObjectArray) +{ + if (!JsonObj.IsValid()) + { + return; + } + + TArray< TSharedPtr > EntriesArray; + + for (auto Value : ObjectArray) + { + EntriesArray.Add(MakeShareable(new FJsonValueObject(Value->GetRootObject()))); + } + + JsonObj->SetArrayField(FieldName, EntriesArray); +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabJsonValue.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabJsonValue.cpp new file mode 100644 index 000000000..dc5ca91e4 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabJsonValue.cpp @@ -0,0 +1,263 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// JSon Values +// These are used as a wrapper for the internal json values. +// Originally wriiten by Vladimir Alyamkin. +//////////////////////////////////////////////////////////// + +#include "PlayFabJsonValue.h" +#include "PlayFabJsonObject.h" +#include "PlayFabPrivate.h" +#include "CoreMinimal.h" + + +UPlayFabJsonValue::UPlayFabJsonValue(const class FObjectInitializer& PCIP) + : Super(PCIP) +{ + +} + +UPlayFabJsonValue* UPlayFabJsonValue::ConstructJsonValueNumber(UObject* WorldContextObject, float Number) +{ + TSharedPtr NewVal = MakeShareable(new FJsonValueNumber(Number)); + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +UPlayFabJsonValue* UPlayFabJsonValue::ConstructJsonValueString(UObject* WorldContextObject, const FString& StringValue) +{ + TSharedPtr NewVal = MakeShareable(new FJsonValueString(StringValue)); + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +UPlayFabJsonValue* UPlayFabJsonValue::ConstructJsonValueBool(UObject* WorldContextObject, bool InValue) +{ + TSharedPtr NewVal = MakeShareable(new FJsonValueBoolean(InValue)); + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +UPlayFabJsonValue* UPlayFabJsonValue::ConstructJsonValueArray(UObject* WorldContextObject, const TArray& InArray) +{ + // Prepare data array to create new value + TArray< TSharedPtr > ValueArray; + for (auto InVal : InArray) + { + ValueArray.Add(InVal->GetRootValue()); + } + + TSharedPtr NewVal = MakeShareable(new FJsonValueArray(ValueArray)); + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +UPlayFabJsonValue* UPlayFabJsonValue::ConstructJsonValueObject(UObject* WorldContextObject, UPlayFabJsonObject *JsonObject) +{ + TSharedPtr NewVal = MakeShareable(new FJsonValueObject(JsonObject->GetRootObject())); + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +UPlayFabJsonValue* ConstructJsonValue(UObject* WorldContextObject, const TSharedPtr& InValue) +{ + TSharedPtr NewVal = InValue; + + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(NewVal); + + return NewValue; +} + +TSharedPtr& UPlayFabJsonValue::GetRootValue() +{ + return JsonVal; +} + +void UPlayFabJsonValue::SetRootValue(TSharedPtr& JsonValue) +{ + JsonVal = JsonValue; +} + + +////////////////////////////////////////////////////////////////////////// +// FJsonValue API + +EPFJson::Type UPlayFabJsonValue::GetType() const +{ + if (!JsonVal.IsValid()) + { + return EPFJson::None; + } + + switch (JsonVal->Type) + { + case EJson::None: + return EPFJson::None; + + case EJson::Null: + return EPFJson::Null; + + case EJson::String: + return EPFJson::String; + + case EJson::Number: + return EPFJson::Number; + + case EJson::Boolean: + return EPFJson::Boolean; + + case EJson::Array: + return EPFJson::Array; + + case EJson::Object: + return EPFJson::Object; + + default: + return EPFJson::None; + } +} + +FString UPlayFabJsonValue::GetTypeString() const +{ + if (!JsonVal.IsValid()) + { + return "None"; + } + + switch (JsonVal->Type) + { + case EJson::None: + return TEXT("None"); + + case EJson::Null: + return TEXT("Null"); + + case EJson::String: + return TEXT("String"); + + case EJson::Number: + return TEXT("Number"); + + case EJson::Boolean: + return TEXT("Boolean"); + + case EJson::Array: + return TEXT("Array"); + + case EJson::Object: + return TEXT("Object"); + + default: + return TEXT("None"); + } +} + +bool UPlayFabJsonValue::IsNull() const +{ + if (!JsonVal.IsValid()) + { + return true; + } + + return JsonVal->IsNull(); +} + +float UPlayFabJsonValue::AsNumber() const +{ + if (!JsonVal.IsValid()) + { + ErrorMessage(TEXT("Number")); + return 0.f; + } + + return JsonVal->AsNumber(); +} + +FString UPlayFabJsonValue::AsString() const +{ + if (!JsonVal.IsValid()) + { + ErrorMessage(TEXT("String")); + return FString(); + } + + return JsonVal->AsString(); +} + +bool UPlayFabJsonValue::AsBool() const +{ + if (!JsonVal.IsValid()) + { + ErrorMessage(TEXT("Boolean")); + return false; + } + + return JsonVal->AsBool(); +} + +TArray UPlayFabJsonValue::AsArray() const +{ + TArray OutArray; + + if (!JsonVal.IsValid()) + { + ErrorMessage(TEXT("Array")); + return OutArray; + } + + TArray< TSharedPtr > ValArray = JsonVal->AsArray(); + for (auto Value : ValArray) + { + UPlayFabJsonValue* NewValue = NewObject(); + NewValue->SetRootValue(Value); + + OutArray.Add(NewValue); + } + + return OutArray; +} + +UPlayFabJsonObject* UPlayFabJsonValue::AsObject() +{ + if (!JsonVal.IsValid()) + { + ErrorMessage(TEXT("Object")); + return nullptr; + } + + TSharedPtr NewObj = JsonVal->AsObject(); + + UPlayFabJsonObject* JsonObj = NewObject(); + JsonObj->SetRootObject(NewObj); + + return JsonObj; +} + + +////////////////////////////////////////////////////////////////////////// +// Helpers + +void UPlayFabJsonValue::ErrorMessage(const FString& InType) const +{ + UE_LOG(LogPlayFab, Error, TEXT("Json Value of type '%s' used as a '%s'."), *GetTypeString(), *InType); +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabLocalizationAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabLocalizationAPI.cpp new file mode 100644 index 000000000..0c3584d27 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabLocalizationAPI.cpp @@ -0,0 +1,235 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Localization +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabLocalizationAPI.h" +#include "PlayFabLocalizationModels.h" +#include "PlayFabLocalizationModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabLocalizationAPI::UPlayFabLocalizationAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabLocalizationAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabLocalizationAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabLocalizationAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Localization API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Localization +////////////////////////////////////////////////////// +/** Retrieves the list of allowed languages, only accessible by title entities */ +UPlayFabLocalizationAPI* UPlayFabLocalizationAPI::GetLanguageList(FLocalizationGetLanguageListRequest request, + FDelegateOnSuccessGetLanguageList onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabLocalizationAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLanguageList = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabLocalizationAPI::HelperGetLanguageList); + + // Setup the request + manager->PlayFabRequestURL = "/Locale/GetLanguageList"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabLocalizationRequestCompleted +void UPlayFabLocalizationAPI::HelperGetLanguageList(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLanguageList.IsBound()) + { + FLocalizationGetLanguageListResponse result = UPlayFabLocalizationModelDecoder::decodeGetLanguageListResponseResponse(response.responseData); + OnSuccessGetLanguageList.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabLocalizationAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabLocalizationAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabLocalizationAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabLocalizationAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabLocalizationModelDecoder.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabLocalizationModelDecoder.cpp new file mode 100644 index 000000000..dfbda3496 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabLocalizationModelDecoder.cpp @@ -0,0 +1,35 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Localization +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabLocalizationModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Localization API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Localization +////////////////////////////////////////////////////// + +FLocalizationGetLanguageListResponse UPlayFabLocalizationModelDecoder::decodeGetLanguageListResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FLocalizationGetLanguageListResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.LanguageList = !(dataObj->HasField("LanguageList")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("LanguageList"), TEXT(",")); + + return tempStruct; +} + + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabLocalizationModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabLocalizationModels.cpp new file mode 100644 index 000000000..29aaa81a1 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabLocalizationModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Localization +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabLocalizationModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerAPI.cpp new file mode 100644 index 000000000..61d598732 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerAPI.cpp @@ -0,0 +1,469 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Matchmaker +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabMatchmakerAPI.h" +#include "PlayFabMatchmakerModels.h" +#include "PlayFabMatchmakerModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabMatchmakerAPI::UPlayFabMatchmakerAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabMatchmakerAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabMatchmakerAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabMatchmakerAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Matchmaker API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// +/** Validates a user with the PlayFab service */ +UPlayFabMatchmakerAPI* UPlayFabMatchmakerAPI::AuthUser(FMatchmakerAuthUserRequest request, + FDelegateOnSuccessAuthUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabMatchmakerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAuthUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabMatchmakerAPI::HelperAuthUser); + + // Setup the request + manager->PlayFabRequestURL = "/Matchmaker/AuthUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.AuthorizationTicket.IsEmpty() || request.AuthorizationTicket == "") { + OutRestJsonObj->SetFieldNull(TEXT("AuthorizationTicket")); + } else { + OutRestJsonObj->SetStringField(TEXT("AuthorizationTicket"), request.AuthorizationTicket); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabMatchmakerRequestCompleted +void UPlayFabMatchmakerAPI::HelperAuthUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAuthUser.IsBound()) + { + FMatchmakerAuthUserResponse result = UPlayFabMatchmakerModelDecoder::decodeAuthUserResponseResponse(response.responseData); + OnSuccessAuthUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Informs the PlayFab game server hosting service that the indicated user has joined the Game Server Instance specified */ +UPlayFabMatchmakerAPI* UPlayFabMatchmakerAPI::PlayerJoined(FMatchmakerPlayerJoinedRequest request, + FDelegateOnSuccessPlayerJoined onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabMatchmakerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessPlayerJoined = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabMatchmakerAPI::HelperPlayerJoined); + + // Setup the request + manager->PlayFabRequestURL = "/Matchmaker/PlayerJoined"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabMatchmakerRequestCompleted +void UPlayFabMatchmakerAPI::HelperPlayerJoined(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessPlayerJoined.IsBound()) + { + FMatchmakerPlayerJoinedResponse result = UPlayFabMatchmakerModelDecoder::decodePlayerJoinedResponseResponse(response.responseData); + OnSuccessPlayerJoined.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Informs the PlayFab game server hosting service that the indicated user has left the Game Server Instance specified */ +UPlayFabMatchmakerAPI* UPlayFabMatchmakerAPI::PlayerLeft(FMatchmakerPlayerLeftRequest request, + FDelegateOnSuccessPlayerLeft onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabMatchmakerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessPlayerLeft = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabMatchmakerAPI::HelperPlayerLeft); + + // Setup the request + manager->PlayFabRequestURL = "/Matchmaker/PlayerLeft"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabMatchmakerRequestCompleted +void UPlayFabMatchmakerAPI::HelperPlayerLeft(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessPlayerLeft.IsBound()) + { + FMatchmakerPlayerLeftResponse result = UPlayFabMatchmakerModelDecoder::decodePlayerLeftResponseResponse(response.responseData); + OnSuccessPlayerLeft.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Instructs the PlayFab game server hosting service to instantiate a new Game Server Instance */ +UPlayFabMatchmakerAPI* UPlayFabMatchmakerAPI::StartGame(FMatchmakerStartGameRequest request, + FDelegateOnSuccessStartGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabMatchmakerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessStartGame = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabMatchmakerAPI::HelperStartGame); + + // Setup the request + manager->PlayFabRequestURL = "/Matchmaker/StartGame"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Build.IsEmpty() || request.Build == "") { + OutRestJsonObj->SetFieldNull(TEXT("Build")); + } else { + OutRestJsonObj->SetStringField(TEXT("Build"), request.Build); + } + if (request.CustomCommandLineData.IsEmpty() || request.CustomCommandLineData == "") { + OutRestJsonObj->SetFieldNull(TEXT("CustomCommandLineData")); + } else { + OutRestJsonObj->SetStringField(TEXT("CustomCommandLineData"), request.CustomCommandLineData); + } + if (request.ExternalMatchmakerEventEndpoint.IsEmpty() || request.ExternalMatchmakerEventEndpoint == "") { + OutRestJsonObj->SetFieldNull(TEXT("ExternalMatchmakerEventEndpoint")); + } else { + OutRestJsonObj->SetStringField(TEXT("ExternalMatchmakerEventEndpoint"), request.ExternalMatchmakerEventEndpoint); + } + if (request.GameMode.IsEmpty() || request.GameMode == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameMode")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameMode"), request.GameMode); + } + FString temp_Region; + if (GetEnumValueToString(TEXT("ERegion"), request.Region, temp_Region)) + OutRestJsonObj->SetStringField(TEXT("Region"), temp_Region); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabMatchmakerRequestCompleted +void UPlayFabMatchmakerAPI::HelperStartGame(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessStartGame.IsBound()) + { + FMatchmakerStartGameResponse result = UPlayFabMatchmakerModelDecoder::decodeStartGameResponseResponse(response.responseData); + OnSuccessStartGame.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the relevant details for a specified user, which the external match-making service can then use to compute effective matches */ +UPlayFabMatchmakerAPI* UPlayFabMatchmakerAPI::UserInfo(FMatchmakerUserInfoRequest request, + FDelegateOnSuccessUserInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabMatchmakerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUserInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabMatchmakerAPI::HelperUserInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Matchmaker/UserInfo"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MinCatalogVersion"), request.MinCatalogVersion); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabMatchmakerRequestCompleted +void UPlayFabMatchmakerAPI::HelperUserInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUserInfo.IsBound()) + { + FMatchmakerUserInfoResponse result = UPlayFabMatchmakerModelDecoder::decodeUserInfoResponseResponse(response.responseData); + OnSuccessUserInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabMatchmakerAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabMatchmakerAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabMatchmakerAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabMatchmakerAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerModelDecoder.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerModelDecoder.cpp new file mode 100644 index 000000000..5aa8d21f3 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerModelDecoder.cpp @@ -0,0 +1,88 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Matchmaker +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabMatchmakerModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Matchmaker API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +FMatchmakerAuthUserResponse UPlayFabMatchmakerModelDecoder::decodeAuthUserResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FMatchmakerAuthUserResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Authorized = !(dataObj->HasField("Authorized")) ? false : dataObj->GetBoolField("Authorized"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FMatchmakerPlayerJoinedResponse UPlayFabMatchmakerModelDecoder::decodePlayerJoinedResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FMatchmakerPlayerJoinedResponse tempStruct; + + + return tempStruct; +} + +FMatchmakerPlayerLeftResponse UPlayFabMatchmakerModelDecoder::decodePlayerLeftResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FMatchmakerPlayerLeftResponse tempStruct; + + + return tempStruct; +} + +FMatchmakerStartGameResponse UPlayFabMatchmakerModelDecoder::decodeStartGameResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FMatchmakerStartGameResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GameID = !(dataObj->HasField("GameID")) ? TEXT("") : dataObj->GetStringField("GameID"); + tempStruct.ServerHostname = !(dataObj->HasField("ServerHostname")) ? TEXT("") : dataObj->GetStringField("ServerHostname"); + tempStruct.ServerIPV4Address = !(dataObj->HasField("ServerIPV4Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV4Address"); + tempStruct.ServerIPV6Address = !(dataObj->HasField("ServerIPV6Address")) ? TEXT("") : dataObj->GetStringField("ServerIPV6Address"); + tempStruct.ServerPort = !(dataObj->HasField("ServerPort")) ? 0 : int(dataObj->GetNumberField("ServerPort")); + tempStruct.ServerPublicDNSName = !(dataObj->HasField("ServerPublicDNSName")) ? TEXT("") : dataObj->GetStringField("ServerPublicDNSName"); + + return tempStruct; +} + +FMatchmakerUserInfoResponse UPlayFabMatchmakerModelDecoder::decodeUserInfoResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FMatchmakerUserInfoResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Inventory = !(dataObj->HasField("Inventory")) ? TArray() : dataObj->GetObjectArrayField("Inventory"); + tempStruct.IsDeveloper = !(dataObj->HasField("IsDeveloper")) ? false : dataObj->GetBoolField("IsDeveloper"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.SteamId = !(dataObj->HasField("SteamId")) ? TEXT("") : dataObj->GetStringField("SteamId"); + tempStruct.TitleDisplayName = !(dataObj->HasField("TitleDisplayName")) ? TEXT("") : dataObj->GetStringField("TitleDisplayName"); + tempStruct.Username = !(dataObj->HasField("Username")) ? TEXT("") : dataObj->GetStringField("Username"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + tempStruct.VirtualCurrencyRechargeTimes = !(dataObj->HasField("VirtualCurrencyRechargeTimes")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyRechargeTimes"); + + return tempStruct; +} + + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerModels.cpp new file mode 100644 index 000000000..3f3928000 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabMatchmakerModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Matchmaker +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabMatchmakerModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabPrivate.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabPrivate.h new file mode 100644 index 000000000..7730fed0b --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabPrivate.h @@ -0,0 +1,23 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////// +// PlayFab Main Header File +//////////////////////////////////////////////////////////// + +#pragma once + +#include "CoreUObject.h" +#include "Engine.h" + +#include "Delegates/Delegate.h" +#include "Http.h" +#include "Containers/Map.h" +#include "Json.h" + +#include "Modules/ModuleManager.h" + +DECLARE_LOG_CATEGORY_EXTERN(LogPlayFab, Log, All); + +#include "IPlayFab.h" \ No newline at end of file diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabProfilesAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabProfilesAPI.cpp new file mode 100644 index 000000000..4d25c3da7 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabProfilesAPI.cpp @@ -0,0 +1,486 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Profiles +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabProfilesAPI.h" +#include "PlayFabProfilesModels.h" +#include "PlayFabProfilesModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabProfilesAPI::UPlayFabProfilesAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabProfilesAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabProfilesAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabProfilesAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Profiles API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// +/** Gets the global title access policy */ +UPlayFabProfilesAPI* UPlayFabProfilesAPI::GetGlobalPolicy(FProfilesGetGlobalPolicyRequest request, + FDelegateOnSuccessGetGlobalPolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabProfilesAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetGlobalPolicy = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabProfilesAPI::HelperGetGlobalPolicy); + + // Setup the request + manager->PlayFabRequestURL = "/Profile/GetGlobalPolicy"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabProfilesRequestCompleted +void UPlayFabProfilesAPI::HelperGetGlobalPolicy(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetGlobalPolicy.IsBound()) + { + FProfilesGetGlobalPolicyResponse result = UPlayFabProfilesModelDecoder::decodeGetGlobalPolicyResponseResponse(response.responseData); + OnSuccessGetGlobalPolicy.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the entity's profile. */ +UPlayFabProfilesAPI* UPlayFabProfilesAPI::GetProfile(FProfilesGetEntityProfileRequest request, + FDelegateOnSuccessGetProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabProfilesAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetProfile = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabProfilesAPI::HelperGetProfile); + + // Setup the request + manager->PlayFabRequestURL = "/Profile/GetProfile"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("DataAsObject"), request.DataAsObject); + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabProfilesRequestCompleted +void UPlayFabProfilesAPI::HelperGetProfile(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetProfile.IsBound()) + { + FProfilesGetEntityProfileResponse result = UPlayFabProfilesModelDecoder::decodeGetEntityProfileResponseResponse(response.responseData); + OnSuccessGetProfile.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the entity's profile. */ +UPlayFabProfilesAPI* UPlayFabProfilesAPI::GetProfiles(FProfilesGetEntityProfilesRequest request, + FDelegateOnSuccessGetProfiles onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabProfilesAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetProfiles = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabProfilesAPI::HelperGetProfiles); + + // Setup the request + manager->PlayFabRequestURL = "/Profile/GetProfiles"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("DataAsObject"), request.DataAsObject); + if (request.Entities.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Entities")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Entities"), request.Entities); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabProfilesRequestCompleted +void UPlayFabProfilesAPI::HelperGetProfiles(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetProfiles.IsBound()) + { + FProfilesGetEntityProfilesResponse result = UPlayFabProfilesModelDecoder::decodeGetEntityProfilesResponseResponse(response.responseData); + OnSuccessGetProfiles.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the global title access policy */ +UPlayFabProfilesAPI* UPlayFabProfilesAPI::SetGlobalPolicy(FProfilesSetGlobalPolicyRequest request, + FDelegateOnSuccessSetGlobalPolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabProfilesAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetGlobalPolicy = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabProfilesAPI::HelperSetGlobalPolicy); + + // Setup the request + manager->PlayFabRequestURL = "/Profile/SetGlobalPolicy"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Permissions.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Permissions")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Permissions"), request.Permissions); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabProfilesRequestCompleted +void UPlayFabProfilesAPI::HelperSetGlobalPolicy(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetGlobalPolicy.IsBound()) + { + FProfilesSetGlobalPolicyResponse result = UPlayFabProfilesModelDecoder::decodeSetGlobalPolicyResponseResponse(response.responseData); + OnSuccessSetGlobalPolicy.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the entity's language */ +UPlayFabProfilesAPI* UPlayFabProfilesAPI::SetProfileLanguage(FProfilesSetProfileLanguageRequest request, + FDelegateOnSuccessSetProfileLanguage onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabProfilesAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetProfileLanguage = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabProfilesAPI::HelperSetProfileLanguage); + + // Setup the request + manager->PlayFabRequestURL = "/Profile/SetProfileLanguage"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + OutRestJsonObj->SetNumberField(TEXT("ExpectedVersion"), request.ExpectedVersion); + if (request.Language.IsEmpty() || request.Language == "") { + OutRestJsonObj->SetFieldNull(TEXT("Language")); + } else { + OutRestJsonObj->SetStringField(TEXT("Language"), request.Language); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabProfilesRequestCompleted +void UPlayFabProfilesAPI::HelperSetProfileLanguage(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetProfileLanguage.IsBound()) + { + FProfilesSetProfileLanguageResponse result = UPlayFabProfilesModelDecoder::decodeSetProfileLanguageResponseResponse(response.responseData); + OnSuccessSetProfileLanguage.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the profiles access policy */ +UPlayFabProfilesAPI* UPlayFabProfilesAPI::SetProfilePolicy(FProfilesSetEntityProfilePolicyRequest request, + FDelegateOnSuccessSetProfilePolicy onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabProfilesAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetProfilePolicy = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabProfilesAPI::HelperSetProfilePolicy); + + // Setup the request + manager->PlayFabRequestURL = "/Profile/SetProfilePolicy"; + manager->useEntityToken = true; + + // Serialize all the request properties to json + if (request.Entity != nullptr) OutRestJsonObj->SetObjectField(TEXT("Entity"), request.Entity); + if (request.Statements.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Statements")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Statements"), request.Statements); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabProfilesRequestCompleted +void UPlayFabProfilesAPI::HelperSetProfilePolicy(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetProfilePolicy.IsBound()) + { + FProfilesSetEntityProfilePolicyResponse result = UPlayFabProfilesModelDecoder::decodeSetEntityProfilePolicyResponseResponse(response.responseData); + OnSuccessSetProfilePolicy.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabProfilesAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabProfilesAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabProfilesAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabProfilesModelDecoder.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabProfilesModelDecoder.cpp new file mode 100644 index 000000000..1d852471d --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabProfilesModelDecoder.cpp @@ -0,0 +1,89 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Profiles +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabProfilesModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Profiles API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +FProfilesGetGlobalPolicyResponse UPlayFabProfilesModelDecoder::decodeGetGlobalPolicyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FProfilesGetGlobalPolicyResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Permissions = !(dataObj->HasField("Permissions")) ? TArray() : dataObj->GetObjectArrayField("Permissions"); + + return tempStruct; +} + +FProfilesGetEntityProfileResponse UPlayFabProfilesModelDecoder::decodeGetEntityProfileResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FProfilesGetEntityProfileResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Profile = !(dataObj->HasField("Profile")) ? nullptr : dataObj->GetObjectField("Profile"); + + return tempStruct; +} + +FProfilesGetEntityProfilesResponse UPlayFabProfilesModelDecoder::decodeGetEntityProfilesResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FProfilesGetEntityProfilesResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Profiles = !(dataObj->HasField("Profiles")) ? TArray() : dataObj->GetObjectArrayField("Profiles"); + + return tempStruct; +} + +FProfilesSetGlobalPolicyResponse UPlayFabProfilesModelDecoder::decodeSetGlobalPolicyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FProfilesSetGlobalPolicyResponse tempStruct; + + + return tempStruct; +} + +FProfilesSetProfileLanguageResponse UPlayFabProfilesModelDecoder::decodeSetProfileLanguageResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FProfilesSetProfileLanguageResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + GetEnumValueFromString(TEXT("EOperationTypes"), dataObj->GetStringField("OperationResult"), tempStruct.OperationResult); + tempStruct.VersionNumber = !(dataObj->HasField("VersionNumber")) ? 0 : int(dataObj->GetNumberField("VersionNumber")); + + return tempStruct; +} + +FProfilesSetEntityProfilePolicyResponse UPlayFabProfilesModelDecoder::decodeSetEntityProfilePolicyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FProfilesSetEntityProfilePolicyResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Permissions = !(dataObj->HasField("Permissions")) ? TArray() : dataObj->GetObjectArrayField("Permissions"); + + return tempStruct; +} + + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabProfilesModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabProfilesModels.cpp new file mode 100644 index 000000000..7a5e2ad43 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabProfilesModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Profiles +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabProfilesModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabServerAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabServerAPI.cpp new file mode 100644 index 000000000..2efc24861 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabServerAPI.cpp @@ -0,0 +1,6752 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// +// API: Server +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabServerAPI.h" +#include "PlayFabServerModels.h" +#include "PlayFabServerModelDecoder.h" +#include "PlayFabPrivate.h" +#include "PlayFabEnums.h" + +UPlayFabServerAPI::UPlayFabServerAPI(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void UPlayFabServerAPI::SetRequestObject(UPlayFabJsonObject* JsonObject) +{ + RequestJsonObj = JsonObject; +} + +UPlayFabJsonObject* UPlayFabServerAPI::GetResponseObject() +{ + return ResponseJsonObj; +} + +FString UPlayFabServerAPI::PercentEncode(const FString& Text) +{ + FString OutText = Text; + + OutText = OutText.Replace(TEXT("!"), TEXT("%21")); + OutText = OutText.Replace(TEXT("\""), TEXT("%22")); + OutText = OutText.Replace(TEXT("#"), TEXT("%23")); + OutText = OutText.Replace(TEXT("$"), TEXT("%24")); + //OutText = OutText.Replace(TEXT("&"), TEXT("%26")); + OutText = OutText.Replace(TEXT("'"), TEXT("%27")); + OutText = OutText.Replace(TEXT("("), TEXT("%28")); + OutText = OutText.Replace(TEXT(")"), TEXT("%29")); + OutText = OutText.Replace(TEXT("*"), TEXT("%2A")); + OutText = OutText.Replace(TEXT("+"), TEXT("%2B")); + OutText = OutText.Replace(TEXT(","), TEXT("%2C")); + //OutText = OutText.Replace(TEXT("/"), TEXT("%2F")); + OutText = OutText.Replace(TEXT(":"), TEXT("%3A")); + OutText = OutText.Replace(TEXT(";"), TEXT("%3B")); + OutText = OutText.Replace(TEXT("="), TEXT("%3D")); + //OutText = OutText.Replace(TEXT("?"), TEXT("%3F")); + OutText = OutText.Replace(TEXT("@"), TEXT("%40")); + OutText = OutText.Replace(TEXT("["), TEXT("%5B")); + OutText = OutText.Replace(TEXT("]"), TEXT("%5D")); + OutText = OutText.Replace(TEXT("{"), TEXT("%7B")); + OutText = OutText.Replace(TEXT("}"), TEXT("%7D")); + + return OutText; +} + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Server API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// +/** Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. */ +UPlayFabServerAPI* UPlayFabServerAPI::BanUsers(FServerBanUsersRequest request, + FDelegateOnSuccessBanUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessBanUsers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperBanUsers); + + // Setup the request + manager->PlayFabRequestURL = "/Server/BanUsers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Bans.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Bans")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Bans"), request.Bans); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperBanUsers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessBanUsers.IsBound()) + { + FServerBanUsersResult result = UPlayFabServerModelDecoder::decodeBanUsersResultResponse(response.responseData); + OnSuccessBanUsers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the player's profile */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayerProfile(FServerGetPlayerProfileRequest request, + FDelegateOnSuccessGetPlayerProfile onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerProfile = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayerProfile); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayerProfile"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayerProfile(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerProfile.IsBound()) + { + FServerGetPlayerProfileResult result = UPlayFabServerModelDecoder::decodeGetPlayerProfileResultResponse(response.responseData); + OnSuccessGetPlayerProfile.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayFabIDsFromFacebookIDs(FServerGetPlayFabIDsFromFacebookIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromFacebookIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayFabIDsFromFacebookIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayFabIDsFromFacebookIDs"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.FacebookIDs.IsEmpty() || request.FacebookIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookIDs")); + } else { + TArray FacebookIDsArray; + FString(request.FacebookIDs).ParseIntoArray(FacebookIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FacebookIDs"), FacebookIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayFabIDsFromFacebookIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromFacebookIDs.IsBound()) + { + FServerGetPlayFabIDsFromFacebookIDsResult result = UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromFacebookIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromFacebookIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Facebook Instant Games identifiers. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayFabIDsFromFacebookInstantGamesIds(FServerGetPlayFabIDsFromFacebookInstantGamesIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromFacebookInstantGamesIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayFabIDsFromFacebookInstantGamesIds); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayFabIDsFromFacebookInstantGamesIds"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.FacebookInstantGamesIds.IsEmpty() || request.FacebookInstantGamesIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("FacebookInstantGamesIds")); + } else { + TArray FacebookInstantGamesIdsArray; + FString(request.FacebookInstantGamesIds).ParseIntoArray(FacebookInstantGamesIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("FacebookInstantGamesIds"), FacebookInstantGamesIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayFabIDsFromFacebookInstantGamesIds(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds.IsBound()) + { + FServerGetPlayFabIDsFromFacebookInstantGamesIdsResult result = UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromFacebookInstantGamesIdsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromFacebookInstantGamesIds.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Nintendo Switch Device identifiers. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayFabIDsFromNintendoSwitchDeviceIds(FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayFabIDsFromNintendoSwitchDeviceIds); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayFabIDsFromNintendoSwitchDeviceIds"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.NintendoSwitchDeviceIds.IsEmpty() || request.NintendoSwitchDeviceIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("NintendoSwitchDeviceIds")); + } else { + TArray NintendoSwitchDeviceIdsArray; + FString(request.NintendoSwitchDeviceIds).ParseIntoArray(NintendoSwitchDeviceIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("NintendoSwitchDeviceIds"), NintendoSwitchDeviceIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayFabIDsFromNintendoSwitchDeviceIds(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds.IsBound()) + { + FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsResult result = UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromNintendoSwitchDeviceIdsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromNintendoSwitchDeviceIds.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayFabIDsFromSteamIDs(FServerGetPlayFabIDsFromSteamIDsRequest request, + FDelegateOnSuccessGetPlayFabIDsFromSteamIDs onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayFabIDsFromSteamIDs = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayFabIDsFromSteamIDs); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayFabIDsFromSteamIDs"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.SteamStringIDs.IsEmpty() || request.SteamStringIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("SteamStringIDs")); + } else { + TArray SteamStringIDsArray; + FString(request.SteamStringIDs).ParseIntoArray(SteamStringIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("SteamStringIDs"), SteamStringIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayFabIDsFromSteamIDs(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayFabIDsFromSteamIDs.IsBound()) + { + FServerGetPlayFabIDsFromSteamIDsResult result = UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromSteamIDsResultResponse(response.responseData); + OnSuccessGetPlayFabIDsFromSteamIDs.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the relevant details for a specified user */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserAccountInfo(FServerGetUserAccountInfoRequest request, + FDelegateOnSuccessGetUserAccountInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserAccountInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserAccountInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserAccountInfo"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserAccountInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserAccountInfo.IsBound()) + { + FServerGetUserAccountInfoResult result = UPlayFabServerModelDecoder::decodeGetUserAccountInfoResultResponse(response.responseData); + OnSuccessGetUserAccountInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Gets all bans for a user. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserBans(FServerGetUserBansRequest request, + FDelegateOnSuccessGetUserBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserBans = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserBans); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserBans"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserBans(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserBans.IsBound()) + { + FServerGetUserBansResult result = UPlayFabServerModelDecoder::decodeGetUserBansResultResponse(response.responseData); + OnSuccessGetUserBans.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revoke all active bans for a user. */ +UPlayFabServerAPI* UPlayFabServerAPI::RevokeAllBansForUser(FServerRevokeAllBansForUserRequest request, + FDelegateOnSuccessRevokeAllBansForUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeAllBansForUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRevokeAllBansForUser); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RevokeAllBansForUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRevokeAllBansForUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeAllBansForUser.IsBound()) + { + FServerRevokeAllBansForUserResult result = UPlayFabServerModelDecoder::decodeRevokeAllBansForUserResultResponse(response.responseData); + OnSuccessRevokeAllBansForUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revoke all active bans specified with BanId. */ +UPlayFabServerAPI* UPlayFabServerAPI::RevokeBans(FServerRevokeBansRequest request, + FDelegateOnSuccessRevokeBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeBans = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRevokeBans); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RevokeBans"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.BanIds.IsEmpty() || request.BanIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("BanIds")); + } else { + TArray BanIdsArray; + FString(request.BanIds).ParseIntoArray(BanIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("BanIds"), BanIdsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRevokeBans(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeBans.IsBound()) + { + FServerRevokeBansResult result = UPlayFabServerModelDecoder::decodeRevokeBansResultResponse(response.responseData); + OnSuccessRevokeBans.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Forces an email to be sent to the registered contact email address for the user's account based on an account recovery email template */ +UPlayFabServerAPI* UPlayFabServerAPI::SendCustomAccountRecoveryEmail(FServerSendCustomAccountRecoveryEmailRequest request, + FDelegateOnSuccessSendCustomAccountRecoveryEmail onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSendCustomAccountRecoveryEmail = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSendCustomAccountRecoveryEmail); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SendCustomAccountRecoveryEmail"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Email.IsEmpty() || request.Email == "") { + OutRestJsonObj->SetFieldNull(TEXT("Email")); + } else { + OutRestJsonObj->SetStringField(TEXT("Email"), request.Email); + } + if (request.EmailTemplateId.IsEmpty() || request.EmailTemplateId == "") { + OutRestJsonObj->SetFieldNull(TEXT("EmailTemplateId")); + } else { + OutRestJsonObj->SetStringField(TEXT("EmailTemplateId"), request.EmailTemplateId); + } + if (request.Username.IsEmpty() || request.Username == "") { + OutRestJsonObj->SetFieldNull(TEXT("Username")); + } else { + OutRestJsonObj->SetStringField(TEXT("Username"), request.Username); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSendCustomAccountRecoveryEmail(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSendCustomAccountRecoveryEmail.IsBound()) + { + FServerSendCustomAccountRecoveryEmailResult result = UPlayFabServerModelDecoder::decodeSendCustomAccountRecoveryEmailResultResponse(response.responseData); + OnSuccessSendCustomAccountRecoveryEmail.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sends an email based on an email template to a player's contact email */ +UPlayFabServerAPI* UPlayFabServerAPI::SendEmailFromTemplate(FServerSendEmailFromTemplateRequest request, + FDelegateOnSuccessSendEmailFromTemplate onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSendEmailFromTemplate = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSendEmailFromTemplate); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SendEmailFromTemplate"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.EmailTemplateId.IsEmpty() || request.EmailTemplateId == "") { + OutRestJsonObj->SetFieldNull(TEXT("EmailTemplateId")); + } else { + OutRestJsonObj->SetStringField(TEXT("EmailTemplateId"), request.EmailTemplateId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSendEmailFromTemplate(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSendEmailFromTemplate.IsBound()) + { + FServerSendEmailFromTemplateResult result = UPlayFabServerModelDecoder::decodeSendEmailFromTemplateResultResponse(response.responseData); + OnSuccessSendEmailFromTemplate.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sends an iOS/Android Push Notification to a specific user, if that user's device has been configured for Push Notifications in PlayFab. If a user has linked both Android and iOS devices, both will be notified. */ +UPlayFabServerAPI* UPlayFabServerAPI::SendPushNotification(FServerSendPushNotificationRequest request, + FDelegateOnSuccessSendPushNotification onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSendPushNotification = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSendPushNotification); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SendPushNotification"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.AdvancedPlatformDelivery.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("AdvancedPlatformDelivery")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("AdvancedPlatformDelivery"), request.AdvancedPlatformDelivery); + } + if (request.Message.IsEmpty() || request.Message == "") { + OutRestJsonObj->SetFieldNull(TEXT("Message")); + } else { + OutRestJsonObj->SetStringField(TEXT("Message"), request.Message); + } + if (request.Package != nullptr) OutRestJsonObj->SetObjectField(TEXT("Package"), request.Package); + if (request.Recipient.IsEmpty() || request.Recipient == "") { + OutRestJsonObj->SetFieldNull(TEXT("Recipient")); + } else { + OutRestJsonObj->SetStringField(TEXT("Recipient"), request.Recipient); + } + if (request.Subject.IsEmpty() || request.Subject == "") { + OutRestJsonObj->SetFieldNull(TEXT("Subject")); + } else { + OutRestJsonObj->SetStringField(TEXT("Subject"), request.Subject); + } + // Check to see if string is empty + if (request.TargetPlatforms.IsEmpty() || request.TargetPlatforms == "") { + OutRestJsonObj->SetFieldNull(TEXT("TargetPlatforms")); + } else { + TArray TargetPlatformsArray; + FString(request.TargetPlatforms).ParseIntoArray(TargetPlatformsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("TargetPlatforms"), TargetPlatformsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSendPushNotification(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSendPushNotification.IsBound()) + { + FServerSendPushNotificationResult result = UPlayFabServerModelDecoder::decodeSendPushNotificationResultResponse(response.responseData); + OnSuccessSendPushNotification.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Update the avatar URL of the specified player */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateAvatarUrl(FServerUpdateAvatarUrlRequest request, + FDelegateOnSuccessUpdateAvatarUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateAvatarUrl = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateAvatarUrl); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateAvatarUrl"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.ImageUrl.IsEmpty() || request.ImageUrl == "") { + OutRestJsonObj->SetFieldNull(TEXT("ImageUrl")); + } else { + OutRestJsonObj->SetStringField(TEXT("ImageUrl"), request.ImageUrl); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateAvatarUrl(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateAvatarUrl.IsBound()) + { + FServerEmptyResponse result = UPlayFabServerModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessUpdateAvatarUrl.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates information of a list of existing bans specified with Ban Ids. */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateBans(FServerUpdateBansRequest request, + FDelegateOnSuccessUpdateBans onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateBans = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateBans); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateBans"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Bans.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Bans")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Bans"), request.Bans); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateBans(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateBans.IsBound()) + { + FServerUpdateBansResult result = UPlayFabServerModelDecoder::decodeUpdateBansResultResponse(response.responseData); + OnSuccessUpdateBans.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Analytics +////////////////////////////////////////////////////// +/** Writes a character-based event into PlayStream. */ +UPlayFabServerAPI* UPlayFabServerAPI::WriteCharacterEvent(FServerWriteServerCharacterEventRequest request, + FDelegateOnSuccessWriteCharacterEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWriteCharacterEvent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperWriteCharacterEvent); + + // Setup the request + manager->PlayFabRequestURL = "/Server/WriteCharacterEvent"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Body != nullptr) OutRestJsonObj->SetObjectField(TEXT("Body"), request.Body); + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.EventName.IsEmpty() || request.EventName == "") { + OutRestJsonObj->SetFieldNull(TEXT("EventName")); + } else { + OutRestJsonObj->SetStringField(TEXT("EventName"), request.EventName); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperWriteCharacterEvent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWriteCharacterEvent.IsBound()) + { + FServerWriteEventResponse result = UPlayFabServerModelDecoder::decodeWriteEventResponseResponse(response.responseData); + OnSuccessWriteCharacterEvent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Writes a player-based event into PlayStream. */ +UPlayFabServerAPI* UPlayFabServerAPI::WritePlayerEvent(FServerWriteServerPlayerEventRequest request, + FDelegateOnSuccessWritePlayerEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWritePlayerEvent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperWritePlayerEvent); + + // Setup the request + manager->PlayFabRequestURL = "/Server/WritePlayerEvent"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Body != nullptr) OutRestJsonObj->SetObjectField(TEXT("Body"), request.Body); + if (request.EventName.IsEmpty() || request.EventName == "") { + OutRestJsonObj->SetFieldNull(TEXT("EventName")); + } else { + OutRestJsonObj->SetStringField(TEXT("EventName"), request.EventName); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperWritePlayerEvent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWritePlayerEvent.IsBound()) + { + FServerWriteEventResponse result = UPlayFabServerModelDecoder::decodeWriteEventResponseResponse(response.responseData); + OnSuccessWritePlayerEvent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Writes a title-based event into PlayStream. */ +UPlayFabServerAPI* UPlayFabServerAPI::WriteTitleEvent(FServerWriteTitleEventRequest request, + FDelegateOnSuccessWriteTitleEvent onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessWriteTitleEvent = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperWriteTitleEvent); + + // Setup the request + manager->PlayFabRequestURL = "/Server/WriteTitleEvent"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Body != nullptr) OutRestJsonObj->SetObjectField(TEXT("Body"), request.Body); + if (request.EventName.IsEmpty() || request.EventName == "") { + OutRestJsonObj->SetFieldNull(TEXT("EventName")); + } else { + OutRestJsonObj->SetStringField(TEXT("EventName"), request.EventName); + } + if (request.Timestamp.IsEmpty() || request.Timestamp == "") { + OutRestJsonObj->SetFieldNull(TEXT("Timestamp")); + } else { + OutRestJsonObj->SetStringField(TEXT("Timestamp"), request.Timestamp); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperWriteTitleEvent(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessWriteTitleEvent.IsBound()) + { + FServerWriteEventResponse result = UPlayFabServerModelDecoder::decodeWriteEventResponseResponse(response.responseData); + OnSuccessWriteTitleEvent.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// +/** Validated a client's session ticket, and if successful, returns details for that user */ +UPlayFabServerAPI* UPlayFabServerAPI::AuthenticateSessionTicket(FServerAuthenticateSessionTicketRequest request, + FDelegateOnSuccessAuthenticateSessionTicket onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAuthenticateSessionTicket = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAuthenticateSessionTicket); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AuthenticateSessionTicket"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.SessionTicket.IsEmpty() || request.SessionTicket == "") { + OutRestJsonObj->SetFieldNull(TEXT("SessionTicket")); + } else { + OutRestJsonObj->SetStringField(TEXT("SessionTicket"), request.SessionTicket); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAuthenticateSessionTicket(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAuthenticateSessionTicket.IsBound()) + { + FServerAuthenticateSessionTicketResult result = UPlayFabServerModelDecoder::decodeAuthenticateSessionTicketResultResponse(response.responseData); + OnSuccessAuthenticateSessionTicket.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's secret use the Admin or Server API method SetPlayerSecret. */ +UPlayFabServerAPI* UPlayFabServerAPI::SetPlayerSecret(FServerSetPlayerSecretRequest request, + FDelegateOnSuccessSetPlayerSecret onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetPlayerSecret = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetPlayerSecret); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetPlayerSecret"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayerSecret.IsEmpty() || request.PlayerSecret == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayerSecret")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayerSecret"), request.PlayerSecret); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetPlayerSecret(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetPlayerSecret.IsBound()) + { + FServerSetPlayerSecretResult result = UPlayFabServerModelDecoder::decodeSetPlayerSecretResultResponse(response.responseData); + OnSuccessSetPlayerSecret.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Character Data +////////////////////////////////////////////////////// +/** Retrieves the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCharacterData(FServerGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCharacterData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCharacterData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterData.IsBound()) + { + FServerGetCharacterDataResult result = UPlayFabServerModelDecoder::decodeGetCharacterDataResultResponse(response.responseData); + OnSuccessGetCharacterData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user's character which cannot be accessed by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCharacterInternalData(FServerGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCharacterInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCharacterInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCharacterInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterInternalData.IsBound()) + { + FServerGetCharacterDataResult result = UPlayFabServerModelDecoder::decodeGetCharacterDataResultResponse(response.responseData); + OnSuccessGetCharacterInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user's character which can only be read by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCharacterReadOnlyData(FServerGetCharacterDataRequest request, + FDelegateOnSuccessGetCharacterReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCharacterReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCharacterReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCharacterReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterReadOnlyData.IsBound()) + { + FServerGetCharacterDataResult result = UPlayFabServerModelDecoder::decodeGetCharacterDataResultResponse(response.responseData); + OnSuccessGetCharacterReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user's character which is readable and writable by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateCharacterData(FServerUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCharacterData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateCharacterData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateCharacterData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateCharacterData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCharacterData.IsBound()) + { + FServerUpdateCharacterDataResult result = UPlayFabServerModelDecoder::decodeUpdateCharacterDataResultResponse(response.responseData); + OnSuccessUpdateCharacterData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user's character which cannot be accessed by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateCharacterInternalData(FServerUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCharacterInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateCharacterInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateCharacterInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateCharacterInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCharacterInternalData.IsBound()) + { + FServerUpdateCharacterDataResult result = UPlayFabServerModelDecoder::decodeUpdateCharacterDataResultResponse(response.responseData); + OnSuccessUpdateCharacterInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user's character which can only be read by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateCharacterReadOnlyData(FServerUpdateCharacterDataRequest request, + FDelegateOnSuccessUpdateCharacterReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCharacterReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateCharacterReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateCharacterReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateCharacterReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCharacterReadOnlyData.IsBound()) + { + FServerUpdateCharacterDataResult result = UPlayFabServerModelDecoder::decodeUpdateCharacterDataResultResponse(response.responseData); + OnSuccessUpdateCharacterReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// +/** Deletes the specific character ID from the specified user. */ +UPlayFabServerAPI* UPlayFabServerAPI::DeleteCharacterFromUser(FServerDeleteCharacterFromUserRequest request, + FDelegateOnSuccessDeleteCharacterFromUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteCharacterFromUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperDeleteCharacterFromUser); + + // Setup the request + manager->PlayFabRequestURL = "/Server/DeleteCharacterFromUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + OutRestJsonObj->SetBoolField(TEXT("SaveCharacterInventory"), request.SaveCharacterInventory); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperDeleteCharacterFromUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteCharacterFromUser.IsBound()) + { + FServerDeleteCharacterFromUserResult result = UPlayFabServerModelDecoder::decodeDeleteCharacterFromUserResultResponse(response.responseData); + OnSuccessDeleteCharacterFromUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetAllUsersCharacters(FServerListUsersCharactersRequest request, + FDelegateOnSuccessGetAllUsersCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetAllUsersCharacters = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetAllUsersCharacters); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetAllUsersCharacters"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetAllUsersCharacters(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetAllUsersCharacters.IsBound()) + { + FServerListUsersCharactersResult result = UPlayFabServerModelDecoder::decodeListUsersCharactersResultResponse(response.responseData); + OnSuccessGetAllUsersCharacters.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCharacterLeaderboard(FServerGetCharacterLeaderboardRequest request, + FDelegateOnSuccessGetCharacterLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterLeaderboard = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCharacterLeaderboard); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCharacterLeaderboard"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterType.IsEmpty() || request.CharacterType == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterType")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterType"), request.CharacterType); + } + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + OutRestJsonObj->SetNumberField(TEXT("StartPosition"), request.StartPosition); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCharacterLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterLeaderboard.IsBound()) + { + FServerGetCharacterLeaderboardResult result = UPlayFabServerModelDecoder::decodeGetCharacterLeaderboardResultResponse(response.responseData); + OnSuccessGetCharacterLeaderboard.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the details of all title-specific statistics for the specific character */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCharacterStatistics(FServerGetCharacterStatisticsRequest request, + FDelegateOnSuccessGetCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCharacterStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCharacterStatistics"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterStatistics.IsBound()) + { + FServerGetCharacterStatisticsResult result = UPlayFabServerModelDecoder::decodeGetCharacterStatisticsResultResponse(response.responseData); + OnSuccessGetCharacterStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked characters for the given statistic, centered on the requested user */ +UPlayFabServerAPI* UPlayFabServerAPI::GetLeaderboardAroundCharacter(FServerGetLeaderboardAroundCharacterRequest request, + FDelegateOnSuccessGetLeaderboardAroundCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboardAroundCharacter = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetLeaderboardAroundCharacter); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetLeaderboardAroundCharacter"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CharacterType.IsEmpty() || request.CharacterType == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterType")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterType"), request.CharacterType); + } + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetLeaderboardAroundCharacter(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboardAroundCharacter.IsBound()) + { + FServerGetLeaderboardAroundCharacterResult result = UPlayFabServerModelDecoder::decodeGetLeaderboardAroundCharacterResultResponse(response.responseData); + OnSuccessGetLeaderboardAroundCharacter.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of all of the user's characters for the given statistic. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetLeaderboardForUserCharacters(FServerGetLeaderboardForUsersCharactersRequest request, + FDelegateOnSuccessGetLeaderboardForUserCharacters onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboardForUserCharacters = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetLeaderboardForUserCharacters); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetLeaderboardForUserCharacters"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetLeaderboardForUserCharacters(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboardForUserCharacters.IsBound()) + { + FServerGetLeaderboardForUsersCharactersResult result = UPlayFabServerModelDecoder::decodeGetLeaderboardForUsersCharactersResultResponse(response.responseData); + OnSuccessGetLeaderboardForUserCharacters.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness. */ +UPlayFabServerAPI* UPlayFabServerAPI::GrantCharacterToUser(FServerGrantCharacterToUserRequest request, + FDelegateOnSuccessGrantCharacterToUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGrantCharacterToUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGrantCharacterToUser); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GrantCharacterToUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterName.IsEmpty() || request.CharacterName == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterName")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterName"), request.CharacterName); + } + if (request.CharacterType.IsEmpty() || request.CharacterType == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterType")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterType"), request.CharacterType); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGrantCharacterToUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGrantCharacterToUser.IsBound()) + { + FServerGrantCharacterToUserResult result = UPlayFabServerModelDecoder::decodeGrantCharacterToUserResultResponse(response.responseData); + OnSuccessGrantCharacterToUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the values of the specified title-specific statistics for the specific character */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateCharacterStatistics(FServerUpdateCharacterStatisticsRequest request, + FDelegateOnSuccessUpdateCharacterStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateCharacterStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateCharacterStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateCharacterStatistics"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CharacterStatistics != nullptr) OutRestJsonObj->SetObjectField(TEXT("CharacterStatistics"), request.CharacterStatistics); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateCharacterStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateCharacterStatistics.IsBound()) + { + FServerUpdateCharacterStatisticsResult result = UPlayFabServerModelDecoder::decodeUpdateCharacterStatisticsResultResponse(response.responseData); + OnSuccessUpdateCharacterStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// +/** This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service. Also, please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetContentDownloadUrl(FServerGetContentDownloadUrlRequest request, + FDelegateOnSuccessGetContentDownloadUrl onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetContentDownloadUrl = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetContentDownloadUrl); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetContentDownloadUrl"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.HttpMethod.IsEmpty() || request.HttpMethod == "") { + OutRestJsonObj->SetFieldNull(TEXT("HttpMethod")); + } else { + OutRestJsonObj->SetStringField(TEXT("HttpMethod"), request.HttpMethod); + } + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + OutRestJsonObj->SetBoolField(TEXT("ThruCDN"), request.ThruCDN); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetContentDownloadUrl(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetContentDownloadUrl.IsBound()) + { + FServerGetContentDownloadUrlResult result = UPlayFabServerModelDecoder::decodeGetContentDownloadUrlResultResponse(response.responseData); + OnSuccessGetContentDownloadUrl.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Friend List Management +////////////////////////////////////////////////////// +/** Adds the Friend user to the friendlist of the user with PlayFabId. At least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. */ +UPlayFabServerAPI* UPlayFabServerAPI::AddFriend(FServerAddFriendRequest request, + FDelegateOnSuccessAddFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddFriend = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAddFriend); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AddFriend"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.FriendEmail.IsEmpty() || request.FriendEmail == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendEmail")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendEmail"), request.FriendEmail); + } + if (request.FriendPlayFabId.IsEmpty() || request.FriendPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendPlayFabId"), request.FriendPlayFabId); + } + if (request.FriendTitleDisplayName.IsEmpty() || request.FriendTitleDisplayName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendTitleDisplayName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendTitleDisplayName"), request.FriendTitleDisplayName); + } + if (request.FriendUsername.IsEmpty() || request.FriendUsername == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendUsername")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendUsername"), request.FriendUsername); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAddFriend(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddFriend.IsBound()) + { + FServerEmptyResponse result = UPlayFabServerModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessAddFriend.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the current friends for the user with PlayFabId, constrained to users who have PlayFab accounts. Friends from linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetFriendsList(FServerGetFriendsListRequest request, + FDelegateOnSuccessGetFriendsList onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetFriendsList = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetFriendsList); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetFriendsList"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("IncludeFacebookFriends"), request.IncludeFacebookFriends); + OutRestJsonObj->SetBoolField(TEXT("IncludeSteamFriends"), request.IncludeSteamFriends); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetFriendsList(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetFriendsList.IsBound()) + { + FServerGetFriendsListResult result = UPlayFabServerModelDecoder::decodeGetFriendsListResultResponse(response.responseData); + OnSuccessGetFriendsList.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes the specified friend from the the user's friend list */ +UPlayFabServerAPI* UPlayFabServerAPI::RemoveFriend(FServerRemoveFriendRequest request, + FDelegateOnSuccessRemoveFriend onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveFriend = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRemoveFriend); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RemoveFriend"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.FriendPlayFabId.IsEmpty() || request.FriendPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendPlayFabId"), request.FriendPlayFabId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRemoveFriend(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveFriend.IsBound()) + { + FServerEmptyResponse result = UPlayFabServerModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessRemoveFriend.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the tag list for a specified user in the friend list of another user */ +UPlayFabServerAPI* UPlayFabServerAPI::SetFriendTags(FServerSetFriendTagsRequest request, + FDelegateOnSuccessSetFriendTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetFriendTags = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetFriendTags); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetFriendTags"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.FriendPlayFabId.IsEmpty() || request.FriendPlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("FriendPlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("FriendPlayFabId"), request.FriendPlayFabId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + // Check to see if string is empty + if (request.Tags.IsEmpty() || request.Tags == "") { + OutRestJsonObj->SetFieldNull(TEXT("Tags")); + } else { + TArray TagsArray; + FString(request.Tags).ParseIntoArray(TagsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Tags"), TagsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetFriendTags(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetFriendTags.IsBound()) + { + FServerEmptyResponse result = UPlayFabServerModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessSetFriendTags.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// +/** Inform the matchmaker that a Game Server Instance is removed. */ +UPlayFabServerAPI* UPlayFabServerAPI::DeregisterGame(FServerDeregisterGameRequest request, + FDelegateOnSuccessDeregisterGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeregisterGame = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperDeregisterGame); + + // Setup the request + manager->PlayFabRequestURL = "/Server/DeregisterGame"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperDeregisterGame(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeregisterGame.IsBound()) + { + FServerDeregisterGameResponse result = UPlayFabServerModelDecoder::decodeDeregisterGameResponseResponse(response.responseData); + OnSuccessDeregisterGame.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Informs the PlayFab match-making service that the user specified has left the Game Server Instance */ +UPlayFabServerAPI* UPlayFabServerAPI::NotifyMatchmakerPlayerLeft(FServerNotifyMatchmakerPlayerLeftRequest request, + FDelegateOnSuccessNotifyMatchmakerPlayerLeft onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessNotifyMatchmakerPlayerLeft = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperNotifyMatchmakerPlayerLeft); + + // Setup the request + manager->PlayFabRequestURL = "/Server/NotifyMatchmakerPlayerLeft"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperNotifyMatchmakerPlayerLeft(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessNotifyMatchmakerPlayerLeft.IsBound()) + { + FServerNotifyMatchmakerPlayerLeftResult result = UPlayFabServerModelDecoder::decodeNotifyMatchmakerPlayerLeftResultResponse(response.responseData); + OnSuccessNotifyMatchmakerPlayerLeft.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Validates a Game Server session ticket and returns details about the user */ +UPlayFabServerAPI* UPlayFabServerAPI::RedeemMatchmakerTicket(FServerRedeemMatchmakerTicketRequest request, + FDelegateOnSuccessRedeemMatchmakerTicket onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRedeemMatchmakerTicket = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRedeemMatchmakerTicket); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RedeemMatchmakerTicket"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + if (request.Ticket.IsEmpty() || request.Ticket == "") { + OutRestJsonObj->SetFieldNull(TEXT("Ticket")); + } else { + OutRestJsonObj->SetStringField(TEXT("Ticket"), request.Ticket); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRedeemMatchmakerTicket(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRedeemMatchmakerTicket.IsBound()) + { + FServerRedeemMatchmakerTicketResult result = UPlayFabServerModelDecoder::decodeRedeemMatchmakerTicketResultResponse(response.responseData); + OnSuccessRedeemMatchmakerTicket.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Set the state of the indicated Game Server Instance. Also update the heartbeat for the instance. */ +UPlayFabServerAPI* UPlayFabServerAPI::RefreshGameServerInstanceHeartbeat(FServerRefreshGameServerInstanceHeartbeatRequest request, + FDelegateOnSuccessRefreshGameServerInstanceHeartbeat onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRefreshGameServerInstanceHeartbeat = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRefreshGameServerInstanceHeartbeat); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RefreshGameServerInstanceHeartbeat"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRefreshGameServerInstanceHeartbeat(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRefreshGameServerInstanceHeartbeat.IsBound()) + { + FServerRefreshGameServerInstanceHeartbeatResult result = UPlayFabServerModelDecoder::decodeRefreshGameServerInstanceHeartbeatResultResponse(response.responseData); + OnSuccessRefreshGameServerInstanceHeartbeat.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Inform the matchmaker that a new Game Server Instance is added. */ +UPlayFabServerAPI* UPlayFabServerAPI::RegisterGame(FServerRegisterGameRequest request, + FDelegateOnSuccessRegisterGame onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRegisterGame = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRegisterGame); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RegisterGame"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Build.IsEmpty() || request.Build == "") { + OutRestJsonObj->SetFieldNull(TEXT("Build")); + } else { + OutRestJsonObj->SetStringField(TEXT("Build"), request.Build); + } + if (request.GameMode.IsEmpty() || request.GameMode == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameMode")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameMode"), request.GameMode); + } + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + FString temp_Region; + if (GetEnumValueToString(TEXT("ERegion"), request.Region, temp_Region)) + OutRestJsonObj->SetStringField(TEXT("Region"), temp_Region); + if (request.ServerHost.IsEmpty() || request.ServerHost == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerHost")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerHost"), request.ServerHost); + } + if (request.ServerIPV4Address.IsEmpty() || request.ServerIPV4Address == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerIPV4Address")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerIPV4Address"), request.ServerIPV4Address); + } + if (request.ServerIPV6Address.IsEmpty() || request.ServerIPV6Address == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerIPV6Address")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerIPV6Address"), request.ServerIPV6Address); + } + if (request.ServerPort.IsEmpty() || request.ServerPort == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerPort")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerPort"), request.ServerPort); + } + if (request.ServerPublicDNSName.IsEmpty() || request.ServerPublicDNSName == "") { + OutRestJsonObj->SetFieldNull(TEXT("ServerPublicDNSName")); + } else { + OutRestJsonObj->SetStringField(TEXT("ServerPublicDNSName"), request.ServerPublicDNSName); + } + if (request.Tags != nullptr) OutRestJsonObj->SetObjectField(TEXT("Tags"), request.Tags); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRegisterGame(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRegisterGame.IsBound()) + { + FServerRegisterGameResponse result = UPlayFabServerModelDecoder::decodeRegisterGameResponseResponse(response.responseData); + OnSuccessRegisterGame.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Sets the custom data of the indicated Game Server Instance */ +UPlayFabServerAPI* UPlayFabServerAPI::SetGameServerInstanceData(FServerSetGameServerInstanceDataRequest request, + FDelegateOnSuccessSetGameServerInstanceData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetGameServerInstanceData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetGameServerInstanceData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetGameServerInstanceData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.GameServerData.IsEmpty() || request.GameServerData == "") { + OutRestJsonObj->SetFieldNull(TEXT("GameServerData")); + } else { + OutRestJsonObj->SetStringField(TEXT("GameServerData"), request.GameServerData); + } + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetGameServerInstanceData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetGameServerInstanceData.IsBound()) + { + FServerSetGameServerInstanceDataResult result = UPlayFabServerModelDecoder::decodeSetGameServerInstanceDataResultResponse(response.responseData); + OnSuccessSetGameServerInstanceData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Set the state of the indicated Game Server Instance. */ +UPlayFabServerAPI* UPlayFabServerAPI::SetGameServerInstanceState(FServerSetGameServerInstanceStateRequest request, + FDelegateOnSuccessSetGameServerInstanceState onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetGameServerInstanceState = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetGameServerInstanceState); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetGameServerInstanceState"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + FString temp_State; + if (GetEnumValueToString(TEXT("EGameInstanceState"), request.State, temp_State)) + OutRestJsonObj->SetStringField(TEXT("State"), temp_State); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetGameServerInstanceState(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetGameServerInstanceState.IsBound()) + { + FServerSetGameServerInstanceStateResult result = UPlayFabServerModelDecoder::decodeSetGameServerInstanceStateResultResponse(response.responseData); + OnSuccessSetGameServerInstanceState.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Set custom tags for the specified Game Server Instance */ +UPlayFabServerAPI* UPlayFabServerAPI::SetGameServerInstanceTags(FServerSetGameServerInstanceTagsRequest request, + FDelegateOnSuccessSetGameServerInstanceTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetGameServerInstanceTags = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetGameServerInstanceTags); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetGameServerInstanceTags"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.LobbyId.IsEmpty() || request.LobbyId == "") { + OutRestJsonObj->SetFieldNull(TEXT("LobbyId")); + } else { + OutRestJsonObj->SetStringField(TEXT("LobbyId"), request.LobbyId); + } + if (request.Tags != nullptr) OutRestJsonObj->SetObjectField(TEXT("Tags"), request.Tags); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetGameServerInstanceTags(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetGameServerInstanceTags.IsBound()) + { + FServerSetGameServerInstanceTagsResult result = UPlayFabServerModelDecoder::decodeSetGameServerInstanceTagsResultResponse(response.responseData); + OnSuccessSetGameServerInstanceTags.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Platform Specific Methods +////////////////////////////////////////////////////// +/** Awards the specified users the specified Steam achievements */ +UPlayFabServerAPI* UPlayFabServerAPI::AwardSteamAchievement(FServerAwardSteamAchievementRequest request, + FDelegateOnSuccessAwardSteamAchievement onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAwardSteamAchievement = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAwardSteamAchievement); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AwardSteamAchievement"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Achievements.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Achievements")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Achievements"), request.Achievements); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAwardSteamAchievement(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAwardSteamAchievement.IsBound()) + { + FServerAwardSteamAchievementResult result = UPlayFabServerModelDecoder::decodeAwardSteamAchievementResultResponse(response.responseData); + OnSuccessAwardSteamAchievement.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// +/** Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. */ +UPlayFabServerAPI* UPlayFabServerAPI::DeleteUsers(FServerDeleteUsersRequest request, + FDelegateOnSuccessDeleteUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteUsers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperDeleteUsers); + + // Setup the request + manager->PlayFabRequestURL = "/Server/DeleteUsers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.PlayFabIds.IsEmpty() || request.PlayFabIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabIds")); + } else { + TArray PlayFabIdsArray; + FString(request.PlayFabIds).ParseIntoArray(PlayFabIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("PlayFabIds"), PlayFabIdsArray); + } + OutRestJsonObj->SetStringField(TEXT("TitleId"), IPlayFab::Get().getGameTitleId()); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperDeleteUsers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteUsers.IsBound()) + { + FServerDeleteUsersResult result = UPlayFabServerModelDecoder::decodeDeleteUsersResultResponse(response.responseData); + OnSuccessDeleteUsers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked friends of the given player for the given statistic, starting from the indicated point in the leaderboard */ +UPlayFabServerAPI* UPlayFabServerAPI::GetFriendLeaderboard(FServerGetFriendLeaderboardRequest request, + FDelegateOnSuccessGetFriendLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetFriendLeaderboard = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetFriendLeaderboard); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetFriendLeaderboard"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("IncludeFacebookFriends"), request.IncludeFacebookFriends); + OutRestJsonObj->SetBoolField(TEXT("IncludeSteamFriends"), request.IncludeSteamFriends); + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + OutRestJsonObj->SetNumberField(TEXT("StartPosition"), request.StartPosition); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + if (request.XboxToken.IsEmpty() || request.XboxToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("XboxToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("XboxToken"), request.XboxToken); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetFriendLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetFriendLeaderboard.IsBound()) + { + FServerGetLeaderboardResult result = UPlayFabServerModelDecoder::decodeGetLeaderboardResultResponse(response.responseData); + OnSuccessGetFriendLeaderboard.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard */ +UPlayFabServerAPI* UPlayFabServerAPI::GetLeaderboard(FServerGetLeaderboardRequest request, + FDelegateOnSuccessGetLeaderboard onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboard = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetLeaderboard); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetLeaderboard"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + OutRestJsonObj->SetNumberField(TEXT("StartPosition"), request.StartPosition); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetLeaderboard(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboard.IsBound()) + { + FServerGetLeaderboardResult result = UPlayFabServerModelDecoder::decodeGetLeaderboardResultResponse(response.responseData); + OnSuccessGetLeaderboard.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user */ +UPlayFabServerAPI* UPlayFabServerAPI::GetLeaderboardAroundUser(FServerGetLeaderboardAroundUserRequest request, + FDelegateOnSuccessGetLeaderboardAroundUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetLeaderboardAroundUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetLeaderboardAroundUser); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetLeaderboardAroundUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("MaxResultsCount"), request.MaxResultsCount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ProfileConstraints != nullptr) OutRestJsonObj->SetObjectField(TEXT("ProfileConstraints"), request.ProfileConstraints); + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + OutRestJsonObj->SetBoolField(TEXT("UseSpecificVersion"), request.UseSpecificVersion); + OutRestJsonObj->SetNumberField(TEXT("Version"), request.Version); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetLeaderboardAroundUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetLeaderboardAroundUser.IsBound()) + { + FServerGetLeaderboardAroundUserResult result = UPlayFabServerModelDecoder::decodeGetLeaderboardAroundUserResultResponse(response.responseData); + OnSuccessGetLeaderboardAroundUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be returned. All parameters default to false. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayerCombinedInfo(FServerGetPlayerCombinedInfoRequest request, + FDelegateOnSuccessGetPlayerCombinedInfo onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerCombinedInfo = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayerCombinedInfo); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayerCombinedInfo"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.InfoRequestParameters != nullptr) OutRestJsonObj->SetObjectField(TEXT("InfoRequestParameters"), request.InfoRequestParameters); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayerCombinedInfo(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerCombinedInfo.IsBound()) + { + FServerGetPlayerCombinedInfoResult result = UPlayFabServerModelDecoder::decodeGetPlayerCombinedInfoResultResponse(response.responseData); + OnSuccessGetPlayerCombinedInfo.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the current version and values for the indicated statistics, for the local player. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayerStatistics(FServerGetPlayerStatisticsRequest request, + FDelegateOnSuccessGetPlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayerStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayerStatistics"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + // Check to see if string is empty + if (request.StatisticNames.IsEmpty() || request.StatisticNames == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticNames")); + } else { + TArray StatisticNamesArray; + FString(request.StatisticNames).ParseIntoArray(StatisticNamesArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("StatisticNames"), StatisticNamesArray); + } + if (request.StatisticNameVersions.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("StatisticNameVersions")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("StatisticNameVersions"), request.StatisticNameVersions); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerStatistics.IsBound()) + { + FServerGetPlayerStatisticsResult result = UPlayFabServerModelDecoder::decodeGetPlayerStatisticsResultResponse(response.responseData); + OnSuccessGetPlayerStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the information on the available versions of the specified statistic. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayerStatisticVersions(FServerGetPlayerStatisticVersionsRequest request, + FDelegateOnSuccessGetPlayerStatisticVersions onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerStatisticVersions = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayerStatisticVersions); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayerStatisticVersions"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.StatisticName.IsEmpty() || request.StatisticName == "") { + OutRestJsonObj->SetFieldNull(TEXT("StatisticName")); + } else { + OutRestJsonObj->SetStringField(TEXT("StatisticName"), request.StatisticName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayerStatisticVersions(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerStatisticVersions.IsBound()) + { + FServerGetPlayerStatisticVersionsResult result = UPlayFabServerModelDecoder::decodeGetPlayerStatisticVersionsResultResponse(response.responseData); + OnSuccessGetPlayerStatisticVersions.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserData.IsBound()) + { + FServerGetUserDataResult result = UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which cannot be accessed by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserInternalData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserInternalData.IsBound()) + { + FServerGetUserDataResult result = UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserPublisherData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherData.IsBound()) + { + FServerGetUserDataResult result = UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which cannot be accessed by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserPublisherInternalData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserPublisherInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserPublisherInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherInternalData.IsBound()) + { + FServerGetUserDataResult result = UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the publisher-specific custom data for the user which can only be read by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserPublisherReadOnlyData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserPublisherReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserPublisherReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserPublisherReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserPublisherReadOnlyData.IsBound()) + { + FServerGetUserDataResult result = UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserPublisherReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title-specific custom data for the user which can only be read by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserReadOnlyData(FServerGetUserDataRequest request, + FDelegateOnSuccessGetUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("IfChangedFromDataVersion"), request.IfChangedFromDataVersion); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserReadOnlyData.IsBound()) + { + FServerGetUserDataResult result = UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(response.responseData); + OnSuccessGetUserReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the values of the specified title-specific statistics for the user */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdatePlayerStatistics(FServerUpdatePlayerStatisticsRequest request, + FDelegateOnSuccessUpdatePlayerStatistics onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdatePlayerStatistics = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdatePlayerStatistics); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdatePlayerStatistics"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("ForceUpdate"), request.ForceUpdate); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.Statistics.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Statistics")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Statistics"), request.Statistics); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdatePlayerStatistics(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdatePlayerStatistics.IsBound()) + { + FServerUpdatePlayerStatisticsResult result = UPlayFabServerModelDecoder::decodeUpdatePlayerStatisticsResultResponse(response.responseData); + OnSuccessUpdatePlayerStatistics.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user which is readable and writable by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserData.IsBound()) + { + FServerUpdateUserDataResult result = UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user which cannot be accessed by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserInternalData(FServerUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserInternalData.IsBound()) + { + FServerUpdateUserDataResult result = UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the publisher-specific custom data for the user which is readable and writable by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserPublisherData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherData.IsBound()) + { + FServerUpdateUserDataResult result = UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the publisher-specific custom data for the user which cannot be accessed by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserPublisherInternalData(FServerUpdateUserInternalDataRequest request, + FDelegateOnSuccessUpdateUserPublisherInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserPublisherInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserPublisherInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserPublisherInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherInternalData.IsBound()) + { + FServerUpdateUserDataResult result = UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the publisher-specific custom data for the user which can only be read by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserPublisherReadOnlyData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserPublisherReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserPublisherReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserPublisherReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserPublisherReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserPublisherReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserPublisherReadOnlyData.IsBound()) + { + FServerUpdateUserDataResult result = UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserPublisherReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the title-specific custom data for the user which can only be read by the client */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserReadOnlyData(FServerUpdateUserDataRequest request, + FDelegateOnSuccessUpdateUserReadOnlyData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserReadOnlyData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserReadOnlyData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserReadOnlyData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserReadOnlyData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserReadOnlyData.IsBound()) + { + FServerUpdateUserDataResult result = UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(response.responseData); + OnSuccessUpdateUserReadOnlyData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// +/** Increments the character's balance of the specified virtual currency by the stated amount */ +UPlayFabServerAPI* UPlayFabServerAPI::AddCharacterVirtualCurrency(FServerAddCharacterVirtualCurrencyRequest request, + FDelegateOnSuccessAddCharacterVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddCharacterVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAddCharacterVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AddCharacterVirtualCurrency"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAddCharacterVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddCharacterVirtualCurrency.IsBound()) + { + FServerModifyCharacterVirtualCurrencyResult result = UPlayFabServerModelDecoder::decodeModifyCharacterVirtualCurrencyResultResponse(response.responseData); + OnSuccessAddCharacterVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Increments the user's balance of the specified virtual currency by the stated amount */ +UPlayFabServerAPI* UPlayFabServerAPI::AddUserVirtualCurrency(FServerAddUserVirtualCurrencyRequest request, + FDelegateOnSuccessAddUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddUserVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAddUserVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AddUserVirtualCurrency"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAddUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddUserVirtualCurrency.IsBound()) + { + FServerModifyUserVirtualCurrencyResult result = UPlayFabServerModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(response.responseData); + OnSuccessAddUserVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. */ +UPlayFabServerAPI* UPlayFabServerAPI::ConsumeItem(FServerConsumeItemRequest request, + FDelegateOnSuccessConsumeItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessConsumeItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperConsumeItem); + + // Setup the request + manager->PlayFabRequestURL = "/Server/ConsumeItem"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + OutRestJsonObj->SetNumberField(TEXT("ConsumeCount"), request.ConsumeCount); + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperConsumeItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessConsumeItem.IsBound()) + { + FServerConsumeItemResult result = UPlayFabServerModelDecoder::decodeConsumeItemResultResponse(response.responseData); + OnSuccessConsumeItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Returns the result of an evaluation of a Random Result Table - the ItemId from the game Catalog which would have been added to the player inventory, if the Random Result Table were added via a Bundle or a call to UnlockContainer. */ +UPlayFabServerAPI* UPlayFabServerAPI::EvaluateRandomResultTable(FServerEvaluateRandomResultTableRequest request, + FDelegateOnSuccessEvaluateRandomResultTable onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessEvaluateRandomResultTable = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperEvaluateRandomResultTable); + + // Setup the request + manager->PlayFabRequestURL = "/Server/EvaluateRandomResultTable"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.TableId.IsEmpty() || request.TableId == "") { + OutRestJsonObj->SetFieldNull(TEXT("TableId")); + } else { + OutRestJsonObj->SetStringField(TEXT("TableId"), request.TableId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperEvaluateRandomResultTable(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessEvaluateRandomResultTable.IsBound()) + { + FServerEvaluateRandomResultTableResult result = UPlayFabServerModelDecoder::decodeEvaluateRandomResultTableResultResponse(response.responseData); + OnSuccessEvaluateRandomResultTable.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the specified character's current inventory of virtual goods */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCharacterInventory(FServerGetCharacterInventoryRequest request, + FDelegateOnSuccessGetCharacterInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCharacterInventory = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCharacterInventory); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCharacterInventory"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCharacterInventory(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCharacterInventory.IsBound()) + { + FServerGetCharacterInventoryResult result = UPlayFabServerModelDecoder::decodeGetCharacterInventoryResultResponse(response.responseData); + OnSuccessGetCharacterInventory.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the configuration information for the specified random results tables for the title, including all ItemId values and weights */ +UPlayFabServerAPI* UPlayFabServerAPI::GetRandomResultTables(FServerGetRandomResultTablesRequest request, + FDelegateOnSuccessGetRandomResultTables onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetRandomResultTables = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetRandomResultTables); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetRandomResultTables"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + // Check to see if string is empty + if (request.TableIDs.IsEmpty() || request.TableIDs == "") { + OutRestJsonObj->SetFieldNull(TEXT("TableIDs")); + } else { + TArray TableIDsArray; + FString(request.TableIDs).ParseIntoArray(TableIDsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("TableIDs"), TableIDsArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetRandomResultTables(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetRandomResultTables.IsBound()) + { + FServerGetRandomResultTablesResult result = UPlayFabServerModelDecoder::decodeGetRandomResultTablesResultResponse(response.responseData); + OnSuccessGetRandomResultTables.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the specified user's current inventory of virtual goods */ +UPlayFabServerAPI* UPlayFabServerAPI::GetUserInventory(FServerGetUserInventoryRequest request, + FDelegateOnSuccessGetUserInventory onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetUserInventory = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetUserInventory); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetUserInventory"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetUserInventory(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetUserInventory.IsBound()) + { + FServerGetUserInventoryResult result = UPlayFabServerModelDecoder::decodeGetUserInventoryResultResponse(response.responseData); + OnSuccessGetUserInventory.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds the specified items to the specified character's inventory */ +UPlayFabServerAPI* UPlayFabServerAPI::GrantItemsToCharacter(FServerGrantItemsToCharacterRequest request, + FDelegateOnSuccessGrantItemsToCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGrantItemsToCharacter = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGrantItemsToCharacter); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GrantItemsToCharacter"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Annotation.IsEmpty() || request.Annotation == "") { + OutRestJsonObj->SetFieldNull(TEXT("Annotation")); + } else { + OutRestJsonObj->SetStringField(TEXT("Annotation"), request.Annotation); + } + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + // Check to see if string is empty + if (request.ItemIds.IsEmpty() || request.ItemIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemIds")); + } else { + TArray ItemIdsArray; + FString(request.ItemIds).ParseIntoArray(ItemIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("ItemIds"), ItemIdsArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGrantItemsToCharacter(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGrantItemsToCharacter.IsBound()) + { + FServerGrantItemsToCharacterResult result = UPlayFabServerModelDecoder::decodeGrantItemsToCharacterResultResponse(response.responseData); + OnSuccessGrantItemsToCharacter.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds the specified items to the specified user's inventory */ +UPlayFabServerAPI* UPlayFabServerAPI::GrantItemsToUser(FServerGrantItemsToUserRequest request, + FDelegateOnSuccessGrantItemsToUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGrantItemsToUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGrantItemsToUser); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GrantItemsToUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Annotation.IsEmpty() || request.Annotation == "") { + OutRestJsonObj->SetFieldNull(TEXT("Annotation")); + } else { + OutRestJsonObj->SetStringField(TEXT("Annotation"), request.Annotation); + } + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + // Check to see if string is empty + if (request.ItemIds.IsEmpty() || request.ItemIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemIds")); + } else { + TArray ItemIdsArray; + FString(request.ItemIds).ParseIntoArray(ItemIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("ItemIds"), ItemIdsArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGrantItemsToUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGrantItemsToUser.IsBound()) + { + FServerGrantItemsToUserResult result = UPlayFabServerModelDecoder::decodeGrantItemsToUserResultResponse(response.responseData); + OnSuccessGrantItemsToUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds the specified items to the specified user inventories */ +UPlayFabServerAPI* UPlayFabServerAPI::GrantItemsToUsers(FServerGrantItemsToUsersRequest request, + FDelegateOnSuccessGrantItemsToUsers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGrantItemsToUsers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGrantItemsToUsers); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GrantItemsToUsers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.ItemGrants.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("ItemGrants")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("ItemGrants"), request.ItemGrants); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGrantItemsToUsers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGrantItemsToUsers.IsBound()) + { + FServerGrantItemsToUsersResult result = UPlayFabServerModelDecoder::decodeGrantItemsToUsersResultResponse(response.responseData); + OnSuccessGrantItemsToUsers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Modifies the number of remaining uses of a player's inventory item */ +UPlayFabServerAPI* UPlayFabServerAPI::ModifyItemUses(FServerModifyItemUsesRequest request, + FDelegateOnSuccessModifyItemUses onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessModifyItemUses = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperModifyItemUses); + + // Setup the request + manager->PlayFabRequestURL = "/Server/ModifyItemUses"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + OutRestJsonObj->SetNumberField(TEXT("UsesToAdd"), request.UsesToAdd); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperModifyItemUses(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessModifyItemUses.IsBound()) + { + FServerModifyItemUsesResult result = UPlayFabServerModelDecoder::decodeModifyItemUsesResultResponse(response.responseData); + OnSuccessModifyItemUses.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Moves an item from a character's inventory into another of the users's character's inventory. */ +UPlayFabServerAPI* UPlayFabServerAPI::MoveItemToCharacterFromCharacter(FServerMoveItemToCharacterFromCharacterRequest request, + FDelegateOnSuccessMoveItemToCharacterFromCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessMoveItemToCharacterFromCharacter = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperMoveItemToCharacterFromCharacter); + + // Setup the request + manager->PlayFabRequestURL = "/Server/MoveItemToCharacterFromCharacter"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.GivingCharacterId.IsEmpty() || request.GivingCharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("GivingCharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("GivingCharacterId"), request.GivingCharacterId); + } + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.ReceivingCharacterId.IsEmpty() || request.ReceivingCharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReceivingCharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReceivingCharacterId"), request.ReceivingCharacterId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperMoveItemToCharacterFromCharacter(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessMoveItemToCharacterFromCharacter.IsBound()) + { + FServerMoveItemToCharacterFromCharacterResult result = UPlayFabServerModelDecoder::decodeMoveItemToCharacterFromCharacterResultResponse(response.responseData); + OnSuccessMoveItemToCharacterFromCharacter.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Moves an item from a user's inventory into their character's inventory. */ +UPlayFabServerAPI* UPlayFabServerAPI::MoveItemToCharacterFromUser(FServerMoveItemToCharacterFromUserRequest request, + FDelegateOnSuccessMoveItemToCharacterFromUser onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessMoveItemToCharacterFromUser = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperMoveItemToCharacterFromUser); + + // Setup the request + manager->PlayFabRequestURL = "/Server/MoveItemToCharacterFromUser"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperMoveItemToCharacterFromUser(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessMoveItemToCharacterFromUser.IsBound()) + { + FServerMoveItemToCharacterFromUserResult result = UPlayFabServerModelDecoder::decodeMoveItemToCharacterFromUserResultResponse(response.responseData); + OnSuccessMoveItemToCharacterFromUser.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Moves an item from a character's inventory into the owning user's inventory. */ +UPlayFabServerAPI* UPlayFabServerAPI::MoveItemToUserFromCharacter(FServerMoveItemToUserFromCharacterRequest request, + FDelegateOnSuccessMoveItemToUserFromCharacter onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessMoveItemToUserFromCharacter = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperMoveItemToUserFromCharacter); + + // Setup the request + manager->PlayFabRequestURL = "/Server/MoveItemToUserFromCharacter"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperMoveItemToUserFromCharacter(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessMoveItemToUserFromCharacter.IsBound()) + { + FServerMoveItemToUserFromCharacterResult result = UPlayFabServerModelDecoder::decodeMoveItemToUserFromCharacterResultResponse(response.responseData); + OnSuccessMoveItemToUserFromCharacter.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ +UPlayFabServerAPI* UPlayFabServerAPI::RedeemCoupon(FServerRedeemCouponRequest request, + FDelegateOnSuccessRedeemCoupon onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRedeemCoupon = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRedeemCoupon); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RedeemCoupon"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.CouponCode.IsEmpty() || request.CouponCode == "") { + OutRestJsonObj->SetFieldNull(TEXT("CouponCode")); + } else { + OutRestJsonObj->SetStringField(TEXT("CouponCode"), request.CouponCode); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRedeemCoupon(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRedeemCoupon.IsBound()) + { + FServerRedeemCouponResult result = UPlayFabServerModelDecoder::decodeRedeemCouponResultResponse(response.responseData); + OnSuccessRedeemCoupon.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Submit a report about a player (due to bad bahavior, etc.) on behalf of another player, so that customer service representatives for the title can take action concerning potentially toxic players. */ +UPlayFabServerAPI* UPlayFabServerAPI::ReportPlayer(FServerReportPlayerServerRequest request, + FDelegateOnSuccessReportPlayer onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessReportPlayer = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperReportPlayer); + + // Setup the request + manager->PlayFabRequestURL = "/Server/ReportPlayer"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Comment.IsEmpty() || request.Comment == "") { + OutRestJsonObj->SetFieldNull(TEXT("Comment")); + } else { + OutRestJsonObj->SetStringField(TEXT("Comment"), request.Comment); + } + if (request.ReporteeId.IsEmpty() || request.ReporteeId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReporteeId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReporteeId"), request.ReporteeId); + } + if (request.ReporterId.IsEmpty() || request.ReporterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ReporterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ReporterId"), request.ReporterId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperReportPlayer(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessReportPlayer.IsBound()) + { + FServerReportPlayerServerResult result = UPlayFabServerModelDecoder::decodeReportPlayerServerResultResponse(response.responseData); + OnSuccessReportPlayer.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revokes access to an item in a user's inventory */ +UPlayFabServerAPI* UPlayFabServerAPI::RevokeInventoryItem(FServerRevokeInventoryItemRequest request, + FDelegateOnSuccessRevokeInventoryItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeInventoryItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRevokeInventoryItem); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RevokeInventoryItem"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRevokeInventoryItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeInventoryItem.IsBound()) + { + FServerRevokeInventoryResult result = UPlayFabServerModelDecoder::decodeRevokeInventoryResultResponse(response.responseData); + OnSuccessRevokeInventoryItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Revokes access for up to 25 items across multiple users and characters. */ +UPlayFabServerAPI* UPlayFabServerAPI::RevokeInventoryItems(FServerRevokeInventoryItemsRequest request, + FDelegateOnSuccessRevokeInventoryItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRevokeInventoryItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRevokeInventoryItems); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RevokeInventoryItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Items.Num() == 0) { + OutRestJsonObj->SetFieldNull(TEXT("Items")); + } else { + OutRestJsonObj->SetObjectArrayField(TEXT("Items"), request.Items); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRevokeInventoryItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRevokeInventoryItems.IsBound()) + { + FServerRevokeInventoryItemsResult result = UPlayFabServerModelDecoder::decodeRevokeInventoryItemsResultResponse(response.responseData); + OnSuccessRevokeInventoryItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Decrements the character's balance of the specified virtual currency by the stated amount. It is possible to make a VC balance negative with this API. */ +UPlayFabServerAPI* UPlayFabServerAPI::SubtractCharacterVirtualCurrency(FServerSubtractCharacterVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractCharacterVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSubtractCharacterVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSubtractCharacterVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SubtractCharacterVirtualCurrency"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSubtractCharacterVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSubtractCharacterVirtualCurrency.IsBound()) + { + FServerModifyCharacterVirtualCurrencyResult result = UPlayFabServerModelDecoder::decodeModifyCharacterVirtualCurrencyResultResponse(response.responseData); + OnSuccessSubtractCharacterVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Decrements the user's balance of the specified virtual currency by the stated amount. It is possible to make a VC balance negative with this API. */ +UPlayFabServerAPI* UPlayFabServerAPI::SubtractUserVirtualCurrency(FServerSubtractUserVirtualCurrencyRequest request, + FDelegateOnSuccessSubtractUserVirtualCurrency onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSubtractUserVirtualCurrency = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSubtractUserVirtualCurrency); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SubtractUserVirtualCurrency"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Amount"), request.Amount); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.VirtualCurrency.IsEmpty() || request.VirtualCurrency == "") { + OutRestJsonObj->SetFieldNull(TEXT("VirtualCurrency")); + } else { + OutRestJsonObj->SetStringField(TEXT("VirtualCurrency"), request.VirtualCurrency); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSubtractUserVirtualCurrency(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSubtractUserVirtualCurrency.IsBound()) + { + FServerModifyUserVirtualCurrencyResult result = UPlayFabServerModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(response.responseData); + OnSuccessSubtractUserVirtualCurrency.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Opens a specific container (ContainerItemInstanceId), with a specific key (KeyItemInstanceId, when required), and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. */ +UPlayFabServerAPI* UPlayFabServerAPI::UnlockContainerInstance(FServerUnlockContainerInstanceRequest request, + FDelegateOnSuccessUnlockContainerInstance onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlockContainerInstance = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUnlockContainerInstance); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UnlockContainerInstance"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ContainerItemInstanceId.IsEmpty() || request.ContainerItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContainerItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContainerItemInstanceId"), request.ContainerItemInstanceId); + } + if (request.KeyItemInstanceId.IsEmpty() || request.KeyItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeyItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("KeyItemInstanceId"), request.KeyItemInstanceId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUnlockContainerInstance(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlockContainerInstance.IsBound()) + { + FServerUnlockContainerItemResult result = UPlayFabServerModelDecoder::decodeUnlockContainerItemResultResponse(response.responseData); + OnSuccessUnlockContainerInstance.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Searches Player or Character inventory for any ItemInstance matching the given CatalogItemId, if necessary unlocks it using any appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. */ +UPlayFabServerAPI* UPlayFabServerAPI::UnlockContainerItem(FServerUnlockContainerItemRequest request, + FDelegateOnSuccessUnlockContainerItem onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUnlockContainerItem = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUnlockContainerItem); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UnlockContainerItem"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.ContainerItemId.IsEmpty() || request.ContainerItemId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContainerItemId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContainerItemId"), request.ContainerItemId); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUnlockContainerItem(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUnlockContainerItem.IsBound()) + { + FServerUnlockContainerItemResult result = UPlayFabServerModelDecoder::decodeUnlockContainerItemResultResponse(response.responseData); + OnSuccessUnlockContainerItem.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the key-value pair data tagged to the specified item, which is read-only from the client. */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateUserInventoryItemCustomData(FServerUpdateUserInventoryItemDataRequest request, + FDelegateOnSuccessUpdateUserInventoryItemCustomData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateUserInventoryItemCustomData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateUserInventoryItemCustomData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateUserInventoryItemCustomData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CharacterId.IsEmpty() || request.CharacterId == "") { + OutRestJsonObj->SetFieldNull(TEXT("CharacterId")); + } else { + OutRestJsonObj->SetStringField(TEXT("CharacterId"), request.CharacterId); + } + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + if (request.ItemInstanceId.IsEmpty() || request.ItemInstanceId == "") { + OutRestJsonObj->SetFieldNull(TEXT("ItemInstanceId")); + } else { + OutRestJsonObj->SetStringField(TEXT("ItemInstanceId"), request.ItemInstanceId); + } + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateUserInventoryItemCustomData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateUserInventoryItemCustomData.IsBound()) + { + FServerEmptyResponse result = UPlayFabServerModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessUpdateUserInventoryItemCustomData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// +/** Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. */ +UPlayFabServerAPI* UPlayFabServerAPI::AddPlayerTag(FServerAddPlayerTagRequest request, + FDelegateOnSuccessAddPlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddPlayerTag = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAddPlayerTag); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AddPlayerTag"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.TagName.IsEmpty() || request.TagName == "") { + OutRestJsonObj->SetFieldNull(TEXT("TagName")); + } else { + OutRestJsonObj->SetStringField(TEXT("TagName"), request.TagName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAddPlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddPlayerTag.IsBound()) + { + FServerAddPlayerTagResult result = UPlayFabServerModelDecoder::decodeAddPlayerTagResultResponse(response.responseData); + OnSuccessAddPlayerTag.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetAllSegments(FServerGetAllSegmentsRequest request, + FDelegateOnSuccessGetAllSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetAllSegments = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetAllSegments); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetAllSegments"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetAllSegments(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetAllSegments.IsBound()) + { + FServerGetAllSegmentsResult result = UPlayFabServerModelDecoder::decodeGetAllSegmentsResultResponse(response.responseData); + OnSuccessGetAllSegments.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** List all segments that a player currently belongs to at this moment in time. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayerSegments(FServerGetPlayersSegmentsRequest request, + FDelegateOnSuccessGetPlayerSegments onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerSegments = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayerSegments); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayerSegments"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayerSegments(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerSegments.IsBound()) + { + FServerGetPlayerSegmentsResult result = UPlayFabServerModelDecoder::decodeGetPlayerSegmentsResultResponse(response.responseData); + OnSuccessGetPlayerSegments.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayersInSegment(FServerGetPlayersInSegmentRequest request, + FDelegateOnSuccessGetPlayersInSegment onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayersInSegment = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayersInSegment); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayersInSegment"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.ContinuationToken.IsEmpty() || request.ContinuationToken == "") { + OutRestJsonObj->SetFieldNull(TEXT("ContinuationToken")); + } else { + OutRestJsonObj->SetStringField(TEXT("ContinuationToken"), request.ContinuationToken); + } + OutRestJsonObj->SetNumberField(TEXT("MaxBatchSize"), request.MaxBatchSize); + OutRestJsonObj->SetNumberField(TEXT("SecondsToLive"), request.SecondsToLive); + if (request.SegmentId.IsEmpty() || request.SegmentId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SegmentId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SegmentId"), request.SegmentId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayersInSegment(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayersInSegment.IsBound()) + { + FServerGetPlayersInSegmentResult result = UPlayFabServerModelDecoder::decodeGetPlayersInSegmentResultResponse(response.responseData); + OnSuccessGetPlayersInSegment.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Get all tags with a given Namespace (optional) from a player profile. */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPlayerTags(FServerGetPlayerTagsRequest request, + FDelegateOnSuccessGetPlayerTags onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPlayerTags = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPlayerTags); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPlayerTags"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Namespace.IsEmpty() || request.Namespace == "") { + OutRestJsonObj->SetFieldNull(TEXT("Namespace")); + } else { + OutRestJsonObj->SetStringField(TEXT("Namespace"), request.Namespace); + } + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPlayerTags(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPlayerTags.IsBound()) + { + FServerGetPlayerTagsResult result = UPlayFabServerModelDecoder::decodeGetPlayerTagsResultResponse(response.responseData); + OnSuccessGetPlayerTags.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. */ +UPlayFabServerAPI* UPlayFabServerAPI::RemovePlayerTag(FServerRemovePlayerTagRequest request, + FDelegateOnSuccessRemovePlayerTag onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemovePlayerTag = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRemovePlayerTag); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RemovePlayerTag"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + if (request.TagName.IsEmpty() || request.TagName == "") { + OutRestJsonObj->SetFieldNull(TEXT("TagName")); + } else { + OutRestJsonObj->SetStringField(TEXT("TagName"), request.TagName); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRemovePlayerTag(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemovePlayerTag.IsBound()) + { + FServerRemovePlayerTagResult result = UPlayFabServerModelDecoder::decodeRemovePlayerTagResultResponse(response.responseData); + OnSuccessRemovePlayerTag.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// +/** Executes a CloudScript function, with the 'currentPlayerId' variable set to the specified PlayFabId parameter value. */ +UPlayFabServerAPI* UPlayFabServerAPI::ExecuteCloudScript(FServerExecuteCloudScriptServerRequest request, + FDelegateOnSuccessExecuteCloudScript onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessExecuteCloudScript = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperExecuteCloudScript); + + // Setup the request + manager->PlayFabRequestURL = "/Server/ExecuteCloudScript"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.FunctionName.IsEmpty() || request.FunctionName == "") { + OutRestJsonObj->SetFieldNull(TEXT("FunctionName")); + } else { + OutRestJsonObj->SetStringField(TEXT("FunctionName"), request.FunctionName); + } + if (request.FunctionParameter != nullptr) OutRestJsonObj->SetObjectField(TEXT("FunctionParameter"), request.FunctionParameter); + OutRestJsonObj->SetBoolField(TEXT("GeneratePlayStreamEvent"), request.GeneratePlayStreamEvent); + if (request.PlayFabId.IsEmpty() || request.PlayFabId == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabId")); + } else { + OutRestJsonObj->SetStringField(TEXT("PlayFabId"), request.PlayFabId); + } + FString temp_RevisionSelection; + if (GetEnumValueToString(TEXT("ECloudScriptRevisionOption"), request.RevisionSelection, temp_RevisionSelection)) + OutRestJsonObj->SetStringField(TEXT("RevisionSelection"), temp_RevisionSelection); + OutRestJsonObj->SetNumberField(TEXT("SpecificRevision"), request.SpecificRevision); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperExecuteCloudScript(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessExecuteCloudScript.IsBound()) + { + FServerExecuteCloudScriptResult result = UPlayFabServerModelDecoder::decodeExecuteCloudScriptResultResponse(response.responseData); + OnSuccessExecuteCloudScript.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// +/** Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users in the group (and the server) can add new members. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabServerAPI* UPlayFabServerAPI::AddSharedGroupMembers(FServerAddSharedGroupMembersRequest request, + FDelegateOnSuccessAddSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessAddSharedGroupMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperAddSharedGroupMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Server/AddSharedGroupMembers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.PlayFabIds.IsEmpty() || request.PlayFabIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabIds")); + } else { + TArray PlayFabIdsArray; + FString(request.PlayFabIds).ParseIntoArray(PlayFabIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("PlayFabIds"), PlayFabIdsArray); + } + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperAddSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessAddSharedGroupMembers.IsBound()) + { + FServerAddSharedGroupMembersResult result = UPlayFabServerModelDecoder::decodeAddSharedGroupMembersResultResponse(response.responseData); + OnSuccessAddSharedGroupMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the group. When created by a server, the group will initially have no members. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabServerAPI* UPlayFabServerAPI::CreateSharedGroup(FServerCreateSharedGroupRequest request, + FDelegateOnSuccessCreateSharedGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessCreateSharedGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperCreateSharedGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Server/CreateSharedGroup"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperCreateSharedGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessCreateSharedGroup.IsBound()) + { + FServerCreateSharedGroupResult result = UPlayFabServerModelDecoder::decodeCreateSharedGroupResultResponse(response.responseData); + OnSuccessCreateSharedGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Deletes a shared group, freeing up the shared group ID to be reused for a new group. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabServerAPI* UPlayFabServerAPI::DeleteSharedGroup(FServerDeleteSharedGroupRequest request, + FDelegateOnSuccessDeleteSharedGroup onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessDeleteSharedGroup = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperDeleteSharedGroup); + + // Setup the request + manager->PlayFabRequestURL = "/Server/DeleteSharedGroup"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperDeleteSharedGroup(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessDeleteSharedGroup.IsBound()) + { + FServerEmptyResponse result = UPlayFabServerModelDecoder::decodeEmptyResponseResponse(response.responseData); + OnSuccessDeleteSharedGroup.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves data stored in a shared group object, as well as the list of members in the group. The server can access all public and private group data. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabServerAPI* UPlayFabServerAPI::GetSharedGroupData(FServerGetSharedGroupDataRequest request, + FDelegateOnSuccessGetSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetSharedGroupData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetSharedGroupData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetSharedGroupData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetBoolField(TEXT("GetMembers"), request.GetMembers); + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetSharedGroupData.IsBound()) + { + FServerGetSharedGroupDataResult result = UPlayFabServerModelDecoder::decodeGetSharedGroupDataResultResponse(response.responseData); + OnSuccessGetSharedGroupData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the group can remove members. If as a result of the call, zero users remain with access, the group and its associated data will be deleted. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabServerAPI* UPlayFabServerAPI::RemoveSharedGroupMembers(FServerRemoveSharedGroupMembersRequest request, + FDelegateOnSuccessRemoveSharedGroupMembers onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessRemoveSharedGroupMembers = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperRemoveSharedGroupMembers); + + // Setup the request + manager->PlayFabRequestURL = "/Server/RemoveSharedGroupMembers"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.PlayFabIds.IsEmpty() || request.PlayFabIds == "") { + OutRestJsonObj->SetFieldNull(TEXT("PlayFabIds")); + } else { + TArray PlayFabIdsArray; + FString(request.PlayFabIds).ParseIntoArray(PlayFabIdsArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("PlayFabIds"), PlayFabIdsArray); + } + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperRemoveSharedGroupMembers(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessRemoveSharedGroupMembers.IsBound()) + { + FServerRemoveSharedGroupMembersResult result = UPlayFabServerModelDecoder::decodeRemoveSharedGroupMembersResultResponse(response.responseData); + OnSuccessRemoveSharedGroupMembers.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated or added in this call will be readable by users not in the group. By default, data permissions are set to Private. Regardless of the permission setting, only members of the group (and the server) can update the data. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups */ +UPlayFabServerAPI* UPlayFabServerAPI::UpdateSharedGroupData(FServerUpdateSharedGroupDataRequest request, + FDelegateOnSuccessUpdateSharedGroupData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessUpdateSharedGroupData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperUpdateSharedGroupData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/UpdateSharedGroupData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Data != nullptr) OutRestJsonObj->SetObjectField(TEXT("Data"), request.Data); + // Check to see if string is empty + if (request.KeysToRemove.IsEmpty() || request.KeysToRemove == "") { + OutRestJsonObj->SetFieldNull(TEXT("KeysToRemove")); + } else { + TArray KeysToRemoveArray; + FString(request.KeysToRemove).ParseIntoArray(KeysToRemoveArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("KeysToRemove"), KeysToRemoveArray); + } + FString temp_Permission; + if (GetEnumValueToString(TEXT("EUserDataPermission"), request.Permission, temp_Permission)) + OutRestJsonObj->SetStringField(TEXT("Permission"), temp_Permission); + if (request.SharedGroupId.IsEmpty() || request.SharedGroupId == "") { + OutRestJsonObj->SetFieldNull(TEXT("SharedGroupId")); + } else { + OutRestJsonObj->SetStringField(TEXT("SharedGroupId"), request.SharedGroupId); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperUpdateSharedGroupData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessUpdateSharedGroupData.IsBound()) + { + FServerUpdateSharedGroupDataResult result = UPlayFabServerModelDecoder::decodeUpdateSharedGroupDataResultResponse(response.responseData); + OnSuccessUpdateSharedGroupData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// +/** Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ +UPlayFabServerAPI* UPlayFabServerAPI::GetCatalogItems(FServerGetCatalogItemsRequest request, + FDelegateOnSuccessGetCatalogItems onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetCatalogItems = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetCatalogItems); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetCatalogItems"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.CatalogVersion.IsEmpty() || request.CatalogVersion == "") { + OutRestJsonObj->SetFieldNull(TEXT("CatalogVersion")); + } else { + OutRestJsonObj->SetStringField(TEXT("CatalogVersion"), request.CatalogVersion); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetCatalogItems(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetCatalogItems.IsBound()) + { + FServerGetCatalogItemsResult result = UPlayFabServerModelDecoder::decodeGetCatalogItemsResultResponse(response.responseData); + OnSuccessGetCatalogItems.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom publisher settings */ +UPlayFabServerAPI* UPlayFabServerAPI::GetPublisherData(FServerGetPublisherDataRequest request, + FDelegateOnSuccessGetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetPublisherData.IsBound()) + { + FServerGetPublisherDataResult result = UPlayFabServerModelDecoder::decodeGetPublisherDataResultResponse(response.responseData); + OnSuccessGetPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the current server time */ +UPlayFabServerAPI* UPlayFabServerAPI::GetTime(FServerGetTimeRequest request, + FDelegateOnSuccessGetTime onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTime = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetTime); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetTime"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetTime(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTime.IsBound()) + { + FServerGetTimeResult result = UPlayFabServerModelDecoder::decodeGetTimeResultResponse(response.responseData); + OnSuccessGetTime.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom title settings */ +UPlayFabServerAPI* UPlayFabServerAPI::GetTitleData(FServerGetTitleDataRequest request, + FDelegateOnSuccessGetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetTitleData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetTitleData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleData.IsBound()) + { + FServerGetTitleDataResult result = UPlayFabServerModelDecoder::decodeGetTitleDataResultResponse(response.responseData); + OnSuccessGetTitleData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the key-value store of custom internal title settings */ +UPlayFabServerAPI* UPlayFabServerAPI::GetTitleInternalData(FServerGetTitleDataRequest request, + FDelegateOnSuccessGetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetTitleInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetTitleInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + // Check to see if string is empty + if (request.Keys.IsEmpty() || request.Keys == "") { + OutRestJsonObj->SetFieldNull(TEXT("Keys")); + } else { + TArray KeysArray; + FString(request.Keys).ParseIntoArray(KeysArray, TEXT(","), false); + OutRestJsonObj->SetStringArrayField(TEXT("Keys"), KeysArray); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleInternalData.IsBound()) + { + FServerGetTitleDataResult result = UPlayFabServerModelDecoder::decodeGetTitleDataResultResponse(response.responseData); + OnSuccessGetTitleInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Retrieves the title news feed, as configured in the developer portal */ +UPlayFabServerAPI* UPlayFabServerAPI::GetTitleNews(FServerGetTitleNewsRequest request, + FDelegateOnSuccessGetTitleNews onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessGetTitleNews = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperGetTitleNews); + + // Setup the request + manager->PlayFabRequestURL = "/Server/GetTitleNews"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + OutRestJsonObj->SetNumberField(TEXT("Count"), request.Count); + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperGetTitleNews(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessGetTitleNews.IsBound()) + { + FServerGetTitleNewsResult result = UPlayFabServerModelDecoder::decodeGetTitleNewsResultResponse(response.responseData); + OnSuccessGetTitleNews.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the key-value store of custom publisher settings */ +UPlayFabServerAPI* UPlayFabServerAPI::SetPublisherData(FServerSetPublisherDataRequest request, + FDelegateOnSuccessSetPublisherData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetPublisherData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetPublisherData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetPublisherData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Value.IsEmpty() || request.Value == "") { + OutRestJsonObj->SetFieldNull(TEXT("Value")); + } else { + OutRestJsonObj->SetStringField(TEXT("Value"), request.Value); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetPublisherData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetPublisherData.IsBound()) + { + FServerSetPublisherDataResult result = UPlayFabServerModelDecoder::decodeSetPublisherDataResultResponse(response.responseData); + OnSuccessSetPublisherData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the key-value store of custom title settings */ +UPlayFabServerAPI* UPlayFabServerAPI::SetTitleData(FServerSetTitleDataRequest request, + FDelegateOnSuccessSetTitleData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetTitleData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetTitleData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetTitleData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Value.IsEmpty() || request.Value == "") { + OutRestJsonObj->SetFieldNull(TEXT("Value")); + } else { + OutRestJsonObj->SetStringField(TEXT("Value"), request.Value); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetTitleData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetTitleData.IsBound()) + { + FServerSetTitleDataResult result = UPlayFabServerModelDecoder::decodeSetTitleDataResultResponse(response.responseData); + OnSuccessSetTitleData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + +/** Updates the key-value store of custom title settings */ +UPlayFabServerAPI* UPlayFabServerAPI::SetTitleInternalData(FServerSetTitleDataRequest request, + FDelegateOnSuccessSetTitleInternalData onSuccess, + FDelegateOnFailurePlayFabError onFailure, + UObject* customData) +{ + // Objects containing request data + UPlayFabServerAPI* manager = NewObject(); + if (manager->IsSafeForRootSet()) manager->AddToRoot(); + UPlayFabJsonObject* OutRestJsonObj = NewObject(); + manager->mCustomData = customData; + + // Assign delegates + manager->OnSuccessSetTitleInternalData = onSuccess; + manager->OnFailure = onFailure; + manager->OnPlayFabResponse.AddDynamic(manager, &UPlayFabServerAPI::HelperSetTitleInternalData); + + // Setup the request + manager->PlayFabRequestURL = "/Server/SetTitleInternalData"; + manager->useSecretKey = true; + + // Serialize all the request properties to json + if (request.Key.IsEmpty() || request.Key == "") { + OutRestJsonObj->SetFieldNull(TEXT("Key")); + } else { + OutRestJsonObj->SetStringField(TEXT("Key"), request.Key); + } + if (request.Value.IsEmpty() || request.Value == "") { + OutRestJsonObj->SetFieldNull(TEXT("Value")); + } else { + OutRestJsonObj->SetStringField(TEXT("Value"), request.Value); + } + + // Add Request to manager + manager->SetRequestObject(OutRestJsonObj); + + return manager; +} + +// Implements FOnPlayFabServerRequestCompleted +void UPlayFabServerAPI::HelperSetTitleInternalData(FPlayFabBaseModel response, UObject* customData, bool successful) +{ + FPlayFabError error = response.responseError; + if (error.hasError && OnFailure.IsBound()) + { + OnFailure.Execute(error, customData); + } + else if (!error.hasError && OnSuccessSetTitleInternalData.IsBound()) + { + FServerSetTitleDataResult result = UPlayFabServerModelDecoder::decodeSetTitleDataResultResponse(response.responseData); + OnSuccessSetTitleInternalData.Execute(result, mCustomData); + } + this->RemoveFromRoot(); +} + + + +void UPlayFabServerAPI::OnProcessRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) +{ + // Be sure that we have no data from previous response + ResetResponseData(); + + if (!IsValidLowLevel()) + { + UE_LOG(LogPlayFab, Error, TEXT("The request object is invalid during OnProcessRequestComplete.")); + return; + } + if (!OnPlayFabResponse.IsBound()) + { + UE_LOG(LogPlayFab, Error, TEXT("OnPlayFabResponse has come un-bound during OnProcessRequestComplete.")); + return; + } + + FPlayFabBaseModel myResponse; + + // Check we have result to process further + if (!bWasSuccessful) + { + UE_LOG(LogPlayFab, Error, TEXT("Request failed: %s"), *Request->GetURL()); + + // Broadcast the result event + myResponse.responseError.hasError = true; + myResponse.responseError.ErrorCode = 503; + myResponse.responseError.ErrorName = "Unable to contact server"; + myResponse.responseError.ErrorMessage = "Unable to contact server"; + + OnPlayFabResponse.Broadcast(myResponse, mCustomData, false); + + return; + } + + // Save response data as a string + ResponseContent = Response->GetContentAsString(); + + // Save response code as int32 + ResponseCode = Response->GetResponseCode(); + + // Try to deserialize data to JSON + TSharedRef> JsonReader = TJsonReaderFactory::Create(ResponseContent); + FJsonSerializer::Deserialize(JsonReader, ResponseJsonObj->GetRootObject()); + + // Decide whether the request was successful + bIsValidJsonResponse = bWasSuccessful && ResponseJsonObj->GetRootObject().IsValid(); + + // Log errors + if (!bIsValidJsonResponse) + UE_LOG(LogPlayFab, Warning, TEXT("JSON could not be decoded!")); + + // Log response state + UE_LOG(LogPlayFab, Log, TEXT("Response : %s"), *ResponseContent); + + myResponse.responseError.decodeError(ResponseJsonObj); + myResponse.responseData = ResponseJsonObj; + IPlayFab* pfSettings = &(IPlayFab::Get()); + + if (returnsEntityToken) + pfSettings->setEntityToken(myResponse.responseData->GetObjectField("data")->GetStringField("EntityToken")); + + // Broadcast the result event + OnPlayFabResponse.Broadcast(myResponse, mCustomData, myResponse.responseError.hasError); + pfSettings->ModifyPendingCallCount(-1); +} + +void UPlayFabServerAPI::Activate() +{ + IPlayFab* pfSettings = &(IPlayFab::Get()); + + FString RequestUrl; + RequestUrl = pfSettings->getUrl(PlayFabRequestURL); + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(RequestUrl); + HttpRequest->SetVerb(TEXT("POST")); + + // Headers + auto entityToken = pfSettings->getEntityToken(); + auto clientToken = pfSettings->getSessionTicket(); + auto devSecretKey = pfSettings->getSecretApiKey(); + if (useEntityToken && entityToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-EntityToken"), entityToken); + else if (useSessionTicket && clientToken.Len() > 0) + HttpRequest->SetHeader(TEXT("X-Authentication"), clientToken); + else if (useSecretKey && devSecretKey.Len() > 0) + HttpRequest->SetHeader(TEXT("X-SecretKey"), devSecretKey); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), pfSettings->getVersionString()); + HttpRequest->SetHeader(TEXT("X-ReportErrorAsSuccess"), TEXT("true")); // FHttpResponsePtr doesn't provide sufficient information when an error code is returned + for (TMap::TConstIterator It(RequestHeaders); It; ++It) + HttpRequest->SetHeader(It.Key(), It.Value()); + + // Serialize data to json string + FString OutputString; + TSharedRef< TJsonWriter<> > Writer = TJsonWriterFactory<>::Create(&OutputString); + FJsonSerializer::Serialize(RequestJsonObj->GetRootObject().ToSharedRef(), Writer); + + // Set Json content + HttpRequest->SetContentAsString(OutputString); + + UE_LOG(LogPlayFab, Log, TEXT("Request: %s"), *OutputString); + + // Bind event + HttpRequest->OnProcessRequestComplete().BindUObject(this, &UPlayFabServerAPI::OnProcessRequestComplete); + + // Execute the request + pfSettings->ModifyPendingCallCount(1); + HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::ResetResponseData() +{ + if (ResponseJsonObj != nullptr) + ResponseJsonObj->Reset(); + else + ResponseJsonObj = NewObject(); + bIsValidJsonResponse = false; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabServerModelDecoder.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabServerModelDecoder.cpp new file mode 100644 index 000000000..dc82b0251 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabServerModelDecoder.cpp @@ -0,0 +1,1050 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Server +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabServerModelDecoder.h" +#include "PlayFabPrivate.h" + +////////////////////////////////////////////////////////////////////////// +// Generated PlayFab Server API Functions +////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////// +// Account Management +////////////////////////////////////////////////////// + +FServerBanUsersResult UPlayFabServerModelDecoder::decodeBanUsersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerBanUsersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FServerGetPlayerProfileResult UPlayFabServerModelDecoder::decodeGetPlayerProfileResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayerProfileResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayerProfile = !(dataObj->HasField("PlayerProfile")) ? nullptr : dataObj->GetObjectField("PlayerProfile"); + + return tempStruct; +} + +FServerGetPlayFabIDsFromFacebookIDsResult UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromFacebookIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayFabIDsFromFacebookIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FServerGetPlayFabIDsFromFacebookInstantGamesIdsResult UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromFacebookInstantGamesIdsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayFabIDsFromFacebookInstantGamesIdsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsResult UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromNintendoSwitchDeviceIdsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayFabIDsFromNintendoSwitchDeviceIdsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FServerGetPlayFabIDsFromSteamIDsResult UPlayFabServerModelDecoder::decodeGetPlayFabIDsFromSteamIDsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayFabIDsFromSteamIDsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? TArray() : dataObj->GetObjectArrayField("Data"); + + return tempStruct; +} + +FServerGetUserAccountInfoResult UPlayFabServerModelDecoder::decodeGetUserAccountInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetUserAccountInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.UserInfo = !(dataObj->HasField("UserInfo")) ? nullptr : dataObj->GetObjectField("UserInfo"); + + return tempStruct; +} + +FServerGetUserBansResult UPlayFabServerModelDecoder::decodeGetUserBansResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetUserBansResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FServerRevokeAllBansForUserResult UPlayFabServerModelDecoder::decodeRevokeAllBansForUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRevokeAllBansForUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FServerRevokeBansResult UPlayFabServerModelDecoder::decodeRevokeBansResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRevokeBansResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + +FServerSendCustomAccountRecoveryEmailResult UPlayFabServerModelDecoder::decodeSendCustomAccountRecoveryEmailResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSendCustomAccountRecoveryEmailResult tempStruct; + + + return tempStruct; +} + +FServerSendEmailFromTemplateResult UPlayFabServerModelDecoder::decodeSendEmailFromTemplateResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSendEmailFromTemplateResult tempStruct; + + + return tempStruct; +} + +FServerSendPushNotificationResult UPlayFabServerModelDecoder::decodeSendPushNotificationResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSendPushNotificationResult tempStruct; + + + return tempStruct; +} + +FServerEmptyResponse UPlayFabServerModelDecoder::decodeEmptyResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerEmptyResponse tempStruct; + + + return tempStruct; +} + +FServerUpdateBansResult UPlayFabServerModelDecoder::decodeUpdateBansResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUpdateBansResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.BanData = !(dataObj->HasField("BanData")) ? TArray() : dataObj->GetObjectArrayField("BanData"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Analytics +////////////////////////////////////////////////////// + +FServerWriteEventResponse UPlayFabServerModelDecoder::decodeWriteEventResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerWriteEventResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.EventId = !(dataObj->HasField("EventId")) ? TEXT("") : dataObj->GetStringField("EventId"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Authentication +////////////////////////////////////////////////////// + +FServerAuthenticateSessionTicketResult UPlayFabServerModelDecoder::decodeAuthenticateSessionTicketResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerAuthenticateSessionTicketResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.UserInfo = !(dataObj->HasField("UserInfo")) ? nullptr : dataObj->GetObjectField("UserInfo"); + + return tempStruct; +} + +FServerSetPlayerSecretResult UPlayFabServerModelDecoder::decodeSetPlayerSecretResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSetPlayerSecretResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Character Data +////////////////////////////////////////////////////// + +FServerGetCharacterDataResult UPlayFabServerModelDecoder::decodeGetCharacterDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetCharacterDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FServerUpdateCharacterDataResult UPlayFabServerModelDecoder::decodeUpdateCharacterDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUpdateCharacterDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Characters +////////////////////////////////////////////////////// + +FServerDeleteCharacterFromUserResult UPlayFabServerModelDecoder::decodeDeleteCharacterFromUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerDeleteCharacterFromUserResult tempStruct; + + + return tempStruct; +} + +FServerListUsersCharactersResult UPlayFabServerModelDecoder::decodeListUsersCharactersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerListUsersCharactersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Characters = !(dataObj->HasField("Characters")) ? TArray() : dataObj->GetObjectArrayField("Characters"); + + return tempStruct; +} + +FServerGetCharacterLeaderboardResult UPlayFabServerModelDecoder::decodeGetCharacterLeaderboardResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetCharacterLeaderboardResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + + return tempStruct; +} + +FServerGetCharacterStatisticsResult UPlayFabServerModelDecoder::decodeGetCharacterStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetCharacterStatisticsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + tempStruct.CharacterStatistics = !(dataObj->HasField("CharacterStatistics")) ? nullptr : dataObj->GetObjectField("CharacterStatistics"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FServerGetLeaderboardAroundCharacterResult UPlayFabServerModelDecoder::decodeGetLeaderboardAroundCharacterResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetLeaderboardAroundCharacterResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + + return tempStruct; +} + +FServerGetLeaderboardForUsersCharactersResult UPlayFabServerModelDecoder::decodeGetLeaderboardForUsersCharactersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetLeaderboardForUsersCharactersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + + return tempStruct; +} + +FServerGrantCharacterToUserResult UPlayFabServerModelDecoder::decodeGrantCharacterToUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGrantCharacterToUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + + return tempStruct; +} + +FServerUpdateCharacterStatisticsResult UPlayFabServerModelDecoder::decodeUpdateCharacterStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUpdateCharacterStatisticsResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Content +////////////////////////////////////////////////////// + +FServerGetContentDownloadUrlResult UPlayFabServerModelDecoder::decodeGetContentDownloadUrlResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetContentDownloadUrlResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.URL = !(dataObj->HasField("URL")) ? TEXT("") : dataObj->GetStringField("URL"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Friend List Management +////////////////////////////////////////////////////// + +FServerGetFriendsListResult UPlayFabServerModelDecoder::decodeGetFriendsListResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetFriendsListResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Friends = !(dataObj->HasField("Friends")) ? TArray() : dataObj->GetObjectArrayField("Friends"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Matchmaking +////////////////////////////////////////////////////// + +FServerDeregisterGameResponse UPlayFabServerModelDecoder::decodeDeregisterGameResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerDeregisterGameResponse tempStruct; + + + return tempStruct; +} + +FServerNotifyMatchmakerPlayerLeftResult UPlayFabServerModelDecoder::decodeNotifyMatchmakerPlayerLeftResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerNotifyMatchmakerPlayerLeftResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + GetEnumValueFromString(TEXT("EPlayerConnectionState"), dataObj->GetStringField("PlayerState"), tempStruct.PlayerState); + + return tempStruct; +} + +FServerRedeemMatchmakerTicketResult UPlayFabServerModelDecoder::decodeRedeemMatchmakerTicketResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRedeemMatchmakerTicketResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Error = !(dataObj->HasField("Error")) ? TEXT("") : dataObj->GetStringField("Error"); + tempStruct.TicketIsValid = !(dataObj->HasField("TicketIsValid")) ? false : dataObj->GetBoolField("TicketIsValid"); + tempStruct.UserInfo = !(dataObj->HasField("UserInfo")) ? nullptr : dataObj->GetObjectField("UserInfo"); + + return tempStruct; +} + +FServerRefreshGameServerInstanceHeartbeatResult UPlayFabServerModelDecoder::decodeRefreshGameServerInstanceHeartbeatResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRefreshGameServerInstanceHeartbeatResult tempStruct; + + + return tempStruct; +} + +FServerRegisterGameResponse UPlayFabServerModelDecoder::decodeRegisterGameResponseResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRegisterGameResponse tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.LobbyId = !(dataObj->HasField("LobbyId")) ? TEXT("") : dataObj->GetStringField("LobbyId"); + + return tempStruct; +} + +FServerSetGameServerInstanceDataResult UPlayFabServerModelDecoder::decodeSetGameServerInstanceDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSetGameServerInstanceDataResult tempStruct; + + + return tempStruct; +} + +FServerSetGameServerInstanceStateResult UPlayFabServerModelDecoder::decodeSetGameServerInstanceStateResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSetGameServerInstanceStateResult tempStruct; + + + return tempStruct; +} + +FServerSetGameServerInstanceTagsResult UPlayFabServerModelDecoder::decodeSetGameServerInstanceTagsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSetGameServerInstanceTagsResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Platform Specific Methods +////////////////////////////////////////////////////// + +FServerAwardSteamAchievementResult UPlayFabServerModelDecoder::decodeAwardSteamAchievementResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerAwardSteamAchievementResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.AchievementResults = !(dataObj->HasField("AchievementResults")) ? TArray() : dataObj->GetObjectArrayField("AchievementResults"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Player Data Management +////////////////////////////////////////////////////// + +FServerDeleteUsersResult UPlayFabServerModelDecoder::decodeDeleteUsersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerDeleteUsersResult tempStruct; + + + return tempStruct; +} + +FServerGetLeaderboardResult UPlayFabServerModelDecoder::decodeGetLeaderboardResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetLeaderboardResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + tempStruct.NextReset = !(dataObj->HasField("NextReset")) ? TEXT("") : dataObj->GetStringField("NextReset"); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + +FServerGetLeaderboardAroundUserResult UPlayFabServerModelDecoder::decodeGetLeaderboardAroundUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetLeaderboardAroundUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Leaderboard = !(dataObj->HasField("Leaderboard")) ? TArray() : dataObj->GetObjectArrayField("Leaderboard"); + tempStruct.NextReset = !(dataObj->HasField("NextReset")) ? TEXT("") : dataObj->GetStringField("NextReset"); + tempStruct.Version = !(dataObj->HasField("Version")) ? 0 : int(dataObj->GetNumberField("Version")); + + return tempStruct; +} + +FServerGetPlayerCombinedInfoResult UPlayFabServerModelDecoder::decodeGetPlayerCombinedInfoResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayerCombinedInfoResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.InfoResultPayload = !(dataObj->HasField("InfoResultPayload")) ? nullptr : dataObj->GetObjectField("InfoResultPayload"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FServerGetPlayerStatisticsResult UPlayFabServerModelDecoder::decodeGetPlayerStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayerStatisticsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.Statistics = !(dataObj->HasField("Statistics")) ? TArray() : dataObj->GetObjectArrayField("Statistics"); + + return tempStruct; +} + +FServerGetPlayerStatisticVersionsResult UPlayFabServerModelDecoder::decodeGetPlayerStatisticVersionsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayerStatisticVersionsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.StatisticVersions = !(dataObj->HasField("StatisticVersions")) ? TArray() : dataObj->GetObjectArrayField("StatisticVersions"); + + return tempStruct; +} + +FServerGetUserDataResult UPlayFabServerModelDecoder::decodeGetUserDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetUserDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + + return tempStruct; +} + +FServerUpdatePlayerStatisticsResult UPlayFabServerModelDecoder::decodeUpdatePlayerStatisticsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUpdatePlayerStatisticsResult tempStruct; + + + return tempStruct; +} + +FServerUpdateUserDataResult UPlayFabServerModelDecoder::decodeUpdateUserDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUpdateUserDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.DataVersion = !(dataObj->HasField("DataVersion")) ? 0 : int(dataObj->GetNumberField("DataVersion")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Player Item Management +////////////////////////////////////////////////////// + +FServerModifyCharacterVirtualCurrencyResult UPlayFabServerModelDecoder::decodeModifyCharacterVirtualCurrencyResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerModifyCharacterVirtualCurrencyResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Balance = !(dataObj->HasField("Balance")) ? 0 : int(dataObj->GetNumberField("Balance")); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? TEXT("") : dataObj->GetStringField("VirtualCurrency"); + + return tempStruct; +} + +FServerModifyUserVirtualCurrencyResult UPlayFabServerModelDecoder::decodeModifyUserVirtualCurrencyResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerModifyUserVirtualCurrencyResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Balance = !(dataObj->HasField("Balance")) ? 0 : int(dataObj->GetNumberField("Balance")); + tempStruct.BalanceChange = !(dataObj->HasField("BalanceChange")) ? 0 : int(dataObj->GetNumberField("BalanceChange")); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? TEXT("") : dataObj->GetStringField("VirtualCurrency"); + + return tempStruct; +} + +FServerConsumeItemResult UPlayFabServerModelDecoder::decodeConsumeItemResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerConsumeItemResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemInstanceId = !(dataObj->HasField("ItemInstanceId")) ? TEXT("") : dataObj->GetStringField("ItemInstanceId"); + tempStruct.RemainingUses = !(dataObj->HasField("RemainingUses")) ? 0 : int(dataObj->GetNumberField("RemainingUses")); + + return tempStruct; +} + +FServerEvaluateRandomResultTableResult UPlayFabServerModelDecoder::decodeEvaluateRandomResultTableResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerEvaluateRandomResultTableResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ResultItemId = !(dataObj->HasField("ResultItemId")) ? TEXT("") : dataObj->GetStringField("ResultItemId"); + + return tempStruct; +} + +FServerGetCharacterInventoryResult UPlayFabServerModelDecoder::decodeGetCharacterInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetCharacterInventoryResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.CharacterId = !(dataObj->HasField("CharacterId")) ? TEXT("") : dataObj->GetStringField("CharacterId"); + tempStruct.Inventory = !(dataObj->HasField("Inventory")) ? TArray() : dataObj->GetObjectArrayField("Inventory"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + tempStruct.VirtualCurrencyRechargeTimes = !(dataObj->HasField("VirtualCurrencyRechargeTimes")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyRechargeTimes"); + + return tempStruct; +} + +FServerGetRandomResultTablesResult UPlayFabServerModelDecoder::decodeGetRandomResultTablesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetRandomResultTablesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Tables = !(dataObj->HasField("Tables")) ? nullptr : dataObj->GetObjectField("Tables"); + + return tempStruct; +} + +FServerGetUserInventoryResult UPlayFabServerModelDecoder::decodeGetUserInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetUserInventoryResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Inventory = !(dataObj->HasField("Inventory")) ? TArray() : dataObj->GetObjectArrayField("Inventory"); + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + tempStruct.VirtualCurrencyRechargeTimes = !(dataObj->HasField("VirtualCurrencyRechargeTimes")) ? nullptr : dataObj->GetObjectField("VirtualCurrencyRechargeTimes"); + + return tempStruct; +} + +FServerGrantItemsToCharacterResult UPlayFabServerModelDecoder::decodeGrantItemsToCharacterResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGrantItemsToCharacterResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemGrantResults = !(dataObj->HasField("ItemGrantResults")) ? TArray() : dataObj->GetObjectArrayField("ItemGrantResults"); + + return tempStruct; +} + +FServerGrantItemsToUserResult UPlayFabServerModelDecoder::decodeGrantItemsToUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGrantItemsToUserResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemGrantResults = !(dataObj->HasField("ItemGrantResults")) ? TArray() : dataObj->GetObjectArrayField("ItemGrantResults"); + + return tempStruct; +} + +FServerGrantItemsToUsersResult UPlayFabServerModelDecoder::decodeGrantItemsToUsersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGrantItemsToUsersResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemGrantResults = !(dataObj->HasField("ItemGrantResults")) ? TArray() : dataObj->GetObjectArrayField("ItemGrantResults"); + + return tempStruct; +} + +FServerModifyItemUsesResult UPlayFabServerModelDecoder::decodeModifyItemUsesResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerModifyItemUsesResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ItemInstanceId = !(dataObj->HasField("ItemInstanceId")) ? TEXT("") : dataObj->GetStringField("ItemInstanceId"); + tempStruct.RemainingUses = !(dataObj->HasField("RemainingUses")) ? 0 : int(dataObj->GetNumberField("RemainingUses")); + + return tempStruct; +} + +FServerMoveItemToCharacterFromCharacterResult UPlayFabServerModelDecoder::decodeMoveItemToCharacterFromCharacterResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerMoveItemToCharacterFromCharacterResult tempStruct; + + + return tempStruct; +} + +FServerMoveItemToCharacterFromUserResult UPlayFabServerModelDecoder::decodeMoveItemToCharacterFromUserResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerMoveItemToCharacterFromUserResult tempStruct; + + + return tempStruct; +} + +FServerMoveItemToUserFromCharacterResult UPlayFabServerModelDecoder::decodeMoveItemToUserFromCharacterResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerMoveItemToUserFromCharacterResult tempStruct; + + + return tempStruct; +} + +FServerRedeemCouponResult UPlayFabServerModelDecoder::decodeRedeemCouponResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRedeemCouponResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GrantedItems = !(dataObj->HasField("GrantedItems")) ? TArray() : dataObj->GetObjectArrayField("GrantedItems"); + + return tempStruct; +} + +FServerReportPlayerServerResult UPlayFabServerModelDecoder::decodeReportPlayerServerResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerReportPlayerServerResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.SubmissionsRemaining = !(dataObj->HasField("SubmissionsRemaining")) ? 0 : int(dataObj->GetNumberField("SubmissionsRemaining")); + + return tempStruct; +} + +FServerRevokeInventoryResult UPlayFabServerModelDecoder::decodeRevokeInventoryResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRevokeInventoryResult tempStruct; + + + return tempStruct; +} + +FServerRevokeInventoryItemsResult UPlayFabServerModelDecoder::decodeRevokeInventoryItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRevokeInventoryItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Errors = !(dataObj->HasField("Errors")) ? TArray() : dataObj->GetObjectArrayField("Errors"); + + return tempStruct; +} + +FServerUnlockContainerItemResult UPlayFabServerModelDecoder::decodeUnlockContainerItemResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUnlockContainerItemResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.GrantedItems = !(dataObj->HasField("GrantedItems")) ? TArray() : dataObj->GetObjectArrayField("GrantedItems"); + tempStruct.UnlockedItemInstanceId = !(dataObj->HasField("UnlockedItemInstanceId")) ? TEXT("") : dataObj->GetStringField("UnlockedItemInstanceId"); + tempStruct.UnlockedWithItemInstanceId = !(dataObj->HasField("UnlockedWithItemInstanceId")) ? TEXT("") : dataObj->GetStringField("UnlockedWithItemInstanceId"); + tempStruct.VirtualCurrency = !(dataObj->HasField("VirtualCurrency")) ? nullptr : dataObj->GetObjectField("VirtualCurrency"); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// PlayStream +////////////////////////////////////////////////////// + +FServerAddPlayerTagResult UPlayFabServerModelDecoder::decodeAddPlayerTagResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerAddPlayerTagResult tempStruct; + + + return tempStruct; +} + +FServerGetAllSegmentsResult UPlayFabServerModelDecoder::decodeGetAllSegmentsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetAllSegmentsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Segments = !(dataObj->HasField("Segments")) ? TArray() : dataObj->GetObjectArrayField("Segments"); + + return tempStruct; +} + +FServerGetPlayerSegmentsResult UPlayFabServerModelDecoder::decodeGetPlayerSegmentsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayerSegmentsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Segments = !(dataObj->HasField("Segments")) ? TArray() : dataObj->GetObjectArrayField("Segments"); + + return tempStruct; +} + +FServerGetPlayersInSegmentResult UPlayFabServerModelDecoder::decodeGetPlayersInSegmentResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayersInSegmentResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.ContinuationToken = !(dataObj->HasField("ContinuationToken")) ? TEXT("") : dataObj->GetStringField("ContinuationToken"); + tempStruct.PlayerProfiles = !(dataObj->HasField("PlayerProfiles")) ? TArray() : dataObj->GetObjectArrayField("PlayerProfiles"); + tempStruct.ProfilesInSegment = !(dataObj->HasField("ProfilesInSegment")) ? 0 : int(dataObj->GetNumberField("ProfilesInSegment")); + + return tempStruct; +} + +FServerGetPlayerTagsResult UPlayFabServerModelDecoder::decodeGetPlayerTagsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPlayerTagsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.PlayFabId = !(dataObj->HasField("PlayFabId")) ? TEXT("") : dataObj->GetStringField("PlayFabId"); + tempStruct.Tags = !(dataObj->HasField("Tags")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("Tags"), TEXT(",")); + + return tempStruct; +} + +FServerRemovePlayerTagResult UPlayFabServerModelDecoder::decodeRemovePlayerTagResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRemovePlayerTagResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Server-Side Cloud Script +////////////////////////////////////////////////////// + +FServerExecuteCloudScriptResult UPlayFabServerModelDecoder::decodeExecuteCloudScriptResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerExecuteCloudScriptResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.APIRequestsIssued = !(dataObj->HasField("APIRequestsIssued")) ? 0 : int(dataObj->GetNumberField("APIRequestsIssued")); + tempStruct.Error = !(dataObj->HasField("Error")) ? nullptr : dataObj->GetObjectField("Error"); + tempStruct.ExecutionTimeSeconds = !(dataObj->HasField("ExecutionTimeSeconds")) ? 0 : int(dataObj->GetNumberField("ExecutionTimeSeconds")); + tempStruct.FunctionName = !(dataObj->HasField("FunctionName")) ? TEXT("") : dataObj->GetStringField("FunctionName"); + tempStruct.FunctionResult = !(dataObj->HasField("FunctionResult")) ? nullptr : dataObj->GetObjectField("FunctionResult"); + tempStruct.FunctionResultTooLarge = !(dataObj->HasField("FunctionResultTooLarge")) ? false : dataObj->GetBoolField("FunctionResultTooLarge"); + tempStruct.HttpRequestsIssued = !(dataObj->HasField("HttpRequestsIssued")) ? 0 : int(dataObj->GetNumberField("HttpRequestsIssued")); + tempStruct.Logs = !(dataObj->HasField("Logs")) ? TArray() : dataObj->GetObjectArrayField("Logs"); + tempStruct.LogsTooLarge = !(dataObj->HasField("LogsTooLarge")) ? false : dataObj->GetBoolField("LogsTooLarge"); + tempStruct.MemoryConsumedBytes = !(dataObj->HasField("MemoryConsumedBytes")) ? 0 : int(dataObj->GetNumberField("MemoryConsumedBytes")); + tempStruct.ProcessorTimeSeconds = !(dataObj->HasField("ProcessorTimeSeconds")) ? 0 : int(dataObj->GetNumberField("ProcessorTimeSeconds")); + tempStruct.Revision = !(dataObj->HasField("Revision")) ? 0 : int(dataObj->GetNumberField("Revision")); + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Shared Group Data +////////////////////////////////////////////////////// + +FServerAddSharedGroupMembersResult UPlayFabServerModelDecoder::decodeAddSharedGroupMembersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerAddSharedGroupMembersResult tempStruct; + + + return tempStruct; +} + +FServerCreateSharedGroupResult UPlayFabServerModelDecoder::decodeCreateSharedGroupResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerCreateSharedGroupResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.SharedGroupId = !(dataObj->HasField("SharedGroupId")) ? TEXT("") : dataObj->GetStringField("SharedGroupId"); + + return tempStruct; +} + +FServerGetSharedGroupDataResult UPlayFabServerModelDecoder::decodeGetSharedGroupDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetSharedGroupDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + tempStruct.Members = !(dataObj->HasField("Members")) ? TEXT("") : FString::Join(dataObj->GetStringArrayField("Members"), TEXT(",")); + + return tempStruct; +} + +FServerRemoveSharedGroupMembersResult UPlayFabServerModelDecoder::decodeRemoveSharedGroupMembersResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerRemoveSharedGroupMembersResult tempStruct; + + + return tempStruct; +} + +FServerUpdateSharedGroupDataResult UPlayFabServerModelDecoder::decodeUpdateSharedGroupDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerUpdateSharedGroupDataResult tempStruct; + + + return tempStruct; +} + + + +/////////////////////////////////////////////////////// +// Title-Wide Data Management +////////////////////////////////////////////////////// + +FServerGetCatalogItemsResult UPlayFabServerModelDecoder::decodeGetCatalogItemsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetCatalogItemsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Catalog = !(dataObj->HasField("Catalog")) ? TArray() : dataObj->GetObjectArrayField("Catalog"); + + return tempStruct; +} + +FServerGetPublisherDataResult UPlayFabServerModelDecoder::decodeGetPublisherDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetPublisherDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + + return tempStruct; +} + +FServerGetTimeResult UPlayFabServerModelDecoder::decodeGetTimeResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetTimeResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Time = !(dataObj->HasField("Time")) ? TEXT("") : dataObj->GetStringField("Time"); + + return tempStruct; +} + +FServerGetTitleDataResult UPlayFabServerModelDecoder::decodeGetTitleDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetTitleDataResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.Data = !(dataObj->HasField("Data")) ? nullptr : dataObj->GetObjectField("Data"); + + return tempStruct; +} + +FServerGetTitleNewsResult UPlayFabServerModelDecoder::decodeGetTitleNewsResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerGetTitleNewsResult tempStruct; + UPlayFabJsonObject* dataObj = !(response->HasField("data")) ? nullptr : response->GetObjectField("data"); + + tempStruct.News = !(dataObj->HasField("News")) ? TArray() : dataObj->GetObjectArrayField("News"); + + return tempStruct; +} + +FServerSetPublisherDataResult UPlayFabServerModelDecoder::decodeSetPublisherDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSetPublisherDataResult tempStruct; + + + return tempStruct; +} + +FServerSetTitleDataResult UPlayFabServerModelDecoder::decodeSetTitleDataResultResponse(UPlayFabJsonObject* response) +{ + // Temp ustruct + FServerSetTitleDataResult tempStruct; + + + return tempStruct; +} + + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabServerModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabServerModels.cpp new file mode 100644 index 000000000..a9dbb6648 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabServerModels.cpp @@ -0,0 +1,13 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the play fab models +// +// API: Server +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabServerModels.h" +#include "PlayFabPrivate.h" \ No newline at end of file diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabUtilities.cpp b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabUtilities.cpp new file mode 100644 index 000000000..40766534a --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabUtilities.cpp @@ -0,0 +1,469 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Automatically generated cpp file for the UE4 PlayFab plugin. +// This cpp file contains the utilities functions that supports the plugin.. +// +////////////////////////////////////////////////////////////////////////////////////////////// + +#include "PlayFabUtilities.h" +#include "IPlayFab.h" +#include "PlayFabPrivate.h" + +void UPlayFabUtilities::setPlayFabSettings(FString GameTitleId, FString PlayFabSecretApiKey, FString PhotonRealtimeAppId, FString PhotonTurnbasedAppId, FString PhotonChatAppId) +{ + // Set the settings + IPlayFab::Get().setGameTitleId(GameTitleId); + IPlayFab::Get().setApiSecretKey(PlayFabSecretApiKey); + IPlayFab::Get().setPhotonRealtimeAppId(PhotonRealtimeAppId); + IPlayFab::Get().setPhotonTurnbasedAppId(PhotonTurnbasedAppId); + IPlayFab::Get().setPhotonChatAppId(PhotonChatAppId); +} + +FString UPlayFabUtilities::getPhotonAppId(bool Realtime, bool Chat, bool Turnbased) +{ + if (Realtime) { return IPlayFab::Get().getPhotonRealtimeAppId(); } + else if (Chat) { return IPlayFab::Get().getPhotonChatAppId(); } + else if (Turnbased) { return IPlayFab::Get().getPhotonTurnbasedAppId(); } + else { return ""; } +} + +FString UPlayFabUtilities::getErrorText(int32 code) +{ + // Variable to hold the return text + FString returnText = ""; + + // Switch on the code + switch (code) + { + case 0: returnText = "Success"; break; + case 500: returnText = "UnkownError"; break; + case 1000: returnText = "InvalidParams"; break; + case 1001: returnText = "AccountNotFound"; break; + case 1002: returnText = "AccountBanned"; break; + case 1003: returnText = "InvalidUsernameOrPassword"; break; + case 1004: returnText = "InvalidTitleId"; break; + case 1005: returnText = "InvalidEmailAddress"; break; + case 1006: returnText = "EmailAddressNotAvailable"; break; + case 1007: returnText = "InvalidUsername"; break; + case 1008: returnText = "InvalidPassword"; break; + case 1009: returnText = "UsernameNotAvailable"; break; + case 1010: returnText = "InvalidSteamTicket"; break; + case 1011: returnText = "AccountAlreadyLinked"; break; + case 1012: returnText = "LinkedAccountAlreadyClaimed"; break; + case 1013: returnText = "InvalidFacebookToken"; break; + case 1014: returnText = "AccountNotLinked"; break; + case 1015: returnText = "FailedByPaymentProvider"; break; + case 1016: returnText = "CouponCodeNotFound"; break; + case 1017: returnText = "InvalidContainerItem"; break; + case 1018: returnText = "ContainerNotOwned"; break; + case 1019: returnText = "KeyNotOwned"; break; + case 1020: returnText = "InvalidItemIdInTable"; break; + case 1021: returnText = "InvalidReceipt"; break; + case 1022: returnText = "ReceiptAlreadyUsed"; break; + case 1023: returnText = "ReceiptCancelled"; break; + case 1024: returnText = "GameNotFound"; break; + case 1025: returnText = "GameModeNotFound"; break; + case 1026: returnText = "InvalidGoogleToken"; break; + case 1027: returnText = "UserIsNotPartOfDeveloper"; break; + case 1028: returnText = "InvalidTitleForDeveloper"; break; + case 1029: returnText = "TitleNameConflicts"; break; + case 1030: returnText = "UserisNotValid"; break; + case 1031: returnText = "ValueAlreadyExists"; break; + case 1032: returnText = "BuildNotFound"; break; + case 1033: returnText = "PlayerNotInGame"; break; + case 1034: returnText = "InvalidTicket"; break; + case 1035: returnText = "InvalidDeveloper"; break; + case 1036: returnText = "InvalidOrderInfo"; break; + case 1037: returnText = "RegistrationIncomplete"; break; + case 1038: returnText = "InvalidPlatform"; break; + case 1039: returnText = "UnknownError"; break; + case 1040: returnText = "SteamApplicationNotOwned"; break; + case 1041: returnText = "WrongSteamAccount"; break; + case 1042: returnText = "TitleNotActivated"; break; + case 1043: returnText = "RegistrationSessionNotFound"; break; + case 1044: returnText = "NoSuchMod"; break; + case 1045: returnText = "FileNotFound"; break; + case 1046: returnText = "DuplicateEmail"; break; + case 1047: returnText = "ItemNotFound"; break; + case 1048: returnText = "ItemNotOwned"; break; + case 1049: returnText = "ItemNotRecycleable"; break; + case 1050: returnText = "ItemNotAffordable"; break; + case 1051: returnText = "InvalidVirtualCurrency"; break; + case 1052: returnText = "WrongVirtualCurrency"; break; + case 1053: returnText = "WrongPrice"; break; + case 1054: returnText = "NonPositiveValue"; break; + case 1055: returnText = "InvalidRegion"; break; + case 1056: returnText = "RegionAtCapacity"; break; + case 1057: returnText = "ServerFailedToStart"; break; + case 1058: returnText = "NameNotAvailable"; break; + case 1059: returnText = "InsufficientFunds"; break; + case 1060: returnText = "InvalidDeviceID"; break; + case 1061: returnText = "InvalidPushNotificationToken"; break; + case 1062: returnText = "NoRemainingUses"; break; + case 1063: returnText = "InvalidPaymentProvider"; break; + case 1064: returnText = "PurchaseInitializationFailure"; break; + case 1065: returnText = "DuplicateUsername"; break; + case 1066: returnText = "InvalidBuyerInfo"; break; + case 1067: returnText = "NoGameModeParamsSet"; break; + case 1068: returnText = "BodyTooLarge"; break; + case 1069: returnText = "ReservedWordInBody"; break; + case 1070: returnText = "InvalidTypeInBody"; break; + case 1071: returnText = "InvalidRequest"; break; + case 1072: returnText = "ReservedEventName"; break; + case 1073: returnText = "InvalidUserStatistics"; break; + case 1074: returnText = "NotAuthenticated"; break; + case 1075: returnText = "StreamAlreadyExists"; break; + case 1076: returnText = "ErrorCreatingStream"; break; + case 1077: returnText = "StreamNotFound"; break; + case 1078: returnText = "InvalidAccount"; break; + case 1080: returnText = "PurchaseDoesNotExist"; break; + case 1081: returnText = "InvalidPurchaseTransactionStatus"; break; + case 1082: returnText = "APINotEnabledForGameClientAccess"; break; + case 1083: returnText = "NoPushNotificationARNForTitle"; break; + case 1084: returnText = "BuildAlreadyExists"; break; + case 1085: returnText = "BuildPackageDoesNotExist"; break; + case 1087: returnText = "CustomAnalyticsEventsNotEnabledForTitle"; break; + case 1088: returnText = "InvalidSharedGroupId"; break; + case 1089: returnText = "NotAuthorized"; break; + case 1090: returnText = "MissingTitleGoogleProperties"; break; + case 1091: returnText = "InvalidItemProperties"; break; + case 1092: returnText = "InvalidPSNAuthCode"; break; + case 1093: returnText = "InvalidItemId"; break; + case 1094: returnText = "PushNotEnabledForAccount"; break; + case 1095: returnText = "PushServiceError"; break; + case 1096: returnText = "ReceiptDoesNotContainInAppItems"; break; + case 1097: returnText = "ReceiptContainsMultipleInAppItems"; break; + case 1098: returnText = "InvalidBundleID"; break; + case 1099: returnText = "JavascriptException"; break; + case 1100: returnText = "InvalidSessionTicket"; break; + case 1101: returnText = "UnableToConnectToDatabase"; break; + case 1110: returnText = "InternalServerError"; break; + case 1111: returnText = "InvalidReportDate"; break; + case 1112: returnText = "ReportNotAvailable"; break; + case 1113: returnText = "DatabaseThroughputExceeded"; break; + case 1115: returnText = "InvalidGameTicket"; break; + case 1116: returnText = "ExpiredGameTicket"; break; + case 1117: returnText = "GameTicketDoesNotMatchLobby"; break; + case 1118: returnText = "LinkedDeviceAlreadyClaimed"; break; + case 1119: returnText = "DeviceAlreadyLinked"; break; + case 1120: returnText = "DeviceNotLinked"; break; + case 1121: returnText = "PartialFailure"; break; + case 1122: returnText = "PublisherNotSet"; break; + case 1123: returnText = "ServiceUnavailable"; break; + case 1124: returnText = "VersionNotFound"; break; + case 1125: returnText = "RevisionNotFound"; break; + case 1126: returnText = "InvalidPublisherId"; break; + case 1127: returnText = "DownstreamServiceUnavailable"; break; + case 1128: returnText = "APINotIncludedInTitleUsageTier"; break; + case 1129: returnText = "DAULimitExceeded"; break; + case 1130: returnText = "APIRequestLimitExceeded"; break; + case 1131: returnText = "InvalidAPIEndpoint"; break; + case 1132: returnText = "BuildNotAvailable"; break; + case 1133: returnText = "ConcurrentEditError"; break; + case 1134: returnText = "ContentNotFound"; break; + case 1135: returnText = "CharacterNotFound"; break; + case 1136: returnText = "CloudScriptNotFound"; break; + case 1137: returnText = "ContentQuotaExceeded"; break; + case 1138: returnText = "InvalidCharacterStatistics"; break; + case 1139: returnText = "PhotonNotEnabledForTitle"; break; + case 1140: returnText = "PhotonApplicationNotFound"; break; + case 1141: returnText = "PhotonApplicationNotAssociatedWithTitle"; break; + case 1142: returnText = "InvalidEmailOrPassword"; break; + case 1143: returnText = "FacebookAPIError"; break; + case 1144: returnText = "InvalidContentType"; break; + case 1145: returnText = "KeyLengthExceeded"; break; + case 1146: returnText = "DataLengthExceeded"; break; + case 1147: returnText = "TooManyKeys"; break; + case 1148: returnText = "FreeTierCannotHaveVirtualCurrency"; break; + case 1149: returnText = "MissingAmazonSharedKey"; break; + case 1150: returnText = "AmazonValidationError"; break; + case 1151: returnText = "InvalidPSNIssuerId"; break; + case 1152: returnText = "PSNInaccessible"; break; + case 1153: returnText = "ExpiredAuthToken"; break; + case 1154: returnText = "FailedToGetEntitlements"; break; + case 1155: returnText = "FailedToConsumeEntitlement"; break; + case 1156: returnText = "TradeAcceptingUserNotAllowed"; break; + case 1157: returnText = "TradeInventoryItemIsAssignedToCharacter"; break; + case 1158: returnText = "TradeInventoryItemIsBundle"; break; + case 1159: returnText = "TradeStatusNotValidForCancelling"; break; + case 1160: returnText = "TradeStatusNotValidForAccepting"; break; + case 1161: returnText = "TradeDoesNotExist"; break; + case 1162: returnText = "TradeCancelled"; break; + case 1163: returnText = "TradeAlreadyFilled"; break; + case 1164: returnText = "TradeWaitForStatusTimeout"; break; + case 1165: returnText = "TradeInventoryItemExpired"; break; + case 1166: returnText = "TradeMissingOfferedAndAcceptedItems"; break; + case 1167: returnText = "TradeAcceptedItemIsBundle"; break; + case 1168: returnText = "TradeAcceptedItemIsStackable"; break; + case 1169: returnText = "TradeInventoryItemInvalidStatus"; break; + case 1170: returnText = "TradeAcceptedCatalogItemInvalid"; break; + case 1171: returnText = "TradeAllowedUsersInvalid"; break; + case 1172: returnText = "TradeInventoryItemDoesNotExist"; break; + case 1173: returnText = "TradeInventoryItemIsConsumed"; break; + case 1174: returnText = "TradeInventoryItemIsStackable"; break; + case 1175: returnText = "TradeAcceptedItemsMismatch"; break; + case 1176: returnText = "InvalidKongregateToken"; break; + case 1177: returnText = "FeatureNotConfiguredForTitle"; break; + case 1178: returnText = "NoMatchingCatalogItemForReceipt"; break; + case 1179: returnText = "InvalidCurrencyCode"; break; + case 1180: returnText = "NoRealMoneyPriceForCatalogItem"; break; + case 1181: returnText = "TradeInventoryItemIsNotTradable"; break; + case 1182: returnText = "TradeAcceptedCatalogItemIsNotTradable"; break; + case 1183: returnText = "UsersAlreadyFriends"; break; + case 1184: returnText = "LinkedIdentifierAlreadyClaimed"; break; + case 1185: returnText = "CustomIdNotLinked"; break; + case 1186: returnText = "TotalDataSizeExceeded"; break; + case 1187: returnText = "DeleteKeyConflict"; break; + case 1188: returnText = "InvalidXboxLiveToken"; break; + case 1189: returnText = "ExpiredXboxLiveToken"; break; + case 1190: returnText = "ResettableStatisticVersionRequired"; break; + case 1191: returnText = "NotAuthorizedByTitle"; break; + case 1192: returnText = "NoPartnerEnabled"; break; + case 1193: returnText = "InvalidPartnerResponse"; break; + case 1194: returnText = "APINotEnabledForGameServerAccess"; break; + case 1195: returnText = "StatisticNotFound"; break; + case 1196: returnText = "StatisticNameConflict"; break; + case 1197: returnText = "StatisticVersionClosedForWrites"; break; + case 1198: returnText = "StatisticVersionInvalid"; break; + case 1199: returnText = "APIClientRequestRateLimitExceeded"; break; + case 1200: returnText = "InvalidJSONContent"; break; + case 1201: returnText = "InvalidDropTable"; break; + case 1202: returnText = "StatisticVersionAlreadyIncrementedForScheduledInterval"; break; + case 1203: returnText = "StatisticCountLimitExceeded"; break; + case 1204: returnText = "StatisticVersionIncrementRateExceeded"; break; + case 1205: returnText = "ContainerKeyInvalid"; break; + case 1206: returnText = "CloudScriptExecutionTimeLimitExceeded"; break; + case 1207: returnText = "NoWritePermissionsForEvent"; break; + case 1208: returnText = "CloudScriptFunctionArgumentSizeExceeded"; break; + case 1209: returnText = "CloudScriptAPIRequestCountExceeded"; break; + case 1210: returnText = "CloudScriptAPIRequestError"; break; + case 1211: returnText = "CloudScriptHTTPRequestError"; break; + case 1212: returnText = "InsufficientGuildRole"; break; + case 1213: returnText = "GuildNotFound"; break; + case 1214: returnText = "OverLimit"; break; + case 1215: returnText = "EventNotFound"; break; + case 1216: returnText = "InvalidEventField"; break; + case 1217: returnText = "InvalidEventName"; break; + case 1218: returnText = "CatalogNotConfigured"; break; + case 1219: returnText = "OperationNotSupportedForPlatform"; break; + case 1220: returnText = "SegmentNotFound"; break; + case 1221: returnText = "StoreNotFound"; break; + case 1222: returnText = "InvalidStatisticName"; break; + case 1223: returnText = "TitleNotQualifiedForLimit"; break; + case 1224: returnText = "InvalidServiceLimitLevel"; break; + case 1225: returnText = "ServiceLimitLevelInTransition"; break; + case 1226: returnText = "CouponAlreadyRedeemed"; break; + case 1227: returnText = "GameServerBuildSizeLimitExceeded"; break; + case 1228: returnText = "GameServerBuildCountLimitExceeded"; break; + case 1229: returnText = "VirtualCurrencyCountLimitExceeded"; break; + case 1230: returnText = "VirtualCurrencyCodeExists"; break; + case 1231: returnText = "TitleNewsItemCountLimitExceeded"; break; + case 1232: returnText = "InvalidTwitchToken"; break; + case 1233: returnText = "TwitchResponseError"; break; + case 1234: returnText = "ProfaneDisplayName"; break; + case 1235: returnText = "UserAlreadyAdded"; break; + case 1236: returnText = "InvalidVirtualCurrencyCode"; break; + case 1237: returnText = "VirtualCurrencyCannotBeDeleted"; break; + case 1238: returnText = "IdentifierAlreadyClaimed"; break; + case 1239: returnText = "IdentifierNotLinked"; break; + case 1240: returnText = "InvalidContinuationToken"; break; + case 1241: returnText = "ExpiredContinuationToken"; break; + case 1242: returnText = "InvalidSegment"; break; + case 1243: returnText = "InvalidSessionId"; break; + case 1244: returnText = "SessionLogNotFound"; break; + case 1245: returnText = "InvalidSearchTerm"; break; + case 1246: returnText = "TwoFactorAuthenticationTokenRequired"; break; + case 1247: returnText = "GameServerHostCountLimitExceeded"; break; + case 1248: returnText = "PlayerTagCountLimitExceeded"; break; + case 1249: returnText = "RequestAlreadyRunning"; break; + case 1250: returnText = "ActionGroupNotFound"; break; + case 1251: returnText = "MaximumSegmentBulkActionJobsRunning"; break; + case 1252: returnText = "NoActionsOnPlayersInSegmentJob"; break; + case 1253: returnText = "DuplicateStatisticName"; break; + case 1254: returnText = "ScheduledTaskNameConflict"; break; + case 1255: returnText = "ScheduledTaskCreateConflict"; break; + case 1256: returnText = "InvalidScheduledTaskName"; break; + case 1257: returnText = "InvalidTaskSchedule"; break; + case 1258: returnText = "SteamNotEnabledForTitle"; break; + case 1259: returnText = "LimitNotAnUpgradeOption"; break; + case 1260: returnText = "NoSecretKeyEnabledForCloudScript"; break; + case 1261: returnText = "TaskNotFound"; break; + case 1262: returnText = "TaskInstanceNotFound"; break; + case 1263: returnText = "InvalidIdentityProviderId"; break; + case 1264: returnText = "MisconfiguredIdentityProvider"; break; + case 1265: returnText = "InvalidScheduledTaskType"; break; + case 1266: returnText = "BillingInformationRequired"; break; + case 1267: returnText = "LimitedEditionItemUnavailable"; break; + case 1268: returnText = "InvalidAdPlacementAndReward"; break; + case 1269: returnText = "AllAdPlacementViewsAlreadyConsumed"; break; + case 1270: returnText = "GoogleOAuthNotConfiguredForTitle"; break; + case 1271: returnText = "GoogleOAuthError"; break; + case 1272: returnText = "UserNotFriend"; break; + case 1273: returnText = "InvalidSignature"; break; + case 1274: returnText = "InvalidPublicKey"; break; + case 1275: returnText = "GoogleOAuthNoIdTokenIncludedInResponse"; break; + case 1276: returnText = "StatisticUpdateInProgress"; break; + case 1277: returnText = "LeaderboardVersionNotAvailable"; break; + case 1279: returnText = "StatisticAlreadyHasPrizeTable"; break; + case 1280: returnText = "PrizeTableHasOverlappingRanks"; break; + case 1281: returnText = "PrizeTableHasMissingRanks"; break; + case 1282: returnText = "PrizeTableRankStartsAtZero"; break; + case 1283: returnText = "InvalidStatistic"; break; + case 1284: returnText = "ExpressionParseFailure"; break; + case 1285: returnText = "ExpressionInvokeFailure"; break; + case 1286: returnText = "ExpressionTooLong"; break; + case 1287: returnText = "DataUpdateRateExceeded"; break; + case 1288: returnText = "RestrictedEmailDomain"; break; + case 1289: returnText = "EncryptionKeyDisabled"; break; + case 1290: returnText = "EncryptionKeyMissing"; break; + case 1291: returnText = "EncryptionKeyBroken"; break; + case 1292: returnText = "NoSharedSecretKeyConfigured"; break; + case 1293: returnText = "SecretKeyNotFound"; break; + case 1294: returnText = "PlayerSecretAlreadyConfigured"; break; + case 1295: returnText = "APIRequestsDisabledForTitle"; break; + case 1296: returnText = "InvalidSharedSecretKey"; break; + case 1297: returnText = "PrizeTableHasNoRanks"; break; + case 1298: returnText = "ProfileDoesNotExist"; break; + case 1299: returnText = "ContentS3OriginBucketNotConfigured"; break; + case 1300: returnText = "InvalidEnvironmentForReceipt"; break; + case 1301: returnText = "EncryptedRequestNotAllowed"; break; + case 1302: returnText = "SignedRequestNotAllowed"; break; + case 1303: returnText = "RequestViewConstraintParamsNotAllowed"; break; + case 1304: returnText = "BadPartnerConfiguration"; break; + case 1305: returnText = "XboxBPCertificateFailure"; break; + case 1306: returnText = "XboxXASSExchangeFailure"; break; + case 1307: returnText = "InvalidEntityId"; break; + case 1308: returnText = "StatisticValueAggregationOverflow"; break; + case 1309: returnText = "EmailMessageFromAddressIsMissing"; break; + case 1310: returnText = "EmailMessageToAddressIsMissing"; break; + case 1311: returnText = "SmtpServerAuthenticationError"; break; + case 1312: returnText = "SmtpServerLimitExceeded"; break; + case 1313: returnText = "SmtpServerInsufficientStorage"; break; + case 1314: returnText = "SmtpServerCommunicationError"; break; + case 1315: returnText = "SmtpServerGeneralFailure"; break; + case 1316: returnText = "EmailClientTimeout"; break; + case 1317: returnText = "EmailClientCanceledTask"; break; + case 1318: returnText = "EmailTemplateMissing"; break; + case 1319: returnText = "InvalidHostForTitleId"; break; + case 1320: returnText = "EmailConfirmationTokenDoesNotExist"; break; + case 1321: returnText = "EmailConfirmationTokenExpired"; break; + case 1322: returnText = "AccountDeleted"; break; + case 1323: returnText = "PlayerSecretNotConfigured"; break; + case 1324: returnText = "InvalidSignatureTime"; break; + case 1325: returnText = "NoContactEmailAddressFound"; break; + case 1326: returnText = "InvalidAuthToken"; break; + case 1327: returnText = "AuthTokenDoesNotExist"; break; + case 1328: returnText = "AuthTokenExpired"; break; + case 1329: returnText = "AuthTokenAlreadyUsedToResetPassword"; break; + case 1330: returnText = "MembershipNameTooLong"; break; + case 1331: returnText = "MembershipNotFound"; break; + case 1332: returnText = "GoogleServiceAccountInvalid"; break; + case 1333: returnText = "GoogleServiceAccountParseFailure"; break; + case 1334: returnText = "EntityTokenMissing"; break; + case 1335: returnText = "EntityTokenInvalid"; break; + case 1336: returnText = "EntityTokenExpired"; break; + case 1337: returnText = "EntityTokenRevoked"; break; + case 1338: returnText = "InvalidProductForSubscription"; break; + case 1339: returnText = "XboxInaccessible"; break; + case 1340: returnText = "SubscriptionAlreadyTaken"; break; + case 1341: returnText = "SmtpAddonNotEnabled"; break; + case 1342: returnText = "APIConcurrentRequestLimitExceeded"; break; + case 1343: returnText = "XboxRejectedXSTSExchangeRequest"; break; + case 1344: returnText = "VariableNotDefined"; break; + case 1345: returnText = "TemplateVersionNotDefined"; break; + case 1346: returnText = "FileTooLarge"; break; + case 1347: returnText = "TitleDeleted"; break; + case 1348: returnText = "TitleContainsUserAccounts"; break; + case 1349: returnText = "TitleDeletionPlayerCleanupFailure"; break; + case 1350: returnText = "EntityFileOperationPending"; break; + case 1351: returnText = "NoEntityFileOperationPending"; break; + case 1352: returnText = "EntityProfileVersionMismatch"; break; + case 1353: returnText = "TemplateVersionTooOld"; break; + case 1354: returnText = "MembershipDefinitionInUse"; break; + case 1355: returnText = "PaymentPageNotConfigured"; break; + case 1356: returnText = "FailedLoginAttemptRateLimitExceeded"; break; + case 1357: returnText = "EntityBlockedByGroup"; break; + case 1358: returnText = "RoleDoesNotExist"; break; + case 1359: returnText = "EntityIsAlreadyMember"; break; + case 1360: returnText = "DuplicateRoleId"; break; + case 1361: returnText = "GroupInvitationNotFound"; break; + case 1362: returnText = "GroupApplicationNotFound"; break; + case 1363: returnText = "OutstandingInvitationAcceptedInstead"; break; + case 1364: returnText = "OutstandingApplicationAcceptedInstead"; break; + case 1365: returnText = "RoleIsGroupDefaultMember"; break; + case 1366: returnText = "RoleIsGroupAdmin"; break; + case 1367: returnText = "RoleNameNotAvailable"; break; + case 1368: returnText = "GroupNameNotAvailable"; break; + case 1369: returnText = "EmailReportAlreadySent"; break; + case 1370: returnText = "EmailReportRecipientBlacklisted"; break; + case 1371: returnText = "EventNamespaceNotAllowed"; break; + case 1372: returnText = "EventEntityNotAllowed"; break; + case 1373: returnText = "InvalidEntityType"; break; + case 1374: returnText = "NullTokenResultFromAad"; break; + case 1375: returnText = "InvalidTokenResultFromAad"; break; + case 1376: returnText = "NoValidCertificateForAad"; break; + case 1377: returnText = "InvalidCertificateForAad"; break; + case 1378: returnText = "DuplicateDropTableId"; break; + case 1379: returnText = "MultiplayerServerError"; break; + case 1380: returnText = "MultiplayerServerTooManyRequests"; break; + case 1381: returnText = "MultiplayerServerNoContent"; break; + case 1382: returnText = "MultiplayerServerBadRequest"; break; + case 1383: returnText = "MultiplayerServerUnauthorized"; break; + case 1384: returnText = "MultiplayerServerForbidden"; break; + case 1385: returnText = "MultiplayerServerNotFound"; break; + case 1386: returnText = "MultiplayerServerConflict"; break; + case 1387: returnText = "MultiplayerServerInternalServerError"; break; + case 1388: returnText = "MultiplayerServerUnavailable"; break; + case 1389: returnText = "ExplicitContentDetected"; break; + case 1390: returnText = "PIIContentDetected"; break; + case 1391: returnText = "InvalidScheduledTaskParameter"; break; + case 1392: returnText = "PerEntityEventRateLimitExceeded"; break; + case 1393: returnText = "TitleDefaultLanguageNotSet"; break; + case 1394: returnText = "EmailTemplateMissingDefaultVersion"; break; + case 1395: returnText = "FacebookInstantGamesIdNotLinked"; break; + case 1396: returnText = "InvalidFacebookInstantGamesSignature"; break; + case 1397: returnText = "FacebookInstantGamesAuthNotConfiguredForTitle"; break; + case 2001: returnText = "MatchmakingEntityInvalid"; break; + case 2002: returnText = "MatchmakingPlayerAttributesInvalid"; break; + case 2003: returnText = "MatchmakingCreateRequestMissing"; break; + case 2004: returnText = "MatchmakingCreateRequestCreatorMissing"; break; + case 2005: returnText = "MatchmakingCreateRequestCreatorIdMissing"; break; + case 2006: returnText = "MatchmakingCreateRequestUserListMissing"; break; + case 2007: returnText = "MatchmakingCreateRequestGiveUpAfterInvalid"; break; + case 2008: returnText = "MatchmakingTicketIdMissing"; break; + case 2009: returnText = "MatchmakingMatchIdMissing"; break; + case 2010: returnText = "MatchmakingMatchIdIdMissing"; break; + case 2011: returnText = "MatchmakingQueueNameMissing"; break; + case 2012: returnText = "MatchmakingTitleIdMissing"; break; + case 2013: returnText = "MatchmakingTicketIdIdMissing"; break; + case 2014: returnText = "MatchmakingPlayerIdMissing"; break; + case 2015: returnText = "MatchmakingJoinRequestUserMissing"; break; + case 2016: returnText = "MatchmakingQueueConfigNotFound"; break; + case 2017: returnText = "MatchmakingMatchNotFound"; break; + case 2018: returnText = "MatchmakingTicketNotFound"; break; + case 2019: returnText = "MatchmakingCreateTicketServerIdentityInvalid"; break; + case 2020: returnText = "MatchmakingCreateTicketClientIdentityInvalid"; break; + case 2021: returnText = "MatchmakingGetTicketUserMismatch"; break; + case 2022: returnText = "MatchmakingJoinTicketServerIdentityInvalid"; break; + case 2023: returnText = "MatchmakingJoinTicketUserIdentityMismatch"; break; + case 2024: returnText = "MatchmakingCancelTicketServerIdentityInvalid"; break; + case 2025: returnText = "MatchmakingCancelTicketUserIdentityMismatch"; break; + case 2026: returnText = "MatchmakingGetMatchIdentityMismatch"; break; + case 2027: returnText = "MatchmakingPlayerIdentityMismatch"; break; + case 2028: returnText = "MatchmakingAlreadyJoinedTicket"; break; + case 2029: returnText = "MatchmakingTicketAlreadyCompleted"; break; + case 2030: returnText = "MatchmakingQueueNameInvalid"; break; + case 2031: returnText = "MatchmakingQueueConfigInvalid"; break; + case 2032: returnText = "MatchmakingMemberProfileInvalid"; break; + case 2033: returnText = "WriteAttemptedDuringExport"; break; + case 2034: returnText = "NintendoSwitchDeviceIdNotLinked"; break; + case 2035: returnText = "MatchmakingNotEnabled"; break; + } + + // Return the text + return returnText; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFab/Public/IPlayFab.h b/PlayFabPlugin/PlayFab/Source/PlayFab/Public/IPlayFab.h new file mode 100644 index 000000000..a51ed1b30 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFab/Public/IPlayFab.h @@ -0,0 +1,178 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "Modules/ModuleManager.h" +#include "PlayFabCommon.h" + +/** +* The public interface to this module. In most cases, this interface is only public to sibling modules +* within this plugin. +*/ +class IPlayFab : public IModuleInterface +{ +public: + /** + * Singleton-like access to this module's interface. This is just for convenience! + * Beware of calling this during the shutdown phase, though. Your module might have been unloaded already. + * + * @return Returns singleton instance, loading the module on demand if needed + */ + + static inline IPlayFab& Get() + { + return FModuleManager::LoadModuleChecked< IPlayFab >("PlayFab"); + } + + /** + * Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true. + * + * @return True if the module is loaded and ready to use + */ + static inline bool IsAvailable() + { + return FModuleManager::Get().IsModuleLoaded("PlayFab"); + } + + inline FString getGameTitleId() const + { + return IPlayFabCommonModuleInterface::Get().GetTitleId(); + } + inline void setGameTitleId(const FString& NewGameTitleId) + { + IPlayFabCommonModuleInterface::Get().SetTitleId(NewGameTitleId); + } + + inline bool IsClientLoggedIn() const + { + return getSessionTicket().Len() > 0; + } + inline FString getSessionTicket() const + { + return IPlayFabCommonModuleInterface::Get().GetClientSessionTicket(); + } + inline void setSessionTicket(const FString& NewSessionTicket) + { + IPlayFabCommonModuleInterface::Get().SetClientSessionTicket(NewSessionTicket); + } + + inline FString getEntityToken() const + { + return IPlayFabCommonModuleInterface::Get().GetEntityToken(); + } + inline void setEntityToken(const FString& NewEntityToken) + { + IPlayFabCommonModuleInterface::Get().SetEntityToken(NewEntityToken); + } + + inline FString getSecretApiKey() const + { + return IPlayFabCommonModuleInterface::Get().GetPlayFabApiSecretKey(); + } + inline void setApiSecretKey(const FString& NewSecretApiKey) + { + IPlayFabCommonModuleInterface::Get().SetPlayFabApiSecretKey(NewSecretApiKey); + } + + inline FString getVersionString() const + { + return IPlayFabCommonModuleInterface::Get().GetVersionString(); + } + + inline FString getBuildIdentifier() const + { + return IPlayFabCommonModuleInterface::Get().GetBuildIdentifier(); + } + + inline FString getAD_TYPE_ANDROID_ID() const + { + return IPlayFabCommonModuleInterface::Get().GetAD_TYPE_ANDROID_ID(); + } + + inline FString getAD_TYPE_IDFA() const + { + return IPlayFabCommonModuleInterface::Get().GetAD_TYPE_IDFA(); + } + + inline FString getAdvertisingIdType() const + { + return IPlayFabCommonModuleInterface::Get().GetAdvertisingIdType(); + } + + inline void setAdvertisingIdType(FString advertisingIdType) + { + return IPlayFabCommonModuleInterface::Get().SetAdvertisingIdType(advertisingIdType); + } + + inline FString getAdvertisingIdValue() const + { + return IPlayFabCommonModuleInterface::Get().GetAdvertisingIdValue(); + } + + inline void setAdvertisingIdValue(FString advertisingIdValue) + { + return IPlayFabCommonModuleInterface::Get().SetAdvertisingIdValue(advertisingIdValue); + } + + inline FString getPhotonRealtimeAppId() const + { + return IPlayFabCommonModuleInterface::Get().GetPhotonRealtimeAppId(); + } + + inline void setPhotonRealtimeAppId(const FString& photonRealtimeAppId) + { + IPlayFabCommonModuleInterface::Get().SetPhotonRealtimeAppId(photonRealtimeAppId); + } + + inline FString getPhotonTurnbasedAppId() const + { + return IPlayFabCommonModuleInterface::Get().GetPhotonTurnbasedAppId(); + } + + inline void setPhotonTurnbasedAppId(const FString& photonTurnbasedAppId) + { + IPlayFabCommonModuleInterface::Get().SetPhotonTurnbasedAppId(photonTurnbasedAppId); + } + + inline FString getPhotonChatAppId() const + { + return IPlayFabCommonModuleInterface::Get().GetPhotonChatAppId(); + } + + inline void setPhotonChatAppId(const FString& photonChatAppId) + { + IPlayFabCommonModuleInterface::Get().SetPhotonChatAppId(photonChatAppId); + } + + inline bool getDisableAdvertising() const + { + return IPlayFabCommonModuleInterface::Get().GetDisableAdvertising(); + } + + inline FString getUrl(const FString& callPath) const + { + return IPlayFabCommonModuleInterface::Get().GetUrl(callPath); + } + + inline int32 GetPendingCallCount() + { + int32 output; + pendingCallLock.Lock(); + output = pendingCalls; + pendingCallLock.Unlock(); + return output; + } + inline void ModifyPendingCallCount(int32 delta) + { + pendingCallLock.Lock(); + pendingCalls += delta; + pendingCallLock.Unlock(); + } + +private: + FCriticalSection pendingCallLock; + int32 pendingCalls; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCommon/PlayFabCommon.Build.cs b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/PlayFabCommon.Build.cs new file mode 100644 index 000000000..9af7bbb6c --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/PlayFabCommon.Build.cs @@ -0,0 +1,35 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +using UnrealBuildTool; +using System.IO; + +public class PlayFabCommon : ModuleRules +{ + public PlayFabCommon(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public")); + + PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private")); + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "CoreUObject", + "HTTP", + "Json", + } + ); + + if (Target.bBuildEditor == true) + { + PrivateDependencyModuleNames.AddRange(new string[] { + "Settings" + }); + } + } +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Private/PlayFabCommon.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Private/PlayFabCommon.cpp new file mode 100644 index 000000000..9c70276d5 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Private/PlayFabCommon.cpp @@ -0,0 +1,129 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFabCommon.h" + +#if WITH_EDITOR +#include "ISettingsModule.h" +#include "ISettingsSection.h" +#endif // WITH_EDITOR + +#include "PlayFabCommonSettings.h" +#include "PlayFabRuntimeSettings.h" + +#define LOCTEXT_NAMESPACE "FPlayFabCommonsModule" + +class FPlayFabCommonModule : public IPlayFabCommonModuleInterface +{ + /** IModuleInterface implementation */ + virtual void StartupModule() override; + virtual void ShutdownModule() override; + + // Settings + void RegisterSettings(); + void UnregisterSettings(); + + /** Callback for when the settings were saved. */ + bool HandleSettingsSaved(); + + FString GetSdkVersion() const override { return PlayFabCommon::PlayFabCommonSettings::sdkVersion; } + FString GetBuildIdentifier() const override { return PlayFabCommon::PlayFabCommonSettings::buildIdentifier; } + FString GetVersionString() const override { return PlayFabCommon::PlayFabCommonSettings::versionString; } + + FString GetAD_TYPE_IDFA() const override { return PlayFabCommon::PlayFabCommonSettings::AD_TYPE_IDFA; } + FString GetAD_TYPE_ANDROID_ID() const override { return PlayFabCommon::PlayFabCommonSettings::AD_TYPE_ANDROID_ID; } + + FString GetServerURL() const override { return PlayFabCommon::PlayFabCommonSettings::serverURL; } + FString GetProductionEnvironmentURL() const override { return PlayFabCommon::PlayFabCommonSettings::productionEnvironmentURL; } + FString GetTitleId() const override { return PlayFabCommon::PlayFabCommonSettings::titleId; } + FString GetClientSessionTicket() const override { return PlayFabCommon::PlayFabCommonSettings::clientSessionTicket; } + FString GetDeveloperSecretKey() const override { return PlayFabCommon::PlayFabCommonSettings::developerSecretKey; } + FString GetEntityToken() const override { return PlayFabCommon::PlayFabCommonSettings::entityToken; } + FString GetAdvertisingIdType() const override { return PlayFabCommon::PlayFabCommonSettings::advertisingIdType; } + FString GetAdvertisingIdValue() const override { return PlayFabCommon::PlayFabCommonSettings::advertisingIdValue; } + bool GetDisableAdvertising() const override { return PlayFabCommon::PlayFabCommonSettings::disableAdvertising; } + + void SetServerURL(const FString& serverURL) override { PlayFabCommon::PlayFabCommonSettings::serverURL = serverURL; } + void SetProductionEnvironmentURL(const FString& productionEnvironmentURL) override { PlayFabCommon::PlayFabCommonSettings::productionEnvironmentURL = productionEnvironmentURL; } + void SetTitleId(const FString& titleId) override { PlayFabCommon::PlayFabCommonSettings::titleId = titleId; } + void SetClientSessionTicket(const FString& clientSessionTicket) override { PlayFabCommon::PlayFabCommonSettings::clientSessionTicket = clientSessionTicket; } + void SetDeveloperSecretKey(const FString& developerSecretKey) override { PlayFabCommon::PlayFabCommonSettings::developerSecretKey = developerSecretKey; } + void SetEntityToken(const FString& entityToken) override { PlayFabCommon::PlayFabCommonSettings::entityToken = entityToken; } + void SetAdvertisingIdType(const FString& advertisingIdType) override { PlayFabCommon::PlayFabCommonSettings::advertisingIdType = advertisingIdType; } + void SetAdvertisingIdValue(const FString& advertisingIdValue) override { PlayFabCommon::PlayFabCommonSettings::advertisingIdValue = advertisingIdValue; } + void SetDisableAdvertising(bool disableAdvertising) override { PlayFabCommon::PlayFabCommonSettings::disableAdvertising = disableAdvertising; } + + FString GetPlayFabApiSecretKey() const override { return PlayFabCommon::PlayFabCommonSettings::playFabApiSecretKey; } + void SetPlayFabApiSecretKey(const FString & playFabApiSecretKey) override { PlayFabCommon::PlayFabCommonSettings::playFabApiSecretKey = playFabApiSecretKey; } + + FString GetPhotonRealtimeAppId() const override { return PlayFabCommon::PlayFabCommonSettings::photonRealtimeAppId; } + void SetPhotonRealtimeAppId(const FString & photonRealtimeAppId) override { PlayFabCommon::PlayFabCommonSettings::photonRealtimeAppId = photonRealtimeAppId; } + + FString GetPhotonTurnbasedAppId() const override { return PlayFabCommon::PlayFabCommonSettings::photonTurnbasedAppId; } + void SetPhotonTurnbasedAppId(const FString & photonTurnbasedAppId) override { PlayFabCommon::PlayFabCommonSettings::photonTurnbasedAppId = photonTurnbasedAppId; } + + FString GetPhotonChatAppId() const override { return PlayFabCommon::PlayFabCommonSettings::photonChatAppId; } + void SetPhotonChatAppId(const FString & photonChatAppId) override { PlayFabCommon::PlayFabCommonSettings::photonChatAppId = photonChatAppId; } + + FString GetUrl(const FString& callPath) const override { return PlayFabCommon::PlayFabCommonSettings::getURL(callPath); } +}; + +void FPlayFabCommonModule::StartupModule() +{ + // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module + RegisterSettings(); + HandleSettingsSaved(); +} + +void FPlayFabCommonModule::ShutdownModule() +{ + // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, + // we call this function before unloading the module. + UnregisterSettings(); +} + +void FPlayFabCommonModule::RegisterSettings() +{ +#if WITH_EDITOR + if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr("Settings")) + { + ISettingsSectionPtr SettingsSection = SettingsModule->RegisterSettings("Project", "Plugins", "PlayFab", + LOCTEXT("PlayFabSettingsName", "PlayFab"), + LOCTEXT("PlayFabSettingsDescription", "Configure the PlayFab plugin"), + GetMutableDefault() + ); + + if (SettingsSection.IsValid()) + { + SettingsSection->OnModified().BindRaw(this, &FPlayFabCommonModule::HandleSettingsSaved); + } + } +#endif // WITH_EDITOR +} + +void FPlayFabCommonModule::UnregisterSettings() +{ +#if WITH_EDITOR + if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr("Settings")) + { + SettingsModule->UnregisterSettings("Project", "Plugins", "PlayFab"); + } +#endif +} + +bool FPlayFabCommonModule::HandleSettingsSaved() +{ + // copy to the internal structure + PlayFabCommon::PlayFabCommonSettings::serverURL = FString(); // flush the previous Server URL + PlayFabCommon::PlayFabCommonSettings::productionEnvironmentURL = GetDefault()->ProductionEnvironmentURL; + PlayFabCommon::PlayFabCommonSettings::titleId = GetDefault()->TitleId; + PlayFabCommon::PlayFabCommonSettings::developerSecretKey = GetDefault()->DeveloperSecretKey; + + return true; +} + +#undef LOCTEXT_NAMESPACE + +IMPLEMENT_MODULE(FPlayFabCommonModule, PlayFabCommon) diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Private/PlayFabCommonSettings.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Private/PlayFabCommonSettings.cpp new file mode 100644 index 000000000..c07eefbc7 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Private/PlayFabCommonSettings.cpp @@ -0,0 +1,33 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFabCommonSettings.h" + +namespace PlayFabCommon +{ + const FString PlayFabCommonSettings::sdkVersion = "1.1.180829"; + const FString PlayFabCommonSettings::buildIdentifier = "jbuild_unrealmarketplaceplugin_1"; + const FString PlayFabCommonSettings::versionString = "UE4MKPL-1.1.180829"; + + FString PlayFabCommonSettings::serverURL; + FString PlayFabCommonSettings::productionEnvironmentURL = ".playfabapi.com"; + + FString PlayFabCommonSettings::titleId; + + FString PlayFabCommonSettings::clientSessionTicket; + FString PlayFabCommonSettings::developerSecretKey; + FString PlayFabCommonSettings::entityToken; + FString PlayFabCommonSettings::advertisingIdType; + FString PlayFabCommonSettings::advertisingIdValue; + + bool PlayFabCommonSettings::disableAdvertising = false; + const FString PlayFabCommonSettings::AD_TYPE_IDFA = "Idfa"; + const FString PlayFabCommonSettings::AD_TYPE_ANDROID_ID = "Adid"; + + FString PlayFabCommonSettings::playFabApiSecretKey; + FString PlayFabCommonSettings::photonRealtimeAppId; + FString PlayFabCommonSettings::photonTurnbasedAppId; + FString PlayFabCommonSettings::photonChatAppId; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Private/PlayFabRuntimeSettings.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Private/PlayFabRuntimeSettings.cpp new file mode 100644 index 000000000..cefa8c7b3 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Private/PlayFabRuntimeSettings.cpp @@ -0,0 +1,16 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + + #include "PlayFabRuntimeSettings.h" + +////////////////////////////////////////////////////////////////////////// +// UPlayFabRuntimeSettings + +UPlayFabRuntimeSettings::UPlayFabRuntimeSettings() + : ProductionEnvironmentURL(TEXT(".playfabapi.com")) + , TitleId() + , DeveloperSecretKey() +{ +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Public/PlayFabCommon.h b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Public/PlayFabCommon.h new file mode 100644 index 000000000..587ad6da5 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Public/PlayFabCommon.h @@ -0,0 +1,76 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" +#include "Modules/ModuleManager.h" + +class IPlayFabCommonModuleInterface : public IModuleInterface +{ +public: + + /** + * Singleton-like access to this module's interface. This is just for convenience! + * Beware of calling this during the shutdown phase, though. Your module might have been unloaded already. + * + * @return Returns singleton instance, loading the module on demand if needed + */ + static inline IPlayFabCommonModuleInterface& Get() + { + return FModuleManager::LoadModuleChecked("PlayFabCommon"); + } + + /** + * Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true. + * + * @return True if the module is loaded and ready to use + */ + static inline bool IsAvailable() + { + return FModuleManager::Get().IsModuleLoaded("PlayFabCommon"); + } + + virtual FString GetSdkVersion() const = 0; + virtual FString GetBuildIdentifier() const = 0; + virtual FString GetVersionString() const = 0; + + virtual FString GetAD_TYPE_IDFA() const = 0; + virtual FString GetAD_TYPE_ANDROID_ID() const = 0; + + virtual FString GetServerURL() const = 0; + virtual FString GetProductionEnvironmentURL() const = 0; + virtual FString GetTitleId() const = 0; + virtual FString GetClientSessionTicket() const = 0; + virtual FString GetDeveloperSecretKey() const = 0; + virtual FString GetEntityToken() const = 0; + virtual FString GetAdvertisingIdType() const = 0; + virtual FString GetAdvertisingIdValue() const = 0; + virtual bool GetDisableAdvertising() const = 0; + + virtual void SetServerURL(const FString& serverURL) = 0; + virtual void SetProductionEnvironmentURL(const FString& productionEnvironmentURL) = 0; + virtual void SetTitleId(const FString& titleId) = 0; + virtual void SetClientSessionTicket(const FString& clientSessionTicket) = 0; + virtual void SetDeveloperSecretKey(const FString& developerSecretKey) = 0; + virtual void SetEntityToken(const FString& entityToken) = 0; + virtual void SetAdvertisingIdType(const FString& advertisingIdType) = 0; + virtual void SetAdvertisingIdValue(const FString& advertisingIdValue) = 0; + virtual void SetDisableAdvertising(bool disableAdvertising) = 0; + + virtual FString GetPlayFabApiSecretKey() const = 0; + virtual void SetPlayFabApiSecretKey(const FString& playFabApiSecretKey) = 0; + + virtual FString GetPhotonRealtimeAppId() const = 0; + virtual void SetPhotonRealtimeAppId(const FString & photonRealtimeAppId) = 0; + + virtual FString GetPhotonTurnbasedAppId() const = 0; + virtual void SetPhotonTurnbasedAppId(const FString & photonTurnbasedAppId) = 0; + + virtual FString GetPhotonChatAppId() const = 0; + virtual void SetPhotonChatAppId(const FString & photonChatAppId) = 0; + + virtual FString GetUrl(const FString& callPath) const = 0; +}; \ No newline at end of file diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Public/PlayFabCommonSettings.h b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Public/PlayFabCommonSettings.h new file mode 100644 index 000000000..d349808c2 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Public/PlayFabCommonSettings.h @@ -0,0 +1,46 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" + +namespace PlayFabCommon +{ + class PlayFabCommonSettings + { + public: + static const FString sdkVersion; + static const FString buildIdentifier; + static const FString versionString; + + static FString serverURL; + static FString productionEnvironmentURL; + static FString titleId; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) + static FString clientSessionTicket; // Secret token that represents your session in the Client API. Set by calling any login method in the Client API + static FString developerSecretKey; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) + static FString entityToken; // Secret token that represents your session in the Entity API. Set by calling GetEntityToken in the Entity API + static FString advertisingIdType; // Set this to the appropriate AD_TYPE_X constant below + static FString advertisingIdValue; // Set this to corresponding device value + + // DisableAdvertising is provided for completeness, but changing it is not suggested + // Disabling this may prevent your advertising-related PlayFab marketplace partners from working correctly + static bool disableAdvertising; + static const FString AD_TYPE_IDFA; + static const FString AD_TYPE_ANDROID_ID; + + static FString playFabApiSecretKey; // PlayFab DeveloperSecretKey + static FString photonRealtimeAppId; + static FString photonTurnbasedAppId; + static FString photonChatAppId; + + static FString getURL(const FString& callPath) + { + if (serverURL.Len() == 0) + serverURL = TEXT("https://") + titleId + productionEnvironmentURL; + return serverURL + callPath + TEXT("?sdk=") + versionString; + } + }; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Public/PlayFabRuntimeSettings.h b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Public/PlayFabRuntimeSettings.h new file mode 100644 index 000000000..3ad374202 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCommon/Public/PlayFabRuntimeSettings.h @@ -0,0 +1,32 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" +#include "PlayFabRuntimeSettings.generated.h" + +/** +* Implements the settings for the PlayFab plugin. +*/ +UCLASS(config = Engine, defaultconfig) +class PLAYFABCOMMON_API UPlayFabRuntimeSettings : public UObject +{ + GENERATED_BODY() +public: + UPlayFabRuntimeSettings(); + + // URL endpoint of the PlayFab production environment + UPROPERTY(EditAnywhere, config, Category = Settings) + FString ProductionEnvironmentURL; + + // Game Title ID + UPROPERTY(EditAnywhere, config, Category = Settings) + FString TitleId; + + // Secret Key, Do not add this to the clients! + UPROPERTY(EditAnywhere, config, Category = Settings) + FString DeveloperSecretKey; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/PlayFabCpp.Build.cs b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/PlayFabCpp.Build.cs new file mode 100644 index 000000000..6026246a0 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/PlayFabCpp.Build.cs @@ -0,0 +1,30 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + +using UnrealBuildTool; +using System.IO; + +public class PlayFabCpp : ModuleRules +{ + public PlayFabCpp(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public")); + + PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private")); + + PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public/Core")); + + PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private/Core")); + + PublicDependencyModuleNames.AddRange(new string[]{ + "Core", + "CoreUObject", + "HTTP", + "Json", + "PlayFabCommon" + }); + } +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAdminAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAdminAPI.cpp new file mode 100644 index 000000000..1adb2b1c2 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAdminAPI.cpp @@ -0,0 +1,2873 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabAdminAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::AdminModels; + +UPlayFabAdminAPI::UPlayFabAdminAPI() {} + +UPlayFabAdminAPI::~UPlayFabAdminAPI() {} + +int UPlayFabAdminAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabAdminAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabAdminAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabAdminAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabAdminAPI::AbortTaskInstance( + AdminModels::FAbortTaskInstanceRequest& request, + const FAbortTaskInstanceDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/AbortTaskInstance")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnAbortTaskInstanceResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnAbortTaskInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAbortTaskInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::AddNews( + AdminModels::FAddNewsRequest& request, + const FAddNewsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/AddNews")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnAddNewsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnAddNewsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddNewsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FAddNewsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::AddPlayerTag( + AdminModels::FAddPlayerTagRequest& request, + const FAddPlayerTagDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/AddPlayerTag")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnAddPlayerTagResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnAddPlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddPlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FAddPlayerTagResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::AddServerBuild( + AdminModels::FAddServerBuildRequest& request, + const FAddServerBuildDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/AddServerBuild")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnAddServerBuildResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnAddServerBuildResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddServerBuildDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FAddServerBuildResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::AddUserVirtualCurrency( + AdminModels::FAddUserVirtualCurrencyRequest& request, + const FAddUserVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/AddUserVirtualCurrency")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnAddUserVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnAddUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FModifyUserVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::AddVirtualCurrencyTypes( + AdminModels::FAddVirtualCurrencyTypesRequest& request, + const FAddVirtualCurrencyTypesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/AddVirtualCurrencyTypes")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnAddVirtualCurrencyTypesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnAddVirtualCurrencyTypesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddVirtualCurrencyTypesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FBlankResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::BanUsers( + AdminModels::FBanUsersRequest& request, + const FBanUsersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/BanUsers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnBanUsersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnBanUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FBanUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FBanUsersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::CheckLimitedEditionItemAvailability( + AdminModels::FCheckLimitedEditionItemAvailabilityRequest& request, + const FCheckLimitedEditionItemAvailabilityDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/CheckLimitedEditionItemAvailability")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnCheckLimitedEditionItemAvailabilityResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnCheckLimitedEditionItemAvailabilityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCheckLimitedEditionItemAvailabilityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FCheckLimitedEditionItemAvailabilityResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::CreateActionsOnPlayersInSegmentTask( + AdminModels::FCreateActionsOnPlayerSegmentTaskRequest& request, + const FCreateActionsOnPlayersInSegmentTaskDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/CreateActionsOnPlayersInSegmentTask")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnCreateActionsOnPlayersInSegmentTaskResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnCreateActionsOnPlayersInSegmentTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateActionsOnPlayersInSegmentTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FCreateTaskResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::CreateCloudScriptTask( + AdminModels::FCreateCloudScriptTaskRequest& request, + const FCreateCloudScriptTaskDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/CreateCloudScriptTask")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnCreateCloudScriptTaskResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnCreateCloudScriptTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateCloudScriptTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FCreateTaskResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::CreatePlayerSharedSecret( + AdminModels::FCreatePlayerSharedSecretRequest& request, + const FCreatePlayerSharedSecretDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/CreatePlayerSharedSecret")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnCreatePlayerSharedSecretResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnCreatePlayerSharedSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreatePlayerSharedSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FCreatePlayerSharedSecretResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::CreatePlayerStatisticDefinition( + AdminModels::FCreatePlayerStatisticDefinitionRequest& request, + const FCreatePlayerStatisticDefinitionDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/CreatePlayerStatisticDefinition")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnCreatePlayerStatisticDefinitionResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnCreatePlayerStatisticDefinitionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreatePlayerStatisticDefinitionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FCreatePlayerStatisticDefinitionResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeleteContent( + AdminModels::FDeleteContentRequest& request, + const FDeleteContentDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeleteContent")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeleteContentResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeleteContentResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteContentDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FBlankResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeleteMasterPlayerAccount( + AdminModels::FDeleteMasterPlayerAccountRequest& request, + const FDeleteMasterPlayerAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeleteMasterPlayerAccount")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeleteMasterPlayerAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeleteMasterPlayerAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteMasterPlayerAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FDeleteMasterPlayerAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeletePlayer( + AdminModels::FDeletePlayerRequest& request, + const FDeletePlayerDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeletePlayer")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeletePlayerResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeletePlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeletePlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FDeletePlayerResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeletePlayerSharedSecret( + AdminModels::FDeletePlayerSharedSecretRequest& request, + const FDeletePlayerSharedSecretDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeletePlayerSharedSecret")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeletePlayerSharedSecretResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeletePlayerSharedSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeletePlayerSharedSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FDeletePlayerSharedSecretResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeleteStore( + AdminModels::FDeleteStoreRequest& request, + const FDeleteStoreDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeleteStore")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeleteStoreResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeleteStoreResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteStoreDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FDeleteStoreResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeleteTask( + AdminModels::FDeleteTaskRequest& request, + const FDeleteTaskDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeleteTask")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeleteTaskResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeleteTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::DeleteTitle( + + const FDeleteTitleDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/DeleteTitle")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnDeleteTitleResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnDeleteTitleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteTitleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FDeleteTitleResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ExportMasterPlayerData( + AdminModels::FExportMasterPlayerDataRequest& request, + const FExportMasterPlayerDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ExportMasterPlayerData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnExportMasterPlayerDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnExportMasterPlayerDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExportMasterPlayerDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FExportMasterPlayerDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetActionsOnPlayersInSegmentTaskInstance( + AdminModels::FGetTaskInstanceRequest& request, + const FGetActionsOnPlayersInSegmentTaskInstanceDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetActionsOnPlayersInSegmentTaskInstance")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetActionsOnPlayersInSegmentTaskInstanceResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetActionsOnPlayersInSegmentTaskInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetActionsOnPlayersInSegmentTaskInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetActionsOnPlayersInSegmentTaskInstanceResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetAllSegments( + + const FGetAllSegmentsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetAllSegments")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetAllSegmentsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetAllSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetAllSegmentsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetCatalogItems( + AdminModels::FGetCatalogItemsRequest& request, + const FGetCatalogItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetCatalogItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetCatalogItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetCatalogItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetCloudScriptRevision( + AdminModels::FGetCloudScriptRevisionRequest& request, + const FGetCloudScriptRevisionDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetCloudScriptRevision")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetCloudScriptRevisionResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetCloudScriptRevisionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCloudScriptRevisionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetCloudScriptRevisionResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetCloudScriptTaskInstance( + AdminModels::FGetTaskInstanceRequest& request, + const FGetCloudScriptTaskInstanceDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetCloudScriptTaskInstance")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetCloudScriptTaskInstanceResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetCloudScriptTaskInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCloudScriptTaskInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetCloudScriptTaskInstanceResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetCloudScriptVersions( + + const FGetCloudScriptVersionsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetCloudScriptVersions")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetCloudScriptVersionsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetCloudScriptVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCloudScriptVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetCloudScriptVersionsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetContentList( + AdminModels::FGetContentListRequest& request, + const FGetContentListDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetContentList")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetContentListResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetContentListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetContentListResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetContentUploadUrl( + AdminModels::FGetContentUploadUrlRequest& request, + const FGetContentUploadUrlDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetContentUploadUrl")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetContentUploadUrlResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetContentUploadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentUploadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetContentUploadUrlResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetDataReport( + AdminModels::FGetDataReportRequest& request, + const FGetDataReportDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetDataReport")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetDataReportResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetDataReportResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetDataReportDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetDataReportResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetMatchmakerGameInfo( + AdminModels::FGetMatchmakerGameInfoRequest& request, + const FGetMatchmakerGameInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetMatchmakerGameInfo")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetMatchmakerGameInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetMatchmakerGameInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetMatchmakerGameInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetMatchmakerGameInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetMatchmakerGameModes( + AdminModels::FGetMatchmakerGameModesRequest& request, + const FGetMatchmakerGameModesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetMatchmakerGameModes")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetMatchmakerGameModesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetMatchmakerGameModesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetMatchmakerGameModesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetMatchmakerGameModesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayedTitleList( + AdminModels::FGetPlayedTitleListRequest& request, + const FGetPlayedTitleListDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayedTitleList")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayedTitleListResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayedTitleListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayedTitleListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayedTitleListResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerIdFromAuthToken( + AdminModels::FGetPlayerIdFromAuthTokenRequest& request, + const FGetPlayerIdFromAuthTokenDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerIdFromAuthToken")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerIdFromAuthTokenResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerIdFromAuthTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerIdFromAuthTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerIdFromAuthTokenResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerProfile( + AdminModels::FGetPlayerProfileRequest& request, + const FGetPlayerProfileDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerProfile")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerProfileResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerProfileResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerSegments( + AdminModels::FGetPlayersSegmentsRequest& request, + const FGetPlayerSegmentsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerSegments")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerSegmentsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerSegmentsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerSharedSecrets( + + const FGetPlayerSharedSecretsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerSharedSecrets")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerSharedSecretsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerSharedSecretsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSharedSecretsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerSharedSecretsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayersInSegment( + AdminModels::FGetPlayersInSegmentRequest& request, + const FGetPlayersInSegmentDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayersInSegment")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayersInSegmentResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayersInSegmentResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayersInSegmentDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayersInSegmentResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerStatisticDefinitions( + + const FGetPlayerStatisticDefinitionsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerStatisticDefinitions")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerStatisticDefinitionsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerStatisticDefinitionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticDefinitionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerStatisticDefinitionsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerStatisticVersions( + AdminModels::FGetPlayerStatisticVersionsRequest& request, + const FGetPlayerStatisticVersionsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerStatisticVersions")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerStatisticVersionsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerStatisticVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerStatisticVersionsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPlayerTags( + AdminModels::FGetPlayerTagsRequest& request, + const FGetPlayerTagsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPlayerTags")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPlayerTagsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPlayerTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPlayerTagsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPolicy( + AdminModels::FGetPolicyRequest& request, + const FGetPolicyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPolicy")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPolicyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPolicyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetPublisherData( + AdminModels::FGetPublisherDataRequest& request, + const FGetPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetPublisherDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetRandomResultTables( + AdminModels::FGetRandomResultTablesRequest& request, + const FGetRandomResultTablesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetRandomResultTables")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetRandomResultTablesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetRandomResultTablesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetRandomResultTablesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetRandomResultTablesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetServerBuildInfo( + AdminModels::FGetServerBuildInfoRequest& request, + const FGetServerBuildInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetServerBuildInfo")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetServerBuildInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetServerBuildInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetServerBuildInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetServerBuildInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetServerBuildUploadUrl( + AdminModels::FGetServerBuildUploadURLRequest& request, + const FGetServerBuildUploadUrlDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetServerBuildUploadUrl")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetServerBuildUploadUrlResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetServerBuildUploadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetServerBuildUploadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetServerBuildUploadURLResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetStoreItems( + AdminModels::FGetStoreItemsRequest& request, + const FGetStoreItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetStoreItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetStoreItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetStoreItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetTaskInstances( + AdminModels::FGetTaskInstancesRequest& request, + const FGetTaskInstancesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetTaskInstances")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetTaskInstancesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetTaskInstancesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTaskInstancesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetTaskInstancesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetTasks( + AdminModels::FGetTasksRequest& request, + const FGetTasksDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetTasks")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetTasksResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetTasksResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTasksDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetTasksResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetTitleData( + AdminModels::FGetTitleDataRequest& request, + const FGetTitleDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetTitleData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetTitleDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetTitleInternalData( + AdminModels::FGetTitleDataRequest& request, + const FGetTitleInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetTitleInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetTitleInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserAccountInfo( + AdminModels::FLookupUserAccountInfoRequest& request, + const FGetUserAccountInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserAccountInfo")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserAccountInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserAccountInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserAccountInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FLookupUserAccountInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserBans( + AdminModels::FGetUserBansRequest& request, + const FGetUserBansDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserBans")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserBansResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserBansResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserData( + AdminModels::FGetUserDataRequest& request, + const FGetUserDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserInternalData( + AdminModels::FGetUserDataRequest& request, + const FGetUserInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserInventory( + AdminModels::FGetUserInventoryRequest& request, + const FGetUserInventoryDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserInventory")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserInventoryResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserPublisherData( + AdminModels::FGetUserDataRequest& request, + const FGetUserPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserPublisherInternalData( + AdminModels::FGetUserDataRequest& request, + const FGetUserPublisherInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserPublisherInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserPublisherInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserPublisherReadOnlyData( + AdminModels::FGetUserDataRequest& request, + const FGetUserPublisherReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserPublisherReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserPublisherReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GetUserReadOnlyData( + AdminModels::FGetUserDataRequest& request, + const FGetUserReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GetUserReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGetUserReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGetUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::GrantItemsToUsers( + AdminModels::FGrantItemsToUsersRequest& request, + const FGrantItemsToUsersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/GrantItemsToUsers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnGrantItemsToUsersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnGrantItemsToUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FGrantItemsToUsersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::IncrementLimitedEditionItemAvailability( + AdminModels::FIncrementLimitedEditionItemAvailabilityRequest& request, + const FIncrementLimitedEditionItemAvailabilityDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/IncrementLimitedEditionItemAvailability")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnIncrementLimitedEditionItemAvailabilityResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnIncrementLimitedEditionItemAvailabilityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FIncrementLimitedEditionItemAvailabilityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FIncrementLimitedEditionItemAvailabilityResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::IncrementPlayerStatisticVersion( + AdminModels::FIncrementPlayerStatisticVersionRequest& request, + const FIncrementPlayerStatisticVersionDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/IncrementPlayerStatisticVersion")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnIncrementPlayerStatisticVersionResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnIncrementPlayerStatisticVersionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FIncrementPlayerStatisticVersionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FIncrementPlayerStatisticVersionResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ListServerBuilds( + + const FListServerBuildsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ListServerBuilds")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnListServerBuildsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnListServerBuildsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListServerBuildsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FListBuildsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ListVirtualCurrencyTypes( + + const FListVirtualCurrencyTypesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ListVirtualCurrencyTypes")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnListVirtualCurrencyTypesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnListVirtualCurrencyTypesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListVirtualCurrencyTypesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FListVirtualCurrencyTypesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ModifyMatchmakerGameModes( + AdminModels::FModifyMatchmakerGameModesRequest& request, + const FModifyMatchmakerGameModesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ModifyMatchmakerGameModes")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnModifyMatchmakerGameModesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnModifyMatchmakerGameModesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FModifyMatchmakerGameModesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FModifyMatchmakerGameModesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ModifyServerBuild( + AdminModels::FModifyServerBuildRequest& request, + const FModifyServerBuildDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ModifyServerBuild")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnModifyServerBuildResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnModifyServerBuildResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FModifyServerBuildDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FModifyServerBuildResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RefundPurchase( + AdminModels::FRefundPurchaseRequest& request, + const FRefundPurchaseDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RefundPurchase")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRefundPurchaseResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRefundPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefundPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRefundPurchaseResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RemovePlayerTag( + AdminModels::FRemovePlayerTagRequest& request, + const FRemovePlayerTagDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RemovePlayerTag")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRemovePlayerTagResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRemovePlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemovePlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRemovePlayerTagResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RemoveServerBuild( + AdminModels::FRemoveServerBuildRequest& request, + const FRemoveServerBuildDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RemoveServerBuild")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRemoveServerBuildResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRemoveServerBuildResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveServerBuildDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRemoveServerBuildResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RemoveVirtualCurrencyTypes( + AdminModels::FRemoveVirtualCurrencyTypesRequest& request, + const FRemoveVirtualCurrencyTypesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RemoveVirtualCurrencyTypes")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRemoveVirtualCurrencyTypesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRemoveVirtualCurrencyTypesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveVirtualCurrencyTypesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FBlankResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ResetCharacterStatistics( + AdminModels::FResetCharacterStatisticsRequest& request, + const FResetCharacterStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ResetCharacterStatistics")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnResetCharacterStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnResetCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResetCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FResetCharacterStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ResetPassword( + AdminModels::FResetPasswordRequest& request, + const FResetPasswordDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ResetPassword")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnResetPasswordResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnResetPasswordResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResetPasswordDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FResetPasswordResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ResetUserStatistics( + AdminModels::FResetUserStatisticsRequest& request, + const FResetUserStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ResetUserStatistics")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnResetUserStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnResetUserStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResetUserStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FResetUserStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::ResolvePurchaseDispute( + AdminModels::FResolvePurchaseDisputeRequest& request, + const FResolvePurchaseDisputeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/ResolvePurchaseDispute")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnResolvePurchaseDisputeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnResolvePurchaseDisputeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResolvePurchaseDisputeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FResolvePurchaseDisputeResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RevokeAllBansForUser( + AdminModels::FRevokeAllBansForUserRequest& request, + const FRevokeAllBansForUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RevokeAllBansForUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRevokeAllBansForUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRevokeAllBansForUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeAllBansForUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRevokeAllBansForUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RevokeBans( + AdminModels::FRevokeBansRequest& request, + const FRevokeBansDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RevokeBans")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRevokeBansResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRevokeBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRevokeBansResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RevokeInventoryItem( + AdminModels::FRevokeInventoryItemRequest& request, + const FRevokeInventoryItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RevokeInventoryItem")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRevokeInventoryItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRevokeInventoryItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRevokeInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RevokeInventoryItems( + AdminModels::FRevokeInventoryItemsRequest& request, + const FRevokeInventoryItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RevokeInventoryItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRevokeInventoryItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRevokeInventoryItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRevokeInventoryItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::RunTask( + AdminModels::FRunTaskRequest& request, + const FRunTaskDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/RunTask")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnRunTaskResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnRunTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRunTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FRunTaskResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SendAccountRecoveryEmail( + AdminModels::FSendAccountRecoveryEmailRequest& request, + const FSendAccountRecoveryEmailDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SendAccountRecoveryEmail")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSendAccountRecoveryEmailResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSendAccountRecoveryEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendAccountRecoveryEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSendAccountRecoveryEmailResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetCatalogItems( + AdminModels::FUpdateCatalogItemsRequest& request, + const FSetCatalogItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetCatalogItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetCatalogItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateCatalogItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetPlayerSecret( + AdminModels::FSetPlayerSecretRequest& request, + const FSetPlayerSecretDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetPlayerSecret")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetPlayerSecretResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetPlayerSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPlayerSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSetPlayerSecretResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetPublishedRevision( + AdminModels::FSetPublishedRevisionRequest& request, + const FSetPublishedRevisionDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetPublishedRevision")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetPublishedRevisionResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetPublishedRevisionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPublishedRevisionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSetPublishedRevisionResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetPublisherData( + AdminModels::FSetPublisherDataRequest& request, + const FSetPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSetPublisherDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetStoreItems( + AdminModels::FUpdateStoreItemsRequest& request, + const FSetStoreItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetStoreItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetStoreItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateStoreItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetTitleData( + AdminModels::FSetTitleDataRequest& request, + const FSetTitleDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetTitleData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetTitleDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetTitleInternalData( + AdminModels::FSetTitleDataRequest& request, + const FSetTitleInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetTitleInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetTitleInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SetupPushNotification( + AdminModels::FSetupPushNotificationRequest& request, + const FSetupPushNotificationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SetupPushNotification")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSetupPushNotificationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSetupPushNotificationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetupPushNotificationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FSetupPushNotificationResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::SubtractUserVirtualCurrency( + AdminModels::FSubtractUserVirtualCurrencyRequest& request, + const FSubtractUserVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/SubtractUserVirtualCurrency")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnSubtractUserVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnSubtractUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FModifyUserVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateBans( + AdminModels::FUpdateBansRequest& request, + const FUpdateBansDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateBans")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateBansResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateBansResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateCatalogItems( + AdminModels::FUpdateCatalogItemsRequest& request, + const FUpdateCatalogItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateCatalogItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateCatalogItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateCatalogItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateCloudScript( + AdminModels::FUpdateCloudScriptRequest& request, + const FUpdateCloudScriptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateCloudScript")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateCloudScriptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateCloudScriptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdatePlayerSharedSecret( + AdminModels::FUpdatePlayerSharedSecretRequest& request, + const FUpdatePlayerSharedSecretDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdatePlayerSharedSecret")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdatePlayerSharedSecretResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdatePlayerSharedSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerSharedSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdatePlayerSharedSecretResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdatePlayerStatisticDefinition( + AdminModels::FUpdatePlayerStatisticDefinitionRequest& request, + const FUpdatePlayerStatisticDefinitionDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdatePlayerStatisticDefinition")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdatePlayerStatisticDefinitionResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdatePlayerStatisticDefinitionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerStatisticDefinitionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdatePlayerStatisticDefinitionResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdatePolicy( + AdminModels::FUpdatePolicyRequest& request, + const FUpdatePolicyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdatePolicy")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdatePolicyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdatePolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdatePolicyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateRandomResultTables( + AdminModels::FUpdateRandomResultTablesRequest& request, + const FUpdateRandomResultTablesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateRandomResultTables")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateRandomResultTablesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateRandomResultTablesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateRandomResultTablesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateRandomResultTablesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateStoreItems( + AdminModels::FUpdateStoreItemsRequest& request, + const FUpdateStoreItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateStoreItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateStoreItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateStoreItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateTask( + AdminModels::FUpdateTaskRequest& request, + const FUpdateTaskDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateTask")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateTaskResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserData( + AdminModels::FUpdateUserDataRequest& request, + const FUpdateUserDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserInternalData( + AdminModels::FUpdateUserInternalDataRequest& request, + const FUpdateUserInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserPublisherData( + AdminModels::FUpdateUserDataRequest& request, + const FUpdateUserPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserPublisherInternalData( + AdminModels::FUpdateUserInternalDataRequest& request, + const FUpdateUserPublisherInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserPublisherInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserPublisherInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserPublisherReadOnlyData( + AdminModels::FUpdateUserDataRequest& request, + const FUpdateUserPublisherReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserPublisherReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserPublisherReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserReadOnlyData( + AdminModels::FUpdateUserDataRequest& request, + const FUpdateUserReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabAdminAPI::UpdateUserTitleDisplayName( + AdminModels::FUpdateUserTitleDisplayNameRequest& request, + const FUpdateUserTitleDisplayNameDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Admin/UpdateUserTitleDisplayName")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAdminAPI::OnUpdateUserTitleDisplayNameResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAdminAPI::OnUpdateUserTitleDisplayNameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserTitleDisplayNameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AdminModels::FUpdateUserTitleDisplayNameResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAdminDataModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAdminDataModels.cpp new file mode 100644 index 000000000..820d02726 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAdminDataModels.cpp @@ -0,0 +1,13448 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabAdminDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::AdminModels; + +PlayFab::AdminModels::FAbortTaskInstanceRequest::~FAbortTaskInstanceRequest() +{ + +} + +void PlayFab::AdminModels::FAbortTaskInstanceRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("TaskInstanceId")); writer->WriteValue(TaskInstanceId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAbortTaskInstanceRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TaskInstanceIdValue = obj->TryGetField(TEXT("TaskInstanceId")); + if (TaskInstanceIdValue.IsValid() && !TaskInstanceIdValue->IsNull()) + { + FString TmpValue; + if (TaskInstanceIdValue->TryGetString(TmpValue)) { TaskInstanceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FActionsOnPlayersInSegmentTaskParameter::~FActionsOnPlayersInSegmentTaskParameter() +{ + +} + +void PlayFab::AdminModels::FActionsOnPlayersInSegmentTaskParameter::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ActionId")); writer->WriteValue(ActionId); + + writer->WriteIdentifierPrefix(TEXT("SegmentId")); writer->WriteValue(SegmentId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FActionsOnPlayersInSegmentTaskParameter::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActionIdValue = obj->TryGetField(TEXT("ActionId")); + if (ActionIdValue.IsValid() && !ActionIdValue->IsNull()) + { + FString TmpValue; + if (ActionIdValue->TryGetString(TmpValue)) { ActionId = TmpValue; } + } + + const TSharedPtr SegmentIdValue = obj->TryGetField(TEXT("SegmentId")); + if (SegmentIdValue.IsValid() && !SegmentIdValue->IsNull()) + { + FString TmpValue; + if (SegmentIdValue->TryGetString(TmpValue)) { SegmentId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeTaskInstanceStatusEnumJSON(TaskInstanceStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case TaskInstanceStatusSucceeded: writer->WriteValue(TEXT("Succeeded")); break; + case TaskInstanceStatusStarting: writer->WriteValue(TEXT("Starting")); break; + case TaskInstanceStatusInProgress: writer->WriteValue(TEXT("InProgress")); break; + case TaskInstanceStatusFailed: writer->WriteValue(TEXT("Failed")); break; + case TaskInstanceStatusAborted: writer->WriteValue(TEXT("Aborted")); break; + case TaskInstanceStatusPending: writer->WriteValue(TEXT("Pending")); break; + } +} + +AdminModels::TaskInstanceStatus PlayFab::AdminModels::readTaskInstanceStatusFromValue(const TSharedPtr& value) +{ + return readTaskInstanceStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::TaskInstanceStatus PlayFab::AdminModels::readTaskInstanceStatusFromValue(const FString& value) +{ + static TMap _TaskInstanceStatusMap; + if (_TaskInstanceStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _TaskInstanceStatusMap.Add(TEXT("Succeeded"), TaskInstanceStatusSucceeded); + _TaskInstanceStatusMap.Add(TEXT("Starting"), TaskInstanceStatusStarting); + _TaskInstanceStatusMap.Add(TEXT("InProgress"), TaskInstanceStatusInProgress); + _TaskInstanceStatusMap.Add(TEXT("Failed"), TaskInstanceStatusFailed); + _TaskInstanceStatusMap.Add(TEXT("Aborted"), TaskInstanceStatusAborted); + _TaskInstanceStatusMap.Add(TEXT("Pending"), TaskInstanceStatusPending); + + } + + if (!value.IsEmpty()) + { + auto output = _TaskInstanceStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return TaskInstanceStatusSucceeded; // Basically critical fail +} + +PlayFab::AdminModels::FNameIdentifier::~FNameIdentifier() +{ + +} + +void PlayFab::AdminModels::FNameIdentifier::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Id.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FNameIdentifier::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FActionsOnPlayersInSegmentTaskSummary::~FActionsOnPlayersInSegmentTaskSummary() +{ + //if (TaskIdentifier != nullptr) delete TaskIdentifier; + +} + +void PlayFab::AdminModels::FActionsOnPlayersInSegmentTaskSummary::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CompletedAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("CompletedAt")); writeDatetime(CompletedAt, writer); } + + if (ErrorMessage.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ErrorMessage")); writer->WriteValue(ErrorMessage); } + + if (ErrorWasFatal.notNull()) { writer->WriteIdentifierPrefix(TEXT("ErrorWasFatal")); writer->WriteValue(ErrorWasFatal); } + + if (EstimatedSecondsRemaining.notNull()) { writer->WriteIdentifierPrefix(TEXT("EstimatedSecondsRemaining")); writer->WriteValue(EstimatedSecondsRemaining); } + + if (PercentComplete.notNull()) { writer->WriteIdentifierPrefix(TEXT("PercentComplete")); writer->WriteValue(PercentComplete); } + + if (ScheduledByUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ScheduledByUserId")); writer->WriteValue(ScheduledByUserId); } + + writer->WriteIdentifierPrefix(TEXT("StartedAt")); writeDatetime(StartedAt, writer); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeTaskInstanceStatusEnumJSON(Status, writer); } + + if (TaskIdentifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TaskIdentifier")); TaskIdentifier->writeJSON(writer); } + + if (TaskInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TaskInstanceId")); writer->WriteValue(TaskInstanceId); } + + if (TotalPlayersInSegment.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalPlayersInSegment")); writer->WriteValue(TotalPlayersInSegment); } + + if (TotalPlayersProcessed.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalPlayersProcessed")); writer->WriteValue(TotalPlayersProcessed); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FActionsOnPlayersInSegmentTaskSummary::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CompletedAtValue = obj->TryGetField(TEXT("CompletedAt")); + if (CompletedAtValue.IsValid()) + CompletedAt = readDatetime(CompletedAtValue); + + + const TSharedPtr ErrorMessageValue = obj->TryGetField(TEXT("ErrorMessage")); + if (ErrorMessageValue.IsValid() && !ErrorMessageValue->IsNull()) + { + FString TmpValue; + if (ErrorMessageValue->TryGetString(TmpValue)) { ErrorMessage = TmpValue; } + } + + const TSharedPtr ErrorWasFatalValue = obj->TryGetField(TEXT("ErrorWasFatal")); + if (ErrorWasFatalValue.IsValid() && !ErrorWasFatalValue->IsNull()) + { + bool TmpValue; + if (ErrorWasFatalValue->TryGetBool(TmpValue)) { ErrorWasFatal = TmpValue; } + } + + const TSharedPtr EstimatedSecondsRemainingValue = obj->TryGetField(TEXT("EstimatedSecondsRemaining")); + if (EstimatedSecondsRemainingValue.IsValid() && !EstimatedSecondsRemainingValue->IsNull()) + { + double TmpValue; + if (EstimatedSecondsRemainingValue->TryGetNumber(TmpValue)) { EstimatedSecondsRemaining = TmpValue; } + } + + const TSharedPtr PercentCompleteValue = obj->TryGetField(TEXT("PercentComplete")); + if (PercentCompleteValue.IsValid() && !PercentCompleteValue->IsNull()) + { + double TmpValue; + if (PercentCompleteValue->TryGetNumber(TmpValue)) { PercentComplete = TmpValue; } + } + + const TSharedPtr ScheduledByUserIdValue = obj->TryGetField(TEXT("ScheduledByUserId")); + if (ScheduledByUserIdValue.IsValid() && !ScheduledByUserIdValue->IsNull()) + { + FString TmpValue; + if (ScheduledByUserIdValue->TryGetString(TmpValue)) { ScheduledByUserId = TmpValue; } + } + + const TSharedPtr StartedAtValue = obj->TryGetField(TEXT("StartedAt")); + if (StartedAtValue.IsValid()) + StartedAt = readDatetime(StartedAtValue); + + + Status = readTaskInstanceStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TaskIdentifierValue = obj->TryGetField(TEXT("TaskIdentifier")); + if (TaskIdentifierValue.IsValid() && !TaskIdentifierValue->IsNull()) + { + TaskIdentifier = MakeShareable(new FNameIdentifier(TaskIdentifierValue->AsObject())); + } + + const TSharedPtr TaskInstanceIdValue = obj->TryGetField(TEXT("TaskInstanceId")); + if (TaskInstanceIdValue.IsValid() && !TaskInstanceIdValue->IsNull()) + { + FString TmpValue; + if (TaskInstanceIdValue->TryGetString(TmpValue)) { TaskInstanceId = TmpValue; } + } + + const TSharedPtr TotalPlayersInSegmentValue = obj->TryGetField(TEXT("TotalPlayersInSegment")); + if (TotalPlayersInSegmentValue.IsValid() && !TotalPlayersInSegmentValue->IsNull()) + { + int32 TmpValue; + if (TotalPlayersInSegmentValue->TryGetNumber(TmpValue)) { TotalPlayersInSegment = TmpValue; } + } + + const TSharedPtr TotalPlayersProcessedValue = obj->TryGetField(TEXT("TotalPlayersProcessed")); + if (TotalPlayersProcessedValue.IsValid() && !TotalPlayersProcessedValue->IsNull()) + { + int32 TmpValue; + if (TotalPlayersProcessedValue->TryGetNumber(TmpValue)) { TotalPlayersProcessed = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAdCampaignAttribution::~FAdCampaignAttribution() +{ + +} + +void PlayFab::AdminModels::FAdCampaignAttribution::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AttributedAt")); writeDatetime(AttributedAt, writer); + + if (CampaignId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CampaignId")); writer->WriteValue(CampaignId); } + + if (Platform.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Platform")); writer->WriteValue(Platform); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAdCampaignAttribution::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AttributedAtValue = obj->TryGetField(TEXT("AttributedAt")); + if (AttributedAtValue.IsValid()) + AttributedAt = readDatetime(AttributedAtValue); + + + const TSharedPtr CampaignIdValue = obj->TryGetField(TEXT("CampaignId")); + if (CampaignIdValue.IsValid() && !CampaignIdValue->IsNull()) + { + FString TmpValue; + if (CampaignIdValue->TryGetString(TmpValue)) { CampaignId = TmpValue; } + } + + const TSharedPtr PlatformValue = obj->TryGetField(TEXT("Platform")); + if (PlatformValue.IsValid() && !PlatformValue->IsNull()) + { + FString TmpValue; + if (PlatformValue->TryGetString(TmpValue)) { Platform = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAdCampaignAttributionModel::~FAdCampaignAttributionModel() +{ + +} + +void PlayFab::AdminModels::FAdCampaignAttributionModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AttributedAt")); writeDatetime(AttributedAt, writer); + + if (CampaignId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CampaignId")); writer->WriteValue(CampaignId); } + + if (Platform.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Platform")); writer->WriteValue(Platform); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAdCampaignAttributionModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AttributedAtValue = obj->TryGetField(TEXT("AttributedAt")); + if (AttributedAtValue.IsValid()) + AttributedAt = readDatetime(AttributedAtValue); + + + const TSharedPtr CampaignIdValue = obj->TryGetField(TEXT("CampaignId")); + if (CampaignIdValue.IsValid() && !CampaignIdValue->IsNull()) + { + FString TmpValue; + if (CampaignIdValue->TryGetString(TmpValue)) { CampaignId = TmpValue; } + } + + const TSharedPtr PlatformValue = obj->TryGetField(TEXT("Platform")); + if (PlatformValue.IsValid() && !PlatformValue->IsNull()) + { + FString TmpValue; + if (PlatformValue->TryGetString(TmpValue)) { Platform = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAddNewsRequest::~FAddNewsRequest() +{ + +} + +void PlayFab::AdminModels::FAddNewsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Body")); writer->WriteValue(Body); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteIdentifierPrefix(TEXT("Title")); writer->WriteValue(Title); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddNewsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BodyValue = obj->TryGetField(TEXT("Body")); + if (BodyValue.IsValid() && !BodyValue->IsNull()) + { + FString TmpValue; + if (BodyValue->TryGetString(TmpValue)) { Body = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + const TSharedPtr TitleValue = obj->TryGetField(TEXT("Title")); + if (TitleValue.IsValid() && !TitleValue->IsNull()) + { + FString TmpValue; + if (TitleValue->TryGetString(TmpValue)) { Title = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAddNewsResult::~FAddNewsResult() +{ + +} + +void PlayFab::AdminModels::FAddNewsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NewsId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NewsId")); writer->WriteValue(NewsId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddNewsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NewsIdValue = obj->TryGetField(TEXT("NewsId")); + if (NewsIdValue.IsValid() && !NewsIdValue->IsNull()) + { + FString TmpValue; + if (NewsIdValue->TryGetString(TmpValue)) { NewsId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAddPlayerTagRequest::~FAddPlayerTagRequest() +{ + +} + +void PlayFab::AdminModels::FAddPlayerTagRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("TagName")); writer->WriteValue(TagName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddPlayerTagRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TagNameValue = obj->TryGetField(TEXT("TagName")); + if (TagNameValue.IsValid() && !TagNameValue->IsNull()) + { + FString TmpValue; + if (TagNameValue->TryGetString(TmpValue)) { TagName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAddPlayerTagResult::~FAddPlayerTagResult() +{ + +} + +void PlayFab::AdminModels::FAddPlayerTagResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddPlayerTagResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeRegionEnumJSON(Region enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case RegionUSCentral: writer->WriteValue(TEXT("USCentral")); break; + case RegionUSEast: writer->WriteValue(TEXT("USEast")); break; + case RegionEUWest: writer->WriteValue(TEXT("EUWest")); break; + case RegionSingapore: writer->WriteValue(TEXT("Singapore")); break; + case RegionJapan: writer->WriteValue(TEXT("Japan")); break; + case RegionBrazil: writer->WriteValue(TEXT("Brazil")); break; + case RegionAustralia: writer->WriteValue(TEXT("Australia")); break; + } +} + +AdminModels::Region PlayFab::AdminModels::readRegionFromValue(const TSharedPtr& value) +{ + return readRegionFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::Region PlayFab::AdminModels::readRegionFromValue(const FString& value) +{ + static TMap _RegionMap; + if (_RegionMap.Num() == 0) + { + // Auto-generate the map on the first use + _RegionMap.Add(TEXT("USCentral"), RegionUSCentral); + _RegionMap.Add(TEXT("USEast"), RegionUSEast); + _RegionMap.Add(TEXT("EUWest"), RegionEUWest); + _RegionMap.Add(TEXT("Singapore"), RegionSingapore); + _RegionMap.Add(TEXT("Japan"), RegionJapan); + _RegionMap.Add(TEXT("Brazil"), RegionBrazil); + _RegionMap.Add(TEXT("Australia"), RegionAustralia); + + } + + if (!value.IsEmpty()) + { + auto output = _RegionMap.Find(value); + if (output != nullptr) + return *output; + } + + return RegionUSCentral; // Basically critical fail +} + +PlayFab::AdminModels::FAddServerBuildRequest::~FAddServerBuildRequest() +{ + +} + +void PlayFab::AdminModels::FAddServerBuildRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ActiveRegions.Num() != 0) + { + writer->WriteArrayStart(TEXT("ActiveRegions")); + for (const Region& item : ActiveRegions) + writeRegionEnumJSON(item, writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); + + if (CommandLineTemplate.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CommandLineTemplate")); writer->WriteValue(CommandLineTemplate); } + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + if (ExecutablePath.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ExecutablePath")); writer->WriteValue(ExecutablePath); } + + writer->WriteIdentifierPrefix(TEXT("MaxGamesPerHost")); writer->WriteValue(MaxGamesPerHost); + + writer->WriteIdentifierPrefix(TEXT("MinFreeGameSlots")); writer->WriteValue(MinFreeGameSlots); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddServerBuildRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ActiveRegionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ActiveRegions")); + for (int32 Idx = 0; Idx < ActiveRegionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ActiveRegionsArray[Idx]; + ActiveRegions.Add(readRegionFromValue(CurrentItem)); + } + + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + const TSharedPtr CommandLineTemplateValue = obj->TryGetField(TEXT("CommandLineTemplate")); + if (CommandLineTemplateValue.IsValid() && !CommandLineTemplateValue->IsNull()) + { + FString TmpValue; + if (CommandLineTemplateValue->TryGetString(TmpValue)) { CommandLineTemplate = TmpValue; } + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ExecutablePathValue = obj->TryGetField(TEXT("ExecutablePath")); + if (ExecutablePathValue.IsValid() && !ExecutablePathValue->IsNull()) + { + FString TmpValue; + if (ExecutablePathValue->TryGetString(TmpValue)) { ExecutablePath = TmpValue; } + } + + const TSharedPtr MaxGamesPerHostValue = obj->TryGetField(TEXT("MaxGamesPerHost")); + if (MaxGamesPerHostValue.IsValid() && !MaxGamesPerHostValue->IsNull()) + { + int32 TmpValue; + if (MaxGamesPerHostValue->TryGetNumber(TmpValue)) { MaxGamesPerHost = TmpValue; } + } + + const TSharedPtr MinFreeGameSlotsValue = obj->TryGetField(TEXT("MinFreeGameSlots")); + if (MinFreeGameSlotsValue.IsValid() && !MinFreeGameSlotsValue->IsNull()) + { + int32 TmpValue; + if (MinFreeGameSlotsValue->TryGetNumber(TmpValue)) { MinFreeGameSlots = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeGameBuildStatusEnumJSON(GameBuildStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case GameBuildStatusAvailable: writer->WriteValue(TEXT("Available")); break; + case GameBuildStatusValidating: writer->WriteValue(TEXT("Validating")); break; + case GameBuildStatusInvalidBuildPackage: writer->WriteValue(TEXT("InvalidBuildPackage")); break; + case GameBuildStatusProcessing: writer->WriteValue(TEXT("Processing")); break; + case GameBuildStatusFailedToProcess: writer->WriteValue(TEXT("FailedToProcess")); break; + } +} + +AdminModels::GameBuildStatus PlayFab::AdminModels::readGameBuildStatusFromValue(const TSharedPtr& value) +{ + return readGameBuildStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::GameBuildStatus PlayFab::AdminModels::readGameBuildStatusFromValue(const FString& value) +{ + static TMap _GameBuildStatusMap; + if (_GameBuildStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _GameBuildStatusMap.Add(TEXT("Available"), GameBuildStatusAvailable); + _GameBuildStatusMap.Add(TEXT("Validating"), GameBuildStatusValidating); + _GameBuildStatusMap.Add(TEXT("InvalidBuildPackage"), GameBuildStatusInvalidBuildPackage); + _GameBuildStatusMap.Add(TEXT("Processing"), GameBuildStatusProcessing); + _GameBuildStatusMap.Add(TEXT("FailedToProcess"), GameBuildStatusFailedToProcess); + + } + + if (!value.IsEmpty()) + { + auto output = _GameBuildStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return GameBuildStatusAvailable; // Basically critical fail +} + +PlayFab::AdminModels::FAddServerBuildResult::~FAddServerBuildResult() +{ + +} + +void PlayFab::AdminModels::FAddServerBuildResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ActiveRegions.Num() != 0) + { + writer->WriteArrayStart(TEXT("ActiveRegions")); + for (const Region& item : ActiveRegions) + writeRegionEnumJSON(item, writer); + writer->WriteArrayEnd(); + } + + + if (BuildId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); } + + if (CommandLineTemplate.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CommandLineTemplate")); writer->WriteValue(CommandLineTemplate); } + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + if (ExecutablePath.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ExecutablePath")); writer->WriteValue(ExecutablePath); } + + writer->WriteIdentifierPrefix(TEXT("MaxGamesPerHost")); writer->WriteValue(MaxGamesPerHost); + + writer->WriteIdentifierPrefix(TEXT("MinFreeGameSlots")); writer->WriteValue(MinFreeGameSlots); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeGameBuildStatusEnumJSON(Status, writer); } + + writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddServerBuildResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ActiveRegionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ActiveRegions")); + for (int32 Idx = 0; Idx < ActiveRegionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ActiveRegionsArray[Idx]; + ActiveRegions.Add(readRegionFromValue(CurrentItem)); + } + + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + const TSharedPtr CommandLineTemplateValue = obj->TryGetField(TEXT("CommandLineTemplate")); + if (CommandLineTemplateValue.IsValid() && !CommandLineTemplateValue->IsNull()) + { + FString TmpValue; + if (CommandLineTemplateValue->TryGetString(TmpValue)) { CommandLineTemplate = TmpValue; } + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ExecutablePathValue = obj->TryGetField(TEXT("ExecutablePath")); + if (ExecutablePathValue.IsValid() && !ExecutablePathValue->IsNull()) + { + FString TmpValue; + if (ExecutablePathValue->TryGetString(TmpValue)) { ExecutablePath = TmpValue; } + } + + const TSharedPtr MaxGamesPerHostValue = obj->TryGetField(TEXT("MaxGamesPerHost")); + if (MaxGamesPerHostValue.IsValid() && !MaxGamesPerHostValue->IsNull()) + { + int32 TmpValue; + if (MaxGamesPerHostValue->TryGetNumber(TmpValue)) { MaxGamesPerHost = TmpValue; } + } + + const TSharedPtr MinFreeGameSlotsValue = obj->TryGetField(TEXT("MinFreeGameSlots")); + if (MinFreeGameSlotsValue.IsValid() && !MinFreeGameSlotsValue->IsNull()) + { + int32 TmpValue; + if (MinFreeGameSlotsValue->TryGetNumber(TmpValue)) { MinFreeGameSlots = TmpValue; } + } + + Status = readGameBuildStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAddUserVirtualCurrencyRequest::~FAddUserVirtualCurrencyRequest() +{ + +} + +void PlayFab::AdminModels::FAddUserVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddUserVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FVirtualCurrencyData::~FVirtualCurrencyData() +{ + +} + +void PlayFab::AdminModels::FVirtualCurrencyData::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CurrencyCode")); writer->WriteValue(CurrencyCode); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (InitialDeposit.notNull()) { writer->WriteIdentifierPrefix(TEXT("InitialDeposit")); writer->WriteValue(InitialDeposit); } + + if (RechargeMax.notNull()) { writer->WriteIdentifierPrefix(TEXT("RechargeMax")); writer->WriteValue(RechargeMax); } + + if (RechargeRate.notNull()) { writer->WriteIdentifierPrefix(TEXT("RechargeRate")); writer->WriteValue(RechargeRate); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FVirtualCurrencyData::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyCodeValue = obj->TryGetField(TEXT("CurrencyCode")); + if (CurrencyCodeValue.IsValid() && !CurrencyCodeValue->IsNull()) + { + FString TmpValue; + if (CurrencyCodeValue->TryGetString(TmpValue)) { CurrencyCode = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr InitialDepositValue = obj->TryGetField(TEXT("InitialDeposit")); + if (InitialDepositValue.IsValid() && !InitialDepositValue->IsNull()) + { + int32 TmpValue; + if (InitialDepositValue->TryGetNumber(TmpValue)) { InitialDeposit = TmpValue; } + } + + const TSharedPtr RechargeMaxValue = obj->TryGetField(TEXT("RechargeMax")); + if (RechargeMaxValue.IsValid() && !RechargeMaxValue->IsNull()) + { + int32 TmpValue; + if (RechargeMaxValue->TryGetNumber(TmpValue)) { RechargeMax = TmpValue; } + } + + const TSharedPtr RechargeRateValue = obj->TryGetField(TEXT("RechargeRate")); + if (RechargeRateValue.IsValid() && !RechargeRateValue->IsNull()) + { + int32 TmpValue; + if (RechargeRateValue->TryGetNumber(TmpValue)) { RechargeRate = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FAddVirtualCurrencyTypesRequest::~FAddVirtualCurrencyTypesRequest() +{ + +} + +void PlayFab::AdminModels::FAddVirtualCurrencyTypesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("VirtualCurrencies")); + for (const FVirtualCurrencyData& item : VirtualCurrencies) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FAddVirtualCurrencyTypesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&VirtualCurrenciesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("VirtualCurrencies")); + for (int32 Idx = 0; Idx < VirtualCurrenciesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = VirtualCurrenciesArray[Idx]; + VirtualCurrencies.Add(FVirtualCurrencyData(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeConditionalsEnumJSON(Conditionals enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ConditionalsAny: writer->WriteValue(TEXT("Any")); break; + case ConditionalsTrue: writer->WriteValue(TEXT("True")); break; + case ConditionalsFalse: writer->WriteValue(TEXT("False")); break; + } +} + +AdminModels::Conditionals PlayFab::AdminModels::readConditionalsFromValue(const TSharedPtr& value) +{ + return readConditionalsFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::Conditionals PlayFab::AdminModels::readConditionalsFromValue(const FString& value) +{ + static TMap _ConditionalsMap; + if (_ConditionalsMap.Num() == 0) + { + // Auto-generate the map on the first use + _ConditionalsMap.Add(TEXT("Any"), ConditionalsAny); + _ConditionalsMap.Add(TEXT("True"), ConditionalsTrue); + _ConditionalsMap.Add(TEXT("False"), ConditionalsFalse); + + } + + if (!value.IsEmpty()) + { + auto output = _ConditionalsMap.Find(value); + if (output != nullptr) + return *output; + } + + return ConditionalsAny; // Basically critical fail +} + +PlayFab::AdminModels::FApiCondition::~FApiCondition() +{ + +} + +void PlayFab::AdminModels::FApiCondition::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (HasSignatureOrEncryption.notNull()) { writer->WriteIdentifierPrefix(TEXT("HasSignatureOrEncryption")); writeConditionalsEnumJSON(HasSignatureOrEncryption, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FApiCondition::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSignatureOrEncryption = readConditionalsFromValue(obj->TryGetField(TEXT("HasSignatureOrEncryption"))); + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeAuthTokenTypeEnumJSON(AuthTokenType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case AuthTokenTypeEmail: writer->WriteValue(TEXT("Email")); break; + } +} + +AdminModels::AuthTokenType PlayFab::AdminModels::readAuthTokenTypeFromValue(const TSharedPtr& value) +{ + return readAuthTokenTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::AuthTokenType PlayFab::AdminModels::readAuthTokenTypeFromValue(const FString& value) +{ + static TMap _AuthTokenTypeMap; + if (_AuthTokenTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _AuthTokenTypeMap.Add(TEXT("Email"), AuthTokenTypeEmail); + + } + + if (!value.IsEmpty()) + { + auto output = _AuthTokenTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return AuthTokenTypeEmail; // Basically critical fail +} + +PlayFab::AdminModels::FBanInfo::~FBanInfo() +{ + +} + +void PlayFab::AdminModels::FBanInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Active")); writer->WriteValue(Active); + + if (BanId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BanId")); writer->WriteValue(BanId); } + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (Expires.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); } + + if (IPAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IPAddress")); writer->WriteValue(IPAddress); } + + if (MACAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MACAddress")); writer->WriteValue(MACAddress); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FBanInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActiveValue = obj->TryGetField(TEXT("Active")); + if (ActiveValue.IsValid() && !ActiveValue->IsNull()) + { + bool TmpValue; + if (ActiveValue->TryGetBool(TmpValue)) { Active = TmpValue; } + } + + const TSharedPtr BanIdValue = obj->TryGetField(TEXT("BanId")); + if (BanIdValue.IsValid() && !BanIdValue->IsNull()) + { + FString TmpValue; + if (BanIdValue->TryGetString(TmpValue)) { BanId = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr IPAddressValue = obj->TryGetField(TEXT("IPAddress")); + if (IPAddressValue.IsValid() && !IPAddressValue->IsNull()) + { + FString TmpValue; + if (IPAddressValue->TryGetString(TmpValue)) { IPAddress = TmpValue; } + } + + const TSharedPtr MACAddressValue = obj->TryGetField(TEXT("MACAddress")); + if (MACAddressValue.IsValid() && !MACAddressValue->IsNull()) + { + FString TmpValue; + if (MACAddressValue->TryGetString(TmpValue)) { MACAddress = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FBanRequest::~FBanRequest() +{ + +} + +void PlayFab::AdminModels::FBanRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DurationInHours.notNull()) { writer->WriteIdentifierPrefix(TEXT("DurationInHours")); writer->WriteValue(static_cast(DurationInHours)); } + + if (IPAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IPAddress")); writer->WriteValue(IPAddress); } + + if (MACAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MACAddress")); writer->WriteValue(MACAddress); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FBanRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DurationInHoursValue = obj->TryGetField(TEXT("DurationInHours")); + if (DurationInHoursValue.IsValid() && !DurationInHoursValue->IsNull()) + { + uint32 TmpValue; + if (DurationInHoursValue->TryGetNumber(TmpValue)) { DurationInHours = TmpValue; } + } + + const TSharedPtr IPAddressValue = obj->TryGetField(TEXT("IPAddress")); + if (IPAddressValue.IsValid() && !IPAddressValue->IsNull()) + { + FString TmpValue; + if (IPAddressValue->TryGetString(TmpValue)) { IPAddress = TmpValue; } + } + + const TSharedPtr MACAddressValue = obj->TryGetField(TEXT("MACAddress")); + if (MACAddressValue.IsValid() && !MACAddressValue->IsNull()) + { + FString TmpValue; + if (MACAddressValue->TryGetString(TmpValue)) { MACAddress = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FBanUsersRequest::~FBanUsersRequest() +{ + +} + +void PlayFab::AdminModels::FBanUsersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Bans")); + for (const FBanRequest& item : Bans) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FBanUsersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BansArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Bans")); + for (int32 Idx = 0; Idx < BansArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BansArray[Idx]; + Bans.Add(FBanRequest(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FBanUsersResult::~FBanUsersResult() +{ + +} + +void PlayFab::AdminModels::FBanUsersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FBanUsersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FBlankResult::~FBlankResult() +{ + +} + +void PlayFab::AdminModels::FBlankResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FBlankResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FCatalogItemBundleInfo::~FCatalogItemBundleInfo() +{ + +} + +void PlayFab::AdminModels::FCatalogItemBundleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BundledItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundledItems")); + for (const FString& item : BundledItems) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundledResultTables.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundledResultTables")); + for (const FString& item : BundledResultTables) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundledVirtualCurrencies.Num() != 0) + { + writer->WriteObjectStart(TEXT("BundledVirtualCurrencies")); + for (TMap::TConstIterator It(BundledVirtualCurrencies); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCatalogItemBundleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("BundledItems"), BundledItems); + + obj->TryGetStringArrayField(TEXT("BundledResultTables"), BundledResultTables); + + const TSharedPtr* BundledVirtualCurrenciesObject; + if (obj->TryGetObjectField(TEXT("BundledVirtualCurrencies"), BundledVirtualCurrenciesObject)) + { + for (TMap>::TConstIterator It((*BundledVirtualCurrenciesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + BundledVirtualCurrencies.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCatalogItemConsumableInfo::~FCatalogItemConsumableInfo() +{ + +} + +void PlayFab::AdminModels::FCatalogItemConsumableInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (UsageCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsageCount")); writer->WriteValue(static_cast(UsageCount)); } + + if (UsagePeriod.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsagePeriod")); writer->WriteValue(static_cast(UsagePeriod)); } + + if (UsagePeriodGroup.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UsagePeriodGroup")); writer->WriteValue(UsagePeriodGroup); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCatalogItemConsumableInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UsageCountValue = obj->TryGetField(TEXT("UsageCount")); + if (UsageCountValue.IsValid() && !UsageCountValue->IsNull()) + { + uint32 TmpValue; + if (UsageCountValue->TryGetNumber(TmpValue)) { UsageCount = TmpValue; } + } + + const TSharedPtr UsagePeriodValue = obj->TryGetField(TEXT("UsagePeriod")); + if (UsagePeriodValue.IsValid() && !UsagePeriodValue->IsNull()) + { + uint32 TmpValue; + if (UsagePeriodValue->TryGetNumber(TmpValue)) { UsagePeriod = TmpValue; } + } + + const TSharedPtr UsagePeriodGroupValue = obj->TryGetField(TEXT("UsagePeriodGroup")); + if (UsagePeriodGroupValue.IsValid() && !UsagePeriodGroupValue->IsNull()) + { + FString TmpValue; + if (UsagePeriodGroupValue->TryGetString(TmpValue)) { UsagePeriodGroup = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCatalogItemContainerInfo::~FCatalogItemContainerInfo() +{ + +} + +void PlayFab::AdminModels::FCatalogItemContainerInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemContents")); + for (const FString& item : ItemContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (KeyItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KeyItemId")); writer->WriteValue(KeyItemId); } + + if (ResultTableContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("ResultTableContents")); + for (const FString& item : ResultTableContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyContents.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyContents")); + for (TMap::TConstIterator It(VirtualCurrencyContents); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCatalogItemContainerInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("ItemContents"), ItemContents); + + const TSharedPtr KeyItemIdValue = obj->TryGetField(TEXT("KeyItemId")); + if (KeyItemIdValue.IsValid() && !KeyItemIdValue->IsNull()) + { + FString TmpValue; + if (KeyItemIdValue->TryGetString(TmpValue)) { KeyItemId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("ResultTableContents"), ResultTableContents); + + const TSharedPtr* VirtualCurrencyContentsObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyContents"), VirtualCurrencyContentsObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyContentsObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyContents.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCatalogItem::~FCatalogItem() +{ + //if (Bundle != nullptr) delete Bundle; + //if (Consumable != nullptr) delete Consumable; + //if (Container != nullptr) delete Container; + +} + +void PlayFab::AdminModels::FCatalogItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Bundle.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Bundle")); Bundle->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("CanBecomeCharacter")); writer->WriteValue(CanBecomeCharacter); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (Consumable.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Consumable")); Consumable->writeJSON(writer); } + + if (Container.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Container")); Container->writeJSON(writer); } + + if (CustomData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomData")); writer->WriteValue(CustomData); } + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + writer->WriteIdentifierPrefix(TEXT("InitialLimitedEditionCount")); writer->WriteValue(InitialLimitedEditionCount); + + writer->WriteIdentifierPrefix(TEXT("IsLimitedEdition")); writer->WriteValue(IsLimitedEdition); + + writer->WriteIdentifierPrefix(TEXT("IsStackable")); writer->WriteValue(IsStackable); + + writer->WriteIdentifierPrefix(TEXT("IsTradable")); writer->WriteValue(IsTradable); + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (ItemImageUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemImageUrl")); writer->WriteValue(ItemImageUrl); } + + if (RealCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("RealCurrencyPrices")); + for (TMap::TConstIterator It(RealCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyPrices")); + for (TMap::TConstIterator It(VirtualCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCatalogItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BundleValue = obj->TryGetField(TEXT("Bundle")); + if (BundleValue.IsValid() && !BundleValue->IsNull()) + { + Bundle = MakeShareable(new FCatalogItemBundleInfo(BundleValue->AsObject())); + } + + const TSharedPtr CanBecomeCharacterValue = obj->TryGetField(TEXT("CanBecomeCharacter")); + if (CanBecomeCharacterValue.IsValid() && !CanBecomeCharacterValue->IsNull()) + { + bool TmpValue; + if (CanBecomeCharacterValue->TryGetBool(TmpValue)) { CanBecomeCharacter = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr ConsumableValue = obj->TryGetField(TEXT("Consumable")); + if (ConsumableValue.IsValid() && !ConsumableValue->IsNull()) + { + Consumable = MakeShareable(new FCatalogItemConsumableInfo(ConsumableValue->AsObject())); + } + + const TSharedPtr ContainerValue = obj->TryGetField(TEXT("Container")); + if (ContainerValue.IsValid() && !ContainerValue->IsNull()) + { + Container = MakeShareable(new FCatalogItemContainerInfo(ContainerValue->AsObject())); + } + + const TSharedPtr CustomDataValue = obj->TryGetField(TEXT("CustomData")); + if (CustomDataValue.IsValid() && !CustomDataValue->IsNull()) + { + FString TmpValue; + if (CustomDataValue->TryGetString(TmpValue)) { CustomData = TmpValue; } + } + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr InitialLimitedEditionCountValue = obj->TryGetField(TEXT("InitialLimitedEditionCount")); + if (InitialLimitedEditionCountValue.IsValid() && !InitialLimitedEditionCountValue->IsNull()) + { + int32 TmpValue; + if (InitialLimitedEditionCountValue->TryGetNumber(TmpValue)) { InitialLimitedEditionCount = TmpValue; } + } + + const TSharedPtr IsLimitedEditionValue = obj->TryGetField(TEXT("IsLimitedEdition")); + if (IsLimitedEditionValue.IsValid() && !IsLimitedEditionValue->IsNull()) + { + bool TmpValue; + if (IsLimitedEditionValue->TryGetBool(TmpValue)) { IsLimitedEdition = TmpValue; } + } + + const TSharedPtr IsStackableValue = obj->TryGetField(TEXT("IsStackable")); + if (IsStackableValue.IsValid() && !IsStackableValue->IsNull()) + { + bool TmpValue; + if (IsStackableValue->TryGetBool(TmpValue)) { IsStackable = TmpValue; } + } + + const TSharedPtr IsTradableValue = obj->TryGetField(TEXT("IsTradable")); + if (IsTradableValue.IsValid() && !IsTradableValue->IsNull()) + { + bool TmpValue; + if (IsTradableValue->TryGetBool(TmpValue)) { IsTradable = TmpValue; } + } + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemImageUrlValue = obj->TryGetField(TEXT("ItemImageUrl")); + if (ItemImageUrlValue.IsValid() && !ItemImageUrlValue->IsNull()) + { + FString TmpValue; + if (ItemImageUrlValue->TryGetString(TmpValue)) { ItemImageUrl = TmpValue; } + } + + const TSharedPtr* RealCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("RealCurrencyPrices"), RealCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*RealCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + RealCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr* VirtualCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyPrices"), VirtualCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCheckLimitedEditionItemAvailabilityRequest::~FCheckLimitedEditionItemAvailabilityRequest() +{ + +} + +void PlayFab::AdminModels::FCheckLimitedEditionItemAvailabilityRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCheckLimitedEditionItemAvailabilityRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCheckLimitedEditionItemAvailabilityResult::~FCheckLimitedEditionItemAvailabilityResult() +{ + +} + +void PlayFab::AdminModels::FCheckLimitedEditionItemAvailabilityResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCheckLimitedEditionItemAvailabilityResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCloudScriptFile::~FCloudScriptFile() +{ + +} + +void PlayFab::AdminModels::FCloudScriptFile::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FileContents")); writer->WriteValue(FileContents); + + writer->WriteIdentifierPrefix(TEXT("Filename")); writer->WriteValue(Filename); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCloudScriptFile::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FileContentsValue = obj->TryGetField(TEXT("FileContents")); + if (FileContentsValue.IsValid() && !FileContentsValue->IsNull()) + { + FString TmpValue; + if (FileContentsValue->TryGetString(TmpValue)) { FileContents = TmpValue; } + } + + const TSharedPtr FilenameValue = obj->TryGetField(TEXT("Filename")); + if (FilenameValue.IsValid() && !FilenameValue->IsNull()) + { + FString TmpValue; + if (FilenameValue->TryGetString(TmpValue)) { Filename = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCloudScriptTaskParameter::~FCloudScriptTaskParameter() +{ + +} + +void PlayFab::AdminModels::FCloudScriptTaskParameter::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Argument.notNull()) { writer->WriteIdentifierPrefix(TEXT("Argument")); Argument.writeJSON(writer); } + + if (FunctionName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCloudScriptTaskParameter::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ArgumentValue = obj->TryGetField(TEXT("Argument")); + if (ArgumentValue.IsValid() && !ArgumentValue->IsNull()) + { + Argument = FJsonKeeper(ArgumentValue); + } + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FScriptExecutionError::~FScriptExecutionError() +{ + +} + +void PlayFab::AdminModels::FScriptExecutionError::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + if (StackTrace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StackTrace")); writer->WriteValue(StackTrace); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FScriptExecutionError::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + const TSharedPtr StackTraceValue = obj->TryGetField(TEXT("StackTrace")); + if (StackTraceValue.IsValid() && !StackTraceValue->IsNull()) + { + FString TmpValue; + if (StackTraceValue->TryGetString(TmpValue)) { StackTrace = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FLogStatement::~FLogStatement() +{ + +} + +void PlayFab::AdminModels::FLogStatement::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.notNull()) { writer->WriteIdentifierPrefix(TEXT("Data")); Data.writeJSON(writer); } + + if (Level.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Level")); writer->WriteValue(Level); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FLogStatement::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataValue = obj->TryGetField(TEXT("Data")); + if (DataValue.IsValid() && !DataValue->IsNull()) + { + Data = FJsonKeeper(DataValue); + } + + const TSharedPtr LevelValue = obj->TryGetField(TEXT("Level")); + if (LevelValue.IsValid() && !LevelValue->IsNull()) + { + FString TmpValue; + if (LevelValue->TryGetString(TmpValue)) { Level = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FExecuteCloudScriptResult::~FExecuteCloudScriptResult() +{ + //if (Error != nullptr) delete Error; + +} + +void PlayFab::AdminModels::FExecuteCloudScriptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("APIRequestsIssued")); writer->WriteValue(APIRequestsIssued); + + if (Error.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Error")); Error->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ExecutionTimeSeconds")); writer->WriteValue(ExecutionTimeSeconds); + + if (FunctionName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); } + + if (FunctionResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResult")); FunctionResult.writeJSON(writer); } + + if (FunctionResultTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResultTooLarge")); writer->WriteValue(FunctionResultTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("HttpRequestsIssued")); writer->WriteValue(HttpRequestsIssued); + + if (Logs.Num() != 0) + { + writer->WriteArrayStart(TEXT("Logs")); + for (const FLogStatement& item : Logs) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (LogsTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("LogsTooLarge")); writer->WriteValue(LogsTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("MemoryConsumedBytes")); writer->WriteValue(static_cast(MemoryConsumedBytes)); + + writer->WriteIdentifierPrefix(TEXT("ProcessorTimeSeconds")); writer->WriteValue(ProcessorTimeSeconds); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FExecuteCloudScriptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr APIRequestsIssuedValue = obj->TryGetField(TEXT("APIRequestsIssued")); + if (APIRequestsIssuedValue.IsValid() && !APIRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (APIRequestsIssuedValue->TryGetNumber(TmpValue)) { APIRequestsIssued = TmpValue; } + } + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + Error = MakeShareable(new FScriptExecutionError(ErrorValue->AsObject())); + } + + const TSharedPtr ExecutionTimeSecondsValue = obj->TryGetField(TEXT("ExecutionTimeSeconds")); + if (ExecutionTimeSecondsValue.IsValid() && !ExecutionTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ExecutionTimeSecondsValue->TryGetNumber(TmpValue)) { ExecutionTimeSeconds = TmpValue; } + } + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionResultValue = obj->TryGetField(TEXT("FunctionResult")); + if (FunctionResultValue.IsValid() && !FunctionResultValue->IsNull()) + { + FunctionResult = FJsonKeeper(FunctionResultValue); + } + + const TSharedPtr FunctionResultTooLargeValue = obj->TryGetField(TEXT("FunctionResultTooLarge")); + if (FunctionResultTooLargeValue.IsValid() && !FunctionResultTooLargeValue->IsNull()) + { + bool TmpValue; + if (FunctionResultTooLargeValue->TryGetBool(TmpValue)) { FunctionResultTooLarge = TmpValue; } + } + + const TSharedPtr HttpRequestsIssuedValue = obj->TryGetField(TEXT("HttpRequestsIssued")); + if (HttpRequestsIssuedValue.IsValid() && !HttpRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (HttpRequestsIssuedValue->TryGetNumber(TmpValue)) { HttpRequestsIssued = TmpValue; } + } + + const TArray>&LogsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Logs")); + for (int32 Idx = 0; Idx < LogsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LogsArray[Idx]; + Logs.Add(FLogStatement(CurrentItem->AsObject())); + } + + + const TSharedPtr LogsTooLargeValue = obj->TryGetField(TEXT("LogsTooLarge")); + if (LogsTooLargeValue.IsValid() && !LogsTooLargeValue->IsNull()) + { + bool TmpValue; + if (LogsTooLargeValue->TryGetBool(TmpValue)) { LogsTooLarge = TmpValue; } + } + + const TSharedPtr MemoryConsumedBytesValue = obj->TryGetField(TEXT("MemoryConsumedBytes")); + if (MemoryConsumedBytesValue.IsValid() && !MemoryConsumedBytesValue->IsNull()) + { + uint32 TmpValue; + if (MemoryConsumedBytesValue->TryGetNumber(TmpValue)) { MemoryConsumedBytes = TmpValue; } + } + + const TSharedPtr ProcessorTimeSecondsValue = obj->TryGetField(TEXT("ProcessorTimeSeconds")); + if (ProcessorTimeSecondsValue.IsValid() && !ProcessorTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ProcessorTimeSecondsValue->TryGetNumber(TmpValue)) { ProcessorTimeSeconds = TmpValue; } + } + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCloudScriptTaskSummary::~FCloudScriptTaskSummary() +{ + //if (Result != nullptr) delete Result; + //if (TaskIdentifier != nullptr) delete TaskIdentifier; + +} + +void PlayFab::AdminModels::FCloudScriptTaskSummary::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CompletedAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("CompletedAt")); writeDatetime(CompletedAt, writer); } + + if (EstimatedSecondsRemaining.notNull()) { writer->WriteIdentifierPrefix(TEXT("EstimatedSecondsRemaining")); writer->WriteValue(EstimatedSecondsRemaining); } + + if (PercentComplete.notNull()) { writer->WriteIdentifierPrefix(TEXT("PercentComplete")); writer->WriteValue(PercentComplete); } + + if (Result.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Result")); Result->writeJSON(writer); } + + if (ScheduledByUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ScheduledByUserId")); writer->WriteValue(ScheduledByUserId); } + + writer->WriteIdentifierPrefix(TEXT("StartedAt")); writeDatetime(StartedAt, writer); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeTaskInstanceStatusEnumJSON(Status, writer); } + + if (TaskIdentifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TaskIdentifier")); TaskIdentifier->writeJSON(writer); } + + if (TaskInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TaskInstanceId")); writer->WriteValue(TaskInstanceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCloudScriptTaskSummary::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CompletedAtValue = obj->TryGetField(TEXT("CompletedAt")); + if (CompletedAtValue.IsValid()) + CompletedAt = readDatetime(CompletedAtValue); + + + const TSharedPtr EstimatedSecondsRemainingValue = obj->TryGetField(TEXT("EstimatedSecondsRemaining")); + if (EstimatedSecondsRemainingValue.IsValid() && !EstimatedSecondsRemainingValue->IsNull()) + { + double TmpValue; + if (EstimatedSecondsRemainingValue->TryGetNumber(TmpValue)) { EstimatedSecondsRemaining = TmpValue; } + } + + const TSharedPtr PercentCompleteValue = obj->TryGetField(TEXT("PercentComplete")); + if (PercentCompleteValue.IsValid() && !PercentCompleteValue->IsNull()) + { + double TmpValue; + if (PercentCompleteValue->TryGetNumber(TmpValue)) { PercentComplete = TmpValue; } + } + + const TSharedPtr ResultValue = obj->TryGetField(TEXT("Result")); + if (ResultValue.IsValid() && !ResultValue->IsNull()) + { + Result = MakeShareable(new FExecuteCloudScriptResult(ResultValue->AsObject())); + } + + const TSharedPtr ScheduledByUserIdValue = obj->TryGetField(TEXT("ScheduledByUserId")); + if (ScheduledByUserIdValue.IsValid() && !ScheduledByUserIdValue->IsNull()) + { + FString TmpValue; + if (ScheduledByUserIdValue->TryGetString(TmpValue)) { ScheduledByUserId = TmpValue; } + } + + const TSharedPtr StartedAtValue = obj->TryGetField(TEXT("StartedAt")); + if (StartedAtValue.IsValid()) + StartedAt = readDatetime(StartedAtValue); + + + Status = readTaskInstanceStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TaskIdentifierValue = obj->TryGetField(TEXT("TaskIdentifier")); + if (TaskIdentifierValue.IsValid() && !TaskIdentifierValue->IsNull()) + { + TaskIdentifier = MakeShareable(new FNameIdentifier(TaskIdentifierValue->AsObject())); + } + + const TSharedPtr TaskInstanceIdValue = obj->TryGetField(TEXT("TaskInstanceId")); + if (TaskInstanceIdValue.IsValid() && !TaskInstanceIdValue->IsNull()) + { + FString TmpValue; + if (TaskInstanceIdValue->TryGetString(TmpValue)) { TaskInstanceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCloudScriptVersionStatus::~FCloudScriptVersionStatus() +{ + +} + +void PlayFab::AdminModels::FCloudScriptVersionStatus::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LatestRevision")); writer->WriteValue(LatestRevision); + + writer->WriteIdentifierPrefix(TEXT("PublishedRevision")); writer->WriteValue(PublishedRevision); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCloudScriptVersionStatus::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LatestRevisionValue = obj->TryGetField(TEXT("LatestRevision")); + if (LatestRevisionValue.IsValid() && !LatestRevisionValue->IsNull()) + { + int32 TmpValue; + if (LatestRevisionValue->TryGetNumber(TmpValue)) { LatestRevision = TmpValue; } + } + + const TSharedPtr PublishedRevisionValue = obj->TryGetField(TEXT("PublishedRevision")); + if (PublishedRevisionValue.IsValid() && !PublishedRevisionValue->IsNull()) + { + int32 TmpValue; + if (PublishedRevisionValue->TryGetNumber(TmpValue)) { PublishedRevision = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeEmailVerificationStatusEnumJSON(EmailVerificationStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case EmailVerificationStatusUnverified: writer->WriteValue(TEXT("Unverified")); break; + case EmailVerificationStatusPending: writer->WriteValue(TEXT("Pending")); break; + case EmailVerificationStatusConfirmed: writer->WriteValue(TEXT("Confirmed")); break; + } +} + +AdminModels::EmailVerificationStatus PlayFab::AdminModels::readEmailVerificationStatusFromValue(const TSharedPtr& value) +{ + return readEmailVerificationStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::EmailVerificationStatus PlayFab::AdminModels::readEmailVerificationStatusFromValue(const FString& value) +{ + static TMap _EmailVerificationStatusMap; + if (_EmailVerificationStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _EmailVerificationStatusMap.Add(TEXT("Unverified"), EmailVerificationStatusUnverified); + _EmailVerificationStatusMap.Add(TEXT("Pending"), EmailVerificationStatusPending); + _EmailVerificationStatusMap.Add(TEXT("Confirmed"), EmailVerificationStatusConfirmed); + + } + + if (!value.IsEmpty()) + { + auto output = _EmailVerificationStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return EmailVerificationStatusUnverified; // Basically critical fail +} + +PlayFab::AdminModels::FContactEmailInfo::~FContactEmailInfo() +{ + +} + +void PlayFab::AdminModels::FContactEmailInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EmailAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailAddress")); writer->WriteValue(EmailAddress); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + if (VerificationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("VerificationStatus")); writeEmailVerificationStatusEnumJSON(VerificationStatus, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FContactEmailInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailAddressValue = obj->TryGetField(TEXT("EmailAddress")); + if (EmailAddressValue.IsValid() && !EmailAddressValue->IsNull()) + { + FString TmpValue; + if (EmailAddressValue->TryGetString(TmpValue)) { EmailAddress = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + VerificationStatus = readEmailVerificationStatusFromValue(obj->TryGetField(TEXT("VerificationStatus"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FContactEmailInfoModel::~FContactEmailInfoModel() +{ + +} + +void PlayFab::AdminModels::FContactEmailInfoModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EmailAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailAddress")); writer->WriteValue(EmailAddress); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + if (VerificationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("VerificationStatus")); writeEmailVerificationStatusEnumJSON(VerificationStatus, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FContactEmailInfoModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailAddressValue = obj->TryGetField(TEXT("EmailAddress")); + if (EmailAddressValue.IsValid() && !EmailAddressValue->IsNull()) + { + FString TmpValue; + if (EmailAddressValue->TryGetString(TmpValue)) { EmailAddress = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + VerificationStatus = readEmailVerificationStatusFromValue(obj->TryGetField(TEXT("VerificationStatus"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FContentInfo::~FContentInfo() +{ + +} + +void PlayFab::AdminModels::FContentInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Key.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); } + + writer->WriteIdentifierPrefix(TEXT("LastModified")); writeDatetime(LastModified, writer); + + writer->WriteIdentifierPrefix(TEXT("Size")); writer->WriteValue(static_cast(Size)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FContentInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr LastModifiedValue = obj->TryGetField(TEXT("LastModified")); + if (LastModifiedValue.IsValid()) + LastModified = readDatetime(LastModifiedValue); + + + const TSharedPtr SizeValue = obj->TryGetField(TEXT("Size")); + if (SizeValue.IsValid() && !SizeValue->IsNull()) + { + uint32 TmpValue; + if (SizeValue->TryGetNumber(TmpValue)) { Size = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeContinentCodeEnumJSON(ContinentCode enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ContinentCodeAF: writer->WriteValue(TEXT("AF")); break; + case ContinentCodeAN: writer->WriteValue(TEXT("AN")); break; + case ContinentCodeAS: writer->WriteValue(TEXT("AS")); break; + case ContinentCodeEU: writer->WriteValue(TEXT("EU")); break; + case ContinentCodeNA: writer->WriteValue(TEXT("NA")); break; + case ContinentCodeOC: writer->WriteValue(TEXT("OC")); break; + case ContinentCodeSA: writer->WriteValue(TEXT("SA")); break; + } +} + +AdminModels::ContinentCode PlayFab::AdminModels::readContinentCodeFromValue(const TSharedPtr& value) +{ + return readContinentCodeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::ContinentCode PlayFab::AdminModels::readContinentCodeFromValue(const FString& value) +{ + static TMap _ContinentCodeMap; + if (_ContinentCodeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ContinentCodeMap.Add(TEXT("AF"), ContinentCodeAF); + _ContinentCodeMap.Add(TEXT("AN"), ContinentCodeAN); + _ContinentCodeMap.Add(TEXT("AS"), ContinentCodeAS); + _ContinentCodeMap.Add(TEXT("EU"), ContinentCodeEU); + _ContinentCodeMap.Add(TEXT("NA"), ContinentCodeNA); + _ContinentCodeMap.Add(TEXT("OC"), ContinentCodeOC); + _ContinentCodeMap.Add(TEXT("SA"), ContinentCodeSA); + + } + + if (!value.IsEmpty()) + { + auto output = _ContinentCodeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ContinentCodeAF; // Basically critical fail +} + +void PlayFab::AdminModels::writeCountryCodeEnumJSON(CountryCode enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CountryCodeAF: writer->WriteValue(TEXT("AF")); break; + case CountryCodeAX: writer->WriteValue(TEXT("AX")); break; + case CountryCodeAL: writer->WriteValue(TEXT("AL")); break; + case CountryCodeDZ: writer->WriteValue(TEXT("DZ")); break; + case CountryCodeAS: writer->WriteValue(TEXT("AS")); break; + case CountryCodeAD: writer->WriteValue(TEXT("AD")); break; + case CountryCodeAO: writer->WriteValue(TEXT("AO")); break; + case CountryCodeAI: writer->WriteValue(TEXT("AI")); break; + case CountryCodeAQ: writer->WriteValue(TEXT("AQ")); break; + case CountryCodeAG: writer->WriteValue(TEXT("AG")); break; + case CountryCodeAR: writer->WriteValue(TEXT("AR")); break; + case CountryCodeAM: writer->WriteValue(TEXT("AM")); break; + case CountryCodeAW: writer->WriteValue(TEXT("AW")); break; + case CountryCodeAU: writer->WriteValue(TEXT("AU")); break; + case CountryCodeAT: writer->WriteValue(TEXT("AT")); break; + case CountryCodeAZ: writer->WriteValue(TEXT("AZ")); break; + case CountryCodeBS: writer->WriteValue(TEXT("BS")); break; + case CountryCodeBH: writer->WriteValue(TEXT("BH")); break; + case CountryCodeBD: writer->WriteValue(TEXT("BD")); break; + case CountryCodeBB: writer->WriteValue(TEXT("BB")); break; + case CountryCodeBY: writer->WriteValue(TEXT("BY")); break; + case CountryCodeBE: writer->WriteValue(TEXT("BE")); break; + case CountryCodeBZ: writer->WriteValue(TEXT("BZ")); break; + case CountryCodeBJ: writer->WriteValue(TEXT("BJ")); break; + case CountryCodeBM: writer->WriteValue(TEXT("BM")); break; + case CountryCodeBT: writer->WriteValue(TEXT("BT")); break; + case CountryCodeBO: writer->WriteValue(TEXT("BO")); break; + case CountryCodeBQ: writer->WriteValue(TEXT("BQ")); break; + case CountryCodeBA: writer->WriteValue(TEXT("BA")); break; + case CountryCodeBW: writer->WriteValue(TEXT("BW")); break; + case CountryCodeBV: writer->WriteValue(TEXT("BV")); break; + case CountryCodeBR: writer->WriteValue(TEXT("BR")); break; + case CountryCodeIO: writer->WriteValue(TEXT("IO")); break; + case CountryCodeBN: writer->WriteValue(TEXT("BN")); break; + case CountryCodeBG: writer->WriteValue(TEXT("BG")); break; + case CountryCodeBF: writer->WriteValue(TEXT("BF")); break; + case CountryCodeBI: writer->WriteValue(TEXT("BI")); break; + case CountryCodeKH: writer->WriteValue(TEXT("KH")); break; + case CountryCodeCM: writer->WriteValue(TEXT("CM")); break; + case CountryCodeCA: writer->WriteValue(TEXT("CA")); break; + case CountryCodeCV: writer->WriteValue(TEXT("CV")); break; + case CountryCodeKY: writer->WriteValue(TEXT("KY")); break; + case CountryCodeCF: writer->WriteValue(TEXT("CF")); break; + case CountryCodeTD: writer->WriteValue(TEXT("TD")); break; + case CountryCodeCL: writer->WriteValue(TEXT("CL")); break; + case CountryCodeCN: writer->WriteValue(TEXT("CN")); break; + case CountryCodeCX: writer->WriteValue(TEXT("CX")); break; + case CountryCodeCC: writer->WriteValue(TEXT("CC")); break; + case CountryCodeCO: writer->WriteValue(TEXT("CO")); break; + case CountryCodeKM: writer->WriteValue(TEXT("KM")); break; + case CountryCodeCG: writer->WriteValue(TEXT("CG")); break; + case CountryCodeCD: writer->WriteValue(TEXT("CD")); break; + case CountryCodeCK: writer->WriteValue(TEXT("CK")); break; + case CountryCodeCR: writer->WriteValue(TEXT("CR")); break; + case CountryCodeCI: writer->WriteValue(TEXT("CI")); break; + case CountryCodeHR: writer->WriteValue(TEXT("HR")); break; + case CountryCodeCU: writer->WriteValue(TEXT("CU")); break; + case CountryCodeCW: writer->WriteValue(TEXT("CW")); break; + case CountryCodeCY: writer->WriteValue(TEXT("CY")); break; + case CountryCodeCZ: writer->WriteValue(TEXT("CZ")); break; + case CountryCodeDK: writer->WriteValue(TEXT("DK")); break; + case CountryCodeDJ: writer->WriteValue(TEXT("DJ")); break; + case CountryCodeDM: writer->WriteValue(TEXT("DM")); break; + case CountryCodeDO: writer->WriteValue(TEXT("DO")); break; + case CountryCodeEC: writer->WriteValue(TEXT("EC")); break; + case CountryCodeEG: writer->WriteValue(TEXT("EG")); break; + case CountryCodeSV: writer->WriteValue(TEXT("SV")); break; + case CountryCodeGQ: writer->WriteValue(TEXT("GQ")); break; + case CountryCodeER: writer->WriteValue(TEXT("ER")); break; + case CountryCodeEE: writer->WriteValue(TEXT("EE")); break; + case CountryCodeET: writer->WriteValue(TEXT("ET")); break; + case CountryCodeFK: writer->WriteValue(TEXT("FK")); break; + case CountryCodeFO: writer->WriteValue(TEXT("FO")); break; + case CountryCodeFJ: writer->WriteValue(TEXT("FJ")); break; + case CountryCodeFI: writer->WriteValue(TEXT("FI")); break; + case CountryCodeFR: writer->WriteValue(TEXT("FR")); break; + case CountryCodeGF: writer->WriteValue(TEXT("GF")); break; + case CountryCodePF: writer->WriteValue(TEXT("PF")); break; + case CountryCodeTF: writer->WriteValue(TEXT("TF")); break; + case CountryCodeGA: writer->WriteValue(TEXT("GA")); break; + case CountryCodeGM: writer->WriteValue(TEXT("GM")); break; + case CountryCodeGE: writer->WriteValue(TEXT("GE")); break; + case CountryCodeDE: writer->WriteValue(TEXT("DE")); break; + case CountryCodeGH: writer->WriteValue(TEXT("GH")); break; + case CountryCodeGI: writer->WriteValue(TEXT("GI")); break; + case CountryCodeGR: writer->WriteValue(TEXT("GR")); break; + case CountryCodeGL: writer->WriteValue(TEXT("GL")); break; + case CountryCodeGD: writer->WriteValue(TEXT("GD")); break; + case CountryCodeGP: writer->WriteValue(TEXT("GP")); break; + case CountryCodeGU: writer->WriteValue(TEXT("GU")); break; + case CountryCodeGT: writer->WriteValue(TEXT("GT")); break; + case CountryCodeGG: writer->WriteValue(TEXT("GG")); break; + case CountryCodeGN: writer->WriteValue(TEXT("GN")); break; + case CountryCodeGW: writer->WriteValue(TEXT("GW")); break; + case CountryCodeGY: writer->WriteValue(TEXT("GY")); break; + case CountryCodeHT: writer->WriteValue(TEXT("HT")); break; + case CountryCodeHM: writer->WriteValue(TEXT("HM")); break; + case CountryCodeVA: writer->WriteValue(TEXT("VA")); break; + case CountryCodeHN: writer->WriteValue(TEXT("HN")); break; + case CountryCodeHK: writer->WriteValue(TEXT("HK")); break; + case CountryCodeHU: writer->WriteValue(TEXT("HU")); break; + case CountryCodeIS: writer->WriteValue(TEXT("IS")); break; + case CountryCodeIN: writer->WriteValue(TEXT("IN")); break; + case CountryCodeID: writer->WriteValue(TEXT("ID")); break; + case CountryCodeIR: writer->WriteValue(TEXT("IR")); break; + case CountryCodeIQ: writer->WriteValue(TEXT("IQ")); break; + case CountryCodeIE: writer->WriteValue(TEXT("IE")); break; + case CountryCodeIM: writer->WriteValue(TEXT("IM")); break; + case CountryCodeIL: writer->WriteValue(TEXT("IL")); break; + case CountryCodeIT: writer->WriteValue(TEXT("IT")); break; + case CountryCodeJM: writer->WriteValue(TEXT("JM")); break; + case CountryCodeJP: writer->WriteValue(TEXT("JP")); break; + case CountryCodeJE: writer->WriteValue(TEXT("JE")); break; + case CountryCodeJO: writer->WriteValue(TEXT("JO")); break; + case CountryCodeKZ: writer->WriteValue(TEXT("KZ")); break; + case CountryCodeKE: writer->WriteValue(TEXT("KE")); break; + case CountryCodeKI: writer->WriteValue(TEXT("KI")); break; + case CountryCodeKP: writer->WriteValue(TEXT("KP")); break; + case CountryCodeKR: writer->WriteValue(TEXT("KR")); break; + case CountryCodeKW: writer->WriteValue(TEXT("KW")); break; + case CountryCodeKG: writer->WriteValue(TEXT("KG")); break; + case CountryCodeLA: writer->WriteValue(TEXT("LA")); break; + case CountryCodeLV: writer->WriteValue(TEXT("LV")); break; + case CountryCodeLB: writer->WriteValue(TEXT("LB")); break; + case CountryCodeLS: writer->WriteValue(TEXT("LS")); break; + case CountryCodeLR: writer->WriteValue(TEXT("LR")); break; + case CountryCodeLY: writer->WriteValue(TEXT("LY")); break; + case CountryCodeLI: writer->WriteValue(TEXT("LI")); break; + case CountryCodeLT: writer->WriteValue(TEXT("LT")); break; + case CountryCodeLU: writer->WriteValue(TEXT("LU")); break; + case CountryCodeMO: writer->WriteValue(TEXT("MO")); break; + case CountryCodeMK: writer->WriteValue(TEXT("MK")); break; + case CountryCodeMG: writer->WriteValue(TEXT("MG")); break; + case CountryCodeMW: writer->WriteValue(TEXT("MW")); break; + case CountryCodeMY: writer->WriteValue(TEXT("MY")); break; + case CountryCodeMV: writer->WriteValue(TEXT("MV")); break; + case CountryCodeML: writer->WriteValue(TEXT("ML")); break; + case CountryCodeMT: writer->WriteValue(TEXT("MT")); break; + case CountryCodeMH: writer->WriteValue(TEXT("MH")); break; + case CountryCodeMQ: writer->WriteValue(TEXT("MQ")); break; + case CountryCodeMR: writer->WriteValue(TEXT("MR")); break; + case CountryCodeMU: writer->WriteValue(TEXT("MU")); break; + case CountryCodeYT: writer->WriteValue(TEXT("YT")); break; + case CountryCodeMX: writer->WriteValue(TEXT("MX")); break; + case CountryCodeFM: writer->WriteValue(TEXT("FM")); break; + case CountryCodeMD: writer->WriteValue(TEXT("MD")); break; + case CountryCodeMC: writer->WriteValue(TEXT("MC")); break; + case CountryCodeMN: writer->WriteValue(TEXT("MN")); break; + case CountryCodeME: writer->WriteValue(TEXT("ME")); break; + case CountryCodeMS: writer->WriteValue(TEXT("MS")); break; + case CountryCodeMA: writer->WriteValue(TEXT("MA")); break; + case CountryCodeMZ: writer->WriteValue(TEXT("MZ")); break; + case CountryCodeMM: writer->WriteValue(TEXT("MM")); break; + case CountryCodeNA: writer->WriteValue(TEXT("NA")); break; + case CountryCodeNR: writer->WriteValue(TEXT("NR")); break; + case CountryCodeNP: writer->WriteValue(TEXT("NP")); break; + case CountryCodeNL: writer->WriteValue(TEXT("NL")); break; + case CountryCodeNC: writer->WriteValue(TEXT("NC")); break; + case CountryCodeNZ: writer->WriteValue(TEXT("NZ")); break; + case CountryCodeNI: writer->WriteValue(TEXT("NI")); break; + case CountryCodeNE: writer->WriteValue(TEXT("NE")); break; + case CountryCodeNG: writer->WriteValue(TEXT("NG")); break; + case CountryCodeNU: writer->WriteValue(TEXT("NU")); break; + case CountryCodeNF: writer->WriteValue(TEXT("NF")); break; + case CountryCodeMP: writer->WriteValue(TEXT("MP")); break; + case CountryCodeNO: writer->WriteValue(TEXT("NO")); break; + case CountryCodeOM: writer->WriteValue(TEXT("OM")); break; + case CountryCodePK: writer->WriteValue(TEXT("PK")); break; + case CountryCodePW: writer->WriteValue(TEXT("PW")); break; + case CountryCodePS: writer->WriteValue(TEXT("PS")); break; + case CountryCodePA: writer->WriteValue(TEXT("PA")); break; + case CountryCodePG: writer->WriteValue(TEXT("PG")); break; + case CountryCodePY: writer->WriteValue(TEXT("PY")); break; + case CountryCodePE: writer->WriteValue(TEXT("PE")); break; + case CountryCodePH: writer->WriteValue(TEXT("PH")); break; + case CountryCodePN: writer->WriteValue(TEXT("PN")); break; + case CountryCodePL: writer->WriteValue(TEXT("PL")); break; + case CountryCodePT: writer->WriteValue(TEXT("PT")); break; + case CountryCodePR: writer->WriteValue(TEXT("PR")); break; + case CountryCodeQA: writer->WriteValue(TEXT("QA")); break; + case CountryCodeRE: writer->WriteValue(TEXT("RE")); break; + case CountryCodeRO: writer->WriteValue(TEXT("RO")); break; + case CountryCodeRU: writer->WriteValue(TEXT("RU")); break; + case CountryCodeRW: writer->WriteValue(TEXT("RW")); break; + case CountryCodeBL: writer->WriteValue(TEXT("BL")); break; + case CountryCodeSH: writer->WriteValue(TEXT("SH")); break; + case CountryCodeKN: writer->WriteValue(TEXT("KN")); break; + case CountryCodeLC: writer->WriteValue(TEXT("LC")); break; + case CountryCodeMF: writer->WriteValue(TEXT("MF")); break; + case CountryCodePM: writer->WriteValue(TEXT("PM")); break; + case CountryCodeVC: writer->WriteValue(TEXT("VC")); break; + case CountryCodeWS: writer->WriteValue(TEXT("WS")); break; + case CountryCodeSM: writer->WriteValue(TEXT("SM")); break; + case CountryCodeST: writer->WriteValue(TEXT("ST")); break; + case CountryCodeSA: writer->WriteValue(TEXT("SA")); break; + case CountryCodeSN: writer->WriteValue(TEXT("SN")); break; + case CountryCodeRS: writer->WriteValue(TEXT("RS")); break; + case CountryCodeSC: writer->WriteValue(TEXT("SC")); break; + case CountryCodeSL: writer->WriteValue(TEXT("SL")); break; + case CountryCodeSG: writer->WriteValue(TEXT("SG")); break; + case CountryCodeSX: writer->WriteValue(TEXT("SX")); break; + case CountryCodeSK: writer->WriteValue(TEXT("SK")); break; + case CountryCodeSI: writer->WriteValue(TEXT("SI")); break; + case CountryCodeSB: writer->WriteValue(TEXT("SB")); break; + case CountryCodeSO: writer->WriteValue(TEXT("SO")); break; + case CountryCodeZA: writer->WriteValue(TEXT("ZA")); break; + case CountryCodeGS: writer->WriteValue(TEXT("GS")); break; + case CountryCodeSS: writer->WriteValue(TEXT("SS")); break; + case CountryCodeES: writer->WriteValue(TEXT("ES")); break; + case CountryCodeLK: writer->WriteValue(TEXT("LK")); break; + case CountryCodeSD: writer->WriteValue(TEXT("SD")); break; + case CountryCodeSR: writer->WriteValue(TEXT("SR")); break; + case CountryCodeSJ: writer->WriteValue(TEXT("SJ")); break; + case CountryCodeSZ: writer->WriteValue(TEXT("SZ")); break; + case CountryCodeSE: writer->WriteValue(TEXT("SE")); break; + case CountryCodeCH: writer->WriteValue(TEXT("CH")); break; + case CountryCodeSY: writer->WriteValue(TEXT("SY")); break; + case CountryCodeTW: writer->WriteValue(TEXT("TW")); break; + case CountryCodeTJ: writer->WriteValue(TEXT("TJ")); break; + case CountryCodeTZ: writer->WriteValue(TEXT("TZ")); break; + case CountryCodeTH: writer->WriteValue(TEXT("TH")); break; + case CountryCodeTL: writer->WriteValue(TEXT("TL")); break; + case CountryCodeTG: writer->WriteValue(TEXT("TG")); break; + case CountryCodeTK: writer->WriteValue(TEXT("TK")); break; + case CountryCodeTO: writer->WriteValue(TEXT("TO")); break; + case CountryCodeTT: writer->WriteValue(TEXT("TT")); break; + case CountryCodeTN: writer->WriteValue(TEXT("TN")); break; + case CountryCodeTR: writer->WriteValue(TEXT("TR")); break; + case CountryCodeTM: writer->WriteValue(TEXT("TM")); break; + case CountryCodeTC: writer->WriteValue(TEXT("TC")); break; + case CountryCodeTV: writer->WriteValue(TEXT("TV")); break; + case CountryCodeUG: writer->WriteValue(TEXT("UG")); break; + case CountryCodeUA: writer->WriteValue(TEXT("UA")); break; + case CountryCodeAE: writer->WriteValue(TEXT("AE")); break; + case CountryCodeGB: writer->WriteValue(TEXT("GB")); break; + case CountryCodeUS: writer->WriteValue(TEXT("US")); break; + case CountryCodeUM: writer->WriteValue(TEXT("UM")); break; + case CountryCodeUY: writer->WriteValue(TEXT("UY")); break; + case CountryCodeUZ: writer->WriteValue(TEXT("UZ")); break; + case CountryCodeVU: writer->WriteValue(TEXT("VU")); break; + case CountryCodeVE: writer->WriteValue(TEXT("VE")); break; + case CountryCodeVN: writer->WriteValue(TEXT("VN")); break; + case CountryCodeVG: writer->WriteValue(TEXT("VG")); break; + case CountryCodeVI: writer->WriteValue(TEXT("VI")); break; + case CountryCodeWF: writer->WriteValue(TEXT("WF")); break; + case CountryCodeEH: writer->WriteValue(TEXT("EH")); break; + case CountryCodeYE: writer->WriteValue(TEXT("YE")); break; + case CountryCodeZM: writer->WriteValue(TEXT("ZM")); break; + case CountryCodeZW: writer->WriteValue(TEXT("ZW")); break; + } +} + +AdminModels::CountryCode PlayFab::AdminModels::readCountryCodeFromValue(const TSharedPtr& value) +{ + return readCountryCodeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::CountryCode PlayFab::AdminModels::readCountryCodeFromValue(const FString& value) +{ + static TMap _CountryCodeMap; + if (_CountryCodeMap.Num() == 0) + { + // Auto-generate the map on the first use + _CountryCodeMap.Add(TEXT("AF"), CountryCodeAF); + _CountryCodeMap.Add(TEXT("AX"), CountryCodeAX); + _CountryCodeMap.Add(TEXT("AL"), CountryCodeAL); + _CountryCodeMap.Add(TEXT("DZ"), CountryCodeDZ); + _CountryCodeMap.Add(TEXT("AS"), CountryCodeAS); + _CountryCodeMap.Add(TEXT("AD"), CountryCodeAD); + _CountryCodeMap.Add(TEXT("AO"), CountryCodeAO); + _CountryCodeMap.Add(TEXT("AI"), CountryCodeAI); + _CountryCodeMap.Add(TEXT("AQ"), CountryCodeAQ); + _CountryCodeMap.Add(TEXT("AG"), CountryCodeAG); + _CountryCodeMap.Add(TEXT("AR"), CountryCodeAR); + _CountryCodeMap.Add(TEXT("AM"), CountryCodeAM); + _CountryCodeMap.Add(TEXT("AW"), CountryCodeAW); + _CountryCodeMap.Add(TEXT("AU"), CountryCodeAU); + _CountryCodeMap.Add(TEXT("AT"), CountryCodeAT); + _CountryCodeMap.Add(TEXT("AZ"), CountryCodeAZ); + _CountryCodeMap.Add(TEXT("BS"), CountryCodeBS); + _CountryCodeMap.Add(TEXT("BH"), CountryCodeBH); + _CountryCodeMap.Add(TEXT("BD"), CountryCodeBD); + _CountryCodeMap.Add(TEXT("BB"), CountryCodeBB); + _CountryCodeMap.Add(TEXT("BY"), CountryCodeBY); + _CountryCodeMap.Add(TEXT("BE"), CountryCodeBE); + _CountryCodeMap.Add(TEXT("BZ"), CountryCodeBZ); + _CountryCodeMap.Add(TEXT("BJ"), CountryCodeBJ); + _CountryCodeMap.Add(TEXT("BM"), CountryCodeBM); + _CountryCodeMap.Add(TEXT("BT"), CountryCodeBT); + _CountryCodeMap.Add(TEXT("BO"), CountryCodeBO); + _CountryCodeMap.Add(TEXT("BQ"), CountryCodeBQ); + _CountryCodeMap.Add(TEXT("BA"), CountryCodeBA); + _CountryCodeMap.Add(TEXT("BW"), CountryCodeBW); + _CountryCodeMap.Add(TEXT("BV"), CountryCodeBV); + _CountryCodeMap.Add(TEXT("BR"), CountryCodeBR); + _CountryCodeMap.Add(TEXT("IO"), CountryCodeIO); + _CountryCodeMap.Add(TEXT("BN"), CountryCodeBN); + _CountryCodeMap.Add(TEXT("BG"), CountryCodeBG); + _CountryCodeMap.Add(TEXT("BF"), CountryCodeBF); + _CountryCodeMap.Add(TEXT("BI"), CountryCodeBI); + _CountryCodeMap.Add(TEXT("KH"), CountryCodeKH); + _CountryCodeMap.Add(TEXT("CM"), CountryCodeCM); + _CountryCodeMap.Add(TEXT("CA"), CountryCodeCA); + _CountryCodeMap.Add(TEXT("CV"), CountryCodeCV); + _CountryCodeMap.Add(TEXT("KY"), CountryCodeKY); + _CountryCodeMap.Add(TEXT("CF"), CountryCodeCF); + _CountryCodeMap.Add(TEXT("TD"), CountryCodeTD); + _CountryCodeMap.Add(TEXT("CL"), CountryCodeCL); + _CountryCodeMap.Add(TEXT("CN"), CountryCodeCN); + _CountryCodeMap.Add(TEXT("CX"), CountryCodeCX); + _CountryCodeMap.Add(TEXT("CC"), CountryCodeCC); + _CountryCodeMap.Add(TEXT("CO"), CountryCodeCO); + _CountryCodeMap.Add(TEXT("KM"), CountryCodeKM); + _CountryCodeMap.Add(TEXT("CG"), CountryCodeCG); + _CountryCodeMap.Add(TEXT("CD"), CountryCodeCD); + _CountryCodeMap.Add(TEXT("CK"), CountryCodeCK); + _CountryCodeMap.Add(TEXT("CR"), CountryCodeCR); + _CountryCodeMap.Add(TEXT("CI"), CountryCodeCI); + _CountryCodeMap.Add(TEXT("HR"), CountryCodeHR); + _CountryCodeMap.Add(TEXT("CU"), CountryCodeCU); + _CountryCodeMap.Add(TEXT("CW"), CountryCodeCW); + _CountryCodeMap.Add(TEXT("CY"), CountryCodeCY); + _CountryCodeMap.Add(TEXT("CZ"), CountryCodeCZ); + _CountryCodeMap.Add(TEXT("DK"), CountryCodeDK); + _CountryCodeMap.Add(TEXT("DJ"), CountryCodeDJ); + _CountryCodeMap.Add(TEXT("DM"), CountryCodeDM); + _CountryCodeMap.Add(TEXT("DO"), CountryCodeDO); + _CountryCodeMap.Add(TEXT("EC"), CountryCodeEC); + _CountryCodeMap.Add(TEXT("EG"), CountryCodeEG); + _CountryCodeMap.Add(TEXT("SV"), CountryCodeSV); + _CountryCodeMap.Add(TEXT("GQ"), CountryCodeGQ); + _CountryCodeMap.Add(TEXT("ER"), CountryCodeER); + _CountryCodeMap.Add(TEXT("EE"), CountryCodeEE); + _CountryCodeMap.Add(TEXT("ET"), CountryCodeET); + _CountryCodeMap.Add(TEXT("FK"), CountryCodeFK); + _CountryCodeMap.Add(TEXT("FO"), CountryCodeFO); + _CountryCodeMap.Add(TEXT("FJ"), CountryCodeFJ); + _CountryCodeMap.Add(TEXT("FI"), CountryCodeFI); + _CountryCodeMap.Add(TEXT("FR"), CountryCodeFR); + _CountryCodeMap.Add(TEXT("GF"), CountryCodeGF); + _CountryCodeMap.Add(TEXT("PF"), CountryCodePF); + _CountryCodeMap.Add(TEXT("TF"), CountryCodeTF); + _CountryCodeMap.Add(TEXT("GA"), CountryCodeGA); + _CountryCodeMap.Add(TEXT("GM"), CountryCodeGM); + _CountryCodeMap.Add(TEXT("GE"), CountryCodeGE); + _CountryCodeMap.Add(TEXT("DE"), CountryCodeDE); + _CountryCodeMap.Add(TEXT("GH"), CountryCodeGH); + _CountryCodeMap.Add(TEXT("GI"), CountryCodeGI); + _CountryCodeMap.Add(TEXT("GR"), CountryCodeGR); + _CountryCodeMap.Add(TEXT("GL"), CountryCodeGL); + _CountryCodeMap.Add(TEXT("GD"), CountryCodeGD); + _CountryCodeMap.Add(TEXT("GP"), CountryCodeGP); + _CountryCodeMap.Add(TEXT("GU"), CountryCodeGU); + _CountryCodeMap.Add(TEXT("GT"), CountryCodeGT); + _CountryCodeMap.Add(TEXT("GG"), CountryCodeGG); + _CountryCodeMap.Add(TEXT("GN"), CountryCodeGN); + _CountryCodeMap.Add(TEXT("GW"), CountryCodeGW); + _CountryCodeMap.Add(TEXT("GY"), CountryCodeGY); + _CountryCodeMap.Add(TEXT("HT"), CountryCodeHT); + _CountryCodeMap.Add(TEXT("HM"), CountryCodeHM); + _CountryCodeMap.Add(TEXT("VA"), CountryCodeVA); + _CountryCodeMap.Add(TEXT("HN"), CountryCodeHN); + _CountryCodeMap.Add(TEXT("HK"), CountryCodeHK); + _CountryCodeMap.Add(TEXT("HU"), CountryCodeHU); + _CountryCodeMap.Add(TEXT("IS"), CountryCodeIS); + _CountryCodeMap.Add(TEXT("IN"), CountryCodeIN); + _CountryCodeMap.Add(TEXT("ID"), CountryCodeID); + _CountryCodeMap.Add(TEXT("IR"), CountryCodeIR); + _CountryCodeMap.Add(TEXT("IQ"), CountryCodeIQ); + _CountryCodeMap.Add(TEXT("IE"), CountryCodeIE); + _CountryCodeMap.Add(TEXT("IM"), CountryCodeIM); + _CountryCodeMap.Add(TEXT("IL"), CountryCodeIL); + _CountryCodeMap.Add(TEXT("IT"), CountryCodeIT); + _CountryCodeMap.Add(TEXT("JM"), CountryCodeJM); + _CountryCodeMap.Add(TEXT("JP"), CountryCodeJP); + _CountryCodeMap.Add(TEXT("JE"), CountryCodeJE); + _CountryCodeMap.Add(TEXT("JO"), CountryCodeJO); + _CountryCodeMap.Add(TEXT("KZ"), CountryCodeKZ); + _CountryCodeMap.Add(TEXT("KE"), CountryCodeKE); + _CountryCodeMap.Add(TEXT("KI"), CountryCodeKI); + _CountryCodeMap.Add(TEXT("KP"), CountryCodeKP); + _CountryCodeMap.Add(TEXT("KR"), CountryCodeKR); + _CountryCodeMap.Add(TEXT("KW"), CountryCodeKW); + _CountryCodeMap.Add(TEXT("KG"), CountryCodeKG); + _CountryCodeMap.Add(TEXT("LA"), CountryCodeLA); + _CountryCodeMap.Add(TEXT("LV"), CountryCodeLV); + _CountryCodeMap.Add(TEXT("LB"), CountryCodeLB); + _CountryCodeMap.Add(TEXT("LS"), CountryCodeLS); + _CountryCodeMap.Add(TEXT("LR"), CountryCodeLR); + _CountryCodeMap.Add(TEXT("LY"), CountryCodeLY); + _CountryCodeMap.Add(TEXT("LI"), CountryCodeLI); + _CountryCodeMap.Add(TEXT("LT"), CountryCodeLT); + _CountryCodeMap.Add(TEXT("LU"), CountryCodeLU); + _CountryCodeMap.Add(TEXT("MO"), CountryCodeMO); + _CountryCodeMap.Add(TEXT("MK"), CountryCodeMK); + _CountryCodeMap.Add(TEXT("MG"), CountryCodeMG); + _CountryCodeMap.Add(TEXT("MW"), CountryCodeMW); + _CountryCodeMap.Add(TEXT("MY"), CountryCodeMY); + _CountryCodeMap.Add(TEXT("MV"), CountryCodeMV); + _CountryCodeMap.Add(TEXT("ML"), CountryCodeML); + _CountryCodeMap.Add(TEXT("MT"), CountryCodeMT); + _CountryCodeMap.Add(TEXT("MH"), CountryCodeMH); + _CountryCodeMap.Add(TEXT("MQ"), CountryCodeMQ); + _CountryCodeMap.Add(TEXT("MR"), CountryCodeMR); + _CountryCodeMap.Add(TEXT("MU"), CountryCodeMU); + _CountryCodeMap.Add(TEXT("YT"), CountryCodeYT); + _CountryCodeMap.Add(TEXT("MX"), CountryCodeMX); + _CountryCodeMap.Add(TEXT("FM"), CountryCodeFM); + _CountryCodeMap.Add(TEXT("MD"), CountryCodeMD); + _CountryCodeMap.Add(TEXT("MC"), CountryCodeMC); + _CountryCodeMap.Add(TEXT("MN"), CountryCodeMN); + _CountryCodeMap.Add(TEXT("ME"), CountryCodeME); + _CountryCodeMap.Add(TEXT("MS"), CountryCodeMS); + _CountryCodeMap.Add(TEXT("MA"), CountryCodeMA); + _CountryCodeMap.Add(TEXT("MZ"), CountryCodeMZ); + _CountryCodeMap.Add(TEXT("MM"), CountryCodeMM); + _CountryCodeMap.Add(TEXT("NA"), CountryCodeNA); + _CountryCodeMap.Add(TEXT("NR"), CountryCodeNR); + _CountryCodeMap.Add(TEXT("NP"), CountryCodeNP); + _CountryCodeMap.Add(TEXT("NL"), CountryCodeNL); + _CountryCodeMap.Add(TEXT("NC"), CountryCodeNC); + _CountryCodeMap.Add(TEXT("NZ"), CountryCodeNZ); + _CountryCodeMap.Add(TEXT("NI"), CountryCodeNI); + _CountryCodeMap.Add(TEXT("NE"), CountryCodeNE); + _CountryCodeMap.Add(TEXT("NG"), CountryCodeNG); + _CountryCodeMap.Add(TEXT("NU"), CountryCodeNU); + _CountryCodeMap.Add(TEXT("NF"), CountryCodeNF); + _CountryCodeMap.Add(TEXT("MP"), CountryCodeMP); + _CountryCodeMap.Add(TEXT("NO"), CountryCodeNO); + _CountryCodeMap.Add(TEXT("OM"), CountryCodeOM); + _CountryCodeMap.Add(TEXT("PK"), CountryCodePK); + _CountryCodeMap.Add(TEXT("PW"), CountryCodePW); + _CountryCodeMap.Add(TEXT("PS"), CountryCodePS); + _CountryCodeMap.Add(TEXT("PA"), CountryCodePA); + _CountryCodeMap.Add(TEXT("PG"), CountryCodePG); + _CountryCodeMap.Add(TEXT("PY"), CountryCodePY); + _CountryCodeMap.Add(TEXT("PE"), CountryCodePE); + _CountryCodeMap.Add(TEXT("PH"), CountryCodePH); + _CountryCodeMap.Add(TEXT("PN"), CountryCodePN); + _CountryCodeMap.Add(TEXT("PL"), CountryCodePL); + _CountryCodeMap.Add(TEXT("PT"), CountryCodePT); + _CountryCodeMap.Add(TEXT("PR"), CountryCodePR); + _CountryCodeMap.Add(TEXT("QA"), CountryCodeQA); + _CountryCodeMap.Add(TEXT("RE"), CountryCodeRE); + _CountryCodeMap.Add(TEXT("RO"), CountryCodeRO); + _CountryCodeMap.Add(TEXT("RU"), CountryCodeRU); + _CountryCodeMap.Add(TEXT("RW"), CountryCodeRW); + _CountryCodeMap.Add(TEXT("BL"), CountryCodeBL); + _CountryCodeMap.Add(TEXT("SH"), CountryCodeSH); + _CountryCodeMap.Add(TEXT("KN"), CountryCodeKN); + _CountryCodeMap.Add(TEXT("LC"), CountryCodeLC); + _CountryCodeMap.Add(TEXT("MF"), CountryCodeMF); + _CountryCodeMap.Add(TEXT("PM"), CountryCodePM); + _CountryCodeMap.Add(TEXT("VC"), CountryCodeVC); + _CountryCodeMap.Add(TEXT("WS"), CountryCodeWS); + _CountryCodeMap.Add(TEXT("SM"), CountryCodeSM); + _CountryCodeMap.Add(TEXT("ST"), CountryCodeST); + _CountryCodeMap.Add(TEXT("SA"), CountryCodeSA); + _CountryCodeMap.Add(TEXT("SN"), CountryCodeSN); + _CountryCodeMap.Add(TEXT("RS"), CountryCodeRS); + _CountryCodeMap.Add(TEXT("SC"), CountryCodeSC); + _CountryCodeMap.Add(TEXT("SL"), CountryCodeSL); + _CountryCodeMap.Add(TEXT("SG"), CountryCodeSG); + _CountryCodeMap.Add(TEXT("SX"), CountryCodeSX); + _CountryCodeMap.Add(TEXT("SK"), CountryCodeSK); + _CountryCodeMap.Add(TEXT("SI"), CountryCodeSI); + _CountryCodeMap.Add(TEXT("SB"), CountryCodeSB); + _CountryCodeMap.Add(TEXT("SO"), CountryCodeSO); + _CountryCodeMap.Add(TEXT("ZA"), CountryCodeZA); + _CountryCodeMap.Add(TEXT("GS"), CountryCodeGS); + _CountryCodeMap.Add(TEXT("SS"), CountryCodeSS); + _CountryCodeMap.Add(TEXT("ES"), CountryCodeES); + _CountryCodeMap.Add(TEXT("LK"), CountryCodeLK); + _CountryCodeMap.Add(TEXT("SD"), CountryCodeSD); + _CountryCodeMap.Add(TEXT("SR"), CountryCodeSR); + _CountryCodeMap.Add(TEXT("SJ"), CountryCodeSJ); + _CountryCodeMap.Add(TEXT("SZ"), CountryCodeSZ); + _CountryCodeMap.Add(TEXT("SE"), CountryCodeSE); + _CountryCodeMap.Add(TEXT("CH"), CountryCodeCH); + _CountryCodeMap.Add(TEXT("SY"), CountryCodeSY); + _CountryCodeMap.Add(TEXT("TW"), CountryCodeTW); + _CountryCodeMap.Add(TEXT("TJ"), CountryCodeTJ); + _CountryCodeMap.Add(TEXT("TZ"), CountryCodeTZ); + _CountryCodeMap.Add(TEXT("TH"), CountryCodeTH); + _CountryCodeMap.Add(TEXT("TL"), CountryCodeTL); + _CountryCodeMap.Add(TEXT("TG"), CountryCodeTG); + _CountryCodeMap.Add(TEXT("TK"), CountryCodeTK); + _CountryCodeMap.Add(TEXT("TO"), CountryCodeTO); + _CountryCodeMap.Add(TEXT("TT"), CountryCodeTT); + _CountryCodeMap.Add(TEXT("TN"), CountryCodeTN); + _CountryCodeMap.Add(TEXT("TR"), CountryCodeTR); + _CountryCodeMap.Add(TEXT("TM"), CountryCodeTM); + _CountryCodeMap.Add(TEXT("TC"), CountryCodeTC); + _CountryCodeMap.Add(TEXT("TV"), CountryCodeTV); + _CountryCodeMap.Add(TEXT("UG"), CountryCodeUG); + _CountryCodeMap.Add(TEXT("UA"), CountryCodeUA); + _CountryCodeMap.Add(TEXT("AE"), CountryCodeAE); + _CountryCodeMap.Add(TEXT("GB"), CountryCodeGB); + _CountryCodeMap.Add(TEXT("US"), CountryCodeUS); + _CountryCodeMap.Add(TEXT("UM"), CountryCodeUM); + _CountryCodeMap.Add(TEXT("UY"), CountryCodeUY); + _CountryCodeMap.Add(TEXT("UZ"), CountryCodeUZ); + _CountryCodeMap.Add(TEXT("VU"), CountryCodeVU); + _CountryCodeMap.Add(TEXT("VE"), CountryCodeVE); + _CountryCodeMap.Add(TEXT("VN"), CountryCodeVN); + _CountryCodeMap.Add(TEXT("VG"), CountryCodeVG); + _CountryCodeMap.Add(TEXT("VI"), CountryCodeVI); + _CountryCodeMap.Add(TEXT("WF"), CountryCodeWF); + _CountryCodeMap.Add(TEXT("EH"), CountryCodeEH); + _CountryCodeMap.Add(TEXT("YE"), CountryCodeYE); + _CountryCodeMap.Add(TEXT("ZM"), CountryCodeZM); + _CountryCodeMap.Add(TEXT("ZW"), CountryCodeZW); + + } + + if (!value.IsEmpty()) + { + auto output = _CountryCodeMap.Find(value); + if (output != nullptr) + return *output; + } + + return CountryCodeAF; // Basically critical fail +} + +PlayFab::AdminModels::FCreateActionsOnPlayerSegmentTaskRequest::~FCreateActionsOnPlayerSegmentTaskRequest() +{ + +} + +void PlayFab::AdminModels::FCreateActionsOnPlayerSegmentTaskRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); + + writer->WriteIdentifierPrefix(TEXT("Parameter")); Parameter.writeJSON(writer); + + if (Schedule.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Schedule")); writer->WriteValue(Schedule); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreateActionsOnPlayerSegmentTaskRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr ParameterValue = obj->TryGetField(TEXT("Parameter")); + if (ParameterValue.IsValid() && !ParameterValue->IsNull()) + { + Parameter = FActionsOnPlayersInSegmentTaskParameter(ParameterValue->AsObject()); + } + + const TSharedPtr ScheduleValue = obj->TryGetField(TEXT("Schedule")); + if (ScheduleValue.IsValid() && !ScheduleValue->IsNull()) + { + FString TmpValue; + if (ScheduleValue->TryGetString(TmpValue)) { Schedule = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCreateCloudScriptTaskRequest::~FCreateCloudScriptTaskRequest() +{ + +} + +void PlayFab::AdminModels::FCreateCloudScriptTaskRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); + + writer->WriteIdentifierPrefix(TEXT("Parameter")); Parameter.writeJSON(writer); + + if (Schedule.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Schedule")); writer->WriteValue(Schedule); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreateCloudScriptTaskRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr ParameterValue = obj->TryGetField(TEXT("Parameter")); + if (ParameterValue.IsValid() && !ParameterValue->IsNull()) + { + Parameter = FCloudScriptTaskParameter(ParameterValue->AsObject()); + } + + const TSharedPtr ScheduleValue = obj->TryGetField(TEXT("Schedule")); + if (ScheduleValue.IsValid() && !ScheduleValue->IsNull()) + { + FString TmpValue; + if (ScheduleValue->TryGetString(TmpValue)) { Schedule = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCreatePlayerSharedSecretRequest::~FCreatePlayerSharedSecretRequest() +{ + +} + +void PlayFab::AdminModels::FCreatePlayerSharedSecretRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FriendlyName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendlyName")); writer->WriteValue(FriendlyName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreatePlayerSharedSecretRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendlyNameValue = obj->TryGetField(TEXT("FriendlyName")); + if (FriendlyNameValue.IsValid() && !FriendlyNameValue->IsNull()) + { + FString TmpValue; + if (FriendlyNameValue->TryGetString(TmpValue)) { FriendlyName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCreatePlayerSharedSecretResult::~FCreatePlayerSharedSecretResult() +{ + +} + +void PlayFab::AdminModels::FCreatePlayerSharedSecretResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SecretKey.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SecretKey")); writer->WriteValue(SecretKey); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreatePlayerSharedSecretResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SecretKeyValue = obj->TryGetField(TEXT("SecretKey")); + if (SecretKeyValue.IsValid() && !SecretKeyValue->IsNull()) + { + FString TmpValue; + if (SecretKeyValue->TryGetString(TmpValue)) { SecretKey = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeStatisticAggregationMethodEnumJSON(StatisticAggregationMethod enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case StatisticAggregationMethodLast: writer->WriteValue(TEXT("Last")); break; + case StatisticAggregationMethodMin: writer->WriteValue(TEXT("Min")); break; + case StatisticAggregationMethodMax: writer->WriteValue(TEXT("Max")); break; + case StatisticAggregationMethodSum: writer->WriteValue(TEXT("Sum")); break; + } +} + +AdminModels::StatisticAggregationMethod PlayFab::AdminModels::readStatisticAggregationMethodFromValue(const TSharedPtr& value) +{ + return readStatisticAggregationMethodFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::StatisticAggregationMethod PlayFab::AdminModels::readStatisticAggregationMethodFromValue(const FString& value) +{ + static TMap _StatisticAggregationMethodMap; + if (_StatisticAggregationMethodMap.Num() == 0) + { + // Auto-generate the map on the first use + _StatisticAggregationMethodMap.Add(TEXT("Last"), StatisticAggregationMethodLast); + _StatisticAggregationMethodMap.Add(TEXT("Min"), StatisticAggregationMethodMin); + _StatisticAggregationMethodMap.Add(TEXT("Max"), StatisticAggregationMethodMax); + _StatisticAggregationMethodMap.Add(TEXT("Sum"), StatisticAggregationMethodSum); + + } + + if (!value.IsEmpty()) + { + auto output = _StatisticAggregationMethodMap.Find(value); + if (output != nullptr) + return *output; + } + + return StatisticAggregationMethodLast; // Basically critical fail +} + +void PlayFab::AdminModels::writeStatisticResetIntervalOptionEnumJSON(StatisticResetIntervalOption enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case StatisticResetIntervalOptionNever: writer->WriteValue(TEXT("Never")); break; + case StatisticResetIntervalOptionHour: writer->WriteValue(TEXT("Hour")); break; + case StatisticResetIntervalOptionDay: writer->WriteValue(TEXT("Day")); break; + case StatisticResetIntervalOptionWeek: writer->WriteValue(TEXT("Week")); break; + case StatisticResetIntervalOptionMonth: writer->WriteValue(TEXT("Month")); break; + } +} + +AdminModels::StatisticResetIntervalOption PlayFab::AdminModels::readStatisticResetIntervalOptionFromValue(const TSharedPtr& value) +{ + return readStatisticResetIntervalOptionFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::StatisticResetIntervalOption PlayFab::AdminModels::readStatisticResetIntervalOptionFromValue(const FString& value) +{ + static TMap _StatisticResetIntervalOptionMap; + if (_StatisticResetIntervalOptionMap.Num() == 0) + { + // Auto-generate the map on the first use + _StatisticResetIntervalOptionMap.Add(TEXT("Never"), StatisticResetIntervalOptionNever); + _StatisticResetIntervalOptionMap.Add(TEXT("Hour"), StatisticResetIntervalOptionHour); + _StatisticResetIntervalOptionMap.Add(TEXT("Day"), StatisticResetIntervalOptionDay); + _StatisticResetIntervalOptionMap.Add(TEXT("Week"), StatisticResetIntervalOptionWeek); + _StatisticResetIntervalOptionMap.Add(TEXT("Month"), StatisticResetIntervalOptionMonth); + + } + + if (!value.IsEmpty()) + { + auto output = _StatisticResetIntervalOptionMap.Find(value); + if (output != nullptr) + return *output; + } + + return StatisticResetIntervalOptionNever; // Basically critical fail +} + +PlayFab::AdminModels::FCreatePlayerStatisticDefinitionRequest::~FCreatePlayerStatisticDefinitionRequest() +{ + +} + +void PlayFab::AdminModels::FCreatePlayerStatisticDefinitionRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AggregationMethod.notNull()) { writer->WriteIdentifierPrefix(TEXT("AggregationMethod")); writeStatisticAggregationMethodEnumJSON(AggregationMethod, writer); } + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (VersionChangeInterval.notNull()) { writer->WriteIdentifierPrefix(TEXT("VersionChangeInterval")); writeStatisticResetIntervalOptionEnumJSON(VersionChangeInterval, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreatePlayerStatisticDefinitionRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + AggregationMethod = readStatisticAggregationMethodFromValue(obj->TryGetField(TEXT("AggregationMethod"))); + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + VersionChangeInterval = readStatisticResetIntervalOptionFromValue(obj->TryGetField(TEXT("VersionChangeInterval"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerStatisticDefinition::~FPlayerStatisticDefinition() +{ + +} + +void PlayFab::AdminModels::FPlayerStatisticDefinition::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AggregationMethod.notNull()) { writer->WriteIdentifierPrefix(TEXT("AggregationMethod")); writeStatisticAggregationMethodEnumJSON(AggregationMethod, writer); } + + writer->WriteIdentifierPrefix(TEXT("CurrentVersion")); writer->WriteValue(static_cast(CurrentVersion)); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + if (VersionChangeInterval.notNull()) { writer->WriteIdentifierPrefix(TEXT("VersionChangeInterval")); writeStatisticResetIntervalOptionEnumJSON(VersionChangeInterval, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerStatisticDefinition::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + AggregationMethod = readStatisticAggregationMethodFromValue(obj->TryGetField(TEXT("AggregationMethod"))); + + const TSharedPtr CurrentVersionValue = obj->TryGetField(TEXT("CurrentVersion")); + if (CurrentVersionValue.IsValid() && !CurrentVersionValue->IsNull()) + { + uint32 TmpValue; + if (CurrentVersionValue->TryGetNumber(TmpValue)) { CurrentVersion = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + VersionChangeInterval = readStatisticResetIntervalOptionFromValue(obj->TryGetField(TEXT("VersionChangeInterval"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FCreatePlayerStatisticDefinitionResult::~FCreatePlayerStatisticDefinitionResult() +{ + //if (Statistic != nullptr) delete Statistic; + +} + +void PlayFab::AdminModels::FCreatePlayerStatisticDefinitionResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Statistic.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Statistic")); Statistic->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreatePlayerStatisticDefinitionResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticValue = obj->TryGetField(TEXT("Statistic")); + if (StatisticValue.IsValid() && !StatisticValue->IsNull()) + { + Statistic = MakeShareable(new FPlayerStatisticDefinition(StatisticValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FCreateTaskResult::~FCreateTaskResult() +{ + +} + +void PlayFab::AdminModels::FCreateTaskResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TaskId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TaskId")); writer->WriteValue(TaskId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FCreateTaskResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TaskIdValue = obj->TryGetField(TEXT("TaskId")); + if (TaskIdValue.IsValid() && !TaskIdValue->IsNull()) + { + FString TmpValue; + if (TaskIdValue->TryGetString(TmpValue)) { TaskId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeCurrencyEnumJSON(Currency enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CurrencyAED: writer->WriteValue(TEXT("AED")); break; + case CurrencyAFN: writer->WriteValue(TEXT("AFN")); break; + case CurrencyALL: writer->WriteValue(TEXT("ALL")); break; + case CurrencyAMD: writer->WriteValue(TEXT("AMD")); break; + case CurrencyANG: writer->WriteValue(TEXT("ANG")); break; + case CurrencyAOA: writer->WriteValue(TEXT("AOA")); break; + case CurrencyARS: writer->WriteValue(TEXT("ARS")); break; + case CurrencyAUD: writer->WriteValue(TEXT("AUD")); break; + case CurrencyAWG: writer->WriteValue(TEXT("AWG")); break; + case CurrencyAZN: writer->WriteValue(TEXT("AZN")); break; + case CurrencyBAM: writer->WriteValue(TEXT("BAM")); break; + case CurrencyBBD: writer->WriteValue(TEXT("BBD")); break; + case CurrencyBDT: writer->WriteValue(TEXT("BDT")); break; + case CurrencyBGN: writer->WriteValue(TEXT("BGN")); break; + case CurrencyBHD: writer->WriteValue(TEXT("BHD")); break; + case CurrencyBIF: writer->WriteValue(TEXT("BIF")); break; + case CurrencyBMD: writer->WriteValue(TEXT("BMD")); break; + case CurrencyBND: writer->WriteValue(TEXT("BND")); break; + case CurrencyBOB: writer->WriteValue(TEXT("BOB")); break; + case CurrencyBRL: writer->WriteValue(TEXT("BRL")); break; + case CurrencyBSD: writer->WriteValue(TEXT("BSD")); break; + case CurrencyBTN: writer->WriteValue(TEXT("BTN")); break; + case CurrencyBWP: writer->WriteValue(TEXT("BWP")); break; + case CurrencyBYR: writer->WriteValue(TEXT("BYR")); break; + case CurrencyBZD: writer->WriteValue(TEXT("BZD")); break; + case CurrencyCAD: writer->WriteValue(TEXT("CAD")); break; + case CurrencyCDF: writer->WriteValue(TEXT("CDF")); break; + case CurrencyCHF: writer->WriteValue(TEXT("CHF")); break; + case CurrencyCLP: writer->WriteValue(TEXT("CLP")); break; + case CurrencyCNY: writer->WriteValue(TEXT("CNY")); break; + case CurrencyCOP: writer->WriteValue(TEXT("COP")); break; + case CurrencyCRC: writer->WriteValue(TEXT("CRC")); break; + case CurrencyCUC: writer->WriteValue(TEXT("CUC")); break; + case CurrencyCUP: writer->WriteValue(TEXT("CUP")); break; + case CurrencyCVE: writer->WriteValue(TEXT("CVE")); break; + case CurrencyCZK: writer->WriteValue(TEXT("CZK")); break; + case CurrencyDJF: writer->WriteValue(TEXT("DJF")); break; + case CurrencyDKK: writer->WriteValue(TEXT("DKK")); break; + case CurrencyDOP: writer->WriteValue(TEXT("DOP")); break; + case CurrencyDZD: writer->WriteValue(TEXT("DZD")); break; + case CurrencyEGP: writer->WriteValue(TEXT("EGP")); break; + case CurrencyERN: writer->WriteValue(TEXT("ERN")); break; + case CurrencyETB: writer->WriteValue(TEXT("ETB")); break; + case CurrencyEUR: writer->WriteValue(TEXT("EUR")); break; + case CurrencyFJD: writer->WriteValue(TEXT("FJD")); break; + case CurrencyFKP: writer->WriteValue(TEXT("FKP")); break; + case CurrencyGBP: writer->WriteValue(TEXT("GBP")); break; + case CurrencyGEL: writer->WriteValue(TEXT("GEL")); break; + case CurrencyGGP: writer->WriteValue(TEXT("GGP")); break; + case CurrencyGHS: writer->WriteValue(TEXT("GHS")); break; + case CurrencyGIP: writer->WriteValue(TEXT("GIP")); break; + case CurrencyGMD: writer->WriteValue(TEXT("GMD")); break; + case CurrencyGNF: writer->WriteValue(TEXT("GNF")); break; + case CurrencyGTQ: writer->WriteValue(TEXT("GTQ")); break; + case CurrencyGYD: writer->WriteValue(TEXT("GYD")); break; + case CurrencyHKD: writer->WriteValue(TEXT("HKD")); break; + case CurrencyHNL: writer->WriteValue(TEXT("HNL")); break; + case CurrencyHRK: writer->WriteValue(TEXT("HRK")); break; + case CurrencyHTG: writer->WriteValue(TEXT("HTG")); break; + case CurrencyHUF: writer->WriteValue(TEXT("HUF")); break; + case CurrencyIDR: writer->WriteValue(TEXT("IDR")); break; + case CurrencyILS: writer->WriteValue(TEXT("ILS")); break; + case CurrencyIMP: writer->WriteValue(TEXT("IMP")); break; + case CurrencyINR: writer->WriteValue(TEXT("INR")); break; + case CurrencyIQD: writer->WriteValue(TEXT("IQD")); break; + case CurrencyIRR: writer->WriteValue(TEXT("IRR")); break; + case CurrencyISK: writer->WriteValue(TEXT("ISK")); break; + case CurrencyJEP: writer->WriteValue(TEXT("JEP")); break; + case CurrencyJMD: writer->WriteValue(TEXT("JMD")); break; + case CurrencyJOD: writer->WriteValue(TEXT("JOD")); break; + case CurrencyJPY: writer->WriteValue(TEXT("JPY")); break; + case CurrencyKES: writer->WriteValue(TEXT("KES")); break; + case CurrencyKGS: writer->WriteValue(TEXT("KGS")); break; + case CurrencyKHR: writer->WriteValue(TEXT("KHR")); break; + case CurrencyKMF: writer->WriteValue(TEXT("KMF")); break; + case CurrencyKPW: writer->WriteValue(TEXT("KPW")); break; + case CurrencyKRW: writer->WriteValue(TEXT("KRW")); break; + case CurrencyKWD: writer->WriteValue(TEXT("KWD")); break; + case CurrencyKYD: writer->WriteValue(TEXT("KYD")); break; + case CurrencyKZT: writer->WriteValue(TEXT("KZT")); break; + case CurrencyLAK: writer->WriteValue(TEXT("LAK")); break; + case CurrencyLBP: writer->WriteValue(TEXT("LBP")); break; + case CurrencyLKR: writer->WriteValue(TEXT("LKR")); break; + case CurrencyLRD: writer->WriteValue(TEXT("LRD")); break; + case CurrencyLSL: writer->WriteValue(TEXT("LSL")); break; + case CurrencyLYD: writer->WriteValue(TEXT("LYD")); break; + case CurrencyMAD: writer->WriteValue(TEXT("MAD")); break; + case CurrencyMDL: writer->WriteValue(TEXT("MDL")); break; + case CurrencyMGA: writer->WriteValue(TEXT("MGA")); break; + case CurrencyMKD: writer->WriteValue(TEXT("MKD")); break; + case CurrencyMMK: writer->WriteValue(TEXT("MMK")); break; + case CurrencyMNT: writer->WriteValue(TEXT("MNT")); break; + case CurrencyMOP: writer->WriteValue(TEXT("MOP")); break; + case CurrencyMRO: writer->WriteValue(TEXT("MRO")); break; + case CurrencyMUR: writer->WriteValue(TEXT("MUR")); break; + case CurrencyMVR: writer->WriteValue(TEXT("MVR")); break; + case CurrencyMWK: writer->WriteValue(TEXT("MWK")); break; + case CurrencyMXN: writer->WriteValue(TEXT("MXN")); break; + case CurrencyMYR: writer->WriteValue(TEXT("MYR")); break; + case CurrencyMZN: writer->WriteValue(TEXT("MZN")); break; + case CurrencyNAD: writer->WriteValue(TEXT("NAD")); break; + case CurrencyNGN: writer->WriteValue(TEXT("NGN")); break; + case CurrencyNIO: writer->WriteValue(TEXT("NIO")); break; + case CurrencyNOK: writer->WriteValue(TEXT("NOK")); break; + case CurrencyNPR: writer->WriteValue(TEXT("NPR")); break; + case CurrencyNZD: writer->WriteValue(TEXT("NZD")); break; + case CurrencyOMR: writer->WriteValue(TEXT("OMR")); break; + case CurrencyPAB: writer->WriteValue(TEXT("PAB")); break; + case CurrencyPEN: writer->WriteValue(TEXT("PEN")); break; + case CurrencyPGK: writer->WriteValue(TEXT("PGK")); break; + case CurrencyPHP: writer->WriteValue(TEXT("PHP")); break; + case CurrencyPKR: writer->WriteValue(TEXT("PKR")); break; + case CurrencyPLN: writer->WriteValue(TEXT("PLN")); break; + case CurrencyPYG: writer->WriteValue(TEXT("PYG")); break; + case CurrencyQAR: writer->WriteValue(TEXT("QAR")); break; + case CurrencyRON: writer->WriteValue(TEXT("RON")); break; + case CurrencyRSD: writer->WriteValue(TEXT("RSD")); break; + case CurrencyRUB: writer->WriteValue(TEXT("RUB")); break; + case CurrencyRWF: writer->WriteValue(TEXT("RWF")); break; + case CurrencySAR: writer->WriteValue(TEXT("SAR")); break; + case CurrencySBD: writer->WriteValue(TEXT("SBD")); break; + case CurrencySCR: writer->WriteValue(TEXT("SCR")); break; + case CurrencySDG: writer->WriteValue(TEXT("SDG")); break; + case CurrencySEK: writer->WriteValue(TEXT("SEK")); break; + case CurrencySGD: writer->WriteValue(TEXT("SGD")); break; + case CurrencySHP: writer->WriteValue(TEXT("SHP")); break; + case CurrencySLL: writer->WriteValue(TEXT("SLL")); break; + case CurrencySOS: writer->WriteValue(TEXT("SOS")); break; + case CurrencySPL: writer->WriteValue(TEXT("SPL")); break; + case CurrencySRD: writer->WriteValue(TEXT("SRD")); break; + case CurrencySTD: writer->WriteValue(TEXT("STD")); break; + case CurrencySVC: writer->WriteValue(TEXT("SVC")); break; + case CurrencySYP: writer->WriteValue(TEXT("SYP")); break; + case CurrencySZL: writer->WriteValue(TEXT("SZL")); break; + case CurrencyTHB: writer->WriteValue(TEXT("THB")); break; + case CurrencyTJS: writer->WriteValue(TEXT("TJS")); break; + case CurrencyTMT: writer->WriteValue(TEXT("TMT")); break; + case CurrencyTND: writer->WriteValue(TEXT("TND")); break; + case CurrencyTOP: writer->WriteValue(TEXT("TOP")); break; + case CurrencyTRY: writer->WriteValue(TEXT("TRY")); break; + case CurrencyTTD: writer->WriteValue(TEXT("TTD")); break; + case CurrencyTVD: writer->WriteValue(TEXT("TVD")); break; + case CurrencyTWD: writer->WriteValue(TEXT("TWD")); break; + case CurrencyTZS: writer->WriteValue(TEXT("TZS")); break; + case CurrencyUAH: writer->WriteValue(TEXT("UAH")); break; + case CurrencyUGX: writer->WriteValue(TEXT("UGX")); break; + case CurrencyUSD: writer->WriteValue(TEXT("USD")); break; + case CurrencyUYU: writer->WriteValue(TEXT("UYU")); break; + case CurrencyUZS: writer->WriteValue(TEXT("UZS")); break; + case CurrencyVEF: writer->WriteValue(TEXT("VEF")); break; + case CurrencyVND: writer->WriteValue(TEXT("VND")); break; + case CurrencyVUV: writer->WriteValue(TEXT("VUV")); break; + case CurrencyWST: writer->WriteValue(TEXT("WST")); break; + case CurrencyXAF: writer->WriteValue(TEXT("XAF")); break; + case CurrencyXCD: writer->WriteValue(TEXT("XCD")); break; + case CurrencyXDR: writer->WriteValue(TEXT("XDR")); break; + case CurrencyXOF: writer->WriteValue(TEXT("XOF")); break; + case CurrencyXPF: writer->WriteValue(TEXT("XPF")); break; + case CurrencyYER: writer->WriteValue(TEXT("YER")); break; + case CurrencyZAR: writer->WriteValue(TEXT("ZAR")); break; + case CurrencyZMW: writer->WriteValue(TEXT("ZMW")); break; + case CurrencyZWD: writer->WriteValue(TEXT("ZWD")); break; + } +} + +AdminModels::Currency PlayFab::AdminModels::readCurrencyFromValue(const TSharedPtr& value) +{ + return readCurrencyFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::Currency PlayFab::AdminModels::readCurrencyFromValue(const FString& value) +{ + static TMap _CurrencyMap; + if (_CurrencyMap.Num() == 0) + { + // Auto-generate the map on the first use + _CurrencyMap.Add(TEXT("AED"), CurrencyAED); + _CurrencyMap.Add(TEXT("AFN"), CurrencyAFN); + _CurrencyMap.Add(TEXT("ALL"), CurrencyALL); + _CurrencyMap.Add(TEXT("AMD"), CurrencyAMD); + _CurrencyMap.Add(TEXT("ANG"), CurrencyANG); + _CurrencyMap.Add(TEXT("AOA"), CurrencyAOA); + _CurrencyMap.Add(TEXT("ARS"), CurrencyARS); + _CurrencyMap.Add(TEXT("AUD"), CurrencyAUD); + _CurrencyMap.Add(TEXT("AWG"), CurrencyAWG); + _CurrencyMap.Add(TEXT("AZN"), CurrencyAZN); + _CurrencyMap.Add(TEXT("BAM"), CurrencyBAM); + _CurrencyMap.Add(TEXT("BBD"), CurrencyBBD); + _CurrencyMap.Add(TEXT("BDT"), CurrencyBDT); + _CurrencyMap.Add(TEXT("BGN"), CurrencyBGN); + _CurrencyMap.Add(TEXT("BHD"), CurrencyBHD); + _CurrencyMap.Add(TEXT("BIF"), CurrencyBIF); + _CurrencyMap.Add(TEXT("BMD"), CurrencyBMD); + _CurrencyMap.Add(TEXT("BND"), CurrencyBND); + _CurrencyMap.Add(TEXT("BOB"), CurrencyBOB); + _CurrencyMap.Add(TEXT("BRL"), CurrencyBRL); + _CurrencyMap.Add(TEXT("BSD"), CurrencyBSD); + _CurrencyMap.Add(TEXT("BTN"), CurrencyBTN); + _CurrencyMap.Add(TEXT("BWP"), CurrencyBWP); + _CurrencyMap.Add(TEXT("BYR"), CurrencyBYR); + _CurrencyMap.Add(TEXT("BZD"), CurrencyBZD); + _CurrencyMap.Add(TEXT("CAD"), CurrencyCAD); + _CurrencyMap.Add(TEXT("CDF"), CurrencyCDF); + _CurrencyMap.Add(TEXT("CHF"), CurrencyCHF); + _CurrencyMap.Add(TEXT("CLP"), CurrencyCLP); + _CurrencyMap.Add(TEXT("CNY"), CurrencyCNY); + _CurrencyMap.Add(TEXT("COP"), CurrencyCOP); + _CurrencyMap.Add(TEXT("CRC"), CurrencyCRC); + _CurrencyMap.Add(TEXT("CUC"), CurrencyCUC); + _CurrencyMap.Add(TEXT("CUP"), CurrencyCUP); + _CurrencyMap.Add(TEXT("CVE"), CurrencyCVE); + _CurrencyMap.Add(TEXT("CZK"), CurrencyCZK); + _CurrencyMap.Add(TEXT("DJF"), CurrencyDJF); + _CurrencyMap.Add(TEXT("DKK"), CurrencyDKK); + _CurrencyMap.Add(TEXT("DOP"), CurrencyDOP); + _CurrencyMap.Add(TEXT("DZD"), CurrencyDZD); + _CurrencyMap.Add(TEXT("EGP"), CurrencyEGP); + _CurrencyMap.Add(TEXT("ERN"), CurrencyERN); + _CurrencyMap.Add(TEXT("ETB"), CurrencyETB); + _CurrencyMap.Add(TEXT("EUR"), CurrencyEUR); + _CurrencyMap.Add(TEXT("FJD"), CurrencyFJD); + _CurrencyMap.Add(TEXT("FKP"), CurrencyFKP); + _CurrencyMap.Add(TEXT("GBP"), CurrencyGBP); + _CurrencyMap.Add(TEXT("GEL"), CurrencyGEL); + _CurrencyMap.Add(TEXT("GGP"), CurrencyGGP); + _CurrencyMap.Add(TEXT("GHS"), CurrencyGHS); + _CurrencyMap.Add(TEXT("GIP"), CurrencyGIP); + _CurrencyMap.Add(TEXT("GMD"), CurrencyGMD); + _CurrencyMap.Add(TEXT("GNF"), CurrencyGNF); + _CurrencyMap.Add(TEXT("GTQ"), CurrencyGTQ); + _CurrencyMap.Add(TEXT("GYD"), CurrencyGYD); + _CurrencyMap.Add(TEXT("HKD"), CurrencyHKD); + _CurrencyMap.Add(TEXT("HNL"), CurrencyHNL); + _CurrencyMap.Add(TEXT("HRK"), CurrencyHRK); + _CurrencyMap.Add(TEXT("HTG"), CurrencyHTG); + _CurrencyMap.Add(TEXT("HUF"), CurrencyHUF); + _CurrencyMap.Add(TEXT("IDR"), CurrencyIDR); + _CurrencyMap.Add(TEXT("ILS"), CurrencyILS); + _CurrencyMap.Add(TEXT("IMP"), CurrencyIMP); + _CurrencyMap.Add(TEXT("INR"), CurrencyINR); + _CurrencyMap.Add(TEXT("IQD"), CurrencyIQD); + _CurrencyMap.Add(TEXT("IRR"), CurrencyIRR); + _CurrencyMap.Add(TEXT("ISK"), CurrencyISK); + _CurrencyMap.Add(TEXT("JEP"), CurrencyJEP); + _CurrencyMap.Add(TEXT("JMD"), CurrencyJMD); + _CurrencyMap.Add(TEXT("JOD"), CurrencyJOD); + _CurrencyMap.Add(TEXT("JPY"), CurrencyJPY); + _CurrencyMap.Add(TEXT("KES"), CurrencyKES); + _CurrencyMap.Add(TEXT("KGS"), CurrencyKGS); + _CurrencyMap.Add(TEXT("KHR"), CurrencyKHR); + _CurrencyMap.Add(TEXT("KMF"), CurrencyKMF); + _CurrencyMap.Add(TEXT("KPW"), CurrencyKPW); + _CurrencyMap.Add(TEXT("KRW"), CurrencyKRW); + _CurrencyMap.Add(TEXT("KWD"), CurrencyKWD); + _CurrencyMap.Add(TEXT("KYD"), CurrencyKYD); + _CurrencyMap.Add(TEXT("KZT"), CurrencyKZT); + _CurrencyMap.Add(TEXT("LAK"), CurrencyLAK); + _CurrencyMap.Add(TEXT("LBP"), CurrencyLBP); + _CurrencyMap.Add(TEXT("LKR"), CurrencyLKR); + _CurrencyMap.Add(TEXT("LRD"), CurrencyLRD); + _CurrencyMap.Add(TEXT("LSL"), CurrencyLSL); + _CurrencyMap.Add(TEXT("LYD"), CurrencyLYD); + _CurrencyMap.Add(TEXT("MAD"), CurrencyMAD); + _CurrencyMap.Add(TEXT("MDL"), CurrencyMDL); + _CurrencyMap.Add(TEXT("MGA"), CurrencyMGA); + _CurrencyMap.Add(TEXT("MKD"), CurrencyMKD); + _CurrencyMap.Add(TEXT("MMK"), CurrencyMMK); + _CurrencyMap.Add(TEXT("MNT"), CurrencyMNT); + _CurrencyMap.Add(TEXT("MOP"), CurrencyMOP); + _CurrencyMap.Add(TEXT("MRO"), CurrencyMRO); + _CurrencyMap.Add(TEXT("MUR"), CurrencyMUR); + _CurrencyMap.Add(TEXT("MVR"), CurrencyMVR); + _CurrencyMap.Add(TEXT("MWK"), CurrencyMWK); + _CurrencyMap.Add(TEXT("MXN"), CurrencyMXN); + _CurrencyMap.Add(TEXT("MYR"), CurrencyMYR); + _CurrencyMap.Add(TEXT("MZN"), CurrencyMZN); + _CurrencyMap.Add(TEXT("NAD"), CurrencyNAD); + _CurrencyMap.Add(TEXT("NGN"), CurrencyNGN); + _CurrencyMap.Add(TEXT("NIO"), CurrencyNIO); + _CurrencyMap.Add(TEXT("NOK"), CurrencyNOK); + _CurrencyMap.Add(TEXT("NPR"), CurrencyNPR); + _CurrencyMap.Add(TEXT("NZD"), CurrencyNZD); + _CurrencyMap.Add(TEXT("OMR"), CurrencyOMR); + _CurrencyMap.Add(TEXT("PAB"), CurrencyPAB); + _CurrencyMap.Add(TEXT("PEN"), CurrencyPEN); + _CurrencyMap.Add(TEXT("PGK"), CurrencyPGK); + _CurrencyMap.Add(TEXT("PHP"), CurrencyPHP); + _CurrencyMap.Add(TEXT("PKR"), CurrencyPKR); + _CurrencyMap.Add(TEXT("PLN"), CurrencyPLN); + _CurrencyMap.Add(TEXT("PYG"), CurrencyPYG); + _CurrencyMap.Add(TEXT("QAR"), CurrencyQAR); + _CurrencyMap.Add(TEXT("RON"), CurrencyRON); + _CurrencyMap.Add(TEXT("RSD"), CurrencyRSD); + _CurrencyMap.Add(TEXT("RUB"), CurrencyRUB); + _CurrencyMap.Add(TEXT("RWF"), CurrencyRWF); + _CurrencyMap.Add(TEXT("SAR"), CurrencySAR); + _CurrencyMap.Add(TEXT("SBD"), CurrencySBD); + _CurrencyMap.Add(TEXT("SCR"), CurrencySCR); + _CurrencyMap.Add(TEXT("SDG"), CurrencySDG); + _CurrencyMap.Add(TEXT("SEK"), CurrencySEK); + _CurrencyMap.Add(TEXT("SGD"), CurrencySGD); + _CurrencyMap.Add(TEXT("SHP"), CurrencySHP); + _CurrencyMap.Add(TEXT("SLL"), CurrencySLL); + _CurrencyMap.Add(TEXT("SOS"), CurrencySOS); + _CurrencyMap.Add(TEXT("SPL"), CurrencySPL); + _CurrencyMap.Add(TEXT("SRD"), CurrencySRD); + _CurrencyMap.Add(TEXT("STD"), CurrencySTD); + _CurrencyMap.Add(TEXT("SVC"), CurrencySVC); + _CurrencyMap.Add(TEXT("SYP"), CurrencySYP); + _CurrencyMap.Add(TEXT("SZL"), CurrencySZL); + _CurrencyMap.Add(TEXT("THB"), CurrencyTHB); + _CurrencyMap.Add(TEXT("TJS"), CurrencyTJS); + _CurrencyMap.Add(TEXT("TMT"), CurrencyTMT); + _CurrencyMap.Add(TEXT("TND"), CurrencyTND); + _CurrencyMap.Add(TEXT("TOP"), CurrencyTOP); + _CurrencyMap.Add(TEXT("TRY"), CurrencyTRY); + _CurrencyMap.Add(TEXT("TTD"), CurrencyTTD); + _CurrencyMap.Add(TEXT("TVD"), CurrencyTVD); + _CurrencyMap.Add(TEXT("TWD"), CurrencyTWD); + _CurrencyMap.Add(TEXT("TZS"), CurrencyTZS); + _CurrencyMap.Add(TEXT("UAH"), CurrencyUAH); + _CurrencyMap.Add(TEXT("UGX"), CurrencyUGX); + _CurrencyMap.Add(TEXT("USD"), CurrencyUSD); + _CurrencyMap.Add(TEXT("UYU"), CurrencyUYU); + _CurrencyMap.Add(TEXT("UZS"), CurrencyUZS); + _CurrencyMap.Add(TEXT("VEF"), CurrencyVEF); + _CurrencyMap.Add(TEXT("VND"), CurrencyVND); + _CurrencyMap.Add(TEXT("VUV"), CurrencyVUV); + _CurrencyMap.Add(TEXT("WST"), CurrencyWST); + _CurrencyMap.Add(TEXT("XAF"), CurrencyXAF); + _CurrencyMap.Add(TEXT("XCD"), CurrencyXCD); + _CurrencyMap.Add(TEXT("XDR"), CurrencyXDR); + _CurrencyMap.Add(TEXT("XOF"), CurrencyXOF); + _CurrencyMap.Add(TEXT("XPF"), CurrencyXPF); + _CurrencyMap.Add(TEXT("YER"), CurrencyYER); + _CurrencyMap.Add(TEXT("ZAR"), CurrencyZAR); + _CurrencyMap.Add(TEXT("ZMW"), CurrencyZMW); + _CurrencyMap.Add(TEXT("ZWD"), CurrencyZWD); + + } + + if (!value.IsEmpty()) + { + auto output = _CurrencyMap.Find(value); + if (output != nullptr) + return *output; + } + + return CurrencyAED; // Basically critical fail +} + +PlayFab::AdminModels::FDeleteContentRequest::~FDeleteContentRequest() +{ + +} + +void PlayFab::AdminModels::FDeleteContentRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteContentRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteMasterPlayerAccountRequest::~FDeleteMasterPlayerAccountRequest() +{ + +} + +void PlayFab::AdminModels::FDeleteMasterPlayerAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteMasterPlayerAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteMasterPlayerAccountResult::~FDeleteMasterPlayerAccountResult() +{ + +} + +void PlayFab::AdminModels::FDeleteMasterPlayerAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (JobReceiptId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("JobReceiptId")); writer->WriteValue(JobReceiptId); } + + if (TitleIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("TitleIds")); + for (const FString& item : TitleIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteMasterPlayerAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr JobReceiptIdValue = obj->TryGetField(TEXT("JobReceiptId")); + if (JobReceiptIdValue.IsValid() && !JobReceiptIdValue->IsNull()) + { + FString TmpValue; + if (JobReceiptIdValue->TryGetString(TmpValue)) { JobReceiptId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("TitleIds"), TitleIds); + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeletePlayerRequest::~FDeletePlayerRequest() +{ + +} + +void PlayFab::AdminModels::FDeletePlayerRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeletePlayerRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeletePlayerResult::~FDeletePlayerResult() +{ + +} + +void PlayFab::AdminModels::FDeletePlayerResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeletePlayerResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeletePlayerSharedSecretRequest::~FDeletePlayerSharedSecretRequest() +{ + +} + +void PlayFab::AdminModels::FDeletePlayerSharedSecretRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SecretKey.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SecretKey")); writer->WriteValue(SecretKey); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeletePlayerSharedSecretRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SecretKeyValue = obj->TryGetField(TEXT("SecretKey")); + if (SecretKeyValue.IsValid() && !SecretKeyValue->IsNull()) + { + FString TmpValue; + if (SecretKeyValue->TryGetString(TmpValue)) { SecretKey = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeletePlayerSharedSecretResult::~FDeletePlayerSharedSecretResult() +{ + +} + +void PlayFab::AdminModels::FDeletePlayerSharedSecretResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeletePlayerSharedSecretResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteStoreRequest::~FDeleteStoreRequest() +{ + +} + +void PlayFab::AdminModels::FDeleteStoreRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteStoreRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteStoreResult::~FDeleteStoreResult() +{ + +} + +void PlayFab::AdminModels::FDeleteStoreResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteStoreResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteTaskRequest::~FDeleteTaskRequest() +{ + //if (Identifier != nullptr) delete Identifier; + +} + +void PlayFab::AdminModels::FDeleteTaskRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Identifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Identifier")); Identifier->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteTaskRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdentifierValue = obj->TryGetField(TEXT("Identifier")); + if (IdentifierValue.IsValid() && !IdentifierValue->IsNull()) + { + Identifier = MakeShareable(new FNameIdentifier(IdentifierValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteTitleRequest::~FDeleteTitleRequest() +{ + +} + +void PlayFab::AdminModels::FDeleteTitleRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteTitleRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FDeleteTitleResult::~FDeleteTitleResult() +{ + +} + +void PlayFab::AdminModels::FDeleteTitleResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FDeleteTitleResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeEffectTypeEnumJSON(EffectType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case EffectTypeAllow: writer->WriteValue(TEXT("Allow")); break; + case EffectTypeDeny: writer->WriteValue(TEXT("Deny")); break; + } +} + +AdminModels::EffectType PlayFab::AdminModels::readEffectTypeFromValue(const TSharedPtr& value) +{ + return readEffectTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::EffectType PlayFab::AdminModels::readEffectTypeFromValue(const FString& value) +{ + static TMap _EffectTypeMap; + if (_EffectTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _EffectTypeMap.Add(TEXT("Allow"), EffectTypeAllow); + _EffectTypeMap.Add(TEXT("Deny"), EffectTypeDeny); + + } + + if (!value.IsEmpty()) + { + auto output = _EffectTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return EffectTypeAllow; // Basically critical fail +} + +PlayFab::AdminModels::FEmptyResponse::~FEmptyResponse() +{ + +} + +void PlayFab::AdminModels::FEmptyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FEmptyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::AdminModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FExportMasterPlayerDataRequest::~FExportMasterPlayerDataRequest() +{ + +} + +void PlayFab::AdminModels::FExportMasterPlayerDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FExportMasterPlayerDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FExportMasterPlayerDataResult::~FExportMasterPlayerDataResult() +{ + +} + +void PlayFab::AdminModels::FExportMasterPlayerDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (JobReceiptId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("JobReceiptId")); writer->WriteValue(JobReceiptId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FExportMasterPlayerDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr JobReceiptIdValue = obj->TryGetField(TEXT("JobReceiptId")); + if (JobReceiptIdValue.IsValid() && !JobReceiptIdValue->IsNull()) + { + FString TmpValue; + if (JobReceiptIdValue->TryGetString(TmpValue)) { JobReceiptId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGameModeInfo::~FGameModeInfo() +{ + +} + +void PlayFab::AdminModels::FGameModeInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Gamemode")); writer->WriteValue(Gamemode); + + writer->WriteIdentifierPrefix(TEXT("MaxPlayerCount")); writer->WriteValue(static_cast(MaxPlayerCount)); + + writer->WriteIdentifierPrefix(TEXT("MinPlayerCount")); writer->WriteValue(static_cast(MinPlayerCount)); + + if (StartOpen.notNull()) { writer->WriteIdentifierPrefix(TEXT("StartOpen")); writer->WriteValue(StartOpen); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGameModeInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GamemodeValue = obj->TryGetField(TEXT("Gamemode")); + if (GamemodeValue.IsValid() && !GamemodeValue->IsNull()) + { + FString TmpValue; + if (GamemodeValue->TryGetString(TmpValue)) { Gamemode = TmpValue; } + } + + const TSharedPtr MaxPlayerCountValue = obj->TryGetField(TEXT("MaxPlayerCount")); + if (MaxPlayerCountValue.IsValid() && !MaxPlayerCountValue->IsNull()) + { + uint32 TmpValue; + if (MaxPlayerCountValue->TryGetNumber(TmpValue)) { MaxPlayerCount = TmpValue; } + } + + const TSharedPtr MinPlayerCountValue = obj->TryGetField(TEXT("MinPlayerCount")); + if (MinPlayerCountValue.IsValid() && !MinPlayerCountValue->IsNull()) + { + uint32 TmpValue; + if (MinPlayerCountValue->TryGetNumber(TmpValue)) { MinPlayerCount = TmpValue; } + } + + const TSharedPtr StartOpenValue = obj->TryGetField(TEXT("StartOpen")); + if (StartOpenValue.IsValid() && !StartOpenValue->IsNull()) + { + bool TmpValue; + if (StartOpenValue->TryGetBool(TmpValue)) { StartOpen = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetActionsOnPlayersInSegmentTaskInstanceResult::~FGetActionsOnPlayersInSegmentTaskInstanceResult() +{ + //if (Parameter != nullptr) delete Parameter; + //if (Summary != nullptr) delete Summary; + +} + +void PlayFab::AdminModels::FGetActionsOnPlayersInSegmentTaskInstanceResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Parameter.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Parameter")); Parameter->writeJSON(writer); } + + if (Summary.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Summary")); Summary->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetActionsOnPlayersInSegmentTaskInstanceResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ParameterValue = obj->TryGetField(TEXT("Parameter")); + if (ParameterValue.IsValid() && !ParameterValue->IsNull()) + { + Parameter = MakeShareable(new FActionsOnPlayersInSegmentTaskParameter(ParameterValue->AsObject())); + } + + const TSharedPtr SummaryValue = obj->TryGetField(TEXT("Summary")); + if (SummaryValue.IsValid() && !SummaryValue->IsNull()) + { + Summary = MakeShareable(new FActionsOnPlayersInSegmentTaskSummary(SummaryValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetAllSegmentsRequest::~FGetAllSegmentsRequest() +{ + +} + +void PlayFab::AdminModels::FGetAllSegmentsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetAllSegmentsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetSegmentResult::~FGetSegmentResult() +{ + +} + +void PlayFab::AdminModels::FGetSegmentResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ABTestParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ABTestParent")); writer->WriteValue(ABTestParent); } + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetSegmentResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ABTestParentValue = obj->TryGetField(TEXT("ABTestParent")); + if (ABTestParentValue.IsValid() && !ABTestParentValue->IsNull()) + { + FString TmpValue; + if (ABTestParentValue->TryGetString(TmpValue)) { ABTestParent = TmpValue; } + } + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetAllSegmentsResult::~FGetAllSegmentsResult() +{ + +} + +void PlayFab::AdminModels::FGetAllSegmentsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Segments.Num() != 0) + { + writer->WriteArrayStart(TEXT("Segments")); + for (const FGetSegmentResult& item : Segments) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetAllSegmentsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SegmentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Segments")); + for (int32 Idx = 0; Idx < SegmentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SegmentsArray[Idx]; + Segments.Add(FGetSegmentResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCatalogItemsRequest::~FGetCatalogItemsRequest() +{ + +} + +void PlayFab::AdminModels::FGetCatalogItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCatalogItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCatalogItemsResult::~FGetCatalogItemsResult() +{ + +} + +void PlayFab::AdminModels::FGetCatalogItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Catalog.Num() != 0) + { + writer->WriteArrayStart(TEXT("Catalog")); + for (const FCatalogItem& item : Catalog) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCatalogItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&CatalogArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Catalog")); + for (int32 Idx = 0; Idx < CatalogArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CatalogArray[Idx]; + Catalog.Add(FCatalogItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCloudScriptRevisionRequest::~FGetCloudScriptRevisionRequest() +{ + +} + +void PlayFab::AdminModels::FGetCloudScriptRevisionRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Revision.notNull()) { writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCloudScriptRevisionRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCloudScriptRevisionResult::~FGetCloudScriptRevisionResult() +{ + +} + +void PlayFab::AdminModels::FGetCloudScriptRevisionResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CreatedAt")); writeDatetime(CreatedAt, writer); + + if (Files.Num() != 0) + { + writer->WriteArrayStart(TEXT("Files")); + for (const FCloudScriptFile& item : Files) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("IsPublished")); writer->WriteValue(IsPublished); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCloudScriptRevisionResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreatedAtValue = obj->TryGetField(TEXT("CreatedAt")); + if (CreatedAtValue.IsValid()) + CreatedAt = readDatetime(CreatedAtValue); + + + const TArray>&FilesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Files")); + for (int32 Idx = 0; Idx < FilesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = FilesArray[Idx]; + Files.Add(FCloudScriptFile(CurrentItem->AsObject())); + } + + + const TSharedPtr IsPublishedValue = obj->TryGetField(TEXT("IsPublished")); + if (IsPublishedValue.IsValid() && !IsPublishedValue->IsNull()) + { + bool TmpValue; + if (IsPublishedValue->TryGetBool(TmpValue)) { IsPublished = TmpValue; } + } + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCloudScriptTaskInstanceResult::~FGetCloudScriptTaskInstanceResult() +{ + //if (Parameter != nullptr) delete Parameter; + //if (Summary != nullptr) delete Summary; + +} + +void PlayFab::AdminModels::FGetCloudScriptTaskInstanceResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Parameter.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Parameter")); Parameter->writeJSON(writer); } + + if (Summary.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Summary")); Summary->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCloudScriptTaskInstanceResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ParameterValue = obj->TryGetField(TEXT("Parameter")); + if (ParameterValue.IsValid() && !ParameterValue->IsNull()) + { + Parameter = MakeShareable(new FCloudScriptTaskParameter(ParameterValue->AsObject())); + } + + const TSharedPtr SummaryValue = obj->TryGetField(TEXT("Summary")); + if (SummaryValue.IsValid() && !SummaryValue->IsNull()) + { + Summary = MakeShareable(new FCloudScriptTaskSummary(SummaryValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCloudScriptVersionsRequest::~FGetCloudScriptVersionsRequest() +{ + +} + +void PlayFab::AdminModels::FGetCloudScriptVersionsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCloudScriptVersionsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetCloudScriptVersionsResult::~FGetCloudScriptVersionsResult() +{ + +} + +void PlayFab::AdminModels::FGetCloudScriptVersionsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Versions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Versions")); + for (const FCloudScriptVersionStatus& item : Versions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetCloudScriptVersionsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&VersionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Versions")); + for (int32 Idx = 0; Idx < VersionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = VersionsArray[Idx]; + Versions.Add(FCloudScriptVersionStatus(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetContentListRequest::~FGetContentListRequest() +{ + +} + +void PlayFab::AdminModels::FGetContentListRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Prefix.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Prefix")); writer->WriteValue(Prefix); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetContentListRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PrefixValue = obj->TryGetField(TEXT("Prefix")); + if (PrefixValue.IsValid() && !PrefixValue->IsNull()) + { + FString TmpValue; + if (PrefixValue->TryGetString(TmpValue)) { Prefix = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetContentListResult::~FGetContentListResult() +{ + +} + +void PlayFab::AdminModels::FGetContentListResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Contents.Num() != 0) + { + writer->WriteArrayStart(TEXT("Contents")); + for (const FContentInfo& item : Contents) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("ItemCount")); writer->WriteValue(ItemCount); + + writer->WriteIdentifierPrefix(TEXT("TotalSize")); writer->WriteValue(static_cast(TotalSize)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetContentListResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ContentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Contents")); + for (int32 Idx = 0; Idx < ContentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContentsArray[Idx]; + Contents.Add(FContentInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr ItemCountValue = obj->TryGetField(TEXT("ItemCount")); + if (ItemCountValue.IsValid() && !ItemCountValue->IsNull()) + { + int32 TmpValue; + if (ItemCountValue->TryGetNumber(TmpValue)) { ItemCount = TmpValue; } + } + + const TSharedPtr TotalSizeValue = obj->TryGetField(TEXT("TotalSize")); + if (TotalSizeValue.IsValid() && !TotalSizeValue->IsNull()) + { + uint32 TmpValue; + if (TotalSizeValue->TryGetNumber(TmpValue)) { TotalSize = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetContentUploadUrlRequest::~FGetContentUploadUrlRequest() +{ + +} + +void PlayFab::AdminModels::FGetContentUploadUrlRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ContentType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ContentType")); writer->WriteValue(ContentType); } + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetContentUploadUrlRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ContentTypeValue = obj->TryGetField(TEXT("ContentType")); + if (ContentTypeValue.IsValid() && !ContentTypeValue->IsNull()) + { + FString TmpValue; + if (ContentTypeValue->TryGetString(TmpValue)) { ContentType = TmpValue; } + } + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetContentUploadUrlResult::~FGetContentUploadUrlResult() +{ + +} + +void PlayFab::AdminModels::FGetContentUploadUrlResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (URL.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("URL")); writer->WriteValue(URL); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetContentUploadUrlResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr URLValue = obj->TryGetField(TEXT("URL")); + if (URLValue.IsValid() && !URLValue->IsNull()) + { + FString TmpValue; + if (URLValue->TryGetString(TmpValue)) { URL = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetDataReportRequest::~FGetDataReportRequest() +{ + +} + +void PlayFab::AdminModels::FGetDataReportRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Day")); writer->WriteValue(Day); + + writer->WriteIdentifierPrefix(TEXT("Month")); writer->WriteValue(Month); + + writer->WriteIdentifierPrefix(TEXT("ReportName")); writer->WriteValue(ReportName); + + writer->WriteIdentifierPrefix(TEXT("Year")); writer->WriteValue(Year); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetDataReportRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DayValue = obj->TryGetField(TEXT("Day")); + if (DayValue.IsValid() && !DayValue->IsNull()) + { + int32 TmpValue; + if (DayValue->TryGetNumber(TmpValue)) { Day = TmpValue; } + } + + const TSharedPtr MonthValue = obj->TryGetField(TEXT("Month")); + if (MonthValue.IsValid() && !MonthValue->IsNull()) + { + int32 TmpValue; + if (MonthValue->TryGetNumber(TmpValue)) { Month = TmpValue; } + } + + const TSharedPtr ReportNameValue = obj->TryGetField(TEXT("ReportName")); + if (ReportNameValue.IsValid() && !ReportNameValue->IsNull()) + { + FString TmpValue; + if (ReportNameValue->TryGetString(TmpValue)) { ReportName = TmpValue; } + } + + const TSharedPtr YearValue = obj->TryGetField(TEXT("Year")); + if (YearValue.IsValid() && !YearValue->IsNull()) + { + int32 TmpValue; + if (YearValue->TryGetNumber(TmpValue)) { Year = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetDataReportResult::~FGetDataReportResult() +{ + +} + +void PlayFab::AdminModels::FGetDataReportResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DownloadUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DownloadUrl")); writer->WriteValue(DownloadUrl); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetDataReportResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DownloadUrlValue = obj->TryGetField(TEXT("DownloadUrl")); + if (DownloadUrlValue.IsValid() && !DownloadUrlValue->IsNull()) + { + FString TmpValue; + if (DownloadUrlValue->TryGetString(TmpValue)) { DownloadUrl = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetMatchmakerGameInfoRequest::~FGetMatchmakerGameInfoRequest() +{ + +} + +void PlayFab::AdminModels::FGetMatchmakerGameInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetMatchmakerGameInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetMatchmakerGameInfoResult::~FGetMatchmakerGameInfoResult() +{ + +} + +void PlayFab::AdminModels::FGetMatchmakerGameInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BuildVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); } + + if (EndTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("EndTime")); writeDatetime(EndTime, writer); } + + if (LobbyId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); } + + if (Mode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Mode")); writer->WriteValue(Mode); } + + if (Players.Num() != 0) + { + writer->WriteArrayStart(TEXT("Players")); + for (const FString& item : Players) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (pfRegion.notNull()) { writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); } + + if (ServerAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerAddress")); writer->WriteValue(ServerAddress); } + + if (ServerIPV4Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV4Address")); writer->WriteValue(ServerIPV4Address); } + + if (ServerIPV6Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV6Address")); writer->WriteValue(ServerIPV6Address); } + + writer->WriteIdentifierPrefix(TEXT("ServerPort")); writer->WriteValue(static_cast(ServerPort)); + + if (ServerPublicDNSName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerPublicDNSName")); writer->WriteValue(ServerPublicDNSName); } + + writer->WriteIdentifierPrefix(TEXT("StartTime")); writeDatetime(StartTime, writer); + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetMatchmakerGameInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TSharedPtr EndTimeValue = obj->TryGetField(TEXT("EndTime")); + if (EndTimeValue.IsValid()) + EndTime = readDatetime(EndTimeValue); + + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + const TSharedPtr ModeValue = obj->TryGetField(TEXT("Mode")); + if (ModeValue.IsValid() && !ModeValue->IsNull()) + { + FString TmpValue; + if (ModeValue->TryGetString(TmpValue)) { Mode = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Players"), Players); + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + const TSharedPtr ServerAddressValue = obj->TryGetField(TEXT("ServerAddress")); + if (ServerAddressValue.IsValid() && !ServerAddressValue->IsNull()) + { + FString TmpValue; + if (ServerAddressValue->TryGetString(TmpValue)) { ServerAddress = TmpValue; } + } + + const TSharedPtr ServerIPV4AddressValue = obj->TryGetField(TEXT("ServerIPV4Address")); + if (ServerIPV4AddressValue.IsValid() && !ServerIPV4AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV4AddressValue->TryGetString(TmpValue)) { ServerIPV4Address = TmpValue; } + } + + const TSharedPtr ServerIPV6AddressValue = obj->TryGetField(TEXT("ServerIPV6Address")); + if (ServerIPV6AddressValue.IsValid() && !ServerIPV6AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV6AddressValue->TryGetString(TmpValue)) { ServerIPV6Address = TmpValue; } + } + + const TSharedPtr ServerPortValue = obj->TryGetField(TEXT("ServerPort")); + if (ServerPortValue.IsValid() && !ServerPortValue->IsNull()) + { + uint32 TmpValue; + if (ServerPortValue->TryGetNumber(TmpValue)) { ServerPort = TmpValue; } + } + + const TSharedPtr ServerPublicDNSNameValue = obj->TryGetField(TEXT("ServerPublicDNSName")); + if (ServerPublicDNSNameValue.IsValid() && !ServerPublicDNSNameValue->IsNull()) + { + FString TmpValue; + if (ServerPublicDNSNameValue->TryGetString(TmpValue)) { ServerPublicDNSName = TmpValue; } + } + + const TSharedPtr StartTimeValue = obj->TryGetField(TEXT("StartTime")); + if (StartTimeValue.IsValid()) + StartTime = readDatetime(StartTimeValue); + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetMatchmakerGameModesRequest::~FGetMatchmakerGameModesRequest() +{ + +} + +void PlayFab::AdminModels::FGetMatchmakerGameModesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetMatchmakerGameModesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetMatchmakerGameModesResult::~FGetMatchmakerGameModesResult() +{ + +} + +void PlayFab::AdminModels::FGetMatchmakerGameModesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GameModes.Num() != 0) + { + writer->WriteArrayStart(TEXT("GameModes")); + for (const FGameModeInfo& item : GameModes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetMatchmakerGameModesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GameModesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GameModes")); + for (int32 Idx = 0; Idx < GameModesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GameModesArray[Idx]; + GameModes.Add(FGameModeInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayedTitleListRequest::~FGetPlayedTitleListRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayedTitleListRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayedTitleListRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayedTitleListResult::~FGetPlayedTitleListResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayedTitleListResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TitleIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("TitleIds")); + for (const FString& item : TitleIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayedTitleListResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("TitleIds"), TitleIds); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerIdFromAuthTokenRequest::~FGetPlayerIdFromAuthTokenRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayerIdFromAuthTokenRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Token")); writer->WriteValue(Token); + + writer->WriteIdentifierPrefix(TEXT("TokenType")); writeAuthTokenTypeEnumJSON(TokenType, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerIdFromAuthTokenRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TokenValue = obj->TryGetField(TEXT("Token")); + if (TokenValue.IsValid() && !TokenValue->IsNull()) + { + FString TmpValue; + if (TokenValue->TryGetString(TmpValue)) { Token = TmpValue; } + } + + TokenType = readAuthTokenTypeFromValue(obj->TryGetField(TEXT("TokenType"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerIdFromAuthTokenResult::~FGetPlayerIdFromAuthTokenResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayerIdFromAuthTokenResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerIdFromAuthTokenResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerProfileViewConstraints::~FPlayerProfileViewConstraints() +{ + +} + +void PlayFab::AdminModels::FPlayerProfileViewConstraints::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ShowAvatarUrl")); writer->WriteValue(ShowAvatarUrl); + + writer->WriteIdentifierPrefix(TEXT("ShowBannedUntil")); writer->WriteValue(ShowBannedUntil); + + writer->WriteIdentifierPrefix(TEXT("ShowCampaignAttributions")); writer->WriteValue(ShowCampaignAttributions); + + writer->WriteIdentifierPrefix(TEXT("ShowContactEmailAddresses")); writer->WriteValue(ShowContactEmailAddresses); + + writer->WriteIdentifierPrefix(TEXT("ShowCreated")); writer->WriteValue(ShowCreated); + + writer->WriteIdentifierPrefix(TEXT("ShowDisplayName")); writer->WriteValue(ShowDisplayName); + + writer->WriteIdentifierPrefix(TEXT("ShowLastLogin")); writer->WriteValue(ShowLastLogin); + + writer->WriteIdentifierPrefix(TEXT("ShowLinkedAccounts")); writer->WriteValue(ShowLinkedAccounts); + + writer->WriteIdentifierPrefix(TEXT("ShowLocations")); writer->WriteValue(ShowLocations); + + writer->WriteIdentifierPrefix(TEXT("ShowMemberships")); writer->WriteValue(ShowMemberships); + + writer->WriteIdentifierPrefix(TEXT("ShowOrigination")); writer->WriteValue(ShowOrigination); + + writer->WriteIdentifierPrefix(TEXT("ShowPushNotificationRegistrations")); writer->WriteValue(ShowPushNotificationRegistrations); + + writer->WriteIdentifierPrefix(TEXT("ShowStatistics")); writer->WriteValue(ShowStatistics); + + writer->WriteIdentifierPrefix(TEXT("ShowTags")); writer->WriteValue(ShowTags); + + writer->WriteIdentifierPrefix(TEXT("ShowTotalValueToDateInUsd")); writer->WriteValue(ShowTotalValueToDateInUsd); + + writer->WriteIdentifierPrefix(TEXT("ShowValuesToDate")); writer->WriteValue(ShowValuesToDate); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerProfileViewConstraints::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ShowAvatarUrlValue = obj->TryGetField(TEXT("ShowAvatarUrl")); + if (ShowAvatarUrlValue.IsValid() && !ShowAvatarUrlValue->IsNull()) + { + bool TmpValue; + if (ShowAvatarUrlValue->TryGetBool(TmpValue)) { ShowAvatarUrl = TmpValue; } + } + + const TSharedPtr ShowBannedUntilValue = obj->TryGetField(TEXT("ShowBannedUntil")); + if (ShowBannedUntilValue.IsValid() && !ShowBannedUntilValue->IsNull()) + { + bool TmpValue; + if (ShowBannedUntilValue->TryGetBool(TmpValue)) { ShowBannedUntil = TmpValue; } + } + + const TSharedPtr ShowCampaignAttributionsValue = obj->TryGetField(TEXT("ShowCampaignAttributions")); + if (ShowCampaignAttributionsValue.IsValid() && !ShowCampaignAttributionsValue->IsNull()) + { + bool TmpValue; + if (ShowCampaignAttributionsValue->TryGetBool(TmpValue)) { ShowCampaignAttributions = TmpValue; } + } + + const TSharedPtr ShowContactEmailAddressesValue = obj->TryGetField(TEXT("ShowContactEmailAddresses")); + if (ShowContactEmailAddressesValue.IsValid() && !ShowContactEmailAddressesValue->IsNull()) + { + bool TmpValue; + if (ShowContactEmailAddressesValue->TryGetBool(TmpValue)) { ShowContactEmailAddresses = TmpValue; } + } + + const TSharedPtr ShowCreatedValue = obj->TryGetField(TEXT("ShowCreated")); + if (ShowCreatedValue.IsValid() && !ShowCreatedValue->IsNull()) + { + bool TmpValue; + if (ShowCreatedValue->TryGetBool(TmpValue)) { ShowCreated = TmpValue; } + } + + const TSharedPtr ShowDisplayNameValue = obj->TryGetField(TEXT("ShowDisplayName")); + if (ShowDisplayNameValue.IsValid() && !ShowDisplayNameValue->IsNull()) + { + bool TmpValue; + if (ShowDisplayNameValue->TryGetBool(TmpValue)) { ShowDisplayName = TmpValue; } + } + + const TSharedPtr ShowLastLoginValue = obj->TryGetField(TEXT("ShowLastLogin")); + if (ShowLastLoginValue.IsValid() && !ShowLastLoginValue->IsNull()) + { + bool TmpValue; + if (ShowLastLoginValue->TryGetBool(TmpValue)) { ShowLastLogin = TmpValue; } + } + + const TSharedPtr ShowLinkedAccountsValue = obj->TryGetField(TEXT("ShowLinkedAccounts")); + if (ShowLinkedAccountsValue.IsValid() && !ShowLinkedAccountsValue->IsNull()) + { + bool TmpValue; + if (ShowLinkedAccountsValue->TryGetBool(TmpValue)) { ShowLinkedAccounts = TmpValue; } + } + + const TSharedPtr ShowLocationsValue = obj->TryGetField(TEXT("ShowLocations")); + if (ShowLocationsValue.IsValid() && !ShowLocationsValue->IsNull()) + { + bool TmpValue; + if (ShowLocationsValue->TryGetBool(TmpValue)) { ShowLocations = TmpValue; } + } + + const TSharedPtr ShowMembershipsValue = obj->TryGetField(TEXT("ShowMemberships")); + if (ShowMembershipsValue.IsValid() && !ShowMembershipsValue->IsNull()) + { + bool TmpValue; + if (ShowMembershipsValue->TryGetBool(TmpValue)) { ShowMemberships = TmpValue; } + } + + const TSharedPtr ShowOriginationValue = obj->TryGetField(TEXT("ShowOrigination")); + if (ShowOriginationValue.IsValid() && !ShowOriginationValue->IsNull()) + { + bool TmpValue; + if (ShowOriginationValue->TryGetBool(TmpValue)) { ShowOrigination = TmpValue; } + } + + const TSharedPtr ShowPushNotificationRegistrationsValue = obj->TryGetField(TEXT("ShowPushNotificationRegistrations")); + if (ShowPushNotificationRegistrationsValue.IsValid() && !ShowPushNotificationRegistrationsValue->IsNull()) + { + bool TmpValue; + if (ShowPushNotificationRegistrationsValue->TryGetBool(TmpValue)) { ShowPushNotificationRegistrations = TmpValue; } + } + + const TSharedPtr ShowStatisticsValue = obj->TryGetField(TEXT("ShowStatistics")); + if (ShowStatisticsValue.IsValid() && !ShowStatisticsValue->IsNull()) + { + bool TmpValue; + if (ShowStatisticsValue->TryGetBool(TmpValue)) { ShowStatistics = TmpValue; } + } + + const TSharedPtr ShowTagsValue = obj->TryGetField(TEXT("ShowTags")); + if (ShowTagsValue.IsValid() && !ShowTagsValue->IsNull()) + { + bool TmpValue; + if (ShowTagsValue->TryGetBool(TmpValue)) { ShowTags = TmpValue; } + } + + const TSharedPtr ShowTotalValueToDateInUsdValue = obj->TryGetField(TEXT("ShowTotalValueToDateInUsd")); + if (ShowTotalValueToDateInUsdValue.IsValid() && !ShowTotalValueToDateInUsdValue->IsNull()) + { + bool TmpValue; + if (ShowTotalValueToDateInUsdValue->TryGetBool(TmpValue)) { ShowTotalValueToDateInUsd = TmpValue; } + } + + const TSharedPtr ShowValuesToDateValue = obj->TryGetField(TEXT("ShowValuesToDate")); + if (ShowValuesToDateValue.IsValid() && !ShowValuesToDateValue->IsNull()) + { + bool TmpValue; + if (ShowValuesToDateValue->TryGetBool(TmpValue)) { ShowValuesToDate = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerProfileRequest::~FGetPlayerProfileRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::AdminModels::FGetPlayerProfileRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerProfileRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeLoginIdentityProviderEnumJSON(LoginIdentityProvider enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case LoginIdentityProviderUnknown: writer->WriteValue(TEXT("Unknown")); break; + case LoginIdentityProviderPlayFab: writer->WriteValue(TEXT("PlayFab")); break; + case LoginIdentityProviderCustom: writer->WriteValue(TEXT("Custom")); break; + case LoginIdentityProviderGameCenter: writer->WriteValue(TEXT("GameCenter")); break; + case LoginIdentityProviderGooglePlay: writer->WriteValue(TEXT("GooglePlay")); break; + case LoginIdentityProviderSteam: writer->WriteValue(TEXT("Steam")); break; + case LoginIdentityProviderXBoxLive: writer->WriteValue(TEXT("XBoxLive")); break; + case LoginIdentityProviderPSN: writer->WriteValue(TEXT("PSN")); break; + case LoginIdentityProviderKongregate: writer->WriteValue(TEXT("Kongregate")); break; + case LoginIdentityProviderFacebook: writer->WriteValue(TEXT("Facebook")); break; + case LoginIdentityProviderIOSDevice: writer->WriteValue(TEXT("IOSDevice")); break; + case LoginIdentityProviderAndroidDevice: writer->WriteValue(TEXT("AndroidDevice")); break; + case LoginIdentityProviderTwitch: writer->WriteValue(TEXT("Twitch")); break; + case LoginIdentityProviderWindowsHello: writer->WriteValue(TEXT("WindowsHello")); break; + case LoginIdentityProviderGameServer: writer->WriteValue(TEXT("GameServer")); break; + case LoginIdentityProviderCustomServer: writer->WriteValue(TEXT("CustomServer")); break; + case LoginIdentityProviderNintendoSwitch: writer->WriteValue(TEXT("NintendoSwitch")); break; + case LoginIdentityProviderFacebookInstantGames: writer->WriteValue(TEXT("FacebookInstantGames")); break; + case LoginIdentityProviderOpenIdConnect: writer->WriteValue(TEXT("OpenIdConnect")); break; + } +} + +AdminModels::LoginIdentityProvider PlayFab::AdminModels::readLoginIdentityProviderFromValue(const TSharedPtr& value) +{ + return readLoginIdentityProviderFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::LoginIdentityProvider PlayFab::AdminModels::readLoginIdentityProviderFromValue(const FString& value) +{ + static TMap _LoginIdentityProviderMap; + if (_LoginIdentityProviderMap.Num() == 0) + { + // Auto-generate the map on the first use + _LoginIdentityProviderMap.Add(TEXT("Unknown"), LoginIdentityProviderUnknown); + _LoginIdentityProviderMap.Add(TEXT("PlayFab"), LoginIdentityProviderPlayFab); + _LoginIdentityProviderMap.Add(TEXT("Custom"), LoginIdentityProviderCustom); + _LoginIdentityProviderMap.Add(TEXT("GameCenter"), LoginIdentityProviderGameCenter); + _LoginIdentityProviderMap.Add(TEXT("GooglePlay"), LoginIdentityProviderGooglePlay); + _LoginIdentityProviderMap.Add(TEXT("Steam"), LoginIdentityProviderSteam); + _LoginIdentityProviderMap.Add(TEXT("XBoxLive"), LoginIdentityProviderXBoxLive); + _LoginIdentityProviderMap.Add(TEXT("PSN"), LoginIdentityProviderPSN); + _LoginIdentityProviderMap.Add(TEXT("Kongregate"), LoginIdentityProviderKongregate); + _LoginIdentityProviderMap.Add(TEXT("Facebook"), LoginIdentityProviderFacebook); + _LoginIdentityProviderMap.Add(TEXT("IOSDevice"), LoginIdentityProviderIOSDevice); + _LoginIdentityProviderMap.Add(TEXT("AndroidDevice"), LoginIdentityProviderAndroidDevice); + _LoginIdentityProviderMap.Add(TEXT("Twitch"), LoginIdentityProviderTwitch); + _LoginIdentityProviderMap.Add(TEXT("WindowsHello"), LoginIdentityProviderWindowsHello); + _LoginIdentityProviderMap.Add(TEXT("GameServer"), LoginIdentityProviderGameServer); + _LoginIdentityProviderMap.Add(TEXT("CustomServer"), LoginIdentityProviderCustomServer); + _LoginIdentityProviderMap.Add(TEXT("NintendoSwitch"), LoginIdentityProviderNintendoSwitch); + _LoginIdentityProviderMap.Add(TEXT("FacebookInstantGames"), LoginIdentityProviderFacebookInstantGames); + _LoginIdentityProviderMap.Add(TEXT("OpenIdConnect"), LoginIdentityProviderOpenIdConnect); + + } + + if (!value.IsEmpty()) + { + auto output = _LoginIdentityProviderMap.Find(value); + if (output != nullptr) + return *output; + } + + return LoginIdentityProviderUnknown; // Basically critical fail +} + +PlayFab::AdminModels::FLinkedPlatformAccountModel::~FLinkedPlatformAccountModel() +{ + +} + +void PlayFab::AdminModels::FLinkedPlatformAccountModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writeLoginIdentityProviderEnumJSON(Platform, writer); } + + if (PlatformUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlatformUserId")); writer->WriteValue(PlatformUserId); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FLinkedPlatformAccountModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + Platform = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Platform"))); + + const TSharedPtr PlatformUserIdValue = obj->TryGetField(TEXT("PlatformUserId")); + if (PlatformUserIdValue.IsValid() && !PlatformUserIdValue->IsNull()) + { + FString TmpValue; + if (PlatformUserIdValue->TryGetString(TmpValue)) { PlatformUserId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FLocationModel::~FLocationModel() +{ + +} + +void PlayFab::AdminModels::FLocationModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (City.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("City")); writer->WriteValue(City); } + + if (pfContinentCode.notNull()) { writer->WriteIdentifierPrefix(TEXT("ContinentCode")); writeContinentCodeEnumJSON(pfContinentCode, writer); } + + if (pfCountryCode.notNull()) { writer->WriteIdentifierPrefix(TEXT("CountryCode")); writeCountryCodeEnumJSON(pfCountryCode, writer); } + + if (Latitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Latitude")); writer->WriteValue(Latitude); } + + if (Longitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Longitude")); writer->WriteValue(Longitude); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FLocationModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CityValue = obj->TryGetField(TEXT("City")); + if (CityValue.IsValid() && !CityValue->IsNull()) + { + FString TmpValue; + if (CityValue->TryGetString(TmpValue)) { City = TmpValue; } + } + + pfContinentCode = readContinentCodeFromValue(obj->TryGetField(TEXT("ContinentCode"))); + + pfCountryCode = readCountryCodeFromValue(obj->TryGetField(TEXT("CountryCode"))); + + const TSharedPtr LatitudeValue = obj->TryGetField(TEXT("Latitude")); + if (LatitudeValue.IsValid() && !LatitudeValue->IsNull()) + { + double TmpValue; + if (LatitudeValue->TryGetNumber(TmpValue)) { Latitude = TmpValue; } + } + + const TSharedPtr LongitudeValue = obj->TryGetField(TEXT("Longitude")); + if (LongitudeValue.IsValid() && !LongitudeValue->IsNull()) + { + double TmpValue; + if (LongitudeValue->TryGetNumber(TmpValue)) { Longitude = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeSubscriptionProviderStatusEnumJSON(SubscriptionProviderStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case SubscriptionProviderStatusNoError: writer->WriteValue(TEXT("NoError")); break; + case SubscriptionProviderStatusCancelled: writer->WriteValue(TEXT("Cancelled")); break; + case SubscriptionProviderStatusUnknownError: writer->WriteValue(TEXT("UnknownError")); break; + case SubscriptionProviderStatusBillingError: writer->WriteValue(TEXT("BillingError")); break; + case SubscriptionProviderStatusProductUnavailable: writer->WriteValue(TEXT("ProductUnavailable")); break; + case SubscriptionProviderStatusCustomerDidNotAcceptPriceChange: writer->WriteValue(TEXT("CustomerDidNotAcceptPriceChange")); break; + case SubscriptionProviderStatusFreeTrial: writer->WriteValue(TEXT("FreeTrial")); break; + case SubscriptionProviderStatusPaymentPending: writer->WriteValue(TEXT("PaymentPending")); break; + } +} + +AdminModels::SubscriptionProviderStatus PlayFab::AdminModels::readSubscriptionProviderStatusFromValue(const TSharedPtr& value) +{ + return readSubscriptionProviderStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::SubscriptionProviderStatus PlayFab::AdminModels::readSubscriptionProviderStatusFromValue(const FString& value) +{ + static TMap _SubscriptionProviderStatusMap; + if (_SubscriptionProviderStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _SubscriptionProviderStatusMap.Add(TEXT("NoError"), SubscriptionProviderStatusNoError); + _SubscriptionProviderStatusMap.Add(TEXT("Cancelled"), SubscriptionProviderStatusCancelled); + _SubscriptionProviderStatusMap.Add(TEXT("UnknownError"), SubscriptionProviderStatusUnknownError); + _SubscriptionProviderStatusMap.Add(TEXT("BillingError"), SubscriptionProviderStatusBillingError); + _SubscriptionProviderStatusMap.Add(TEXT("ProductUnavailable"), SubscriptionProviderStatusProductUnavailable); + _SubscriptionProviderStatusMap.Add(TEXT("CustomerDidNotAcceptPriceChange"), SubscriptionProviderStatusCustomerDidNotAcceptPriceChange); + _SubscriptionProviderStatusMap.Add(TEXT("FreeTrial"), SubscriptionProviderStatusFreeTrial); + _SubscriptionProviderStatusMap.Add(TEXT("PaymentPending"), SubscriptionProviderStatusPaymentPending); + + } + + if (!value.IsEmpty()) + { + auto output = _SubscriptionProviderStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return SubscriptionProviderStatusNoError; // Basically critical fail +} + +PlayFab::AdminModels::FSubscriptionModel::~FSubscriptionModel() +{ + +} + +void PlayFab::AdminModels::FSubscriptionModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); + + writer->WriteIdentifierPrefix(TEXT("InitialSubscriptionTime")); writeDatetime(InitialSubscriptionTime, writer); + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeSubscriptionProviderStatusEnumJSON(Status, writer); } + + if (SubscriptionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionId")); writer->WriteValue(SubscriptionId); } + + if (SubscriptionItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionItemId")); writer->WriteValue(SubscriptionItemId); } + + if (SubscriptionProvider.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionProvider")); writer->WriteValue(SubscriptionProvider); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSubscriptionModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr InitialSubscriptionTimeValue = obj->TryGetField(TEXT("InitialSubscriptionTime")); + if (InitialSubscriptionTimeValue.IsValid()) + InitialSubscriptionTime = readDatetime(InitialSubscriptionTimeValue); + + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + Status = readSubscriptionProviderStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr SubscriptionIdValue = obj->TryGetField(TEXT("SubscriptionId")); + if (SubscriptionIdValue.IsValid() && !SubscriptionIdValue->IsNull()) + { + FString TmpValue; + if (SubscriptionIdValue->TryGetString(TmpValue)) { SubscriptionId = TmpValue; } + } + + const TSharedPtr SubscriptionItemIdValue = obj->TryGetField(TEXT("SubscriptionItemId")); + if (SubscriptionItemIdValue.IsValid() && !SubscriptionItemIdValue->IsNull()) + { + FString TmpValue; + if (SubscriptionItemIdValue->TryGetString(TmpValue)) { SubscriptionItemId = TmpValue; } + } + + const TSharedPtr SubscriptionProviderValue = obj->TryGetField(TEXT("SubscriptionProvider")); + if (SubscriptionProviderValue.IsValid() && !SubscriptionProviderValue->IsNull()) + { + FString TmpValue; + if (SubscriptionProviderValue->TryGetString(TmpValue)) { SubscriptionProvider = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FMembershipModel::~FMembershipModel() +{ + +} + +void PlayFab::AdminModels::FMembershipModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + writer->WriteIdentifierPrefix(TEXT("MembershipExpiration")); writeDatetime(MembershipExpiration, writer); + + if (MembershipId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MembershipId")); writer->WriteValue(MembershipId); } + + if (OverrideExpiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("OverrideExpiration")); writeDatetime(OverrideExpiration, writer); } + + if (OverrideIsSet.notNull()) { writer->WriteIdentifierPrefix(TEXT("OverrideIsSet")); writer->WriteValue(OverrideIsSet); } + + if (Subscriptions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Subscriptions")); + for (const FSubscriptionModel& item : Subscriptions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FMembershipModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr MembershipExpirationValue = obj->TryGetField(TEXT("MembershipExpiration")); + if (MembershipExpirationValue.IsValid()) + MembershipExpiration = readDatetime(MembershipExpirationValue); + + + const TSharedPtr MembershipIdValue = obj->TryGetField(TEXT("MembershipId")); + if (MembershipIdValue.IsValid() && !MembershipIdValue->IsNull()) + { + FString TmpValue; + if (MembershipIdValue->TryGetString(TmpValue)) { MembershipId = TmpValue; } + } + + const TSharedPtr OverrideExpirationValue = obj->TryGetField(TEXT("OverrideExpiration")); + if (OverrideExpirationValue.IsValid()) + OverrideExpiration = readDatetime(OverrideExpirationValue); + + + const TSharedPtr OverrideIsSetValue = obj->TryGetField(TEXT("OverrideIsSet")); + if (OverrideIsSetValue.IsValid() && !OverrideIsSetValue->IsNull()) + { + bool TmpValue; + if (OverrideIsSetValue->TryGetBool(TmpValue)) { OverrideIsSet = TmpValue; } + } + + const TArray>&SubscriptionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Subscriptions")); + for (int32 Idx = 0; Idx < SubscriptionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SubscriptionsArray[Idx]; + Subscriptions.Add(FSubscriptionModel(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::AdminModels::writePushNotificationPlatformEnumJSON(PushNotificationPlatform enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case PushNotificationPlatformApplePushNotificationService: writer->WriteValue(TEXT("ApplePushNotificationService")); break; + case PushNotificationPlatformGoogleCloudMessaging: writer->WriteValue(TEXT("GoogleCloudMessaging")); break; + } +} + +AdminModels::PushNotificationPlatform PlayFab::AdminModels::readPushNotificationPlatformFromValue(const TSharedPtr& value) +{ + return readPushNotificationPlatformFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::PushNotificationPlatform PlayFab::AdminModels::readPushNotificationPlatformFromValue(const FString& value) +{ + static TMap _PushNotificationPlatformMap; + if (_PushNotificationPlatformMap.Num() == 0) + { + // Auto-generate the map on the first use + _PushNotificationPlatformMap.Add(TEXT("ApplePushNotificationService"), PushNotificationPlatformApplePushNotificationService); + _PushNotificationPlatformMap.Add(TEXT("GoogleCloudMessaging"), PushNotificationPlatformGoogleCloudMessaging); + + } + + if (!value.IsEmpty()) + { + auto output = _PushNotificationPlatformMap.Find(value); + if (output != nullptr) + return *output; + } + + return PushNotificationPlatformApplePushNotificationService; // Basically critical fail +} + +PlayFab::AdminModels::FPushNotificationRegistrationModel::~FPushNotificationRegistrationModel() +{ + +} + +void PlayFab::AdminModels::FPushNotificationRegistrationModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NotificationEndpointARN.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NotificationEndpointARN")); writer->WriteValue(NotificationEndpointARN); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writePushNotificationPlatformEnumJSON(Platform, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPushNotificationRegistrationModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NotificationEndpointARNValue = obj->TryGetField(TEXT("NotificationEndpointARN")); + if (NotificationEndpointARNValue.IsValid() && !NotificationEndpointARNValue->IsNull()) + { + FString TmpValue; + if (NotificationEndpointARNValue->TryGetString(TmpValue)) { NotificationEndpointARN = TmpValue; } + } + + Platform = readPushNotificationPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FStatisticModel::~FStatisticModel() +{ + +} + +void PlayFab::AdminModels::FStatisticModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FStatisticModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FTagModel::~FTagModel() +{ + +} + +void PlayFab::AdminModels::FTagModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TagValue.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TagValue")); writer->WriteValue(TagValue); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FTagModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TagValueValue = obj->TryGetField(TEXT("TagValue")); + if (TagValueValue.IsValid() && !TagValueValue->IsNull()) + { + FString TmpValue; + if (TagValueValue->TryGetString(TmpValue)) { TagValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FValueToDateModel::~FValueToDateModel() +{ + +} + +void PlayFab::AdminModels::FValueToDateModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Currency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Currency")); writer->WriteValue(Currency); } + + writer->WriteIdentifierPrefix(TEXT("TotalValue")); writer->WriteValue(static_cast(TotalValue)); + + if (TotalValueAsDecimal.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TotalValueAsDecimal")); writer->WriteValue(TotalValueAsDecimal); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FValueToDateModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyValue = obj->TryGetField(TEXT("Currency")); + if (CurrencyValue.IsValid() && !CurrencyValue->IsNull()) + { + FString TmpValue; + if (CurrencyValue->TryGetString(TmpValue)) { Currency = TmpValue; } + } + + const TSharedPtr TotalValueValue = obj->TryGetField(TEXT("TotalValue")); + if (TotalValueValue.IsValid() && !TotalValueValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueValue->TryGetNumber(TmpValue)) { TotalValue = TmpValue; } + } + + const TSharedPtr TotalValueAsDecimalValue = obj->TryGetField(TEXT("TotalValueAsDecimal")); + if (TotalValueAsDecimalValue.IsValid() && !TotalValueAsDecimalValue->IsNull()) + { + FString TmpValue; + if (TotalValueAsDecimalValue->TryGetString(TmpValue)) { TotalValueAsDecimal = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerProfileModel::~FPlayerProfileModel() +{ + +} + +void PlayFab::AdminModels::FPlayerProfileModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdCampaignAttributions.Num() != 0) + { + writer->WriteArrayStart(TEXT("AdCampaignAttributions")); + for (const FAdCampaignAttributionModel& item : AdCampaignAttributions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + if (BannedUntil.notNull()) { writer->WriteIdentifierPrefix(TEXT("BannedUntil")); writeDatetime(BannedUntil, writer); } + + if (ContactEmailAddresses.Num() != 0) + { + writer->WriteArrayStart(TEXT("ContactEmailAddresses")); + for (const FContactEmailInfoModel& item : ContactEmailAddresses) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (LinkedAccounts.Num() != 0) + { + writer->WriteArrayStart(TEXT("LinkedAccounts")); + for (const FLinkedPlatformAccountModel& item : LinkedAccounts) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Locations.Num() != 0) + { + writer->WriteArrayStart(TEXT("Locations")); + for (const FLocationModel& item : Locations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Memberships.Num() != 0) + { + writer->WriteArrayStart(TEXT("Memberships")); + for (const FMembershipModel& item : Memberships) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeLoginIdentityProviderEnumJSON(Origination, writer); } + + if (PlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerId")); writer->WriteValue(PlayerId); } + + if (PublisherId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PublisherId")); writer->WriteValue(PublisherId); } + + if (PushNotificationRegistrations.Num() != 0) + { + writer->WriteArrayStart(TEXT("PushNotificationRegistrations")); + for (const FPushNotificationRegistrationModel& item : PushNotificationRegistrations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Statistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticModel& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FTagModel& item : Tags) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + if (TotalValueToDateInUSD.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalValueToDateInUSD")); writer->WriteValue(static_cast(TotalValueToDateInUSD)); } + + if (ValuesToDate.Num() != 0) + { + writer->WriteArrayStart(TEXT("ValuesToDate")); + for (const FValueToDateModel& item : ValuesToDate) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerProfileModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AdCampaignAttributionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AdCampaignAttributions")); + for (int32 Idx = 0; Idx < AdCampaignAttributionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AdCampaignAttributionsArray[Idx]; + AdCampaignAttributions.Add(FAdCampaignAttributionModel(CurrentItem->AsObject())); + } + + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr BannedUntilValue = obj->TryGetField(TEXT("BannedUntil")); + if (BannedUntilValue.IsValid()) + BannedUntil = readDatetime(BannedUntilValue); + + + const TArray>&ContactEmailAddressesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ContactEmailAddresses")); + for (int32 Idx = 0; Idx < ContactEmailAddressesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContactEmailAddressesArray[Idx]; + ContactEmailAddresses.Add(FContactEmailInfoModel(CurrentItem->AsObject())); + } + + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + const TArray>&LinkedAccountsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("LinkedAccounts")); + for (int32 Idx = 0; Idx < LinkedAccountsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LinkedAccountsArray[Idx]; + LinkedAccounts.Add(FLinkedPlatformAccountModel(CurrentItem->AsObject())); + } + + + const TArray>&LocationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Locations")); + for (int32 Idx = 0; Idx < LocationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LocationsArray[Idx]; + Locations.Add(FLocationModel(CurrentItem->AsObject())); + } + + + const TArray>&MembershipsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Memberships")); + for (int32 Idx = 0; Idx < MembershipsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembershipsArray[Idx]; + Memberships.Add(FMembershipModel(CurrentItem->AsObject())); + } + + + Origination = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr PlayerIdValue = obj->TryGetField(TEXT("PlayerId")); + if (PlayerIdValue.IsValid() && !PlayerIdValue->IsNull()) + { + FString TmpValue; + if (PlayerIdValue->TryGetString(TmpValue)) { PlayerId = TmpValue; } + } + + const TSharedPtr PublisherIdValue = obj->TryGetField(TEXT("PublisherId")); + if (PublisherIdValue.IsValid() && !PublisherIdValue->IsNull()) + { + FString TmpValue; + if (PublisherIdValue->TryGetString(TmpValue)) { PublisherId = TmpValue; } + } + + const TArray>&PushNotificationRegistrationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PushNotificationRegistrations")); + for (int32 Idx = 0; Idx < PushNotificationRegistrationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PushNotificationRegistrationsArray[Idx]; + PushNotificationRegistrations.Add(FPushNotificationRegistrationModel(CurrentItem->AsObject())); + } + + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticModel(CurrentItem->AsObject())); + } + + + const TArray>&TagsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Tags")); + for (int32 Idx = 0; Idx < TagsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = TagsArray[Idx]; + Tags.Add(FTagModel(CurrentItem->AsObject())); + } + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr TotalValueToDateInUSDValue = obj->TryGetField(TEXT("TotalValueToDateInUSD")); + if (TotalValueToDateInUSDValue.IsValid() && !TotalValueToDateInUSDValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueToDateInUSDValue->TryGetNumber(TmpValue)) { TotalValueToDateInUSD = TmpValue; } + } + + const TArray>&ValuesToDateArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ValuesToDate")); + for (int32 Idx = 0; Idx < ValuesToDateArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ValuesToDateArray[Idx]; + ValuesToDate.Add(FValueToDateModel(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerProfileResult::~FGetPlayerProfileResult() +{ + //if (PlayerProfile != nullptr) delete PlayerProfile; + +} + +void PlayFab::AdminModels::FGetPlayerProfileResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayerProfile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PlayerProfile")); PlayerProfile->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerProfileResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayerProfileValue = obj->TryGetField(TEXT("PlayerProfile")); + if (PlayerProfileValue.IsValid() && !PlayerProfileValue->IsNull()) + { + PlayerProfile = MakeShareable(new FPlayerProfileModel(PlayerProfileValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerSegmentsResult::~FGetPlayerSegmentsResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayerSegmentsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Segments.Num() != 0) + { + writer->WriteArrayStart(TEXT("Segments")); + for (const FGetSegmentResult& item : Segments) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerSegmentsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SegmentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Segments")); + for (int32 Idx = 0; Idx < SegmentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SegmentsArray[Idx]; + Segments.Add(FGetSegmentResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerSharedSecretsRequest::~FGetPlayerSharedSecretsRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayerSharedSecretsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerSharedSecretsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FSharedSecret::~FSharedSecret() +{ + +} + +void PlayFab::AdminModels::FSharedSecret::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Disabled")); writer->WriteValue(Disabled); + + if (FriendlyName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendlyName")); writer->WriteValue(FriendlyName); } + + if (SecretKey.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SecretKey")); writer->WriteValue(SecretKey); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSharedSecret::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisabledValue = obj->TryGetField(TEXT("Disabled")); + if (DisabledValue.IsValid() && !DisabledValue->IsNull()) + { + bool TmpValue; + if (DisabledValue->TryGetBool(TmpValue)) { Disabled = TmpValue; } + } + + const TSharedPtr FriendlyNameValue = obj->TryGetField(TEXT("FriendlyName")); + if (FriendlyNameValue.IsValid() && !FriendlyNameValue->IsNull()) + { + FString TmpValue; + if (FriendlyNameValue->TryGetString(TmpValue)) { FriendlyName = TmpValue; } + } + + const TSharedPtr SecretKeyValue = obj->TryGetField(TEXT("SecretKey")); + if (SecretKeyValue.IsValid() && !SecretKeyValue->IsNull()) + { + FString TmpValue; + if (SecretKeyValue->TryGetString(TmpValue)) { SecretKey = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerSharedSecretsResult::~FGetPlayerSharedSecretsResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayerSharedSecretsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SharedSecrets.Num() != 0) + { + writer->WriteArrayStart(TEXT("SharedSecrets")); + for (const FSharedSecret& item : SharedSecrets) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerSharedSecretsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SharedSecretsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("SharedSecrets")); + for (int32 Idx = 0; Idx < SharedSecretsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SharedSecretsArray[Idx]; + SharedSecrets.Add(FSharedSecret(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayersInSegmentRequest::~FGetPlayersInSegmentRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayersInSegmentRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ContinuationToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ContinuationToken")); writer->WriteValue(ContinuationToken); } + + if (MaxBatchSize.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxBatchSize")); writer->WriteValue(static_cast(MaxBatchSize)); } + + if (SecondsToLive.notNull()) { writer->WriteIdentifierPrefix(TEXT("SecondsToLive")); writer->WriteValue(static_cast(SecondsToLive)); } + + writer->WriteIdentifierPrefix(TEXT("SegmentId")); writer->WriteValue(SegmentId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayersInSegmentRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ContinuationTokenValue = obj->TryGetField(TEXT("ContinuationToken")); + if (ContinuationTokenValue.IsValid() && !ContinuationTokenValue->IsNull()) + { + FString TmpValue; + if (ContinuationTokenValue->TryGetString(TmpValue)) { ContinuationToken = TmpValue; } + } + + const TSharedPtr MaxBatchSizeValue = obj->TryGetField(TEXT("MaxBatchSize")); + if (MaxBatchSizeValue.IsValid() && !MaxBatchSizeValue->IsNull()) + { + uint32 TmpValue; + if (MaxBatchSizeValue->TryGetNumber(TmpValue)) { MaxBatchSize = TmpValue; } + } + + const TSharedPtr SecondsToLiveValue = obj->TryGetField(TEXT("SecondsToLive")); + if (SecondsToLiveValue.IsValid() && !SecondsToLiveValue->IsNull()) + { + uint32 TmpValue; + if (SecondsToLiveValue->TryGetNumber(TmpValue)) { SecondsToLive = TmpValue; } + } + + const TSharedPtr SegmentIdValue = obj->TryGetField(TEXT("SegmentId")); + if (SegmentIdValue.IsValid() && !SegmentIdValue->IsNull()) + { + FString TmpValue; + if (SegmentIdValue->TryGetString(TmpValue)) { SegmentId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerLinkedAccount::~FPlayerLinkedAccount() +{ + +} + +void PlayFab::AdminModels::FPlayerLinkedAccount::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writeLoginIdentityProviderEnumJSON(Platform, writer); } + + if (PlatformUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlatformUserId")); writer->WriteValue(PlatformUserId); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerLinkedAccount::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + Platform = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Platform"))); + + const TSharedPtr PlatformUserIdValue = obj->TryGetField(TEXT("PlatformUserId")); + if (PlatformUserIdValue.IsValid() && !PlatformUserIdValue->IsNull()) + { + FString TmpValue; + if (PlatformUserIdValue->TryGetString(TmpValue)) { PlatformUserId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerLocation::~FPlayerLocation() +{ + +} + +void PlayFab::AdminModels::FPlayerLocation::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (City.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("City")); writer->WriteValue(City); } + + writer->WriteIdentifierPrefix(TEXT("ContinentCode")); writeContinentCodeEnumJSON(pfContinentCode, writer); + + writer->WriteIdentifierPrefix(TEXT("CountryCode")); writeCountryCodeEnumJSON(pfCountryCode, writer); + + if (Latitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Latitude")); writer->WriteValue(Latitude); } + + if (Longitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Longitude")); writer->WriteValue(Longitude); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerLocation::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CityValue = obj->TryGetField(TEXT("City")); + if (CityValue.IsValid() && !CityValue->IsNull()) + { + FString TmpValue; + if (CityValue->TryGetString(TmpValue)) { City = TmpValue; } + } + + pfContinentCode = readContinentCodeFromValue(obj->TryGetField(TEXT("ContinentCode"))); + + pfCountryCode = readCountryCodeFromValue(obj->TryGetField(TEXT("CountryCode"))); + + const TSharedPtr LatitudeValue = obj->TryGetField(TEXT("Latitude")); + if (LatitudeValue.IsValid() && !LatitudeValue->IsNull()) + { + double TmpValue; + if (LatitudeValue->TryGetNumber(TmpValue)) { Latitude = TmpValue; } + } + + const TSharedPtr LongitudeValue = obj->TryGetField(TEXT("Longitude")); + if (LongitudeValue.IsValid() && !LongitudeValue->IsNull()) + { + double TmpValue; + if (LongitudeValue->TryGetNumber(TmpValue)) { Longitude = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerStatistic::~FPlayerStatistic() +{ + +} + +void PlayFab::AdminModels::FPlayerStatistic::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Id.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteIdentifierPrefix(TEXT("StatisticValue")); writer->WriteValue(StatisticValue); + + writer->WriteIdentifierPrefix(TEXT("StatisticVersion")); writer->WriteValue(StatisticVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerStatistic::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr StatisticValueValue = obj->TryGetField(TEXT("StatisticValue")); + if (StatisticValueValue.IsValid() && !StatisticValueValue->IsNull()) + { + int32 TmpValue; + if (StatisticValueValue->TryGetNumber(TmpValue)) { StatisticValue = TmpValue; } + } + + const TSharedPtr StatisticVersionValue = obj->TryGetField(TEXT("StatisticVersion")); + if (StatisticVersionValue.IsValid() && !StatisticVersionValue->IsNull()) + { + int32 TmpValue; + if (StatisticVersionValue->TryGetNumber(TmpValue)) { StatisticVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPushNotificationRegistration::~FPushNotificationRegistration() +{ + +} + +void PlayFab::AdminModels::FPushNotificationRegistration::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NotificationEndpointARN.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NotificationEndpointARN")); writer->WriteValue(NotificationEndpointARN); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writePushNotificationPlatformEnumJSON(Platform, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPushNotificationRegistration::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NotificationEndpointARNValue = obj->TryGetField(TEXT("NotificationEndpointARN")); + if (NotificationEndpointARNValue.IsValid() && !NotificationEndpointARNValue->IsNull()) + { + FString TmpValue; + if (NotificationEndpointARNValue->TryGetString(TmpValue)) { NotificationEndpointARN = TmpValue; } + } + + Platform = readPushNotificationPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FPlayerProfile::~FPlayerProfile() +{ + +} + +void PlayFab::AdminModels::FPlayerProfile::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdCampaignAttributions.Num() != 0) + { + writer->WriteArrayStart(TEXT("AdCampaignAttributions")); + for (const FAdCampaignAttribution& item : AdCampaignAttributions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + if (BannedUntil.notNull()) { writer->WriteIdentifierPrefix(TEXT("BannedUntil")); writeDatetime(BannedUntil, writer); } + + if (ContactEmailAddresses.Num() != 0) + { + writer->WriteArrayStart(TEXT("ContactEmailAddresses")); + for (const FContactEmailInfo& item : ContactEmailAddresses) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (LinkedAccounts.Num() != 0) + { + writer->WriteArrayStart(TEXT("LinkedAccounts")); + for (const FPlayerLinkedAccount& item : LinkedAccounts) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Locations.Num() != 0) + { + writer->WriteObjectStart(TEXT("Locations")); + for (TMap::TConstIterator It(Locations); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeLoginIdentityProviderEnumJSON(Origination, writer); } + + if (PlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerId")); writer->WriteValue(PlayerId); } + + if (PlayerStatistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerStatistics")); + for (const FPlayerStatistic& item : PlayerStatistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PublisherId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PublisherId")); writer->WriteValue(PublisherId); } + + if (PushNotificationRegistrations.Num() != 0) + { + writer->WriteArrayStart(TEXT("PushNotificationRegistrations")); + for (const FPushNotificationRegistration& item : PushNotificationRegistrations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Statistics.Num() != 0) + { + writer->WriteObjectStart(TEXT("Statistics")); + for (TMap::TConstIterator It(Statistics); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + if (TotalValueToDateInUSD.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalValueToDateInUSD")); writer->WriteValue(static_cast(TotalValueToDateInUSD)); } + + if (ValuesToDate.Num() != 0) + { + writer->WriteObjectStart(TEXT("ValuesToDate")); + for (TMap::TConstIterator It(ValuesToDate); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyBalances.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyBalances")); + for (TMap::TConstIterator It(VirtualCurrencyBalances); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerProfile::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AdCampaignAttributionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AdCampaignAttributions")); + for (int32 Idx = 0; Idx < AdCampaignAttributionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AdCampaignAttributionsArray[Idx]; + AdCampaignAttributions.Add(FAdCampaignAttribution(CurrentItem->AsObject())); + } + + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr BannedUntilValue = obj->TryGetField(TEXT("BannedUntil")); + if (BannedUntilValue.IsValid()) + BannedUntil = readDatetime(BannedUntilValue); + + + const TArray>&ContactEmailAddressesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ContactEmailAddresses")); + for (int32 Idx = 0; Idx < ContactEmailAddressesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContactEmailAddressesArray[Idx]; + ContactEmailAddresses.Add(FContactEmailInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + const TArray>&LinkedAccountsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("LinkedAccounts")); + for (int32 Idx = 0; Idx < LinkedAccountsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LinkedAccountsArray[Idx]; + LinkedAccounts.Add(FPlayerLinkedAccount(CurrentItem->AsObject())); + } + + + const TSharedPtr* LocationsObject; + if (obj->TryGetObjectField(TEXT("Locations"), LocationsObject)) + { + for (TMap>::TConstIterator It((*LocationsObject)->Values); It; ++It) + { + Locations.Add(It.Key(), FPlayerLocation(It.Value()->AsObject())); + } + } + + Origination = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr PlayerIdValue = obj->TryGetField(TEXT("PlayerId")); + if (PlayerIdValue.IsValid() && !PlayerIdValue->IsNull()) + { + FString TmpValue; + if (PlayerIdValue->TryGetString(TmpValue)) { PlayerId = TmpValue; } + } + + const TArray>&PlayerStatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PlayerStatistics")); + for (int32 Idx = 0; Idx < PlayerStatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PlayerStatisticsArray[Idx]; + PlayerStatistics.Add(FPlayerStatistic(CurrentItem->AsObject())); + } + + + const TSharedPtr PublisherIdValue = obj->TryGetField(TEXT("PublisherId")); + if (PublisherIdValue.IsValid() && !PublisherIdValue->IsNull()) + { + FString TmpValue; + if (PublisherIdValue->TryGetString(TmpValue)) { PublisherId = TmpValue; } + } + + const TArray>&PushNotificationRegistrationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PushNotificationRegistrations")); + for (int32 Idx = 0; Idx < PushNotificationRegistrationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PushNotificationRegistrationsArray[Idx]; + PushNotificationRegistrations.Add(FPushNotificationRegistration(CurrentItem->AsObject())); + } + + + const TSharedPtr* StatisticsObject; + if (obj->TryGetObjectField(TEXT("Statistics"), StatisticsObject)) + { + for (TMap>::TConstIterator It((*StatisticsObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + Statistics.Add(It.Key(), TmpValue); + } + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr TotalValueToDateInUSDValue = obj->TryGetField(TEXT("TotalValueToDateInUSD")); + if (TotalValueToDateInUSDValue.IsValid() && !TotalValueToDateInUSDValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueToDateInUSDValue->TryGetNumber(TmpValue)) { TotalValueToDateInUSD = TmpValue; } + } + + const TSharedPtr* ValuesToDateObject; + if (obj->TryGetObjectField(TEXT("ValuesToDate"), ValuesToDateObject)) + { + for (TMap>::TConstIterator It((*ValuesToDateObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + ValuesToDate.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyBalancesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyBalances"), VirtualCurrencyBalancesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyBalancesObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyBalances.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayersInSegmentResult::~FGetPlayersInSegmentResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayersInSegmentResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ContinuationToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ContinuationToken")); writer->WriteValue(ContinuationToken); } + + if (PlayerProfiles.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerProfiles")); + for (const FPlayerProfile& item : PlayerProfiles) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("ProfilesInSegment")); writer->WriteValue(ProfilesInSegment); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayersInSegmentResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ContinuationTokenValue = obj->TryGetField(TEXT("ContinuationToken")); + if (ContinuationTokenValue.IsValid() && !ContinuationTokenValue->IsNull()) + { + FString TmpValue; + if (ContinuationTokenValue->TryGetString(TmpValue)) { ContinuationToken = TmpValue; } + } + + const TArray>&PlayerProfilesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PlayerProfiles")); + for (int32 Idx = 0; Idx < PlayerProfilesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PlayerProfilesArray[Idx]; + PlayerProfiles.Add(FPlayerProfile(CurrentItem->AsObject())); + } + + + const TSharedPtr ProfilesInSegmentValue = obj->TryGetField(TEXT("ProfilesInSegment")); + if (ProfilesInSegmentValue.IsValid() && !ProfilesInSegmentValue->IsNull()) + { + int32 TmpValue; + if (ProfilesInSegmentValue->TryGetNumber(TmpValue)) { ProfilesInSegment = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayersSegmentsRequest::~FGetPlayersSegmentsRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayersSegmentsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayersSegmentsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerStatisticDefinitionsRequest::~FGetPlayerStatisticDefinitionsRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayerStatisticDefinitionsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerStatisticDefinitionsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerStatisticDefinitionsResult::~FGetPlayerStatisticDefinitionsResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayerStatisticDefinitionsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Statistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statistics")); + for (const FPlayerStatisticDefinition& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerStatisticDefinitionsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FPlayerStatisticDefinition(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerStatisticVersionsRequest::~FGetPlayerStatisticVersionsRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayerStatisticVersionsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerStatisticVersionsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeStatisticVersionStatusEnumJSON(StatisticVersionStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case StatisticVersionStatusActive: writer->WriteValue(TEXT("Active")); break; + case StatisticVersionStatusSnapshotPending: writer->WriteValue(TEXT("SnapshotPending")); break; + case StatisticVersionStatusSnapshot: writer->WriteValue(TEXT("Snapshot")); break; + case StatisticVersionStatusArchivalPending: writer->WriteValue(TEXT("ArchivalPending")); break; + case StatisticVersionStatusArchived: writer->WriteValue(TEXT("Archived")); break; + } +} + +AdminModels::StatisticVersionStatus PlayFab::AdminModels::readStatisticVersionStatusFromValue(const TSharedPtr& value) +{ + return readStatisticVersionStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::StatisticVersionStatus PlayFab::AdminModels::readStatisticVersionStatusFromValue(const FString& value) +{ + static TMap _StatisticVersionStatusMap; + if (_StatisticVersionStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _StatisticVersionStatusMap.Add(TEXT("Active"), StatisticVersionStatusActive); + _StatisticVersionStatusMap.Add(TEXT("SnapshotPending"), StatisticVersionStatusSnapshotPending); + _StatisticVersionStatusMap.Add(TEXT("Snapshot"), StatisticVersionStatusSnapshot); + _StatisticVersionStatusMap.Add(TEXT("ArchivalPending"), StatisticVersionStatusArchivalPending); + _StatisticVersionStatusMap.Add(TEXT("Archived"), StatisticVersionStatusArchived); + + } + + if (!value.IsEmpty()) + { + auto output = _StatisticVersionStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return StatisticVersionStatusActive; // Basically critical fail +} + +PlayFab::AdminModels::FPlayerStatisticVersion::~FPlayerStatisticVersion() +{ + +} + +void PlayFab::AdminModels::FPlayerStatisticVersion::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ActivationTime")); writeDatetime(ActivationTime, writer); + + if (ArchiveDownloadUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ArchiveDownloadUrl")); writer->WriteValue(ArchiveDownloadUrl); } + + if (DeactivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("DeactivationTime")); writeDatetime(DeactivationTime, writer); } + + if (ScheduledActivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("ScheduledActivationTime")); writeDatetime(ScheduledActivationTime, writer); } + + if (ScheduledDeactivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("ScheduledDeactivationTime")); writeDatetime(ScheduledDeactivationTime, writer); } + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeStatisticVersionStatusEnumJSON(Status, writer); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPlayerStatisticVersion::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActivationTimeValue = obj->TryGetField(TEXT("ActivationTime")); + if (ActivationTimeValue.IsValid()) + ActivationTime = readDatetime(ActivationTimeValue); + + + const TSharedPtr ArchiveDownloadUrlValue = obj->TryGetField(TEXT("ArchiveDownloadUrl")); + if (ArchiveDownloadUrlValue.IsValid() && !ArchiveDownloadUrlValue->IsNull()) + { + FString TmpValue; + if (ArchiveDownloadUrlValue->TryGetString(TmpValue)) { ArchiveDownloadUrl = TmpValue; } + } + + const TSharedPtr DeactivationTimeValue = obj->TryGetField(TEXT("DeactivationTime")); + if (DeactivationTimeValue.IsValid()) + DeactivationTime = readDatetime(DeactivationTimeValue); + + + const TSharedPtr ScheduledActivationTimeValue = obj->TryGetField(TEXT("ScheduledActivationTime")); + if (ScheduledActivationTimeValue.IsValid()) + ScheduledActivationTime = readDatetime(ScheduledActivationTimeValue); + + + const TSharedPtr ScheduledDeactivationTimeValue = obj->TryGetField(TEXT("ScheduledDeactivationTime")); + if (ScheduledDeactivationTimeValue.IsValid()) + ScheduledDeactivationTime = readDatetime(ScheduledDeactivationTimeValue); + + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + Status = readStatisticVersionStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerStatisticVersionsResult::~FGetPlayerStatisticVersionsResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayerStatisticVersionsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticVersions.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticVersions")); + for (const FPlayerStatisticVersion& item : StatisticVersions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerStatisticVersionsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&StatisticVersionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("StatisticVersions")); + for (int32 Idx = 0; Idx < StatisticVersionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticVersionsArray[Idx]; + StatisticVersions.Add(FPlayerStatisticVersion(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerTagsRequest::~FGetPlayerTagsRequest() +{ + +} + +void PlayFab::AdminModels::FGetPlayerTagsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Namespace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Namespace")); writer->WriteValue(Namespace); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerTagsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NamespaceValue = obj->TryGetField(TEXT("Namespace")); + if (NamespaceValue.IsValid() && !NamespaceValue->IsNull()) + { + FString TmpValue; + if (NamespaceValue->TryGetString(TmpValue)) { Namespace = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPlayerTagsResult::~FGetPlayerTagsResult() +{ + +} + +void PlayFab::AdminModels::FGetPlayerTagsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPlayerTagsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPolicyRequest::~FGetPolicyRequest() +{ + +} + +void PlayFab::AdminModels::FGetPolicyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PolicyName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PolicyName")); writer->WriteValue(PolicyName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPolicyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PolicyNameValue = obj->TryGetField(TEXT("PolicyName")); + if (PolicyNameValue.IsValid() && !PolicyNameValue->IsNull()) + { + FString TmpValue; + if (PolicyNameValue->TryGetString(TmpValue)) { PolicyName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FPermissionStatement::~FPermissionStatement() +{ + //if (ApiConditions != nullptr) delete ApiConditions; + +} + +void PlayFab::AdminModels::FPermissionStatement::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Action")); writer->WriteValue(Action); + + if (ApiConditions.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ApiConditions")); ApiConditions->writeJSON(writer); } + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + writer->WriteIdentifierPrefix(TEXT("Effect")); writeEffectTypeEnumJSON(Effect, writer); + + writer->WriteIdentifierPrefix(TEXT("Principal")); writer->WriteValue(Principal); + + writer->WriteIdentifierPrefix(TEXT("Resource")); writer->WriteValue(Resource); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FPermissionStatement::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActionValue = obj->TryGetField(TEXT("Action")); + if (ActionValue.IsValid() && !ActionValue->IsNull()) + { + FString TmpValue; + if (ActionValue->TryGetString(TmpValue)) { Action = TmpValue; } + } + + const TSharedPtr ApiConditionsValue = obj->TryGetField(TEXT("ApiConditions")); + if (ApiConditionsValue.IsValid() && !ApiConditionsValue->IsNull()) + { + ApiConditions = MakeShareable(new FApiCondition(ApiConditionsValue->AsObject())); + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + Effect = readEffectTypeFromValue(obj->TryGetField(TEXT("Effect"))); + + const TSharedPtr PrincipalValue = obj->TryGetField(TEXT("Principal")); + if (PrincipalValue.IsValid() && !PrincipalValue->IsNull()) + { + FString TmpValue; + if (PrincipalValue->TryGetString(TmpValue)) { Principal = TmpValue; } + } + + const TSharedPtr ResourceValue = obj->TryGetField(TEXT("Resource")); + if (ResourceValue.IsValid() && !ResourceValue->IsNull()) + { + FString TmpValue; + if (ResourceValue->TryGetString(TmpValue)) { Resource = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPolicyResponse::~FGetPolicyResponse() +{ + +} + +void PlayFab::AdminModels::FGetPolicyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PolicyName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PolicyName")); writer->WriteValue(PolicyName); } + + if (Statements.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statements")); + for (const FPermissionStatement& item : Statements) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPolicyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PolicyNameValue = obj->TryGetField(TEXT("PolicyName")); + if (PolicyNameValue.IsValid() && !PolicyNameValue->IsNull()) + { + FString TmpValue; + if (PolicyNameValue->TryGetString(TmpValue)) { PolicyName = TmpValue; } + } + + const TArray>&StatementsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statements")); + for (int32 Idx = 0; Idx < StatementsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatementsArray[Idx]; + Statements.Add(FPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPublisherDataRequest::~FGetPublisherDataRequest() +{ + +} + +void PlayFab::AdminModels::FGetPublisherDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPublisherDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetPublisherDataResult::~FGetPublisherDataResult() +{ + +} + +void PlayFab::AdminModels::FGetPublisherDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetPublisherDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetRandomResultTablesRequest::~FGetRandomResultTablesRequest() +{ + +} + +void PlayFab::AdminModels::FGetRandomResultTablesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetRandomResultTablesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeResultTableNodeTypeEnumJSON(ResultTableNodeType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ResultTableNodeTypeItemId: writer->WriteValue(TEXT("ItemId")); break; + case ResultTableNodeTypeTableId: writer->WriteValue(TEXT("TableId")); break; + } +} + +AdminModels::ResultTableNodeType PlayFab::AdminModels::readResultTableNodeTypeFromValue(const TSharedPtr& value) +{ + return readResultTableNodeTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::ResultTableNodeType PlayFab::AdminModels::readResultTableNodeTypeFromValue(const FString& value) +{ + static TMap _ResultTableNodeTypeMap; + if (_ResultTableNodeTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ResultTableNodeTypeMap.Add(TEXT("ItemId"), ResultTableNodeTypeItemId); + _ResultTableNodeTypeMap.Add(TEXT("TableId"), ResultTableNodeTypeTableId); + + } + + if (!value.IsEmpty()) + { + auto output = _ResultTableNodeTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ResultTableNodeTypeItemId; // Basically critical fail +} + +PlayFab::AdminModels::FResultTableNode::~FResultTableNode() +{ + +} + +void PlayFab::AdminModels::FResultTableNode::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ResultItem")); writer->WriteValue(ResultItem); + + writer->WriteIdentifierPrefix(TEXT("ResultItemType")); writeResultTableNodeTypeEnumJSON(ResultItemType, writer); + + writer->WriteIdentifierPrefix(TEXT("Weight")); writer->WriteValue(Weight); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResultTableNode::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ResultItemValue = obj->TryGetField(TEXT("ResultItem")); + if (ResultItemValue.IsValid() && !ResultItemValue->IsNull()) + { + FString TmpValue; + if (ResultItemValue->TryGetString(TmpValue)) { ResultItem = TmpValue; } + } + + ResultItemType = readResultTableNodeTypeFromValue(obj->TryGetField(TEXT("ResultItemType"))); + + const TSharedPtr WeightValue = obj->TryGetField(TEXT("Weight")); + if (WeightValue.IsValid() && !WeightValue->IsNull()) + { + int32 TmpValue; + if (WeightValue->TryGetNumber(TmpValue)) { Weight = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRandomResultTableListing::~FRandomResultTableListing() +{ + +} + +void PlayFab::AdminModels::FRandomResultTableListing::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("Nodes")); + for (const FResultTableNode& item : Nodes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("TableId")); writer->WriteValue(TableId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRandomResultTableListing::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TArray>&NodesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Nodes")); + for (int32 Idx = 0; Idx < NodesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = NodesArray[Idx]; + Nodes.Add(FResultTableNode(CurrentItem->AsObject())); + } + + + const TSharedPtr TableIdValue = obj->TryGetField(TEXT("TableId")); + if (TableIdValue.IsValid() && !TableIdValue->IsNull()) + { + FString TmpValue; + if (TableIdValue->TryGetString(TmpValue)) { TableId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetRandomResultTablesResult::~FGetRandomResultTablesResult() +{ + +} + +void PlayFab::AdminModels::FGetRandomResultTablesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Tables.Num() != 0) + { + writer->WriteObjectStart(TEXT("Tables")); + for (TMap::TConstIterator It(Tables); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetRandomResultTablesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* TablesObject; + if (obj->TryGetObjectField(TEXT("Tables"), TablesObject)) + { + for (TMap>::TConstIterator It((*TablesObject)->Values); It; ++It) + { + Tables.Add(It.Key(), FRandomResultTableListing(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetServerBuildInfoRequest::~FGetServerBuildInfoRequest() +{ + +} + +void PlayFab::AdminModels::FGetServerBuildInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetServerBuildInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetServerBuildInfoResult::~FGetServerBuildInfoResult() +{ + +} + +void PlayFab::AdminModels::FGetServerBuildInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ActiveRegions.Num() != 0) + { + writer->WriteArrayStart(TEXT("ActiveRegions")); + for (const Region& item : ActiveRegions) + writeRegionEnumJSON(item, writer); + writer->WriteArrayEnd(); + } + + + if (BuildId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); } + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + if (ErrorMessage.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ErrorMessage")); writer->WriteValue(ErrorMessage); } + + writer->WriteIdentifierPrefix(TEXT("MaxGamesPerHost")); writer->WriteValue(MaxGamesPerHost); + + writer->WriteIdentifierPrefix(TEXT("MinFreeGameSlots")); writer->WriteValue(MinFreeGameSlots); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeGameBuildStatusEnumJSON(Status, writer); } + + writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetServerBuildInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ActiveRegionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ActiveRegions")); + for (int32 Idx = 0; Idx < ActiveRegionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ActiveRegionsArray[Idx]; + ActiveRegions.Add(readRegionFromValue(CurrentItem)); + } + + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ErrorMessageValue = obj->TryGetField(TEXT("ErrorMessage")); + if (ErrorMessageValue.IsValid() && !ErrorMessageValue->IsNull()) + { + FString TmpValue; + if (ErrorMessageValue->TryGetString(TmpValue)) { ErrorMessage = TmpValue; } + } + + const TSharedPtr MaxGamesPerHostValue = obj->TryGetField(TEXT("MaxGamesPerHost")); + if (MaxGamesPerHostValue.IsValid() && !MaxGamesPerHostValue->IsNull()) + { + int32 TmpValue; + if (MaxGamesPerHostValue->TryGetNumber(TmpValue)) { MaxGamesPerHost = TmpValue; } + } + + const TSharedPtr MinFreeGameSlotsValue = obj->TryGetField(TEXT("MinFreeGameSlots")); + if (MinFreeGameSlotsValue.IsValid() && !MinFreeGameSlotsValue->IsNull()) + { + int32 TmpValue; + if (MinFreeGameSlotsValue->TryGetNumber(TmpValue)) { MinFreeGameSlots = TmpValue; } + } + + Status = readGameBuildStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetServerBuildUploadURLRequest::~FGetServerBuildUploadURLRequest() +{ + +} + +void PlayFab::AdminModels::FGetServerBuildUploadURLRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetServerBuildUploadURLRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetServerBuildUploadURLResult::~FGetServerBuildUploadURLResult() +{ + +} + +void PlayFab::AdminModels::FGetServerBuildUploadURLResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (URL.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("URL")); writer->WriteValue(URL); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetServerBuildUploadURLResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr URLValue = obj->TryGetField(TEXT("URL")); + if (URLValue.IsValid() && !URLValue->IsNull()) + { + FString TmpValue; + if (URLValue->TryGetString(TmpValue)) { URL = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetStoreItemsRequest::~FGetStoreItemsRequest() +{ + +} + +void PlayFab::AdminModels::FGetStoreItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetStoreItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FStoreMarketingModel::~FStoreMarketingModel() +{ + +} + +void PlayFab::AdminModels::FStoreMarketingModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Metadata.notNull()) { writer->WriteIdentifierPrefix(TEXT("Metadata")); Metadata.writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FStoreMarketingModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr MetadataValue = obj->TryGetField(TEXT("Metadata")); + if (MetadataValue.IsValid() && !MetadataValue->IsNull()) + { + Metadata = FJsonKeeper(MetadataValue); + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeSourceTypeEnumJSON(SourceType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case SourceTypeAdmin: writer->WriteValue(TEXT("Admin")); break; + case SourceTypeBackEnd: writer->WriteValue(TEXT("BackEnd")); break; + case SourceTypeGameClient: writer->WriteValue(TEXT("GameClient")); break; + case SourceTypeGameServer: writer->WriteValue(TEXT("GameServer")); break; + case SourceTypePartner: writer->WriteValue(TEXT("Partner")); break; + case SourceTypeCustom: writer->WriteValue(TEXT("Custom")); break; + case SourceTypeAPI: writer->WriteValue(TEXT("API")); break; + } +} + +AdminModels::SourceType PlayFab::AdminModels::readSourceTypeFromValue(const TSharedPtr& value) +{ + return readSourceTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::SourceType PlayFab::AdminModels::readSourceTypeFromValue(const FString& value) +{ + static TMap _SourceTypeMap; + if (_SourceTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _SourceTypeMap.Add(TEXT("Admin"), SourceTypeAdmin); + _SourceTypeMap.Add(TEXT("BackEnd"), SourceTypeBackEnd); + _SourceTypeMap.Add(TEXT("GameClient"), SourceTypeGameClient); + _SourceTypeMap.Add(TEXT("GameServer"), SourceTypeGameServer); + _SourceTypeMap.Add(TEXT("Partner"), SourceTypePartner); + _SourceTypeMap.Add(TEXT("Custom"), SourceTypeCustom); + _SourceTypeMap.Add(TEXT("API"), SourceTypeAPI); + + } + + if (!value.IsEmpty()) + { + auto output = _SourceTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return SourceTypeAdmin; // Basically critical fail +} + +PlayFab::AdminModels::FStoreItem::~FStoreItem() +{ + +} + +void PlayFab::AdminModels::FStoreItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CustomData.notNull()) { writer->WriteIdentifierPrefix(TEXT("CustomData")); CustomData.writeJSON(writer); } + + if (DisplayPosition.notNull()) { writer->WriteIdentifierPrefix(TEXT("DisplayPosition")); writer->WriteValue(static_cast(DisplayPosition)); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (RealCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("RealCurrencyPrices")); + for (TMap::TConstIterator It(RealCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyPrices")); + for (TMap::TConstIterator It(VirtualCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FStoreItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomDataValue = obj->TryGetField(TEXT("CustomData")); + if (CustomDataValue.IsValid() && !CustomDataValue->IsNull()) + { + CustomData = FJsonKeeper(CustomDataValue); + } + + const TSharedPtr DisplayPositionValue = obj->TryGetField(TEXT("DisplayPosition")); + if (DisplayPositionValue.IsValid() && !DisplayPositionValue->IsNull()) + { + uint32 TmpValue; + if (DisplayPositionValue->TryGetNumber(TmpValue)) { DisplayPosition = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr* RealCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("RealCurrencyPrices"), RealCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*RealCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + RealCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyPrices"), VirtualCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetStoreItemsResult::~FGetStoreItemsResult() +{ + //if (MarketingData != nullptr) delete MarketingData; + +} + +void PlayFab::AdminModels::FGetStoreItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (MarketingData.IsValid()) { writer->WriteIdentifierPrefix(TEXT("MarketingData")); MarketingData->writeJSON(writer); } + + if (Source.notNull()) { writer->WriteIdentifierPrefix(TEXT("Source")); writeSourceTypeEnumJSON(Source, writer); } + + if (Store.Num() != 0) + { + writer->WriteArrayStart(TEXT("Store")); + for (const FStoreItem& item : Store) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (StoreId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetStoreItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr MarketingDataValue = obj->TryGetField(TEXT("MarketingData")); + if (MarketingDataValue.IsValid() && !MarketingDataValue->IsNull()) + { + MarketingData = MakeShareable(new FStoreMarketingModel(MarketingDataValue->AsObject())); + } + + Source = readSourceTypeFromValue(obj->TryGetField(TEXT("Source"))); + + const TArray>&StoreArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Store")); + for (int32 Idx = 0; Idx < StoreArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StoreArray[Idx]; + Store.Add(FStoreItem(CurrentItem->AsObject())); + } + + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTaskInstanceRequest::~FGetTaskInstanceRequest() +{ + +} + +void PlayFab::AdminModels::FGetTaskInstanceRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("TaskInstanceId")); writer->WriteValue(TaskInstanceId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTaskInstanceRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TaskInstanceIdValue = obj->TryGetField(TEXT("TaskInstanceId")); + if (TaskInstanceIdValue.IsValid() && !TaskInstanceIdValue->IsNull()) + { + FString TmpValue; + if (TaskInstanceIdValue->TryGetString(TmpValue)) { TaskInstanceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTaskInstancesRequest::~FGetTaskInstancesRequest() +{ + //if (TaskIdentifier != nullptr) delete TaskIdentifier; + +} + +void PlayFab::AdminModels::FGetTaskInstancesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StartedAtRangeFrom.notNull()) { writer->WriteIdentifierPrefix(TEXT("StartedAtRangeFrom")); writeDatetime(StartedAtRangeFrom, writer); } + + if (StartedAtRangeTo.notNull()) { writer->WriteIdentifierPrefix(TEXT("StartedAtRangeTo")); writeDatetime(StartedAtRangeTo, writer); } + + if (StatusFilter.notNull()) { writer->WriteIdentifierPrefix(TEXT("StatusFilter")); writeTaskInstanceStatusEnumJSON(StatusFilter, writer); } + + if (TaskIdentifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TaskIdentifier")); TaskIdentifier->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTaskInstancesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StartedAtRangeFromValue = obj->TryGetField(TEXT("StartedAtRangeFrom")); + if (StartedAtRangeFromValue.IsValid()) + StartedAtRangeFrom = readDatetime(StartedAtRangeFromValue); + + + const TSharedPtr StartedAtRangeToValue = obj->TryGetField(TEXT("StartedAtRangeTo")); + if (StartedAtRangeToValue.IsValid()) + StartedAtRangeTo = readDatetime(StartedAtRangeToValue); + + + StatusFilter = readTaskInstanceStatusFromValue(obj->TryGetField(TEXT("StatusFilter"))); + + const TSharedPtr TaskIdentifierValue = obj->TryGetField(TEXT("TaskIdentifier")); + if (TaskIdentifierValue.IsValid() && !TaskIdentifierValue->IsNull()) + { + TaskIdentifier = MakeShareable(new FNameIdentifier(TaskIdentifierValue->AsObject())); + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeScheduledTaskTypeEnumJSON(ScheduledTaskType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ScheduledTaskTypeCloudScript: writer->WriteValue(TEXT("CloudScript")); break; + case ScheduledTaskTypeActionsOnPlayerSegment: writer->WriteValue(TEXT("ActionsOnPlayerSegment")); break; + } +} + +AdminModels::ScheduledTaskType PlayFab::AdminModels::readScheduledTaskTypeFromValue(const TSharedPtr& value) +{ + return readScheduledTaskTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::ScheduledTaskType PlayFab::AdminModels::readScheduledTaskTypeFromValue(const FString& value) +{ + static TMap _ScheduledTaskTypeMap; + if (_ScheduledTaskTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ScheduledTaskTypeMap.Add(TEXT("CloudScript"), ScheduledTaskTypeCloudScript); + _ScheduledTaskTypeMap.Add(TEXT("ActionsOnPlayerSegment"), ScheduledTaskTypeActionsOnPlayerSegment); + + } + + if (!value.IsEmpty()) + { + auto output = _ScheduledTaskTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ScheduledTaskTypeCloudScript; // Basically critical fail +} + +PlayFab::AdminModels::FTaskInstanceBasicSummary::~FTaskInstanceBasicSummary() +{ + //if (TaskIdentifier != nullptr) delete TaskIdentifier; + +} + +void PlayFab::AdminModels::FTaskInstanceBasicSummary::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CompletedAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("CompletedAt")); writeDatetime(CompletedAt, writer); } + + if (EstimatedSecondsRemaining.notNull()) { writer->WriteIdentifierPrefix(TEXT("EstimatedSecondsRemaining")); writer->WriteValue(EstimatedSecondsRemaining); } + + if (PercentComplete.notNull()) { writer->WriteIdentifierPrefix(TEXT("PercentComplete")); writer->WriteValue(PercentComplete); } + + if (ScheduledByUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ScheduledByUserId")); writer->WriteValue(ScheduledByUserId); } + + writer->WriteIdentifierPrefix(TEXT("StartedAt")); writeDatetime(StartedAt, writer); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeTaskInstanceStatusEnumJSON(Status, writer); } + + if (TaskIdentifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TaskIdentifier")); TaskIdentifier->writeJSON(writer); } + + if (TaskInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TaskInstanceId")); writer->WriteValue(TaskInstanceId); } + + if (Type.notNull()) { writer->WriteIdentifierPrefix(TEXT("Type")); writeScheduledTaskTypeEnumJSON(Type, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FTaskInstanceBasicSummary::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CompletedAtValue = obj->TryGetField(TEXT("CompletedAt")); + if (CompletedAtValue.IsValid()) + CompletedAt = readDatetime(CompletedAtValue); + + + const TSharedPtr EstimatedSecondsRemainingValue = obj->TryGetField(TEXT("EstimatedSecondsRemaining")); + if (EstimatedSecondsRemainingValue.IsValid() && !EstimatedSecondsRemainingValue->IsNull()) + { + double TmpValue; + if (EstimatedSecondsRemainingValue->TryGetNumber(TmpValue)) { EstimatedSecondsRemaining = TmpValue; } + } + + const TSharedPtr PercentCompleteValue = obj->TryGetField(TEXT("PercentComplete")); + if (PercentCompleteValue.IsValid() && !PercentCompleteValue->IsNull()) + { + double TmpValue; + if (PercentCompleteValue->TryGetNumber(TmpValue)) { PercentComplete = TmpValue; } + } + + const TSharedPtr ScheduledByUserIdValue = obj->TryGetField(TEXT("ScheduledByUserId")); + if (ScheduledByUserIdValue.IsValid() && !ScheduledByUserIdValue->IsNull()) + { + FString TmpValue; + if (ScheduledByUserIdValue->TryGetString(TmpValue)) { ScheduledByUserId = TmpValue; } + } + + const TSharedPtr StartedAtValue = obj->TryGetField(TEXT("StartedAt")); + if (StartedAtValue.IsValid()) + StartedAt = readDatetime(StartedAtValue); + + + Status = readTaskInstanceStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TaskIdentifierValue = obj->TryGetField(TEXT("TaskIdentifier")); + if (TaskIdentifierValue.IsValid() && !TaskIdentifierValue->IsNull()) + { + TaskIdentifier = MakeShareable(new FNameIdentifier(TaskIdentifierValue->AsObject())); + } + + const TSharedPtr TaskInstanceIdValue = obj->TryGetField(TEXT("TaskInstanceId")); + if (TaskInstanceIdValue.IsValid() && !TaskInstanceIdValue->IsNull()) + { + FString TmpValue; + if (TaskInstanceIdValue->TryGetString(TmpValue)) { TaskInstanceId = TmpValue; } + } + + Type = readScheduledTaskTypeFromValue(obj->TryGetField(TEXT("Type"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTaskInstancesResult::~FGetTaskInstancesResult() +{ + +} + +void PlayFab::AdminModels::FGetTaskInstancesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Summaries.Num() != 0) + { + writer->WriteArrayStart(TEXT("Summaries")); + for (const FTaskInstanceBasicSummary& item : Summaries) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTaskInstancesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SummariesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Summaries")); + for (int32 Idx = 0; Idx < SummariesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SummariesArray[Idx]; + Summaries.Add(FTaskInstanceBasicSummary(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTasksRequest::~FGetTasksRequest() +{ + //if (Identifier != nullptr) delete Identifier; + +} + +void PlayFab::AdminModels::FGetTasksRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Identifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Identifier")); Identifier->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTasksRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdentifierValue = obj->TryGetField(TEXT("Identifier")); + if (IdentifierValue.IsValid() && !IdentifierValue->IsNull()) + { + Identifier = MakeShareable(new FNameIdentifier(IdentifierValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FScheduledTask::~FScheduledTask() +{ + +} + +void PlayFab::AdminModels::FScheduledTask::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + if (LastRunTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastRunTime")); writeDatetime(LastRunTime, writer); } + + writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); + + if (NextRunTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("NextRunTime")); writeDatetime(NextRunTime, writer); } + + if (Parameter.notNull()) { writer->WriteIdentifierPrefix(TEXT("Parameter")); Parameter.writeJSON(writer); } + + if (Schedule.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Schedule")); writer->WriteValue(Schedule); } + + if (TaskId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TaskId")); writer->WriteValue(TaskId); } + + if (Type.notNull()) { writer->WriteIdentifierPrefix(TEXT("Type")); writeScheduledTaskTypeEnumJSON(Type, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FScheduledTask::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr LastRunTimeValue = obj->TryGetField(TEXT("LastRunTime")); + if (LastRunTimeValue.IsValid()) + LastRunTime = readDatetime(LastRunTimeValue); + + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr NextRunTimeValue = obj->TryGetField(TEXT("NextRunTime")); + if (NextRunTimeValue.IsValid()) + NextRunTime = readDatetime(NextRunTimeValue); + + + const TSharedPtr ParameterValue = obj->TryGetField(TEXT("Parameter")); + if (ParameterValue.IsValid() && !ParameterValue->IsNull()) + { + Parameter = FJsonKeeper(ParameterValue); + } + + const TSharedPtr ScheduleValue = obj->TryGetField(TEXT("Schedule")); + if (ScheduleValue.IsValid() && !ScheduleValue->IsNull()) + { + FString TmpValue; + if (ScheduleValue->TryGetString(TmpValue)) { Schedule = TmpValue; } + } + + const TSharedPtr TaskIdValue = obj->TryGetField(TEXT("TaskId")); + if (TaskIdValue.IsValid() && !TaskIdValue->IsNull()) + { + FString TmpValue; + if (TaskIdValue->TryGetString(TmpValue)) { TaskId = TmpValue; } + } + + Type = readScheduledTaskTypeFromValue(obj->TryGetField(TEXT("Type"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTasksResult::~FGetTasksResult() +{ + +} + +void PlayFab::AdminModels::FGetTasksResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Tasks.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tasks")); + for (const FScheduledTask& item : Tasks) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTasksResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&TasksArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Tasks")); + for (int32 Idx = 0; Idx < TasksArray.Num(); Idx++) + { + TSharedPtr CurrentItem = TasksArray[Idx]; + Tasks.Add(FScheduledTask(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTitleDataRequest::~FGetTitleDataRequest() +{ + +} + +void PlayFab::AdminModels::FGetTitleDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTitleDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetTitleDataResult::~FGetTitleDataResult() +{ + +} + +void PlayFab::AdminModels::FGetTitleDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetTitleDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetUserBansRequest::~FGetUserBansRequest() +{ + +} + +void PlayFab::AdminModels::FGetUserBansRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetUserBansRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetUserBansResult::~FGetUserBansResult() +{ + +} + +void PlayFab::AdminModels::FGetUserBansResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetUserBansResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetUserDataRequest::~FGetUserDataRequest() +{ + +} + +void PlayFab::AdminModels::FGetUserDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IfChangedFromDataVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("IfChangedFromDataVersion")); writer->WriteValue(static_cast(IfChangedFromDataVersion)); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetUserDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IfChangedFromDataVersionValue = obj->TryGetField(TEXT("IfChangedFromDataVersion")); + if (IfChangedFromDataVersionValue.IsValid() && !IfChangedFromDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (IfChangedFromDataVersionValue->TryGetNumber(TmpValue)) { IfChangedFromDataVersion = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeUserDataPermissionEnumJSON(UserDataPermission enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case UserDataPermissionPrivate: writer->WriteValue(TEXT("Private")); break; + case UserDataPermissionPublic: writer->WriteValue(TEXT("Public")); break; + } +} + +AdminModels::UserDataPermission PlayFab::AdminModels::readUserDataPermissionFromValue(const TSharedPtr& value) +{ + return readUserDataPermissionFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::UserDataPermission PlayFab::AdminModels::readUserDataPermissionFromValue(const FString& value) +{ + static TMap _UserDataPermissionMap; + if (_UserDataPermissionMap.Num() == 0) + { + // Auto-generate the map on the first use + _UserDataPermissionMap.Add(TEXT("Private"), UserDataPermissionPrivate); + _UserDataPermissionMap.Add(TEXT("Public"), UserDataPermissionPublic); + + } + + if (!value.IsEmpty()) + { + auto output = _UserDataPermissionMap.Find(value); + if (output != nullptr) + return *output; + } + + return UserDataPermissionPrivate; // Basically critical fail +} + +PlayFab::AdminModels::FUserDataRecord::~FUserDataRecord() +{ + +} + +void PlayFab::AdminModels::FUserDataRecord::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LastUpdated")); writeDatetime(LastUpdated, writer); + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserDataRecord::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LastUpdatedValue = obj->TryGetField(TEXT("LastUpdated")); + if (LastUpdatedValue.IsValid()) + LastUpdated = readDatetime(LastUpdatedValue); + + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetUserDataResult::~FGetUserDataResult() +{ + +} + +void PlayFab::AdminModels::FGetUserDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetUserDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetUserInventoryRequest::~FGetUserInventoryRequest() +{ + +} + +void PlayFab::AdminModels::FGetUserInventoryRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetUserInventoryRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FItemInstance::~FItemInstance() +{ + +} + +void PlayFab::AdminModels::FItemInstance::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (BundleContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundleContents")); + for (const FString& item : BundleContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundleParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BundleParent")); writer->WriteValue(BundleParent); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CustomData.Num() != 0) + { + writer->WriteObjectStart(TEXT("CustomData")); + for (TMap::TConstIterator It(CustomData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Expiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (PurchaseDate.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); } + + if (RemainingUses.notNull()) { writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); } + + if (UnitCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnitCurrency")); writer->WriteValue(UnitCurrency); } + + writer->WriteIdentifierPrefix(TEXT("UnitPrice")); writer->WriteValue(static_cast(UnitPrice)); + + if (UsesIncrementedBy.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsesIncrementedBy")); writer->WriteValue(UsesIncrementedBy); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FItemInstance::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("BundleContents"), BundleContents); + + const TSharedPtr BundleParentValue = obj->TryGetField(TEXT("BundleParent")); + if (BundleParentValue.IsValid() && !BundleParentValue->IsNull()) + { + FString TmpValue; + if (BundleParentValue->TryGetString(TmpValue)) { BundleParent = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr* CustomDataObject; + if (obj->TryGetObjectField(TEXT("CustomData"), CustomDataObject)) + { + for (TMap>::TConstIterator It((*CustomDataObject)->Values); It; ++It) + { + CustomData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + const TSharedPtr UnitCurrencyValue = obj->TryGetField(TEXT("UnitCurrency")); + if (UnitCurrencyValue.IsValid() && !UnitCurrencyValue->IsNull()) + { + FString TmpValue; + if (UnitCurrencyValue->TryGetString(TmpValue)) { UnitCurrency = TmpValue; } + } + + const TSharedPtr UnitPriceValue = obj->TryGetField(TEXT("UnitPrice")); + if (UnitPriceValue.IsValid() && !UnitPriceValue->IsNull()) + { + uint32 TmpValue; + if (UnitPriceValue->TryGetNumber(TmpValue)) { UnitPrice = TmpValue; } + } + + const TSharedPtr UsesIncrementedByValue = obj->TryGetField(TEXT("UsesIncrementedBy")); + if (UsesIncrementedByValue.IsValid() && !UsesIncrementedByValue->IsNull()) + { + int32 TmpValue; + if (UsesIncrementedByValue->TryGetNumber(TmpValue)) { UsesIncrementedBy = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FVirtualCurrencyRechargeTime::~FVirtualCurrencyRechargeTime() +{ + +} + +void PlayFab::AdminModels::FVirtualCurrencyRechargeTime::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("RechargeMax")); writer->WriteValue(RechargeMax); + + writer->WriteIdentifierPrefix(TEXT("RechargeTime")); writeDatetime(RechargeTime, writer); + + writer->WriteIdentifierPrefix(TEXT("SecondsToRecharge")); writer->WriteValue(SecondsToRecharge); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FVirtualCurrencyRechargeTime::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RechargeMaxValue = obj->TryGetField(TEXT("RechargeMax")); + if (RechargeMaxValue.IsValid() && !RechargeMaxValue->IsNull()) + { + int32 TmpValue; + if (RechargeMaxValue->TryGetNumber(TmpValue)) { RechargeMax = TmpValue; } + } + + const TSharedPtr RechargeTimeValue = obj->TryGetField(TEXT("RechargeTime")); + if (RechargeTimeValue.IsValid()) + RechargeTime = readDatetime(RechargeTimeValue); + + + const TSharedPtr SecondsToRechargeValue = obj->TryGetField(TEXT("SecondsToRecharge")); + if (SecondsToRechargeValue.IsValid() && !SecondsToRechargeValue->IsNull()) + { + int32 TmpValue; + if (SecondsToRechargeValue->TryGetNumber(TmpValue)) { SecondsToRecharge = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGetUserInventoryResult::~FGetUserInventoryResult() +{ + +} + +void PlayFab::AdminModels::FGetUserInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(VirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGetUserInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyRechargeTimes"), VirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + VirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGrantedItemInstance::~FGrantedItemInstance() +{ + +} + +void PlayFab::AdminModels::FGrantedItemInstance::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (BundleContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundleContents")); + for (const FString& item : BundleContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundleParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BundleParent")); writer->WriteValue(BundleParent); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CustomData.Num() != 0) + { + writer->WriteObjectStart(TEXT("CustomData")); + for (TMap::TConstIterator It(CustomData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Expiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (PurchaseDate.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); } + + if (RemainingUses.notNull()) { writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); } + + writer->WriteIdentifierPrefix(TEXT("Result")); writer->WriteValue(Result); + + if (UnitCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnitCurrency")); writer->WriteValue(UnitCurrency); } + + writer->WriteIdentifierPrefix(TEXT("UnitPrice")); writer->WriteValue(static_cast(UnitPrice)); + + if (UsesIncrementedBy.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsesIncrementedBy")); writer->WriteValue(UsesIncrementedBy); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGrantedItemInstance::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("BundleContents"), BundleContents); + + const TSharedPtr BundleParentValue = obj->TryGetField(TEXT("BundleParent")); + if (BundleParentValue.IsValid() && !BundleParentValue->IsNull()) + { + FString TmpValue; + if (BundleParentValue->TryGetString(TmpValue)) { BundleParent = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* CustomDataObject; + if (obj->TryGetObjectField(TEXT("CustomData"), CustomDataObject)) + { + for (TMap>::TConstIterator It((*CustomDataObject)->Values); It; ++It) + { + CustomData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + const TSharedPtr ResultValue = obj->TryGetField(TEXT("Result")); + if (ResultValue.IsValid() && !ResultValue->IsNull()) + { + bool TmpValue; + if (ResultValue->TryGetBool(TmpValue)) { Result = TmpValue; } + } + + const TSharedPtr UnitCurrencyValue = obj->TryGetField(TEXT("UnitCurrency")); + if (UnitCurrencyValue.IsValid() && !UnitCurrencyValue->IsNull()) + { + FString TmpValue; + if (UnitCurrencyValue->TryGetString(TmpValue)) { UnitCurrency = TmpValue; } + } + + const TSharedPtr UnitPriceValue = obj->TryGetField(TEXT("UnitPrice")); + if (UnitPriceValue.IsValid() && !UnitPriceValue->IsNull()) + { + uint32 TmpValue; + if (UnitPriceValue->TryGetNumber(TmpValue)) { UnitPrice = TmpValue; } + } + + const TSharedPtr UsesIncrementedByValue = obj->TryGetField(TEXT("UsesIncrementedBy")); + if (UsesIncrementedByValue.IsValid() && !UsesIncrementedByValue->IsNull()) + { + int32 TmpValue; + if (UsesIncrementedByValue->TryGetNumber(TmpValue)) { UsesIncrementedBy = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FItemGrant::~FItemGrant() +{ + +} + +void PlayFab::AdminModels::FItemGrant::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FItemGrant::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FGrantItemsToUsersRequest::~FGrantItemsToUsersRequest() +{ + +} + +void PlayFab::AdminModels::FGrantItemsToUsersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("ItemGrants")); + for (const FItemGrant& item : ItemGrants) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGrantItemsToUsersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TArray>&ItemGrantsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ItemGrants")); + for (int32 Idx = 0; Idx < ItemGrantsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemGrantsArray[Idx]; + ItemGrants.Add(FItemGrant(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FGrantItemsToUsersResult::~FGrantItemsToUsersResult() +{ + +} + +void PlayFab::AdminModels::FGrantItemsToUsersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemGrantResults.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemGrantResults")); + for (const FGrantedItemInstance& item : ItemGrantResults) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FGrantItemsToUsersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemGrantResultsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ItemGrantResults")); + for (int32 Idx = 0; Idx < ItemGrantResultsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemGrantResultsArray[Idx]; + ItemGrantResults.Add(FGrantedItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FIncrementLimitedEditionItemAvailabilityRequest::~FIncrementLimitedEditionItemAvailabilityRequest() +{ + +} + +void PlayFab::AdminModels::FIncrementLimitedEditionItemAvailabilityRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FIncrementLimitedEditionItemAvailabilityRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FIncrementLimitedEditionItemAvailabilityResult::~FIncrementLimitedEditionItemAvailabilityResult() +{ + +} + +void PlayFab::AdminModels::FIncrementLimitedEditionItemAvailabilityResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FIncrementLimitedEditionItemAvailabilityResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FIncrementPlayerStatisticVersionRequest::~FIncrementPlayerStatisticVersionRequest() +{ + +} + +void PlayFab::AdminModels::FIncrementPlayerStatisticVersionRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FIncrementPlayerStatisticVersionRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FIncrementPlayerStatisticVersionResult::~FIncrementPlayerStatisticVersionResult() +{ + //if (StatisticVersion != nullptr) delete StatisticVersion; + +} + +void PlayFab::AdminModels::FIncrementPlayerStatisticVersionResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticVersion.IsValid()) { writer->WriteIdentifierPrefix(TEXT("StatisticVersion")); StatisticVersion->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FIncrementPlayerStatisticVersionResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticVersionValue = obj->TryGetField(TEXT("StatisticVersion")); + if (StatisticVersionValue.IsValid() && !StatisticVersionValue->IsNull()) + { + StatisticVersion = MakeShareable(new FPlayerStatisticVersion(StatisticVersionValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FListBuildsRequest::~FListBuildsRequest() +{ + +} + +void PlayFab::AdminModels::FListBuildsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FListBuildsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FListBuildsResult::~FListBuildsResult() +{ + +} + +void PlayFab::AdminModels::FListBuildsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Builds.Num() != 0) + { + writer->WriteArrayStart(TEXT("Builds")); + for (const FGetServerBuildInfoResult& item : Builds) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FListBuildsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BuildsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Builds")); + for (int32 Idx = 0; Idx < BuildsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BuildsArray[Idx]; + Builds.Add(FGetServerBuildInfoResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FListVirtualCurrencyTypesRequest::~FListVirtualCurrencyTypesRequest() +{ + +} + +void PlayFab::AdminModels::FListVirtualCurrencyTypesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FListVirtualCurrencyTypesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FListVirtualCurrencyTypesResult::~FListVirtualCurrencyTypesResult() +{ + +} + +void PlayFab::AdminModels::FListVirtualCurrencyTypesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (VirtualCurrencies.Num() != 0) + { + writer->WriteArrayStart(TEXT("VirtualCurrencies")); + for (const FVirtualCurrencyData& item : VirtualCurrencies) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FListVirtualCurrencyTypesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&VirtualCurrenciesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("VirtualCurrencies")); + for (int32 Idx = 0; Idx < VirtualCurrenciesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = VirtualCurrenciesArray[Idx]; + VirtualCurrencies.Add(FVirtualCurrencyData(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FLookupUserAccountInfoRequest::~FLookupUserAccountInfoRequest() +{ + +} + +void PlayFab::AdminModels::FLookupUserAccountInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (TitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleDisplayName")); writer->WriteValue(TitleDisplayName); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FLookupUserAccountInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TitleDisplayNameValue = obj->TryGetField(TEXT("TitleDisplayName")); + if (TitleDisplayNameValue.IsValid() && !TitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (TitleDisplayNameValue->TryGetString(TmpValue)) { TitleDisplayName = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserAndroidDeviceInfo::~FUserAndroidDeviceInfo() +{ + +} + +void PlayFab::AdminModels::FUserAndroidDeviceInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceId")); writer->WriteValue(AndroidDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserAndroidDeviceInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceIdValue = obj->TryGetField(TEXT("AndroidDeviceId")); + if (AndroidDeviceIdValue.IsValid() && !AndroidDeviceIdValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceIdValue->TryGetString(TmpValue)) { AndroidDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserCustomIdInfo::~FUserCustomIdInfo() +{ + +} + +void PlayFab::AdminModels::FUserCustomIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CustomId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomId")); writer->WriteValue(CustomId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserCustomIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomIdValue = obj->TryGetField(TEXT("CustomId")); + if (CustomIdValue.IsValid() && !CustomIdValue->IsNull()) + { + FString TmpValue; + if (CustomIdValue->TryGetString(TmpValue)) { CustomId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserFacebookInfo::~FUserFacebookInfo() +{ + +} + +void PlayFab::AdminModels::FUserFacebookInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookId")); writer->WriteValue(FacebookId); } + + if (FullName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FullName")); writer->WriteValue(FullName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserFacebookInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookIdValue = obj->TryGetField(TEXT("FacebookId")); + if (FacebookIdValue.IsValid() && !FacebookIdValue->IsNull()) + { + FString TmpValue; + if (FacebookIdValue->TryGetString(TmpValue)) { FacebookId = TmpValue; } + } + + const TSharedPtr FullNameValue = obj->TryGetField(TEXT("FullName")); + if (FullNameValue.IsValid() && !FullNameValue->IsNull()) + { + FString TmpValue; + if (FullNameValue->TryGetString(TmpValue)) { FullName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserFacebookInstantGamesIdInfo::~FUserFacebookInstantGamesIdInfo() +{ + +} + +void PlayFab::AdminModels::FUserFacebookInstantGamesIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookInstantGamesId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesId")); writer->WriteValue(FacebookInstantGamesId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserFacebookInstantGamesIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesIdValue = obj->TryGetField(TEXT("FacebookInstantGamesId")); + if (FacebookInstantGamesIdValue.IsValid() && !FacebookInstantGamesIdValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesIdValue->TryGetString(TmpValue)) { FacebookInstantGamesId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserGameCenterInfo::~FUserGameCenterInfo() +{ + +} + +void PlayFab::AdminModels::FUserGameCenterInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GameCenterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameCenterId")); writer->WriteValue(GameCenterId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserGameCenterInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameCenterIdValue = obj->TryGetField(TEXT("GameCenterId")); + if (GameCenterIdValue.IsValid() && !GameCenterIdValue->IsNull()) + { + FString TmpValue; + if (GameCenterIdValue->TryGetString(TmpValue)) { GameCenterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserGoogleInfo::~FUserGoogleInfo() +{ + +} + +void PlayFab::AdminModels::FUserGoogleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GoogleEmail.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleEmail")); writer->WriteValue(GoogleEmail); } + + if (GoogleGender.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleGender")); writer->WriteValue(GoogleGender); } + + if (GoogleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleId")); writer->WriteValue(GoogleId); } + + if (GoogleLocale.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleLocale")); writer->WriteValue(GoogleLocale); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserGoogleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GoogleEmailValue = obj->TryGetField(TEXT("GoogleEmail")); + if (GoogleEmailValue.IsValid() && !GoogleEmailValue->IsNull()) + { + FString TmpValue; + if (GoogleEmailValue->TryGetString(TmpValue)) { GoogleEmail = TmpValue; } + } + + const TSharedPtr GoogleGenderValue = obj->TryGetField(TEXT("GoogleGender")); + if (GoogleGenderValue.IsValid() && !GoogleGenderValue->IsNull()) + { + FString TmpValue; + if (GoogleGenderValue->TryGetString(TmpValue)) { GoogleGender = TmpValue; } + } + + const TSharedPtr GoogleIdValue = obj->TryGetField(TEXT("GoogleId")); + if (GoogleIdValue.IsValid() && !GoogleIdValue->IsNull()) + { + FString TmpValue; + if (GoogleIdValue->TryGetString(TmpValue)) { GoogleId = TmpValue; } + } + + const TSharedPtr GoogleLocaleValue = obj->TryGetField(TEXT("GoogleLocale")); + if (GoogleLocaleValue.IsValid() && !GoogleLocaleValue->IsNull()) + { + FString TmpValue; + if (GoogleLocaleValue->TryGetString(TmpValue)) { GoogleLocale = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserIosDeviceInfo::~FUserIosDeviceInfo() +{ + +} + +void PlayFab::AdminModels::FUserIosDeviceInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IosDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IosDeviceId")); writer->WriteValue(IosDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserIosDeviceInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IosDeviceIdValue = obj->TryGetField(TEXT("IosDeviceId")); + if (IosDeviceIdValue.IsValid() && !IosDeviceIdValue->IsNull()) + { + FString TmpValue; + if (IosDeviceIdValue->TryGetString(TmpValue)) { IosDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserKongregateInfo::~FUserKongregateInfo() +{ + +} + +void PlayFab::AdminModels::FUserKongregateInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (KongregateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateId")); writer->WriteValue(KongregateId); } + + if (KongregateName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateName")); writer->WriteValue(KongregateName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserKongregateInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KongregateIdValue = obj->TryGetField(TEXT("KongregateId")); + if (KongregateIdValue.IsValid() && !KongregateIdValue->IsNull()) + { + FString TmpValue; + if (KongregateIdValue->TryGetString(TmpValue)) { KongregateId = TmpValue; } + } + + const TSharedPtr KongregateNameValue = obj->TryGetField(TEXT("KongregateName")); + if (KongregateNameValue.IsValid() && !KongregateNameValue->IsNull()) + { + FString TmpValue; + if (KongregateNameValue->TryGetString(TmpValue)) { KongregateName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserNintendoSwitchDeviceIdInfo::~FUserNintendoSwitchDeviceIdInfo() +{ + +} + +void PlayFab::AdminModels::FUserNintendoSwitchDeviceIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserNintendoSwitchDeviceIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserOpenIdInfo::~FUserOpenIdInfo() +{ + +} + +void PlayFab::AdminModels::FUserOpenIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ConnectionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ConnectionId")); writer->WriteValue(ConnectionId); } + + if (Issuer.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Issuer")); writer->WriteValue(Issuer); } + + if (Subject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Subject")); writer->WriteValue(Subject); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserOpenIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ConnectionIdValue = obj->TryGetField(TEXT("ConnectionId")); + if (ConnectionIdValue.IsValid() && !ConnectionIdValue->IsNull()) + { + FString TmpValue; + if (ConnectionIdValue->TryGetString(TmpValue)) { ConnectionId = TmpValue; } + } + + const TSharedPtr IssuerValue = obj->TryGetField(TEXT("Issuer")); + if (IssuerValue.IsValid() && !IssuerValue->IsNull()) + { + FString TmpValue; + if (IssuerValue->TryGetString(TmpValue)) { Issuer = TmpValue; } + } + + const TSharedPtr SubjectValue = obj->TryGetField(TEXT("Subject")); + if (SubjectValue.IsValid() && !SubjectValue->IsNull()) + { + FString TmpValue; + if (SubjectValue->TryGetString(TmpValue)) { Subject = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserPrivateAccountInfo::~FUserPrivateAccountInfo() +{ + +} + +void PlayFab::AdminModels::FUserPrivateAccountInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserPrivateAccountInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserPsnInfo::~FUserPsnInfo() +{ + +} + +void PlayFab::AdminModels::FUserPsnInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PsnAccountId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PsnAccountId")); writer->WriteValue(PsnAccountId); } + + if (PsnOnlineId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PsnOnlineId")); writer->WriteValue(PsnOnlineId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserPsnInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PsnAccountIdValue = obj->TryGetField(TEXT("PsnAccountId")); + if (PsnAccountIdValue.IsValid() && !PsnAccountIdValue->IsNull()) + { + FString TmpValue; + if (PsnAccountIdValue->TryGetString(TmpValue)) { PsnAccountId = TmpValue; } + } + + const TSharedPtr PsnOnlineIdValue = obj->TryGetField(TEXT("PsnOnlineId")); + if (PsnOnlineIdValue.IsValid() && !PsnOnlineIdValue->IsNull()) + { + FString TmpValue; + if (PsnOnlineIdValue->TryGetString(TmpValue)) { PsnOnlineId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeTitleActivationStatusEnumJSON(TitleActivationStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case TitleActivationStatusNone: writer->WriteValue(TEXT("None")); break; + case TitleActivationStatusActivatedTitleKey: writer->WriteValue(TEXT("ActivatedTitleKey")); break; + case TitleActivationStatusPendingSteam: writer->WriteValue(TEXT("PendingSteam")); break; + case TitleActivationStatusActivatedSteam: writer->WriteValue(TEXT("ActivatedSteam")); break; + case TitleActivationStatusRevokedSteam: writer->WriteValue(TEXT("RevokedSteam")); break; + } +} + +AdminModels::TitleActivationStatus PlayFab::AdminModels::readTitleActivationStatusFromValue(const TSharedPtr& value) +{ + return readTitleActivationStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::TitleActivationStatus PlayFab::AdminModels::readTitleActivationStatusFromValue(const FString& value) +{ + static TMap _TitleActivationStatusMap; + if (_TitleActivationStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _TitleActivationStatusMap.Add(TEXT("None"), TitleActivationStatusNone); + _TitleActivationStatusMap.Add(TEXT("ActivatedTitleKey"), TitleActivationStatusActivatedTitleKey); + _TitleActivationStatusMap.Add(TEXT("PendingSteam"), TitleActivationStatusPendingSteam); + _TitleActivationStatusMap.Add(TEXT("ActivatedSteam"), TitleActivationStatusActivatedSteam); + _TitleActivationStatusMap.Add(TEXT("RevokedSteam"), TitleActivationStatusRevokedSteam); + + } + + if (!value.IsEmpty()) + { + auto output = _TitleActivationStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return TitleActivationStatusNone; // Basically critical fail +} + +PlayFab::AdminModels::FUserSteamInfo::~FUserSteamInfo() +{ + +} + +void PlayFab::AdminModels::FUserSteamInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SteamActivationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("SteamActivationStatus")); writeTitleActivationStatusEnumJSON(SteamActivationStatus, writer); } + + if (SteamCountry.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamCountry")); writer->WriteValue(SteamCountry); } + + if (SteamCurrency.notNull()) { writer->WriteIdentifierPrefix(TEXT("SteamCurrency")); writeCurrencyEnumJSON(SteamCurrency, writer); } + + if (SteamId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamId")); writer->WriteValue(SteamId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserSteamInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + SteamActivationStatus = readTitleActivationStatusFromValue(obj->TryGetField(TEXT("SteamActivationStatus"))); + + const TSharedPtr SteamCountryValue = obj->TryGetField(TEXT("SteamCountry")); + if (SteamCountryValue.IsValid() && !SteamCountryValue->IsNull()) + { + FString TmpValue; + if (SteamCountryValue->TryGetString(TmpValue)) { SteamCountry = TmpValue; } + } + + SteamCurrency = readCurrencyFromValue(obj->TryGetField(TEXT("SteamCurrency"))); + + const TSharedPtr SteamIdValue = obj->TryGetField(TEXT("SteamId")); + if (SteamIdValue.IsValid() && !SteamIdValue->IsNull()) + { + FString TmpValue; + if (SteamIdValue->TryGetString(TmpValue)) { SteamId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeUserOriginationEnumJSON(UserOrigination enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case UserOriginationOrganic: writer->WriteValue(TEXT("Organic")); break; + case UserOriginationSteam: writer->WriteValue(TEXT("Steam")); break; + case UserOriginationGoogle: writer->WriteValue(TEXT("Google")); break; + case UserOriginationAmazon: writer->WriteValue(TEXT("Amazon")); break; + case UserOriginationFacebook: writer->WriteValue(TEXT("Facebook")); break; + case UserOriginationKongregate: writer->WriteValue(TEXT("Kongregate")); break; + case UserOriginationGamersFirst: writer->WriteValue(TEXT("GamersFirst")); break; + case UserOriginationUnknown: writer->WriteValue(TEXT("Unknown")); break; + case UserOriginationIOS: writer->WriteValue(TEXT("IOS")); break; + case UserOriginationLoadTest: writer->WriteValue(TEXT("LoadTest")); break; + case UserOriginationAndroid: writer->WriteValue(TEXT("Android")); break; + case UserOriginationPSN: writer->WriteValue(TEXT("PSN")); break; + case UserOriginationGameCenter: writer->WriteValue(TEXT("GameCenter")); break; + case UserOriginationCustomId: writer->WriteValue(TEXT("CustomId")); break; + case UserOriginationXboxLive: writer->WriteValue(TEXT("XboxLive")); break; + case UserOriginationParse: writer->WriteValue(TEXT("Parse")); break; + case UserOriginationTwitch: writer->WriteValue(TEXT("Twitch")); break; + case UserOriginationWindowsHello: writer->WriteValue(TEXT("WindowsHello")); break; + case UserOriginationServerCustomId: writer->WriteValue(TEXT("ServerCustomId")); break; + case UserOriginationNintendoSwitchDeviceId: writer->WriteValue(TEXT("NintendoSwitchDeviceId")); break; + case UserOriginationFacebookInstantGamesId: writer->WriteValue(TEXT("FacebookInstantGamesId")); break; + case UserOriginationOpenIdConnect: writer->WriteValue(TEXT("OpenIdConnect")); break; + } +} + +AdminModels::UserOrigination PlayFab::AdminModels::readUserOriginationFromValue(const TSharedPtr& value) +{ + return readUserOriginationFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::UserOrigination PlayFab::AdminModels::readUserOriginationFromValue(const FString& value) +{ + static TMap _UserOriginationMap; + if (_UserOriginationMap.Num() == 0) + { + // Auto-generate the map on the first use + _UserOriginationMap.Add(TEXT("Organic"), UserOriginationOrganic); + _UserOriginationMap.Add(TEXT("Steam"), UserOriginationSteam); + _UserOriginationMap.Add(TEXT("Google"), UserOriginationGoogle); + _UserOriginationMap.Add(TEXT("Amazon"), UserOriginationAmazon); + _UserOriginationMap.Add(TEXT("Facebook"), UserOriginationFacebook); + _UserOriginationMap.Add(TEXT("Kongregate"), UserOriginationKongregate); + _UserOriginationMap.Add(TEXT("GamersFirst"), UserOriginationGamersFirst); + _UserOriginationMap.Add(TEXT("Unknown"), UserOriginationUnknown); + _UserOriginationMap.Add(TEXT("IOS"), UserOriginationIOS); + _UserOriginationMap.Add(TEXT("LoadTest"), UserOriginationLoadTest); + _UserOriginationMap.Add(TEXT("Android"), UserOriginationAndroid); + _UserOriginationMap.Add(TEXT("PSN"), UserOriginationPSN); + _UserOriginationMap.Add(TEXT("GameCenter"), UserOriginationGameCenter); + _UserOriginationMap.Add(TEXT("CustomId"), UserOriginationCustomId); + _UserOriginationMap.Add(TEXT("XboxLive"), UserOriginationXboxLive); + _UserOriginationMap.Add(TEXT("Parse"), UserOriginationParse); + _UserOriginationMap.Add(TEXT("Twitch"), UserOriginationTwitch); + _UserOriginationMap.Add(TEXT("WindowsHello"), UserOriginationWindowsHello); + _UserOriginationMap.Add(TEXT("ServerCustomId"), UserOriginationServerCustomId); + _UserOriginationMap.Add(TEXT("NintendoSwitchDeviceId"), UserOriginationNintendoSwitchDeviceId); + _UserOriginationMap.Add(TEXT("FacebookInstantGamesId"), UserOriginationFacebookInstantGamesId); + _UserOriginationMap.Add(TEXT("OpenIdConnect"), UserOriginationOpenIdConnect); + + } + + if (!value.IsEmpty()) + { + auto output = _UserOriginationMap.Find(value); + if (output != nullptr) + return *output; + } + + return UserOriginationOrganic; // Basically critical fail +} + +PlayFab::AdminModels::FUserTitleInfo::~FUserTitleInfo() +{ + //if (TitlePlayerAccount != nullptr) delete TitlePlayerAccount; + +} + +void PlayFab::AdminModels::FUserTitleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (FirstLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("FirstLogin")); writeDatetime(FirstLogin, writer); } + + if (isBanned.notNull()) { writer->WriteIdentifierPrefix(TEXT("isBanned")); writer->WriteValue(isBanned); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeUserOriginationEnumJSON(Origination, writer); } + + if (TitlePlayerAccount.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TitlePlayerAccount")); TitlePlayerAccount->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserTitleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr FirstLoginValue = obj->TryGetField(TEXT("FirstLogin")); + if (FirstLoginValue.IsValid()) + FirstLogin = readDatetime(FirstLoginValue); + + + const TSharedPtr isBannedValue = obj->TryGetField(TEXT("isBanned")); + if (isBannedValue.IsValid() && !isBannedValue->IsNull()) + { + bool TmpValue; + if (isBannedValue->TryGetBool(TmpValue)) { isBanned = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + Origination = readUserOriginationFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr TitlePlayerAccountValue = obj->TryGetField(TEXT("TitlePlayerAccount")); + if (TitlePlayerAccountValue.IsValid() && !TitlePlayerAccountValue->IsNull()) + { + TitlePlayerAccount = MakeShareable(new FEntityKey(TitlePlayerAccountValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserTwitchInfo::~FUserTwitchInfo() +{ + +} + +void PlayFab::AdminModels::FUserTwitchInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TwitchId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchId")); writer->WriteValue(TwitchId); } + + if (TwitchUserName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchUserName")); writer->WriteValue(TwitchUserName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserTwitchInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TwitchIdValue = obj->TryGetField(TEXT("TwitchId")); + if (TwitchIdValue.IsValid() && !TwitchIdValue->IsNull()) + { + FString TmpValue; + if (TwitchIdValue->TryGetString(TmpValue)) { TwitchId = TmpValue; } + } + + const TSharedPtr TwitchUserNameValue = obj->TryGetField(TEXT("TwitchUserName")); + if (TwitchUserNameValue.IsValid() && !TwitchUserNameValue->IsNull()) + { + FString TmpValue; + if (TwitchUserNameValue->TryGetString(TmpValue)) { TwitchUserName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserWindowsHelloInfo::~FUserWindowsHelloInfo() +{ + +} + +void PlayFab::AdminModels::FUserWindowsHelloInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (WindowsHelloDeviceName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloDeviceName")); writer->WriteValue(WindowsHelloDeviceName); } + + if (WindowsHelloPublicKeyHash.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloPublicKeyHash")); writer->WriteValue(WindowsHelloPublicKeyHash); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserWindowsHelloInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr WindowsHelloDeviceNameValue = obj->TryGetField(TEXT("WindowsHelloDeviceName")); + if (WindowsHelloDeviceNameValue.IsValid() && !WindowsHelloDeviceNameValue->IsNull()) + { + FString TmpValue; + if (WindowsHelloDeviceNameValue->TryGetString(TmpValue)) { WindowsHelloDeviceName = TmpValue; } + } + + const TSharedPtr WindowsHelloPublicKeyHashValue = obj->TryGetField(TEXT("WindowsHelloPublicKeyHash")); + if (WindowsHelloPublicKeyHashValue.IsValid() && !WindowsHelloPublicKeyHashValue->IsNull()) + { + FString TmpValue; + if (WindowsHelloPublicKeyHashValue->TryGetString(TmpValue)) { WindowsHelloPublicKeyHash = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserXboxInfo::~FUserXboxInfo() +{ + +} + +void PlayFab::AdminModels::FUserXboxInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (XboxUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxUserId")); writer->WriteValue(XboxUserId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserXboxInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr XboxUserIdValue = obj->TryGetField(TEXT("XboxUserId")); + if (XboxUserIdValue.IsValid() && !XboxUserIdValue->IsNull()) + { + FString TmpValue; + if (XboxUserIdValue->TryGetString(TmpValue)) { XboxUserId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUserAccountInfo::~FUserAccountInfo() +{ + //if (AndroidDeviceInfo != nullptr) delete AndroidDeviceInfo; + //if (CustomIdInfo != nullptr) delete CustomIdInfo; + //if (FacebookInfo != nullptr) delete FacebookInfo; + //if (FacebookInstantGamesIdInfo != nullptr) delete FacebookInstantGamesIdInfo; + //if (GameCenterInfo != nullptr) delete GameCenterInfo; + //if (GoogleInfo != nullptr) delete GoogleInfo; + //if (IosDeviceInfo != nullptr) delete IosDeviceInfo; + //if (KongregateInfo != nullptr) delete KongregateInfo; + //if (NintendoSwitchDeviceIdInfo != nullptr) delete NintendoSwitchDeviceIdInfo; + //if (PrivateInfo != nullptr) delete PrivateInfo; + //if (PsnInfo != nullptr) delete PsnInfo; + //if (SteamInfo != nullptr) delete SteamInfo; + //if (TitleInfo != nullptr) delete TitleInfo; + //if (TwitchInfo != nullptr) delete TwitchInfo; + //if (WindowsHelloInfo != nullptr) delete WindowsHelloInfo; + //if (XboxInfo != nullptr) delete XboxInfo; + +} + +void PlayFab::AdminModels::FUserAccountInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceInfo")); AndroidDeviceInfo->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + if (CustomIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("CustomIdInfo")); CustomIdInfo->writeJSON(writer); } + + if (FacebookInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInfo")); FacebookInfo->writeJSON(writer); } + + if (FacebookInstantGamesIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesIdInfo")); FacebookInstantGamesIdInfo->writeJSON(writer); } + + if (GameCenterInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GameCenterInfo")); GameCenterInfo->writeJSON(writer); } + + if (GoogleInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GoogleInfo")); GoogleInfo->writeJSON(writer); } + + if (IosDeviceInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("IosDeviceInfo")); IosDeviceInfo->writeJSON(writer); } + + if (KongregateInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("KongregateInfo")); KongregateInfo->writeJSON(writer); } + + if (NintendoSwitchDeviceIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceIdInfo")); NintendoSwitchDeviceIdInfo->writeJSON(writer); } + + if (OpenIdInfo.Num() != 0) + { + writer->WriteArrayStart(TEXT("OpenIdInfo")); + for (const FUserOpenIdInfo& item : OpenIdInfo) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (PrivateInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PrivateInfo")); PrivateInfo->writeJSON(writer); } + + if (PsnInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PsnInfo")); PsnInfo->writeJSON(writer); } + + if (SteamInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SteamInfo")); SteamInfo->writeJSON(writer); } + + if (TitleInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TitleInfo")); TitleInfo->writeJSON(writer); } + + if (TwitchInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TwitchInfo")); TwitchInfo->writeJSON(writer); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + if (WindowsHelloInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloInfo")); WindowsHelloInfo->writeJSON(writer); } + + if (XboxInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("XboxInfo")); XboxInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUserAccountInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceInfoValue = obj->TryGetField(TEXT("AndroidDeviceInfo")); + if (AndroidDeviceInfoValue.IsValid() && !AndroidDeviceInfoValue->IsNull()) + { + AndroidDeviceInfo = MakeShareable(new FUserAndroidDeviceInfo(AndroidDeviceInfoValue->AsObject())); + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr CustomIdInfoValue = obj->TryGetField(TEXT("CustomIdInfo")); + if (CustomIdInfoValue.IsValid() && !CustomIdInfoValue->IsNull()) + { + CustomIdInfo = MakeShareable(new FUserCustomIdInfo(CustomIdInfoValue->AsObject())); + } + + const TSharedPtr FacebookInfoValue = obj->TryGetField(TEXT("FacebookInfo")); + if (FacebookInfoValue.IsValid() && !FacebookInfoValue->IsNull()) + { + FacebookInfo = MakeShareable(new FUserFacebookInfo(FacebookInfoValue->AsObject())); + } + + const TSharedPtr FacebookInstantGamesIdInfoValue = obj->TryGetField(TEXT("FacebookInstantGamesIdInfo")); + if (FacebookInstantGamesIdInfoValue.IsValid() && !FacebookInstantGamesIdInfoValue->IsNull()) + { + FacebookInstantGamesIdInfo = MakeShareable(new FUserFacebookInstantGamesIdInfo(FacebookInstantGamesIdInfoValue->AsObject())); + } + + const TSharedPtr GameCenterInfoValue = obj->TryGetField(TEXT("GameCenterInfo")); + if (GameCenterInfoValue.IsValid() && !GameCenterInfoValue->IsNull()) + { + GameCenterInfo = MakeShareable(new FUserGameCenterInfo(GameCenterInfoValue->AsObject())); + } + + const TSharedPtr GoogleInfoValue = obj->TryGetField(TEXT("GoogleInfo")); + if (GoogleInfoValue.IsValid() && !GoogleInfoValue->IsNull()) + { + GoogleInfo = MakeShareable(new FUserGoogleInfo(GoogleInfoValue->AsObject())); + } + + const TSharedPtr IosDeviceInfoValue = obj->TryGetField(TEXT("IosDeviceInfo")); + if (IosDeviceInfoValue.IsValid() && !IosDeviceInfoValue->IsNull()) + { + IosDeviceInfo = MakeShareable(new FUserIosDeviceInfo(IosDeviceInfoValue->AsObject())); + } + + const TSharedPtr KongregateInfoValue = obj->TryGetField(TEXT("KongregateInfo")); + if (KongregateInfoValue.IsValid() && !KongregateInfoValue->IsNull()) + { + KongregateInfo = MakeShareable(new FUserKongregateInfo(KongregateInfoValue->AsObject())); + } + + const TSharedPtr NintendoSwitchDeviceIdInfoValue = obj->TryGetField(TEXT("NintendoSwitchDeviceIdInfo")); + if (NintendoSwitchDeviceIdInfoValue.IsValid() && !NintendoSwitchDeviceIdInfoValue->IsNull()) + { + NintendoSwitchDeviceIdInfo = MakeShareable(new FUserNintendoSwitchDeviceIdInfo(NintendoSwitchDeviceIdInfoValue->AsObject())); + } + + const TArray>&OpenIdInfoArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("OpenIdInfo")); + for (int32 Idx = 0; Idx < OpenIdInfoArray.Num(); Idx++) + { + TSharedPtr CurrentItem = OpenIdInfoArray[Idx]; + OpenIdInfo.Add(FUserOpenIdInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PrivateInfoValue = obj->TryGetField(TEXT("PrivateInfo")); + if (PrivateInfoValue.IsValid() && !PrivateInfoValue->IsNull()) + { + PrivateInfo = MakeShareable(new FUserPrivateAccountInfo(PrivateInfoValue->AsObject())); + } + + const TSharedPtr PsnInfoValue = obj->TryGetField(TEXT("PsnInfo")); + if (PsnInfoValue.IsValid() && !PsnInfoValue->IsNull()) + { + PsnInfo = MakeShareable(new FUserPsnInfo(PsnInfoValue->AsObject())); + } + + const TSharedPtr SteamInfoValue = obj->TryGetField(TEXT("SteamInfo")); + if (SteamInfoValue.IsValid() && !SteamInfoValue->IsNull()) + { + SteamInfo = MakeShareable(new FUserSteamInfo(SteamInfoValue->AsObject())); + } + + const TSharedPtr TitleInfoValue = obj->TryGetField(TEXT("TitleInfo")); + if (TitleInfoValue.IsValid() && !TitleInfoValue->IsNull()) + { + TitleInfo = MakeShareable(new FUserTitleInfo(TitleInfoValue->AsObject())); + } + + const TSharedPtr TwitchInfoValue = obj->TryGetField(TEXT("TwitchInfo")); + if (TwitchInfoValue.IsValid() && !TwitchInfoValue->IsNull()) + { + TwitchInfo = MakeShareable(new FUserTwitchInfo(TwitchInfoValue->AsObject())); + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + const TSharedPtr WindowsHelloInfoValue = obj->TryGetField(TEXT("WindowsHelloInfo")); + if (WindowsHelloInfoValue.IsValid() && !WindowsHelloInfoValue->IsNull()) + { + WindowsHelloInfo = MakeShareable(new FUserWindowsHelloInfo(WindowsHelloInfoValue->AsObject())); + } + + const TSharedPtr XboxInfoValue = obj->TryGetField(TEXT("XboxInfo")); + if (XboxInfoValue.IsValid() && !XboxInfoValue->IsNull()) + { + XboxInfo = MakeShareable(new FUserXboxInfo(XboxInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FLookupUserAccountInfoResult::~FLookupUserAccountInfoResult() +{ + //if (UserInfo != nullptr) delete UserInfo; + +} + +void PlayFab::AdminModels::FLookupUserAccountInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (UserInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("UserInfo")); UserInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FLookupUserAccountInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UserInfoValue = obj->TryGetField(TEXT("UserInfo")); + if (UserInfoValue.IsValid() && !UserInfoValue->IsNull()) + { + UserInfo = MakeShareable(new FUserAccountInfo(UserInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FModifyMatchmakerGameModesRequest::~FModifyMatchmakerGameModesRequest() +{ + +} + +void PlayFab::AdminModels::FModifyMatchmakerGameModesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); + + writer->WriteArrayStart(TEXT("GameModes")); + for (const FGameModeInfo& item : GameModes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FModifyMatchmakerGameModesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TArray>&GameModesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GameModes")); + for (int32 Idx = 0; Idx < GameModesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GameModesArray[Idx]; + GameModes.Add(FGameModeInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FModifyMatchmakerGameModesResult::~FModifyMatchmakerGameModesResult() +{ + +} + +void PlayFab::AdminModels::FModifyMatchmakerGameModesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FModifyMatchmakerGameModesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FModifyServerBuildRequest::~FModifyServerBuildRequest() +{ + +} + +void PlayFab::AdminModels::FModifyServerBuildRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ActiveRegions.Num() != 0) + { + writer->WriteArrayStart(TEXT("ActiveRegions")); + for (const Region& item : ActiveRegions) + writeRegionEnumJSON(item, writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); + + if (CommandLineTemplate.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CommandLineTemplate")); writer->WriteValue(CommandLineTemplate); } + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + if (ExecutablePath.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ExecutablePath")); writer->WriteValue(ExecutablePath); } + + writer->WriteIdentifierPrefix(TEXT("MaxGamesPerHost")); writer->WriteValue(MaxGamesPerHost); + + writer->WriteIdentifierPrefix(TEXT("MinFreeGameSlots")); writer->WriteValue(MinFreeGameSlots); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FModifyServerBuildRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ActiveRegionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ActiveRegions")); + for (int32 Idx = 0; Idx < ActiveRegionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ActiveRegionsArray[Idx]; + ActiveRegions.Add(readRegionFromValue(CurrentItem)); + } + + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + const TSharedPtr CommandLineTemplateValue = obj->TryGetField(TEXT("CommandLineTemplate")); + if (CommandLineTemplateValue.IsValid() && !CommandLineTemplateValue->IsNull()) + { + FString TmpValue; + if (CommandLineTemplateValue->TryGetString(TmpValue)) { CommandLineTemplate = TmpValue; } + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ExecutablePathValue = obj->TryGetField(TEXT("ExecutablePath")); + if (ExecutablePathValue.IsValid() && !ExecutablePathValue->IsNull()) + { + FString TmpValue; + if (ExecutablePathValue->TryGetString(TmpValue)) { ExecutablePath = TmpValue; } + } + + const TSharedPtr MaxGamesPerHostValue = obj->TryGetField(TEXT("MaxGamesPerHost")); + if (MaxGamesPerHostValue.IsValid() && !MaxGamesPerHostValue->IsNull()) + { + int32 TmpValue; + if (MaxGamesPerHostValue->TryGetNumber(TmpValue)) { MaxGamesPerHost = TmpValue; } + } + + const TSharedPtr MinFreeGameSlotsValue = obj->TryGetField(TEXT("MinFreeGameSlots")); + if (MinFreeGameSlotsValue.IsValid() && !MinFreeGameSlotsValue->IsNull()) + { + int32 TmpValue; + if (MinFreeGameSlotsValue->TryGetNumber(TmpValue)) { MinFreeGameSlots = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + +PlayFab::AdminModels::FModifyServerBuildResult::~FModifyServerBuildResult() +{ + +} + +void PlayFab::AdminModels::FModifyServerBuildResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ActiveRegions.Num() != 0) + { + writer->WriteArrayStart(TEXT("ActiveRegions")); + for (const Region& item : ActiveRegions) + writeRegionEnumJSON(item, writer); + writer->WriteArrayEnd(); + } + + + if (BuildId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); } + + if (CommandLineTemplate.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CommandLineTemplate")); writer->WriteValue(CommandLineTemplate); } + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + if (ExecutablePath.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ExecutablePath")); writer->WriteValue(ExecutablePath); } + + writer->WriteIdentifierPrefix(TEXT("MaxGamesPerHost")); writer->WriteValue(MaxGamesPerHost); + + writer->WriteIdentifierPrefix(TEXT("MinFreeGameSlots")); writer->WriteValue(MinFreeGameSlots); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeGameBuildStatusEnumJSON(Status, writer); } + + writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FModifyServerBuildResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ActiveRegionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ActiveRegions")); + for (int32 Idx = 0; Idx < ActiveRegionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ActiveRegionsArray[Idx]; + ActiveRegions.Add(readRegionFromValue(CurrentItem)); + } + + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + const TSharedPtr CommandLineTemplateValue = obj->TryGetField(TEXT("CommandLineTemplate")); + if (CommandLineTemplateValue.IsValid() && !CommandLineTemplateValue->IsNull()) + { + FString TmpValue; + if (CommandLineTemplateValue->TryGetString(TmpValue)) { CommandLineTemplate = TmpValue; } + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ExecutablePathValue = obj->TryGetField(TEXT("ExecutablePath")); + if (ExecutablePathValue.IsValid() && !ExecutablePathValue->IsNull()) + { + FString TmpValue; + if (ExecutablePathValue->TryGetString(TmpValue)) { ExecutablePath = TmpValue; } + } + + const TSharedPtr MaxGamesPerHostValue = obj->TryGetField(TEXT("MaxGamesPerHost")); + if (MaxGamesPerHostValue.IsValid() && !MaxGamesPerHostValue->IsNull()) + { + int32 TmpValue; + if (MaxGamesPerHostValue->TryGetNumber(TmpValue)) { MaxGamesPerHost = TmpValue; } + } + + const TSharedPtr MinFreeGameSlotsValue = obj->TryGetField(TEXT("MinFreeGameSlots")); + if (MinFreeGameSlotsValue.IsValid() && !MinFreeGameSlotsValue->IsNull()) + { + int32 TmpValue; + if (MinFreeGameSlotsValue->TryGetNumber(TmpValue)) { MinFreeGameSlots = TmpValue; } + } + + Status = readGameBuildStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FModifyUserVirtualCurrencyResult::~FModifyUserVirtualCurrencyResult() +{ + +} + +void PlayFab::AdminModels::FModifyUserVirtualCurrencyResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Balance")); writer->WriteValue(Balance); + + writer->WriteIdentifierPrefix(TEXT("BalanceChange")); writer->WriteValue(BalanceChange); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (VirtualCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FModifyUserVirtualCurrencyResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BalanceValue = obj->TryGetField(TEXT("Balance")); + if (BalanceValue.IsValid() && !BalanceValue->IsNull()) + { + int32 TmpValue; + if (BalanceValue->TryGetNumber(TmpValue)) { Balance = TmpValue; } + } + + const TSharedPtr BalanceChangeValue = obj->TryGetField(TEXT("BalanceChange")); + if (BalanceChangeValue.IsValid() && !BalanceChangeValue->IsNull()) + { + int32 TmpValue; + if (BalanceChangeValue->TryGetNumber(TmpValue)) { BalanceChange = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writePushSetupPlatformEnumJSON(PushSetupPlatform enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case PushSetupPlatformGCM: writer->WriteValue(TEXT("GCM")); break; + case PushSetupPlatformAPNS: writer->WriteValue(TEXT("APNS")); break; + case PushSetupPlatformAPNS_SANDBOX: writer->WriteValue(TEXT("APNS_SANDBOX")); break; + } +} + +AdminModels::PushSetupPlatform PlayFab::AdminModels::readPushSetupPlatformFromValue(const TSharedPtr& value) +{ + return readPushSetupPlatformFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::PushSetupPlatform PlayFab::AdminModels::readPushSetupPlatformFromValue(const FString& value) +{ + static TMap _PushSetupPlatformMap; + if (_PushSetupPlatformMap.Num() == 0) + { + // Auto-generate the map on the first use + _PushSetupPlatformMap.Add(TEXT("GCM"), PushSetupPlatformGCM); + _PushSetupPlatformMap.Add(TEXT("APNS"), PushSetupPlatformAPNS); + _PushSetupPlatformMap.Add(TEXT("APNS_SANDBOX"), PushSetupPlatformAPNS_SANDBOX); + + } + + if (!value.IsEmpty()) + { + auto output = _PushSetupPlatformMap.Find(value); + if (output != nullptr) + return *output; + } + + return PushSetupPlatformGCM; // Basically critical fail +} + +PlayFab::AdminModels::FRandomResultTable::~FRandomResultTable() +{ + +} + +void PlayFab::AdminModels::FRandomResultTable::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Nodes")); + for (const FResultTableNode& item : Nodes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("TableId")); writer->WriteValue(TableId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRandomResultTable::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&NodesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Nodes")); + for (int32 Idx = 0; Idx < NodesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = NodesArray[Idx]; + Nodes.Add(FResultTableNode(CurrentItem->AsObject())); + } + + + const TSharedPtr TableIdValue = obj->TryGetField(TEXT("TableId")); + if (TableIdValue.IsValid() && !TableIdValue->IsNull()) + { + FString TmpValue; + if (TableIdValue->TryGetString(TmpValue)) { TableId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRefundPurchaseRequest::~FRefundPurchaseRequest() +{ + +} + +void PlayFab::AdminModels::FRefundPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRefundPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRefundPurchaseResponse::~FRefundPurchaseResponse() +{ + +} + +void PlayFab::AdminModels::FRefundPurchaseResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PurchaseStatus.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PurchaseStatus")); writer->WriteValue(PurchaseStatus); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRefundPurchaseResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PurchaseStatusValue = obj->TryGetField(TEXT("PurchaseStatus")); + if (PurchaseStatusValue.IsValid() && !PurchaseStatusValue->IsNull()) + { + FString TmpValue; + if (PurchaseStatusValue->TryGetString(TmpValue)) { PurchaseStatus = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRemovePlayerTagRequest::~FRemovePlayerTagRequest() +{ + +} + +void PlayFab::AdminModels::FRemovePlayerTagRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("TagName")); writer->WriteValue(TagName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRemovePlayerTagRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TagNameValue = obj->TryGetField(TEXT("TagName")); + if (TagNameValue.IsValid() && !TagNameValue->IsNull()) + { + FString TmpValue; + if (TagNameValue->TryGetString(TmpValue)) { TagName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRemovePlayerTagResult::~FRemovePlayerTagResult() +{ + +} + +void PlayFab::AdminModels::FRemovePlayerTagResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRemovePlayerTagResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FRemoveServerBuildRequest::~FRemoveServerBuildRequest() +{ + +} + +void PlayFab::AdminModels::FRemoveServerBuildRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildId")); writer->WriteValue(BuildId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRemoveServerBuildRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildIdValue = obj->TryGetField(TEXT("BuildId")); + if (BuildIdValue.IsValid() && !BuildIdValue->IsNull()) + { + FString TmpValue; + if (BuildIdValue->TryGetString(TmpValue)) { BuildId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRemoveServerBuildResult::~FRemoveServerBuildResult() +{ + +} + +void PlayFab::AdminModels::FRemoveServerBuildResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRemoveServerBuildResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FRemoveVirtualCurrencyTypesRequest::~FRemoveVirtualCurrencyTypesRequest() +{ + +} + +void PlayFab::AdminModels::FRemoveVirtualCurrencyTypesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("VirtualCurrencies")); + for (const FVirtualCurrencyData& item : VirtualCurrencies) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRemoveVirtualCurrencyTypesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&VirtualCurrenciesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("VirtualCurrencies")); + for (int32 Idx = 0; Idx < VirtualCurrenciesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = VirtualCurrenciesArray[Idx]; + VirtualCurrencies.Add(FVirtualCurrencyData(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FResetCharacterStatisticsRequest::~FResetCharacterStatisticsRequest() +{ + +} + +void PlayFab::AdminModels::FResetCharacterStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResetCharacterStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FResetCharacterStatisticsResult::~FResetCharacterStatisticsResult() +{ + +} + +void PlayFab::AdminModels::FResetCharacterStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResetCharacterStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FResetPasswordRequest::~FResetPasswordRequest() +{ + +} + +void PlayFab::AdminModels::FResetPasswordRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Password")); writer->WriteValue(Password); + + writer->WriteIdentifierPrefix(TEXT("Token")); writer->WriteValue(Token); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResetPasswordRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PasswordValue = obj->TryGetField(TEXT("Password")); + if (PasswordValue.IsValid() && !PasswordValue->IsNull()) + { + FString TmpValue; + if (PasswordValue->TryGetString(TmpValue)) { Password = TmpValue; } + } + + const TSharedPtr TokenValue = obj->TryGetField(TEXT("Token")); + if (TokenValue.IsValid() && !TokenValue->IsNull()) + { + FString TmpValue; + if (TokenValue->TryGetString(TmpValue)) { Token = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FResetPasswordResult::~FResetPasswordResult() +{ + +} + +void PlayFab::AdminModels::FResetPasswordResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResetPasswordResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FResetUserStatisticsRequest::~FResetUserStatisticsRequest() +{ + +} + +void PlayFab::AdminModels::FResetUserStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResetUserStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FResetUserStatisticsResult::~FResetUserStatisticsResult() +{ + +} + +void PlayFab::AdminModels::FResetUserStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResetUserStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeResolutionOutcomeEnumJSON(ResolutionOutcome enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ResolutionOutcomeRevoke: writer->WriteValue(TEXT("Revoke")); break; + case ResolutionOutcomeReinstate: writer->WriteValue(TEXT("Reinstate")); break; + case ResolutionOutcomeManual: writer->WriteValue(TEXT("Manual")); break; + } +} + +AdminModels::ResolutionOutcome PlayFab::AdminModels::readResolutionOutcomeFromValue(const TSharedPtr& value) +{ + return readResolutionOutcomeFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::ResolutionOutcome PlayFab::AdminModels::readResolutionOutcomeFromValue(const FString& value) +{ + static TMap _ResolutionOutcomeMap; + if (_ResolutionOutcomeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ResolutionOutcomeMap.Add(TEXT("Revoke"), ResolutionOutcomeRevoke); + _ResolutionOutcomeMap.Add(TEXT("Reinstate"), ResolutionOutcomeReinstate); + _ResolutionOutcomeMap.Add(TEXT("Manual"), ResolutionOutcomeManual); + + } + + if (!value.IsEmpty()) + { + auto output = _ResolutionOutcomeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ResolutionOutcomeRevoke; // Basically critical fail +} + +PlayFab::AdminModels::FResolvePurchaseDisputeRequest::~FResolvePurchaseDisputeRequest() +{ + +} + +void PlayFab::AdminModels::FResolvePurchaseDisputeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); + + writer->WriteIdentifierPrefix(TEXT("Outcome")); writeResolutionOutcomeEnumJSON(Outcome, writer); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResolvePurchaseDisputeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + Outcome = readResolutionOutcomeFromValue(obj->TryGetField(TEXT("Outcome"))); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FResolvePurchaseDisputeResponse::~FResolvePurchaseDisputeResponse() +{ + +} + +void PlayFab::AdminModels::FResolvePurchaseDisputeResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PurchaseStatus.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PurchaseStatus")); writer->WriteValue(PurchaseStatus); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FResolvePurchaseDisputeResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PurchaseStatusValue = obj->TryGetField(TEXT("PurchaseStatus")); + if (PurchaseStatusValue.IsValid() && !PurchaseStatusValue->IsNull()) + { + FString TmpValue; + if (PurchaseStatusValue->TryGetString(TmpValue)) { PurchaseStatus = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeAllBansForUserRequest::~FRevokeAllBansForUserRequest() +{ + +} + +void PlayFab::AdminModels::FRevokeAllBansForUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeAllBansForUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeAllBansForUserResult::~FRevokeAllBansForUserResult() +{ + +} + +void PlayFab::AdminModels::FRevokeAllBansForUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeAllBansForUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeBansRequest::~FRevokeBansRequest() +{ + +} + +void PlayFab::AdminModels::FRevokeBansRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("BanIds")); + for (const FString& item : BanIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeBansRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("BanIds"), BanIds); + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeBansResult::~FRevokeBansResult() +{ + +} + +void PlayFab::AdminModels::FRevokeBansResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeBansResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeInventoryItem::~FRevokeInventoryItem() +{ + +} + +void PlayFab::AdminModels::FRevokeInventoryItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeInventoryItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeInventoryItemRequest::~FRevokeInventoryItemRequest() +{ + +} + +void PlayFab::AdminModels::FRevokeInventoryItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeInventoryItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeInventoryItemsRequest::~FRevokeInventoryItemsRequest() +{ + +} + +void PlayFab::AdminModels::FRevokeInventoryItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Items")); + for (const FRevokeInventoryItem& item : Items) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeInventoryItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Items")); + for (int32 Idx = 0; Idx < ItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemsArray[Idx]; + Items.Add(FRevokeInventoryItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeItemError::~FRevokeItemError() +{ + //if (Item != nullptr) delete Item; + +} + +void PlayFab::AdminModels::FRevokeItemError::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + if (Item.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Item")); Item->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeItemError::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr ItemValue = obj->TryGetField(TEXT("Item")); + if (ItemValue.IsValid() && !ItemValue->IsNull()) + { + Item = MakeShareable(new FRevokeInventoryItem(ItemValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeInventoryItemsResult::~FRevokeInventoryItemsResult() +{ + +} + +void PlayFab::AdminModels::FRevokeInventoryItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Errors.Num() != 0) + { + writer->WriteArrayStart(TEXT("Errors")); + for (const FRevokeItemError& item : Errors) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeInventoryItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ErrorsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Errors")); + for (int32 Idx = 0; Idx < ErrorsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ErrorsArray[Idx]; + Errors.Add(FRevokeItemError(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FRevokeInventoryResult::~FRevokeInventoryResult() +{ + +} + +void PlayFab::AdminModels::FRevokeInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRevokeInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FRunTaskRequest::~FRunTaskRequest() +{ + //if (Identifier != nullptr) delete Identifier; + +} + +void PlayFab::AdminModels::FRunTaskRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Identifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Identifier")); Identifier->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRunTaskRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdentifierValue = obj->TryGetField(TEXT("Identifier")); + if (IdentifierValue.IsValid() && !IdentifierValue->IsNull()) + { + Identifier = MakeShareable(new FNameIdentifier(IdentifierValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FRunTaskResult::~FRunTaskResult() +{ + +} + +void PlayFab::AdminModels::FRunTaskResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TaskInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TaskInstanceId")); writer->WriteValue(TaskInstanceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FRunTaskResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TaskInstanceIdValue = obj->TryGetField(TEXT("TaskInstanceId")); + if (TaskInstanceIdValue.IsValid() && !TaskInstanceIdValue->IsNull()) + { + FString TmpValue; + if (TaskInstanceIdValue->TryGetString(TmpValue)) { TaskInstanceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FSendAccountRecoveryEmailRequest::~FSendAccountRecoveryEmailRequest() +{ + +} + +void PlayFab::AdminModels::FSendAccountRecoveryEmailRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); + + if (EmailTemplateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailTemplateId")); writer->WriteValue(EmailTemplateId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSendAccountRecoveryEmailRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr EmailTemplateIdValue = obj->TryGetField(TEXT("EmailTemplateId")); + if (EmailTemplateIdValue.IsValid() && !EmailTemplateIdValue->IsNull()) + { + FString TmpValue; + if (EmailTemplateIdValue->TryGetString(TmpValue)) { EmailTemplateId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FSendAccountRecoveryEmailResult::~FSendAccountRecoveryEmailResult() +{ + +} + +void PlayFab::AdminModels::FSendAccountRecoveryEmailResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSendAccountRecoveryEmailResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetPlayerSecretRequest::~FSetPlayerSecretRequest() +{ + +} + +void PlayFab::AdminModels::FSetPlayerSecretRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetPlayerSecretRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetPlayerSecretResult::~FSetPlayerSecretResult() +{ + +} + +void PlayFab::AdminModels::FSetPlayerSecretResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetPlayerSecretResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetPublishedRevisionRequest::~FSetPublishedRevisionRequest() +{ + +} + +void PlayFab::AdminModels::FSetPublishedRevisionRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetPublishedRevisionRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetPublishedRevisionResult::~FSetPublishedRevisionResult() +{ + +} + +void PlayFab::AdminModels::FSetPublishedRevisionResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetPublishedRevisionResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetPublisherDataRequest::~FSetPublisherDataRequest() +{ + +} + +void PlayFab::AdminModels::FSetPublisherDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetPublisherDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetPublisherDataResult::~FSetPublisherDataResult() +{ + +} + +void PlayFab::AdminModels::FSetPublisherDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetPublisherDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetTitleDataRequest::~FSetTitleDataRequest() +{ + +} + +void PlayFab::AdminModels::FSetTitleDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetTitleDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetTitleDataResult::~FSetTitleDataResult() +{ + +} + +void PlayFab::AdminModels::FSetTitleDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetTitleDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetupPushNotificationRequest::~FSetupPushNotificationRequest() +{ + +} + +void PlayFab::AdminModels::FSetupPushNotificationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Credential")); writer->WriteValue(Credential); + + if (Key.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); } + + writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); + + writer->WriteIdentifierPrefix(TEXT("OverwriteOldARN")); writer->WriteValue(OverwriteOldARN); + + writer->WriteIdentifierPrefix(TEXT("Platform")); writePushSetupPlatformEnumJSON(Platform, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetupPushNotificationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CredentialValue = obj->TryGetField(TEXT("Credential")); + if (CredentialValue.IsValid() && !CredentialValue->IsNull()) + { + FString TmpValue; + if (CredentialValue->TryGetString(TmpValue)) { Credential = TmpValue; } + } + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr OverwriteOldARNValue = obj->TryGetField(TEXT("OverwriteOldARN")); + if (OverwriteOldARNValue.IsValid() && !OverwriteOldARNValue->IsNull()) + { + bool TmpValue; + if (OverwriteOldARNValue->TryGetBool(TmpValue)) { OverwriteOldARN = TmpValue; } + } + + Platform = readPushSetupPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FSetupPushNotificationResult::~FSetupPushNotificationResult() +{ + +} + +void PlayFab::AdminModels::FSetupPushNotificationResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ARN.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ARN")); writer->WriteValue(ARN); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSetupPushNotificationResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ARNValue = obj->TryGetField(TEXT("ARN")); + if (ARNValue.IsValid() && !ARNValue->IsNull()) + { + FString TmpValue; + if (ARNValue->TryGetString(TmpValue)) { ARN = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::AdminModels::writeStatisticVersionArchivalStatusEnumJSON(StatisticVersionArchivalStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case StatisticVersionArchivalStatusNotScheduled: writer->WriteValue(TEXT("NotScheduled")); break; + case StatisticVersionArchivalStatusScheduled: writer->WriteValue(TEXT("Scheduled")); break; + case StatisticVersionArchivalStatusQueued: writer->WriteValue(TEXT("Queued")); break; + case StatisticVersionArchivalStatusInProgress: writer->WriteValue(TEXT("InProgress")); break; + case StatisticVersionArchivalStatusComplete: writer->WriteValue(TEXT("Complete")); break; + } +} + +AdminModels::StatisticVersionArchivalStatus PlayFab::AdminModels::readStatisticVersionArchivalStatusFromValue(const TSharedPtr& value) +{ + return readStatisticVersionArchivalStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +AdminModels::StatisticVersionArchivalStatus PlayFab::AdminModels::readStatisticVersionArchivalStatusFromValue(const FString& value) +{ + static TMap _StatisticVersionArchivalStatusMap; + if (_StatisticVersionArchivalStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _StatisticVersionArchivalStatusMap.Add(TEXT("NotScheduled"), StatisticVersionArchivalStatusNotScheduled); + _StatisticVersionArchivalStatusMap.Add(TEXT("Scheduled"), StatisticVersionArchivalStatusScheduled); + _StatisticVersionArchivalStatusMap.Add(TEXT("Queued"), StatisticVersionArchivalStatusQueued); + _StatisticVersionArchivalStatusMap.Add(TEXT("InProgress"), StatisticVersionArchivalStatusInProgress); + _StatisticVersionArchivalStatusMap.Add(TEXT("Complete"), StatisticVersionArchivalStatusComplete); + + } + + if (!value.IsEmpty()) + { + auto output = _StatisticVersionArchivalStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return StatisticVersionArchivalStatusNotScheduled; // Basically critical fail +} + +PlayFab::AdminModels::FSubtractUserVirtualCurrencyRequest::~FSubtractUserVirtualCurrencyRequest() +{ + +} + +void PlayFab::AdminModels::FSubtractUserVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FSubtractUserVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateBanRequest::~FUpdateBanRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateBanRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Active.notNull()) { writer->WriteIdentifierPrefix(TEXT("Active")); writer->WriteValue(Active); } + + writer->WriteIdentifierPrefix(TEXT("BanId")); writer->WriteValue(BanId); + + if (Expires.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); } + + if (IPAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IPAddress")); writer->WriteValue(IPAddress); } + + if (MACAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MACAddress")); writer->WriteValue(MACAddress); } + + if (Permanent.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permanent")); writer->WriteValue(Permanent); } + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateBanRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActiveValue = obj->TryGetField(TEXT("Active")); + if (ActiveValue.IsValid() && !ActiveValue->IsNull()) + { + bool TmpValue; + if (ActiveValue->TryGetBool(TmpValue)) { Active = TmpValue; } + } + + const TSharedPtr BanIdValue = obj->TryGetField(TEXT("BanId")); + if (BanIdValue.IsValid() && !BanIdValue->IsNull()) + { + FString TmpValue; + if (BanIdValue->TryGetString(TmpValue)) { BanId = TmpValue; } + } + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr IPAddressValue = obj->TryGetField(TEXT("IPAddress")); + if (IPAddressValue.IsValid() && !IPAddressValue->IsNull()) + { + FString TmpValue; + if (IPAddressValue->TryGetString(TmpValue)) { IPAddress = TmpValue; } + } + + const TSharedPtr MACAddressValue = obj->TryGetField(TEXT("MACAddress")); + if (MACAddressValue.IsValid() && !MACAddressValue->IsNull()) + { + FString TmpValue; + if (MACAddressValue->TryGetString(TmpValue)) { MACAddress = TmpValue; } + } + + const TSharedPtr PermanentValue = obj->TryGetField(TEXT("Permanent")); + if (PermanentValue.IsValid() && !PermanentValue->IsNull()) + { + bool TmpValue; + if (PermanentValue->TryGetBool(TmpValue)) { Permanent = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateBansRequest::~FUpdateBansRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateBansRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Bans")); + for (const FUpdateBanRequest& item : Bans) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateBansRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BansArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Bans")); + for (int32 Idx = 0; Idx < BansArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BansArray[Idx]; + Bans.Add(FUpdateBanRequest(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateBansResult::~FUpdateBansResult() +{ + +} + +void PlayFab::AdminModels::FUpdateBansResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateBansResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateCatalogItemsRequest::~FUpdateCatalogItemsRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateCatalogItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Catalog.Num() != 0) + { + writer->WriteArrayStart(TEXT("Catalog")); + for (const FCatalogItem& item : Catalog) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (SetAsDefaultCatalog.notNull()) { writer->WriteIdentifierPrefix(TEXT("SetAsDefaultCatalog")); writer->WriteValue(SetAsDefaultCatalog); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateCatalogItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&CatalogArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Catalog")); + for (int32 Idx = 0; Idx < CatalogArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CatalogArray[Idx]; + Catalog.Add(FCatalogItem(CurrentItem->AsObject())); + } + + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr SetAsDefaultCatalogValue = obj->TryGetField(TEXT("SetAsDefaultCatalog")); + if (SetAsDefaultCatalogValue.IsValid() && !SetAsDefaultCatalogValue->IsNull()) + { + bool TmpValue; + if (SetAsDefaultCatalogValue->TryGetBool(TmpValue)) { SetAsDefaultCatalog = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateCatalogItemsResult::~FUpdateCatalogItemsResult() +{ + +} + +void PlayFab::AdminModels::FUpdateCatalogItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateCatalogItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateCloudScriptRequest::~FUpdateCloudScriptRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateCloudScriptRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DeveloperPlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeveloperPlayFabId")); writer->WriteValue(DeveloperPlayFabId); } + + writer->WriteArrayStart(TEXT("Files")); + for (const FCloudScriptFile& item : Files) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("Publish")); writer->WriteValue(Publish); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateCloudScriptRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DeveloperPlayFabIdValue = obj->TryGetField(TEXT("DeveloperPlayFabId")); + if (DeveloperPlayFabIdValue.IsValid() && !DeveloperPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (DeveloperPlayFabIdValue->TryGetString(TmpValue)) { DeveloperPlayFabId = TmpValue; } + } + + const TArray>&FilesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Files")); + for (int32 Idx = 0; Idx < FilesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = FilesArray[Idx]; + Files.Add(FCloudScriptFile(CurrentItem->AsObject())); + } + + + const TSharedPtr PublishValue = obj->TryGetField(TEXT("Publish")); + if (PublishValue.IsValid() && !PublishValue->IsNull()) + { + bool TmpValue; + if (PublishValue->TryGetBool(TmpValue)) { Publish = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateCloudScriptResult::~FUpdateCloudScriptResult() +{ + +} + +void PlayFab::AdminModels::FUpdateCloudScriptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateCloudScriptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdatePlayerSharedSecretRequest::~FUpdatePlayerSharedSecretRequest() +{ + +} + +void PlayFab::AdminModels::FUpdatePlayerSharedSecretRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Disabled")); writer->WriteValue(Disabled); + + if (FriendlyName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendlyName")); writer->WriteValue(FriendlyName); } + + if (SecretKey.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SecretKey")); writer->WriteValue(SecretKey); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdatePlayerSharedSecretRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisabledValue = obj->TryGetField(TEXT("Disabled")); + if (DisabledValue.IsValid() && !DisabledValue->IsNull()) + { + bool TmpValue; + if (DisabledValue->TryGetBool(TmpValue)) { Disabled = TmpValue; } + } + + const TSharedPtr FriendlyNameValue = obj->TryGetField(TEXT("FriendlyName")); + if (FriendlyNameValue.IsValid() && !FriendlyNameValue->IsNull()) + { + FString TmpValue; + if (FriendlyNameValue->TryGetString(TmpValue)) { FriendlyName = TmpValue; } + } + + const TSharedPtr SecretKeyValue = obj->TryGetField(TEXT("SecretKey")); + if (SecretKeyValue.IsValid() && !SecretKeyValue->IsNull()) + { + FString TmpValue; + if (SecretKeyValue->TryGetString(TmpValue)) { SecretKey = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdatePlayerSharedSecretResult::~FUpdatePlayerSharedSecretResult() +{ + +} + +void PlayFab::AdminModels::FUpdatePlayerSharedSecretResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdatePlayerSharedSecretResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdatePlayerStatisticDefinitionRequest::~FUpdatePlayerStatisticDefinitionRequest() +{ + +} + +void PlayFab::AdminModels::FUpdatePlayerStatisticDefinitionRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AggregationMethod.notNull()) { writer->WriteIdentifierPrefix(TEXT("AggregationMethod")); writeStatisticAggregationMethodEnumJSON(AggregationMethod, writer); } + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (VersionChangeInterval.notNull()) { writer->WriteIdentifierPrefix(TEXT("VersionChangeInterval")); writeStatisticResetIntervalOptionEnumJSON(VersionChangeInterval, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdatePlayerStatisticDefinitionRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + AggregationMethod = readStatisticAggregationMethodFromValue(obj->TryGetField(TEXT("AggregationMethod"))); + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + VersionChangeInterval = readStatisticResetIntervalOptionFromValue(obj->TryGetField(TEXT("VersionChangeInterval"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdatePlayerStatisticDefinitionResult::~FUpdatePlayerStatisticDefinitionResult() +{ + //if (Statistic != nullptr) delete Statistic; + +} + +void PlayFab::AdminModels::FUpdatePlayerStatisticDefinitionResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Statistic.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Statistic")); Statistic->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdatePlayerStatisticDefinitionResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticValue = obj->TryGetField(TEXT("Statistic")); + if (StatisticValue.IsValid() && !StatisticValue->IsNull()) + { + Statistic = MakeShareable(new FPlayerStatisticDefinition(StatisticValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdatePolicyRequest::~FUpdatePolicyRequest() +{ + +} + +void PlayFab::AdminModels::FUpdatePolicyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("OverwritePolicy")); writer->WriteValue(OverwritePolicy); + + writer->WriteIdentifierPrefix(TEXT("PolicyName")); writer->WriteValue(PolicyName); + + writer->WriteArrayStart(TEXT("Statements")); + for (const FPermissionStatement& item : Statements) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdatePolicyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OverwritePolicyValue = obj->TryGetField(TEXT("OverwritePolicy")); + if (OverwritePolicyValue.IsValid() && !OverwritePolicyValue->IsNull()) + { + bool TmpValue; + if (OverwritePolicyValue->TryGetBool(TmpValue)) { OverwritePolicy = TmpValue; } + } + + const TSharedPtr PolicyNameValue = obj->TryGetField(TEXT("PolicyName")); + if (PolicyNameValue.IsValid() && !PolicyNameValue->IsNull()) + { + FString TmpValue; + if (PolicyNameValue->TryGetString(TmpValue)) { PolicyName = TmpValue; } + } + + const TArray>&StatementsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statements")); + for (int32 Idx = 0; Idx < StatementsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatementsArray[Idx]; + Statements.Add(FPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdatePolicyResponse::~FUpdatePolicyResponse() +{ + +} + +void PlayFab::AdminModels::FUpdatePolicyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PolicyName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PolicyName")); writer->WriteValue(PolicyName); } + + if (Statements.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statements")); + for (const FPermissionStatement& item : Statements) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdatePolicyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PolicyNameValue = obj->TryGetField(TEXT("PolicyName")); + if (PolicyNameValue.IsValid() && !PolicyNameValue->IsNull()) + { + FString TmpValue; + if (PolicyNameValue->TryGetString(TmpValue)) { PolicyName = TmpValue; } + } + + const TArray>&StatementsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statements")); + for (int32 Idx = 0; Idx < StatementsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatementsArray[Idx]; + Statements.Add(FPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateRandomResultTablesRequest::~FUpdateRandomResultTablesRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateRandomResultTablesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (Tables.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tables")); + for (const FRandomResultTable& item : Tables) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateRandomResultTablesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TArray>&TablesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Tables")); + for (int32 Idx = 0; Idx < TablesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = TablesArray[Idx]; + Tables.Add(FRandomResultTable(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateRandomResultTablesResult::~FUpdateRandomResultTablesResult() +{ + +} + +void PlayFab::AdminModels::FUpdateRandomResultTablesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateRandomResultTablesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateStoreItemsRequest::~FUpdateStoreItemsRequest() +{ + //if (MarketingData != nullptr) delete MarketingData; + +} + +void PlayFab::AdminModels::FUpdateStoreItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (MarketingData.IsValid()) { writer->WriteIdentifierPrefix(TEXT("MarketingData")); MarketingData->writeJSON(writer); } + + if (Store.Num() != 0) + { + writer->WriteArrayStart(TEXT("Store")); + for (const FStoreItem& item : Store) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateStoreItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr MarketingDataValue = obj->TryGetField(TEXT("MarketingData")); + if (MarketingDataValue.IsValid() && !MarketingDataValue->IsNull()) + { + MarketingData = MakeShareable(new FStoreMarketingModel(MarketingDataValue->AsObject())); + } + + const TArray>&StoreArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Store")); + for (int32 Idx = 0; Idx < StoreArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StoreArray[Idx]; + Store.Add(FStoreItem(CurrentItem->AsObject())); + } + + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateStoreItemsResult::~FUpdateStoreItemsResult() +{ + +} + +void PlayFab::AdminModels::FUpdateStoreItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateStoreItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateTaskRequest::~FUpdateTaskRequest() +{ + //if (Identifier != nullptr) delete Identifier; + +} + +void PlayFab::AdminModels::FUpdateTaskRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (Identifier.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Identifier")); Identifier->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); + + if (Parameter.notNull()) { writer->WriteIdentifierPrefix(TEXT("Parameter")); Parameter.writeJSON(writer); } + + if (Schedule.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Schedule")); writer->WriteValue(Schedule); } + + writer->WriteIdentifierPrefix(TEXT("Type")); writeScheduledTaskTypeEnumJSON(Type, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateTaskRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr IdentifierValue = obj->TryGetField(TEXT("Identifier")); + if (IdentifierValue.IsValid() && !IdentifierValue->IsNull()) + { + Identifier = MakeShareable(new FNameIdentifier(IdentifierValue->AsObject())); + } + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr ParameterValue = obj->TryGetField(TEXT("Parameter")); + if (ParameterValue.IsValid() && !ParameterValue->IsNull()) + { + Parameter = FJsonKeeper(ParameterValue); + } + + const TSharedPtr ScheduleValue = obj->TryGetField(TEXT("Schedule")); + if (ScheduleValue.IsValid() && !ScheduleValue->IsNull()) + { + FString TmpValue; + if (ScheduleValue->TryGetString(TmpValue)) { Schedule = TmpValue; } + } + + Type = readScheduledTaskTypeFromValue(obj->TryGetField(TEXT("Type"))); + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateUserDataRequest::~FUpdateUserDataRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateUserDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateUserDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateUserDataResult::~FUpdateUserDataResult() +{ + +} + +void PlayFab::AdminModels::FUpdateUserDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateUserDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateUserInternalDataRequest::~FUpdateUserInternalDataRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateUserInternalDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateUserInternalDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateUserTitleDisplayNameRequest::~FUpdateUserTitleDisplayNameRequest() +{ + +} + +void PlayFab::AdminModels::FUpdateUserTitleDisplayNameRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateUserTitleDisplayNameRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AdminModels::FUpdateUserTitleDisplayNameResult::~FUpdateUserTitleDisplayNameResult() +{ + +} + +void PlayFab::AdminModels::FUpdateUserTitleDisplayNameResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AdminModels::FUpdateUserTitleDisplayNameResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + return HasSucceeded; +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAuthenticationAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAuthenticationAPI.cpp new file mode 100644 index 000000000..1c980fdae --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAuthenticationAPI.cpp @@ -0,0 +1,73 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabAuthenticationAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::AuthenticationModels; + +UPlayFabAuthenticationAPI::UPlayFabAuthenticationAPI() {} + +UPlayFabAuthenticationAPI::~UPlayFabAuthenticationAPI() {} + +int UPlayFabAuthenticationAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabAuthenticationAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabAuthenticationAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabAuthenticationAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabAuthenticationAPI::GetEntityToken( + AuthenticationModels::FGetEntityTokenRequest& request, + const FGetEntityTokenDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + FString authKey; FString authValue; + if (PlayFabSettings::GetEntityToken().Len() > 0) { + authKey = TEXT("X-EntityToken"); authValue = PlayFabSettings::GetEntityToken(); + } else if (PlayFabSettings::GetClientSessionTicket().Len() > 0) { + authKey = TEXT("X-Authorization"); authValue = PlayFabSettings::GetClientSessionTicket(); + } else if (PlayFabSettings::GetDeveloperSecretKey().Len() > 0) { + authKey = TEXT("X-SecretKey"); authValue = PlayFabSettings::GetDeveloperSecretKey(); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Authentication/GetEntityToken")), request.toJSONString(), authKey, authValue); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabAuthenticationAPI::OnGetEntityTokenResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabAuthenticationAPI::OnGetEntityTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetEntityTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + AuthenticationModels::FGetEntityTokenResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.EntityToken.Len() > 0) + PlayFabSettings::SetEntityToken(outResult.EntityToken); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAuthenticationDataModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAuthenticationDataModels.cpp new file mode 100644 index 000000000..1984f34b2 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabAuthenticationDataModels.cpp @@ -0,0 +1,122 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabAuthenticationDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::AuthenticationModels; + +PlayFab::AuthenticationModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::AuthenticationModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AuthenticationModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::AuthenticationModels::FGetEntityTokenRequest::~FGetEntityTokenRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::AuthenticationModels::FGetEntityTokenRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AuthenticationModels::FGetEntityTokenRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::AuthenticationModels::FGetEntityTokenResponse::~FGetEntityTokenResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::AuthenticationModels::FGetEntityTokenResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + if (EntityToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EntityToken")); writer->WriteValue(EntityToken); } + + if (TokenExpiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("TokenExpiration")); writeDatetime(TokenExpiration, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::AuthenticationModels::FGetEntityTokenResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr EntityTokenValue = obj->TryGetField(TEXT("EntityToken")); + if (EntityTokenValue.IsValid() && !EntityTokenValue->IsNull()) + { + FString TmpValue; + if (EntityTokenValue->TryGetString(TmpValue)) { EntityToken = TmpValue; } + } + + const TSharedPtr TokenExpirationValue = obj->TryGetField(TEXT("TokenExpiration")); + if (TokenExpirationValue.IsValid()) + TokenExpiration = readDatetime(TokenExpirationValue); + + + return HasSucceeded; +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabBaseModel.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabBaseModel.cpp new file mode 100644 index 000000000..6c1de5da9 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabBaseModel.cpp @@ -0,0 +1,110 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFabBaseModel.h" +#include "PlayFab.h" + +using namespace PlayFab; + +FString FPlayFabBaseModel::toJSONString() const +{ + FString JsonOutString; + JsonWriter Json = TJsonWriterFactory >::Create(&JsonOutString); + writeJSON(Json); + + if (Json->Close()) + { + // write log here + } + + return JsonOutString; +} + +void FJsonKeeper::writeJSON(JsonWriter& writer) const +{ + switch (JsonValue->Type) + { + case EJson::None: + { + break; + } + case EJson::Array: + { + writer->WriteArrayStart(); + for (auto Elem : JsonValue->AsArray()) + { + FJsonKeeper(Elem).writeJSON(writer); + } + writer->WriteArrayEnd(); + break; + } + case EJson::Boolean: + { + writer->WriteValue(JsonValue->AsBool()); + break; + } + case EJson::Number: + { + writer->WriteValue(JsonValue->AsNumber()); + break; + } + case EJson::Object: + { + writer->WriteObjectStart(); + for (auto Elem : JsonValue->AsObject()->Values) + { + writer->WriteIdentifierPrefix(Elem.Key); + FJsonKeeper(Elem.Value).writeJSON(writer); + } + writer->WriteObjectEnd(); + break; + } + case EJson::String: + { + writer->WriteValue(JsonValue->AsString()); + break; + } + case EJson::Null: + { + writer->WriteNull(); + break; + } + default: + { + break; + } + } +} + +bool FJsonKeeper::readFromValue(const TSharedPtr& obj) +{ + return false; +} + +bool FJsonKeeper::readFromValue(const TSharedPtr& value) +{ + if (value.IsValid()) + { + JsonValue = value.ToSharedRef(); + } + return true; +} + +void PlayFab::writeDatetime(FDateTime datetime, JsonWriter& writer) +{ + writer->WriteValue(datetime.ToIso8601()); +} + +FDateTime PlayFab::readDatetime(const TSharedPtr& value) +{ + FDateTime DateTimeOut; + FString DateString = value->AsString(); + if (!FDateTime::ParseIso8601(*DateString, DateTimeOut)) + { + UE_LOG(LogPlayFab, Error, TEXT("readDatetime - Unable to import FDateTime from Iso8601 String")); + } + + return DateTimeOut; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabClientAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabClientAPI.cpp new file mode 100644 index 000000000..581143277 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabClientAPI.cpp @@ -0,0 +1,4062 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabClientAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::ClientModels; + +UPlayFabClientAPI::UPlayFabClientAPI() {} + +UPlayFabClientAPI::~UPlayFabClientAPI() {} + +int UPlayFabClientAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabClientAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabClientAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +bool UPlayFabClientAPI::SetAdvertId(const FString& advertisingIdType, const FString& advertisingIdValue) +{ + // TODO: Work on exposing PlayFabSettings::AD_TYPE_X vars, for now, just validate against them + bool valid = advertisingIdType == PlayFabSettings::AD_TYPE_IDFA || advertisingIdType == PlayFabSettings::AD_TYPE_ANDROID_ID; + if (valid) + { + PlayFabSettings::SetAdvertisingIdType(advertisingIdType); + PlayFabSettings::SetAdvertisingIdValue(advertisingIdValue); + } + return valid; +} + +bool UPlayFabClientAPI::AdvertIdSuccessful() +{ + return PlayFabSettings::GetAdvertisingIdType().EndsWith("_Successful"); +} + +bool UPlayFabClientAPI::IsClientLoggedIn() const +{ + return !PlayFabSettings::GetClientSessionTicket().IsEmpty(); +} + +void UPlayFabClientAPI::MultiStepClientLogin(bool needsAttribution) +{ + if (needsAttribution && !PlayFabSettings::GetDisableAdvertising() && !PlayFabSettings::GetAdvertisingIdType().IsEmpty() && !PlayFabSettings::GetAdvertisingIdValue().IsEmpty()) + { + PlayFab::ClientModels::FAttributeInstallRequest request; + if (PlayFabSettings::GetAdvertisingIdType() == PlayFabSettings::AD_TYPE_IDFA) + request.Idfa = PlayFabSettings::GetAdvertisingIdValue(); + else if (PlayFabSettings::GetAdvertisingIdType() == PlayFabSettings::AD_TYPE_ANDROID_ID) + request.Adid = PlayFabSettings::GetAdvertisingIdValue(); + else + return; + AttributeInstall(request); + } +} + +void UPlayFabClientAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabClientAPI::AcceptTrade( + ClientModels::FAcceptTradeRequest& request, + const FAcceptTradeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AcceptTrade")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAcceptTradeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAcceptTradeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAcceptTradeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAcceptTradeResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AddFriend( + ClientModels::FAddFriendRequest& request, + const FAddFriendDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AddFriend")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAddFriendResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAddFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAddFriendResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AddGenericID( + ClientModels::FAddGenericIDRequest& request, + const FAddGenericIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AddGenericID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAddGenericIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAddGenericIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddGenericIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAddGenericIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AddOrUpdateContactEmail( + ClientModels::FAddOrUpdateContactEmailRequest& request, + const FAddOrUpdateContactEmailDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AddOrUpdateContactEmail")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAddOrUpdateContactEmailResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAddOrUpdateContactEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddOrUpdateContactEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAddOrUpdateContactEmailResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AddSharedGroupMembers( + ClientModels::FAddSharedGroupMembersRequest& request, + const FAddSharedGroupMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AddSharedGroupMembers")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAddSharedGroupMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAddSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAddSharedGroupMembersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AddUsernamePassword( + ClientModels::FAddUsernamePasswordRequest& request, + const FAddUsernamePasswordDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AddUsernamePassword")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAddUsernamePasswordResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAddUsernamePasswordResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUsernamePasswordDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAddUsernamePasswordResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AddUserVirtualCurrency( + ClientModels::FAddUserVirtualCurrencyRequest& request, + const FAddUserVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AddUserVirtualCurrency")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAddUserVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAddUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FModifyUserVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AndroidDevicePushNotificationRegistration( + ClientModels::FAndroidDevicePushNotificationRegistrationRequest& request, + const FAndroidDevicePushNotificationRegistrationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AndroidDevicePushNotificationRegistration")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAndroidDevicePushNotificationRegistrationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAndroidDevicePushNotificationRegistrationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAndroidDevicePushNotificationRegistrationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAndroidDevicePushNotificationRegistrationResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::AttributeInstall( + ClientModels::FAttributeInstallRequest& request, + const FAttributeInstallDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/AttributeInstall")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnAttributeInstallResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnAttributeInstallResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAttributeInstallDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FAttributeInstallResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + // Modify advertisingIdType: Prevents us from sending the id multiple times, and allows automated tests to determine id was sent successfully + PlayFabSettings::SetAdvertisingIdType(PlayFabSettings::GetAdvertisingIdType() + "_Successful"); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::CancelTrade( + ClientModels::FCancelTradeRequest& request, + const FCancelTradeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/CancelTrade")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnCancelTradeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnCancelTradeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCancelTradeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FCancelTradeResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ConfirmPurchase( + ClientModels::FConfirmPurchaseRequest& request, + const FConfirmPurchaseDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ConfirmPurchase")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnConfirmPurchaseResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnConfirmPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConfirmPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FConfirmPurchaseResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ConsumeItem( + ClientModels::FConsumeItemRequest& request, + const FConsumeItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ConsumeItem")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnConsumeItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnConsumeItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConsumeItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FConsumeItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ConsumeXboxEntitlements( + ClientModels::FConsumeXboxEntitlementsRequest& request, + const FConsumeXboxEntitlementsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ConsumeXboxEntitlements")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnConsumeXboxEntitlementsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnConsumeXboxEntitlementsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConsumeXboxEntitlementsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FConsumeXboxEntitlementsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::CreateSharedGroup( + ClientModels::FCreateSharedGroupRequest& request, + const FCreateSharedGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/CreateSharedGroup")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnCreateSharedGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnCreateSharedGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateSharedGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FCreateSharedGroupResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ExecuteCloudScript( + ClientModels::FExecuteCloudScriptRequest& request, + const FExecuteCloudScriptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ExecuteCloudScript")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnExecuteCloudScriptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnExecuteCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExecuteCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FExecuteCloudScriptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetAccountInfo( + ClientModels::FGetAccountInfoRequest& request, + const FGetAccountInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetAccountInfo")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetAccountInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetAccountInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAccountInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetAccountInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetAllUsersCharacters( + ClientModels::FListUsersCharactersRequest& request, + const FGetAllUsersCharactersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetAllUsersCharacters")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetAllUsersCharactersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetAllUsersCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllUsersCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FListUsersCharactersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCatalogItems( + ClientModels::FGetCatalogItemsRequest& request, + const FGetCatalogItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCatalogItems")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCatalogItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetCatalogItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCharacterData( + ClientModels::FGetCharacterDataRequest& request, + const FGetCharacterDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCharacterData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCharacterDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCharacterInventory( + ClientModels::FGetCharacterInventoryRequest& request, + const FGetCharacterInventoryDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCharacterInventory")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCharacterInventoryResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCharacterInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetCharacterInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCharacterLeaderboard( + ClientModels::FGetCharacterLeaderboardRequest& request, + const FGetCharacterLeaderboardDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCharacterLeaderboard")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCharacterLeaderboardResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCharacterLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetCharacterLeaderboardResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCharacterReadOnlyData( + ClientModels::FGetCharacterDataRequest& request, + const FGetCharacterReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCharacterReadOnlyData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCharacterReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCharacterReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCharacterStatistics( + ClientModels::FGetCharacterStatisticsRequest& request, + const FGetCharacterStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCharacterStatistics")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCharacterStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetCharacterStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetContentDownloadUrl( + ClientModels::FGetContentDownloadUrlRequest& request, + const FGetContentDownloadUrlDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetContentDownloadUrl")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetContentDownloadUrlResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetContentDownloadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentDownloadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetContentDownloadUrlResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetCurrentGames( + ClientModels::FCurrentGamesRequest& request, + const FGetCurrentGamesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetCurrentGames")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetCurrentGamesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetCurrentGamesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCurrentGamesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FCurrentGamesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetFriendLeaderboard( + ClientModels::FGetFriendLeaderboardRequest& request, + const FGetFriendLeaderboardDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetFriendLeaderboard")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetFriendLeaderboardResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetFriendLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetLeaderboardResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetFriendLeaderboardAroundPlayer( + ClientModels::FGetFriendLeaderboardAroundPlayerRequest& request, + const FGetFriendLeaderboardAroundPlayerDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetFriendLeaderboardAroundPlayer")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetFriendLeaderboardAroundPlayerResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetFriendLeaderboardAroundPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendLeaderboardAroundPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetFriendLeaderboardAroundPlayerResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetFriendsList( + ClientModels::FGetFriendsListRequest& request, + const FGetFriendsListDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetFriendsList")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetFriendsListResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetFriendsListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendsListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetFriendsListResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetGameServerRegions( + ClientModels::FGameServerRegionsRequest& request, + const FGetGameServerRegionsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetGameServerRegions")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetGameServerRegionsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetGameServerRegionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetGameServerRegionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGameServerRegionsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetLeaderboard( + ClientModels::FGetLeaderboardRequest& request, + const FGetLeaderboardDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetLeaderboard")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetLeaderboardResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetLeaderboardResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetLeaderboardAroundCharacter( + ClientModels::FGetLeaderboardAroundCharacterRequest& request, + const FGetLeaderboardAroundCharacterDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetLeaderboardAroundCharacter")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetLeaderboardAroundCharacterResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetLeaderboardAroundCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetLeaderboardAroundCharacterResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetLeaderboardAroundPlayer( + ClientModels::FGetLeaderboardAroundPlayerRequest& request, + const FGetLeaderboardAroundPlayerDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetLeaderboardAroundPlayer")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetLeaderboardAroundPlayerResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetLeaderboardAroundPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetLeaderboardAroundPlayerResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetLeaderboardForUserCharacters( + ClientModels::FGetLeaderboardForUsersCharactersRequest& request, + const FGetLeaderboardForUserCharactersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetLeaderboardForUserCharacters")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetLeaderboardForUserCharactersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetLeaderboardForUserCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardForUserCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetLeaderboardForUsersCharactersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPaymentToken( + ClientModels::FGetPaymentTokenRequest& request, + const FGetPaymentTokenDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPaymentToken")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPaymentTokenResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPaymentTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPaymentTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPaymentTokenResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPhotonAuthenticationToken( + ClientModels::FGetPhotonAuthenticationTokenRequest& request, + const FGetPhotonAuthenticationTokenDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPhotonAuthenticationToken")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPhotonAuthenticationTokenResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPhotonAuthenticationTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPhotonAuthenticationTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPhotonAuthenticationTokenResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerCombinedInfo( + ClientModels::FGetPlayerCombinedInfoRequest& request, + const FGetPlayerCombinedInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerCombinedInfo")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerCombinedInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerCombinedInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerCombinedInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerCombinedInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerProfile( + ClientModels::FGetPlayerProfileRequest& request, + const FGetPlayerProfileDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerProfile")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerProfileResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerProfileResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerSegments( + + const FGetPlayerSegmentsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerSegments")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerSegmentsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerSegmentsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerStatistics( + ClientModels::FGetPlayerStatisticsRequest& request, + const FGetPlayerStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerStatistics")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerStatisticVersions( + ClientModels::FGetPlayerStatisticVersionsRequest& request, + const FGetPlayerStatisticVersionsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerStatisticVersions")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerStatisticVersionsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerStatisticVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerStatisticVersionsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerTags( + ClientModels::FGetPlayerTagsRequest& request, + const FGetPlayerTagsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerTags")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerTagsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerTagsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayerTrades( + ClientModels::FGetPlayerTradesRequest& request, + const FGetPlayerTradesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayerTrades")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayerTradesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayerTradesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTradesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayerTradesResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromFacebookIDs( + ClientModels::FGetPlayFabIDsFromFacebookIDsRequest& request, + const FGetPlayFabIDsFromFacebookIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromFacebookIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromFacebookIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromFacebookIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromFacebookIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromFacebookInstantGamesIds( + ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest& request, + const FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromFacebookInstantGamesIds")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromFacebookInstantGamesIdsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromFacebookInstantGamesIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromGameCenterIDs( + ClientModels::FGetPlayFabIDsFromGameCenterIDsRequest& request, + const FGetPlayFabIDsFromGameCenterIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromGameCenterIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromGameCenterIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromGameCenterIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromGameCenterIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromGameCenterIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromGenericIDs( + ClientModels::FGetPlayFabIDsFromGenericIDsRequest& request, + const FGetPlayFabIDsFromGenericIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromGenericIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromGenericIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromGenericIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromGenericIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromGenericIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromGoogleIDs( + ClientModels::FGetPlayFabIDsFromGoogleIDsRequest& request, + const FGetPlayFabIDsFromGoogleIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromGoogleIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromGoogleIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromGoogleIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromGoogleIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromGoogleIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromKongregateIDs( + ClientModels::FGetPlayFabIDsFromKongregateIDsRequest& request, + const FGetPlayFabIDsFromKongregateIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromKongregateIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromKongregateIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromKongregateIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromKongregateIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromKongregateIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromNintendoSwitchDeviceIds( + ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& request, + const FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromNintendoSwitchDeviceIds")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromSteamIDs( + ClientModels::FGetPlayFabIDsFromSteamIDsRequest& request, + const FGetPlayFabIDsFromSteamIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromSteamIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromSteamIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromSteamIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromSteamIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromSteamIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPlayFabIDsFromTwitchIDs( + ClientModels::FGetPlayFabIDsFromTwitchIDsRequest& request, + const FGetPlayFabIDsFromTwitchIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPlayFabIDsFromTwitchIDs")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPlayFabIDsFromTwitchIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPlayFabIDsFromTwitchIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromTwitchIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPlayFabIDsFromTwitchIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPublisherData( + ClientModels::FGetPublisherDataRequest& request, + const FGetPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPublisherData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPublisherDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetPurchase( + ClientModels::FGetPurchaseRequest& request, + const FGetPurchaseDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetPurchase")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetPurchaseResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetPurchaseResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetSharedGroupData( + ClientModels::FGetSharedGroupDataRequest& request, + const FGetSharedGroupDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetSharedGroupData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetSharedGroupDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetSharedGroupDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetStoreItems( + ClientModels::FGetStoreItemsRequest& request, + const FGetStoreItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetStoreItems")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetStoreItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetStoreItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetTime( + + const FGetTimeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetTime")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetTimeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetTimeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTimeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetTimeResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetTitleData( + ClientModels::FGetTitleDataRequest& request, + const FGetTitleDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetTitleData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetTitleDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetTitleNews( + ClientModels::FGetTitleNewsRequest& request, + const FGetTitleNewsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetTitleNews")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetTitleNewsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetTitleNewsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleNewsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetTitleNewsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetTitlePublicKey( + ClientModels::FGetTitlePublicKeyRequest& request, + const FGetTitlePublicKeyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetTitlePublicKey")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetTitlePublicKeyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetTitlePublicKeyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitlePublicKeyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetTitlePublicKeyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetTradeStatus( + ClientModels::FGetTradeStatusRequest& request, + const FGetTradeStatusDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetTradeStatus")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetTradeStatusResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetTradeStatusResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTradeStatusDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetTradeStatusResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetUserData( + ClientModels::FGetUserDataRequest& request, + const FGetUserDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetUserData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetUserDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetUserInventory( + + const FGetUserInventoryDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetUserInventory")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetUserInventoryResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetUserInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetUserInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetUserPublisherData( + ClientModels::FGetUserDataRequest& request, + const FGetUserPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetUserPublisherData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetUserPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetUserPublisherReadOnlyData( + ClientModels::FGetUserDataRequest& request, + const FGetUserPublisherReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetUserPublisherReadOnlyData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetUserPublisherReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetUserReadOnlyData( + ClientModels::FGetUserDataRequest& request, + const FGetUserReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetUserReadOnlyData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetUserReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GetWindowsHelloChallenge( + ClientModels::FGetWindowsHelloChallengeRequest& request, + const FGetWindowsHelloChallengeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GetWindowsHelloChallenge")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGetWindowsHelloChallengeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGetWindowsHelloChallengeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetWindowsHelloChallengeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGetWindowsHelloChallengeResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::GrantCharacterToUser( + ClientModels::FGrantCharacterToUserRequest& request, + const FGrantCharacterToUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/GrantCharacterToUser")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnGrantCharacterToUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnGrantCharacterToUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantCharacterToUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FGrantCharacterToUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkAndroidDeviceID( + ClientModels::FLinkAndroidDeviceIDRequest& request, + const FLinkAndroidDeviceIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkAndroidDeviceID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkAndroidDeviceIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkAndroidDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkAndroidDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkAndroidDeviceIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkCustomID( + ClientModels::FLinkCustomIDRequest& request, + const FLinkCustomIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkCustomID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkCustomIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkCustomIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkCustomIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkCustomIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkFacebookAccount( + ClientModels::FLinkFacebookAccountRequest& request, + const FLinkFacebookAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkFacebookAccount")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkFacebookAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkFacebookAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkFacebookAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkFacebookAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkFacebookInstantGamesId( + ClientModels::FLinkFacebookInstantGamesIdRequest& request, + const FLinkFacebookInstantGamesIdDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkFacebookInstantGamesId")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkFacebookInstantGamesIdResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkFacebookInstantGamesIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkFacebookInstantGamesIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkFacebookInstantGamesIdResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkGameCenterAccount( + ClientModels::FLinkGameCenterAccountRequest& request, + const FLinkGameCenterAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkGameCenterAccount")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkGameCenterAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkGameCenterAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkGameCenterAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkGameCenterAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkGoogleAccount( + ClientModels::FLinkGoogleAccountRequest& request, + const FLinkGoogleAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkGoogleAccount")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkGoogleAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkGoogleAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkGoogleAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkGoogleAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkIOSDeviceID( + ClientModels::FLinkIOSDeviceIDRequest& request, + const FLinkIOSDeviceIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkIOSDeviceID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkIOSDeviceIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkIOSDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkIOSDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkIOSDeviceIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkKongregate( + ClientModels::FLinkKongregateAccountRequest& request, + const FLinkKongregateDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkKongregate")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkKongregateResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkKongregateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkKongregateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkKongregateAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkNintendoSwitchDeviceId( + ClientModels::FLinkNintendoSwitchDeviceIdRequest& request, + const FLinkNintendoSwitchDeviceIdDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkNintendoSwitchDeviceId")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkNintendoSwitchDeviceIdResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkNintendoSwitchDeviceIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkNintendoSwitchDeviceIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkNintendoSwitchDeviceIdResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkSteamAccount( + ClientModels::FLinkSteamAccountRequest& request, + const FLinkSteamAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkSteamAccount")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkSteamAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkSteamAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkSteamAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkSteamAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkTwitch( + ClientModels::FLinkTwitchAccountRequest& request, + const FLinkTwitchDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkTwitch")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkTwitchResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkTwitchResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkTwitchDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkTwitchAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkWindowsHello( + ClientModels::FLinkWindowsHelloAccountRequest& request, + const FLinkWindowsHelloDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkWindowsHello")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkWindowsHelloResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkWindowsHelloAccountResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LinkXboxAccount( + ClientModels::FLinkXboxAccountRequest& request, + const FLinkXboxAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LinkXboxAccount")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLinkXboxAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLinkXboxAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkXboxAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLinkXboxAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithAndroidDeviceID( + ClientModels::FLoginWithAndroidDeviceIDRequest& request, + const FLoginWithAndroidDeviceIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithAndroidDeviceID")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithAndroidDeviceIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithAndroidDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithAndroidDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithCustomID( + ClientModels::FLoginWithCustomIDRequest& request, + const FLoginWithCustomIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithCustomID")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithCustomIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithCustomIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithCustomIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithEmailAddress( + ClientModels::FLoginWithEmailAddressRequest& request, + const FLoginWithEmailAddressDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithEmailAddress")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithEmailAddressResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithEmailAddressResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithEmailAddressDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithFacebook( + ClientModels::FLoginWithFacebookRequest& request, + const FLoginWithFacebookDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithFacebook")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithFacebookResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithFacebookResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithFacebookDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithFacebookInstantGamesId( + ClientModels::FLoginWithFacebookInstantGamesIdRequest& request, + const FLoginWithFacebookInstantGamesIdDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithFacebookInstantGamesId")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithFacebookInstantGamesIdResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithFacebookInstantGamesIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithFacebookInstantGamesIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithGameCenter( + ClientModels::FLoginWithGameCenterRequest& request, + const FLoginWithGameCenterDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithGameCenter")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithGameCenterResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithGameCenterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithGameCenterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithGoogleAccount( + ClientModels::FLoginWithGoogleAccountRequest& request, + const FLoginWithGoogleAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithGoogleAccount")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithGoogleAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithGoogleAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithGoogleAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithIOSDeviceID( + ClientModels::FLoginWithIOSDeviceIDRequest& request, + const FLoginWithIOSDeviceIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithIOSDeviceID")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithIOSDeviceIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithIOSDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithIOSDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithKongregate( + ClientModels::FLoginWithKongregateRequest& request, + const FLoginWithKongregateDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithKongregate")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithKongregateResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithKongregateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithKongregateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithNintendoSwitchDeviceId( + ClientModels::FLoginWithNintendoSwitchDeviceIdRequest& request, + const FLoginWithNintendoSwitchDeviceIdDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithNintendoSwitchDeviceId")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithNintendoSwitchDeviceIdResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithNintendoSwitchDeviceIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithNintendoSwitchDeviceIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithPlayFab( + ClientModels::FLoginWithPlayFabRequest& request, + const FLoginWithPlayFabDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithPlayFab")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithPlayFabResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithPlayFabResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithPlayFabDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithSteam( + ClientModels::FLoginWithSteamRequest& request, + const FLoginWithSteamDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithSteam")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithSteamResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithSteamResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithSteamDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithTwitch( + ClientModels::FLoginWithTwitchRequest& request, + const FLoginWithTwitchDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithTwitch")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithTwitchResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithTwitchResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithTwitchDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithWindowsHello( + ClientModels::FLoginWithWindowsHelloRequest& request, + const FLoginWithWindowsHelloDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithWindowsHello")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithWindowsHelloResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::LoginWithXbox( + ClientModels::FLoginWithXboxRequest& request, + const FLoginWithXboxDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/LoginWithXbox")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnLoginWithXboxResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnLoginWithXboxResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithXboxDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::Matchmake( + ClientModels::FMatchmakeRequest& request, + const FMatchmakeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/Matchmake")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnMatchmakeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnMatchmakeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMatchmakeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FMatchmakeResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::OpenTrade( + ClientModels::FOpenTradeRequest& request, + const FOpenTradeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/OpenTrade")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnOpenTradeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnOpenTradeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FOpenTradeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FOpenTradeResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::PayForPurchase( + ClientModels::FPayForPurchaseRequest& request, + const FPayForPurchaseDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/PayForPurchase")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnPayForPurchaseResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnPayForPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPayForPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FPayForPurchaseResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::PurchaseItem( + ClientModels::FPurchaseItemRequest& request, + const FPurchaseItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/PurchaseItem")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnPurchaseItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnPurchaseItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPurchaseItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FPurchaseItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RedeemCoupon( + ClientModels::FRedeemCouponRequest& request, + const FRedeemCouponDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RedeemCoupon")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRedeemCouponResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRedeemCouponResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRedeemCouponDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRedeemCouponResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RegisterForIOSPushNotification( + ClientModels::FRegisterForIOSPushNotificationRequest& request, + const FRegisterForIOSPushNotificationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RegisterForIOSPushNotification")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRegisterForIOSPushNotificationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRegisterForIOSPushNotificationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterForIOSPushNotificationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRegisterForIOSPushNotificationResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RegisterPlayFabUser( + ClientModels::FRegisterPlayFabUserRequest& request, + const FRegisterPlayFabUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RegisterPlayFabUser")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRegisterPlayFabUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRegisterPlayFabUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterPlayFabUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRegisterPlayFabUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) + PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RegisterWithWindowsHello( + ClientModels::FRegisterWithWindowsHelloRequest& request, + const FRegisterWithWindowsHelloDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetTitleId().Len() > 0) + request.TitleId = PlayFabSettings::GetTitleId(); + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RegisterWithWindowsHello")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRegisterWithWindowsHelloResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRegisterWithWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterWithWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FLoginResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + if (outResult.SessionTicket.Len() > 0) PlayFabSettings::SetClientSessionTicket(outResult.SessionTicket); + if (outResult.EntityToken.IsValid()) PlayFabSettings::SetEntityToken(outResult.EntityToken->EntityToken); + MultiStepClientLogin(outResult.SettingsForUser->NeedsAttribution); + + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RemoveContactEmail( + + const FRemoveContactEmailDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RemoveContactEmail")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRemoveContactEmailResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRemoveContactEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveContactEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRemoveContactEmailResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RemoveFriend( + ClientModels::FRemoveFriendRequest& request, + const FRemoveFriendDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RemoveFriend")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRemoveFriendResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRemoveFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRemoveFriendResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RemoveGenericID( + ClientModels::FRemoveGenericIDRequest& request, + const FRemoveGenericIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RemoveGenericID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRemoveGenericIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRemoveGenericIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveGenericIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRemoveGenericIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RemoveSharedGroupMembers( + ClientModels::FRemoveSharedGroupMembersRequest& request, + const FRemoveSharedGroupMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RemoveSharedGroupMembers")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRemoveSharedGroupMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRemoveSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRemoveSharedGroupMembersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ReportDeviceInfo( + ClientModels::FDeviceInfoRequest& request, + const FReportDeviceInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ReportDeviceInfo")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnReportDeviceInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnReportDeviceInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FReportDeviceInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ReportPlayer( + ClientModels::FReportPlayerClientRequest& request, + const FReportPlayerDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ReportPlayer")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnReportPlayerResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnReportPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FReportPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FReportPlayerClientResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::RestoreIOSPurchases( + ClientModels::FRestoreIOSPurchasesRequest& request, + const FRestoreIOSPurchasesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/RestoreIOSPurchases")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnRestoreIOSPurchasesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnRestoreIOSPurchasesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRestoreIOSPurchasesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FRestoreIOSPurchasesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::SendAccountRecoveryEmail( + ClientModels::FSendAccountRecoveryEmailRequest& request, + const FSendAccountRecoveryEmailDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/SendAccountRecoveryEmail")), request.toJSONString(), TEXT(""), TEXT("")); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnSendAccountRecoveryEmailResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnSendAccountRecoveryEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendAccountRecoveryEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FSendAccountRecoveryEmailResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::SetFriendTags( + ClientModels::FSetFriendTagsRequest& request, + const FSetFriendTagsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/SetFriendTags")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnSetFriendTagsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnSetFriendTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetFriendTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FSetFriendTagsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::SetPlayerSecret( + ClientModels::FSetPlayerSecretRequest& request, + const FSetPlayerSecretDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/SetPlayerSecret")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnSetPlayerSecretResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnSetPlayerSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPlayerSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FSetPlayerSecretResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::StartGame( + ClientModels::FStartGameRequest& request, + const FStartGameDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/StartGame")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnStartGameResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnStartGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FStartGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FStartGameResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::StartPurchase( + ClientModels::FStartPurchaseRequest& request, + const FStartPurchaseDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/StartPurchase")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnStartPurchaseResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnStartPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FStartPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FStartPurchaseResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::SubtractUserVirtualCurrency( + ClientModels::FSubtractUserVirtualCurrencyRequest& request, + const FSubtractUserVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/SubtractUserVirtualCurrency")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnSubtractUserVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnSubtractUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FModifyUserVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkAndroidDeviceID( + ClientModels::FUnlinkAndroidDeviceIDRequest& request, + const FUnlinkAndroidDeviceIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkAndroidDeviceID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkAndroidDeviceIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkAndroidDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkAndroidDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkAndroidDeviceIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkCustomID( + ClientModels::FUnlinkCustomIDRequest& request, + const FUnlinkCustomIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkCustomID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkCustomIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkCustomIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkCustomIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkCustomIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkFacebookAccount( + + const FUnlinkFacebookAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkFacebookAccount")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkFacebookAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkFacebookAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkFacebookAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkFacebookAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkFacebookInstantGamesId( + ClientModels::FUnlinkFacebookInstantGamesIdRequest& request, + const FUnlinkFacebookInstantGamesIdDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkFacebookInstantGamesId")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkFacebookInstantGamesIdResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkFacebookInstantGamesIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkFacebookInstantGamesIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkFacebookInstantGamesIdResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkGameCenterAccount( + + const FUnlinkGameCenterAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkGameCenterAccount")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkGameCenterAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkGameCenterAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkGameCenterAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkGameCenterAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkGoogleAccount( + + const FUnlinkGoogleAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkGoogleAccount")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkGoogleAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkGoogleAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkGoogleAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkGoogleAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkIOSDeviceID( + ClientModels::FUnlinkIOSDeviceIDRequest& request, + const FUnlinkIOSDeviceIDDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkIOSDeviceID")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkIOSDeviceIDResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkIOSDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkIOSDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkIOSDeviceIDResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkKongregate( + + const FUnlinkKongregateDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkKongregate")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkKongregateResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkKongregateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkKongregateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkKongregateAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkNintendoSwitchDeviceId( + ClientModels::FUnlinkNintendoSwitchDeviceIdRequest& request, + const FUnlinkNintendoSwitchDeviceIdDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkNintendoSwitchDeviceId")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkNintendoSwitchDeviceIdResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkNintendoSwitchDeviceIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkNintendoSwitchDeviceIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkNintendoSwitchDeviceIdResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkSteamAccount( + + const FUnlinkSteamAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkSteamAccount")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkSteamAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkSteamAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkSteamAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkSteamAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkTwitch( + + const FUnlinkTwitchDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkTwitch")), TEXT("{}"), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkTwitchResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkTwitchResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkTwitchDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkTwitchAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkWindowsHello( + ClientModels::FUnlinkWindowsHelloAccountRequest& request, + const FUnlinkWindowsHelloDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkWindowsHello")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkWindowsHelloResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkWindowsHelloAccountResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlinkXboxAccount( + ClientModels::FUnlinkXboxAccountRequest& request, + const FUnlinkXboxAccountDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlinkXboxAccount")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlinkXboxAccountResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlinkXboxAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkXboxAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlinkXboxAccountResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlockContainerInstance( + ClientModels::FUnlockContainerInstanceRequest& request, + const FUnlockContainerInstanceDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlockContainerInstance")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlockContainerInstanceResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlockContainerInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlockContainerItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UnlockContainerItem( + ClientModels::FUnlockContainerItemRequest& request, + const FUnlockContainerItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UnlockContainerItem")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUnlockContainerItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUnlockContainerItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUnlockContainerItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateAvatarUrl( + ClientModels::FUpdateAvatarUrlRequest& request, + const FUpdateAvatarUrlDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateAvatarUrl")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateAvatarUrlResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateAvatarUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateAvatarUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateCharacterData( + ClientModels::FUpdateCharacterDataRequest& request, + const FUpdateCharacterDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateCharacterData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateCharacterDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdateCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateCharacterStatistics( + ClientModels::FUpdateCharacterStatisticsRequest& request, + const FUpdateCharacterStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateCharacterStatistics")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateCharacterStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdateCharacterStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdatePlayerStatistics( + ClientModels::FUpdatePlayerStatisticsRequest& request, + const FUpdatePlayerStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdatePlayerStatistics")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdatePlayerStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdatePlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdatePlayerStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateSharedGroupData( + ClientModels::FUpdateSharedGroupDataRequest& request, + const FUpdateSharedGroupDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateSharedGroupData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateSharedGroupDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdateSharedGroupDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateUserData( + ClientModels::FUpdateUserDataRequest& request, + const FUpdateUserDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateUserData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateUserDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateUserPublisherData( + ClientModels::FUpdateUserDataRequest& request, + const FUpdateUserPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateUserPublisherData")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateUserPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::UpdateUserTitleDisplayName( + ClientModels::FUpdateUserTitleDisplayNameRequest& request, + const FUpdateUserTitleDisplayNameDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/UpdateUserTitleDisplayName")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnUpdateUserTitleDisplayNameResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnUpdateUserTitleDisplayNameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserTitleDisplayNameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FUpdateUserTitleDisplayNameResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ValidateAmazonIAPReceipt( + ClientModels::FValidateAmazonReceiptRequest& request, + const FValidateAmazonIAPReceiptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ValidateAmazonIAPReceipt")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnValidateAmazonIAPReceiptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnValidateAmazonIAPReceiptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateAmazonIAPReceiptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FValidateAmazonReceiptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ValidateGooglePlayPurchase( + ClientModels::FValidateGooglePlayPurchaseRequest& request, + const FValidateGooglePlayPurchaseDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ValidateGooglePlayPurchase")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnValidateGooglePlayPurchaseResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnValidateGooglePlayPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateGooglePlayPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FValidateGooglePlayPurchaseResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ValidateIOSReceipt( + ClientModels::FValidateIOSReceiptRequest& request, + const FValidateIOSReceiptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ValidateIOSReceipt")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnValidateIOSReceiptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnValidateIOSReceiptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateIOSReceiptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FValidateIOSReceiptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::ValidateWindowsStoreReceipt( + ClientModels::FValidateWindowsReceiptRequest& request, + const FValidateWindowsStoreReceiptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/ValidateWindowsStoreReceipt")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnValidateWindowsStoreReceiptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnValidateWindowsStoreReceiptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateWindowsStoreReceiptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FValidateWindowsReceiptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::WriteCharacterEvent( + ClientModels::FWriteClientCharacterEventRequest& request, + const FWriteCharacterEventDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/WriteCharacterEvent")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnWriteCharacterEventResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnWriteCharacterEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteCharacterEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FWriteEventResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::WritePlayerEvent( + ClientModels::FWriteClientPlayerEventRequest& request, + const FWritePlayerEventDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/WritePlayerEvent")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnWritePlayerEventResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnWritePlayerEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWritePlayerEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FWriteEventResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabClientAPI::WriteTitleEvent( + ClientModels::FWriteTitleEventRequest& request, + const FWriteTitleEventDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetClientSessionTicket().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must log in before calling this function")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Client/WriteTitleEvent")), request.toJSONString(), TEXT("X-Authorization"), PlayFabSettings::GetClientSessionTicket()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabClientAPI::OnWriteTitleEventResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabClientAPI::OnWriteTitleEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteTitleEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ClientModels::FWriteEventResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabClientDataModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabClientDataModels.cpp new file mode 100644 index 000000000..e7e737a2a --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabClientDataModels.cpp @@ -0,0 +1,17070 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabClientDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::ClientModels; + +PlayFab::ClientModels::FAcceptTradeRequest::~FAcceptTradeRequest() +{ + +} + +void PlayFab::ClientModels::FAcceptTradeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AcceptedInventoryInstanceIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("AcceptedInventoryInstanceIds")); + for (const FString& item : AcceptedInventoryInstanceIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("OfferingPlayerId")); writer->WriteValue(OfferingPlayerId); + + writer->WriteIdentifierPrefix(TEXT("TradeId")); writer->WriteValue(TradeId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAcceptTradeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("AcceptedInventoryInstanceIds"), AcceptedInventoryInstanceIds); + + const TSharedPtr OfferingPlayerIdValue = obj->TryGetField(TEXT("OfferingPlayerId")); + if (OfferingPlayerIdValue.IsValid() && !OfferingPlayerIdValue->IsNull()) + { + FString TmpValue; + if (OfferingPlayerIdValue->TryGetString(TmpValue)) { OfferingPlayerId = TmpValue; } + } + + const TSharedPtr TradeIdValue = obj->TryGetField(TEXT("TradeId")); + if (TradeIdValue.IsValid() && !TradeIdValue->IsNull()) + { + FString TmpValue; + if (TradeIdValue->TryGetString(TmpValue)) { TradeId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeTradeStatusEnumJSON(TradeStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case TradeStatusInvalid: writer->WriteValue(TEXT("Invalid")); break; + case TradeStatusOpening: writer->WriteValue(TEXT("Opening")); break; + case TradeStatusOpen: writer->WriteValue(TEXT("Open")); break; + case TradeStatusAccepting: writer->WriteValue(TEXT("Accepting")); break; + case TradeStatusAccepted: writer->WriteValue(TEXT("Accepted")); break; + case TradeStatusFilled: writer->WriteValue(TEXT("Filled")); break; + case TradeStatusCancelled: writer->WriteValue(TEXT("Cancelled")); break; + } +} + +ClientModels::TradeStatus PlayFab::ClientModels::readTradeStatusFromValue(const TSharedPtr& value) +{ + return readTradeStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::TradeStatus PlayFab::ClientModels::readTradeStatusFromValue(const FString& value) +{ + static TMap _TradeStatusMap; + if (_TradeStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _TradeStatusMap.Add(TEXT("Invalid"), TradeStatusInvalid); + _TradeStatusMap.Add(TEXT("Opening"), TradeStatusOpening); + _TradeStatusMap.Add(TEXT("Open"), TradeStatusOpen); + _TradeStatusMap.Add(TEXT("Accepting"), TradeStatusAccepting); + _TradeStatusMap.Add(TEXT("Accepted"), TradeStatusAccepted); + _TradeStatusMap.Add(TEXT("Filled"), TradeStatusFilled); + _TradeStatusMap.Add(TEXT("Cancelled"), TradeStatusCancelled); + + } + + if (!value.IsEmpty()) + { + auto output = _TradeStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return TradeStatusInvalid; // Basically critical fail +} + +PlayFab::ClientModels::FTradeInfo::~FTradeInfo() +{ + +} + +void PlayFab::ClientModels::FTradeInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AcceptedInventoryInstanceIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("AcceptedInventoryInstanceIds")); + for (const FString& item : AcceptedInventoryInstanceIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (AcceptedPlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AcceptedPlayerId")); writer->WriteValue(AcceptedPlayerId); } + + if (AllowedPlayerIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("AllowedPlayerIds")); + for (const FString& item : AllowedPlayerIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (CancelledAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("CancelledAt")); writeDatetime(CancelledAt, writer); } + + if (FilledAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("FilledAt")); writeDatetime(FilledAt, writer); } + + if (InvalidatedAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("InvalidatedAt")); writeDatetime(InvalidatedAt, writer); } + + if (OfferedCatalogItemIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("OfferedCatalogItemIds")); + for (const FString& item : OfferedCatalogItemIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (OfferedInventoryInstanceIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("OfferedInventoryInstanceIds")); + for (const FString& item : OfferedInventoryInstanceIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (OfferingPlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OfferingPlayerId")); writer->WriteValue(OfferingPlayerId); } + + if (OpenedAt.notNull()) { writer->WriteIdentifierPrefix(TEXT("OpenedAt")); writeDatetime(OpenedAt, writer); } + + if (RequestedCatalogItemIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("RequestedCatalogItemIds")); + for (const FString& item : RequestedCatalogItemIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeTradeStatusEnumJSON(Status, writer); } + + if (TradeId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TradeId")); writer->WriteValue(TradeId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FTradeInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("AcceptedInventoryInstanceIds"), AcceptedInventoryInstanceIds); + + const TSharedPtr AcceptedPlayerIdValue = obj->TryGetField(TEXT("AcceptedPlayerId")); + if (AcceptedPlayerIdValue.IsValid() && !AcceptedPlayerIdValue->IsNull()) + { + FString TmpValue; + if (AcceptedPlayerIdValue->TryGetString(TmpValue)) { AcceptedPlayerId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("AllowedPlayerIds"), AllowedPlayerIds); + + const TSharedPtr CancelledAtValue = obj->TryGetField(TEXT("CancelledAt")); + if (CancelledAtValue.IsValid()) + CancelledAt = readDatetime(CancelledAtValue); + + + const TSharedPtr FilledAtValue = obj->TryGetField(TEXT("FilledAt")); + if (FilledAtValue.IsValid()) + FilledAt = readDatetime(FilledAtValue); + + + const TSharedPtr InvalidatedAtValue = obj->TryGetField(TEXT("InvalidatedAt")); + if (InvalidatedAtValue.IsValid()) + InvalidatedAt = readDatetime(InvalidatedAtValue); + + + obj->TryGetStringArrayField(TEXT("OfferedCatalogItemIds"), OfferedCatalogItemIds); + + obj->TryGetStringArrayField(TEXT("OfferedInventoryInstanceIds"), OfferedInventoryInstanceIds); + + const TSharedPtr OfferingPlayerIdValue = obj->TryGetField(TEXT("OfferingPlayerId")); + if (OfferingPlayerIdValue.IsValid() && !OfferingPlayerIdValue->IsNull()) + { + FString TmpValue; + if (OfferingPlayerIdValue->TryGetString(TmpValue)) { OfferingPlayerId = TmpValue; } + } + + const TSharedPtr OpenedAtValue = obj->TryGetField(TEXT("OpenedAt")); + if (OpenedAtValue.IsValid()) + OpenedAt = readDatetime(OpenedAtValue); + + + obj->TryGetStringArrayField(TEXT("RequestedCatalogItemIds"), RequestedCatalogItemIds); + + Status = readTradeStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TradeIdValue = obj->TryGetField(TEXT("TradeId")); + if (TradeIdValue.IsValid() && !TradeIdValue->IsNull()) + { + FString TmpValue; + if (TradeIdValue->TryGetString(TmpValue)) { TradeId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAcceptTradeResponse::~FAcceptTradeResponse() +{ + //if (Trade != nullptr) delete Trade; + +} + +void PlayFab::ClientModels::FAcceptTradeResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Trade.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Trade")); Trade->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAcceptTradeResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TradeValue = obj->TryGetField(TEXT("Trade")); + if (TradeValue.IsValid() && !TradeValue->IsNull()) + { + Trade = MakeShareable(new FTradeInfo(TradeValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAdCampaignAttributionModel::~FAdCampaignAttributionModel() +{ + +} + +void PlayFab::ClientModels::FAdCampaignAttributionModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AttributedAt")); writeDatetime(AttributedAt, writer); + + if (CampaignId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CampaignId")); writer->WriteValue(CampaignId); } + + if (Platform.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Platform")); writer->WriteValue(Platform); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAdCampaignAttributionModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AttributedAtValue = obj->TryGetField(TEXT("AttributedAt")); + if (AttributedAtValue.IsValid()) + AttributedAt = readDatetime(AttributedAtValue); + + + const TSharedPtr CampaignIdValue = obj->TryGetField(TEXT("CampaignId")); + if (CampaignIdValue.IsValid() && !CampaignIdValue->IsNull()) + { + FString TmpValue; + if (CampaignIdValue->TryGetString(TmpValue)) { CampaignId = TmpValue; } + } + + const TSharedPtr PlatformValue = obj->TryGetField(TEXT("Platform")); + if (PlatformValue.IsValid() && !PlatformValue->IsNull()) + { + FString TmpValue; + if (PlatformValue->TryGetString(TmpValue)) { Platform = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddFriendRequest::~FAddFriendRequest() +{ + +} + +void PlayFab::ClientModels::FAddFriendRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FriendEmail.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendEmail")); writer->WriteValue(FriendEmail); } + + if (FriendPlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); } + + if (FriendTitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendTitleDisplayName")); writer->WriteValue(FriendTitleDisplayName); } + + if (FriendUsername.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendUsername")); writer->WriteValue(FriendUsername); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddFriendRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendEmailValue = obj->TryGetField(TEXT("FriendEmail")); + if (FriendEmailValue.IsValid() && !FriendEmailValue->IsNull()) + { + FString TmpValue; + if (FriendEmailValue->TryGetString(TmpValue)) { FriendEmail = TmpValue; } + } + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + const TSharedPtr FriendTitleDisplayNameValue = obj->TryGetField(TEXT("FriendTitleDisplayName")); + if (FriendTitleDisplayNameValue.IsValid() && !FriendTitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (FriendTitleDisplayNameValue->TryGetString(TmpValue)) { FriendTitleDisplayName = TmpValue; } + } + + const TSharedPtr FriendUsernameValue = obj->TryGetField(TEXT("FriendUsername")); + if (FriendUsernameValue.IsValid() && !FriendUsernameValue->IsNull()) + { + FString TmpValue; + if (FriendUsernameValue->TryGetString(TmpValue)) { FriendUsername = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddFriendResult::~FAddFriendResult() +{ + +} + +void PlayFab::ClientModels::FAddFriendResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Created")); writer->WriteValue(Created); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddFriendResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid() && !CreatedValue->IsNull()) + { + bool TmpValue; + if (CreatedValue->TryGetBool(TmpValue)) { Created = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGenericServiceId::~FGenericServiceId() +{ + +} + +void PlayFab::ClientModels::FGenericServiceId::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ServiceName")); writer->WriteValue(ServiceName); + + writer->WriteIdentifierPrefix(TEXT("UserId")); writer->WriteValue(UserId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGenericServiceId::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ServiceNameValue = obj->TryGetField(TEXT("ServiceName")); + if (ServiceNameValue.IsValid() && !ServiceNameValue->IsNull()) + { + FString TmpValue; + if (ServiceNameValue->TryGetString(TmpValue)) { ServiceName = TmpValue; } + } + + const TSharedPtr UserIdValue = obj->TryGetField(TEXT("UserId")); + if (UserIdValue.IsValid() && !UserIdValue->IsNull()) + { + FString TmpValue; + if (UserIdValue->TryGetString(TmpValue)) { UserId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddGenericIDRequest::~FAddGenericIDRequest() +{ + +} + +void PlayFab::ClientModels::FAddGenericIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GenericId")); GenericId.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddGenericIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GenericIdValue = obj->TryGetField(TEXT("GenericId")); + if (GenericIdValue.IsValid() && !GenericIdValue->IsNull()) + { + GenericId = FGenericServiceId(GenericIdValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddGenericIDResult::~FAddGenericIDResult() +{ + +} + +void PlayFab::ClientModels::FAddGenericIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddGenericIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddOrUpdateContactEmailRequest::~FAddOrUpdateContactEmailRequest() +{ + +} + +void PlayFab::ClientModels::FAddOrUpdateContactEmailRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("EmailAddress")); writer->WriteValue(EmailAddress); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddOrUpdateContactEmailRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailAddressValue = obj->TryGetField(TEXT("EmailAddress")); + if (EmailAddressValue.IsValid() && !EmailAddressValue->IsNull()) + { + FString TmpValue; + if (EmailAddressValue->TryGetString(TmpValue)) { EmailAddress = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddOrUpdateContactEmailResult::~FAddOrUpdateContactEmailResult() +{ + +} + +void PlayFab::ClientModels::FAddOrUpdateContactEmailResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddOrUpdateContactEmailResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddSharedGroupMembersRequest::~FAddSharedGroupMembersRequest() +{ + +} + +void PlayFab::ClientModels::FAddSharedGroupMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("PlayFabIds")); + for (const FString& item : PlayFabIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddSharedGroupMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("PlayFabIds"), PlayFabIds); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddSharedGroupMembersResult::~FAddSharedGroupMembersResult() +{ + +} + +void PlayFab::ClientModels::FAddSharedGroupMembersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddSharedGroupMembersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddUsernamePasswordRequest::~FAddUsernamePasswordRequest() +{ + +} + +void PlayFab::ClientModels::FAddUsernamePasswordRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); + + writer->WriteIdentifierPrefix(TEXT("Password")); writer->WriteValue(Password); + + writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddUsernamePasswordRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr PasswordValue = obj->TryGetField(TEXT("Password")); + if (PasswordValue.IsValid() && !PasswordValue->IsNull()) + { + FString TmpValue; + if (PasswordValue->TryGetString(TmpValue)) { Password = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddUsernamePasswordResult::~FAddUsernamePasswordResult() +{ + +} + +void PlayFab::ClientModels::FAddUsernamePasswordResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddUsernamePasswordResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAddUserVirtualCurrencyRequest::~FAddUserVirtualCurrencyRequest() +{ + +} + +void PlayFab::ClientModels::FAddUserVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAddUserVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAndroidDevicePushNotificationRegistrationRequest::~FAndroidDevicePushNotificationRegistrationRequest() +{ + +} + +void PlayFab::ClientModels::FAndroidDevicePushNotificationRegistrationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ConfirmationMessage.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ConfirmationMessage")); writer->WriteValue(ConfirmationMessage); } + + writer->WriteIdentifierPrefix(TEXT("DeviceToken")); writer->WriteValue(DeviceToken); + + if (SendPushNotificationConfirmation.notNull()) { writer->WriteIdentifierPrefix(TEXT("SendPushNotificationConfirmation")); writer->WriteValue(SendPushNotificationConfirmation); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAndroidDevicePushNotificationRegistrationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ConfirmationMessageValue = obj->TryGetField(TEXT("ConfirmationMessage")); + if (ConfirmationMessageValue.IsValid() && !ConfirmationMessageValue->IsNull()) + { + FString TmpValue; + if (ConfirmationMessageValue->TryGetString(TmpValue)) { ConfirmationMessage = TmpValue; } + } + + const TSharedPtr DeviceTokenValue = obj->TryGetField(TEXT("DeviceToken")); + if (DeviceTokenValue.IsValid() && !DeviceTokenValue->IsNull()) + { + FString TmpValue; + if (DeviceTokenValue->TryGetString(TmpValue)) { DeviceToken = TmpValue; } + } + + const TSharedPtr SendPushNotificationConfirmationValue = obj->TryGetField(TEXT("SendPushNotificationConfirmation")); + if (SendPushNotificationConfirmationValue.IsValid() && !SendPushNotificationConfirmationValue->IsNull()) + { + bool TmpValue; + if (SendPushNotificationConfirmationValue->TryGetBool(TmpValue)) { SendPushNotificationConfirmation = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAndroidDevicePushNotificationRegistrationResult::~FAndroidDevicePushNotificationRegistrationResult() +{ + +} + +void PlayFab::ClientModels::FAndroidDevicePushNotificationRegistrationResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAndroidDevicePushNotificationRegistrationResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FAttributeInstallRequest::~FAttributeInstallRequest() +{ + +} + +void PlayFab::ClientModels::FAttributeInstallRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Adid.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Adid")); writer->WriteValue(Adid); } + + if (Idfa.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Idfa")); writer->WriteValue(Idfa); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAttributeInstallRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AdidValue = obj->TryGetField(TEXT("Adid")); + if (AdidValue.IsValid() && !AdidValue->IsNull()) + { + FString TmpValue; + if (AdidValue->TryGetString(TmpValue)) { Adid = TmpValue; } + } + + const TSharedPtr IdfaValue = obj->TryGetField(TEXT("Idfa")); + if (IdfaValue.IsValid() && !IdfaValue->IsNull()) + { + FString TmpValue; + if (IdfaValue->TryGetString(TmpValue)) { Idfa = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FAttributeInstallResult::~FAttributeInstallResult() +{ + +} + +void PlayFab::ClientModels::FAttributeInstallResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FAttributeInstallResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FCancelTradeRequest::~FCancelTradeRequest() +{ + +} + +void PlayFab::ClientModels::FCancelTradeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("TradeId")); writer->WriteValue(TradeId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCancelTradeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TradeIdValue = obj->TryGetField(TEXT("TradeId")); + if (TradeIdValue.IsValid() && !TradeIdValue->IsNull()) + { + FString TmpValue; + if (TradeIdValue->TryGetString(TmpValue)) { TradeId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCancelTradeResponse::~FCancelTradeResponse() +{ + //if (Trade != nullptr) delete Trade; + +} + +void PlayFab::ClientModels::FCancelTradeResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Trade.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Trade")); Trade->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCancelTradeResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TradeValue = obj->TryGetField(TEXT("Trade")); + if (TradeValue.IsValid() && !TradeValue->IsNull()) + { + Trade = MakeShareable(new FTradeInfo(TradeValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCartItem::~FCartItem() +{ + +} + +void PlayFab::ClientModels::FCartItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (RealCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("RealCurrencyPrices")); + for (TMap::TConstIterator It(RealCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (VCAmount.Num() != 0) + { + writer->WriteObjectStart(TEXT("VCAmount")); + for (TMap::TConstIterator It(VCAmount); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyPrices")); + for (TMap::TConstIterator It(VirtualCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCartItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr* RealCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("RealCurrencyPrices"), RealCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*RealCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + RealCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VCAmountObject; + if (obj->TryGetObjectField(TEXT("VCAmount"), VCAmountObject)) + { + for (TMap>::TConstIterator It((*VCAmountObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VCAmount.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyPrices"), VirtualCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCatalogItemBundleInfo::~FCatalogItemBundleInfo() +{ + +} + +void PlayFab::ClientModels::FCatalogItemBundleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BundledItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundledItems")); + for (const FString& item : BundledItems) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundledResultTables.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundledResultTables")); + for (const FString& item : BundledResultTables) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundledVirtualCurrencies.Num() != 0) + { + writer->WriteObjectStart(TEXT("BundledVirtualCurrencies")); + for (TMap::TConstIterator It(BundledVirtualCurrencies); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCatalogItemBundleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("BundledItems"), BundledItems); + + obj->TryGetStringArrayField(TEXT("BundledResultTables"), BundledResultTables); + + const TSharedPtr* BundledVirtualCurrenciesObject; + if (obj->TryGetObjectField(TEXT("BundledVirtualCurrencies"), BundledVirtualCurrenciesObject)) + { + for (TMap>::TConstIterator It((*BundledVirtualCurrenciesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + BundledVirtualCurrencies.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCatalogItemConsumableInfo::~FCatalogItemConsumableInfo() +{ + +} + +void PlayFab::ClientModels::FCatalogItemConsumableInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (UsageCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsageCount")); writer->WriteValue(static_cast(UsageCount)); } + + if (UsagePeriod.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsagePeriod")); writer->WriteValue(static_cast(UsagePeriod)); } + + if (UsagePeriodGroup.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UsagePeriodGroup")); writer->WriteValue(UsagePeriodGroup); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCatalogItemConsumableInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UsageCountValue = obj->TryGetField(TEXT("UsageCount")); + if (UsageCountValue.IsValid() && !UsageCountValue->IsNull()) + { + uint32 TmpValue; + if (UsageCountValue->TryGetNumber(TmpValue)) { UsageCount = TmpValue; } + } + + const TSharedPtr UsagePeriodValue = obj->TryGetField(TEXT("UsagePeriod")); + if (UsagePeriodValue.IsValid() && !UsagePeriodValue->IsNull()) + { + uint32 TmpValue; + if (UsagePeriodValue->TryGetNumber(TmpValue)) { UsagePeriod = TmpValue; } + } + + const TSharedPtr UsagePeriodGroupValue = obj->TryGetField(TEXT("UsagePeriodGroup")); + if (UsagePeriodGroupValue.IsValid() && !UsagePeriodGroupValue->IsNull()) + { + FString TmpValue; + if (UsagePeriodGroupValue->TryGetString(TmpValue)) { UsagePeriodGroup = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCatalogItemContainerInfo::~FCatalogItemContainerInfo() +{ + +} + +void PlayFab::ClientModels::FCatalogItemContainerInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemContents")); + for (const FString& item : ItemContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (KeyItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KeyItemId")); writer->WriteValue(KeyItemId); } + + if (ResultTableContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("ResultTableContents")); + for (const FString& item : ResultTableContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyContents.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyContents")); + for (TMap::TConstIterator It(VirtualCurrencyContents); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCatalogItemContainerInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("ItemContents"), ItemContents); + + const TSharedPtr KeyItemIdValue = obj->TryGetField(TEXT("KeyItemId")); + if (KeyItemIdValue.IsValid() && !KeyItemIdValue->IsNull()) + { + FString TmpValue; + if (KeyItemIdValue->TryGetString(TmpValue)) { KeyItemId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("ResultTableContents"), ResultTableContents); + + const TSharedPtr* VirtualCurrencyContentsObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyContents"), VirtualCurrencyContentsObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyContentsObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyContents.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCatalogItem::~FCatalogItem() +{ + //if (Bundle != nullptr) delete Bundle; + //if (Consumable != nullptr) delete Consumable; + //if (Container != nullptr) delete Container; + +} + +void PlayFab::ClientModels::FCatalogItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Bundle.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Bundle")); Bundle->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("CanBecomeCharacter")); writer->WriteValue(CanBecomeCharacter); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (Consumable.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Consumable")); Consumable->writeJSON(writer); } + + if (Container.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Container")); Container->writeJSON(writer); } + + if (CustomData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomData")); writer->WriteValue(CustomData); } + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + writer->WriteIdentifierPrefix(TEXT("InitialLimitedEditionCount")); writer->WriteValue(InitialLimitedEditionCount); + + writer->WriteIdentifierPrefix(TEXT("IsLimitedEdition")); writer->WriteValue(IsLimitedEdition); + + writer->WriteIdentifierPrefix(TEXT("IsStackable")); writer->WriteValue(IsStackable); + + writer->WriteIdentifierPrefix(TEXT("IsTradable")); writer->WriteValue(IsTradable); + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (ItemImageUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemImageUrl")); writer->WriteValue(ItemImageUrl); } + + if (RealCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("RealCurrencyPrices")); + for (TMap::TConstIterator It(RealCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyPrices")); + for (TMap::TConstIterator It(VirtualCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCatalogItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BundleValue = obj->TryGetField(TEXT("Bundle")); + if (BundleValue.IsValid() && !BundleValue->IsNull()) + { + Bundle = MakeShareable(new FCatalogItemBundleInfo(BundleValue->AsObject())); + } + + const TSharedPtr CanBecomeCharacterValue = obj->TryGetField(TEXT("CanBecomeCharacter")); + if (CanBecomeCharacterValue.IsValid() && !CanBecomeCharacterValue->IsNull()) + { + bool TmpValue; + if (CanBecomeCharacterValue->TryGetBool(TmpValue)) { CanBecomeCharacter = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr ConsumableValue = obj->TryGetField(TEXT("Consumable")); + if (ConsumableValue.IsValid() && !ConsumableValue->IsNull()) + { + Consumable = MakeShareable(new FCatalogItemConsumableInfo(ConsumableValue->AsObject())); + } + + const TSharedPtr ContainerValue = obj->TryGetField(TEXT("Container")); + if (ContainerValue.IsValid() && !ContainerValue->IsNull()) + { + Container = MakeShareable(new FCatalogItemContainerInfo(ContainerValue->AsObject())); + } + + const TSharedPtr CustomDataValue = obj->TryGetField(TEXT("CustomData")); + if (CustomDataValue.IsValid() && !CustomDataValue->IsNull()) + { + FString TmpValue; + if (CustomDataValue->TryGetString(TmpValue)) { CustomData = TmpValue; } + } + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr InitialLimitedEditionCountValue = obj->TryGetField(TEXT("InitialLimitedEditionCount")); + if (InitialLimitedEditionCountValue.IsValid() && !InitialLimitedEditionCountValue->IsNull()) + { + int32 TmpValue; + if (InitialLimitedEditionCountValue->TryGetNumber(TmpValue)) { InitialLimitedEditionCount = TmpValue; } + } + + const TSharedPtr IsLimitedEditionValue = obj->TryGetField(TEXT("IsLimitedEdition")); + if (IsLimitedEditionValue.IsValid() && !IsLimitedEditionValue->IsNull()) + { + bool TmpValue; + if (IsLimitedEditionValue->TryGetBool(TmpValue)) { IsLimitedEdition = TmpValue; } + } + + const TSharedPtr IsStackableValue = obj->TryGetField(TEXT("IsStackable")); + if (IsStackableValue.IsValid() && !IsStackableValue->IsNull()) + { + bool TmpValue; + if (IsStackableValue->TryGetBool(TmpValue)) { IsStackable = TmpValue; } + } + + const TSharedPtr IsTradableValue = obj->TryGetField(TEXT("IsTradable")); + if (IsTradableValue.IsValid() && !IsTradableValue->IsNull()) + { + bool TmpValue; + if (IsTradableValue->TryGetBool(TmpValue)) { IsTradable = TmpValue; } + } + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemImageUrlValue = obj->TryGetField(TEXT("ItemImageUrl")); + if (ItemImageUrlValue.IsValid() && !ItemImageUrlValue->IsNull()) + { + FString TmpValue; + if (ItemImageUrlValue->TryGetString(TmpValue)) { ItemImageUrl = TmpValue; } + } + + const TSharedPtr* RealCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("RealCurrencyPrices"), RealCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*RealCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + RealCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr* VirtualCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyPrices"), VirtualCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FItemInstance::~FItemInstance() +{ + +} + +void PlayFab::ClientModels::FItemInstance::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (BundleContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundleContents")); + for (const FString& item : BundleContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundleParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BundleParent")); writer->WriteValue(BundleParent); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CustomData.Num() != 0) + { + writer->WriteObjectStart(TEXT("CustomData")); + for (TMap::TConstIterator It(CustomData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Expiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (PurchaseDate.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); } + + if (RemainingUses.notNull()) { writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); } + + if (UnitCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnitCurrency")); writer->WriteValue(UnitCurrency); } + + writer->WriteIdentifierPrefix(TEXT("UnitPrice")); writer->WriteValue(static_cast(UnitPrice)); + + if (UsesIncrementedBy.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsesIncrementedBy")); writer->WriteValue(UsesIncrementedBy); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FItemInstance::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("BundleContents"), BundleContents); + + const TSharedPtr BundleParentValue = obj->TryGetField(TEXT("BundleParent")); + if (BundleParentValue.IsValid() && !BundleParentValue->IsNull()) + { + FString TmpValue; + if (BundleParentValue->TryGetString(TmpValue)) { BundleParent = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr* CustomDataObject; + if (obj->TryGetObjectField(TEXT("CustomData"), CustomDataObject)) + { + for (TMap>::TConstIterator It((*CustomDataObject)->Values); It; ++It) + { + CustomData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + const TSharedPtr UnitCurrencyValue = obj->TryGetField(TEXT("UnitCurrency")); + if (UnitCurrencyValue.IsValid() && !UnitCurrencyValue->IsNull()) + { + FString TmpValue; + if (UnitCurrencyValue->TryGetString(TmpValue)) { UnitCurrency = TmpValue; } + } + + const TSharedPtr UnitPriceValue = obj->TryGetField(TEXT("UnitPrice")); + if (UnitPriceValue.IsValid() && !UnitPriceValue->IsNull()) + { + uint32 TmpValue; + if (UnitPriceValue->TryGetNumber(TmpValue)) { UnitPrice = TmpValue; } + } + + const TSharedPtr UsesIncrementedByValue = obj->TryGetField(TEXT("UsesIncrementedBy")); + if (UsesIncrementedByValue.IsValid() && !UsesIncrementedByValue->IsNull()) + { + int32 TmpValue; + if (UsesIncrementedByValue->TryGetNumber(TmpValue)) { UsesIncrementedBy = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCharacterInventory::~FCharacterInventory() +{ + +} + +void PlayFab::ClientModels::FCharacterInventory::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCharacterInventory::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FCharacterLeaderboardEntry::~FCharacterLeaderboardEntry() +{ + +} + +void PlayFab::ClientModels::FCharacterLeaderboardEntry::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CharacterName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterName")); writer->WriteValue(CharacterName); } + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteIdentifierPrefix(TEXT("Position")); writer->WriteValue(Position); + + writer->WriteIdentifierPrefix(TEXT("StatValue")); writer->WriteValue(StatValue); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCharacterLeaderboardEntry::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterNameValue = obj->TryGetField(TEXT("CharacterName")); + if (CharacterNameValue.IsValid() && !CharacterNameValue->IsNull()) + { + FString TmpValue; + if (CharacterNameValue->TryGetString(TmpValue)) { CharacterName = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PositionValue = obj->TryGetField(TEXT("Position")); + if (PositionValue.IsValid() && !PositionValue->IsNull()) + { + int32 TmpValue; + if (PositionValue->TryGetNumber(TmpValue)) { Position = TmpValue; } + } + + const TSharedPtr StatValueValue = obj->TryGetField(TEXT("StatValue")); + if (StatValueValue.IsValid() && !StatValueValue->IsNull()) + { + int32 TmpValue; + if (StatValueValue->TryGetNumber(TmpValue)) { StatValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCharacterResult::~FCharacterResult() +{ + +} + +void PlayFab::ClientModels::FCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CharacterName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterName")); writer->WriteValue(CharacterName); } + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterNameValue = obj->TryGetField(TEXT("CharacterName")); + if (CharacterNameValue.IsValid() && !CharacterNameValue->IsNull()) + { + FString TmpValue; + if (CharacterNameValue->TryGetString(TmpValue)) { CharacterName = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeCloudScriptRevisionOptionEnumJSON(CloudScriptRevisionOption enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CloudScriptRevisionOptionLive: writer->WriteValue(TEXT("Live")); break; + case CloudScriptRevisionOptionLatest: writer->WriteValue(TEXT("Latest")); break; + case CloudScriptRevisionOptionSpecific: writer->WriteValue(TEXT("Specific")); break; + } +} + +ClientModels::CloudScriptRevisionOption PlayFab::ClientModels::readCloudScriptRevisionOptionFromValue(const TSharedPtr& value) +{ + return readCloudScriptRevisionOptionFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::CloudScriptRevisionOption PlayFab::ClientModels::readCloudScriptRevisionOptionFromValue(const FString& value) +{ + static TMap _CloudScriptRevisionOptionMap; + if (_CloudScriptRevisionOptionMap.Num() == 0) + { + // Auto-generate the map on the first use + _CloudScriptRevisionOptionMap.Add(TEXT("Live"), CloudScriptRevisionOptionLive); + _CloudScriptRevisionOptionMap.Add(TEXT("Latest"), CloudScriptRevisionOptionLatest); + _CloudScriptRevisionOptionMap.Add(TEXT("Specific"), CloudScriptRevisionOptionSpecific); + + } + + if (!value.IsEmpty()) + { + auto output = _CloudScriptRevisionOptionMap.Find(value); + if (output != nullptr) + return *output; + } + + return CloudScriptRevisionOptionLive; // Basically critical fail +} + +PlayFab::ClientModels::FContainer_Dictionary_String_String::~FContainer_Dictionary_String_String() +{ + +} + +void PlayFab::ClientModels::FContainer_Dictionary_String_String::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FContainer_Dictionary_String_String::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCollectionFilter::~FCollectionFilter() +{ + +} + +void PlayFab::ClientModels::FCollectionFilter::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Excludes.Num() != 0) + { + writer->WriteArrayStart(TEXT("Excludes")); + for (const FContainer_Dictionary_String_String& item : Excludes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Includes.Num() != 0) + { + writer->WriteArrayStart(TEXT("Includes")); + for (const FContainer_Dictionary_String_String& item : Includes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCollectionFilter::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ExcludesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Excludes")); + for (int32 Idx = 0; Idx < ExcludesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ExcludesArray[Idx]; + Excludes.Add(FContainer_Dictionary_String_String(CurrentItem->AsObject())); + } + + + const TArray>&IncludesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Includes")); + for (int32 Idx = 0; Idx < IncludesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = IncludesArray[Idx]; + Includes.Add(FContainer_Dictionary_String_String(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FConfirmPurchaseRequest::~FConfirmPurchaseRequest() +{ + +} + +void PlayFab::ClientModels::FConfirmPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FConfirmPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FConfirmPurchaseResult::~FConfirmPurchaseResult() +{ + +} + +void PlayFab::ClientModels::FConfirmPurchaseResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Items.Num() != 0) + { + writer->WriteArrayStart(TEXT("Items")); + for (const FItemInstance& item : Items) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (OrderId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); } + + writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FConfirmPurchaseResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Items")); + for (int32 Idx = 0; Idx < ItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemsArray[Idx]; + Items.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + return HasSucceeded; +} + +PlayFab::ClientModels::FConsumeItemRequest::~FConsumeItemRequest() +{ + +} + +void PlayFab::ClientModels::FConsumeItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ConsumeCount")); writer->WriteValue(ConsumeCount); + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FConsumeItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ConsumeCountValue = obj->TryGetField(TEXT("ConsumeCount")); + if (ConsumeCountValue.IsValid() && !ConsumeCountValue->IsNull()) + { + int32 TmpValue; + if (ConsumeCountValue->TryGetNumber(TmpValue)) { ConsumeCount = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FConsumeItemResult::~FConsumeItemResult() +{ + +} + +void PlayFab::ClientModels::FConsumeItemResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FConsumeItemResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FConsumeXboxEntitlementsRequest::~FConsumeXboxEntitlementsRequest() +{ + +} + +void PlayFab::ClientModels::FConsumeXboxEntitlementsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FConsumeXboxEntitlementsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FConsumeXboxEntitlementsResult::~FConsumeXboxEntitlementsResult() +{ + +} + +void PlayFab::ClientModels::FConsumeXboxEntitlementsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Items.Num() != 0) + { + writer->WriteArrayStart(TEXT("Items")); + for (const FItemInstance& item : Items) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FConsumeXboxEntitlementsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Items")); + for (int32 Idx = 0; Idx < ItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemsArray[Idx]; + Items.Add(FItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeEmailVerificationStatusEnumJSON(EmailVerificationStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case EmailVerificationStatusUnverified: writer->WriteValue(TEXT("Unverified")); break; + case EmailVerificationStatusPending: writer->WriteValue(TEXT("Pending")); break; + case EmailVerificationStatusConfirmed: writer->WriteValue(TEXT("Confirmed")); break; + } +} + +ClientModels::EmailVerificationStatus PlayFab::ClientModels::readEmailVerificationStatusFromValue(const TSharedPtr& value) +{ + return readEmailVerificationStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::EmailVerificationStatus PlayFab::ClientModels::readEmailVerificationStatusFromValue(const FString& value) +{ + static TMap _EmailVerificationStatusMap; + if (_EmailVerificationStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _EmailVerificationStatusMap.Add(TEXT("Unverified"), EmailVerificationStatusUnverified); + _EmailVerificationStatusMap.Add(TEXT("Pending"), EmailVerificationStatusPending); + _EmailVerificationStatusMap.Add(TEXT("Confirmed"), EmailVerificationStatusConfirmed); + + } + + if (!value.IsEmpty()) + { + auto output = _EmailVerificationStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return EmailVerificationStatusUnverified; // Basically critical fail +} + +PlayFab::ClientModels::FContactEmailInfoModel::~FContactEmailInfoModel() +{ + +} + +void PlayFab::ClientModels::FContactEmailInfoModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EmailAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailAddress")); writer->WriteValue(EmailAddress); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + if (VerificationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("VerificationStatus")); writeEmailVerificationStatusEnumJSON(VerificationStatus, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FContactEmailInfoModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailAddressValue = obj->TryGetField(TEXT("EmailAddress")); + if (EmailAddressValue.IsValid() && !EmailAddressValue->IsNull()) + { + FString TmpValue; + if (EmailAddressValue->TryGetString(TmpValue)) { EmailAddress = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + VerificationStatus = readEmailVerificationStatusFromValue(obj->TryGetField(TEXT("VerificationStatus"))); + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeContinentCodeEnumJSON(ContinentCode enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ContinentCodeAF: writer->WriteValue(TEXT("AF")); break; + case ContinentCodeAN: writer->WriteValue(TEXT("AN")); break; + case ContinentCodeAS: writer->WriteValue(TEXT("AS")); break; + case ContinentCodeEU: writer->WriteValue(TEXT("EU")); break; + case ContinentCodeNA: writer->WriteValue(TEXT("NA")); break; + case ContinentCodeOC: writer->WriteValue(TEXT("OC")); break; + case ContinentCodeSA: writer->WriteValue(TEXT("SA")); break; + } +} + +ClientModels::ContinentCode PlayFab::ClientModels::readContinentCodeFromValue(const TSharedPtr& value) +{ + return readContinentCodeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::ContinentCode PlayFab::ClientModels::readContinentCodeFromValue(const FString& value) +{ + static TMap _ContinentCodeMap; + if (_ContinentCodeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ContinentCodeMap.Add(TEXT("AF"), ContinentCodeAF); + _ContinentCodeMap.Add(TEXT("AN"), ContinentCodeAN); + _ContinentCodeMap.Add(TEXT("AS"), ContinentCodeAS); + _ContinentCodeMap.Add(TEXT("EU"), ContinentCodeEU); + _ContinentCodeMap.Add(TEXT("NA"), ContinentCodeNA); + _ContinentCodeMap.Add(TEXT("OC"), ContinentCodeOC); + _ContinentCodeMap.Add(TEXT("SA"), ContinentCodeSA); + + } + + if (!value.IsEmpty()) + { + auto output = _ContinentCodeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ContinentCodeAF; // Basically critical fail +} + +void PlayFab::ClientModels::writeCountryCodeEnumJSON(CountryCode enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CountryCodeAF: writer->WriteValue(TEXT("AF")); break; + case CountryCodeAX: writer->WriteValue(TEXT("AX")); break; + case CountryCodeAL: writer->WriteValue(TEXT("AL")); break; + case CountryCodeDZ: writer->WriteValue(TEXT("DZ")); break; + case CountryCodeAS: writer->WriteValue(TEXT("AS")); break; + case CountryCodeAD: writer->WriteValue(TEXT("AD")); break; + case CountryCodeAO: writer->WriteValue(TEXT("AO")); break; + case CountryCodeAI: writer->WriteValue(TEXT("AI")); break; + case CountryCodeAQ: writer->WriteValue(TEXT("AQ")); break; + case CountryCodeAG: writer->WriteValue(TEXT("AG")); break; + case CountryCodeAR: writer->WriteValue(TEXT("AR")); break; + case CountryCodeAM: writer->WriteValue(TEXT("AM")); break; + case CountryCodeAW: writer->WriteValue(TEXT("AW")); break; + case CountryCodeAU: writer->WriteValue(TEXT("AU")); break; + case CountryCodeAT: writer->WriteValue(TEXT("AT")); break; + case CountryCodeAZ: writer->WriteValue(TEXT("AZ")); break; + case CountryCodeBS: writer->WriteValue(TEXT("BS")); break; + case CountryCodeBH: writer->WriteValue(TEXT("BH")); break; + case CountryCodeBD: writer->WriteValue(TEXT("BD")); break; + case CountryCodeBB: writer->WriteValue(TEXT("BB")); break; + case CountryCodeBY: writer->WriteValue(TEXT("BY")); break; + case CountryCodeBE: writer->WriteValue(TEXT("BE")); break; + case CountryCodeBZ: writer->WriteValue(TEXT("BZ")); break; + case CountryCodeBJ: writer->WriteValue(TEXT("BJ")); break; + case CountryCodeBM: writer->WriteValue(TEXT("BM")); break; + case CountryCodeBT: writer->WriteValue(TEXT("BT")); break; + case CountryCodeBO: writer->WriteValue(TEXT("BO")); break; + case CountryCodeBQ: writer->WriteValue(TEXT("BQ")); break; + case CountryCodeBA: writer->WriteValue(TEXT("BA")); break; + case CountryCodeBW: writer->WriteValue(TEXT("BW")); break; + case CountryCodeBV: writer->WriteValue(TEXT("BV")); break; + case CountryCodeBR: writer->WriteValue(TEXT("BR")); break; + case CountryCodeIO: writer->WriteValue(TEXT("IO")); break; + case CountryCodeBN: writer->WriteValue(TEXT("BN")); break; + case CountryCodeBG: writer->WriteValue(TEXT("BG")); break; + case CountryCodeBF: writer->WriteValue(TEXT("BF")); break; + case CountryCodeBI: writer->WriteValue(TEXT("BI")); break; + case CountryCodeKH: writer->WriteValue(TEXT("KH")); break; + case CountryCodeCM: writer->WriteValue(TEXT("CM")); break; + case CountryCodeCA: writer->WriteValue(TEXT("CA")); break; + case CountryCodeCV: writer->WriteValue(TEXT("CV")); break; + case CountryCodeKY: writer->WriteValue(TEXT("KY")); break; + case CountryCodeCF: writer->WriteValue(TEXT("CF")); break; + case CountryCodeTD: writer->WriteValue(TEXT("TD")); break; + case CountryCodeCL: writer->WriteValue(TEXT("CL")); break; + case CountryCodeCN: writer->WriteValue(TEXT("CN")); break; + case CountryCodeCX: writer->WriteValue(TEXT("CX")); break; + case CountryCodeCC: writer->WriteValue(TEXT("CC")); break; + case CountryCodeCO: writer->WriteValue(TEXT("CO")); break; + case CountryCodeKM: writer->WriteValue(TEXT("KM")); break; + case CountryCodeCG: writer->WriteValue(TEXT("CG")); break; + case CountryCodeCD: writer->WriteValue(TEXT("CD")); break; + case CountryCodeCK: writer->WriteValue(TEXT("CK")); break; + case CountryCodeCR: writer->WriteValue(TEXT("CR")); break; + case CountryCodeCI: writer->WriteValue(TEXT("CI")); break; + case CountryCodeHR: writer->WriteValue(TEXT("HR")); break; + case CountryCodeCU: writer->WriteValue(TEXT("CU")); break; + case CountryCodeCW: writer->WriteValue(TEXT("CW")); break; + case CountryCodeCY: writer->WriteValue(TEXT("CY")); break; + case CountryCodeCZ: writer->WriteValue(TEXT("CZ")); break; + case CountryCodeDK: writer->WriteValue(TEXT("DK")); break; + case CountryCodeDJ: writer->WriteValue(TEXT("DJ")); break; + case CountryCodeDM: writer->WriteValue(TEXT("DM")); break; + case CountryCodeDO: writer->WriteValue(TEXT("DO")); break; + case CountryCodeEC: writer->WriteValue(TEXT("EC")); break; + case CountryCodeEG: writer->WriteValue(TEXT("EG")); break; + case CountryCodeSV: writer->WriteValue(TEXT("SV")); break; + case CountryCodeGQ: writer->WriteValue(TEXT("GQ")); break; + case CountryCodeER: writer->WriteValue(TEXT("ER")); break; + case CountryCodeEE: writer->WriteValue(TEXT("EE")); break; + case CountryCodeET: writer->WriteValue(TEXT("ET")); break; + case CountryCodeFK: writer->WriteValue(TEXT("FK")); break; + case CountryCodeFO: writer->WriteValue(TEXT("FO")); break; + case CountryCodeFJ: writer->WriteValue(TEXT("FJ")); break; + case CountryCodeFI: writer->WriteValue(TEXT("FI")); break; + case CountryCodeFR: writer->WriteValue(TEXT("FR")); break; + case CountryCodeGF: writer->WriteValue(TEXT("GF")); break; + case CountryCodePF: writer->WriteValue(TEXT("PF")); break; + case CountryCodeTF: writer->WriteValue(TEXT("TF")); break; + case CountryCodeGA: writer->WriteValue(TEXT("GA")); break; + case CountryCodeGM: writer->WriteValue(TEXT("GM")); break; + case CountryCodeGE: writer->WriteValue(TEXT("GE")); break; + case CountryCodeDE: writer->WriteValue(TEXT("DE")); break; + case CountryCodeGH: writer->WriteValue(TEXT("GH")); break; + case CountryCodeGI: writer->WriteValue(TEXT("GI")); break; + case CountryCodeGR: writer->WriteValue(TEXT("GR")); break; + case CountryCodeGL: writer->WriteValue(TEXT("GL")); break; + case CountryCodeGD: writer->WriteValue(TEXT("GD")); break; + case CountryCodeGP: writer->WriteValue(TEXT("GP")); break; + case CountryCodeGU: writer->WriteValue(TEXT("GU")); break; + case CountryCodeGT: writer->WriteValue(TEXT("GT")); break; + case CountryCodeGG: writer->WriteValue(TEXT("GG")); break; + case CountryCodeGN: writer->WriteValue(TEXT("GN")); break; + case CountryCodeGW: writer->WriteValue(TEXT("GW")); break; + case CountryCodeGY: writer->WriteValue(TEXT("GY")); break; + case CountryCodeHT: writer->WriteValue(TEXT("HT")); break; + case CountryCodeHM: writer->WriteValue(TEXT("HM")); break; + case CountryCodeVA: writer->WriteValue(TEXT("VA")); break; + case CountryCodeHN: writer->WriteValue(TEXT("HN")); break; + case CountryCodeHK: writer->WriteValue(TEXT("HK")); break; + case CountryCodeHU: writer->WriteValue(TEXT("HU")); break; + case CountryCodeIS: writer->WriteValue(TEXT("IS")); break; + case CountryCodeIN: writer->WriteValue(TEXT("IN")); break; + case CountryCodeID: writer->WriteValue(TEXT("ID")); break; + case CountryCodeIR: writer->WriteValue(TEXT("IR")); break; + case CountryCodeIQ: writer->WriteValue(TEXT("IQ")); break; + case CountryCodeIE: writer->WriteValue(TEXT("IE")); break; + case CountryCodeIM: writer->WriteValue(TEXT("IM")); break; + case CountryCodeIL: writer->WriteValue(TEXT("IL")); break; + case CountryCodeIT: writer->WriteValue(TEXT("IT")); break; + case CountryCodeJM: writer->WriteValue(TEXT("JM")); break; + case CountryCodeJP: writer->WriteValue(TEXT("JP")); break; + case CountryCodeJE: writer->WriteValue(TEXT("JE")); break; + case CountryCodeJO: writer->WriteValue(TEXT("JO")); break; + case CountryCodeKZ: writer->WriteValue(TEXT("KZ")); break; + case CountryCodeKE: writer->WriteValue(TEXT("KE")); break; + case CountryCodeKI: writer->WriteValue(TEXT("KI")); break; + case CountryCodeKP: writer->WriteValue(TEXT("KP")); break; + case CountryCodeKR: writer->WriteValue(TEXT("KR")); break; + case CountryCodeKW: writer->WriteValue(TEXT("KW")); break; + case CountryCodeKG: writer->WriteValue(TEXT("KG")); break; + case CountryCodeLA: writer->WriteValue(TEXT("LA")); break; + case CountryCodeLV: writer->WriteValue(TEXT("LV")); break; + case CountryCodeLB: writer->WriteValue(TEXT("LB")); break; + case CountryCodeLS: writer->WriteValue(TEXT("LS")); break; + case CountryCodeLR: writer->WriteValue(TEXT("LR")); break; + case CountryCodeLY: writer->WriteValue(TEXT("LY")); break; + case CountryCodeLI: writer->WriteValue(TEXT("LI")); break; + case CountryCodeLT: writer->WriteValue(TEXT("LT")); break; + case CountryCodeLU: writer->WriteValue(TEXT("LU")); break; + case CountryCodeMO: writer->WriteValue(TEXT("MO")); break; + case CountryCodeMK: writer->WriteValue(TEXT("MK")); break; + case CountryCodeMG: writer->WriteValue(TEXT("MG")); break; + case CountryCodeMW: writer->WriteValue(TEXT("MW")); break; + case CountryCodeMY: writer->WriteValue(TEXT("MY")); break; + case CountryCodeMV: writer->WriteValue(TEXT("MV")); break; + case CountryCodeML: writer->WriteValue(TEXT("ML")); break; + case CountryCodeMT: writer->WriteValue(TEXT("MT")); break; + case CountryCodeMH: writer->WriteValue(TEXT("MH")); break; + case CountryCodeMQ: writer->WriteValue(TEXT("MQ")); break; + case CountryCodeMR: writer->WriteValue(TEXT("MR")); break; + case CountryCodeMU: writer->WriteValue(TEXT("MU")); break; + case CountryCodeYT: writer->WriteValue(TEXT("YT")); break; + case CountryCodeMX: writer->WriteValue(TEXT("MX")); break; + case CountryCodeFM: writer->WriteValue(TEXT("FM")); break; + case CountryCodeMD: writer->WriteValue(TEXT("MD")); break; + case CountryCodeMC: writer->WriteValue(TEXT("MC")); break; + case CountryCodeMN: writer->WriteValue(TEXT("MN")); break; + case CountryCodeME: writer->WriteValue(TEXT("ME")); break; + case CountryCodeMS: writer->WriteValue(TEXT("MS")); break; + case CountryCodeMA: writer->WriteValue(TEXT("MA")); break; + case CountryCodeMZ: writer->WriteValue(TEXT("MZ")); break; + case CountryCodeMM: writer->WriteValue(TEXT("MM")); break; + case CountryCodeNA: writer->WriteValue(TEXT("NA")); break; + case CountryCodeNR: writer->WriteValue(TEXT("NR")); break; + case CountryCodeNP: writer->WriteValue(TEXT("NP")); break; + case CountryCodeNL: writer->WriteValue(TEXT("NL")); break; + case CountryCodeNC: writer->WriteValue(TEXT("NC")); break; + case CountryCodeNZ: writer->WriteValue(TEXT("NZ")); break; + case CountryCodeNI: writer->WriteValue(TEXT("NI")); break; + case CountryCodeNE: writer->WriteValue(TEXT("NE")); break; + case CountryCodeNG: writer->WriteValue(TEXT("NG")); break; + case CountryCodeNU: writer->WriteValue(TEXT("NU")); break; + case CountryCodeNF: writer->WriteValue(TEXT("NF")); break; + case CountryCodeMP: writer->WriteValue(TEXT("MP")); break; + case CountryCodeNO: writer->WriteValue(TEXT("NO")); break; + case CountryCodeOM: writer->WriteValue(TEXT("OM")); break; + case CountryCodePK: writer->WriteValue(TEXT("PK")); break; + case CountryCodePW: writer->WriteValue(TEXT("PW")); break; + case CountryCodePS: writer->WriteValue(TEXT("PS")); break; + case CountryCodePA: writer->WriteValue(TEXT("PA")); break; + case CountryCodePG: writer->WriteValue(TEXT("PG")); break; + case CountryCodePY: writer->WriteValue(TEXT("PY")); break; + case CountryCodePE: writer->WriteValue(TEXT("PE")); break; + case CountryCodePH: writer->WriteValue(TEXT("PH")); break; + case CountryCodePN: writer->WriteValue(TEXT("PN")); break; + case CountryCodePL: writer->WriteValue(TEXT("PL")); break; + case CountryCodePT: writer->WriteValue(TEXT("PT")); break; + case CountryCodePR: writer->WriteValue(TEXT("PR")); break; + case CountryCodeQA: writer->WriteValue(TEXT("QA")); break; + case CountryCodeRE: writer->WriteValue(TEXT("RE")); break; + case CountryCodeRO: writer->WriteValue(TEXT("RO")); break; + case CountryCodeRU: writer->WriteValue(TEXT("RU")); break; + case CountryCodeRW: writer->WriteValue(TEXT("RW")); break; + case CountryCodeBL: writer->WriteValue(TEXT("BL")); break; + case CountryCodeSH: writer->WriteValue(TEXT("SH")); break; + case CountryCodeKN: writer->WriteValue(TEXT("KN")); break; + case CountryCodeLC: writer->WriteValue(TEXT("LC")); break; + case CountryCodeMF: writer->WriteValue(TEXT("MF")); break; + case CountryCodePM: writer->WriteValue(TEXT("PM")); break; + case CountryCodeVC: writer->WriteValue(TEXT("VC")); break; + case CountryCodeWS: writer->WriteValue(TEXT("WS")); break; + case CountryCodeSM: writer->WriteValue(TEXT("SM")); break; + case CountryCodeST: writer->WriteValue(TEXT("ST")); break; + case CountryCodeSA: writer->WriteValue(TEXT("SA")); break; + case CountryCodeSN: writer->WriteValue(TEXT("SN")); break; + case CountryCodeRS: writer->WriteValue(TEXT("RS")); break; + case CountryCodeSC: writer->WriteValue(TEXT("SC")); break; + case CountryCodeSL: writer->WriteValue(TEXT("SL")); break; + case CountryCodeSG: writer->WriteValue(TEXT("SG")); break; + case CountryCodeSX: writer->WriteValue(TEXT("SX")); break; + case CountryCodeSK: writer->WriteValue(TEXT("SK")); break; + case CountryCodeSI: writer->WriteValue(TEXT("SI")); break; + case CountryCodeSB: writer->WriteValue(TEXT("SB")); break; + case CountryCodeSO: writer->WriteValue(TEXT("SO")); break; + case CountryCodeZA: writer->WriteValue(TEXT("ZA")); break; + case CountryCodeGS: writer->WriteValue(TEXT("GS")); break; + case CountryCodeSS: writer->WriteValue(TEXT("SS")); break; + case CountryCodeES: writer->WriteValue(TEXT("ES")); break; + case CountryCodeLK: writer->WriteValue(TEXT("LK")); break; + case CountryCodeSD: writer->WriteValue(TEXT("SD")); break; + case CountryCodeSR: writer->WriteValue(TEXT("SR")); break; + case CountryCodeSJ: writer->WriteValue(TEXT("SJ")); break; + case CountryCodeSZ: writer->WriteValue(TEXT("SZ")); break; + case CountryCodeSE: writer->WriteValue(TEXT("SE")); break; + case CountryCodeCH: writer->WriteValue(TEXT("CH")); break; + case CountryCodeSY: writer->WriteValue(TEXT("SY")); break; + case CountryCodeTW: writer->WriteValue(TEXT("TW")); break; + case CountryCodeTJ: writer->WriteValue(TEXT("TJ")); break; + case CountryCodeTZ: writer->WriteValue(TEXT("TZ")); break; + case CountryCodeTH: writer->WriteValue(TEXT("TH")); break; + case CountryCodeTL: writer->WriteValue(TEXT("TL")); break; + case CountryCodeTG: writer->WriteValue(TEXT("TG")); break; + case CountryCodeTK: writer->WriteValue(TEXT("TK")); break; + case CountryCodeTO: writer->WriteValue(TEXT("TO")); break; + case CountryCodeTT: writer->WriteValue(TEXT("TT")); break; + case CountryCodeTN: writer->WriteValue(TEXT("TN")); break; + case CountryCodeTR: writer->WriteValue(TEXT("TR")); break; + case CountryCodeTM: writer->WriteValue(TEXT("TM")); break; + case CountryCodeTC: writer->WriteValue(TEXT("TC")); break; + case CountryCodeTV: writer->WriteValue(TEXT("TV")); break; + case CountryCodeUG: writer->WriteValue(TEXT("UG")); break; + case CountryCodeUA: writer->WriteValue(TEXT("UA")); break; + case CountryCodeAE: writer->WriteValue(TEXT("AE")); break; + case CountryCodeGB: writer->WriteValue(TEXT("GB")); break; + case CountryCodeUS: writer->WriteValue(TEXT("US")); break; + case CountryCodeUM: writer->WriteValue(TEXT("UM")); break; + case CountryCodeUY: writer->WriteValue(TEXT("UY")); break; + case CountryCodeUZ: writer->WriteValue(TEXT("UZ")); break; + case CountryCodeVU: writer->WriteValue(TEXT("VU")); break; + case CountryCodeVE: writer->WriteValue(TEXT("VE")); break; + case CountryCodeVN: writer->WriteValue(TEXT("VN")); break; + case CountryCodeVG: writer->WriteValue(TEXT("VG")); break; + case CountryCodeVI: writer->WriteValue(TEXT("VI")); break; + case CountryCodeWF: writer->WriteValue(TEXT("WF")); break; + case CountryCodeEH: writer->WriteValue(TEXT("EH")); break; + case CountryCodeYE: writer->WriteValue(TEXT("YE")); break; + case CountryCodeZM: writer->WriteValue(TEXT("ZM")); break; + case CountryCodeZW: writer->WriteValue(TEXT("ZW")); break; + } +} + +ClientModels::CountryCode PlayFab::ClientModels::readCountryCodeFromValue(const TSharedPtr& value) +{ + return readCountryCodeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::CountryCode PlayFab::ClientModels::readCountryCodeFromValue(const FString& value) +{ + static TMap _CountryCodeMap; + if (_CountryCodeMap.Num() == 0) + { + // Auto-generate the map on the first use + _CountryCodeMap.Add(TEXT("AF"), CountryCodeAF); + _CountryCodeMap.Add(TEXT("AX"), CountryCodeAX); + _CountryCodeMap.Add(TEXT("AL"), CountryCodeAL); + _CountryCodeMap.Add(TEXT("DZ"), CountryCodeDZ); + _CountryCodeMap.Add(TEXT("AS"), CountryCodeAS); + _CountryCodeMap.Add(TEXT("AD"), CountryCodeAD); + _CountryCodeMap.Add(TEXT("AO"), CountryCodeAO); + _CountryCodeMap.Add(TEXT("AI"), CountryCodeAI); + _CountryCodeMap.Add(TEXT("AQ"), CountryCodeAQ); + _CountryCodeMap.Add(TEXT("AG"), CountryCodeAG); + _CountryCodeMap.Add(TEXT("AR"), CountryCodeAR); + _CountryCodeMap.Add(TEXT("AM"), CountryCodeAM); + _CountryCodeMap.Add(TEXT("AW"), CountryCodeAW); + _CountryCodeMap.Add(TEXT("AU"), CountryCodeAU); + _CountryCodeMap.Add(TEXT("AT"), CountryCodeAT); + _CountryCodeMap.Add(TEXT("AZ"), CountryCodeAZ); + _CountryCodeMap.Add(TEXT("BS"), CountryCodeBS); + _CountryCodeMap.Add(TEXT("BH"), CountryCodeBH); + _CountryCodeMap.Add(TEXT("BD"), CountryCodeBD); + _CountryCodeMap.Add(TEXT("BB"), CountryCodeBB); + _CountryCodeMap.Add(TEXT("BY"), CountryCodeBY); + _CountryCodeMap.Add(TEXT("BE"), CountryCodeBE); + _CountryCodeMap.Add(TEXT("BZ"), CountryCodeBZ); + _CountryCodeMap.Add(TEXT("BJ"), CountryCodeBJ); + _CountryCodeMap.Add(TEXT("BM"), CountryCodeBM); + _CountryCodeMap.Add(TEXT("BT"), CountryCodeBT); + _CountryCodeMap.Add(TEXT("BO"), CountryCodeBO); + _CountryCodeMap.Add(TEXT("BQ"), CountryCodeBQ); + _CountryCodeMap.Add(TEXT("BA"), CountryCodeBA); + _CountryCodeMap.Add(TEXT("BW"), CountryCodeBW); + _CountryCodeMap.Add(TEXT("BV"), CountryCodeBV); + _CountryCodeMap.Add(TEXT("BR"), CountryCodeBR); + _CountryCodeMap.Add(TEXT("IO"), CountryCodeIO); + _CountryCodeMap.Add(TEXT("BN"), CountryCodeBN); + _CountryCodeMap.Add(TEXT("BG"), CountryCodeBG); + _CountryCodeMap.Add(TEXT("BF"), CountryCodeBF); + _CountryCodeMap.Add(TEXT("BI"), CountryCodeBI); + _CountryCodeMap.Add(TEXT("KH"), CountryCodeKH); + _CountryCodeMap.Add(TEXT("CM"), CountryCodeCM); + _CountryCodeMap.Add(TEXT("CA"), CountryCodeCA); + _CountryCodeMap.Add(TEXT("CV"), CountryCodeCV); + _CountryCodeMap.Add(TEXT("KY"), CountryCodeKY); + _CountryCodeMap.Add(TEXT("CF"), CountryCodeCF); + _CountryCodeMap.Add(TEXT("TD"), CountryCodeTD); + _CountryCodeMap.Add(TEXT("CL"), CountryCodeCL); + _CountryCodeMap.Add(TEXT("CN"), CountryCodeCN); + _CountryCodeMap.Add(TEXT("CX"), CountryCodeCX); + _CountryCodeMap.Add(TEXT("CC"), CountryCodeCC); + _CountryCodeMap.Add(TEXT("CO"), CountryCodeCO); + _CountryCodeMap.Add(TEXT("KM"), CountryCodeKM); + _CountryCodeMap.Add(TEXT("CG"), CountryCodeCG); + _CountryCodeMap.Add(TEXT("CD"), CountryCodeCD); + _CountryCodeMap.Add(TEXT("CK"), CountryCodeCK); + _CountryCodeMap.Add(TEXT("CR"), CountryCodeCR); + _CountryCodeMap.Add(TEXT("CI"), CountryCodeCI); + _CountryCodeMap.Add(TEXT("HR"), CountryCodeHR); + _CountryCodeMap.Add(TEXT("CU"), CountryCodeCU); + _CountryCodeMap.Add(TEXT("CW"), CountryCodeCW); + _CountryCodeMap.Add(TEXT("CY"), CountryCodeCY); + _CountryCodeMap.Add(TEXT("CZ"), CountryCodeCZ); + _CountryCodeMap.Add(TEXT("DK"), CountryCodeDK); + _CountryCodeMap.Add(TEXT("DJ"), CountryCodeDJ); + _CountryCodeMap.Add(TEXT("DM"), CountryCodeDM); + _CountryCodeMap.Add(TEXT("DO"), CountryCodeDO); + _CountryCodeMap.Add(TEXT("EC"), CountryCodeEC); + _CountryCodeMap.Add(TEXT("EG"), CountryCodeEG); + _CountryCodeMap.Add(TEXT("SV"), CountryCodeSV); + _CountryCodeMap.Add(TEXT("GQ"), CountryCodeGQ); + _CountryCodeMap.Add(TEXT("ER"), CountryCodeER); + _CountryCodeMap.Add(TEXT("EE"), CountryCodeEE); + _CountryCodeMap.Add(TEXT("ET"), CountryCodeET); + _CountryCodeMap.Add(TEXT("FK"), CountryCodeFK); + _CountryCodeMap.Add(TEXT("FO"), CountryCodeFO); + _CountryCodeMap.Add(TEXT("FJ"), CountryCodeFJ); + _CountryCodeMap.Add(TEXT("FI"), CountryCodeFI); + _CountryCodeMap.Add(TEXT("FR"), CountryCodeFR); + _CountryCodeMap.Add(TEXT("GF"), CountryCodeGF); + _CountryCodeMap.Add(TEXT("PF"), CountryCodePF); + _CountryCodeMap.Add(TEXT("TF"), CountryCodeTF); + _CountryCodeMap.Add(TEXT("GA"), CountryCodeGA); + _CountryCodeMap.Add(TEXT("GM"), CountryCodeGM); + _CountryCodeMap.Add(TEXT("GE"), CountryCodeGE); + _CountryCodeMap.Add(TEXT("DE"), CountryCodeDE); + _CountryCodeMap.Add(TEXT("GH"), CountryCodeGH); + _CountryCodeMap.Add(TEXT("GI"), CountryCodeGI); + _CountryCodeMap.Add(TEXT("GR"), CountryCodeGR); + _CountryCodeMap.Add(TEXT("GL"), CountryCodeGL); + _CountryCodeMap.Add(TEXT("GD"), CountryCodeGD); + _CountryCodeMap.Add(TEXT("GP"), CountryCodeGP); + _CountryCodeMap.Add(TEXT("GU"), CountryCodeGU); + _CountryCodeMap.Add(TEXT("GT"), CountryCodeGT); + _CountryCodeMap.Add(TEXT("GG"), CountryCodeGG); + _CountryCodeMap.Add(TEXT("GN"), CountryCodeGN); + _CountryCodeMap.Add(TEXT("GW"), CountryCodeGW); + _CountryCodeMap.Add(TEXT("GY"), CountryCodeGY); + _CountryCodeMap.Add(TEXT("HT"), CountryCodeHT); + _CountryCodeMap.Add(TEXT("HM"), CountryCodeHM); + _CountryCodeMap.Add(TEXT("VA"), CountryCodeVA); + _CountryCodeMap.Add(TEXT("HN"), CountryCodeHN); + _CountryCodeMap.Add(TEXT("HK"), CountryCodeHK); + _CountryCodeMap.Add(TEXT("HU"), CountryCodeHU); + _CountryCodeMap.Add(TEXT("IS"), CountryCodeIS); + _CountryCodeMap.Add(TEXT("IN"), CountryCodeIN); + _CountryCodeMap.Add(TEXT("ID"), CountryCodeID); + _CountryCodeMap.Add(TEXT("IR"), CountryCodeIR); + _CountryCodeMap.Add(TEXT("IQ"), CountryCodeIQ); + _CountryCodeMap.Add(TEXT("IE"), CountryCodeIE); + _CountryCodeMap.Add(TEXT("IM"), CountryCodeIM); + _CountryCodeMap.Add(TEXT("IL"), CountryCodeIL); + _CountryCodeMap.Add(TEXT("IT"), CountryCodeIT); + _CountryCodeMap.Add(TEXT("JM"), CountryCodeJM); + _CountryCodeMap.Add(TEXT("JP"), CountryCodeJP); + _CountryCodeMap.Add(TEXT("JE"), CountryCodeJE); + _CountryCodeMap.Add(TEXT("JO"), CountryCodeJO); + _CountryCodeMap.Add(TEXT("KZ"), CountryCodeKZ); + _CountryCodeMap.Add(TEXT("KE"), CountryCodeKE); + _CountryCodeMap.Add(TEXT("KI"), CountryCodeKI); + _CountryCodeMap.Add(TEXT("KP"), CountryCodeKP); + _CountryCodeMap.Add(TEXT("KR"), CountryCodeKR); + _CountryCodeMap.Add(TEXT("KW"), CountryCodeKW); + _CountryCodeMap.Add(TEXT("KG"), CountryCodeKG); + _CountryCodeMap.Add(TEXT("LA"), CountryCodeLA); + _CountryCodeMap.Add(TEXT("LV"), CountryCodeLV); + _CountryCodeMap.Add(TEXT("LB"), CountryCodeLB); + _CountryCodeMap.Add(TEXT("LS"), CountryCodeLS); + _CountryCodeMap.Add(TEXT("LR"), CountryCodeLR); + _CountryCodeMap.Add(TEXT("LY"), CountryCodeLY); + _CountryCodeMap.Add(TEXT("LI"), CountryCodeLI); + _CountryCodeMap.Add(TEXT("LT"), CountryCodeLT); + _CountryCodeMap.Add(TEXT("LU"), CountryCodeLU); + _CountryCodeMap.Add(TEXT("MO"), CountryCodeMO); + _CountryCodeMap.Add(TEXT("MK"), CountryCodeMK); + _CountryCodeMap.Add(TEXT("MG"), CountryCodeMG); + _CountryCodeMap.Add(TEXT("MW"), CountryCodeMW); + _CountryCodeMap.Add(TEXT("MY"), CountryCodeMY); + _CountryCodeMap.Add(TEXT("MV"), CountryCodeMV); + _CountryCodeMap.Add(TEXT("ML"), CountryCodeML); + _CountryCodeMap.Add(TEXT("MT"), CountryCodeMT); + _CountryCodeMap.Add(TEXT("MH"), CountryCodeMH); + _CountryCodeMap.Add(TEXT("MQ"), CountryCodeMQ); + _CountryCodeMap.Add(TEXT("MR"), CountryCodeMR); + _CountryCodeMap.Add(TEXT("MU"), CountryCodeMU); + _CountryCodeMap.Add(TEXT("YT"), CountryCodeYT); + _CountryCodeMap.Add(TEXT("MX"), CountryCodeMX); + _CountryCodeMap.Add(TEXT("FM"), CountryCodeFM); + _CountryCodeMap.Add(TEXT("MD"), CountryCodeMD); + _CountryCodeMap.Add(TEXT("MC"), CountryCodeMC); + _CountryCodeMap.Add(TEXT("MN"), CountryCodeMN); + _CountryCodeMap.Add(TEXT("ME"), CountryCodeME); + _CountryCodeMap.Add(TEXT("MS"), CountryCodeMS); + _CountryCodeMap.Add(TEXT("MA"), CountryCodeMA); + _CountryCodeMap.Add(TEXT("MZ"), CountryCodeMZ); + _CountryCodeMap.Add(TEXT("MM"), CountryCodeMM); + _CountryCodeMap.Add(TEXT("NA"), CountryCodeNA); + _CountryCodeMap.Add(TEXT("NR"), CountryCodeNR); + _CountryCodeMap.Add(TEXT("NP"), CountryCodeNP); + _CountryCodeMap.Add(TEXT("NL"), CountryCodeNL); + _CountryCodeMap.Add(TEXT("NC"), CountryCodeNC); + _CountryCodeMap.Add(TEXT("NZ"), CountryCodeNZ); + _CountryCodeMap.Add(TEXT("NI"), CountryCodeNI); + _CountryCodeMap.Add(TEXT("NE"), CountryCodeNE); + _CountryCodeMap.Add(TEXT("NG"), CountryCodeNG); + _CountryCodeMap.Add(TEXT("NU"), CountryCodeNU); + _CountryCodeMap.Add(TEXT("NF"), CountryCodeNF); + _CountryCodeMap.Add(TEXT("MP"), CountryCodeMP); + _CountryCodeMap.Add(TEXT("NO"), CountryCodeNO); + _CountryCodeMap.Add(TEXT("OM"), CountryCodeOM); + _CountryCodeMap.Add(TEXT("PK"), CountryCodePK); + _CountryCodeMap.Add(TEXT("PW"), CountryCodePW); + _CountryCodeMap.Add(TEXT("PS"), CountryCodePS); + _CountryCodeMap.Add(TEXT("PA"), CountryCodePA); + _CountryCodeMap.Add(TEXT("PG"), CountryCodePG); + _CountryCodeMap.Add(TEXT("PY"), CountryCodePY); + _CountryCodeMap.Add(TEXT("PE"), CountryCodePE); + _CountryCodeMap.Add(TEXT("PH"), CountryCodePH); + _CountryCodeMap.Add(TEXT("PN"), CountryCodePN); + _CountryCodeMap.Add(TEXT("PL"), CountryCodePL); + _CountryCodeMap.Add(TEXT("PT"), CountryCodePT); + _CountryCodeMap.Add(TEXT("PR"), CountryCodePR); + _CountryCodeMap.Add(TEXT("QA"), CountryCodeQA); + _CountryCodeMap.Add(TEXT("RE"), CountryCodeRE); + _CountryCodeMap.Add(TEXT("RO"), CountryCodeRO); + _CountryCodeMap.Add(TEXT("RU"), CountryCodeRU); + _CountryCodeMap.Add(TEXT("RW"), CountryCodeRW); + _CountryCodeMap.Add(TEXT("BL"), CountryCodeBL); + _CountryCodeMap.Add(TEXT("SH"), CountryCodeSH); + _CountryCodeMap.Add(TEXT("KN"), CountryCodeKN); + _CountryCodeMap.Add(TEXT("LC"), CountryCodeLC); + _CountryCodeMap.Add(TEXT("MF"), CountryCodeMF); + _CountryCodeMap.Add(TEXT("PM"), CountryCodePM); + _CountryCodeMap.Add(TEXT("VC"), CountryCodeVC); + _CountryCodeMap.Add(TEXT("WS"), CountryCodeWS); + _CountryCodeMap.Add(TEXT("SM"), CountryCodeSM); + _CountryCodeMap.Add(TEXT("ST"), CountryCodeST); + _CountryCodeMap.Add(TEXT("SA"), CountryCodeSA); + _CountryCodeMap.Add(TEXT("SN"), CountryCodeSN); + _CountryCodeMap.Add(TEXT("RS"), CountryCodeRS); + _CountryCodeMap.Add(TEXT("SC"), CountryCodeSC); + _CountryCodeMap.Add(TEXT("SL"), CountryCodeSL); + _CountryCodeMap.Add(TEXT("SG"), CountryCodeSG); + _CountryCodeMap.Add(TEXT("SX"), CountryCodeSX); + _CountryCodeMap.Add(TEXT("SK"), CountryCodeSK); + _CountryCodeMap.Add(TEXT("SI"), CountryCodeSI); + _CountryCodeMap.Add(TEXT("SB"), CountryCodeSB); + _CountryCodeMap.Add(TEXT("SO"), CountryCodeSO); + _CountryCodeMap.Add(TEXT("ZA"), CountryCodeZA); + _CountryCodeMap.Add(TEXT("GS"), CountryCodeGS); + _CountryCodeMap.Add(TEXT("SS"), CountryCodeSS); + _CountryCodeMap.Add(TEXT("ES"), CountryCodeES); + _CountryCodeMap.Add(TEXT("LK"), CountryCodeLK); + _CountryCodeMap.Add(TEXT("SD"), CountryCodeSD); + _CountryCodeMap.Add(TEXT("SR"), CountryCodeSR); + _CountryCodeMap.Add(TEXT("SJ"), CountryCodeSJ); + _CountryCodeMap.Add(TEXT("SZ"), CountryCodeSZ); + _CountryCodeMap.Add(TEXT("SE"), CountryCodeSE); + _CountryCodeMap.Add(TEXT("CH"), CountryCodeCH); + _CountryCodeMap.Add(TEXT("SY"), CountryCodeSY); + _CountryCodeMap.Add(TEXT("TW"), CountryCodeTW); + _CountryCodeMap.Add(TEXT("TJ"), CountryCodeTJ); + _CountryCodeMap.Add(TEXT("TZ"), CountryCodeTZ); + _CountryCodeMap.Add(TEXT("TH"), CountryCodeTH); + _CountryCodeMap.Add(TEXT("TL"), CountryCodeTL); + _CountryCodeMap.Add(TEXT("TG"), CountryCodeTG); + _CountryCodeMap.Add(TEXT("TK"), CountryCodeTK); + _CountryCodeMap.Add(TEXT("TO"), CountryCodeTO); + _CountryCodeMap.Add(TEXT("TT"), CountryCodeTT); + _CountryCodeMap.Add(TEXT("TN"), CountryCodeTN); + _CountryCodeMap.Add(TEXT("TR"), CountryCodeTR); + _CountryCodeMap.Add(TEXT("TM"), CountryCodeTM); + _CountryCodeMap.Add(TEXT("TC"), CountryCodeTC); + _CountryCodeMap.Add(TEXT("TV"), CountryCodeTV); + _CountryCodeMap.Add(TEXT("UG"), CountryCodeUG); + _CountryCodeMap.Add(TEXT("UA"), CountryCodeUA); + _CountryCodeMap.Add(TEXT("AE"), CountryCodeAE); + _CountryCodeMap.Add(TEXT("GB"), CountryCodeGB); + _CountryCodeMap.Add(TEXT("US"), CountryCodeUS); + _CountryCodeMap.Add(TEXT("UM"), CountryCodeUM); + _CountryCodeMap.Add(TEXT("UY"), CountryCodeUY); + _CountryCodeMap.Add(TEXT("UZ"), CountryCodeUZ); + _CountryCodeMap.Add(TEXT("VU"), CountryCodeVU); + _CountryCodeMap.Add(TEXT("VE"), CountryCodeVE); + _CountryCodeMap.Add(TEXT("VN"), CountryCodeVN); + _CountryCodeMap.Add(TEXT("VG"), CountryCodeVG); + _CountryCodeMap.Add(TEXT("VI"), CountryCodeVI); + _CountryCodeMap.Add(TEXT("WF"), CountryCodeWF); + _CountryCodeMap.Add(TEXT("EH"), CountryCodeEH); + _CountryCodeMap.Add(TEXT("YE"), CountryCodeYE); + _CountryCodeMap.Add(TEXT("ZM"), CountryCodeZM); + _CountryCodeMap.Add(TEXT("ZW"), CountryCodeZW); + + } + + if (!value.IsEmpty()) + { + auto output = _CountryCodeMap.Find(value); + if (output != nullptr) + return *output; + } + + return CountryCodeAF; // Basically critical fail +} + +PlayFab::ClientModels::FCreateSharedGroupRequest::~FCreateSharedGroupRequest() +{ + +} + +void PlayFab::ClientModels::FCreateSharedGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SharedGroupId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCreateSharedGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCreateSharedGroupResult::~FCreateSharedGroupResult() +{ + +} + +void PlayFab::ClientModels::FCreateSharedGroupResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SharedGroupId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCreateSharedGroupResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeCurrencyEnumJSON(Currency enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CurrencyAED: writer->WriteValue(TEXT("AED")); break; + case CurrencyAFN: writer->WriteValue(TEXT("AFN")); break; + case CurrencyALL: writer->WriteValue(TEXT("ALL")); break; + case CurrencyAMD: writer->WriteValue(TEXT("AMD")); break; + case CurrencyANG: writer->WriteValue(TEXT("ANG")); break; + case CurrencyAOA: writer->WriteValue(TEXT("AOA")); break; + case CurrencyARS: writer->WriteValue(TEXT("ARS")); break; + case CurrencyAUD: writer->WriteValue(TEXT("AUD")); break; + case CurrencyAWG: writer->WriteValue(TEXT("AWG")); break; + case CurrencyAZN: writer->WriteValue(TEXT("AZN")); break; + case CurrencyBAM: writer->WriteValue(TEXT("BAM")); break; + case CurrencyBBD: writer->WriteValue(TEXT("BBD")); break; + case CurrencyBDT: writer->WriteValue(TEXT("BDT")); break; + case CurrencyBGN: writer->WriteValue(TEXT("BGN")); break; + case CurrencyBHD: writer->WriteValue(TEXT("BHD")); break; + case CurrencyBIF: writer->WriteValue(TEXT("BIF")); break; + case CurrencyBMD: writer->WriteValue(TEXT("BMD")); break; + case CurrencyBND: writer->WriteValue(TEXT("BND")); break; + case CurrencyBOB: writer->WriteValue(TEXT("BOB")); break; + case CurrencyBRL: writer->WriteValue(TEXT("BRL")); break; + case CurrencyBSD: writer->WriteValue(TEXT("BSD")); break; + case CurrencyBTN: writer->WriteValue(TEXT("BTN")); break; + case CurrencyBWP: writer->WriteValue(TEXT("BWP")); break; + case CurrencyBYR: writer->WriteValue(TEXT("BYR")); break; + case CurrencyBZD: writer->WriteValue(TEXT("BZD")); break; + case CurrencyCAD: writer->WriteValue(TEXT("CAD")); break; + case CurrencyCDF: writer->WriteValue(TEXT("CDF")); break; + case CurrencyCHF: writer->WriteValue(TEXT("CHF")); break; + case CurrencyCLP: writer->WriteValue(TEXT("CLP")); break; + case CurrencyCNY: writer->WriteValue(TEXT("CNY")); break; + case CurrencyCOP: writer->WriteValue(TEXT("COP")); break; + case CurrencyCRC: writer->WriteValue(TEXT("CRC")); break; + case CurrencyCUC: writer->WriteValue(TEXT("CUC")); break; + case CurrencyCUP: writer->WriteValue(TEXT("CUP")); break; + case CurrencyCVE: writer->WriteValue(TEXT("CVE")); break; + case CurrencyCZK: writer->WriteValue(TEXT("CZK")); break; + case CurrencyDJF: writer->WriteValue(TEXT("DJF")); break; + case CurrencyDKK: writer->WriteValue(TEXT("DKK")); break; + case CurrencyDOP: writer->WriteValue(TEXT("DOP")); break; + case CurrencyDZD: writer->WriteValue(TEXT("DZD")); break; + case CurrencyEGP: writer->WriteValue(TEXT("EGP")); break; + case CurrencyERN: writer->WriteValue(TEXT("ERN")); break; + case CurrencyETB: writer->WriteValue(TEXT("ETB")); break; + case CurrencyEUR: writer->WriteValue(TEXT("EUR")); break; + case CurrencyFJD: writer->WriteValue(TEXT("FJD")); break; + case CurrencyFKP: writer->WriteValue(TEXT("FKP")); break; + case CurrencyGBP: writer->WriteValue(TEXT("GBP")); break; + case CurrencyGEL: writer->WriteValue(TEXT("GEL")); break; + case CurrencyGGP: writer->WriteValue(TEXT("GGP")); break; + case CurrencyGHS: writer->WriteValue(TEXT("GHS")); break; + case CurrencyGIP: writer->WriteValue(TEXT("GIP")); break; + case CurrencyGMD: writer->WriteValue(TEXT("GMD")); break; + case CurrencyGNF: writer->WriteValue(TEXT("GNF")); break; + case CurrencyGTQ: writer->WriteValue(TEXT("GTQ")); break; + case CurrencyGYD: writer->WriteValue(TEXT("GYD")); break; + case CurrencyHKD: writer->WriteValue(TEXT("HKD")); break; + case CurrencyHNL: writer->WriteValue(TEXT("HNL")); break; + case CurrencyHRK: writer->WriteValue(TEXT("HRK")); break; + case CurrencyHTG: writer->WriteValue(TEXT("HTG")); break; + case CurrencyHUF: writer->WriteValue(TEXT("HUF")); break; + case CurrencyIDR: writer->WriteValue(TEXT("IDR")); break; + case CurrencyILS: writer->WriteValue(TEXT("ILS")); break; + case CurrencyIMP: writer->WriteValue(TEXT("IMP")); break; + case CurrencyINR: writer->WriteValue(TEXT("INR")); break; + case CurrencyIQD: writer->WriteValue(TEXT("IQD")); break; + case CurrencyIRR: writer->WriteValue(TEXT("IRR")); break; + case CurrencyISK: writer->WriteValue(TEXT("ISK")); break; + case CurrencyJEP: writer->WriteValue(TEXT("JEP")); break; + case CurrencyJMD: writer->WriteValue(TEXT("JMD")); break; + case CurrencyJOD: writer->WriteValue(TEXT("JOD")); break; + case CurrencyJPY: writer->WriteValue(TEXT("JPY")); break; + case CurrencyKES: writer->WriteValue(TEXT("KES")); break; + case CurrencyKGS: writer->WriteValue(TEXT("KGS")); break; + case CurrencyKHR: writer->WriteValue(TEXT("KHR")); break; + case CurrencyKMF: writer->WriteValue(TEXT("KMF")); break; + case CurrencyKPW: writer->WriteValue(TEXT("KPW")); break; + case CurrencyKRW: writer->WriteValue(TEXT("KRW")); break; + case CurrencyKWD: writer->WriteValue(TEXT("KWD")); break; + case CurrencyKYD: writer->WriteValue(TEXT("KYD")); break; + case CurrencyKZT: writer->WriteValue(TEXT("KZT")); break; + case CurrencyLAK: writer->WriteValue(TEXT("LAK")); break; + case CurrencyLBP: writer->WriteValue(TEXT("LBP")); break; + case CurrencyLKR: writer->WriteValue(TEXT("LKR")); break; + case CurrencyLRD: writer->WriteValue(TEXT("LRD")); break; + case CurrencyLSL: writer->WriteValue(TEXT("LSL")); break; + case CurrencyLYD: writer->WriteValue(TEXT("LYD")); break; + case CurrencyMAD: writer->WriteValue(TEXT("MAD")); break; + case CurrencyMDL: writer->WriteValue(TEXT("MDL")); break; + case CurrencyMGA: writer->WriteValue(TEXT("MGA")); break; + case CurrencyMKD: writer->WriteValue(TEXT("MKD")); break; + case CurrencyMMK: writer->WriteValue(TEXT("MMK")); break; + case CurrencyMNT: writer->WriteValue(TEXT("MNT")); break; + case CurrencyMOP: writer->WriteValue(TEXT("MOP")); break; + case CurrencyMRO: writer->WriteValue(TEXT("MRO")); break; + case CurrencyMUR: writer->WriteValue(TEXT("MUR")); break; + case CurrencyMVR: writer->WriteValue(TEXT("MVR")); break; + case CurrencyMWK: writer->WriteValue(TEXT("MWK")); break; + case CurrencyMXN: writer->WriteValue(TEXT("MXN")); break; + case CurrencyMYR: writer->WriteValue(TEXT("MYR")); break; + case CurrencyMZN: writer->WriteValue(TEXT("MZN")); break; + case CurrencyNAD: writer->WriteValue(TEXT("NAD")); break; + case CurrencyNGN: writer->WriteValue(TEXT("NGN")); break; + case CurrencyNIO: writer->WriteValue(TEXT("NIO")); break; + case CurrencyNOK: writer->WriteValue(TEXT("NOK")); break; + case CurrencyNPR: writer->WriteValue(TEXT("NPR")); break; + case CurrencyNZD: writer->WriteValue(TEXT("NZD")); break; + case CurrencyOMR: writer->WriteValue(TEXT("OMR")); break; + case CurrencyPAB: writer->WriteValue(TEXT("PAB")); break; + case CurrencyPEN: writer->WriteValue(TEXT("PEN")); break; + case CurrencyPGK: writer->WriteValue(TEXT("PGK")); break; + case CurrencyPHP: writer->WriteValue(TEXT("PHP")); break; + case CurrencyPKR: writer->WriteValue(TEXT("PKR")); break; + case CurrencyPLN: writer->WriteValue(TEXT("PLN")); break; + case CurrencyPYG: writer->WriteValue(TEXT("PYG")); break; + case CurrencyQAR: writer->WriteValue(TEXT("QAR")); break; + case CurrencyRON: writer->WriteValue(TEXT("RON")); break; + case CurrencyRSD: writer->WriteValue(TEXT("RSD")); break; + case CurrencyRUB: writer->WriteValue(TEXT("RUB")); break; + case CurrencyRWF: writer->WriteValue(TEXT("RWF")); break; + case CurrencySAR: writer->WriteValue(TEXT("SAR")); break; + case CurrencySBD: writer->WriteValue(TEXT("SBD")); break; + case CurrencySCR: writer->WriteValue(TEXT("SCR")); break; + case CurrencySDG: writer->WriteValue(TEXT("SDG")); break; + case CurrencySEK: writer->WriteValue(TEXT("SEK")); break; + case CurrencySGD: writer->WriteValue(TEXT("SGD")); break; + case CurrencySHP: writer->WriteValue(TEXT("SHP")); break; + case CurrencySLL: writer->WriteValue(TEXT("SLL")); break; + case CurrencySOS: writer->WriteValue(TEXT("SOS")); break; + case CurrencySPL: writer->WriteValue(TEXT("SPL")); break; + case CurrencySRD: writer->WriteValue(TEXT("SRD")); break; + case CurrencySTD: writer->WriteValue(TEXT("STD")); break; + case CurrencySVC: writer->WriteValue(TEXT("SVC")); break; + case CurrencySYP: writer->WriteValue(TEXT("SYP")); break; + case CurrencySZL: writer->WriteValue(TEXT("SZL")); break; + case CurrencyTHB: writer->WriteValue(TEXT("THB")); break; + case CurrencyTJS: writer->WriteValue(TEXT("TJS")); break; + case CurrencyTMT: writer->WriteValue(TEXT("TMT")); break; + case CurrencyTND: writer->WriteValue(TEXT("TND")); break; + case CurrencyTOP: writer->WriteValue(TEXT("TOP")); break; + case CurrencyTRY: writer->WriteValue(TEXT("TRY")); break; + case CurrencyTTD: writer->WriteValue(TEXT("TTD")); break; + case CurrencyTVD: writer->WriteValue(TEXT("TVD")); break; + case CurrencyTWD: writer->WriteValue(TEXT("TWD")); break; + case CurrencyTZS: writer->WriteValue(TEXT("TZS")); break; + case CurrencyUAH: writer->WriteValue(TEXT("UAH")); break; + case CurrencyUGX: writer->WriteValue(TEXT("UGX")); break; + case CurrencyUSD: writer->WriteValue(TEXT("USD")); break; + case CurrencyUYU: writer->WriteValue(TEXT("UYU")); break; + case CurrencyUZS: writer->WriteValue(TEXT("UZS")); break; + case CurrencyVEF: writer->WriteValue(TEXT("VEF")); break; + case CurrencyVND: writer->WriteValue(TEXT("VND")); break; + case CurrencyVUV: writer->WriteValue(TEXT("VUV")); break; + case CurrencyWST: writer->WriteValue(TEXT("WST")); break; + case CurrencyXAF: writer->WriteValue(TEXT("XAF")); break; + case CurrencyXCD: writer->WriteValue(TEXT("XCD")); break; + case CurrencyXDR: writer->WriteValue(TEXT("XDR")); break; + case CurrencyXOF: writer->WriteValue(TEXT("XOF")); break; + case CurrencyXPF: writer->WriteValue(TEXT("XPF")); break; + case CurrencyYER: writer->WriteValue(TEXT("YER")); break; + case CurrencyZAR: writer->WriteValue(TEXT("ZAR")); break; + case CurrencyZMW: writer->WriteValue(TEXT("ZMW")); break; + case CurrencyZWD: writer->WriteValue(TEXT("ZWD")); break; + } +} + +ClientModels::Currency PlayFab::ClientModels::readCurrencyFromValue(const TSharedPtr& value) +{ + return readCurrencyFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::Currency PlayFab::ClientModels::readCurrencyFromValue(const FString& value) +{ + static TMap _CurrencyMap; + if (_CurrencyMap.Num() == 0) + { + // Auto-generate the map on the first use + _CurrencyMap.Add(TEXT("AED"), CurrencyAED); + _CurrencyMap.Add(TEXT("AFN"), CurrencyAFN); + _CurrencyMap.Add(TEXT("ALL"), CurrencyALL); + _CurrencyMap.Add(TEXT("AMD"), CurrencyAMD); + _CurrencyMap.Add(TEXT("ANG"), CurrencyANG); + _CurrencyMap.Add(TEXT("AOA"), CurrencyAOA); + _CurrencyMap.Add(TEXT("ARS"), CurrencyARS); + _CurrencyMap.Add(TEXT("AUD"), CurrencyAUD); + _CurrencyMap.Add(TEXT("AWG"), CurrencyAWG); + _CurrencyMap.Add(TEXT("AZN"), CurrencyAZN); + _CurrencyMap.Add(TEXT("BAM"), CurrencyBAM); + _CurrencyMap.Add(TEXT("BBD"), CurrencyBBD); + _CurrencyMap.Add(TEXT("BDT"), CurrencyBDT); + _CurrencyMap.Add(TEXT("BGN"), CurrencyBGN); + _CurrencyMap.Add(TEXT("BHD"), CurrencyBHD); + _CurrencyMap.Add(TEXT("BIF"), CurrencyBIF); + _CurrencyMap.Add(TEXT("BMD"), CurrencyBMD); + _CurrencyMap.Add(TEXT("BND"), CurrencyBND); + _CurrencyMap.Add(TEXT("BOB"), CurrencyBOB); + _CurrencyMap.Add(TEXT("BRL"), CurrencyBRL); + _CurrencyMap.Add(TEXT("BSD"), CurrencyBSD); + _CurrencyMap.Add(TEXT("BTN"), CurrencyBTN); + _CurrencyMap.Add(TEXT("BWP"), CurrencyBWP); + _CurrencyMap.Add(TEXT("BYR"), CurrencyBYR); + _CurrencyMap.Add(TEXT("BZD"), CurrencyBZD); + _CurrencyMap.Add(TEXT("CAD"), CurrencyCAD); + _CurrencyMap.Add(TEXT("CDF"), CurrencyCDF); + _CurrencyMap.Add(TEXT("CHF"), CurrencyCHF); + _CurrencyMap.Add(TEXT("CLP"), CurrencyCLP); + _CurrencyMap.Add(TEXT("CNY"), CurrencyCNY); + _CurrencyMap.Add(TEXT("COP"), CurrencyCOP); + _CurrencyMap.Add(TEXT("CRC"), CurrencyCRC); + _CurrencyMap.Add(TEXT("CUC"), CurrencyCUC); + _CurrencyMap.Add(TEXT("CUP"), CurrencyCUP); + _CurrencyMap.Add(TEXT("CVE"), CurrencyCVE); + _CurrencyMap.Add(TEXT("CZK"), CurrencyCZK); + _CurrencyMap.Add(TEXT("DJF"), CurrencyDJF); + _CurrencyMap.Add(TEXT("DKK"), CurrencyDKK); + _CurrencyMap.Add(TEXT("DOP"), CurrencyDOP); + _CurrencyMap.Add(TEXT("DZD"), CurrencyDZD); + _CurrencyMap.Add(TEXT("EGP"), CurrencyEGP); + _CurrencyMap.Add(TEXT("ERN"), CurrencyERN); + _CurrencyMap.Add(TEXT("ETB"), CurrencyETB); + _CurrencyMap.Add(TEXT("EUR"), CurrencyEUR); + _CurrencyMap.Add(TEXT("FJD"), CurrencyFJD); + _CurrencyMap.Add(TEXT("FKP"), CurrencyFKP); + _CurrencyMap.Add(TEXT("GBP"), CurrencyGBP); + _CurrencyMap.Add(TEXT("GEL"), CurrencyGEL); + _CurrencyMap.Add(TEXT("GGP"), CurrencyGGP); + _CurrencyMap.Add(TEXT("GHS"), CurrencyGHS); + _CurrencyMap.Add(TEXT("GIP"), CurrencyGIP); + _CurrencyMap.Add(TEXT("GMD"), CurrencyGMD); + _CurrencyMap.Add(TEXT("GNF"), CurrencyGNF); + _CurrencyMap.Add(TEXT("GTQ"), CurrencyGTQ); + _CurrencyMap.Add(TEXT("GYD"), CurrencyGYD); + _CurrencyMap.Add(TEXT("HKD"), CurrencyHKD); + _CurrencyMap.Add(TEXT("HNL"), CurrencyHNL); + _CurrencyMap.Add(TEXT("HRK"), CurrencyHRK); + _CurrencyMap.Add(TEXT("HTG"), CurrencyHTG); + _CurrencyMap.Add(TEXT("HUF"), CurrencyHUF); + _CurrencyMap.Add(TEXT("IDR"), CurrencyIDR); + _CurrencyMap.Add(TEXT("ILS"), CurrencyILS); + _CurrencyMap.Add(TEXT("IMP"), CurrencyIMP); + _CurrencyMap.Add(TEXT("INR"), CurrencyINR); + _CurrencyMap.Add(TEXT("IQD"), CurrencyIQD); + _CurrencyMap.Add(TEXT("IRR"), CurrencyIRR); + _CurrencyMap.Add(TEXT("ISK"), CurrencyISK); + _CurrencyMap.Add(TEXT("JEP"), CurrencyJEP); + _CurrencyMap.Add(TEXT("JMD"), CurrencyJMD); + _CurrencyMap.Add(TEXT("JOD"), CurrencyJOD); + _CurrencyMap.Add(TEXT("JPY"), CurrencyJPY); + _CurrencyMap.Add(TEXT("KES"), CurrencyKES); + _CurrencyMap.Add(TEXT("KGS"), CurrencyKGS); + _CurrencyMap.Add(TEXT("KHR"), CurrencyKHR); + _CurrencyMap.Add(TEXT("KMF"), CurrencyKMF); + _CurrencyMap.Add(TEXT("KPW"), CurrencyKPW); + _CurrencyMap.Add(TEXT("KRW"), CurrencyKRW); + _CurrencyMap.Add(TEXT("KWD"), CurrencyKWD); + _CurrencyMap.Add(TEXT("KYD"), CurrencyKYD); + _CurrencyMap.Add(TEXT("KZT"), CurrencyKZT); + _CurrencyMap.Add(TEXT("LAK"), CurrencyLAK); + _CurrencyMap.Add(TEXT("LBP"), CurrencyLBP); + _CurrencyMap.Add(TEXT("LKR"), CurrencyLKR); + _CurrencyMap.Add(TEXT("LRD"), CurrencyLRD); + _CurrencyMap.Add(TEXT("LSL"), CurrencyLSL); + _CurrencyMap.Add(TEXT("LYD"), CurrencyLYD); + _CurrencyMap.Add(TEXT("MAD"), CurrencyMAD); + _CurrencyMap.Add(TEXT("MDL"), CurrencyMDL); + _CurrencyMap.Add(TEXT("MGA"), CurrencyMGA); + _CurrencyMap.Add(TEXT("MKD"), CurrencyMKD); + _CurrencyMap.Add(TEXT("MMK"), CurrencyMMK); + _CurrencyMap.Add(TEXT("MNT"), CurrencyMNT); + _CurrencyMap.Add(TEXT("MOP"), CurrencyMOP); + _CurrencyMap.Add(TEXT("MRO"), CurrencyMRO); + _CurrencyMap.Add(TEXT("MUR"), CurrencyMUR); + _CurrencyMap.Add(TEXT("MVR"), CurrencyMVR); + _CurrencyMap.Add(TEXT("MWK"), CurrencyMWK); + _CurrencyMap.Add(TEXT("MXN"), CurrencyMXN); + _CurrencyMap.Add(TEXT("MYR"), CurrencyMYR); + _CurrencyMap.Add(TEXT("MZN"), CurrencyMZN); + _CurrencyMap.Add(TEXT("NAD"), CurrencyNAD); + _CurrencyMap.Add(TEXT("NGN"), CurrencyNGN); + _CurrencyMap.Add(TEXT("NIO"), CurrencyNIO); + _CurrencyMap.Add(TEXT("NOK"), CurrencyNOK); + _CurrencyMap.Add(TEXT("NPR"), CurrencyNPR); + _CurrencyMap.Add(TEXT("NZD"), CurrencyNZD); + _CurrencyMap.Add(TEXT("OMR"), CurrencyOMR); + _CurrencyMap.Add(TEXT("PAB"), CurrencyPAB); + _CurrencyMap.Add(TEXT("PEN"), CurrencyPEN); + _CurrencyMap.Add(TEXT("PGK"), CurrencyPGK); + _CurrencyMap.Add(TEXT("PHP"), CurrencyPHP); + _CurrencyMap.Add(TEXT("PKR"), CurrencyPKR); + _CurrencyMap.Add(TEXT("PLN"), CurrencyPLN); + _CurrencyMap.Add(TEXT("PYG"), CurrencyPYG); + _CurrencyMap.Add(TEXT("QAR"), CurrencyQAR); + _CurrencyMap.Add(TEXT("RON"), CurrencyRON); + _CurrencyMap.Add(TEXT("RSD"), CurrencyRSD); + _CurrencyMap.Add(TEXT("RUB"), CurrencyRUB); + _CurrencyMap.Add(TEXT("RWF"), CurrencyRWF); + _CurrencyMap.Add(TEXT("SAR"), CurrencySAR); + _CurrencyMap.Add(TEXT("SBD"), CurrencySBD); + _CurrencyMap.Add(TEXT("SCR"), CurrencySCR); + _CurrencyMap.Add(TEXT("SDG"), CurrencySDG); + _CurrencyMap.Add(TEXT("SEK"), CurrencySEK); + _CurrencyMap.Add(TEXT("SGD"), CurrencySGD); + _CurrencyMap.Add(TEXT("SHP"), CurrencySHP); + _CurrencyMap.Add(TEXT("SLL"), CurrencySLL); + _CurrencyMap.Add(TEXT("SOS"), CurrencySOS); + _CurrencyMap.Add(TEXT("SPL"), CurrencySPL); + _CurrencyMap.Add(TEXT("SRD"), CurrencySRD); + _CurrencyMap.Add(TEXT("STD"), CurrencySTD); + _CurrencyMap.Add(TEXT("SVC"), CurrencySVC); + _CurrencyMap.Add(TEXT("SYP"), CurrencySYP); + _CurrencyMap.Add(TEXT("SZL"), CurrencySZL); + _CurrencyMap.Add(TEXT("THB"), CurrencyTHB); + _CurrencyMap.Add(TEXT("TJS"), CurrencyTJS); + _CurrencyMap.Add(TEXT("TMT"), CurrencyTMT); + _CurrencyMap.Add(TEXT("TND"), CurrencyTND); + _CurrencyMap.Add(TEXT("TOP"), CurrencyTOP); + _CurrencyMap.Add(TEXT("TRY"), CurrencyTRY); + _CurrencyMap.Add(TEXT("TTD"), CurrencyTTD); + _CurrencyMap.Add(TEXT("TVD"), CurrencyTVD); + _CurrencyMap.Add(TEXT("TWD"), CurrencyTWD); + _CurrencyMap.Add(TEXT("TZS"), CurrencyTZS); + _CurrencyMap.Add(TEXT("UAH"), CurrencyUAH); + _CurrencyMap.Add(TEXT("UGX"), CurrencyUGX); + _CurrencyMap.Add(TEXT("USD"), CurrencyUSD); + _CurrencyMap.Add(TEXT("UYU"), CurrencyUYU); + _CurrencyMap.Add(TEXT("UZS"), CurrencyUZS); + _CurrencyMap.Add(TEXT("VEF"), CurrencyVEF); + _CurrencyMap.Add(TEXT("VND"), CurrencyVND); + _CurrencyMap.Add(TEXT("VUV"), CurrencyVUV); + _CurrencyMap.Add(TEXT("WST"), CurrencyWST); + _CurrencyMap.Add(TEXT("XAF"), CurrencyXAF); + _CurrencyMap.Add(TEXT("XCD"), CurrencyXCD); + _CurrencyMap.Add(TEXT("XDR"), CurrencyXDR); + _CurrencyMap.Add(TEXT("XOF"), CurrencyXOF); + _CurrencyMap.Add(TEXT("XPF"), CurrencyXPF); + _CurrencyMap.Add(TEXT("YER"), CurrencyYER); + _CurrencyMap.Add(TEXT("ZAR"), CurrencyZAR); + _CurrencyMap.Add(TEXT("ZMW"), CurrencyZMW); + _CurrencyMap.Add(TEXT("ZWD"), CurrencyZWD); + + } + + if (!value.IsEmpty()) + { + auto output = _CurrencyMap.Find(value); + if (output != nullptr) + return *output; + } + + return CurrencyAED; // Basically critical fail +} + +void PlayFab::ClientModels::writeRegionEnumJSON(Region enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case RegionUSCentral: writer->WriteValue(TEXT("USCentral")); break; + case RegionUSEast: writer->WriteValue(TEXT("USEast")); break; + case RegionEUWest: writer->WriteValue(TEXT("EUWest")); break; + case RegionSingapore: writer->WriteValue(TEXT("Singapore")); break; + case RegionJapan: writer->WriteValue(TEXT("Japan")); break; + case RegionBrazil: writer->WriteValue(TEXT("Brazil")); break; + case RegionAustralia: writer->WriteValue(TEXT("Australia")); break; + } +} + +ClientModels::Region PlayFab::ClientModels::readRegionFromValue(const TSharedPtr& value) +{ + return readRegionFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::Region PlayFab::ClientModels::readRegionFromValue(const FString& value) +{ + static TMap _RegionMap; + if (_RegionMap.Num() == 0) + { + // Auto-generate the map on the first use + _RegionMap.Add(TEXT("USCentral"), RegionUSCentral); + _RegionMap.Add(TEXT("USEast"), RegionUSEast); + _RegionMap.Add(TEXT("EUWest"), RegionEUWest); + _RegionMap.Add(TEXT("Singapore"), RegionSingapore); + _RegionMap.Add(TEXT("Japan"), RegionJapan); + _RegionMap.Add(TEXT("Brazil"), RegionBrazil); + _RegionMap.Add(TEXT("Australia"), RegionAustralia); + + } + + if (!value.IsEmpty()) + { + auto output = _RegionMap.Find(value); + if (output != nullptr) + return *output; + } + + return RegionUSCentral; // Basically critical fail +} + +PlayFab::ClientModels::FCurrentGamesRequest::~FCurrentGamesRequest() +{ + //if (TagFilter != nullptr) delete TagFilter; + +} + +void PlayFab::ClientModels::FCurrentGamesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BuildVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); } + + if (GameMode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameMode")); writer->WriteValue(GameMode); } + + if (pfRegion.notNull()) { writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); } + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + if (TagFilter.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TagFilter")); TagFilter->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCurrentGamesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TSharedPtr GameModeValue = obj->TryGetField(TEXT("GameMode")); + if (GameModeValue.IsValid() && !GameModeValue->IsNull()) + { + FString TmpValue; + if (GameModeValue->TryGetString(TmpValue)) { GameMode = TmpValue; } + } + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr TagFilterValue = obj->TryGetField(TEXT("TagFilter")); + if (TagFilterValue.IsValid() && !TagFilterValue->IsNull()) + { + TagFilter = MakeShareable(new FCollectionFilter(TagFilterValue->AsObject())); + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeGameInstanceStateEnumJSON(GameInstanceState enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case GameInstanceStateOpen: writer->WriteValue(TEXT("Open")); break; + case GameInstanceStateClosed: writer->WriteValue(TEXT("Closed")); break; + } +} + +ClientModels::GameInstanceState PlayFab::ClientModels::readGameInstanceStateFromValue(const TSharedPtr& value) +{ + return readGameInstanceStateFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::GameInstanceState PlayFab::ClientModels::readGameInstanceStateFromValue(const FString& value) +{ + static TMap _GameInstanceStateMap; + if (_GameInstanceStateMap.Num() == 0) + { + // Auto-generate the map on the first use + _GameInstanceStateMap.Add(TEXT("Open"), GameInstanceStateOpen); + _GameInstanceStateMap.Add(TEXT("Closed"), GameInstanceStateClosed); + + } + + if (!value.IsEmpty()) + { + auto output = _GameInstanceStateMap.Find(value); + if (output != nullptr) + return *output; + } + + return GameInstanceStateOpen; // Basically critical fail +} + +PlayFab::ClientModels::FGameInfo::~FGameInfo() +{ + +} + +void PlayFab::ClientModels::FGameInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BuildVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); } + + if (GameMode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameMode")); writer->WriteValue(GameMode); } + + if (GameServerData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameServerData")); writer->WriteValue(GameServerData); } + + if (GameServerStateEnum.notNull()) { writer->WriteIdentifierPrefix(TEXT("GameServerStateEnum")); writeGameInstanceStateEnumJSON(GameServerStateEnum, writer); } + + if (LastHeartbeat.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastHeartbeat")); writeDatetime(LastHeartbeat, writer); } + + if (LobbyID.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyID")); writer->WriteValue(LobbyID); } + + if (MaxPlayers.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxPlayers")); writer->WriteValue(MaxPlayers); } + + if (PlayerUserIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerUserIds")); + for (const FString& item : PlayerUserIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (pfRegion.notNull()) { writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); } + + writer->WriteIdentifierPrefix(TEXT("RunTime")); writer->WriteValue(static_cast(RunTime)); + + if (ServerHostname.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerHostname")); writer->WriteValue(ServerHostname); } + + if (ServerIPV4Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV4Address")); writer->WriteValue(ServerIPV4Address); } + + if (ServerIPV6Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV6Address")); writer->WriteValue(ServerIPV6Address); } + + if (ServerPort.notNull()) { writer->WriteIdentifierPrefix(TEXT("ServerPort")); writer->WriteValue(ServerPort); } + + if (ServerPublicDNSName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerPublicDNSName")); writer->WriteValue(ServerPublicDNSName); } + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + if (Tags.Num() != 0) + { + writer->WriteObjectStart(TEXT("Tags")); + for (TMap::TConstIterator It(Tags); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGameInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TSharedPtr GameModeValue = obj->TryGetField(TEXT("GameMode")); + if (GameModeValue.IsValid() && !GameModeValue->IsNull()) + { + FString TmpValue; + if (GameModeValue->TryGetString(TmpValue)) { GameMode = TmpValue; } + } + + const TSharedPtr GameServerDataValue = obj->TryGetField(TEXT("GameServerData")); + if (GameServerDataValue.IsValid() && !GameServerDataValue->IsNull()) + { + FString TmpValue; + if (GameServerDataValue->TryGetString(TmpValue)) { GameServerData = TmpValue; } + } + + GameServerStateEnum = readGameInstanceStateFromValue(obj->TryGetField(TEXT("GameServerStateEnum"))); + + const TSharedPtr LastHeartbeatValue = obj->TryGetField(TEXT("LastHeartbeat")); + if (LastHeartbeatValue.IsValid()) + LastHeartbeat = readDatetime(LastHeartbeatValue); + + + const TSharedPtr LobbyIDValue = obj->TryGetField(TEXT("LobbyID")); + if (LobbyIDValue.IsValid() && !LobbyIDValue->IsNull()) + { + FString TmpValue; + if (LobbyIDValue->TryGetString(TmpValue)) { LobbyID = TmpValue; } + } + + const TSharedPtr MaxPlayersValue = obj->TryGetField(TEXT("MaxPlayers")); + if (MaxPlayersValue.IsValid() && !MaxPlayersValue->IsNull()) + { + int32 TmpValue; + if (MaxPlayersValue->TryGetNumber(TmpValue)) { MaxPlayers = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("PlayerUserIds"), PlayerUserIds); + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + const TSharedPtr RunTimeValue = obj->TryGetField(TEXT("RunTime")); + if (RunTimeValue.IsValid() && !RunTimeValue->IsNull()) + { + uint32 TmpValue; + if (RunTimeValue->TryGetNumber(TmpValue)) { RunTime = TmpValue; } + } + + const TSharedPtr ServerHostnameValue = obj->TryGetField(TEXT("ServerHostname")); + if (ServerHostnameValue.IsValid() && !ServerHostnameValue->IsNull()) + { + FString TmpValue; + if (ServerHostnameValue->TryGetString(TmpValue)) { ServerHostname = TmpValue; } + } + + const TSharedPtr ServerIPV4AddressValue = obj->TryGetField(TEXT("ServerIPV4Address")); + if (ServerIPV4AddressValue.IsValid() && !ServerIPV4AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV4AddressValue->TryGetString(TmpValue)) { ServerIPV4Address = TmpValue; } + } + + const TSharedPtr ServerIPV6AddressValue = obj->TryGetField(TEXT("ServerIPV6Address")); + if (ServerIPV6AddressValue.IsValid() && !ServerIPV6AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV6AddressValue->TryGetString(TmpValue)) { ServerIPV6Address = TmpValue; } + } + + const TSharedPtr ServerPortValue = obj->TryGetField(TEXT("ServerPort")); + if (ServerPortValue.IsValid() && !ServerPortValue->IsNull()) + { + int32 TmpValue; + if (ServerPortValue->TryGetNumber(TmpValue)) { ServerPort = TmpValue; } + } + + const TSharedPtr ServerPublicDNSNameValue = obj->TryGetField(TEXT("ServerPublicDNSName")); + if (ServerPublicDNSNameValue.IsValid() && !ServerPublicDNSNameValue->IsNull()) + { + FString TmpValue; + if (ServerPublicDNSNameValue->TryGetString(TmpValue)) { ServerPublicDNSName = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr* TagsObject; + if (obj->TryGetObjectField(TEXT("Tags"), TagsObject)) + { + for (TMap>::TConstIterator It((*TagsObject)->Values); It; ++It) + { + Tags.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FCurrentGamesResult::~FCurrentGamesResult() +{ + +} + +void PlayFab::ClientModels::FCurrentGamesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GameCount")); writer->WriteValue(GameCount); + + if (Games.Num() != 0) + { + writer->WriteArrayStart(TEXT("Games")); + for (const FGameInfo& item : Games) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayerCount")); writer->WriteValue(PlayerCount); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FCurrentGamesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameCountValue = obj->TryGetField(TEXT("GameCount")); + if (GameCountValue.IsValid() && !GameCountValue->IsNull()) + { + int32 TmpValue; + if (GameCountValue->TryGetNumber(TmpValue)) { GameCount = TmpValue; } + } + + const TArray>&GamesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Games")); + for (int32 Idx = 0; Idx < GamesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GamesArray[Idx]; + Games.Add(FGameInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayerCountValue = obj->TryGetField(TEXT("PlayerCount")); + if (PlayerCountValue.IsValid() && !PlayerCountValue->IsNull()) + { + int32 TmpValue; + if (PlayerCountValue->TryGetNumber(TmpValue)) { PlayerCount = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FDeviceInfoRequest::~FDeviceInfoRequest() +{ + +} + +void PlayFab::ClientModels::FDeviceInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Info.Num() != 0) + { + writer->WriteObjectStart(TEXT("Info")); + for (TMap::TConstIterator It(Info); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FDeviceInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* InfoObject; + if (obj->TryGetObjectField(TEXT("Info"), InfoObject)) + { + for (TMap>::TConstIterator It((*InfoObject)->Values); It; ++It) + { + Info.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FEmptyResponse::~FEmptyResponse() +{ + +} + +void PlayFab::ClientModels::FEmptyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FEmptyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::ClientModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FEntityTokenResponse::~FEntityTokenResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::ClientModels::FEntityTokenResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + if (EntityToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EntityToken")); writer->WriteValue(EntityToken); } + + if (TokenExpiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("TokenExpiration")); writeDatetime(TokenExpiration, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FEntityTokenResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr EntityTokenValue = obj->TryGetField(TEXT("EntityToken")); + if (EntityTokenValue.IsValid() && !EntityTokenValue->IsNull()) + { + FString TmpValue; + if (EntityTokenValue->TryGetString(TmpValue)) { EntityToken = TmpValue; } + } + + const TSharedPtr TokenExpirationValue = obj->TryGetField(TEXT("TokenExpiration")); + if (TokenExpirationValue.IsValid()) + TokenExpiration = readDatetime(TokenExpirationValue); + + + return HasSucceeded; +} + +PlayFab::ClientModels::FExecuteCloudScriptRequest::~FExecuteCloudScriptRequest() +{ + +} + +void PlayFab::ClientModels::FExecuteCloudScriptRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); + + if (FunctionParameter.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionParameter")); FunctionParameter.writeJSON(writer); } + + if (GeneratePlayStreamEvent.notNull()) { writer->WriteIdentifierPrefix(TEXT("GeneratePlayStreamEvent")); writer->WriteValue(GeneratePlayStreamEvent); } + + if (RevisionSelection.notNull()) { writer->WriteIdentifierPrefix(TEXT("RevisionSelection")); writeCloudScriptRevisionOptionEnumJSON(RevisionSelection, writer); } + + if (SpecificRevision.notNull()) { writer->WriteIdentifierPrefix(TEXT("SpecificRevision")); writer->WriteValue(SpecificRevision); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FExecuteCloudScriptRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionParameterValue = obj->TryGetField(TEXT("FunctionParameter")); + if (FunctionParameterValue.IsValid() && !FunctionParameterValue->IsNull()) + { + FunctionParameter = FJsonKeeper(FunctionParameterValue); + } + + const TSharedPtr GeneratePlayStreamEventValue = obj->TryGetField(TEXT("GeneratePlayStreamEvent")); + if (GeneratePlayStreamEventValue.IsValid() && !GeneratePlayStreamEventValue->IsNull()) + { + bool TmpValue; + if (GeneratePlayStreamEventValue->TryGetBool(TmpValue)) { GeneratePlayStreamEvent = TmpValue; } + } + + RevisionSelection = readCloudScriptRevisionOptionFromValue(obj->TryGetField(TEXT("RevisionSelection"))); + + const TSharedPtr SpecificRevisionValue = obj->TryGetField(TEXT("SpecificRevision")); + if (SpecificRevisionValue.IsValid() && !SpecificRevisionValue->IsNull()) + { + int32 TmpValue; + if (SpecificRevisionValue->TryGetNumber(TmpValue)) { SpecificRevision = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FScriptExecutionError::~FScriptExecutionError() +{ + +} + +void PlayFab::ClientModels::FScriptExecutionError::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + if (StackTrace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StackTrace")); writer->WriteValue(StackTrace); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FScriptExecutionError::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + const TSharedPtr StackTraceValue = obj->TryGetField(TEXT("StackTrace")); + if (StackTraceValue.IsValid() && !StackTraceValue->IsNull()) + { + FString TmpValue; + if (StackTraceValue->TryGetString(TmpValue)) { StackTrace = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLogStatement::~FLogStatement() +{ + +} + +void PlayFab::ClientModels::FLogStatement::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.notNull()) { writer->WriteIdentifierPrefix(TEXT("Data")); Data.writeJSON(writer); } + + if (Level.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Level")); writer->WriteValue(Level); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLogStatement::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataValue = obj->TryGetField(TEXT("Data")); + if (DataValue.IsValid() && !DataValue->IsNull()) + { + Data = FJsonKeeper(DataValue); + } + + const TSharedPtr LevelValue = obj->TryGetField(TEXT("Level")); + if (LevelValue.IsValid() && !LevelValue->IsNull()) + { + FString TmpValue; + if (LevelValue->TryGetString(TmpValue)) { Level = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FExecuteCloudScriptResult::~FExecuteCloudScriptResult() +{ + //if (Error != nullptr) delete Error; + +} + +void PlayFab::ClientModels::FExecuteCloudScriptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("APIRequestsIssued")); writer->WriteValue(APIRequestsIssued); + + if (Error.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Error")); Error->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ExecutionTimeSeconds")); writer->WriteValue(ExecutionTimeSeconds); + + if (FunctionName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); } + + if (FunctionResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResult")); FunctionResult.writeJSON(writer); } + + if (FunctionResultTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResultTooLarge")); writer->WriteValue(FunctionResultTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("HttpRequestsIssued")); writer->WriteValue(HttpRequestsIssued); + + if (Logs.Num() != 0) + { + writer->WriteArrayStart(TEXT("Logs")); + for (const FLogStatement& item : Logs) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (LogsTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("LogsTooLarge")); writer->WriteValue(LogsTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("MemoryConsumedBytes")); writer->WriteValue(static_cast(MemoryConsumedBytes)); + + writer->WriteIdentifierPrefix(TEXT("ProcessorTimeSeconds")); writer->WriteValue(ProcessorTimeSeconds); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FExecuteCloudScriptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr APIRequestsIssuedValue = obj->TryGetField(TEXT("APIRequestsIssued")); + if (APIRequestsIssuedValue.IsValid() && !APIRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (APIRequestsIssuedValue->TryGetNumber(TmpValue)) { APIRequestsIssued = TmpValue; } + } + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + Error = MakeShareable(new FScriptExecutionError(ErrorValue->AsObject())); + } + + const TSharedPtr ExecutionTimeSecondsValue = obj->TryGetField(TEXT("ExecutionTimeSeconds")); + if (ExecutionTimeSecondsValue.IsValid() && !ExecutionTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ExecutionTimeSecondsValue->TryGetNumber(TmpValue)) { ExecutionTimeSeconds = TmpValue; } + } + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionResultValue = obj->TryGetField(TEXT("FunctionResult")); + if (FunctionResultValue.IsValid() && !FunctionResultValue->IsNull()) + { + FunctionResult = FJsonKeeper(FunctionResultValue); + } + + const TSharedPtr FunctionResultTooLargeValue = obj->TryGetField(TEXT("FunctionResultTooLarge")); + if (FunctionResultTooLargeValue.IsValid() && !FunctionResultTooLargeValue->IsNull()) + { + bool TmpValue; + if (FunctionResultTooLargeValue->TryGetBool(TmpValue)) { FunctionResultTooLarge = TmpValue; } + } + + const TSharedPtr HttpRequestsIssuedValue = obj->TryGetField(TEXT("HttpRequestsIssued")); + if (HttpRequestsIssuedValue.IsValid() && !HttpRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (HttpRequestsIssuedValue->TryGetNumber(TmpValue)) { HttpRequestsIssued = TmpValue; } + } + + const TArray>&LogsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Logs")); + for (int32 Idx = 0; Idx < LogsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LogsArray[Idx]; + Logs.Add(FLogStatement(CurrentItem->AsObject())); + } + + + const TSharedPtr LogsTooLargeValue = obj->TryGetField(TEXT("LogsTooLarge")); + if (LogsTooLargeValue.IsValid() && !LogsTooLargeValue->IsNull()) + { + bool TmpValue; + if (LogsTooLargeValue->TryGetBool(TmpValue)) { LogsTooLarge = TmpValue; } + } + + const TSharedPtr MemoryConsumedBytesValue = obj->TryGetField(TEXT("MemoryConsumedBytes")); + if (MemoryConsumedBytesValue.IsValid() && !MemoryConsumedBytesValue->IsNull()) + { + uint32 TmpValue; + if (MemoryConsumedBytesValue->TryGetNumber(TmpValue)) { MemoryConsumedBytes = TmpValue; } + } + + const TSharedPtr ProcessorTimeSecondsValue = obj->TryGetField(TEXT("ProcessorTimeSeconds")); + if (ProcessorTimeSecondsValue.IsValid() && !ProcessorTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ProcessorTimeSecondsValue->TryGetNumber(TmpValue)) { ProcessorTimeSeconds = TmpValue; } + } + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FFacebookInstantGamesPlayFabIdPair::~FFacebookInstantGamesPlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FFacebookInstantGamesPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookInstantGamesId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesId")); writer->WriteValue(FacebookInstantGamesId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FFacebookInstantGamesPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesIdValue = obj->TryGetField(TEXT("FacebookInstantGamesId")); + if (FacebookInstantGamesIdValue.IsValid() && !FacebookInstantGamesIdValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesIdValue->TryGetString(TmpValue)) { FacebookInstantGamesId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FFacebookPlayFabIdPair::~FFacebookPlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FFacebookPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookId")); writer->WriteValue(FacebookId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FFacebookPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookIdValue = obj->TryGetField(TEXT("FacebookId")); + if (FacebookIdValue.IsValid() && !FacebookIdValue->IsNull()) + { + FString TmpValue; + if (FacebookIdValue->TryGetString(TmpValue)) { FacebookId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserFacebookInfo::~FUserFacebookInfo() +{ + +} + +void PlayFab::ClientModels::FUserFacebookInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookId")); writer->WriteValue(FacebookId); } + + if (FullName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FullName")); writer->WriteValue(FullName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserFacebookInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookIdValue = obj->TryGetField(TEXT("FacebookId")); + if (FacebookIdValue.IsValid() && !FacebookIdValue->IsNull()) + { + FString TmpValue; + if (FacebookIdValue->TryGetString(TmpValue)) { FacebookId = TmpValue; } + } + + const TSharedPtr FullNameValue = obj->TryGetField(TEXT("FullName")); + if (FullNameValue.IsValid() && !FullNameValue->IsNull()) + { + FString TmpValue; + if (FullNameValue->TryGetString(TmpValue)) { FullName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserGameCenterInfo::~FUserGameCenterInfo() +{ + +} + +void PlayFab::ClientModels::FUserGameCenterInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GameCenterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameCenterId")); writer->WriteValue(GameCenterId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserGameCenterInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameCenterIdValue = obj->TryGetField(TEXT("GameCenterId")); + if (GameCenterIdValue.IsValid() && !GameCenterIdValue->IsNull()) + { + FString TmpValue; + if (GameCenterIdValue->TryGetString(TmpValue)) { GameCenterId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeLoginIdentityProviderEnumJSON(LoginIdentityProvider enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case LoginIdentityProviderUnknown: writer->WriteValue(TEXT("Unknown")); break; + case LoginIdentityProviderPlayFab: writer->WriteValue(TEXT("PlayFab")); break; + case LoginIdentityProviderCustom: writer->WriteValue(TEXT("Custom")); break; + case LoginIdentityProviderGameCenter: writer->WriteValue(TEXT("GameCenter")); break; + case LoginIdentityProviderGooglePlay: writer->WriteValue(TEXT("GooglePlay")); break; + case LoginIdentityProviderSteam: writer->WriteValue(TEXT("Steam")); break; + case LoginIdentityProviderXBoxLive: writer->WriteValue(TEXT("XBoxLive")); break; + case LoginIdentityProviderPSN: writer->WriteValue(TEXT("PSN")); break; + case LoginIdentityProviderKongregate: writer->WriteValue(TEXT("Kongregate")); break; + case LoginIdentityProviderFacebook: writer->WriteValue(TEXT("Facebook")); break; + case LoginIdentityProviderIOSDevice: writer->WriteValue(TEXT("IOSDevice")); break; + case LoginIdentityProviderAndroidDevice: writer->WriteValue(TEXT("AndroidDevice")); break; + case LoginIdentityProviderTwitch: writer->WriteValue(TEXT("Twitch")); break; + case LoginIdentityProviderWindowsHello: writer->WriteValue(TEXT("WindowsHello")); break; + case LoginIdentityProviderGameServer: writer->WriteValue(TEXT("GameServer")); break; + case LoginIdentityProviderCustomServer: writer->WriteValue(TEXT("CustomServer")); break; + case LoginIdentityProviderNintendoSwitch: writer->WriteValue(TEXT("NintendoSwitch")); break; + case LoginIdentityProviderFacebookInstantGames: writer->WriteValue(TEXT("FacebookInstantGames")); break; + case LoginIdentityProviderOpenIdConnect: writer->WriteValue(TEXT("OpenIdConnect")); break; + } +} + +ClientModels::LoginIdentityProvider PlayFab::ClientModels::readLoginIdentityProviderFromValue(const TSharedPtr& value) +{ + return readLoginIdentityProviderFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::LoginIdentityProvider PlayFab::ClientModels::readLoginIdentityProviderFromValue(const FString& value) +{ + static TMap _LoginIdentityProviderMap; + if (_LoginIdentityProviderMap.Num() == 0) + { + // Auto-generate the map on the first use + _LoginIdentityProviderMap.Add(TEXT("Unknown"), LoginIdentityProviderUnknown); + _LoginIdentityProviderMap.Add(TEXT("PlayFab"), LoginIdentityProviderPlayFab); + _LoginIdentityProviderMap.Add(TEXT("Custom"), LoginIdentityProviderCustom); + _LoginIdentityProviderMap.Add(TEXT("GameCenter"), LoginIdentityProviderGameCenter); + _LoginIdentityProviderMap.Add(TEXT("GooglePlay"), LoginIdentityProviderGooglePlay); + _LoginIdentityProviderMap.Add(TEXT("Steam"), LoginIdentityProviderSteam); + _LoginIdentityProviderMap.Add(TEXT("XBoxLive"), LoginIdentityProviderXBoxLive); + _LoginIdentityProviderMap.Add(TEXT("PSN"), LoginIdentityProviderPSN); + _LoginIdentityProviderMap.Add(TEXT("Kongregate"), LoginIdentityProviderKongregate); + _LoginIdentityProviderMap.Add(TEXT("Facebook"), LoginIdentityProviderFacebook); + _LoginIdentityProviderMap.Add(TEXT("IOSDevice"), LoginIdentityProviderIOSDevice); + _LoginIdentityProviderMap.Add(TEXT("AndroidDevice"), LoginIdentityProviderAndroidDevice); + _LoginIdentityProviderMap.Add(TEXT("Twitch"), LoginIdentityProviderTwitch); + _LoginIdentityProviderMap.Add(TEXT("WindowsHello"), LoginIdentityProviderWindowsHello); + _LoginIdentityProviderMap.Add(TEXT("GameServer"), LoginIdentityProviderGameServer); + _LoginIdentityProviderMap.Add(TEXT("CustomServer"), LoginIdentityProviderCustomServer); + _LoginIdentityProviderMap.Add(TEXT("NintendoSwitch"), LoginIdentityProviderNintendoSwitch); + _LoginIdentityProviderMap.Add(TEXT("FacebookInstantGames"), LoginIdentityProviderFacebookInstantGames); + _LoginIdentityProviderMap.Add(TEXT("OpenIdConnect"), LoginIdentityProviderOpenIdConnect); + + } + + if (!value.IsEmpty()) + { + auto output = _LoginIdentityProviderMap.Find(value); + if (output != nullptr) + return *output; + } + + return LoginIdentityProviderUnknown; // Basically critical fail +} + +PlayFab::ClientModels::FLinkedPlatformAccountModel::~FLinkedPlatformAccountModel() +{ + +} + +void PlayFab::ClientModels::FLinkedPlatformAccountModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writeLoginIdentityProviderEnumJSON(Platform, writer); } + + if (PlatformUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlatformUserId")); writer->WriteValue(PlatformUserId); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkedPlatformAccountModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + Platform = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Platform"))); + + const TSharedPtr PlatformUserIdValue = obj->TryGetField(TEXT("PlatformUserId")); + if (PlatformUserIdValue.IsValid() && !PlatformUserIdValue->IsNull()) + { + FString TmpValue; + if (PlatformUserIdValue->TryGetString(TmpValue)) { PlatformUserId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLocationModel::~FLocationModel() +{ + +} + +void PlayFab::ClientModels::FLocationModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (City.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("City")); writer->WriteValue(City); } + + if (pfContinentCode.notNull()) { writer->WriteIdentifierPrefix(TEXT("ContinentCode")); writeContinentCodeEnumJSON(pfContinentCode, writer); } + + if (pfCountryCode.notNull()) { writer->WriteIdentifierPrefix(TEXT("CountryCode")); writeCountryCodeEnumJSON(pfCountryCode, writer); } + + if (Latitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Latitude")); writer->WriteValue(Latitude); } + + if (Longitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Longitude")); writer->WriteValue(Longitude); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLocationModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CityValue = obj->TryGetField(TEXT("City")); + if (CityValue.IsValid() && !CityValue->IsNull()) + { + FString TmpValue; + if (CityValue->TryGetString(TmpValue)) { City = TmpValue; } + } + + pfContinentCode = readContinentCodeFromValue(obj->TryGetField(TEXT("ContinentCode"))); + + pfCountryCode = readCountryCodeFromValue(obj->TryGetField(TEXT("CountryCode"))); + + const TSharedPtr LatitudeValue = obj->TryGetField(TEXT("Latitude")); + if (LatitudeValue.IsValid() && !LatitudeValue->IsNull()) + { + double TmpValue; + if (LatitudeValue->TryGetNumber(TmpValue)) { Latitude = TmpValue; } + } + + const TSharedPtr LongitudeValue = obj->TryGetField(TEXT("Longitude")); + if (LongitudeValue.IsValid() && !LongitudeValue->IsNull()) + { + double TmpValue; + if (LongitudeValue->TryGetNumber(TmpValue)) { Longitude = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeSubscriptionProviderStatusEnumJSON(SubscriptionProviderStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case SubscriptionProviderStatusNoError: writer->WriteValue(TEXT("NoError")); break; + case SubscriptionProviderStatusCancelled: writer->WriteValue(TEXT("Cancelled")); break; + case SubscriptionProviderStatusUnknownError: writer->WriteValue(TEXT("UnknownError")); break; + case SubscriptionProviderStatusBillingError: writer->WriteValue(TEXT("BillingError")); break; + case SubscriptionProviderStatusProductUnavailable: writer->WriteValue(TEXT("ProductUnavailable")); break; + case SubscriptionProviderStatusCustomerDidNotAcceptPriceChange: writer->WriteValue(TEXT("CustomerDidNotAcceptPriceChange")); break; + case SubscriptionProviderStatusFreeTrial: writer->WriteValue(TEXT("FreeTrial")); break; + case SubscriptionProviderStatusPaymentPending: writer->WriteValue(TEXT("PaymentPending")); break; + } +} + +ClientModels::SubscriptionProviderStatus PlayFab::ClientModels::readSubscriptionProviderStatusFromValue(const TSharedPtr& value) +{ + return readSubscriptionProviderStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::SubscriptionProviderStatus PlayFab::ClientModels::readSubscriptionProviderStatusFromValue(const FString& value) +{ + static TMap _SubscriptionProviderStatusMap; + if (_SubscriptionProviderStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _SubscriptionProviderStatusMap.Add(TEXT("NoError"), SubscriptionProviderStatusNoError); + _SubscriptionProviderStatusMap.Add(TEXT("Cancelled"), SubscriptionProviderStatusCancelled); + _SubscriptionProviderStatusMap.Add(TEXT("UnknownError"), SubscriptionProviderStatusUnknownError); + _SubscriptionProviderStatusMap.Add(TEXT("BillingError"), SubscriptionProviderStatusBillingError); + _SubscriptionProviderStatusMap.Add(TEXT("ProductUnavailable"), SubscriptionProviderStatusProductUnavailable); + _SubscriptionProviderStatusMap.Add(TEXT("CustomerDidNotAcceptPriceChange"), SubscriptionProviderStatusCustomerDidNotAcceptPriceChange); + _SubscriptionProviderStatusMap.Add(TEXT("FreeTrial"), SubscriptionProviderStatusFreeTrial); + _SubscriptionProviderStatusMap.Add(TEXT("PaymentPending"), SubscriptionProviderStatusPaymentPending); + + } + + if (!value.IsEmpty()) + { + auto output = _SubscriptionProviderStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return SubscriptionProviderStatusNoError; // Basically critical fail +} + +PlayFab::ClientModels::FSubscriptionModel::~FSubscriptionModel() +{ + +} + +void PlayFab::ClientModels::FSubscriptionModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); + + writer->WriteIdentifierPrefix(TEXT("InitialSubscriptionTime")); writeDatetime(InitialSubscriptionTime, writer); + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeSubscriptionProviderStatusEnumJSON(Status, writer); } + + if (SubscriptionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionId")); writer->WriteValue(SubscriptionId); } + + if (SubscriptionItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionItemId")); writer->WriteValue(SubscriptionItemId); } + + if (SubscriptionProvider.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionProvider")); writer->WriteValue(SubscriptionProvider); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSubscriptionModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr InitialSubscriptionTimeValue = obj->TryGetField(TEXT("InitialSubscriptionTime")); + if (InitialSubscriptionTimeValue.IsValid()) + InitialSubscriptionTime = readDatetime(InitialSubscriptionTimeValue); + + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + Status = readSubscriptionProviderStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr SubscriptionIdValue = obj->TryGetField(TEXT("SubscriptionId")); + if (SubscriptionIdValue.IsValid() && !SubscriptionIdValue->IsNull()) + { + FString TmpValue; + if (SubscriptionIdValue->TryGetString(TmpValue)) { SubscriptionId = TmpValue; } + } + + const TSharedPtr SubscriptionItemIdValue = obj->TryGetField(TEXT("SubscriptionItemId")); + if (SubscriptionItemIdValue.IsValid() && !SubscriptionItemIdValue->IsNull()) + { + FString TmpValue; + if (SubscriptionItemIdValue->TryGetString(TmpValue)) { SubscriptionItemId = TmpValue; } + } + + const TSharedPtr SubscriptionProviderValue = obj->TryGetField(TEXT("SubscriptionProvider")); + if (SubscriptionProviderValue.IsValid() && !SubscriptionProviderValue->IsNull()) + { + FString TmpValue; + if (SubscriptionProviderValue->TryGetString(TmpValue)) { SubscriptionProvider = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FMembershipModel::~FMembershipModel() +{ + +} + +void PlayFab::ClientModels::FMembershipModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + writer->WriteIdentifierPrefix(TEXT("MembershipExpiration")); writeDatetime(MembershipExpiration, writer); + + if (MembershipId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MembershipId")); writer->WriteValue(MembershipId); } + + if (OverrideExpiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("OverrideExpiration")); writeDatetime(OverrideExpiration, writer); } + + if (OverrideIsSet.notNull()) { writer->WriteIdentifierPrefix(TEXT("OverrideIsSet")); writer->WriteValue(OverrideIsSet); } + + if (Subscriptions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Subscriptions")); + for (const FSubscriptionModel& item : Subscriptions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FMembershipModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr MembershipExpirationValue = obj->TryGetField(TEXT("MembershipExpiration")); + if (MembershipExpirationValue.IsValid()) + MembershipExpiration = readDatetime(MembershipExpirationValue); + + + const TSharedPtr MembershipIdValue = obj->TryGetField(TEXT("MembershipId")); + if (MembershipIdValue.IsValid() && !MembershipIdValue->IsNull()) + { + FString TmpValue; + if (MembershipIdValue->TryGetString(TmpValue)) { MembershipId = TmpValue; } + } + + const TSharedPtr OverrideExpirationValue = obj->TryGetField(TEXT("OverrideExpiration")); + if (OverrideExpirationValue.IsValid()) + OverrideExpiration = readDatetime(OverrideExpirationValue); + + + const TSharedPtr OverrideIsSetValue = obj->TryGetField(TEXT("OverrideIsSet")); + if (OverrideIsSetValue.IsValid() && !OverrideIsSetValue->IsNull()) + { + bool TmpValue; + if (OverrideIsSetValue->TryGetBool(TmpValue)) { OverrideIsSet = TmpValue; } + } + + const TArray>&SubscriptionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Subscriptions")); + for (int32 Idx = 0; Idx < SubscriptionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SubscriptionsArray[Idx]; + Subscriptions.Add(FSubscriptionModel(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::ClientModels::writePushNotificationPlatformEnumJSON(PushNotificationPlatform enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case PushNotificationPlatformApplePushNotificationService: writer->WriteValue(TEXT("ApplePushNotificationService")); break; + case PushNotificationPlatformGoogleCloudMessaging: writer->WriteValue(TEXT("GoogleCloudMessaging")); break; + } +} + +ClientModels::PushNotificationPlatform PlayFab::ClientModels::readPushNotificationPlatformFromValue(const TSharedPtr& value) +{ + return readPushNotificationPlatformFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::PushNotificationPlatform PlayFab::ClientModels::readPushNotificationPlatformFromValue(const FString& value) +{ + static TMap _PushNotificationPlatformMap; + if (_PushNotificationPlatformMap.Num() == 0) + { + // Auto-generate the map on the first use + _PushNotificationPlatformMap.Add(TEXT("ApplePushNotificationService"), PushNotificationPlatformApplePushNotificationService); + _PushNotificationPlatformMap.Add(TEXT("GoogleCloudMessaging"), PushNotificationPlatformGoogleCloudMessaging); + + } + + if (!value.IsEmpty()) + { + auto output = _PushNotificationPlatformMap.Find(value); + if (output != nullptr) + return *output; + } + + return PushNotificationPlatformApplePushNotificationService; // Basically critical fail +} + +PlayFab::ClientModels::FPushNotificationRegistrationModel::~FPushNotificationRegistrationModel() +{ + +} + +void PlayFab::ClientModels::FPushNotificationRegistrationModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NotificationEndpointARN.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NotificationEndpointARN")); writer->WriteValue(NotificationEndpointARN); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writePushNotificationPlatformEnumJSON(Platform, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPushNotificationRegistrationModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NotificationEndpointARNValue = obj->TryGetField(TEXT("NotificationEndpointARN")); + if (NotificationEndpointARNValue.IsValid() && !NotificationEndpointARNValue->IsNull()) + { + FString TmpValue; + if (NotificationEndpointARNValue->TryGetString(TmpValue)) { NotificationEndpointARN = TmpValue; } + } + + Platform = readPushNotificationPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::ClientModels::FStatisticModel::~FStatisticModel() +{ + +} + +void PlayFab::ClientModels::FStatisticModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStatisticModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FTagModel::~FTagModel() +{ + +} + +void PlayFab::ClientModels::FTagModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TagValue.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TagValue")); writer->WriteValue(TagValue); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FTagModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TagValueValue = obj->TryGetField(TEXT("TagValue")); + if (TagValueValue.IsValid() && !TagValueValue->IsNull()) + { + FString TmpValue; + if (TagValueValue->TryGetString(TmpValue)) { TagValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FValueToDateModel::~FValueToDateModel() +{ + +} + +void PlayFab::ClientModels::FValueToDateModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Currency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Currency")); writer->WriteValue(Currency); } + + writer->WriteIdentifierPrefix(TEXT("TotalValue")); writer->WriteValue(static_cast(TotalValue)); + + if (TotalValueAsDecimal.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TotalValueAsDecimal")); writer->WriteValue(TotalValueAsDecimal); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValueToDateModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyValue = obj->TryGetField(TEXT("Currency")); + if (CurrencyValue.IsValid() && !CurrencyValue->IsNull()) + { + FString TmpValue; + if (CurrencyValue->TryGetString(TmpValue)) { Currency = TmpValue; } + } + + const TSharedPtr TotalValueValue = obj->TryGetField(TEXT("TotalValue")); + if (TotalValueValue.IsValid() && !TotalValueValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueValue->TryGetNumber(TmpValue)) { TotalValue = TmpValue; } + } + + const TSharedPtr TotalValueAsDecimalValue = obj->TryGetField(TEXT("TotalValueAsDecimal")); + if (TotalValueAsDecimalValue.IsValid() && !TotalValueAsDecimalValue->IsNull()) + { + FString TmpValue; + if (TotalValueAsDecimalValue->TryGetString(TmpValue)) { TotalValueAsDecimal = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPlayerProfileModel::~FPlayerProfileModel() +{ + +} + +void PlayFab::ClientModels::FPlayerProfileModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdCampaignAttributions.Num() != 0) + { + writer->WriteArrayStart(TEXT("AdCampaignAttributions")); + for (const FAdCampaignAttributionModel& item : AdCampaignAttributions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + if (BannedUntil.notNull()) { writer->WriteIdentifierPrefix(TEXT("BannedUntil")); writeDatetime(BannedUntil, writer); } + + if (ContactEmailAddresses.Num() != 0) + { + writer->WriteArrayStart(TEXT("ContactEmailAddresses")); + for (const FContactEmailInfoModel& item : ContactEmailAddresses) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (LinkedAccounts.Num() != 0) + { + writer->WriteArrayStart(TEXT("LinkedAccounts")); + for (const FLinkedPlatformAccountModel& item : LinkedAccounts) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Locations.Num() != 0) + { + writer->WriteArrayStart(TEXT("Locations")); + for (const FLocationModel& item : Locations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Memberships.Num() != 0) + { + writer->WriteArrayStart(TEXT("Memberships")); + for (const FMembershipModel& item : Memberships) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeLoginIdentityProviderEnumJSON(Origination, writer); } + + if (PlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerId")); writer->WriteValue(PlayerId); } + + if (PublisherId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PublisherId")); writer->WriteValue(PublisherId); } + + if (PushNotificationRegistrations.Num() != 0) + { + writer->WriteArrayStart(TEXT("PushNotificationRegistrations")); + for (const FPushNotificationRegistrationModel& item : PushNotificationRegistrations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Statistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticModel& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FTagModel& item : Tags) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + if (TotalValueToDateInUSD.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalValueToDateInUSD")); writer->WriteValue(static_cast(TotalValueToDateInUSD)); } + + if (ValuesToDate.Num() != 0) + { + writer->WriteArrayStart(TEXT("ValuesToDate")); + for (const FValueToDateModel& item : ValuesToDate) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPlayerProfileModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AdCampaignAttributionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AdCampaignAttributions")); + for (int32 Idx = 0; Idx < AdCampaignAttributionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AdCampaignAttributionsArray[Idx]; + AdCampaignAttributions.Add(FAdCampaignAttributionModel(CurrentItem->AsObject())); + } + + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr BannedUntilValue = obj->TryGetField(TEXT("BannedUntil")); + if (BannedUntilValue.IsValid()) + BannedUntil = readDatetime(BannedUntilValue); + + + const TArray>&ContactEmailAddressesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ContactEmailAddresses")); + for (int32 Idx = 0; Idx < ContactEmailAddressesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContactEmailAddressesArray[Idx]; + ContactEmailAddresses.Add(FContactEmailInfoModel(CurrentItem->AsObject())); + } + + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + const TArray>&LinkedAccountsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("LinkedAccounts")); + for (int32 Idx = 0; Idx < LinkedAccountsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LinkedAccountsArray[Idx]; + LinkedAccounts.Add(FLinkedPlatformAccountModel(CurrentItem->AsObject())); + } + + + const TArray>&LocationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Locations")); + for (int32 Idx = 0; Idx < LocationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LocationsArray[Idx]; + Locations.Add(FLocationModel(CurrentItem->AsObject())); + } + + + const TArray>&MembershipsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Memberships")); + for (int32 Idx = 0; Idx < MembershipsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembershipsArray[Idx]; + Memberships.Add(FMembershipModel(CurrentItem->AsObject())); + } + + + Origination = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr PlayerIdValue = obj->TryGetField(TEXT("PlayerId")); + if (PlayerIdValue.IsValid() && !PlayerIdValue->IsNull()) + { + FString TmpValue; + if (PlayerIdValue->TryGetString(TmpValue)) { PlayerId = TmpValue; } + } + + const TSharedPtr PublisherIdValue = obj->TryGetField(TEXT("PublisherId")); + if (PublisherIdValue.IsValid() && !PublisherIdValue->IsNull()) + { + FString TmpValue; + if (PublisherIdValue->TryGetString(TmpValue)) { PublisherId = TmpValue; } + } + + const TArray>&PushNotificationRegistrationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PushNotificationRegistrations")); + for (int32 Idx = 0; Idx < PushNotificationRegistrationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PushNotificationRegistrationsArray[Idx]; + PushNotificationRegistrations.Add(FPushNotificationRegistrationModel(CurrentItem->AsObject())); + } + + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticModel(CurrentItem->AsObject())); + } + + + const TArray>&TagsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Tags")); + for (int32 Idx = 0; Idx < TagsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = TagsArray[Idx]; + Tags.Add(FTagModel(CurrentItem->AsObject())); + } + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr TotalValueToDateInUSDValue = obj->TryGetField(TEXT("TotalValueToDateInUSD")); + if (TotalValueToDateInUSDValue.IsValid() && !TotalValueToDateInUSDValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueToDateInUSDValue->TryGetNumber(TmpValue)) { TotalValueToDateInUSD = TmpValue; } + } + + const TArray>&ValuesToDateArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ValuesToDate")); + for (int32 Idx = 0; Idx < ValuesToDateArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ValuesToDateArray[Idx]; + ValuesToDate.Add(FValueToDateModel(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserPsnInfo::~FUserPsnInfo() +{ + +} + +void PlayFab::ClientModels::FUserPsnInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PsnAccountId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PsnAccountId")); writer->WriteValue(PsnAccountId); } + + if (PsnOnlineId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PsnOnlineId")); writer->WriteValue(PsnOnlineId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserPsnInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PsnAccountIdValue = obj->TryGetField(TEXT("PsnAccountId")); + if (PsnAccountIdValue.IsValid() && !PsnAccountIdValue->IsNull()) + { + FString TmpValue; + if (PsnAccountIdValue->TryGetString(TmpValue)) { PsnAccountId = TmpValue; } + } + + const TSharedPtr PsnOnlineIdValue = obj->TryGetField(TEXT("PsnOnlineId")); + if (PsnOnlineIdValue.IsValid() && !PsnOnlineIdValue->IsNull()) + { + FString TmpValue; + if (PsnOnlineIdValue->TryGetString(TmpValue)) { PsnOnlineId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeTitleActivationStatusEnumJSON(TitleActivationStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case TitleActivationStatusNone: writer->WriteValue(TEXT("None")); break; + case TitleActivationStatusActivatedTitleKey: writer->WriteValue(TEXT("ActivatedTitleKey")); break; + case TitleActivationStatusPendingSteam: writer->WriteValue(TEXT("PendingSteam")); break; + case TitleActivationStatusActivatedSteam: writer->WriteValue(TEXT("ActivatedSteam")); break; + case TitleActivationStatusRevokedSteam: writer->WriteValue(TEXT("RevokedSteam")); break; + } +} + +ClientModels::TitleActivationStatus PlayFab::ClientModels::readTitleActivationStatusFromValue(const TSharedPtr& value) +{ + return readTitleActivationStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::TitleActivationStatus PlayFab::ClientModels::readTitleActivationStatusFromValue(const FString& value) +{ + static TMap _TitleActivationStatusMap; + if (_TitleActivationStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _TitleActivationStatusMap.Add(TEXT("None"), TitleActivationStatusNone); + _TitleActivationStatusMap.Add(TEXT("ActivatedTitleKey"), TitleActivationStatusActivatedTitleKey); + _TitleActivationStatusMap.Add(TEXT("PendingSteam"), TitleActivationStatusPendingSteam); + _TitleActivationStatusMap.Add(TEXT("ActivatedSteam"), TitleActivationStatusActivatedSteam); + _TitleActivationStatusMap.Add(TEXT("RevokedSteam"), TitleActivationStatusRevokedSteam); + + } + + if (!value.IsEmpty()) + { + auto output = _TitleActivationStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return TitleActivationStatusNone; // Basically critical fail +} + +PlayFab::ClientModels::FUserSteamInfo::~FUserSteamInfo() +{ + +} + +void PlayFab::ClientModels::FUserSteamInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SteamActivationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("SteamActivationStatus")); writeTitleActivationStatusEnumJSON(SteamActivationStatus, writer); } + + if (SteamCountry.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamCountry")); writer->WriteValue(SteamCountry); } + + if (SteamCurrency.notNull()) { writer->WriteIdentifierPrefix(TEXT("SteamCurrency")); writeCurrencyEnumJSON(SteamCurrency, writer); } + + if (SteamId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamId")); writer->WriteValue(SteamId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserSteamInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + SteamActivationStatus = readTitleActivationStatusFromValue(obj->TryGetField(TEXT("SteamActivationStatus"))); + + const TSharedPtr SteamCountryValue = obj->TryGetField(TEXT("SteamCountry")); + if (SteamCountryValue.IsValid() && !SteamCountryValue->IsNull()) + { + FString TmpValue; + if (SteamCountryValue->TryGetString(TmpValue)) { SteamCountry = TmpValue; } + } + + SteamCurrency = readCurrencyFromValue(obj->TryGetField(TEXT("SteamCurrency"))); + + const TSharedPtr SteamIdValue = obj->TryGetField(TEXT("SteamId")); + if (SteamIdValue.IsValid() && !SteamIdValue->IsNull()) + { + FString TmpValue; + if (SteamIdValue->TryGetString(TmpValue)) { SteamId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserXboxInfo::~FUserXboxInfo() +{ + +} + +void PlayFab::ClientModels::FUserXboxInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (XboxUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxUserId")); writer->WriteValue(XboxUserId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserXboxInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr XboxUserIdValue = obj->TryGetField(TEXT("XboxUserId")); + if (XboxUserIdValue.IsValid() && !XboxUserIdValue->IsNull()) + { + FString TmpValue; + if (XboxUserIdValue->TryGetString(TmpValue)) { XboxUserId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FFriendInfo::~FFriendInfo() +{ + //if (FacebookInfo != nullptr) delete FacebookInfo; + //if (GameCenterInfo != nullptr) delete GameCenterInfo; + //if (Profile != nullptr) delete Profile; + //if (PSNInfo != nullptr) delete PSNInfo; + //if (SteamInfo != nullptr) delete SteamInfo; + //if (XboxInfo != nullptr) delete XboxInfo; + +} + +void PlayFab::ClientModels::FFriendInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CurrentMatchmakerLobbyId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CurrentMatchmakerLobbyId")); writer->WriteValue(CurrentMatchmakerLobbyId); } + + if (FacebookInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInfo")); FacebookInfo->writeJSON(writer); } + + if (FriendPlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); } + + if (GameCenterInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GameCenterInfo")); GameCenterInfo->writeJSON(writer); } + + if (Profile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Profile")); Profile->writeJSON(writer); } + + if (PSNInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PSNInfo")); PSNInfo->writeJSON(writer); } + + if (SteamInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SteamInfo")); SteamInfo->writeJSON(writer); } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (TitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleDisplayName")); writer->WriteValue(TitleDisplayName); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + if (XboxInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("XboxInfo")); XboxInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FFriendInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrentMatchmakerLobbyIdValue = obj->TryGetField(TEXT("CurrentMatchmakerLobbyId")); + if (CurrentMatchmakerLobbyIdValue.IsValid() && !CurrentMatchmakerLobbyIdValue->IsNull()) + { + FString TmpValue; + if (CurrentMatchmakerLobbyIdValue->TryGetString(TmpValue)) { CurrentMatchmakerLobbyId = TmpValue; } + } + + const TSharedPtr FacebookInfoValue = obj->TryGetField(TEXT("FacebookInfo")); + if (FacebookInfoValue.IsValid() && !FacebookInfoValue->IsNull()) + { + FacebookInfo = MakeShareable(new FUserFacebookInfo(FacebookInfoValue->AsObject())); + } + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + const TSharedPtr GameCenterInfoValue = obj->TryGetField(TEXT("GameCenterInfo")); + if (GameCenterInfoValue.IsValid() && !GameCenterInfoValue->IsNull()) + { + GameCenterInfo = MakeShareable(new FUserGameCenterInfo(GameCenterInfoValue->AsObject())); + } + + const TSharedPtr ProfileValue = obj->TryGetField(TEXT("Profile")); + if (ProfileValue.IsValid() && !ProfileValue->IsNull()) + { + Profile = MakeShareable(new FPlayerProfileModel(ProfileValue->AsObject())); + } + + const TSharedPtr PSNInfoValue = obj->TryGetField(TEXT("PSNInfo")); + if (PSNInfoValue.IsValid() && !PSNInfoValue->IsNull()) + { + PSNInfo = MakeShareable(new FUserPsnInfo(PSNInfoValue->AsObject())); + } + + const TSharedPtr SteamInfoValue = obj->TryGetField(TEXT("SteamInfo")); + if (SteamInfoValue.IsValid() && !SteamInfoValue->IsNull()) + { + SteamInfo = MakeShareable(new FUserSteamInfo(SteamInfoValue->AsObject())); + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr TitleDisplayNameValue = obj->TryGetField(TEXT("TitleDisplayName")); + if (TitleDisplayNameValue.IsValid() && !TitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (TitleDisplayNameValue->TryGetString(TmpValue)) { TitleDisplayName = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + const TSharedPtr XboxInfoValue = obj->TryGetField(TEXT("XboxInfo")); + if (XboxInfoValue.IsValid() && !XboxInfoValue->IsNull()) + { + XboxInfo = MakeShareable(new FUserXboxInfo(XboxInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGameCenterPlayFabIdPair::~FGameCenterPlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FGameCenterPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GameCenterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameCenterId")); writer->WriteValue(GameCenterId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGameCenterPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameCenterIdValue = obj->TryGetField(TEXT("GameCenterId")); + if (GameCenterIdValue.IsValid() && !GameCenterIdValue->IsNull()) + { + FString TmpValue; + if (GameCenterIdValue->TryGetString(TmpValue)) { GameCenterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGameServerRegionsRequest::~FGameServerRegionsRequest() +{ + +} + +void PlayFab::ClientModels::FGameServerRegionsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGameServerRegionsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRegionInfo::~FRegionInfo() +{ + +} + +void PlayFab::ClientModels::FRegionInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Available")); writer->WriteValue(Available); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + if (PingUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PingUrl")); writer->WriteValue(PingUrl); } + + if (pfRegion.notNull()) { writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRegionInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AvailableValue = obj->TryGetField(TEXT("Available")); + if (AvailableValue.IsValid() && !AvailableValue->IsNull()) + { + bool TmpValue; + if (AvailableValue->TryGetBool(TmpValue)) { Available = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr PingUrlValue = obj->TryGetField(TEXT("PingUrl")); + if (PingUrlValue.IsValid() && !PingUrlValue->IsNull()) + { + FString TmpValue; + if (PingUrlValue->TryGetString(TmpValue)) { PingUrl = TmpValue; } + } + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGameServerRegionsResult::~FGameServerRegionsResult() +{ + +} + +void PlayFab::ClientModels::FGameServerRegionsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Regions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Regions")); + for (const FRegionInfo& item : Regions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGameServerRegionsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&RegionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Regions")); + for (int32 Idx = 0; Idx < RegionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = RegionsArray[Idx]; + Regions.Add(FRegionInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGenericPlayFabIdPair::~FGenericPlayFabIdPair() +{ + //if (GenericId != nullptr) delete GenericId; + +} + +void PlayFab::ClientModels::FGenericPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GenericId.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GenericId")); GenericId->writeJSON(writer); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGenericPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GenericIdValue = obj->TryGetField(TEXT("GenericId")); + if (GenericIdValue.IsValid() && !GenericIdValue->IsNull()) + { + GenericId = MakeShareable(new FGenericServiceId(GenericIdValue->AsObject())); + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetAccountInfoRequest::~FGetAccountInfoRequest() +{ + +} + +void PlayFab::ClientModels::FGetAccountInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (TitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleDisplayName")); writer->WriteValue(TitleDisplayName); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetAccountInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TitleDisplayNameValue = obj->TryGetField(TEXT("TitleDisplayName")); + if (TitleDisplayNameValue.IsValid() && !TitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (TitleDisplayNameValue->TryGetString(TmpValue)) { TitleDisplayName = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserAndroidDeviceInfo::~FUserAndroidDeviceInfo() +{ + +} + +void PlayFab::ClientModels::FUserAndroidDeviceInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceId")); writer->WriteValue(AndroidDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserAndroidDeviceInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceIdValue = obj->TryGetField(TEXT("AndroidDeviceId")); + if (AndroidDeviceIdValue.IsValid() && !AndroidDeviceIdValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceIdValue->TryGetString(TmpValue)) { AndroidDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserCustomIdInfo::~FUserCustomIdInfo() +{ + +} + +void PlayFab::ClientModels::FUserCustomIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CustomId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomId")); writer->WriteValue(CustomId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserCustomIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomIdValue = obj->TryGetField(TEXT("CustomId")); + if (CustomIdValue.IsValid() && !CustomIdValue->IsNull()) + { + FString TmpValue; + if (CustomIdValue->TryGetString(TmpValue)) { CustomId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserFacebookInstantGamesIdInfo::~FUserFacebookInstantGamesIdInfo() +{ + +} + +void PlayFab::ClientModels::FUserFacebookInstantGamesIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookInstantGamesId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesId")); writer->WriteValue(FacebookInstantGamesId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserFacebookInstantGamesIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesIdValue = obj->TryGetField(TEXT("FacebookInstantGamesId")); + if (FacebookInstantGamesIdValue.IsValid() && !FacebookInstantGamesIdValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesIdValue->TryGetString(TmpValue)) { FacebookInstantGamesId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserGoogleInfo::~FUserGoogleInfo() +{ + +} + +void PlayFab::ClientModels::FUserGoogleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GoogleEmail.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleEmail")); writer->WriteValue(GoogleEmail); } + + if (GoogleGender.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleGender")); writer->WriteValue(GoogleGender); } + + if (GoogleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleId")); writer->WriteValue(GoogleId); } + + if (GoogleLocale.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleLocale")); writer->WriteValue(GoogleLocale); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserGoogleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GoogleEmailValue = obj->TryGetField(TEXT("GoogleEmail")); + if (GoogleEmailValue.IsValid() && !GoogleEmailValue->IsNull()) + { + FString TmpValue; + if (GoogleEmailValue->TryGetString(TmpValue)) { GoogleEmail = TmpValue; } + } + + const TSharedPtr GoogleGenderValue = obj->TryGetField(TEXT("GoogleGender")); + if (GoogleGenderValue.IsValid() && !GoogleGenderValue->IsNull()) + { + FString TmpValue; + if (GoogleGenderValue->TryGetString(TmpValue)) { GoogleGender = TmpValue; } + } + + const TSharedPtr GoogleIdValue = obj->TryGetField(TEXT("GoogleId")); + if (GoogleIdValue.IsValid() && !GoogleIdValue->IsNull()) + { + FString TmpValue; + if (GoogleIdValue->TryGetString(TmpValue)) { GoogleId = TmpValue; } + } + + const TSharedPtr GoogleLocaleValue = obj->TryGetField(TEXT("GoogleLocale")); + if (GoogleLocaleValue.IsValid() && !GoogleLocaleValue->IsNull()) + { + FString TmpValue; + if (GoogleLocaleValue->TryGetString(TmpValue)) { GoogleLocale = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserIosDeviceInfo::~FUserIosDeviceInfo() +{ + +} + +void PlayFab::ClientModels::FUserIosDeviceInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IosDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IosDeviceId")); writer->WriteValue(IosDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserIosDeviceInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IosDeviceIdValue = obj->TryGetField(TEXT("IosDeviceId")); + if (IosDeviceIdValue.IsValid() && !IosDeviceIdValue->IsNull()) + { + FString TmpValue; + if (IosDeviceIdValue->TryGetString(TmpValue)) { IosDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserKongregateInfo::~FUserKongregateInfo() +{ + +} + +void PlayFab::ClientModels::FUserKongregateInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (KongregateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateId")); writer->WriteValue(KongregateId); } + + if (KongregateName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateName")); writer->WriteValue(KongregateName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserKongregateInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KongregateIdValue = obj->TryGetField(TEXT("KongregateId")); + if (KongregateIdValue.IsValid() && !KongregateIdValue->IsNull()) + { + FString TmpValue; + if (KongregateIdValue->TryGetString(TmpValue)) { KongregateId = TmpValue; } + } + + const TSharedPtr KongregateNameValue = obj->TryGetField(TEXT("KongregateName")); + if (KongregateNameValue.IsValid() && !KongregateNameValue->IsNull()) + { + FString TmpValue; + if (KongregateNameValue->TryGetString(TmpValue)) { KongregateName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserNintendoSwitchDeviceIdInfo::~FUserNintendoSwitchDeviceIdInfo() +{ + +} + +void PlayFab::ClientModels::FUserNintendoSwitchDeviceIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserNintendoSwitchDeviceIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserOpenIdInfo::~FUserOpenIdInfo() +{ + +} + +void PlayFab::ClientModels::FUserOpenIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ConnectionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ConnectionId")); writer->WriteValue(ConnectionId); } + + if (Issuer.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Issuer")); writer->WriteValue(Issuer); } + + if (Subject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Subject")); writer->WriteValue(Subject); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserOpenIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ConnectionIdValue = obj->TryGetField(TEXT("ConnectionId")); + if (ConnectionIdValue.IsValid() && !ConnectionIdValue->IsNull()) + { + FString TmpValue; + if (ConnectionIdValue->TryGetString(TmpValue)) { ConnectionId = TmpValue; } + } + + const TSharedPtr IssuerValue = obj->TryGetField(TEXT("Issuer")); + if (IssuerValue.IsValid() && !IssuerValue->IsNull()) + { + FString TmpValue; + if (IssuerValue->TryGetString(TmpValue)) { Issuer = TmpValue; } + } + + const TSharedPtr SubjectValue = obj->TryGetField(TEXT("Subject")); + if (SubjectValue.IsValid() && !SubjectValue->IsNull()) + { + FString TmpValue; + if (SubjectValue->TryGetString(TmpValue)) { Subject = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserPrivateAccountInfo::~FUserPrivateAccountInfo() +{ + +} + +void PlayFab::ClientModels::FUserPrivateAccountInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserPrivateAccountInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeUserOriginationEnumJSON(UserOrigination enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case UserOriginationOrganic: writer->WriteValue(TEXT("Organic")); break; + case UserOriginationSteam: writer->WriteValue(TEXT("Steam")); break; + case UserOriginationGoogle: writer->WriteValue(TEXT("Google")); break; + case UserOriginationAmazon: writer->WriteValue(TEXT("Amazon")); break; + case UserOriginationFacebook: writer->WriteValue(TEXT("Facebook")); break; + case UserOriginationKongregate: writer->WriteValue(TEXT("Kongregate")); break; + case UserOriginationGamersFirst: writer->WriteValue(TEXT("GamersFirst")); break; + case UserOriginationUnknown: writer->WriteValue(TEXT("Unknown")); break; + case UserOriginationIOS: writer->WriteValue(TEXT("IOS")); break; + case UserOriginationLoadTest: writer->WriteValue(TEXT("LoadTest")); break; + case UserOriginationAndroid: writer->WriteValue(TEXT("Android")); break; + case UserOriginationPSN: writer->WriteValue(TEXT("PSN")); break; + case UserOriginationGameCenter: writer->WriteValue(TEXT("GameCenter")); break; + case UserOriginationCustomId: writer->WriteValue(TEXT("CustomId")); break; + case UserOriginationXboxLive: writer->WriteValue(TEXT("XboxLive")); break; + case UserOriginationParse: writer->WriteValue(TEXT("Parse")); break; + case UserOriginationTwitch: writer->WriteValue(TEXT("Twitch")); break; + case UserOriginationWindowsHello: writer->WriteValue(TEXT("WindowsHello")); break; + case UserOriginationServerCustomId: writer->WriteValue(TEXT("ServerCustomId")); break; + case UserOriginationNintendoSwitchDeviceId: writer->WriteValue(TEXT("NintendoSwitchDeviceId")); break; + case UserOriginationFacebookInstantGamesId: writer->WriteValue(TEXT("FacebookInstantGamesId")); break; + case UserOriginationOpenIdConnect: writer->WriteValue(TEXT("OpenIdConnect")); break; + } +} + +ClientModels::UserOrigination PlayFab::ClientModels::readUserOriginationFromValue(const TSharedPtr& value) +{ + return readUserOriginationFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::UserOrigination PlayFab::ClientModels::readUserOriginationFromValue(const FString& value) +{ + static TMap _UserOriginationMap; + if (_UserOriginationMap.Num() == 0) + { + // Auto-generate the map on the first use + _UserOriginationMap.Add(TEXT("Organic"), UserOriginationOrganic); + _UserOriginationMap.Add(TEXT("Steam"), UserOriginationSteam); + _UserOriginationMap.Add(TEXT("Google"), UserOriginationGoogle); + _UserOriginationMap.Add(TEXT("Amazon"), UserOriginationAmazon); + _UserOriginationMap.Add(TEXT("Facebook"), UserOriginationFacebook); + _UserOriginationMap.Add(TEXT("Kongregate"), UserOriginationKongregate); + _UserOriginationMap.Add(TEXT("GamersFirst"), UserOriginationGamersFirst); + _UserOriginationMap.Add(TEXT("Unknown"), UserOriginationUnknown); + _UserOriginationMap.Add(TEXT("IOS"), UserOriginationIOS); + _UserOriginationMap.Add(TEXT("LoadTest"), UserOriginationLoadTest); + _UserOriginationMap.Add(TEXT("Android"), UserOriginationAndroid); + _UserOriginationMap.Add(TEXT("PSN"), UserOriginationPSN); + _UserOriginationMap.Add(TEXT("GameCenter"), UserOriginationGameCenter); + _UserOriginationMap.Add(TEXT("CustomId"), UserOriginationCustomId); + _UserOriginationMap.Add(TEXT("XboxLive"), UserOriginationXboxLive); + _UserOriginationMap.Add(TEXT("Parse"), UserOriginationParse); + _UserOriginationMap.Add(TEXT("Twitch"), UserOriginationTwitch); + _UserOriginationMap.Add(TEXT("WindowsHello"), UserOriginationWindowsHello); + _UserOriginationMap.Add(TEXT("ServerCustomId"), UserOriginationServerCustomId); + _UserOriginationMap.Add(TEXT("NintendoSwitchDeviceId"), UserOriginationNintendoSwitchDeviceId); + _UserOriginationMap.Add(TEXT("FacebookInstantGamesId"), UserOriginationFacebookInstantGamesId); + _UserOriginationMap.Add(TEXT("OpenIdConnect"), UserOriginationOpenIdConnect); + + } + + if (!value.IsEmpty()) + { + auto output = _UserOriginationMap.Find(value); + if (output != nullptr) + return *output; + } + + return UserOriginationOrganic; // Basically critical fail +} + +PlayFab::ClientModels::FUserTitleInfo::~FUserTitleInfo() +{ + //if (TitlePlayerAccount != nullptr) delete TitlePlayerAccount; + +} + +void PlayFab::ClientModels::FUserTitleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (FirstLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("FirstLogin")); writeDatetime(FirstLogin, writer); } + + if (isBanned.notNull()) { writer->WriteIdentifierPrefix(TEXT("isBanned")); writer->WriteValue(isBanned); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeUserOriginationEnumJSON(Origination, writer); } + + if (TitlePlayerAccount.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TitlePlayerAccount")); TitlePlayerAccount->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserTitleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr FirstLoginValue = obj->TryGetField(TEXT("FirstLogin")); + if (FirstLoginValue.IsValid()) + FirstLogin = readDatetime(FirstLoginValue); + + + const TSharedPtr isBannedValue = obj->TryGetField(TEXT("isBanned")); + if (isBannedValue.IsValid() && !isBannedValue->IsNull()) + { + bool TmpValue; + if (isBannedValue->TryGetBool(TmpValue)) { isBanned = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + Origination = readUserOriginationFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr TitlePlayerAccountValue = obj->TryGetField(TEXT("TitlePlayerAccount")); + if (TitlePlayerAccountValue.IsValid() && !TitlePlayerAccountValue->IsNull()) + { + TitlePlayerAccount = MakeShareable(new FEntityKey(TitlePlayerAccountValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserTwitchInfo::~FUserTwitchInfo() +{ + +} + +void PlayFab::ClientModels::FUserTwitchInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TwitchId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchId")); writer->WriteValue(TwitchId); } + + if (TwitchUserName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchUserName")); writer->WriteValue(TwitchUserName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserTwitchInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TwitchIdValue = obj->TryGetField(TEXT("TwitchId")); + if (TwitchIdValue.IsValid() && !TwitchIdValue->IsNull()) + { + FString TmpValue; + if (TwitchIdValue->TryGetString(TmpValue)) { TwitchId = TmpValue; } + } + + const TSharedPtr TwitchUserNameValue = obj->TryGetField(TEXT("TwitchUserName")); + if (TwitchUserNameValue.IsValid() && !TwitchUserNameValue->IsNull()) + { + FString TmpValue; + if (TwitchUserNameValue->TryGetString(TmpValue)) { TwitchUserName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserWindowsHelloInfo::~FUserWindowsHelloInfo() +{ + +} + +void PlayFab::ClientModels::FUserWindowsHelloInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (WindowsHelloDeviceName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloDeviceName")); writer->WriteValue(WindowsHelloDeviceName); } + + if (WindowsHelloPublicKeyHash.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloPublicKeyHash")); writer->WriteValue(WindowsHelloPublicKeyHash); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserWindowsHelloInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr WindowsHelloDeviceNameValue = obj->TryGetField(TEXT("WindowsHelloDeviceName")); + if (WindowsHelloDeviceNameValue.IsValid() && !WindowsHelloDeviceNameValue->IsNull()) + { + FString TmpValue; + if (WindowsHelloDeviceNameValue->TryGetString(TmpValue)) { WindowsHelloDeviceName = TmpValue; } + } + + const TSharedPtr WindowsHelloPublicKeyHashValue = obj->TryGetField(TEXT("WindowsHelloPublicKeyHash")); + if (WindowsHelloPublicKeyHashValue.IsValid() && !WindowsHelloPublicKeyHashValue->IsNull()) + { + FString TmpValue; + if (WindowsHelloPublicKeyHashValue->TryGetString(TmpValue)) { WindowsHelloPublicKeyHash = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserAccountInfo::~FUserAccountInfo() +{ + //if (AndroidDeviceInfo != nullptr) delete AndroidDeviceInfo; + //if (CustomIdInfo != nullptr) delete CustomIdInfo; + //if (FacebookInfo != nullptr) delete FacebookInfo; + //if (FacebookInstantGamesIdInfo != nullptr) delete FacebookInstantGamesIdInfo; + //if (GameCenterInfo != nullptr) delete GameCenterInfo; + //if (GoogleInfo != nullptr) delete GoogleInfo; + //if (IosDeviceInfo != nullptr) delete IosDeviceInfo; + //if (KongregateInfo != nullptr) delete KongregateInfo; + //if (NintendoSwitchDeviceIdInfo != nullptr) delete NintendoSwitchDeviceIdInfo; + //if (PrivateInfo != nullptr) delete PrivateInfo; + //if (PsnInfo != nullptr) delete PsnInfo; + //if (SteamInfo != nullptr) delete SteamInfo; + //if (TitleInfo != nullptr) delete TitleInfo; + //if (TwitchInfo != nullptr) delete TwitchInfo; + //if (WindowsHelloInfo != nullptr) delete WindowsHelloInfo; + //if (XboxInfo != nullptr) delete XboxInfo; + +} + +void PlayFab::ClientModels::FUserAccountInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceInfo")); AndroidDeviceInfo->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + if (CustomIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("CustomIdInfo")); CustomIdInfo->writeJSON(writer); } + + if (FacebookInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInfo")); FacebookInfo->writeJSON(writer); } + + if (FacebookInstantGamesIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesIdInfo")); FacebookInstantGamesIdInfo->writeJSON(writer); } + + if (GameCenterInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GameCenterInfo")); GameCenterInfo->writeJSON(writer); } + + if (GoogleInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GoogleInfo")); GoogleInfo->writeJSON(writer); } + + if (IosDeviceInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("IosDeviceInfo")); IosDeviceInfo->writeJSON(writer); } + + if (KongregateInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("KongregateInfo")); KongregateInfo->writeJSON(writer); } + + if (NintendoSwitchDeviceIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceIdInfo")); NintendoSwitchDeviceIdInfo->writeJSON(writer); } + + if (OpenIdInfo.Num() != 0) + { + writer->WriteArrayStart(TEXT("OpenIdInfo")); + for (const FUserOpenIdInfo& item : OpenIdInfo) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (PrivateInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PrivateInfo")); PrivateInfo->writeJSON(writer); } + + if (PsnInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PsnInfo")); PsnInfo->writeJSON(writer); } + + if (SteamInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SteamInfo")); SteamInfo->writeJSON(writer); } + + if (TitleInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TitleInfo")); TitleInfo->writeJSON(writer); } + + if (TwitchInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TwitchInfo")); TwitchInfo->writeJSON(writer); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + if (WindowsHelloInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloInfo")); WindowsHelloInfo->writeJSON(writer); } + + if (XboxInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("XboxInfo")); XboxInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserAccountInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceInfoValue = obj->TryGetField(TEXT("AndroidDeviceInfo")); + if (AndroidDeviceInfoValue.IsValid() && !AndroidDeviceInfoValue->IsNull()) + { + AndroidDeviceInfo = MakeShareable(new FUserAndroidDeviceInfo(AndroidDeviceInfoValue->AsObject())); + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr CustomIdInfoValue = obj->TryGetField(TEXT("CustomIdInfo")); + if (CustomIdInfoValue.IsValid() && !CustomIdInfoValue->IsNull()) + { + CustomIdInfo = MakeShareable(new FUserCustomIdInfo(CustomIdInfoValue->AsObject())); + } + + const TSharedPtr FacebookInfoValue = obj->TryGetField(TEXT("FacebookInfo")); + if (FacebookInfoValue.IsValid() && !FacebookInfoValue->IsNull()) + { + FacebookInfo = MakeShareable(new FUserFacebookInfo(FacebookInfoValue->AsObject())); + } + + const TSharedPtr FacebookInstantGamesIdInfoValue = obj->TryGetField(TEXT("FacebookInstantGamesIdInfo")); + if (FacebookInstantGamesIdInfoValue.IsValid() && !FacebookInstantGamesIdInfoValue->IsNull()) + { + FacebookInstantGamesIdInfo = MakeShareable(new FUserFacebookInstantGamesIdInfo(FacebookInstantGamesIdInfoValue->AsObject())); + } + + const TSharedPtr GameCenterInfoValue = obj->TryGetField(TEXT("GameCenterInfo")); + if (GameCenterInfoValue.IsValid() && !GameCenterInfoValue->IsNull()) + { + GameCenterInfo = MakeShareable(new FUserGameCenterInfo(GameCenterInfoValue->AsObject())); + } + + const TSharedPtr GoogleInfoValue = obj->TryGetField(TEXT("GoogleInfo")); + if (GoogleInfoValue.IsValid() && !GoogleInfoValue->IsNull()) + { + GoogleInfo = MakeShareable(new FUserGoogleInfo(GoogleInfoValue->AsObject())); + } + + const TSharedPtr IosDeviceInfoValue = obj->TryGetField(TEXT("IosDeviceInfo")); + if (IosDeviceInfoValue.IsValid() && !IosDeviceInfoValue->IsNull()) + { + IosDeviceInfo = MakeShareable(new FUserIosDeviceInfo(IosDeviceInfoValue->AsObject())); + } + + const TSharedPtr KongregateInfoValue = obj->TryGetField(TEXT("KongregateInfo")); + if (KongregateInfoValue.IsValid() && !KongregateInfoValue->IsNull()) + { + KongregateInfo = MakeShareable(new FUserKongregateInfo(KongregateInfoValue->AsObject())); + } + + const TSharedPtr NintendoSwitchDeviceIdInfoValue = obj->TryGetField(TEXT("NintendoSwitchDeviceIdInfo")); + if (NintendoSwitchDeviceIdInfoValue.IsValid() && !NintendoSwitchDeviceIdInfoValue->IsNull()) + { + NintendoSwitchDeviceIdInfo = MakeShareable(new FUserNintendoSwitchDeviceIdInfo(NintendoSwitchDeviceIdInfoValue->AsObject())); + } + + const TArray>&OpenIdInfoArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("OpenIdInfo")); + for (int32 Idx = 0; Idx < OpenIdInfoArray.Num(); Idx++) + { + TSharedPtr CurrentItem = OpenIdInfoArray[Idx]; + OpenIdInfo.Add(FUserOpenIdInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PrivateInfoValue = obj->TryGetField(TEXT("PrivateInfo")); + if (PrivateInfoValue.IsValid() && !PrivateInfoValue->IsNull()) + { + PrivateInfo = MakeShareable(new FUserPrivateAccountInfo(PrivateInfoValue->AsObject())); + } + + const TSharedPtr PsnInfoValue = obj->TryGetField(TEXT("PsnInfo")); + if (PsnInfoValue.IsValid() && !PsnInfoValue->IsNull()) + { + PsnInfo = MakeShareable(new FUserPsnInfo(PsnInfoValue->AsObject())); + } + + const TSharedPtr SteamInfoValue = obj->TryGetField(TEXT("SteamInfo")); + if (SteamInfoValue.IsValid() && !SteamInfoValue->IsNull()) + { + SteamInfo = MakeShareable(new FUserSteamInfo(SteamInfoValue->AsObject())); + } + + const TSharedPtr TitleInfoValue = obj->TryGetField(TEXT("TitleInfo")); + if (TitleInfoValue.IsValid() && !TitleInfoValue->IsNull()) + { + TitleInfo = MakeShareable(new FUserTitleInfo(TitleInfoValue->AsObject())); + } + + const TSharedPtr TwitchInfoValue = obj->TryGetField(TEXT("TwitchInfo")); + if (TwitchInfoValue.IsValid() && !TwitchInfoValue->IsNull()) + { + TwitchInfo = MakeShareable(new FUserTwitchInfo(TwitchInfoValue->AsObject())); + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + const TSharedPtr WindowsHelloInfoValue = obj->TryGetField(TEXT("WindowsHelloInfo")); + if (WindowsHelloInfoValue.IsValid() && !WindowsHelloInfoValue->IsNull()) + { + WindowsHelloInfo = MakeShareable(new FUserWindowsHelloInfo(WindowsHelloInfoValue->AsObject())); + } + + const TSharedPtr XboxInfoValue = obj->TryGetField(TEXT("XboxInfo")); + if (XboxInfoValue.IsValid() && !XboxInfoValue->IsNull()) + { + XboxInfo = MakeShareable(new FUserXboxInfo(XboxInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetAccountInfoResult::~FGetAccountInfoResult() +{ + //if (AccountInfo != nullptr) delete AccountInfo; + +} + +void PlayFab::ClientModels::FGetAccountInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AccountInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("AccountInfo")); AccountInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetAccountInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccountInfoValue = obj->TryGetField(TEXT("AccountInfo")); + if (AccountInfoValue.IsValid() && !AccountInfoValue->IsNull()) + { + AccountInfo = MakeShareable(new FUserAccountInfo(AccountInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCatalogItemsRequest::~FGetCatalogItemsRequest() +{ + +} + +void PlayFab::ClientModels::FGetCatalogItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCatalogItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCatalogItemsResult::~FGetCatalogItemsResult() +{ + +} + +void PlayFab::ClientModels::FGetCatalogItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Catalog.Num() != 0) + { + writer->WriteArrayStart(TEXT("Catalog")); + for (const FCatalogItem& item : Catalog) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCatalogItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&CatalogArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Catalog")); + for (int32 Idx = 0; Idx < CatalogArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CatalogArray[Idx]; + Catalog.Add(FCatalogItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterDataRequest::~FGetCharacterDataRequest() +{ + +} + +void PlayFab::ClientModels::FGetCharacterDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (IfChangedFromDataVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("IfChangedFromDataVersion")); writer->WriteValue(static_cast(IfChangedFromDataVersion)); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr IfChangedFromDataVersionValue = obj->TryGetField(TEXT("IfChangedFromDataVersion")); + if (IfChangedFromDataVersionValue.IsValid() && !IfChangedFromDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (IfChangedFromDataVersionValue->TryGetNumber(TmpValue)) { IfChangedFromDataVersion = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeUserDataPermissionEnumJSON(UserDataPermission enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case UserDataPermissionPrivate: writer->WriteValue(TEXT("Private")); break; + case UserDataPermissionPublic: writer->WriteValue(TEXT("Public")); break; + } +} + +ClientModels::UserDataPermission PlayFab::ClientModels::readUserDataPermissionFromValue(const TSharedPtr& value) +{ + return readUserDataPermissionFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::UserDataPermission PlayFab::ClientModels::readUserDataPermissionFromValue(const FString& value) +{ + static TMap _UserDataPermissionMap; + if (_UserDataPermissionMap.Num() == 0) + { + // Auto-generate the map on the first use + _UserDataPermissionMap.Add(TEXT("Private"), UserDataPermissionPrivate); + _UserDataPermissionMap.Add(TEXT("Public"), UserDataPermissionPublic); + + } + + if (!value.IsEmpty()) + { + auto output = _UserDataPermissionMap.Find(value); + if (output != nullptr) + return *output; + } + + return UserDataPermissionPrivate; // Basically critical fail +} + +PlayFab::ClientModels::FUserDataRecord::~FUserDataRecord() +{ + +} + +void PlayFab::ClientModels::FUserDataRecord::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LastUpdated")); writeDatetime(LastUpdated, writer); + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserDataRecord::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LastUpdatedValue = obj->TryGetField(TEXT("LastUpdated")); + if (LastUpdatedValue.IsValid()) + LastUpdated = readDatetime(LastUpdatedValue); + + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterDataResult::~FGetCharacterDataResult() +{ + +} + +void PlayFab::ClientModels::FGetCharacterDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterInventoryRequest::~FGetCharacterInventoryRequest() +{ + +} + +void PlayFab::ClientModels::FGetCharacterInventoryRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterInventoryRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FVirtualCurrencyRechargeTime::~FVirtualCurrencyRechargeTime() +{ + +} + +void PlayFab::ClientModels::FVirtualCurrencyRechargeTime::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("RechargeMax")); writer->WriteValue(RechargeMax); + + writer->WriteIdentifierPrefix(TEXT("RechargeTime")); writeDatetime(RechargeTime, writer); + + writer->WriteIdentifierPrefix(TEXT("SecondsToRecharge")); writer->WriteValue(SecondsToRecharge); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FVirtualCurrencyRechargeTime::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RechargeMaxValue = obj->TryGetField(TEXT("RechargeMax")); + if (RechargeMaxValue.IsValid() && !RechargeMaxValue->IsNull()) + { + int32 TmpValue; + if (RechargeMaxValue->TryGetNumber(TmpValue)) { RechargeMax = TmpValue; } + } + + const TSharedPtr RechargeTimeValue = obj->TryGetField(TEXT("RechargeTime")); + if (RechargeTimeValue.IsValid()) + RechargeTime = readDatetime(RechargeTimeValue); + + + const TSharedPtr SecondsToRechargeValue = obj->TryGetField(TEXT("SecondsToRecharge")); + if (SecondsToRechargeValue.IsValid() && !SecondsToRechargeValue->IsNull()) + { + int32 TmpValue; + if (SecondsToRechargeValue->TryGetNumber(TmpValue)) { SecondsToRecharge = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterInventoryResult::~FGetCharacterInventoryResult() +{ + +} + +void PlayFab::ClientModels::FGetCharacterInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(VirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyRechargeTimes"), VirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + VirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterLeaderboardRequest::~FGetCharacterLeaderboardRequest() +{ + +} + +void PlayFab::ClientModels::FGetCharacterLeaderboardRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + if (MaxResultsCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); } + + writer->WriteIdentifierPrefix(TEXT("StartPosition")); writer->WriteValue(StartPosition); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterLeaderboardRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr StartPositionValue = obj->TryGetField(TEXT("StartPosition")); + if (StartPositionValue.IsValid() && !StartPositionValue->IsNull()) + { + int32 TmpValue; + if (StartPositionValue->TryGetNumber(TmpValue)) { StartPosition = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterLeaderboardResult::~FGetCharacterLeaderboardResult() +{ + +} + +void PlayFab::ClientModels::FGetCharacterLeaderboardResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FCharacterLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterLeaderboardResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FCharacterLeaderboardEntry(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterStatisticsRequest::~FGetCharacterStatisticsRequest() +{ + +} + +void PlayFab::ClientModels::FGetCharacterStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetCharacterStatisticsResult::~FGetCharacterStatisticsResult() +{ + +} + +void PlayFab::ClientModels::FGetCharacterStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterStatistics.Num() != 0) + { + writer->WriteObjectStart(TEXT("CharacterStatistics")); + for (TMap::TConstIterator It(CharacterStatistics); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetCharacterStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* CharacterStatisticsObject; + if (obj->TryGetObjectField(TEXT("CharacterStatistics"), CharacterStatisticsObject)) + { + for (TMap>::TConstIterator It((*CharacterStatisticsObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + CharacterStatistics.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetContentDownloadUrlRequest::~FGetContentDownloadUrlRequest() +{ + +} + +void PlayFab::ClientModels::FGetContentDownloadUrlRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (HttpMethod.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("HttpMethod")); writer->WriteValue(HttpMethod); } + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + if (ThruCDN.notNull()) { writer->WriteIdentifierPrefix(TEXT("ThruCDN")); writer->WriteValue(ThruCDN); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetContentDownloadUrlRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr HttpMethodValue = obj->TryGetField(TEXT("HttpMethod")); + if (HttpMethodValue.IsValid() && !HttpMethodValue->IsNull()) + { + FString TmpValue; + if (HttpMethodValue->TryGetString(TmpValue)) { HttpMethod = TmpValue; } + } + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr ThruCDNValue = obj->TryGetField(TEXT("ThruCDN")); + if (ThruCDNValue.IsValid() && !ThruCDNValue->IsNull()) + { + bool TmpValue; + if (ThruCDNValue->TryGetBool(TmpValue)) { ThruCDN = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetContentDownloadUrlResult::~FGetContentDownloadUrlResult() +{ + +} + +void PlayFab::ClientModels::FGetContentDownloadUrlResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (URL.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("URL")); writer->WriteValue(URL); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetContentDownloadUrlResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr URLValue = obj->TryGetField(TEXT("URL")); + if (URLValue.IsValid() && !URLValue->IsNull()) + { + FString TmpValue; + if (URLValue->TryGetString(TmpValue)) { URL = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPlayerProfileViewConstraints::~FPlayerProfileViewConstraints() +{ + +} + +void PlayFab::ClientModels::FPlayerProfileViewConstraints::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ShowAvatarUrl")); writer->WriteValue(ShowAvatarUrl); + + writer->WriteIdentifierPrefix(TEXT("ShowBannedUntil")); writer->WriteValue(ShowBannedUntil); + + writer->WriteIdentifierPrefix(TEXT("ShowCampaignAttributions")); writer->WriteValue(ShowCampaignAttributions); + + writer->WriteIdentifierPrefix(TEXT("ShowContactEmailAddresses")); writer->WriteValue(ShowContactEmailAddresses); + + writer->WriteIdentifierPrefix(TEXT("ShowCreated")); writer->WriteValue(ShowCreated); + + writer->WriteIdentifierPrefix(TEXT("ShowDisplayName")); writer->WriteValue(ShowDisplayName); + + writer->WriteIdentifierPrefix(TEXT("ShowLastLogin")); writer->WriteValue(ShowLastLogin); + + writer->WriteIdentifierPrefix(TEXT("ShowLinkedAccounts")); writer->WriteValue(ShowLinkedAccounts); + + writer->WriteIdentifierPrefix(TEXT("ShowLocations")); writer->WriteValue(ShowLocations); + + writer->WriteIdentifierPrefix(TEXT("ShowMemberships")); writer->WriteValue(ShowMemberships); + + writer->WriteIdentifierPrefix(TEXT("ShowOrigination")); writer->WriteValue(ShowOrigination); + + writer->WriteIdentifierPrefix(TEXT("ShowPushNotificationRegistrations")); writer->WriteValue(ShowPushNotificationRegistrations); + + writer->WriteIdentifierPrefix(TEXT("ShowStatistics")); writer->WriteValue(ShowStatistics); + + writer->WriteIdentifierPrefix(TEXT("ShowTags")); writer->WriteValue(ShowTags); + + writer->WriteIdentifierPrefix(TEXT("ShowTotalValueToDateInUsd")); writer->WriteValue(ShowTotalValueToDateInUsd); + + writer->WriteIdentifierPrefix(TEXT("ShowValuesToDate")); writer->WriteValue(ShowValuesToDate); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPlayerProfileViewConstraints::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ShowAvatarUrlValue = obj->TryGetField(TEXT("ShowAvatarUrl")); + if (ShowAvatarUrlValue.IsValid() && !ShowAvatarUrlValue->IsNull()) + { + bool TmpValue; + if (ShowAvatarUrlValue->TryGetBool(TmpValue)) { ShowAvatarUrl = TmpValue; } + } + + const TSharedPtr ShowBannedUntilValue = obj->TryGetField(TEXT("ShowBannedUntil")); + if (ShowBannedUntilValue.IsValid() && !ShowBannedUntilValue->IsNull()) + { + bool TmpValue; + if (ShowBannedUntilValue->TryGetBool(TmpValue)) { ShowBannedUntil = TmpValue; } + } + + const TSharedPtr ShowCampaignAttributionsValue = obj->TryGetField(TEXT("ShowCampaignAttributions")); + if (ShowCampaignAttributionsValue.IsValid() && !ShowCampaignAttributionsValue->IsNull()) + { + bool TmpValue; + if (ShowCampaignAttributionsValue->TryGetBool(TmpValue)) { ShowCampaignAttributions = TmpValue; } + } + + const TSharedPtr ShowContactEmailAddressesValue = obj->TryGetField(TEXT("ShowContactEmailAddresses")); + if (ShowContactEmailAddressesValue.IsValid() && !ShowContactEmailAddressesValue->IsNull()) + { + bool TmpValue; + if (ShowContactEmailAddressesValue->TryGetBool(TmpValue)) { ShowContactEmailAddresses = TmpValue; } + } + + const TSharedPtr ShowCreatedValue = obj->TryGetField(TEXT("ShowCreated")); + if (ShowCreatedValue.IsValid() && !ShowCreatedValue->IsNull()) + { + bool TmpValue; + if (ShowCreatedValue->TryGetBool(TmpValue)) { ShowCreated = TmpValue; } + } + + const TSharedPtr ShowDisplayNameValue = obj->TryGetField(TEXT("ShowDisplayName")); + if (ShowDisplayNameValue.IsValid() && !ShowDisplayNameValue->IsNull()) + { + bool TmpValue; + if (ShowDisplayNameValue->TryGetBool(TmpValue)) { ShowDisplayName = TmpValue; } + } + + const TSharedPtr ShowLastLoginValue = obj->TryGetField(TEXT("ShowLastLogin")); + if (ShowLastLoginValue.IsValid() && !ShowLastLoginValue->IsNull()) + { + bool TmpValue; + if (ShowLastLoginValue->TryGetBool(TmpValue)) { ShowLastLogin = TmpValue; } + } + + const TSharedPtr ShowLinkedAccountsValue = obj->TryGetField(TEXT("ShowLinkedAccounts")); + if (ShowLinkedAccountsValue.IsValid() && !ShowLinkedAccountsValue->IsNull()) + { + bool TmpValue; + if (ShowLinkedAccountsValue->TryGetBool(TmpValue)) { ShowLinkedAccounts = TmpValue; } + } + + const TSharedPtr ShowLocationsValue = obj->TryGetField(TEXT("ShowLocations")); + if (ShowLocationsValue.IsValid() && !ShowLocationsValue->IsNull()) + { + bool TmpValue; + if (ShowLocationsValue->TryGetBool(TmpValue)) { ShowLocations = TmpValue; } + } + + const TSharedPtr ShowMembershipsValue = obj->TryGetField(TEXT("ShowMemberships")); + if (ShowMembershipsValue.IsValid() && !ShowMembershipsValue->IsNull()) + { + bool TmpValue; + if (ShowMembershipsValue->TryGetBool(TmpValue)) { ShowMemberships = TmpValue; } + } + + const TSharedPtr ShowOriginationValue = obj->TryGetField(TEXT("ShowOrigination")); + if (ShowOriginationValue.IsValid() && !ShowOriginationValue->IsNull()) + { + bool TmpValue; + if (ShowOriginationValue->TryGetBool(TmpValue)) { ShowOrigination = TmpValue; } + } + + const TSharedPtr ShowPushNotificationRegistrationsValue = obj->TryGetField(TEXT("ShowPushNotificationRegistrations")); + if (ShowPushNotificationRegistrationsValue.IsValid() && !ShowPushNotificationRegistrationsValue->IsNull()) + { + bool TmpValue; + if (ShowPushNotificationRegistrationsValue->TryGetBool(TmpValue)) { ShowPushNotificationRegistrations = TmpValue; } + } + + const TSharedPtr ShowStatisticsValue = obj->TryGetField(TEXT("ShowStatistics")); + if (ShowStatisticsValue.IsValid() && !ShowStatisticsValue->IsNull()) + { + bool TmpValue; + if (ShowStatisticsValue->TryGetBool(TmpValue)) { ShowStatistics = TmpValue; } + } + + const TSharedPtr ShowTagsValue = obj->TryGetField(TEXT("ShowTags")); + if (ShowTagsValue.IsValid() && !ShowTagsValue->IsNull()) + { + bool TmpValue; + if (ShowTagsValue->TryGetBool(TmpValue)) { ShowTags = TmpValue; } + } + + const TSharedPtr ShowTotalValueToDateInUsdValue = obj->TryGetField(TEXT("ShowTotalValueToDateInUsd")); + if (ShowTotalValueToDateInUsdValue.IsValid() && !ShowTotalValueToDateInUsdValue->IsNull()) + { + bool TmpValue; + if (ShowTotalValueToDateInUsdValue->TryGetBool(TmpValue)) { ShowTotalValueToDateInUsd = TmpValue; } + } + + const TSharedPtr ShowValuesToDateValue = obj->TryGetField(TEXT("ShowValuesToDate")); + if (ShowValuesToDateValue.IsValid() && !ShowValuesToDateValue->IsNull()) + { + bool TmpValue; + if (ShowValuesToDateValue->TryGetBool(TmpValue)) { ShowValuesToDate = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetFriendLeaderboardAroundPlayerRequest::~FGetFriendLeaderboardAroundPlayerRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetFriendLeaderboardAroundPlayerRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IncludeFacebookFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeFacebookFriends")); writer->WriteValue(IncludeFacebookFriends); } + + if (IncludeSteamFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeSteamFriends")); writer->WriteValue(IncludeSteamFriends); } + + if (MaxResultsCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + if (XboxToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetFriendLeaderboardAroundPlayerRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IncludeFacebookFriendsValue = obj->TryGetField(TEXT("IncludeFacebookFriends")); + if (IncludeFacebookFriendsValue.IsValid() && !IncludeFacebookFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeFacebookFriendsValue->TryGetBool(TmpValue)) { IncludeFacebookFriends = TmpValue; } + } + + const TSharedPtr IncludeSteamFriendsValue = obj->TryGetField(TEXT("IncludeSteamFriends")); + if (IncludeSteamFriendsValue.IsValid() && !IncludeSteamFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeSteamFriendsValue->TryGetBool(TmpValue)) { IncludeSteamFriends = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPlayerLeaderboardEntry::~FPlayerLeaderboardEntry() +{ + //if (Profile != nullptr) delete Profile; + +} + +void PlayFab::ClientModels::FPlayerLeaderboardEntry::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteIdentifierPrefix(TEXT("Position")); writer->WriteValue(Position); + + if (Profile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Profile")); Profile->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StatValue")); writer->WriteValue(StatValue); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPlayerLeaderboardEntry::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PositionValue = obj->TryGetField(TEXT("Position")); + if (PositionValue.IsValid() && !PositionValue->IsNull()) + { + int32 TmpValue; + if (PositionValue->TryGetNumber(TmpValue)) { Position = TmpValue; } + } + + const TSharedPtr ProfileValue = obj->TryGetField(TEXT("Profile")); + if (ProfileValue.IsValid() && !ProfileValue->IsNull()) + { + Profile = MakeShareable(new FPlayerProfileModel(ProfileValue->AsObject())); + } + + const TSharedPtr StatValueValue = obj->TryGetField(TEXT("StatValue")); + if (StatValueValue.IsValid() && !StatValueValue->IsNull()) + { + int32 TmpValue; + if (StatValueValue->TryGetNumber(TmpValue)) { StatValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetFriendLeaderboardAroundPlayerResult::~FGetFriendLeaderboardAroundPlayerResult() +{ + +} + +void PlayFab::ClientModels::FGetFriendLeaderboardAroundPlayerResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FPlayerLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (NextReset.notNull()) { writer->WriteIdentifierPrefix(TEXT("NextReset")); writeDatetime(NextReset, writer); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetFriendLeaderboardAroundPlayerResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FPlayerLeaderboardEntry(CurrentItem->AsObject())); + } + + + const TSharedPtr NextResetValue = obj->TryGetField(TEXT("NextReset")); + if (NextResetValue.IsValid()) + NextReset = readDatetime(NextResetValue); + + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetFriendLeaderboardRequest::~FGetFriendLeaderboardRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetFriendLeaderboardRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IncludeFacebookFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeFacebookFriends")); writer->WriteValue(IncludeFacebookFriends); } + + if (IncludeSteamFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeSteamFriends")); writer->WriteValue(IncludeSteamFriends); } + + if (MaxResultsCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); } + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StartPosition")); writer->WriteValue(StartPosition); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + if (XboxToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetFriendLeaderboardRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IncludeFacebookFriendsValue = obj->TryGetField(TEXT("IncludeFacebookFriends")); + if (IncludeFacebookFriendsValue.IsValid() && !IncludeFacebookFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeFacebookFriendsValue->TryGetBool(TmpValue)) { IncludeFacebookFriends = TmpValue; } + } + + const TSharedPtr IncludeSteamFriendsValue = obj->TryGetField(TEXT("IncludeSteamFriends")); + if (IncludeSteamFriendsValue.IsValid() && !IncludeSteamFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeSteamFriendsValue->TryGetBool(TmpValue)) { IncludeSteamFriends = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StartPositionValue = obj->TryGetField(TEXT("StartPosition")); + if (StartPositionValue.IsValid() && !StartPositionValue->IsNull()) + { + int32 TmpValue; + if (StartPositionValue->TryGetNumber(TmpValue)) { StartPosition = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetFriendsListRequest::~FGetFriendsListRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetFriendsListRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IncludeFacebookFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeFacebookFriends")); writer->WriteValue(IncludeFacebookFriends); } + + if (IncludeSteamFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeSteamFriends")); writer->WriteValue(IncludeSteamFriends); } + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + if (XboxToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetFriendsListRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IncludeFacebookFriendsValue = obj->TryGetField(TEXT("IncludeFacebookFriends")); + if (IncludeFacebookFriendsValue.IsValid() && !IncludeFacebookFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeFacebookFriendsValue->TryGetBool(TmpValue)) { IncludeFacebookFriends = TmpValue; } + } + + const TSharedPtr IncludeSteamFriendsValue = obj->TryGetField(TEXT("IncludeSteamFriends")); + if (IncludeSteamFriendsValue.IsValid() && !IncludeSteamFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeSteamFriendsValue->TryGetBool(TmpValue)) { IncludeSteamFriends = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetFriendsListResult::~FGetFriendsListResult() +{ + +} + +void PlayFab::ClientModels::FGetFriendsListResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Friends.Num() != 0) + { + writer->WriteArrayStart(TEXT("Friends")); + for (const FFriendInfo& item : Friends) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetFriendsListResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&FriendsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Friends")); + for (int32 Idx = 0; Idx < FriendsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = FriendsArray[Idx]; + Friends.Add(FFriendInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardAroundCharacterRequest::~FGetLeaderboardAroundCharacterRequest() +{ + +} + +void PlayFab::ClientModels::FGetLeaderboardAroundCharacterRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + if (MaxResultsCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); } + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardAroundCharacterRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardAroundCharacterResult::~FGetLeaderboardAroundCharacterResult() +{ + +} + +void PlayFab::ClientModels::FGetLeaderboardAroundCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FCharacterLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardAroundCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FCharacterLeaderboardEntry(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardAroundPlayerRequest::~FGetLeaderboardAroundPlayerRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetLeaderboardAroundPlayerRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (MaxResultsCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardAroundPlayerRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardAroundPlayerResult::~FGetLeaderboardAroundPlayerResult() +{ + +} + +void PlayFab::ClientModels::FGetLeaderboardAroundPlayerResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FPlayerLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (NextReset.notNull()) { writer->WriteIdentifierPrefix(TEXT("NextReset")); writeDatetime(NextReset, writer); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardAroundPlayerResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FPlayerLeaderboardEntry(CurrentItem->AsObject())); + } + + + const TSharedPtr NextResetValue = obj->TryGetField(TEXT("NextReset")); + if (NextResetValue.IsValid()) + NextReset = readDatetime(NextResetValue); + + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardForUsersCharactersRequest::~FGetLeaderboardForUsersCharactersRequest() +{ + +} + +void PlayFab::ClientModels::FGetLeaderboardForUsersCharactersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardForUsersCharactersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardForUsersCharactersResult::~FGetLeaderboardForUsersCharactersResult() +{ + +} + +void PlayFab::ClientModels::FGetLeaderboardForUsersCharactersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FCharacterLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardForUsersCharactersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FCharacterLeaderboardEntry(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardRequest::~FGetLeaderboardRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetLeaderboardRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (MaxResultsCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); } + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StartPosition")); writer->WriteValue(StartPosition); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StartPositionValue = obj->TryGetField(TEXT("StartPosition")); + if (StartPositionValue.IsValid() && !StartPositionValue->IsNull()) + { + int32 TmpValue; + if (StartPositionValue->TryGetNumber(TmpValue)) { StartPosition = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetLeaderboardResult::~FGetLeaderboardResult() +{ + +} + +void PlayFab::ClientModels::FGetLeaderboardResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FPlayerLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (NextReset.notNull()) { writer->WriteIdentifierPrefix(TEXT("NextReset")); writeDatetime(NextReset, writer); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetLeaderboardResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FPlayerLeaderboardEntry(CurrentItem->AsObject())); + } + + + const TSharedPtr NextResetValue = obj->TryGetField(TEXT("NextReset")); + if (NextResetValue.IsValid()) + NextReset = readDatetime(NextResetValue); + + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPaymentTokenRequest::~FGetPaymentTokenRequest() +{ + +} + +void PlayFab::ClientModels::FGetPaymentTokenRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("TokenProvider")); writer->WriteValue(TokenProvider); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPaymentTokenRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TokenProviderValue = obj->TryGetField(TEXT("TokenProvider")); + if (TokenProviderValue.IsValid() && !TokenProviderValue->IsNull()) + { + FString TmpValue; + if (TokenProviderValue->TryGetString(TmpValue)) { TokenProvider = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPaymentTokenResult::~FGetPaymentTokenResult() +{ + +} + +void PlayFab::ClientModels::FGetPaymentTokenResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (OrderId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); } + + if (ProviderToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ProviderToken")); writer->WriteValue(ProviderToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPaymentTokenResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TSharedPtr ProviderTokenValue = obj->TryGetField(TEXT("ProviderToken")); + if (ProviderTokenValue.IsValid() && !ProviderTokenValue->IsNull()) + { + FString TmpValue; + if (ProviderTokenValue->TryGetString(TmpValue)) { ProviderToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPhotonAuthenticationTokenRequest::~FGetPhotonAuthenticationTokenRequest() +{ + +} + +void PlayFab::ClientModels::FGetPhotonAuthenticationTokenRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PhotonApplicationId")); writer->WriteValue(PhotonApplicationId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPhotonAuthenticationTokenRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PhotonApplicationIdValue = obj->TryGetField(TEXT("PhotonApplicationId")); + if (PhotonApplicationIdValue.IsValid() && !PhotonApplicationIdValue->IsNull()) + { + FString TmpValue; + if (PhotonApplicationIdValue->TryGetString(TmpValue)) { PhotonApplicationId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPhotonAuthenticationTokenResult::~FGetPhotonAuthenticationTokenResult() +{ + +} + +void PlayFab::ClientModels::FGetPhotonAuthenticationTokenResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PhotonCustomAuthenticationToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PhotonCustomAuthenticationToken")); writer->WriteValue(PhotonCustomAuthenticationToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPhotonAuthenticationTokenResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PhotonCustomAuthenticationTokenValue = obj->TryGetField(TEXT("PhotonCustomAuthenticationToken")); + if (PhotonCustomAuthenticationTokenValue.IsValid() && !PhotonCustomAuthenticationTokenValue->IsNull()) + { + FString TmpValue; + if (PhotonCustomAuthenticationTokenValue->TryGetString(TmpValue)) { PhotonCustomAuthenticationToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerCombinedInfoRequestParams::~FGetPlayerCombinedInfoRequestParams() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetPlayerCombinedInfoRequestParams::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GetCharacterInventories")); writer->WriteValue(GetCharacterInventories); + + writer->WriteIdentifierPrefix(TEXT("GetCharacterList")); writer->WriteValue(GetCharacterList); + + writer->WriteIdentifierPrefix(TEXT("GetPlayerProfile")); writer->WriteValue(GetPlayerProfile); + + writer->WriteIdentifierPrefix(TEXT("GetPlayerStatistics")); writer->WriteValue(GetPlayerStatistics); + + writer->WriteIdentifierPrefix(TEXT("GetTitleData")); writer->WriteValue(GetTitleData); + + writer->WriteIdentifierPrefix(TEXT("GetUserAccountInfo")); writer->WriteValue(GetUserAccountInfo); + + writer->WriteIdentifierPrefix(TEXT("GetUserData")); writer->WriteValue(GetUserData); + + writer->WriteIdentifierPrefix(TEXT("GetUserInventory")); writer->WriteValue(GetUserInventory); + + writer->WriteIdentifierPrefix(TEXT("GetUserReadOnlyData")); writer->WriteValue(GetUserReadOnlyData); + + writer->WriteIdentifierPrefix(TEXT("GetUserVirtualCurrency")); writer->WriteValue(GetUserVirtualCurrency); + + if (PlayerStatisticNames.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerStatisticNames")); + for (const FString& item : PlayerStatisticNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + if (TitleDataKeys.Num() != 0) + { + writer->WriteArrayStart(TEXT("TitleDataKeys")); + for (const FString& item : TitleDataKeys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (UserDataKeys.Num() != 0) + { + writer->WriteArrayStart(TEXT("UserDataKeys")); + for (const FString& item : UserDataKeys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (UserReadOnlyDataKeys.Num() != 0) + { + writer->WriteArrayStart(TEXT("UserReadOnlyDataKeys")); + for (const FString& item : UserReadOnlyDataKeys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerCombinedInfoRequestParams::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GetCharacterInventoriesValue = obj->TryGetField(TEXT("GetCharacterInventories")); + if (GetCharacterInventoriesValue.IsValid() && !GetCharacterInventoriesValue->IsNull()) + { + bool TmpValue; + if (GetCharacterInventoriesValue->TryGetBool(TmpValue)) { GetCharacterInventories = TmpValue; } + } + + const TSharedPtr GetCharacterListValue = obj->TryGetField(TEXT("GetCharacterList")); + if (GetCharacterListValue.IsValid() && !GetCharacterListValue->IsNull()) + { + bool TmpValue; + if (GetCharacterListValue->TryGetBool(TmpValue)) { GetCharacterList = TmpValue; } + } + + const TSharedPtr GetPlayerProfileValue = obj->TryGetField(TEXT("GetPlayerProfile")); + if (GetPlayerProfileValue.IsValid() && !GetPlayerProfileValue->IsNull()) + { + bool TmpValue; + if (GetPlayerProfileValue->TryGetBool(TmpValue)) { GetPlayerProfile = TmpValue; } + } + + const TSharedPtr GetPlayerStatisticsValue = obj->TryGetField(TEXT("GetPlayerStatistics")); + if (GetPlayerStatisticsValue.IsValid() && !GetPlayerStatisticsValue->IsNull()) + { + bool TmpValue; + if (GetPlayerStatisticsValue->TryGetBool(TmpValue)) { GetPlayerStatistics = TmpValue; } + } + + const TSharedPtr GetTitleDataValue = obj->TryGetField(TEXT("GetTitleData")); + if (GetTitleDataValue.IsValid() && !GetTitleDataValue->IsNull()) + { + bool TmpValue; + if (GetTitleDataValue->TryGetBool(TmpValue)) { GetTitleData = TmpValue; } + } + + const TSharedPtr GetUserAccountInfoValue = obj->TryGetField(TEXT("GetUserAccountInfo")); + if (GetUserAccountInfoValue.IsValid() && !GetUserAccountInfoValue->IsNull()) + { + bool TmpValue; + if (GetUserAccountInfoValue->TryGetBool(TmpValue)) { GetUserAccountInfo = TmpValue; } + } + + const TSharedPtr GetUserDataValue = obj->TryGetField(TEXT("GetUserData")); + if (GetUserDataValue.IsValid() && !GetUserDataValue->IsNull()) + { + bool TmpValue; + if (GetUserDataValue->TryGetBool(TmpValue)) { GetUserData = TmpValue; } + } + + const TSharedPtr GetUserInventoryValue = obj->TryGetField(TEXT("GetUserInventory")); + if (GetUserInventoryValue.IsValid() && !GetUserInventoryValue->IsNull()) + { + bool TmpValue; + if (GetUserInventoryValue->TryGetBool(TmpValue)) { GetUserInventory = TmpValue; } + } + + const TSharedPtr GetUserReadOnlyDataValue = obj->TryGetField(TEXT("GetUserReadOnlyData")); + if (GetUserReadOnlyDataValue.IsValid() && !GetUserReadOnlyDataValue->IsNull()) + { + bool TmpValue; + if (GetUserReadOnlyDataValue->TryGetBool(TmpValue)) { GetUserReadOnlyData = TmpValue; } + } + + const TSharedPtr GetUserVirtualCurrencyValue = obj->TryGetField(TEXT("GetUserVirtualCurrency")); + if (GetUserVirtualCurrencyValue.IsValid() && !GetUserVirtualCurrencyValue->IsNull()) + { + bool TmpValue; + if (GetUserVirtualCurrencyValue->TryGetBool(TmpValue)) { GetUserVirtualCurrency = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("PlayerStatisticNames"), PlayerStatisticNames); + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + obj->TryGetStringArrayField(TEXT("TitleDataKeys"), TitleDataKeys); + + obj->TryGetStringArrayField(TEXT("UserDataKeys"), UserDataKeys); + + obj->TryGetStringArrayField(TEXT("UserReadOnlyDataKeys"), UserReadOnlyDataKeys); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerCombinedInfoRequest::~FGetPlayerCombinedInfoRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayerCombinedInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters.writeJSON(writer); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerCombinedInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject()); + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FStatisticValue::~FStatisticValue() +{ + +} + +void PlayFab::ClientModels::FStatisticValue::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStatisticValue::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerCombinedInfoResultPayload::~FGetPlayerCombinedInfoResultPayload() +{ + //if (AccountInfo != nullptr) delete AccountInfo; + //if (PlayerProfile != nullptr) delete PlayerProfile; + +} + +void PlayFab::ClientModels::FGetPlayerCombinedInfoResultPayload::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AccountInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("AccountInfo")); AccountInfo->writeJSON(writer); } + + if (CharacterInventories.Num() != 0) + { + writer->WriteArrayStart(TEXT("CharacterInventories")); + for (const FCharacterInventory& item : CharacterInventories) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (CharacterList.Num() != 0) + { + writer->WriteArrayStart(TEXT("CharacterList")); + for (const FCharacterResult& item : CharacterList) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayerProfile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PlayerProfile")); PlayerProfile->writeJSON(writer); } + + if (PlayerStatistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerStatistics")); + for (const FStatisticValue& item : PlayerStatistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (TitleData.Num() != 0) + { + writer->WriteObjectStart(TEXT("TitleData")); + for (TMap::TConstIterator It(TitleData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (UserData.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserData")); + for (TMap::TConstIterator It(UserData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("UserDataVersion")); writer->WriteValue(static_cast(UserDataVersion)); + + if (UserInventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("UserInventory")); + for (const FItemInstance& item : UserInventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (UserReadOnlyData.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserReadOnlyData")); + for (TMap::TConstIterator It(UserReadOnlyData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("UserReadOnlyDataVersion")); writer->WriteValue(static_cast(UserReadOnlyDataVersion)); + + if (UserVirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserVirtualCurrency")); + for (TMap::TConstIterator It(UserVirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (UserVirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserVirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(UserVirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerCombinedInfoResultPayload::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccountInfoValue = obj->TryGetField(TEXT("AccountInfo")); + if (AccountInfoValue.IsValid() && !AccountInfoValue->IsNull()) + { + AccountInfo = MakeShareable(new FUserAccountInfo(AccountInfoValue->AsObject())); + } + + const TArray>&CharacterInventoriesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("CharacterInventories")); + for (int32 Idx = 0; Idx < CharacterInventoriesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CharacterInventoriesArray[Idx]; + CharacterInventories.Add(FCharacterInventory(CurrentItem->AsObject())); + } + + + const TArray>&CharacterListArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("CharacterList")); + for (int32 Idx = 0; Idx < CharacterListArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CharacterListArray[Idx]; + CharacterList.Add(FCharacterResult(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayerProfileValue = obj->TryGetField(TEXT("PlayerProfile")); + if (PlayerProfileValue.IsValid() && !PlayerProfileValue->IsNull()) + { + PlayerProfile = MakeShareable(new FPlayerProfileModel(PlayerProfileValue->AsObject())); + } + + const TArray>&PlayerStatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PlayerStatistics")); + for (int32 Idx = 0; Idx < PlayerStatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PlayerStatisticsArray[Idx]; + PlayerStatistics.Add(FStatisticValue(CurrentItem->AsObject())); + } + + + const TSharedPtr* TitleDataObject; + if (obj->TryGetObjectField(TEXT("TitleData"), TitleDataObject)) + { + for (TMap>::TConstIterator It((*TitleDataObject)->Values); It; ++It) + { + TitleData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr* UserDataObject; + if (obj->TryGetObjectField(TEXT("UserData"), UserDataObject)) + { + for (TMap>::TConstIterator It((*UserDataObject)->Values); It; ++It) + { + UserData.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr UserDataVersionValue = obj->TryGetField(TEXT("UserDataVersion")); + if (UserDataVersionValue.IsValid() && !UserDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (UserDataVersionValue->TryGetNumber(TmpValue)) { UserDataVersion = TmpValue; } + } + + const TArray>&UserInventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("UserInventory")); + for (int32 Idx = 0; Idx < UserInventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = UserInventoryArray[Idx]; + UserInventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr* UserReadOnlyDataObject; + if (obj->TryGetObjectField(TEXT("UserReadOnlyData"), UserReadOnlyDataObject)) + { + for (TMap>::TConstIterator It((*UserReadOnlyDataObject)->Values); It; ++It) + { + UserReadOnlyData.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr UserReadOnlyDataVersionValue = obj->TryGetField(TEXT("UserReadOnlyDataVersion")); + if (UserReadOnlyDataVersionValue.IsValid() && !UserReadOnlyDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (UserReadOnlyDataVersionValue->TryGetNumber(TmpValue)) { UserReadOnlyDataVersion = TmpValue; } + } + + const TSharedPtr* UserVirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("UserVirtualCurrency"), UserVirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*UserVirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + UserVirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* UserVirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("UserVirtualCurrencyRechargeTimes"), UserVirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*UserVirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + UserVirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerCombinedInfoResult::~FGetPlayerCombinedInfoResult() +{ + //if (InfoResultPayload != nullptr) delete InfoResultPayload; + +} + +void PlayFab::ClientModels::FGetPlayerCombinedInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (InfoResultPayload.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoResultPayload")); InfoResultPayload->writeJSON(writer); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerCombinedInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr InfoResultPayloadValue = obj->TryGetField(TEXT("InfoResultPayload")); + if (InfoResultPayloadValue.IsValid() && !InfoResultPayloadValue->IsNull()) + { + InfoResultPayload = MakeShareable(new FGetPlayerCombinedInfoResultPayload(InfoResultPayloadValue->AsObject())); + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerProfileRequest::~FGetPlayerProfileRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ClientModels::FGetPlayerProfileRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerProfileRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerProfileResult::~FGetPlayerProfileResult() +{ + //if (PlayerProfile != nullptr) delete PlayerProfile; + +} + +void PlayFab::ClientModels::FGetPlayerProfileResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayerProfile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PlayerProfile")); PlayerProfile->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerProfileResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayerProfileValue = obj->TryGetField(TEXT("PlayerProfile")); + if (PlayerProfileValue.IsValid() && !PlayerProfileValue->IsNull()) + { + PlayerProfile = MakeShareable(new FPlayerProfileModel(PlayerProfileValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerSegmentsRequest::~FGetPlayerSegmentsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayerSegmentsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerSegmentsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetSegmentResult::~FGetSegmentResult() +{ + +} + +void PlayFab::ClientModels::FGetSegmentResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ABTestParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ABTestParent")); writer->WriteValue(ABTestParent); } + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetSegmentResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ABTestParentValue = obj->TryGetField(TEXT("ABTestParent")); + if (ABTestParentValue.IsValid() && !ABTestParentValue->IsNull()) + { + FString TmpValue; + if (ABTestParentValue->TryGetString(TmpValue)) { ABTestParent = TmpValue; } + } + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerSegmentsResult::~FGetPlayerSegmentsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayerSegmentsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Segments.Num() != 0) + { + writer->WriteArrayStart(TEXT("Segments")); + for (const FGetSegmentResult& item : Segments) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerSegmentsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SegmentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Segments")); + for (int32 Idx = 0; Idx < SegmentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SegmentsArray[Idx]; + Segments.Add(FGetSegmentResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FStatisticNameVersion::~FStatisticNameVersion() +{ + +} + +void PlayFab::ClientModels::FStatisticNameVersion::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStatisticNameVersion::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerStatisticsRequest::~FGetPlayerStatisticsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayerStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticNames.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticNames")); + for (const FString& item : StatisticNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (StatisticNameVersions.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticNameVersions")); + for (const FStatisticNameVersion& item : StatisticNameVersions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("StatisticNames"), StatisticNames); + + const TArray>&StatisticNameVersionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("StatisticNameVersions")); + for (int32 Idx = 0; Idx < StatisticNameVersionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticNameVersionsArray[Idx]; + StatisticNameVersions.Add(FStatisticNameVersion(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerStatisticsResult::~FGetPlayerStatisticsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayerStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Statistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticValue& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticValue(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerStatisticVersionsRequest::~FGetPlayerStatisticVersionsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayerStatisticVersionsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerStatisticVersionsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPlayerStatisticVersion::~FPlayerStatisticVersion() +{ + +} + +void PlayFab::ClientModels::FPlayerStatisticVersion::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ActivationTime")); writeDatetime(ActivationTime, writer); + + if (DeactivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("DeactivationTime")); writeDatetime(DeactivationTime, writer); } + + if (ScheduledActivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("ScheduledActivationTime")); writeDatetime(ScheduledActivationTime, writer); } + + if (ScheduledDeactivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("ScheduledDeactivationTime")); writeDatetime(ScheduledDeactivationTime, writer); } + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPlayerStatisticVersion::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActivationTimeValue = obj->TryGetField(TEXT("ActivationTime")); + if (ActivationTimeValue.IsValid()) + ActivationTime = readDatetime(ActivationTimeValue); + + + const TSharedPtr DeactivationTimeValue = obj->TryGetField(TEXT("DeactivationTime")); + if (DeactivationTimeValue.IsValid()) + DeactivationTime = readDatetime(DeactivationTimeValue); + + + const TSharedPtr ScheduledActivationTimeValue = obj->TryGetField(TEXT("ScheduledActivationTime")); + if (ScheduledActivationTimeValue.IsValid()) + ScheduledActivationTime = readDatetime(ScheduledActivationTimeValue); + + + const TSharedPtr ScheduledDeactivationTimeValue = obj->TryGetField(TEXT("ScheduledDeactivationTime")); + if (ScheduledDeactivationTimeValue.IsValid()) + ScheduledDeactivationTime = readDatetime(ScheduledDeactivationTimeValue); + + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerStatisticVersionsResult::~FGetPlayerStatisticVersionsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayerStatisticVersionsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticVersions.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticVersions")); + for (const FPlayerStatisticVersion& item : StatisticVersions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerStatisticVersionsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&StatisticVersionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("StatisticVersions")); + for (int32 Idx = 0; Idx < StatisticVersionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticVersionsArray[Idx]; + StatisticVersions.Add(FPlayerStatisticVersion(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerTagsRequest::~FGetPlayerTagsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayerTagsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Namespace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Namespace")); writer->WriteValue(Namespace); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerTagsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NamespaceValue = obj->TryGetField(TEXT("Namespace")); + if (NamespaceValue.IsValid() && !NamespaceValue->IsNull()) + { + FString TmpValue; + if (NamespaceValue->TryGetString(TmpValue)) { Namespace = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerTagsResult::~FGetPlayerTagsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayerTagsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerTagsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerTradesRequest::~FGetPlayerTradesRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayerTradesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatusFilter.notNull()) { writer->WriteIdentifierPrefix(TEXT("StatusFilter")); writeTradeStatusEnumJSON(StatusFilter, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerTradesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + StatusFilter = readTradeStatusFromValue(obj->TryGetField(TEXT("StatusFilter"))); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayerTradesResponse::~FGetPlayerTradesResponse() +{ + +} + +void PlayFab::ClientModels::FGetPlayerTradesResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AcceptedTrades.Num() != 0) + { + writer->WriteArrayStart(TEXT("AcceptedTrades")); + for (const FTradeInfo& item : AcceptedTrades) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (OpenedTrades.Num() != 0) + { + writer->WriteArrayStart(TEXT("OpenedTrades")); + for (const FTradeInfo& item : OpenedTrades) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayerTradesResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AcceptedTradesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AcceptedTrades")); + for (int32 Idx = 0; Idx < AcceptedTradesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AcceptedTradesArray[Idx]; + AcceptedTrades.Add(FTradeInfo(CurrentItem->AsObject())); + } + + + const TArray>&OpenedTradesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("OpenedTrades")); + for (int32 Idx = 0; Idx < OpenedTradesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = OpenedTradesArray[Idx]; + OpenedTrades.Add(FTradeInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromFacebookIDsRequest::~FGetPlayFabIDsFromFacebookIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromFacebookIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("FacebookIDs")); + for (const FString& item : FacebookIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromFacebookIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FacebookIDs"), FacebookIDs); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromFacebookIDsResult::~FGetPlayFabIDsFromFacebookIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromFacebookIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FFacebookPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromFacebookIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FFacebookPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest::~FGetPlayFabIDsFromFacebookInstantGamesIdsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("FacebookInstantGamesIds")); + for (const FString& item : FacebookInstantGamesIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FacebookInstantGamesIds"), FacebookInstantGamesIds); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult::~FGetPlayFabIDsFromFacebookInstantGamesIdsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FFacebookInstantGamesPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FFacebookInstantGamesPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromGameCenterIDsRequest::~FGetPlayFabIDsFromGameCenterIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromGameCenterIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("GameCenterIDs")); + for (const FString& item : GameCenterIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromGameCenterIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("GameCenterIDs"), GameCenterIDs); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromGameCenterIDsResult::~FGetPlayFabIDsFromGameCenterIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromGameCenterIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FGameCenterPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromGameCenterIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FGameCenterPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromGenericIDsRequest::~FGetPlayFabIDsFromGenericIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromGenericIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("GenericIDs")); + for (const FGenericServiceId& item : GenericIDs) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromGenericIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GenericIDsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GenericIDs")); + for (int32 Idx = 0; Idx < GenericIDsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GenericIDsArray[Idx]; + GenericIDs.Add(FGenericServiceId(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromGenericIDsResult::~FGetPlayFabIDsFromGenericIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromGenericIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FGenericPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromGenericIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FGenericPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromGoogleIDsRequest::~FGetPlayFabIDsFromGoogleIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromGoogleIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("GoogleIDs")); + for (const FString& item : GoogleIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromGoogleIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("GoogleIDs"), GoogleIDs); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGooglePlayFabIdPair::~FGooglePlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FGooglePlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GoogleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleId")); writer->WriteValue(GoogleId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGooglePlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GoogleIdValue = obj->TryGetField(TEXT("GoogleId")); + if (GoogleIdValue.IsValid() && !GoogleIdValue->IsNull()) + { + FString TmpValue; + if (GoogleIdValue->TryGetString(TmpValue)) { GoogleId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromGoogleIDsResult::~FGetPlayFabIDsFromGoogleIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromGoogleIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FGooglePlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromGoogleIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FGooglePlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromKongregateIDsRequest::~FGetPlayFabIDsFromKongregateIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromKongregateIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("KongregateIDs")); + for (const FString& item : KongregateIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromKongregateIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("KongregateIDs"), KongregateIDs); + + return HasSucceeded; +} + +PlayFab::ClientModels::FKongregatePlayFabIdPair::~FKongregatePlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FKongregatePlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (KongregateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateId")); writer->WriteValue(KongregateId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FKongregatePlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KongregateIdValue = obj->TryGetField(TEXT("KongregateId")); + if (KongregateIdValue.IsValid() && !KongregateIdValue->IsNull()) + { + FString TmpValue; + if (KongregateIdValue->TryGetString(TmpValue)) { KongregateId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromKongregateIDsResult::~FGetPlayFabIDsFromKongregateIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromKongregateIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FKongregatePlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromKongregateIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FKongregatePlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest::~FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("NintendoSwitchDeviceIds")); + for (const FString& item : NintendoSwitchDeviceIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("NintendoSwitchDeviceIds"), NintendoSwitchDeviceIds); + + return HasSucceeded; +} + +PlayFab::ClientModels::FNintendoSwitchPlayFabIdPair::~FNintendoSwitchPlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FNintendoSwitchPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FNintendoSwitchPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult::~FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FNintendoSwitchPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FNintendoSwitchPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromSteamIDsRequest::~FGetPlayFabIDsFromSteamIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromSteamIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SteamStringIDs.Num() != 0) + { + writer->WriteArrayStart(TEXT("SteamStringIDs")); + for (const FString& item : SteamStringIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromSteamIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("SteamStringIDs"), SteamStringIDs); + + return HasSucceeded; +} + +PlayFab::ClientModels::FSteamPlayFabIdPair::~FSteamPlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FSteamPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (SteamStringId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamStringId")); writer->WriteValue(SteamStringId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSteamPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr SteamStringIdValue = obj->TryGetField(TEXT("SteamStringId")); + if (SteamStringIdValue.IsValid() && !SteamStringIdValue->IsNull()) + { + FString TmpValue; + if (SteamStringIdValue->TryGetString(TmpValue)) { SteamStringId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromSteamIDsResult::~FGetPlayFabIDsFromSteamIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromSteamIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FSteamPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromSteamIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FSteamPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromTwitchIDsRequest::~FGetPlayFabIDsFromTwitchIDsRequest() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromTwitchIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("TwitchIds")); + for (const FString& item : TwitchIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromTwitchIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("TwitchIds"), TwitchIds); + + return HasSucceeded; +} + +PlayFab::ClientModels::FTwitchPlayFabIdPair::~FTwitchPlayFabIdPair() +{ + +} + +void PlayFab::ClientModels::FTwitchPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (TwitchId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchId")); writer->WriteValue(TwitchId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FTwitchPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TwitchIdValue = obj->TryGetField(TEXT("TwitchId")); + if (TwitchIdValue.IsValid() && !TwitchIdValue->IsNull()) + { + FString TmpValue; + if (TwitchIdValue->TryGetString(TmpValue)) { TwitchId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPlayFabIDsFromTwitchIDsResult::~FGetPlayFabIDsFromTwitchIDsResult() +{ + +} + +void PlayFab::ClientModels::FGetPlayFabIDsFromTwitchIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FTwitchPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPlayFabIDsFromTwitchIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FTwitchPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPublisherDataRequest::~FGetPublisherDataRequest() +{ + +} + +void PlayFab::ClientModels::FGetPublisherDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPublisherDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPublisherDataResult::~FGetPublisherDataResult() +{ + +} + +void PlayFab::ClientModels::FGetPublisherDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPublisherDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPurchaseRequest::~FGetPurchaseRequest() +{ + +} + +void PlayFab::ClientModels::FGetPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetPurchaseResult::~FGetPurchaseResult() +{ + +} + +void PlayFab::ClientModels::FGetPurchaseResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (OrderId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); } + + if (PaymentProvider.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PaymentProvider")); writer->WriteValue(PaymentProvider); } + + writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); + + if (TransactionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TransactionId")); writer->WriteValue(TransactionId); } + + if (TransactionStatus.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TransactionStatus")); writer->WriteValue(TransactionStatus); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetPurchaseResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TSharedPtr PaymentProviderValue = obj->TryGetField(TEXT("PaymentProvider")); + if (PaymentProviderValue.IsValid() && !PaymentProviderValue->IsNull()) + { + FString TmpValue; + if (PaymentProviderValue->TryGetString(TmpValue)) { PaymentProvider = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr TransactionIdValue = obj->TryGetField(TEXT("TransactionId")); + if (TransactionIdValue.IsValid() && !TransactionIdValue->IsNull()) + { + FString TmpValue; + if (TransactionIdValue->TryGetString(TmpValue)) { TransactionId = TmpValue; } + } + + const TSharedPtr TransactionStatusValue = obj->TryGetField(TEXT("TransactionStatus")); + if (TransactionStatusValue.IsValid() && !TransactionStatusValue->IsNull()) + { + FString TmpValue; + if (TransactionStatusValue->TryGetString(TmpValue)) { TransactionStatus = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetSharedGroupDataRequest::~FGetSharedGroupDataRequest() +{ + +} + +void PlayFab::ClientModels::FGetSharedGroupDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GetMembers.notNull()) { writer->WriteIdentifierPrefix(TEXT("GetMembers")); writer->WriteValue(GetMembers); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetSharedGroupDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GetMembersValue = obj->TryGetField(TEXT("GetMembers")); + if (GetMembersValue.IsValid() && !GetMembersValue->IsNull()) + { + bool TmpValue; + if (GetMembersValue->TryGetBool(TmpValue)) { GetMembers = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FSharedGroupDataRecord::~FSharedGroupDataRecord() +{ + +} + +void PlayFab::ClientModels::FSharedGroupDataRecord::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LastUpdated")); writeDatetime(LastUpdated, writer); + + if (LastUpdatedBy.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LastUpdatedBy")); writer->WriteValue(LastUpdatedBy); } + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSharedGroupDataRecord::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LastUpdatedValue = obj->TryGetField(TEXT("LastUpdated")); + if (LastUpdatedValue.IsValid()) + LastUpdated = readDatetime(LastUpdatedValue); + + + const TSharedPtr LastUpdatedByValue = obj->TryGetField(TEXT("LastUpdatedBy")); + if (LastUpdatedByValue.IsValid() && !LastUpdatedByValue->IsNull()) + { + FString TmpValue; + if (LastUpdatedByValue->TryGetString(TmpValue)) { LastUpdatedBy = TmpValue; } + } + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetSharedGroupDataResult::~FGetSharedGroupDataResult() +{ + +} + +void PlayFab::ClientModels::FGetSharedGroupDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + if (Members.Num() != 0) + { + writer->WriteArrayStart(TEXT("Members")); + for (const FString& item : Members) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetSharedGroupDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FSharedGroupDataRecord(It.Value()->AsObject())); + } + } + + obj->TryGetStringArrayField(TEXT("Members"), Members); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetStoreItemsRequest::~FGetStoreItemsRequest() +{ + +} + +void PlayFab::ClientModels::FGetStoreItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetStoreItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FStoreMarketingModel::~FStoreMarketingModel() +{ + +} + +void PlayFab::ClientModels::FStoreMarketingModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Metadata.notNull()) { writer->WriteIdentifierPrefix(TEXT("Metadata")); Metadata.writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStoreMarketingModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr MetadataValue = obj->TryGetField(TEXT("Metadata")); + if (MetadataValue.IsValid() && !MetadataValue->IsNull()) + { + Metadata = FJsonKeeper(MetadataValue); + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeSourceTypeEnumJSON(SourceType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case SourceTypeAdmin: writer->WriteValue(TEXT("Admin")); break; + case SourceTypeBackEnd: writer->WriteValue(TEXT("BackEnd")); break; + case SourceTypeGameClient: writer->WriteValue(TEXT("GameClient")); break; + case SourceTypeGameServer: writer->WriteValue(TEXT("GameServer")); break; + case SourceTypePartner: writer->WriteValue(TEXT("Partner")); break; + case SourceTypeCustom: writer->WriteValue(TEXT("Custom")); break; + case SourceTypeAPI: writer->WriteValue(TEXT("API")); break; + } +} + +ClientModels::SourceType PlayFab::ClientModels::readSourceTypeFromValue(const TSharedPtr& value) +{ + return readSourceTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::SourceType PlayFab::ClientModels::readSourceTypeFromValue(const FString& value) +{ + static TMap _SourceTypeMap; + if (_SourceTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _SourceTypeMap.Add(TEXT("Admin"), SourceTypeAdmin); + _SourceTypeMap.Add(TEXT("BackEnd"), SourceTypeBackEnd); + _SourceTypeMap.Add(TEXT("GameClient"), SourceTypeGameClient); + _SourceTypeMap.Add(TEXT("GameServer"), SourceTypeGameServer); + _SourceTypeMap.Add(TEXT("Partner"), SourceTypePartner); + _SourceTypeMap.Add(TEXT("Custom"), SourceTypeCustom); + _SourceTypeMap.Add(TEXT("API"), SourceTypeAPI); + + } + + if (!value.IsEmpty()) + { + auto output = _SourceTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return SourceTypeAdmin; // Basically critical fail +} + +PlayFab::ClientModels::FStoreItem::~FStoreItem() +{ + +} + +void PlayFab::ClientModels::FStoreItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CustomData.notNull()) { writer->WriteIdentifierPrefix(TEXT("CustomData")); CustomData.writeJSON(writer); } + + if (DisplayPosition.notNull()) { writer->WriteIdentifierPrefix(TEXT("DisplayPosition")); writer->WriteValue(static_cast(DisplayPosition)); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (RealCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("RealCurrencyPrices")); + for (TMap::TConstIterator It(RealCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyPrices")); + for (TMap::TConstIterator It(VirtualCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStoreItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomDataValue = obj->TryGetField(TEXT("CustomData")); + if (CustomDataValue.IsValid() && !CustomDataValue->IsNull()) + { + CustomData = FJsonKeeper(CustomDataValue); + } + + const TSharedPtr DisplayPositionValue = obj->TryGetField(TEXT("DisplayPosition")); + if (DisplayPositionValue.IsValid() && !DisplayPositionValue->IsNull()) + { + uint32 TmpValue; + if (DisplayPositionValue->TryGetNumber(TmpValue)) { DisplayPosition = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr* RealCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("RealCurrencyPrices"), RealCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*RealCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + RealCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyPrices"), VirtualCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetStoreItemsResult::~FGetStoreItemsResult() +{ + //if (MarketingData != nullptr) delete MarketingData; + +} + +void PlayFab::ClientModels::FGetStoreItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (MarketingData.IsValid()) { writer->WriteIdentifierPrefix(TEXT("MarketingData")); MarketingData->writeJSON(writer); } + + if (Source.notNull()) { writer->WriteIdentifierPrefix(TEXT("Source")); writeSourceTypeEnumJSON(Source, writer); } + + if (Store.Num() != 0) + { + writer->WriteArrayStart(TEXT("Store")); + for (const FStoreItem& item : Store) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (StoreId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetStoreItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr MarketingDataValue = obj->TryGetField(TEXT("MarketingData")); + if (MarketingDataValue.IsValid() && !MarketingDataValue->IsNull()) + { + MarketingData = MakeShareable(new FStoreMarketingModel(MarketingDataValue->AsObject())); + } + + Source = readSourceTypeFromValue(obj->TryGetField(TEXT("Source"))); + + const TArray>&StoreArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Store")); + for (int32 Idx = 0; Idx < StoreArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StoreArray[Idx]; + Store.Add(FStoreItem(CurrentItem->AsObject())); + } + + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTimeRequest::~FGetTimeRequest() +{ + +} + +void PlayFab::ClientModels::FGetTimeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTimeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTimeResult::~FGetTimeResult() +{ + +} + +void PlayFab::ClientModels::FGetTimeResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Time")); writeDatetime(Time, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTimeResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TimeValue = obj->TryGetField(TEXT("Time")); + if (TimeValue.IsValid()) + Time = readDatetime(TimeValue); + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTitleDataRequest::~FGetTitleDataRequest() +{ + +} + +void PlayFab::ClientModels::FGetTitleDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTitleDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTitleDataResult::~FGetTitleDataResult() +{ + +} + +void PlayFab::ClientModels::FGetTitleDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTitleDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTitleNewsRequest::~FGetTitleNewsRequest() +{ + +} + +void PlayFab::ClientModels::FGetTitleNewsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Count.notNull()) { writer->WriteIdentifierPrefix(TEXT("Count")); writer->WriteValue(Count); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTitleNewsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CountValue = obj->TryGetField(TEXT("Count")); + if (CountValue.IsValid() && !CountValue->IsNull()) + { + int32 TmpValue; + if (CountValue->TryGetNumber(TmpValue)) { Count = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FTitleNewsItem::~FTitleNewsItem() +{ + +} + +void PlayFab::ClientModels::FTitleNewsItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Body")); writer->WriteValue(Body); } + + if (NewsId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NewsId")); writer->WriteValue(NewsId); } + + writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); + + if (Title.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Title")); writer->WriteValue(Title); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FTitleNewsItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BodyValue = obj->TryGetField(TEXT("Body")); + if (BodyValue.IsValid() && !BodyValue->IsNull()) + { + FString TmpValue; + if (BodyValue->TryGetString(TmpValue)) { Body = TmpValue; } + } + + const TSharedPtr NewsIdValue = obj->TryGetField(TEXT("NewsId")); + if (NewsIdValue.IsValid() && !NewsIdValue->IsNull()) + { + FString TmpValue; + if (NewsIdValue->TryGetString(TmpValue)) { NewsId = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + const TSharedPtr TitleValue = obj->TryGetField(TEXT("Title")); + if (TitleValue.IsValid() && !TitleValue->IsNull()) + { + FString TmpValue; + if (TitleValue->TryGetString(TmpValue)) { Title = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTitleNewsResult::~FGetTitleNewsResult() +{ + +} + +void PlayFab::ClientModels::FGetTitleNewsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (News.Num() != 0) + { + writer->WriteArrayStart(TEXT("News")); + for (const FTitleNewsItem& item : News) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTitleNewsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&NewsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("News")); + for (int32 Idx = 0; Idx < NewsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = NewsArray[Idx]; + News.Add(FTitleNewsItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTitlePublicKeyRequest::~FGetTitlePublicKeyRequest() +{ + +} + +void PlayFab::ClientModels::FGetTitlePublicKeyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteIdentifierPrefix(TEXT("TitleSharedSecret")); writer->WriteValue(TitleSharedSecret); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTitlePublicKeyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr TitleSharedSecretValue = obj->TryGetField(TEXT("TitleSharedSecret")); + if (TitleSharedSecretValue.IsValid() && !TitleSharedSecretValue->IsNull()) + { + FString TmpValue; + if (TitleSharedSecretValue->TryGetString(TmpValue)) { TitleSharedSecret = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTitlePublicKeyResult::~FGetTitlePublicKeyResult() +{ + +} + +void PlayFab::ClientModels::FGetTitlePublicKeyResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (RSAPublicKey.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RSAPublicKey")); writer->WriteValue(RSAPublicKey); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTitlePublicKeyResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RSAPublicKeyValue = obj->TryGetField(TEXT("RSAPublicKey")); + if (RSAPublicKeyValue.IsValid() && !RSAPublicKeyValue->IsNull()) + { + FString TmpValue; + if (RSAPublicKeyValue->TryGetString(TmpValue)) { RSAPublicKey = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTradeStatusRequest::~FGetTradeStatusRequest() +{ + +} + +void PlayFab::ClientModels::FGetTradeStatusRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("OfferingPlayerId")); writer->WriteValue(OfferingPlayerId); + + writer->WriteIdentifierPrefix(TEXT("TradeId")); writer->WriteValue(TradeId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTradeStatusRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OfferingPlayerIdValue = obj->TryGetField(TEXT("OfferingPlayerId")); + if (OfferingPlayerIdValue.IsValid() && !OfferingPlayerIdValue->IsNull()) + { + FString TmpValue; + if (OfferingPlayerIdValue->TryGetString(TmpValue)) { OfferingPlayerId = TmpValue; } + } + + const TSharedPtr TradeIdValue = obj->TryGetField(TEXT("TradeId")); + if (TradeIdValue.IsValid() && !TradeIdValue->IsNull()) + { + FString TmpValue; + if (TradeIdValue->TryGetString(TmpValue)) { TradeId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetTradeStatusResponse::~FGetTradeStatusResponse() +{ + //if (Trade != nullptr) delete Trade; + +} + +void PlayFab::ClientModels::FGetTradeStatusResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Trade.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Trade")); Trade->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetTradeStatusResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TradeValue = obj->TryGetField(TEXT("Trade")); + if (TradeValue.IsValid() && !TradeValue->IsNull()) + { + Trade = MakeShareable(new FTradeInfo(TradeValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetUserDataRequest::~FGetUserDataRequest() +{ + +} + +void PlayFab::ClientModels::FGetUserDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IfChangedFromDataVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("IfChangedFromDataVersion")); writer->WriteValue(static_cast(IfChangedFromDataVersion)); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetUserDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IfChangedFromDataVersionValue = obj->TryGetField(TEXT("IfChangedFromDataVersion")); + if (IfChangedFromDataVersionValue.IsValid() && !IfChangedFromDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (IfChangedFromDataVersionValue->TryGetNumber(TmpValue)) { IfChangedFromDataVersion = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetUserDataResult::~FGetUserDataResult() +{ + +} + +void PlayFab::ClientModels::FGetUserDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetUserDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetUserInventoryRequest::~FGetUserInventoryRequest() +{ + +} + +void PlayFab::ClientModels::FGetUserInventoryRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetUserInventoryRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetUserInventoryResult::~FGetUserInventoryResult() +{ + +} + +void PlayFab::ClientModels::FGetUserInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(VirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetUserInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyRechargeTimes"), VirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + VirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetWindowsHelloChallengeRequest::~FGetWindowsHelloChallengeRequest() +{ + +} + +void PlayFab::ClientModels::FGetWindowsHelloChallengeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PublicKeyHint")); writer->WriteValue(PublicKeyHint); + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetWindowsHelloChallengeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PublicKeyHintValue = obj->TryGetField(TEXT("PublicKeyHint")); + if (PublicKeyHintValue.IsValid() && !PublicKeyHintValue->IsNull()) + { + FString TmpValue; + if (PublicKeyHintValue->TryGetString(TmpValue)) { PublicKeyHint = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGetWindowsHelloChallengeResponse::~FGetWindowsHelloChallengeResponse() +{ + +} + +void PlayFab::ClientModels::FGetWindowsHelloChallengeResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Challenge.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Challenge")); writer->WriteValue(Challenge); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGetWindowsHelloChallengeResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ChallengeValue = obj->TryGetField(TEXT("Challenge")); + if (ChallengeValue.IsValid() && !ChallengeValue->IsNull()) + { + FString TmpValue; + if (ChallengeValue->TryGetString(TmpValue)) { Challenge = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGrantCharacterToUserRequest::~FGrantCharacterToUserRequest() +{ + +} + +void PlayFab::ClientModels::FGrantCharacterToUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("CharacterName")); writer->WriteValue(CharacterName); + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGrantCharacterToUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterNameValue = obj->TryGetField(TEXT("CharacterName")); + if (CharacterNameValue.IsValid() && !CharacterNameValue->IsNull()) + { + FString TmpValue; + if (CharacterNameValue->TryGetString(TmpValue)) { CharacterName = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FGrantCharacterToUserResult::~FGrantCharacterToUserResult() +{ + +} + +void PlayFab::ClientModels::FGrantCharacterToUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + writer->WriteIdentifierPrefix(TEXT("Result")); writer->WriteValue(Result); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FGrantCharacterToUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr ResultValue = obj->TryGetField(TEXT("Result")); + if (ResultValue.IsValid() && !ResultValue->IsNull()) + { + bool TmpValue; + if (ResultValue->TryGetBool(TmpValue)) { Result = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FItemPurchaseRequest::~FItemPurchaseRequest() +{ + +} + +void PlayFab::ClientModels::FItemPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + writer->WriteIdentifierPrefix(TEXT("Quantity")); writer->WriteValue(static_cast(Quantity)); + + if (UpgradeFromItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("UpgradeFromItems")); + for (const FString& item : UpgradeFromItems) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FItemPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr QuantityValue = obj->TryGetField(TEXT("Quantity")); + if (QuantityValue.IsValid() && !QuantityValue->IsNull()) + { + uint32 TmpValue; + if (QuantityValue->TryGetNumber(TmpValue)) { Quantity = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("UpgradeFromItems"), UpgradeFromItems); + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkAndroidDeviceIDRequest::~FLinkAndroidDeviceIDRequest() +{ + +} + +void PlayFab::ClientModels::FLinkAndroidDeviceIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDevice.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDevice")); writer->WriteValue(AndroidDevice); } + + writer->WriteIdentifierPrefix(TEXT("AndroidDeviceId")); writer->WriteValue(AndroidDeviceId); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + if (OS.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OS")); writer->WriteValue(OS); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkAndroidDeviceIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceValue = obj->TryGetField(TEXT("AndroidDevice")); + if (AndroidDeviceValue.IsValid() && !AndroidDeviceValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceValue->TryGetString(TmpValue)) { AndroidDevice = TmpValue; } + } + + const TSharedPtr AndroidDeviceIdValue = obj->TryGetField(TEXT("AndroidDeviceId")); + if (AndroidDeviceIdValue.IsValid() && !AndroidDeviceIdValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceIdValue->TryGetString(TmpValue)) { AndroidDeviceId = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr OSValue = obj->TryGetField(TEXT("OS")); + if (OSValue.IsValid() && !OSValue->IsNull()) + { + FString TmpValue; + if (OSValue->TryGetString(TmpValue)) { OS = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkAndroidDeviceIDResult::~FLinkAndroidDeviceIDResult() +{ + +} + +void PlayFab::ClientModels::FLinkAndroidDeviceIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkAndroidDeviceIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkCustomIDRequest::~FLinkCustomIDRequest() +{ + +} + +void PlayFab::ClientModels::FLinkCustomIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CustomId")); writer->WriteValue(CustomId); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkCustomIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomIdValue = obj->TryGetField(TEXT("CustomId")); + if (CustomIdValue.IsValid() && !CustomIdValue->IsNull()) + { + FString TmpValue; + if (CustomIdValue->TryGetString(TmpValue)) { CustomId = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkCustomIDResult::~FLinkCustomIDResult() +{ + +} + +void PlayFab::ClientModels::FLinkCustomIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkCustomIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkFacebookAccountRequest::~FLinkFacebookAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkFacebookAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AccessToken")); writer->WriteValue(AccessToken); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkFacebookAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccessTokenValue = obj->TryGetField(TEXT("AccessToken")); + if (AccessTokenValue.IsValid() && !AccessTokenValue->IsNull()) + { + FString TmpValue; + if (AccessTokenValue->TryGetString(TmpValue)) { AccessToken = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkFacebookAccountResult::~FLinkFacebookAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkFacebookAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkFacebookAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkFacebookInstantGamesIdRequest::~FLinkFacebookInstantGamesIdRequest() +{ + +} + +void PlayFab::ClientModels::FLinkFacebookInstantGamesIdRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesSignature")); writer->WriteValue(FacebookInstantGamesSignature); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkFacebookInstantGamesIdRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesSignatureValue = obj->TryGetField(TEXT("FacebookInstantGamesSignature")); + if (FacebookInstantGamesSignatureValue.IsValid() && !FacebookInstantGamesSignatureValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesSignatureValue->TryGetString(TmpValue)) { FacebookInstantGamesSignature = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkFacebookInstantGamesIdResult::~FLinkFacebookInstantGamesIdResult() +{ + +} + +void PlayFab::ClientModels::FLinkFacebookInstantGamesIdResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkFacebookInstantGamesIdResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkGameCenterAccountRequest::~FLinkGameCenterAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkGameCenterAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteIdentifierPrefix(TEXT("GameCenterId")); writer->WriteValue(GameCenterId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkGameCenterAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr GameCenterIdValue = obj->TryGetField(TEXT("GameCenterId")); + if (GameCenterIdValue.IsValid() && !GameCenterIdValue->IsNull()) + { + FString TmpValue; + if (GameCenterIdValue->TryGetString(TmpValue)) { GameCenterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkGameCenterAccountResult::~FLinkGameCenterAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkGameCenterAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkGameCenterAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkGoogleAccountRequest::~FLinkGoogleAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkGoogleAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + if (ServerAuthCode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerAuthCode")); writer->WriteValue(ServerAuthCode); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkGoogleAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr ServerAuthCodeValue = obj->TryGetField(TEXT("ServerAuthCode")); + if (ServerAuthCodeValue.IsValid() && !ServerAuthCodeValue->IsNull()) + { + FString TmpValue; + if (ServerAuthCodeValue->TryGetString(TmpValue)) { ServerAuthCode = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkGoogleAccountResult::~FLinkGoogleAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkGoogleAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkGoogleAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkIOSDeviceIDRequest::~FLinkIOSDeviceIDRequest() +{ + +} + +void PlayFab::ClientModels::FLinkIOSDeviceIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DeviceId")); writer->WriteValue(DeviceId); + + if (DeviceModel.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeviceModel")); writer->WriteValue(DeviceModel); } + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + if (OS.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OS")); writer->WriteValue(OS); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkIOSDeviceIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DeviceIdValue = obj->TryGetField(TEXT("DeviceId")); + if (DeviceIdValue.IsValid() && !DeviceIdValue->IsNull()) + { + FString TmpValue; + if (DeviceIdValue->TryGetString(TmpValue)) { DeviceId = TmpValue; } + } + + const TSharedPtr DeviceModelValue = obj->TryGetField(TEXT("DeviceModel")); + if (DeviceModelValue.IsValid() && !DeviceModelValue->IsNull()) + { + FString TmpValue; + if (DeviceModelValue->TryGetString(TmpValue)) { DeviceModel = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr OSValue = obj->TryGetField(TEXT("OS")); + if (OSValue.IsValid() && !OSValue->IsNull()) + { + FString TmpValue; + if (OSValue->TryGetString(TmpValue)) { OS = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkIOSDeviceIDResult::~FLinkIOSDeviceIDResult() +{ + +} + +void PlayFab::ClientModels::FLinkIOSDeviceIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkIOSDeviceIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkKongregateAccountRequest::~FLinkKongregateAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkKongregateAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AuthTicket")); writer->WriteValue(AuthTicket); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteIdentifierPrefix(TEXT("KongregateId")); writer->WriteValue(KongregateId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkKongregateAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AuthTicketValue = obj->TryGetField(TEXT("AuthTicket")); + if (AuthTicketValue.IsValid() && !AuthTicketValue->IsNull()) + { + FString TmpValue; + if (AuthTicketValue->TryGetString(TmpValue)) { AuthTicket = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr KongregateIdValue = obj->TryGetField(TEXT("KongregateId")); + if (KongregateIdValue.IsValid() && !KongregateIdValue->IsNull()) + { + FString TmpValue; + if (KongregateIdValue->TryGetString(TmpValue)) { KongregateId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkKongregateAccountResult::~FLinkKongregateAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkKongregateAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkKongregateAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkNintendoSwitchDeviceIdRequest::~FLinkNintendoSwitchDeviceIdRequest() +{ + +} + +void PlayFab::ClientModels::FLinkNintendoSwitchDeviceIdRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkNintendoSwitchDeviceIdRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkNintendoSwitchDeviceIdResult::~FLinkNintendoSwitchDeviceIdResult() +{ + +} + +void PlayFab::ClientModels::FLinkNintendoSwitchDeviceIdResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkNintendoSwitchDeviceIdResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkSteamAccountRequest::~FLinkSteamAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkSteamAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteIdentifierPrefix(TEXT("SteamTicket")); writer->WriteValue(SteamTicket); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkSteamAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr SteamTicketValue = obj->TryGetField(TEXT("SteamTicket")); + if (SteamTicketValue.IsValid() && !SteamTicketValue->IsNull()) + { + FString TmpValue; + if (SteamTicketValue->TryGetString(TmpValue)) { SteamTicket = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkSteamAccountResult::~FLinkSteamAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkSteamAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkSteamAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkTwitchAccountRequest::~FLinkTwitchAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkTwitchAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AccessToken")); writer->WriteValue(AccessToken); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkTwitchAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccessTokenValue = obj->TryGetField(TEXT("AccessToken")); + if (AccessTokenValue.IsValid() && !AccessTokenValue->IsNull()) + { + FString TmpValue; + if (AccessTokenValue->TryGetString(TmpValue)) { AccessToken = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkTwitchAccountResult::~FLinkTwitchAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkTwitchAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkTwitchAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkWindowsHelloAccountRequest::~FLinkWindowsHelloAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkWindowsHelloAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DeviceName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeviceName")); writer->WriteValue(DeviceName); } + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteIdentifierPrefix(TEXT("PublicKey")); writer->WriteValue(PublicKey); + + writer->WriteIdentifierPrefix(TEXT("UserName")); writer->WriteValue(UserName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkWindowsHelloAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DeviceNameValue = obj->TryGetField(TEXT("DeviceName")); + if (DeviceNameValue.IsValid() && !DeviceNameValue->IsNull()) + { + FString TmpValue; + if (DeviceNameValue->TryGetString(TmpValue)) { DeviceName = TmpValue; } + } + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr PublicKeyValue = obj->TryGetField(TEXT("PublicKey")); + if (PublicKeyValue.IsValid() && !PublicKeyValue->IsNull()) + { + FString TmpValue; + if (PublicKeyValue->TryGetString(TmpValue)) { PublicKey = TmpValue; } + } + + const TSharedPtr UserNameValue = obj->TryGetField(TEXT("UserName")); + if (UserNameValue.IsValid() && !UserNameValue->IsNull()) + { + FString TmpValue; + if (UserNameValue->TryGetString(TmpValue)) { UserName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkWindowsHelloAccountResponse::~FLinkWindowsHelloAccountResponse() +{ + +} + +void PlayFab::ClientModels::FLinkWindowsHelloAccountResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkWindowsHelloAccountResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkXboxAccountRequest::~FLinkXboxAccountRequest() +{ + +} + +void PlayFab::ClientModels::FLinkXboxAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ForceLink.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceLink")); writer->WriteValue(ForceLink); } + + writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkXboxAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ForceLinkValue = obj->TryGetField(TEXT("ForceLink")); + if (ForceLinkValue.IsValid() && !ForceLinkValue->IsNull()) + { + bool TmpValue; + if (ForceLinkValue->TryGetBool(TmpValue)) { ForceLink = TmpValue; } + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLinkXboxAccountResult::~FLinkXboxAccountResult() +{ + +} + +void PlayFab::ClientModels::FLinkXboxAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLinkXboxAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FListUsersCharactersRequest::~FListUsersCharactersRequest() +{ + +} + +void PlayFab::ClientModels::FListUsersCharactersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FListUsersCharactersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FListUsersCharactersResult::~FListUsersCharactersResult() +{ + +} + +void PlayFab::ClientModels::FListUsersCharactersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Characters.Num() != 0) + { + writer->WriteArrayStart(TEXT("Characters")); + for (const FCharacterResult& item : Characters) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FListUsersCharactersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&CharactersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Characters")); + for (int32 Idx = 0; Idx < CharactersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CharactersArray[Idx]; + Characters.Add(FCharacterResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FUserSettings::~FUserSettings() +{ + +} + +void PlayFab::ClientModels::FUserSettings::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GatherDeviceInfo")); writer->WriteValue(GatherDeviceInfo); + + writer->WriteIdentifierPrefix(TEXT("GatherFocusInfo")); writer->WriteValue(GatherFocusInfo); + + writer->WriteIdentifierPrefix(TEXT("NeedsAttribution")); writer->WriteValue(NeedsAttribution); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUserSettings::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GatherDeviceInfoValue = obj->TryGetField(TEXT("GatherDeviceInfo")); + if (GatherDeviceInfoValue.IsValid() && !GatherDeviceInfoValue->IsNull()) + { + bool TmpValue; + if (GatherDeviceInfoValue->TryGetBool(TmpValue)) { GatherDeviceInfo = TmpValue; } + } + + const TSharedPtr GatherFocusInfoValue = obj->TryGetField(TEXT("GatherFocusInfo")); + if (GatherFocusInfoValue.IsValid() && !GatherFocusInfoValue->IsNull()) + { + bool TmpValue; + if (GatherFocusInfoValue->TryGetBool(TmpValue)) { GatherFocusInfo = TmpValue; } + } + + const TSharedPtr NeedsAttributionValue = obj->TryGetField(TEXT("NeedsAttribution")); + if (NeedsAttributionValue.IsValid() && !NeedsAttributionValue->IsNull()) + { + bool TmpValue; + if (NeedsAttributionValue->TryGetBool(TmpValue)) { NeedsAttribution = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginResult::~FLoginResult() +{ + //if (EntityToken != nullptr) delete EntityToken; + //if (InfoResultPayload != nullptr) delete InfoResultPayload; + //if (SettingsForUser != nullptr) delete SettingsForUser; + +} + +void PlayFab::ClientModels::FLoginResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EntityToken.IsValid()) { writer->WriteIdentifierPrefix(TEXT("EntityToken")); EntityToken->writeJSON(writer); } + + if (InfoResultPayload.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoResultPayload")); InfoResultPayload->writeJSON(writer); } + + if (LastLoginTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLoginTime")); writeDatetime(LastLoginTime, writer); } + + writer->WriteIdentifierPrefix(TEXT("NewlyCreated")); writer->WriteValue(NewlyCreated); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (SessionTicket.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SessionTicket")); writer->WriteValue(SessionTicket); } + + if (SettingsForUser.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SettingsForUser")); SettingsForUser->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityTokenValue = obj->TryGetField(TEXT("EntityToken")); + if (EntityTokenValue.IsValid() && !EntityTokenValue->IsNull()) + { + EntityToken = MakeShareable(new FEntityTokenResponse(EntityTokenValue->AsObject())); + } + + const TSharedPtr InfoResultPayloadValue = obj->TryGetField(TEXT("InfoResultPayload")); + if (InfoResultPayloadValue.IsValid() && !InfoResultPayloadValue->IsNull()) + { + InfoResultPayload = MakeShareable(new FGetPlayerCombinedInfoResultPayload(InfoResultPayloadValue->AsObject())); + } + + const TSharedPtr LastLoginTimeValue = obj->TryGetField(TEXT("LastLoginTime")); + if (LastLoginTimeValue.IsValid()) + LastLoginTime = readDatetime(LastLoginTimeValue); + + + const TSharedPtr NewlyCreatedValue = obj->TryGetField(TEXT("NewlyCreated")); + if (NewlyCreatedValue.IsValid() && !NewlyCreatedValue->IsNull()) + { + bool TmpValue; + if (NewlyCreatedValue->TryGetBool(TmpValue)) { NewlyCreated = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr SessionTicketValue = obj->TryGetField(TEXT("SessionTicket")); + if (SessionTicketValue.IsValid() && !SessionTicketValue->IsNull()) + { + FString TmpValue; + if (SessionTicketValue->TryGetString(TmpValue)) { SessionTicket = TmpValue; } + } + + const TSharedPtr SettingsForUserValue = obj->TryGetField(TEXT("SettingsForUser")); + if (SettingsForUserValue.IsValid() && !SettingsForUserValue->IsNull()) + { + SettingsForUser = MakeShareable(new FUserSettings(SettingsForUserValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithAndroidDeviceIDRequest::~FLoginWithAndroidDeviceIDRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithAndroidDeviceIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDevice.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDevice")); writer->WriteValue(AndroidDevice); } + + if (AndroidDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceId")); writer->WriteValue(AndroidDeviceId); } + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (OS.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OS")); writer->WriteValue(OS); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithAndroidDeviceIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceValue = obj->TryGetField(TEXT("AndroidDevice")); + if (AndroidDeviceValue.IsValid() && !AndroidDeviceValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceValue->TryGetString(TmpValue)) { AndroidDevice = TmpValue; } + } + + const TSharedPtr AndroidDeviceIdValue = obj->TryGetField(TEXT("AndroidDeviceId")); + if (AndroidDeviceIdValue.IsValid() && !AndroidDeviceIdValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceIdValue->TryGetString(TmpValue)) { AndroidDeviceId = TmpValue; } + } + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr OSValue = obj->TryGetField(TEXT("OS")); + if (OSValue.IsValid() && !OSValue->IsNull()) + { + FString TmpValue; + if (OSValue->TryGetString(TmpValue)) { OS = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithCustomIDRequest::~FLoginWithCustomIDRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithCustomIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (CustomId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomId")); writer->WriteValue(CustomId); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithCustomIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr CustomIdValue = obj->TryGetField(TEXT("CustomId")); + if (CustomIdValue.IsValid() && !CustomIdValue->IsNull()) + { + FString TmpValue; + if (CustomIdValue->TryGetString(TmpValue)) { CustomId = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithEmailAddressRequest::~FLoginWithEmailAddressRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithEmailAddressRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + writer->WriteIdentifierPrefix(TEXT("Password")); writer->WriteValue(Password); + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithEmailAddressRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PasswordValue = obj->TryGetField(TEXT("Password")); + if (PasswordValue.IsValid() && !PasswordValue->IsNull()) + { + FString TmpValue; + if (PasswordValue->TryGetString(TmpValue)) { Password = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithFacebookInstantGamesIdRequest::~FLoginWithFacebookInstantGamesIdRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithFacebookInstantGamesIdRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesSignature")); writer->WriteValue(FacebookInstantGamesSignature); + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithFacebookInstantGamesIdRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr FacebookInstantGamesSignatureValue = obj->TryGetField(TEXT("FacebookInstantGamesSignature")); + if (FacebookInstantGamesSignatureValue.IsValid() && !FacebookInstantGamesSignatureValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesSignatureValue->TryGetString(TmpValue)) { FacebookInstantGamesSignature = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithFacebookRequest::~FLoginWithFacebookRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithFacebookRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AccessToken")); writer->WriteValue(AccessToken); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithFacebookRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccessTokenValue = obj->TryGetField(TEXT("AccessToken")); + if (AccessTokenValue.IsValid() && !AccessTokenValue->IsNull()) + { + FString TmpValue; + if (AccessTokenValue->TryGetString(TmpValue)) { AccessToken = TmpValue; } + } + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithGameCenterRequest::~FLoginWithGameCenterRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithGameCenterRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerId")); writer->WriteValue(PlayerId); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithGameCenterRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerIdValue = obj->TryGetField(TEXT("PlayerId")); + if (PlayerIdValue.IsValid() && !PlayerIdValue->IsNull()) + { + FString TmpValue; + if (PlayerIdValue->TryGetString(TmpValue)) { PlayerId = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithGoogleAccountRequest::~FLoginWithGoogleAccountRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithGoogleAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + if (ServerAuthCode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerAuthCode")); writer->WriteValue(ServerAuthCode); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithGoogleAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr ServerAuthCodeValue = obj->TryGetField(TEXT("ServerAuthCode")); + if (ServerAuthCodeValue.IsValid() && !ServerAuthCodeValue->IsNull()) + { + FString TmpValue; + if (ServerAuthCodeValue->TryGetString(TmpValue)) { ServerAuthCode = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithIOSDeviceIDRequest::~FLoginWithIOSDeviceIDRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithIOSDeviceIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (DeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeviceId")); writer->WriteValue(DeviceId); } + + if (DeviceModel.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeviceModel")); writer->WriteValue(DeviceModel); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (OS.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OS")); writer->WriteValue(OS); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithIOSDeviceIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr DeviceIdValue = obj->TryGetField(TEXT("DeviceId")); + if (DeviceIdValue.IsValid() && !DeviceIdValue->IsNull()) + { + FString TmpValue; + if (DeviceIdValue->TryGetString(TmpValue)) { DeviceId = TmpValue; } + } + + const TSharedPtr DeviceModelValue = obj->TryGetField(TEXT("DeviceModel")); + if (DeviceModelValue.IsValid() && !DeviceModelValue->IsNull()) + { + FString TmpValue; + if (DeviceModelValue->TryGetString(TmpValue)) { DeviceModel = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr OSValue = obj->TryGetField(TEXT("OS")); + if (OSValue.IsValid() && !OSValue->IsNull()) + { + FString TmpValue; + if (OSValue->TryGetString(TmpValue)) { OS = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithKongregateRequest::~FLoginWithKongregateRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithKongregateRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AuthTicket.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AuthTicket")); writer->WriteValue(AuthTicket); } + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (KongregateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateId")); writer->WriteValue(KongregateId); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithKongregateRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AuthTicketValue = obj->TryGetField(TEXT("AuthTicket")); + if (AuthTicketValue.IsValid() && !AuthTicketValue->IsNull()) + { + FString TmpValue; + if (AuthTicketValue->TryGetString(TmpValue)) { AuthTicket = TmpValue; } + } + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr KongregateIdValue = obj->TryGetField(TEXT("KongregateId")); + if (KongregateIdValue.IsValid() && !KongregateIdValue->IsNull()) + { + FString TmpValue; + if (KongregateIdValue->TryGetString(TmpValue)) { KongregateId = TmpValue; } + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithNintendoSwitchDeviceIdRequest::~FLoginWithNintendoSwitchDeviceIdRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithNintendoSwitchDeviceIdRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithNintendoSwitchDeviceIdRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithPlayFabRequest::~FLoginWithPlayFabRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithPlayFabRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + writer->WriteIdentifierPrefix(TEXT("Password")); writer->WriteValue(Password); + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithPlayFabRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PasswordValue = obj->TryGetField(TEXT("Password")); + if (PasswordValue.IsValid() && !PasswordValue->IsNull()) + { + FString TmpValue; + if (PasswordValue->TryGetString(TmpValue)) { Password = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithSteamRequest::~FLoginWithSteamRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithSteamRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + if (SteamTicket.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamTicket")); writer->WriteValue(SteamTicket); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithSteamRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr SteamTicketValue = obj->TryGetField(TEXT("SteamTicket")); + if (SteamTicketValue.IsValid() && !SteamTicketValue->IsNull()) + { + FString TmpValue; + if (SteamTicketValue->TryGetString(TmpValue)) { SteamTicket = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithTwitchRequest::~FLoginWithTwitchRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithTwitchRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AccessToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AccessToken")); writer->WriteValue(AccessToken); } + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithTwitchRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccessTokenValue = obj->TryGetField(TEXT("AccessToken")); + if (AccessTokenValue.IsValid() && !AccessTokenValue->IsNull()) + { + FString TmpValue; + if (AccessTokenValue->TryGetString(TmpValue)) { AccessToken = TmpValue; } + } + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithWindowsHelloRequest::~FLoginWithWindowsHelloRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithWindowsHelloRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ChallengeSignature")); writer->WriteValue(ChallengeSignature); + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + writer->WriteIdentifierPrefix(TEXT("PublicKeyHint")); writer->WriteValue(PublicKeyHint); + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithWindowsHelloRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ChallengeSignatureValue = obj->TryGetField(TEXT("ChallengeSignature")); + if (ChallengeSignatureValue.IsValid() && !ChallengeSignatureValue->IsNull()) + { + FString TmpValue; + if (ChallengeSignatureValue->TryGetString(TmpValue)) { ChallengeSignature = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PublicKeyHintValue = obj->TryGetField(TEXT("PublicKeyHint")); + if (PublicKeyHintValue.IsValid() && !PublicKeyHintValue->IsNull()) + { + FString TmpValue; + if (PublicKeyHintValue->TryGetString(TmpValue)) { PublicKeyHint = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FLoginWithXboxRequest::~FLoginWithXboxRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FLoginWithXboxRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CreateAccount.notNull()) { writer->WriteIdentifierPrefix(TEXT("CreateAccount")); writer->WriteValue(CreateAccount); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + if (XboxToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FLoginWithXboxRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreateAccountValue = obj->TryGetField(TEXT("CreateAccount")); + if (CreateAccountValue.IsValid() && !CreateAccountValue->IsNull()) + { + bool TmpValue; + if (CreateAccountValue->TryGetBool(TmpValue)) { CreateAccount = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FMatchmakeRequest::~FMatchmakeRequest() +{ + //if (TagFilter != nullptr) delete TagFilter; + +} + +void PlayFab::ClientModels::FMatchmakeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BuildVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (GameMode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameMode")); writer->WriteValue(GameMode); } + + if (LobbyId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); } + + if (pfRegion.notNull()) { writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); } + + if (StartNewIfNoneFound.notNull()) { writer->WriteIdentifierPrefix(TEXT("StartNewIfNoneFound")); writer->WriteValue(StartNewIfNoneFound); } + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + if (TagFilter.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TagFilter")); TagFilter->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FMatchmakeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr GameModeValue = obj->TryGetField(TEXT("GameMode")); + if (GameModeValue.IsValid() && !GameModeValue->IsNull()) + { + FString TmpValue; + if (GameModeValue->TryGetString(TmpValue)) { GameMode = TmpValue; } + } + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + const TSharedPtr StartNewIfNoneFoundValue = obj->TryGetField(TEXT("StartNewIfNoneFound")); + if (StartNewIfNoneFoundValue.IsValid() && !StartNewIfNoneFoundValue->IsNull()) + { + bool TmpValue; + if (StartNewIfNoneFoundValue->TryGetBool(TmpValue)) { StartNewIfNoneFound = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr TagFilterValue = obj->TryGetField(TEXT("TagFilter")); + if (TagFilterValue.IsValid() && !TagFilterValue->IsNull()) + { + TagFilter = MakeShareable(new FCollectionFilter(TagFilterValue->AsObject())); + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeMatchmakeStatusEnumJSON(MatchmakeStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case MatchmakeStatusComplete: writer->WriteValue(TEXT("Complete")); break; + case MatchmakeStatusWaiting: writer->WriteValue(TEXT("Waiting")); break; + case MatchmakeStatusGameNotFound: writer->WriteValue(TEXT("GameNotFound")); break; + case MatchmakeStatusNoAvailableSlots: writer->WriteValue(TEXT("NoAvailableSlots")); break; + case MatchmakeStatusSessionClosed: writer->WriteValue(TEXT("SessionClosed")); break; + } +} + +ClientModels::MatchmakeStatus PlayFab::ClientModels::readMatchmakeStatusFromValue(const TSharedPtr& value) +{ + return readMatchmakeStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::MatchmakeStatus PlayFab::ClientModels::readMatchmakeStatusFromValue(const FString& value) +{ + static TMap _MatchmakeStatusMap; + if (_MatchmakeStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _MatchmakeStatusMap.Add(TEXT("Complete"), MatchmakeStatusComplete); + _MatchmakeStatusMap.Add(TEXT("Waiting"), MatchmakeStatusWaiting); + _MatchmakeStatusMap.Add(TEXT("GameNotFound"), MatchmakeStatusGameNotFound); + _MatchmakeStatusMap.Add(TEXT("NoAvailableSlots"), MatchmakeStatusNoAvailableSlots); + _MatchmakeStatusMap.Add(TEXT("SessionClosed"), MatchmakeStatusSessionClosed); + + } + + if (!value.IsEmpty()) + { + auto output = _MatchmakeStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return MatchmakeStatusComplete; // Basically critical fail +} + +PlayFab::ClientModels::FMatchmakeResult::~FMatchmakeResult() +{ + +} + +void PlayFab::ClientModels::FMatchmakeResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Expires.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Expires")); writer->WriteValue(Expires); } + + if (LobbyID.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyID")); writer->WriteValue(LobbyID); } + + if (PollWaitTimeMS.notNull()) { writer->WriteIdentifierPrefix(TEXT("PollWaitTimeMS")); writer->WriteValue(PollWaitTimeMS); } + + if (ServerHostname.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerHostname")); writer->WriteValue(ServerHostname); } + + if (ServerIPV4Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV4Address")); writer->WriteValue(ServerIPV4Address); } + + if (ServerIPV6Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV6Address")); writer->WriteValue(ServerIPV6Address); } + + if (ServerPort.notNull()) { writer->WriteIdentifierPrefix(TEXT("ServerPort")); writer->WriteValue(ServerPort); } + + if (ServerPublicDNSName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerPublicDNSName")); writer->WriteValue(ServerPublicDNSName); } + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeMatchmakeStatusEnumJSON(Status, writer); } + + if (Ticket.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Ticket")); writer->WriteValue(Ticket); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FMatchmakeResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid() && !ExpiresValue->IsNull()) + { + FString TmpValue; + if (ExpiresValue->TryGetString(TmpValue)) { Expires = TmpValue; } + } + + const TSharedPtr LobbyIDValue = obj->TryGetField(TEXT("LobbyID")); + if (LobbyIDValue.IsValid() && !LobbyIDValue->IsNull()) + { + FString TmpValue; + if (LobbyIDValue->TryGetString(TmpValue)) { LobbyID = TmpValue; } + } + + const TSharedPtr PollWaitTimeMSValue = obj->TryGetField(TEXT("PollWaitTimeMS")); + if (PollWaitTimeMSValue.IsValid() && !PollWaitTimeMSValue->IsNull()) + { + int32 TmpValue; + if (PollWaitTimeMSValue->TryGetNumber(TmpValue)) { PollWaitTimeMS = TmpValue; } + } + + const TSharedPtr ServerHostnameValue = obj->TryGetField(TEXT("ServerHostname")); + if (ServerHostnameValue.IsValid() && !ServerHostnameValue->IsNull()) + { + FString TmpValue; + if (ServerHostnameValue->TryGetString(TmpValue)) { ServerHostname = TmpValue; } + } + + const TSharedPtr ServerIPV4AddressValue = obj->TryGetField(TEXT("ServerIPV4Address")); + if (ServerIPV4AddressValue.IsValid() && !ServerIPV4AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV4AddressValue->TryGetString(TmpValue)) { ServerIPV4Address = TmpValue; } + } + + const TSharedPtr ServerIPV6AddressValue = obj->TryGetField(TEXT("ServerIPV6Address")); + if (ServerIPV6AddressValue.IsValid() && !ServerIPV6AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV6AddressValue->TryGetString(TmpValue)) { ServerIPV6Address = TmpValue; } + } + + const TSharedPtr ServerPortValue = obj->TryGetField(TEXT("ServerPort")); + if (ServerPortValue.IsValid() && !ServerPortValue->IsNull()) + { + int32 TmpValue; + if (ServerPortValue->TryGetNumber(TmpValue)) { ServerPort = TmpValue; } + } + + const TSharedPtr ServerPublicDNSNameValue = obj->TryGetField(TEXT("ServerPublicDNSName")); + if (ServerPublicDNSNameValue.IsValid() && !ServerPublicDNSNameValue->IsNull()) + { + FString TmpValue; + if (ServerPublicDNSNameValue->TryGetString(TmpValue)) { ServerPublicDNSName = TmpValue; } + } + + Status = readMatchmakeStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr TicketValue = obj->TryGetField(TEXT("Ticket")); + if (TicketValue.IsValid() && !TicketValue->IsNull()) + { + FString TmpValue; + if (TicketValue->TryGetString(TmpValue)) { Ticket = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FModifyUserVirtualCurrencyResult::~FModifyUserVirtualCurrencyResult() +{ + +} + +void PlayFab::ClientModels::FModifyUserVirtualCurrencyResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Balance")); writer->WriteValue(Balance); + + writer->WriteIdentifierPrefix(TEXT("BalanceChange")); writer->WriteValue(BalanceChange); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (VirtualCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FModifyUserVirtualCurrencyResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BalanceValue = obj->TryGetField(TEXT("Balance")); + if (BalanceValue.IsValid() && !BalanceValue->IsNull()) + { + int32 TmpValue; + if (BalanceValue->TryGetNumber(TmpValue)) { Balance = TmpValue; } + } + + const TSharedPtr BalanceChangeValue = obj->TryGetField(TEXT("BalanceChange")); + if (BalanceChangeValue.IsValid() && !BalanceChangeValue->IsNull()) + { + int32 TmpValue; + if (BalanceChangeValue->TryGetNumber(TmpValue)) { BalanceChange = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FOpenTradeRequest::~FOpenTradeRequest() +{ + +} + +void PlayFab::ClientModels::FOpenTradeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AllowedPlayerIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("AllowedPlayerIds")); + for (const FString& item : AllowedPlayerIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (OfferedInventoryInstanceIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("OfferedInventoryInstanceIds")); + for (const FString& item : OfferedInventoryInstanceIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (RequestedCatalogItemIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("RequestedCatalogItemIds")); + for (const FString& item : RequestedCatalogItemIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FOpenTradeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("AllowedPlayerIds"), AllowedPlayerIds); + + obj->TryGetStringArrayField(TEXT("OfferedInventoryInstanceIds"), OfferedInventoryInstanceIds); + + obj->TryGetStringArrayField(TEXT("RequestedCatalogItemIds"), RequestedCatalogItemIds); + + return HasSucceeded; +} + +PlayFab::ClientModels::FOpenTradeResponse::~FOpenTradeResponse() +{ + //if (Trade != nullptr) delete Trade; + +} + +void PlayFab::ClientModels::FOpenTradeResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Trade.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Trade")); Trade->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FOpenTradeResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TradeValue = obj->TryGetField(TEXT("Trade")); + if (TradeValue.IsValid() && !TradeValue->IsNull()) + { + Trade = MakeShareable(new FTradeInfo(TradeValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPayForPurchaseRequest::~FPayForPurchaseRequest() +{ + +} + +void PlayFab::ClientModels::FPayForPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Currency")); writer->WriteValue(Currency); + + writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); + + writer->WriteIdentifierPrefix(TEXT("ProviderName")); writer->WriteValue(ProviderName); + + if (ProviderTransactionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ProviderTransactionId")); writer->WriteValue(ProviderTransactionId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPayForPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyValue = obj->TryGetField(TEXT("Currency")); + if (CurrencyValue.IsValid() && !CurrencyValue->IsNull()) + { + FString TmpValue; + if (CurrencyValue->TryGetString(TmpValue)) { Currency = TmpValue; } + } + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TSharedPtr ProviderNameValue = obj->TryGetField(TEXT("ProviderName")); + if (ProviderNameValue.IsValid() && !ProviderNameValue->IsNull()) + { + FString TmpValue; + if (ProviderNameValue->TryGetString(TmpValue)) { ProviderName = TmpValue; } + } + + const TSharedPtr ProviderTransactionIdValue = obj->TryGetField(TEXT("ProviderTransactionId")); + if (ProviderTransactionIdValue.IsValid() && !ProviderTransactionIdValue->IsNull()) + { + FString TmpValue; + if (ProviderTransactionIdValue->TryGetString(TmpValue)) { ProviderTransactionId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ClientModels::writeTransactionStatusEnumJSON(TransactionStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case TransactionStatusCreateCart: writer->WriteValue(TEXT("CreateCart")); break; + case TransactionStatusInit: writer->WriteValue(TEXT("Init")); break; + case TransactionStatusApproved: writer->WriteValue(TEXT("Approved")); break; + case TransactionStatusSucceeded: writer->WriteValue(TEXT("Succeeded")); break; + case TransactionStatusFailedByProvider: writer->WriteValue(TEXT("FailedByProvider")); break; + case TransactionStatusDisputePending: writer->WriteValue(TEXT("DisputePending")); break; + case TransactionStatusRefundPending: writer->WriteValue(TEXT("RefundPending")); break; + case TransactionStatusRefunded: writer->WriteValue(TEXT("Refunded")); break; + case TransactionStatusRefundFailed: writer->WriteValue(TEXT("RefundFailed")); break; + case TransactionStatusChargedBack: writer->WriteValue(TEXT("ChargedBack")); break; + case TransactionStatusFailedByUber: writer->WriteValue(TEXT("FailedByUber")); break; + case TransactionStatusFailedByPlayFab: writer->WriteValue(TEXT("FailedByPlayFab")); break; + case TransactionStatusRevoked: writer->WriteValue(TEXT("Revoked")); break; + case TransactionStatusTradePending: writer->WriteValue(TEXT("TradePending")); break; + case TransactionStatusTraded: writer->WriteValue(TEXT("Traded")); break; + case TransactionStatusUpgraded: writer->WriteValue(TEXT("Upgraded")); break; + case TransactionStatusStackPending: writer->WriteValue(TEXT("StackPending")); break; + case TransactionStatusStacked: writer->WriteValue(TEXT("Stacked")); break; + case TransactionStatusOther: writer->WriteValue(TEXT("Other")); break; + case TransactionStatusFailed: writer->WriteValue(TEXT("Failed")); break; + } +} + +ClientModels::TransactionStatus PlayFab::ClientModels::readTransactionStatusFromValue(const TSharedPtr& value) +{ + return readTransactionStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ClientModels::TransactionStatus PlayFab::ClientModels::readTransactionStatusFromValue(const FString& value) +{ + static TMap _TransactionStatusMap; + if (_TransactionStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _TransactionStatusMap.Add(TEXT("CreateCart"), TransactionStatusCreateCart); + _TransactionStatusMap.Add(TEXT("Init"), TransactionStatusInit); + _TransactionStatusMap.Add(TEXT("Approved"), TransactionStatusApproved); + _TransactionStatusMap.Add(TEXT("Succeeded"), TransactionStatusSucceeded); + _TransactionStatusMap.Add(TEXT("FailedByProvider"), TransactionStatusFailedByProvider); + _TransactionStatusMap.Add(TEXT("DisputePending"), TransactionStatusDisputePending); + _TransactionStatusMap.Add(TEXT("RefundPending"), TransactionStatusRefundPending); + _TransactionStatusMap.Add(TEXT("Refunded"), TransactionStatusRefunded); + _TransactionStatusMap.Add(TEXT("RefundFailed"), TransactionStatusRefundFailed); + _TransactionStatusMap.Add(TEXT("ChargedBack"), TransactionStatusChargedBack); + _TransactionStatusMap.Add(TEXT("FailedByUber"), TransactionStatusFailedByUber); + _TransactionStatusMap.Add(TEXT("FailedByPlayFab"), TransactionStatusFailedByPlayFab); + _TransactionStatusMap.Add(TEXT("Revoked"), TransactionStatusRevoked); + _TransactionStatusMap.Add(TEXT("TradePending"), TransactionStatusTradePending); + _TransactionStatusMap.Add(TEXT("Traded"), TransactionStatusTraded); + _TransactionStatusMap.Add(TEXT("Upgraded"), TransactionStatusUpgraded); + _TransactionStatusMap.Add(TEXT("StackPending"), TransactionStatusStackPending); + _TransactionStatusMap.Add(TEXT("Stacked"), TransactionStatusStacked); + _TransactionStatusMap.Add(TEXT("Other"), TransactionStatusOther); + _TransactionStatusMap.Add(TEXT("Failed"), TransactionStatusFailed); + + } + + if (!value.IsEmpty()) + { + auto output = _TransactionStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return TransactionStatusCreateCart; // Basically critical fail +} + +PlayFab::ClientModels::FPayForPurchaseResult::~FPayForPurchaseResult() +{ + +} + +void PlayFab::ClientModels::FPayForPurchaseResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CreditApplied")); writer->WriteValue(static_cast(CreditApplied)); + + if (OrderId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); } + + if (ProviderData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ProviderData")); writer->WriteValue(ProviderData); } + + if (ProviderToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ProviderToken")); writer->WriteValue(ProviderToken); } + + if (PurchaseConfirmationPageURL.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PurchaseConfirmationPageURL")); writer->WriteValue(PurchaseConfirmationPageURL); } + + if (PurchaseCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PurchaseCurrency")); writer->WriteValue(PurchaseCurrency); } + + writer->WriteIdentifierPrefix(TEXT("PurchasePrice")); writer->WriteValue(static_cast(PurchasePrice)); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeTransactionStatusEnumJSON(Status, writer); } + + if (VCAmount.Num() != 0) + { + writer->WriteObjectStart(TEXT("VCAmount")); + for (TMap::TConstIterator It(VCAmount); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPayForPurchaseResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CreditAppliedValue = obj->TryGetField(TEXT("CreditApplied")); + if (CreditAppliedValue.IsValid() && !CreditAppliedValue->IsNull()) + { + uint32 TmpValue; + if (CreditAppliedValue->TryGetNumber(TmpValue)) { CreditApplied = TmpValue; } + } + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TSharedPtr ProviderDataValue = obj->TryGetField(TEXT("ProviderData")); + if (ProviderDataValue.IsValid() && !ProviderDataValue->IsNull()) + { + FString TmpValue; + if (ProviderDataValue->TryGetString(TmpValue)) { ProviderData = TmpValue; } + } + + const TSharedPtr ProviderTokenValue = obj->TryGetField(TEXT("ProviderToken")); + if (ProviderTokenValue.IsValid() && !ProviderTokenValue->IsNull()) + { + FString TmpValue; + if (ProviderTokenValue->TryGetString(TmpValue)) { ProviderToken = TmpValue; } + } + + const TSharedPtr PurchaseConfirmationPageURLValue = obj->TryGetField(TEXT("PurchaseConfirmationPageURL")); + if (PurchaseConfirmationPageURLValue.IsValid() && !PurchaseConfirmationPageURLValue->IsNull()) + { + FString TmpValue; + if (PurchaseConfirmationPageURLValue->TryGetString(TmpValue)) { PurchaseConfirmationPageURL = TmpValue; } + } + + const TSharedPtr PurchaseCurrencyValue = obj->TryGetField(TEXT("PurchaseCurrency")); + if (PurchaseCurrencyValue.IsValid() && !PurchaseCurrencyValue->IsNull()) + { + FString TmpValue; + if (PurchaseCurrencyValue->TryGetString(TmpValue)) { PurchaseCurrency = TmpValue; } + } + + const TSharedPtr PurchasePriceValue = obj->TryGetField(TEXT("PurchasePrice")); + if (PurchasePriceValue.IsValid() && !PurchasePriceValue->IsNull()) + { + uint32 TmpValue; + if (PurchasePriceValue->TryGetNumber(TmpValue)) { PurchasePrice = TmpValue; } + } + + Status = readTransactionStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr* VCAmountObject; + if (obj->TryGetObjectField(TEXT("VCAmount"), VCAmountObject)) + { + for (TMap>::TConstIterator It((*VCAmountObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VCAmount.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPaymentOption::~FPaymentOption() +{ + +} + +void PlayFab::ClientModels::FPaymentOption::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Currency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Currency")); writer->WriteValue(Currency); } + + writer->WriteIdentifierPrefix(TEXT("Price")); writer->WriteValue(static_cast(Price)); + + if (ProviderName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ProviderName")); writer->WriteValue(ProviderName); } + + writer->WriteIdentifierPrefix(TEXT("StoreCredit")); writer->WriteValue(static_cast(StoreCredit)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPaymentOption::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyValue = obj->TryGetField(TEXT("Currency")); + if (CurrencyValue.IsValid() && !CurrencyValue->IsNull()) + { + FString TmpValue; + if (CurrencyValue->TryGetString(TmpValue)) { Currency = TmpValue; } + } + + const TSharedPtr PriceValue = obj->TryGetField(TEXT("Price")); + if (PriceValue.IsValid() && !PriceValue->IsNull()) + { + uint32 TmpValue; + if (PriceValue->TryGetNumber(TmpValue)) { Price = TmpValue; } + } + + const TSharedPtr ProviderNameValue = obj->TryGetField(TEXT("ProviderName")); + if (ProviderNameValue.IsValid() && !ProviderNameValue->IsNull()) + { + FString TmpValue; + if (ProviderNameValue->TryGetString(TmpValue)) { ProviderName = TmpValue; } + } + + const TSharedPtr StoreCreditValue = obj->TryGetField(TEXT("StoreCredit")); + if (StoreCreditValue.IsValid() && !StoreCreditValue->IsNull()) + { + uint32 TmpValue; + if (StoreCreditValue->TryGetNumber(TmpValue)) { StoreCredit = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPurchaseItemRequest::~FPurchaseItemRequest() +{ + +} + +void PlayFab::ClientModels::FPurchaseItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + writer->WriteIdentifierPrefix(TEXT("Price")); writer->WriteValue(Price); + + if (StoreId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); } + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPurchaseItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr PriceValue = obj->TryGetField(TEXT("Price")); + if (PriceValue.IsValid() && !PriceValue->IsNull()) + { + int32 TmpValue; + if (PriceValue->TryGetNumber(TmpValue)) { Price = TmpValue; } + } + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FPurchaseItemResult::~FPurchaseItemResult() +{ + +} + +void PlayFab::ClientModels::FPurchaseItemResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Items.Num() != 0) + { + writer->WriteArrayStart(TEXT("Items")); + for (const FItemInstance& item : Items) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FPurchaseItemResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Items")); + for (int32 Idx = 0; Idx < ItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemsArray[Idx]; + Items.Add(FItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FRedeemCouponRequest::~FRedeemCouponRequest() +{ + +} + +void PlayFab::ClientModels::FRedeemCouponRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("CouponCode")); writer->WriteValue(CouponCode); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRedeemCouponRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CouponCodeValue = obj->TryGetField(TEXT("CouponCode")); + if (CouponCodeValue.IsValid() && !CouponCodeValue->IsNull()) + { + FString TmpValue; + if (CouponCodeValue->TryGetString(TmpValue)) { CouponCode = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRedeemCouponResult::~FRedeemCouponResult() +{ + +} + +void PlayFab::ClientModels::FRedeemCouponResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GrantedItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("GrantedItems")); + for (const FItemInstance& item : GrantedItems) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRedeemCouponResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GrantedItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GrantedItems")); + for (int32 Idx = 0; Idx < GrantedItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GrantedItemsArray[Idx]; + GrantedItems.Add(FItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FRegisterForIOSPushNotificationRequest::~FRegisterForIOSPushNotificationRequest() +{ + +} + +void PlayFab::ClientModels::FRegisterForIOSPushNotificationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ConfirmationMessage.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ConfirmationMessage")); writer->WriteValue(ConfirmationMessage); } + + writer->WriteIdentifierPrefix(TEXT("DeviceToken")); writer->WriteValue(DeviceToken); + + if (SendPushNotificationConfirmation.notNull()) { writer->WriteIdentifierPrefix(TEXT("SendPushNotificationConfirmation")); writer->WriteValue(SendPushNotificationConfirmation); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRegisterForIOSPushNotificationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ConfirmationMessageValue = obj->TryGetField(TEXT("ConfirmationMessage")); + if (ConfirmationMessageValue.IsValid() && !ConfirmationMessageValue->IsNull()) + { + FString TmpValue; + if (ConfirmationMessageValue->TryGetString(TmpValue)) { ConfirmationMessage = TmpValue; } + } + + const TSharedPtr DeviceTokenValue = obj->TryGetField(TEXT("DeviceToken")); + if (DeviceTokenValue.IsValid() && !DeviceTokenValue->IsNull()) + { + FString TmpValue; + if (DeviceTokenValue->TryGetString(TmpValue)) { DeviceToken = TmpValue; } + } + + const TSharedPtr SendPushNotificationConfirmationValue = obj->TryGetField(TEXT("SendPushNotificationConfirmation")); + if (SendPushNotificationConfirmationValue.IsValid() && !SendPushNotificationConfirmationValue->IsNull()) + { + bool TmpValue; + if (SendPushNotificationConfirmationValue->TryGetBool(TmpValue)) { SendPushNotificationConfirmation = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRegisterForIOSPushNotificationResult::~FRegisterForIOSPushNotificationResult() +{ + +} + +void PlayFab::ClientModels::FRegisterForIOSPushNotificationResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRegisterForIOSPushNotificationResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FRegisterPlayFabUserRequest::~FRegisterPlayFabUserRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FRegisterPlayFabUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (Password.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Password")); writer->WriteValue(Password); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + if (RequireBothUsernameAndEmail.notNull()) { writer->WriteIdentifierPrefix(TEXT("RequireBothUsernameAndEmail")); writer->WriteValue(RequireBothUsernameAndEmail); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRegisterPlayFabUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PasswordValue = obj->TryGetField(TEXT("Password")); + if (PasswordValue.IsValid() && !PasswordValue->IsNull()) + { + FString TmpValue; + if (PasswordValue->TryGetString(TmpValue)) { Password = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr RequireBothUsernameAndEmailValue = obj->TryGetField(TEXT("RequireBothUsernameAndEmail")); + if (RequireBothUsernameAndEmailValue.IsValid() && !RequireBothUsernameAndEmailValue->IsNull()) + { + bool TmpValue; + if (RequireBothUsernameAndEmailValue->TryGetBool(TmpValue)) { RequireBothUsernameAndEmail = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRegisterPlayFabUserResult::~FRegisterPlayFabUserResult() +{ + //if (EntityToken != nullptr) delete EntityToken; + //if (SettingsForUser != nullptr) delete SettingsForUser; + +} + +void PlayFab::ClientModels::FRegisterPlayFabUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EntityToken.IsValid()) { writer->WriteIdentifierPrefix(TEXT("EntityToken")); EntityToken->writeJSON(writer); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (SessionTicket.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SessionTicket")); writer->WriteValue(SessionTicket); } + + if (SettingsForUser.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SettingsForUser")); SettingsForUser->writeJSON(writer); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRegisterPlayFabUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityTokenValue = obj->TryGetField(TEXT("EntityToken")); + if (EntityTokenValue.IsValid() && !EntityTokenValue->IsNull()) + { + EntityToken = MakeShareable(new FEntityTokenResponse(EntityTokenValue->AsObject())); + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr SessionTicketValue = obj->TryGetField(TEXT("SessionTicket")); + if (SessionTicketValue.IsValid() && !SessionTicketValue->IsNull()) + { + FString TmpValue; + if (SessionTicketValue->TryGetString(TmpValue)) { SessionTicket = TmpValue; } + } + + const TSharedPtr SettingsForUserValue = obj->TryGetField(TEXT("SettingsForUser")); + if (SettingsForUserValue.IsValid() && !SettingsForUserValue->IsNull()) + { + SettingsForUser = MakeShareable(new FUserSettings(SettingsForUserValue->AsObject())); + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRegisterWithWindowsHelloRequest::~FRegisterWithWindowsHelloRequest() +{ + //if (InfoRequestParameters != nullptr) delete InfoRequestParameters; + +} + +void PlayFab::ClientModels::FRegisterWithWindowsHelloRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DeviceName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeviceName")); writer->WriteValue(DeviceName); } + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (InfoRequestParameters.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters->writeJSON(writer); } + + if (LoginTitlePlayerAccountEntity.notNull()) { writer->WriteIdentifierPrefix(TEXT("LoginTitlePlayerAccountEntity")); writer->WriteValue(LoginTitlePlayerAccountEntity); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + if (PublicKey.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PublicKey")); writer->WriteValue(PublicKey); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + if (UserName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UserName")); writer->WriteValue(UserName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRegisterWithWindowsHelloRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DeviceNameValue = obj->TryGetField(TEXT("DeviceName")); + if (DeviceNameValue.IsValid() && !DeviceNameValue->IsNull()) + { + FString TmpValue; + if (DeviceNameValue->TryGetString(TmpValue)) { DeviceName = TmpValue; } + } + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = MakeShareable(new FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject())); + } + + const TSharedPtr LoginTitlePlayerAccountEntityValue = obj->TryGetField(TEXT("LoginTitlePlayerAccountEntity")); + if (LoginTitlePlayerAccountEntityValue.IsValid() && !LoginTitlePlayerAccountEntityValue->IsNull()) + { + bool TmpValue; + if (LoginTitlePlayerAccountEntityValue->TryGetBool(TmpValue)) { LoginTitlePlayerAccountEntity = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr PublicKeyValue = obj->TryGetField(TEXT("PublicKey")); + if (PublicKeyValue.IsValid() && !PublicKeyValue->IsNull()) + { + FString TmpValue; + if (PublicKeyValue->TryGetString(TmpValue)) { PublicKey = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr UserNameValue = obj->TryGetField(TEXT("UserName")); + if (UserNameValue.IsValid() && !UserNameValue->IsNull()) + { + FString TmpValue; + if (UserNameValue->TryGetString(TmpValue)) { UserName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveContactEmailRequest::~FRemoveContactEmailRequest() +{ + +} + +void PlayFab::ClientModels::FRemoveContactEmailRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveContactEmailRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveContactEmailResult::~FRemoveContactEmailResult() +{ + +} + +void PlayFab::ClientModels::FRemoveContactEmailResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveContactEmailResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveFriendRequest::~FRemoveFriendRequest() +{ + +} + +void PlayFab::ClientModels::FRemoveFriendRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveFriendRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveFriendResult::~FRemoveFriendResult() +{ + +} + +void PlayFab::ClientModels::FRemoveFriendResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveFriendResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveGenericIDRequest::~FRemoveGenericIDRequest() +{ + +} + +void PlayFab::ClientModels::FRemoveGenericIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GenericId")); GenericId.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveGenericIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GenericIdValue = obj->TryGetField(TEXT("GenericId")); + if (GenericIdValue.IsValid() && !GenericIdValue->IsNull()) + { + GenericId = FGenericServiceId(GenericIdValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveGenericIDResult::~FRemoveGenericIDResult() +{ + +} + +void PlayFab::ClientModels::FRemoveGenericIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveGenericIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveSharedGroupMembersRequest::~FRemoveSharedGroupMembersRequest() +{ + +} + +void PlayFab::ClientModels::FRemoveSharedGroupMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("PlayFabIds")); + for (const FString& item : PlayFabIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveSharedGroupMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("PlayFabIds"), PlayFabIds); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRemoveSharedGroupMembersResult::~FRemoveSharedGroupMembersResult() +{ + +} + +void PlayFab::ClientModels::FRemoveSharedGroupMembersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRemoveSharedGroupMembersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FReportPlayerClientRequest::~FReportPlayerClientRequest() +{ + +} + +void PlayFab::ClientModels::FReportPlayerClientRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + writer->WriteIdentifierPrefix(TEXT("ReporteeId")); writer->WriteValue(ReporteeId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FReportPlayerClientRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ReporteeIdValue = obj->TryGetField(TEXT("ReporteeId")); + if (ReporteeIdValue.IsValid() && !ReporteeIdValue->IsNull()) + { + FString TmpValue; + if (ReporteeIdValue->TryGetString(TmpValue)) { ReporteeId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FReportPlayerClientResult::~FReportPlayerClientResult() +{ + +} + +void PlayFab::ClientModels::FReportPlayerClientResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("SubmissionsRemaining")); writer->WriteValue(SubmissionsRemaining); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FReportPlayerClientResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SubmissionsRemainingValue = obj->TryGetField(TEXT("SubmissionsRemaining")); + if (SubmissionsRemainingValue.IsValid() && !SubmissionsRemainingValue->IsNull()) + { + int32 TmpValue; + if (SubmissionsRemainingValue->TryGetNumber(TmpValue)) { SubmissionsRemaining = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRestoreIOSPurchasesRequest::~FRestoreIOSPurchasesRequest() +{ + +} + +void PlayFab::ClientModels::FRestoreIOSPurchasesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ReceiptData")); writer->WriteValue(ReceiptData); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRestoreIOSPurchasesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ReceiptDataValue = obj->TryGetField(TEXT("ReceiptData")); + if (ReceiptDataValue.IsValid() && !ReceiptDataValue->IsNull()) + { + FString TmpValue; + if (ReceiptDataValue->TryGetString(TmpValue)) { ReceiptData = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FRestoreIOSPurchasesResult::~FRestoreIOSPurchasesResult() +{ + +} + +void PlayFab::ClientModels::FRestoreIOSPurchasesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FRestoreIOSPurchasesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FSendAccountRecoveryEmailRequest::~FSendAccountRecoveryEmailRequest() +{ + +} + +void PlayFab::ClientModels::FSendAccountRecoveryEmailRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); + + if (EmailTemplateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailTemplateId")); writer->WriteValue(EmailTemplateId); } + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSendAccountRecoveryEmailRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr EmailTemplateIdValue = obj->TryGetField(TEXT("EmailTemplateId")); + if (EmailTemplateIdValue.IsValid() && !EmailTemplateIdValue->IsNull()) + { + FString TmpValue; + if (EmailTemplateIdValue->TryGetString(TmpValue)) { EmailTemplateId = TmpValue; } + } + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FSendAccountRecoveryEmailResult::~FSendAccountRecoveryEmailResult() +{ + +} + +void PlayFab::ClientModels::FSendAccountRecoveryEmailResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSendAccountRecoveryEmailResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FSetFriendTagsRequest::~FSetFriendTagsRequest() +{ + +} + +void PlayFab::ClientModels::FSetFriendTagsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); + + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSetFriendTagsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + return HasSucceeded; +} + +PlayFab::ClientModels::FSetFriendTagsResult::~FSetFriendTagsResult() +{ + +} + +void PlayFab::ClientModels::FSetFriendTagsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSetFriendTagsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FSetPlayerSecretRequest::~FSetPlayerSecretRequest() +{ + +} + +void PlayFab::ClientModels::FSetPlayerSecretRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EncryptedRequest.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EncryptedRequest")); writer->WriteValue(EncryptedRequest); } + + if (PlayerSecret.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSetPlayerSecretRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EncryptedRequestValue = obj->TryGetField(TEXT("EncryptedRequest")); + if (EncryptedRequestValue.IsValid() && !EncryptedRequestValue->IsNull()) + { + FString TmpValue; + if (EncryptedRequestValue->TryGetString(TmpValue)) { EncryptedRequest = TmpValue; } + } + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FSetPlayerSecretResult::~FSetPlayerSecretResult() +{ + +} + +void PlayFab::ClientModels::FSetPlayerSecretResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSetPlayerSecretResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FStartGameRequest::~FStartGameRequest() +{ + +} + +void PlayFab::ClientModels::FStartGameRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("BuildVersion")); writer->WriteValue(BuildVersion); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CustomCommandLineData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomCommandLineData")); writer->WriteValue(CustomCommandLineData); } + + writer->WriteIdentifierPrefix(TEXT("GameMode")); writer->WriteValue(GameMode); + + writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStartGameRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildVersionValue = obj->TryGetField(TEXT("BuildVersion")); + if (BuildVersionValue.IsValid() && !BuildVersionValue->IsNull()) + { + FString TmpValue; + if (BuildVersionValue->TryGetString(TmpValue)) { BuildVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CustomCommandLineDataValue = obj->TryGetField(TEXT("CustomCommandLineData")); + if (CustomCommandLineDataValue.IsValid() && !CustomCommandLineDataValue->IsNull()) + { + FString TmpValue; + if (CustomCommandLineDataValue->TryGetString(TmpValue)) { CustomCommandLineData = TmpValue; } + } + + const TSharedPtr GameModeValue = obj->TryGetField(TEXT("GameMode")); + if (GameModeValue.IsValid() && !GameModeValue->IsNull()) + { + FString TmpValue; + if (GameModeValue->TryGetString(TmpValue)) { GameMode = TmpValue; } + } + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FStartGameResult::~FStartGameResult() +{ + +} + +void PlayFab::ClientModels::FStartGameResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Expires.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Expires")); writer->WriteValue(Expires); } + + if (LobbyID.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyID")); writer->WriteValue(LobbyID); } + + if (Password.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Password")); writer->WriteValue(Password); } + + if (ServerHostname.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerHostname")); writer->WriteValue(ServerHostname); } + + if (ServerIPV4Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV4Address")); writer->WriteValue(ServerIPV4Address); } + + if (ServerIPV6Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV6Address")); writer->WriteValue(ServerIPV6Address); } + + if (ServerPort.notNull()) { writer->WriteIdentifierPrefix(TEXT("ServerPort")); writer->WriteValue(ServerPort); } + + if (ServerPublicDNSName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerPublicDNSName")); writer->WriteValue(ServerPublicDNSName); } + + if (Ticket.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Ticket")); writer->WriteValue(Ticket); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStartGameResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid() && !ExpiresValue->IsNull()) + { + FString TmpValue; + if (ExpiresValue->TryGetString(TmpValue)) { Expires = TmpValue; } + } + + const TSharedPtr LobbyIDValue = obj->TryGetField(TEXT("LobbyID")); + if (LobbyIDValue.IsValid() && !LobbyIDValue->IsNull()) + { + FString TmpValue; + if (LobbyIDValue->TryGetString(TmpValue)) { LobbyID = TmpValue; } + } + + const TSharedPtr PasswordValue = obj->TryGetField(TEXT("Password")); + if (PasswordValue.IsValid() && !PasswordValue->IsNull()) + { + FString TmpValue; + if (PasswordValue->TryGetString(TmpValue)) { Password = TmpValue; } + } + + const TSharedPtr ServerHostnameValue = obj->TryGetField(TEXT("ServerHostname")); + if (ServerHostnameValue.IsValid() && !ServerHostnameValue->IsNull()) + { + FString TmpValue; + if (ServerHostnameValue->TryGetString(TmpValue)) { ServerHostname = TmpValue; } + } + + const TSharedPtr ServerIPV4AddressValue = obj->TryGetField(TEXT("ServerIPV4Address")); + if (ServerIPV4AddressValue.IsValid() && !ServerIPV4AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV4AddressValue->TryGetString(TmpValue)) { ServerIPV4Address = TmpValue; } + } + + const TSharedPtr ServerIPV6AddressValue = obj->TryGetField(TEXT("ServerIPV6Address")); + if (ServerIPV6AddressValue.IsValid() && !ServerIPV6AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV6AddressValue->TryGetString(TmpValue)) { ServerIPV6Address = TmpValue; } + } + + const TSharedPtr ServerPortValue = obj->TryGetField(TEXT("ServerPort")); + if (ServerPortValue.IsValid() && !ServerPortValue->IsNull()) + { + int32 TmpValue; + if (ServerPortValue->TryGetNumber(TmpValue)) { ServerPort = TmpValue; } + } + + const TSharedPtr ServerPublicDNSNameValue = obj->TryGetField(TEXT("ServerPublicDNSName")); + if (ServerPublicDNSNameValue.IsValid() && !ServerPublicDNSNameValue->IsNull()) + { + FString TmpValue; + if (ServerPublicDNSNameValue->TryGetString(TmpValue)) { ServerPublicDNSName = TmpValue; } + } + + const TSharedPtr TicketValue = obj->TryGetField(TEXT("Ticket")); + if (TicketValue.IsValid() && !TicketValue->IsNull()) + { + FString TmpValue; + if (TicketValue->TryGetString(TmpValue)) { Ticket = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FStartPurchaseRequest::~FStartPurchaseRequest() +{ + +} + +void PlayFab::ClientModels::FStartPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("Items")); + for (const FItemPurchaseRequest& item : Items) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + if (StoreId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StoreId")); writer->WriteValue(StoreId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStartPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TArray>&ItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Items")); + for (int32 Idx = 0; Idx < ItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemsArray[Idx]; + Items.Add(FItemPurchaseRequest(CurrentItem->AsObject())); + } + + + const TSharedPtr StoreIdValue = obj->TryGetField(TEXT("StoreId")); + if (StoreIdValue.IsValid() && !StoreIdValue->IsNull()) + { + FString TmpValue; + if (StoreIdValue->TryGetString(TmpValue)) { StoreId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FStartPurchaseResult::~FStartPurchaseResult() +{ + +} + +void PlayFab::ClientModels::FStartPurchaseResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Contents.Num() != 0) + { + writer->WriteArrayStart(TEXT("Contents")); + for (const FCartItem& item : Contents) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (OrderId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OrderId")); writer->WriteValue(OrderId); } + + if (PaymentOptions.Num() != 0) + { + writer->WriteArrayStart(TEXT("PaymentOptions")); + for (const FPaymentOption& item : PaymentOptions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyBalances.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyBalances")); + for (TMap::TConstIterator It(VirtualCurrencyBalances); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStartPurchaseResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ContentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Contents")); + for (int32 Idx = 0; Idx < ContentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContentsArray[Idx]; + Contents.Add(FCartItem(CurrentItem->AsObject())); + } + + + const TSharedPtr OrderIdValue = obj->TryGetField(TEXT("OrderId")); + if (OrderIdValue.IsValid() && !OrderIdValue->IsNull()) + { + FString TmpValue; + if (OrderIdValue->TryGetString(TmpValue)) { OrderId = TmpValue; } + } + + const TArray>&PaymentOptionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PaymentOptions")); + for (int32 Idx = 0; Idx < PaymentOptionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PaymentOptionsArray[Idx]; + PaymentOptions.Add(FPaymentOption(CurrentItem->AsObject())); + } + + + const TSharedPtr* VirtualCurrencyBalancesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyBalances"), VirtualCurrencyBalancesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyBalancesObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyBalances.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FStatisticUpdate::~FStatisticUpdate() +{ + +} + +void PlayFab::ClientModels::FStatisticUpdate::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FStatisticUpdate::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FSubtractUserVirtualCurrencyRequest::~FSubtractUserVirtualCurrencyRequest() +{ + +} + +void PlayFab::ClientModels::FSubtractUserVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FSubtractUserVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkAndroidDeviceIDRequest::~FUnlinkAndroidDeviceIDRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkAndroidDeviceIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceId")); writer->WriteValue(AndroidDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkAndroidDeviceIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceIdValue = obj->TryGetField(TEXT("AndroidDeviceId")); + if (AndroidDeviceIdValue.IsValid() && !AndroidDeviceIdValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceIdValue->TryGetString(TmpValue)) { AndroidDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkAndroidDeviceIDResult::~FUnlinkAndroidDeviceIDResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkAndroidDeviceIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkAndroidDeviceIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkCustomIDRequest::~FUnlinkCustomIDRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkCustomIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CustomId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomId")); writer->WriteValue(CustomId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkCustomIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomIdValue = obj->TryGetField(TEXT("CustomId")); + if (CustomIdValue.IsValid() && !CustomIdValue->IsNull()) + { + FString TmpValue; + if (CustomIdValue->TryGetString(TmpValue)) { CustomId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkCustomIDResult::~FUnlinkCustomIDResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkCustomIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkCustomIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkFacebookAccountRequest::~FUnlinkFacebookAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkFacebookAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkFacebookAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkFacebookAccountResult::~FUnlinkFacebookAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkFacebookAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkFacebookAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkFacebookInstantGamesIdRequest::~FUnlinkFacebookInstantGamesIdRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkFacebookInstantGamesIdRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookInstantGamesId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesId")); writer->WriteValue(FacebookInstantGamesId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkFacebookInstantGamesIdRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesIdValue = obj->TryGetField(TEXT("FacebookInstantGamesId")); + if (FacebookInstantGamesIdValue.IsValid() && !FacebookInstantGamesIdValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesIdValue->TryGetString(TmpValue)) { FacebookInstantGamesId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkFacebookInstantGamesIdResult::~FUnlinkFacebookInstantGamesIdResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkFacebookInstantGamesIdResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkFacebookInstantGamesIdResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkGameCenterAccountRequest::~FUnlinkGameCenterAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkGameCenterAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkGameCenterAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkGameCenterAccountResult::~FUnlinkGameCenterAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkGameCenterAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkGameCenterAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkGoogleAccountRequest::~FUnlinkGoogleAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkGoogleAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkGoogleAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkGoogleAccountResult::~FUnlinkGoogleAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkGoogleAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkGoogleAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkIOSDeviceIDRequest::~FUnlinkIOSDeviceIDRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkIOSDeviceIDRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DeviceId")); writer->WriteValue(DeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkIOSDeviceIDRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DeviceIdValue = obj->TryGetField(TEXT("DeviceId")); + if (DeviceIdValue.IsValid() && !DeviceIdValue->IsNull()) + { + FString TmpValue; + if (DeviceIdValue->TryGetString(TmpValue)) { DeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkIOSDeviceIDResult::~FUnlinkIOSDeviceIDResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkIOSDeviceIDResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkIOSDeviceIDResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkKongregateAccountRequest::~FUnlinkKongregateAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkKongregateAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkKongregateAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkKongregateAccountResult::~FUnlinkKongregateAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkKongregateAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkKongregateAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkNintendoSwitchDeviceIdRequest::~FUnlinkNintendoSwitchDeviceIdRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkNintendoSwitchDeviceIdRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkNintendoSwitchDeviceIdRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkNintendoSwitchDeviceIdResult::~FUnlinkNintendoSwitchDeviceIdResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkNintendoSwitchDeviceIdResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkNintendoSwitchDeviceIdResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkSteamAccountRequest::~FUnlinkSteamAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkSteamAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkSteamAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkSteamAccountResult::~FUnlinkSteamAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkSteamAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkSteamAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkTwitchAccountRequest::~FUnlinkTwitchAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkTwitchAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkTwitchAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkTwitchAccountResult::~FUnlinkTwitchAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkTwitchAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkTwitchAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkWindowsHelloAccountRequest::~FUnlinkWindowsHelloAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkWindowsHelloAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PublicKeyHint")); writer->WriteValue(PublicKeyHint); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkWindowsHelloAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PublicKeyHintValue = obj->TryGetField(TEXT("PublicKeyHint")); + if (PublicKeyHintValue.IsValid() && !PublicKeyHintValue->IsNull()) + { + FString TmpValue; + if (PublicKeyHintValue->TryGetString(TmpValue)) { PublicKeyHint = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkWindowsHelloAccountResponse::~FUnlinkWindowsHelloAccountResponse() +{ + +} + +void PlayFab::ClientModels::FUnlinkWindowsHelloAccountResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkWindowsHelloAccountResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkXboxAccountRequest::~FUnlinkXboxAccountRequest() +{ + +} + +void PlayFab::ClientModels::FUnlinkXboxAccountRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkXboxAccountRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlinkXboxAccountResult::~FUnlinkXboxAccountResult() +{ + +} + +void PlayFab::ClientModels::FUnlinkXboxAccountResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlinkXboxAccountResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlockContainerInstanceRequest::~FUnlockContainerInstanceRequest() +{ + +} + +void PlayFab::ClientModels::FUnlockContainerInstanceRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ContainerItemInstanceId")); writer->WriteValue(ContainerItemInstanceId); + + if (KeyItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KeyItemInstanceId")); writer->WriteValue(KeyItemInstanceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlockContainerInstanceRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ContainerItemInstanceIdValue = obj->TryGetField(TEXT("ContainerItemInstanceId")); + if (ContainerItemInstanceIdValue.IsValid() && !ContainerItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ContainerItemInstanceIdValue->TryGetString(TmpValue)) { ContainerItemInstanceId = TmpValue; } + } + + const TSharedPtr KeyItemInstanceIdValue = obj->TryGetField(TEXT("KeyItemInstanceId")); + if (KeyItemInstanceIdValue.IsValid() && !KeyItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (KeyItemInstanceIdValue->TryGetString(TmpValue)) { KeyItemInstanceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlockContainerItemRequest::~FUnlockContainerItemRequest() +{ + +} + +void PlayFab::ClientModels::FUnlockContainerItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ContainerItemId")); writer->WriteValue(ContainerItemId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlockContainerItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ContainerItemIdValue = obj->TryGetField(TEXT("ContainerItemId")); + if (ContainerItemIdValue.IsValid() && !ContainerItemIdValue->IsNull()) + { + FString TmpValue; + if (ContainerItemIdValue->TryGetString(TmpValue)) { ContainerItemId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUnlockContainerItemResult::~FUnlockContainerItemResult() +{ + +} + +void PlayFab::ClientModels::FUnlockContainerItemResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GrantedItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("GrantedItems")); + for (const FItemInstance& item : GrantedItems) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (UnlockedItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnlockedItemInstanceId")); writer->WriteValue(UnlockedItemInstanceId); } + + if (UnlockedWithItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnlockedWithItemInstanceId")); writer->WriteValue(UnlockedWithItemInstanceId); } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUnlockContainerItemResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GrantedItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GrantedItems")); + for (int32 Idx = 0; Idx < GrantedItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GrantedItemsArray[Idx]; + GrantedItems.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr UnlockedItemInstanceIdValue = obj->TryGetField(TEXT("UnlockedItemInstanceId")); + if (UnlockedItemInstanceIdValue.IsValid() && !UnlockedItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (UnlockedItemInstanceIdValue->TryGetString(TmpValue)) { UnlockedItemInstanceId = TmpValue; } + } + + const TSharedPtr UnlockedWithItemInstanceIdValue = obj->TryGetField(TEXT("UnlockedWithItemInstanceId")); + if (UnlockedWithItemInstanceIdValue.IsValid() && !UnlockedWithItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (UnlockedWithItemInstanceIdValue->TryGetString(TmpValue)) { UnlockedWithItemInstanceId = TmpValue; } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateAvatarUrlRequest::~FUpdateAvatarUrlRequest() +{ + +} + +void PlayFab::ClientModels::FUpdateAvatarUrlRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ImageUrl")); writer->WriteValue(ImageUrl); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateAvatarUrlRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ImageUrlValue = obj->TryGetField(TEXT("ImageUrl")); + if (ImageUrlValue.IsValid() && !ImageUrlValue->IsNull()) + { + FString TmpValue; + if (ImageUrlValue->TryGetString(TmpValue)) { ImageUrl = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateCharacterDataRequest::~FUpdateCharacterDataRequest() +{ + +} + +void PlayFab::ClientModels::FUpdateCharacterDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateCharacterDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateCharacterDataResult::~FUpdateCharacterDataResult() +{ + +} + +void PlayFab::ClientModels::FUpdateCharacterDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateCharacterDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateCharacterStatisticsRequest::~FUpdateCharacterStatisticsRequest() +{ + +} + +void PlayFab::ClientModels::FUpdateCharacterStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (CharacterStatistics.Num() != 0) + { + writer->WriteObjectStart(TEXT("CharacterStatistics")); + for (TMap::TConstIterator It(CharacterStatistics); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateCharacterStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* CharacterStatisticsObject; + if (obj->TryGetObjectField(TEXT("CharacterStatistics"), CharacterStatisticsObject)) + { + for (TMap>::TConstIterator It((*CharacterStatisticsObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + CharacterStatistics.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateCharacterStatisticsResult::~FUpdateCharacterStatisticsResult() +{ + +} + +void PlayFab::ClientModels::FUpdateCharacterStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateCharacterStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdatePlayerStatisticsRequest::~FUpdatePlayerStatisticsRequest() +{ + +} + +void PlayFab::ClientModels::FUpdatePlayerStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticUpdate& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdatePlayerStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticUpdate(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdatePlayerStatisticsResult::~FUpdatePlayerStatisticsResult() +{ + +} + +void PlayFab::ClientModels::FUpdatePlayerStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdatePlayerStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateSharedGroupDataRequest::~FUpdateSharedGroupDataRequest() +{ + +} + +void PlayFab::ClientModels::FUpdateSharedGroupDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateSharedGroupDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateSharedGroupDataResult::~FUpdateSharedGroupDataResult() +{ + +} + +void PlayFab::ClientModels::FUpdateSharedGroupDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateSharedGroupDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateUserDataRequest::~FUpdateUserDataRequest() +{ + +} + +void PlayFab::ClientModels::FUpdateUserDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateUserDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateUserDataResult::~FUpdateUserDataResult() +{ + +} + +void PlayFab::ClientModels::FUpdateUserDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateUserDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateUserTitleDisplayNameRequest::~FUpdateUserTitleDisplayNameRequest() +{ + +} + +void PlayFab::ClientModels::FUpdateUserTitleDisplayNameRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateUserTitleDisplayNameRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FUpdateUserTitleDisplayNameResult::~FUpdateUserTitleDisplayNameResult() +{ + +} + +void PlayFab::ClientModels::FUpdateUserTitleDisplayNameResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FUpdateUserTitleDisplayNameResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateAmazonReceiptRequest::~FValidateAmazonReceiptRequest() +{ + +} + +void PlayFab::ClientModels::FValidateAmazonReceiptRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("CurrencyCode")); writer->WriteValue(CurrencyCode); + + writer->WriteIdentifierPrefix(TEXT("PurchasePrice")); writer->WriteValue(PurchasePrice); + + writer->WriteIdentifierPrefix(TEXT("ReceiptId")); writer->WriteValue(ReceiptId); + + writer->WriteIdentifierPrefix(TEXT("UserId")); writer->WriteValue(UserId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateAmazonReceiptRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CurrencyCodeValue = obj->TryGetField(TEXT("CurrencyCode")); + if (CurrencyCodeValue.IsValid() && !CurrencyCodeValue->IsNull()) + { + FString TmpValue; + if (CurrencyCodeValue->TryGetString(TmpValue)) { CurrencyCode = TmpValue; } + } + + const TSharedPtr PurchasePriceValue = obj->TryGetField(TEXT("PurchasePrice")); + if (PurchasePriceValue.IsValid() && !PurchasePriceValue->IsNull()) + { + int32 TmpValue; + if (PurchasePriceValue->TryGetNumber(TmpValue)) { PurchasePrice = TmpValue; } + } + + const TSharedPtr ReceiptIdValue = obj->TryGetField(TEXT("ReceiptId")); + if (ReceiptIdValue.IsValid() && !ReceiptIdValue->IsNull()) + { + FString TmpValue; + if (ReceiptIdValue->TryGetString(TmpValue)) { ReceiptId = TmpValue; } + } + + const TSharedPtr UserIdValue = obj->TryGetField(TEXT("UserId")); + if (UserIdValue.IsValid() && !UserIdValue->IsNull()) + { + FString TmpValue; + if (UserIdValue->TryGetString(TmpValue)) { UserId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateAmazonReceiptResult::~FValidateAmazonReceiptResult() +{ + +} + +void PlayFab::ClientModels::FValidateAmazonReceiptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateAmazonReceiptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateGooglePlayPurchaseRequest::~FValidateGooglePlayPurchaseRequest() +{ + +} + +void PlayFab::ClientModels::FValidateGooglePlayPurchaseRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CurrencyCode.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CurrencyCode")); writer->WriteValue(CurrencyCode); } + + if (PurchasePrice.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchasePrice")); writer->WriteValue(static_cast(PurchasePrice)); } + + writer->WriteIdentifierPrefix(TEXT("ReceiptJson")); writer->WriteValue(ReceiptJson); + + writer->WriteIdentifierPrefix(TEXT("Signature")); writer->WriteValue(Signature); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateGooglePlayPurchaseRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyCodeValue = obj->TryGetField(TEXT("CurrencyCode")); + if (CurrencyCodeValue.IsValid() && !CurrencyCodeValue->IsNull()) + { + FString TmpValue; + if (CurrencyCodeValue->TryGetString(TmpValue)) { CurrencyCode = TmpValue; } + } + + const TSharedPtr PurchasePriceValue = obj->TryGetField(TEXT("PurchasePrice")); + if (PurchasePriceValue.IsValid() && !PurchasePriceValue->IsNull()) + { + uint32 TmpValue; + if (PurchasePriceValue->TryGetNumber(TmpValue)) { PurchasePrice = TmpValue; } + } + + const TSharedPtr ReceiptJsonValue = obj->TryGetField(TEXT("ReceiptJson")); + if (ReceiptJsonValue.IsValid() && !ReceiptJsonValue->IsNull()) + { + FString TmpValue; + if (ReceiptJsonValue->TryGetString(TmpValue)) { ReceiptJson = TmpValue; } + } + + const TSharedPtr SignatureValue = obj->TryGetField(TEXT("Signature")); + if (SignatureValue.IsValid() && !SignatureValue->IsNull()) + { + FString TmpValue; + if (SignatureValue->TryGetString(TmpValue)) { Signature = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateGooglePlayPurchaseResult::~FValidateGooglePlayPurchaseResult() +{ + +} + +void PlayFab::ClientModels::FValidateGooglePlayPurchaseResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateGooglePlayPurchaseResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateIOSReceiptRequest::~FValidateIOSReceiptRequest() +{ + +} + +void PlayFab::ClientModels::FValidateIOSReceiptRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CurrencyCode")); writer->WriteValue(CurrencyCode); + + writer->WriteIdentifierPrefix(TEXT("PurchasePrice")); writer->WriteValue(PurchasePrice); + + writer->WriteIdentifierPrefix(TEXT("ReceiptData")); writer->WriteValue(ReceiptData); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateIOSReceiptRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyCodeValue = obj->TryGetField(TEXT("CurrencyCode")); + if (CurrencyCodeValue.IsValid() && !CurrencyCodeValue->IsNull()) + { + FString TmpValue; + if (CurrencyCodeValue->TryGetString(TmpValue)) { CurrencyCode = TmpValue; } + } + + const TSharedPtr PurchasePriceValue = obj->TryGetField(TEXT("PurchasePrice")); + if (PurchasePriceValue.IsValid() && !PurchasePriceValue->IsNull()) + { + int32 TmpValue; + if (PurchasePriceValue->TryGetNumber(TmpValue)) { PurchasePrice = TmpValue; } + } + + const TSharedPtr ReceiptDataValue = obj->TryGetField(TEXT("ReceiptData")); + if (ReceiptDataValue.IsValid() && !ReceiptDataValue->IsNull()) + { + FString TmpValue; + if (ReceiptDataValue->TryGetString(TmpValue)) { ReceiptData = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateIOSReceiptResult::~FValidateIOSReceiptResult() +{ + +} + +void PlayFab::ClientModels::FValidateIOSReceiptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateIOSReceiptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateWindowsReceiptRequest::~FValidateWindowsReceiptRequest() +{ + +} + +void PlayFab::ClientModels::FValidateWindowsReceiptRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("CurrencyCode")); writer->WriteValue(CurrencyCode); + + writer->WriteIdentifierPrefix(TEXT("PurchasePrice")); writer->WriteValue(static_cast(PurchasePrice)); + + writer->WriteIdentifierPrefix(TEXT("Receipt")); writer->WriteValue(Receipt); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateWindowsReceiptRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CurrencyCodeValue = obj->TryGetField(TEXT("CurrencyCode")); + if (CurrencyCodeValue.IsValid() && !CurrencyCodeValue->IsNull()) + { + FString TmpValue; + if (CurrencyCodeValue->TryGetString(TmpValue)) { CurrencyCode = TmpValue; } + } + + const TSharedPtr PurchasePriceValue = obj->TryGetField(TEXT("PurchasePrice")); + if (PurchasePriceValue.IsValid() && !PurchasePriceValue->IsNull()) + { + uint32 TmpValue; + if (PurchasePriceValue->TryGetNumber(TmpValue)) { PurchasePrice = TmpValue; } + } + + const TSharedPtr ReceiptValue = obj->TryGetField(TEXT("Receipt")); + if (ReceiptValue.IsValid() && !ReceiptValue->IsNull()) + { + FString TmpValue; + if (ReceiptValue->TryGetString(TmpValue)) { Receipt = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FValidateWindowsReceiptResult::~FValidateWindowsReceiptResult() +{ + +} + +void PlayFab::ClientModels::FValidateWindowsReceiptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FValidateWindowsReceiptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ClientModels::FWriteClientCharacterEventRequest::~FWriteClientCharacterEventRequest() +{ + +} + +void PlayFab::ClientModels::FWriteClientCharacterEventRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.Num() != 0) + { + writer->WriteObjectStart(TEXT("Body")); + for (TMap::TConstIterator It(Body); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("EventName")); writer->WriteValue(EventName); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FWriteClientCharacterEventRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* BodyObject; + if (obj->TryGetObjectField(TEXT("Body"), BodyObject)) + { + for (TMap>::TConstIterator It((*BodyObject)->Values); It; ++It) + { + Body.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr EventNameValue = obj->TryGetField(TEXT("EventName")); + if (EventNameValue.IsValid() && !EventNameValue->IsNull()) + { + FString TmpValue; + if (EventNameValue->TryGetString(TmpValue)) { EventName = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + +PlayFab::ClientModels::FWriteClientPlayerEventRequest::~FWriteClientPlayerEventRequest() +{ + +} + +void PlayFab::ClientModels::FWriteClientPlayerEventRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.Num() != 0) + { + writer->WriteObjectStart(TEXT("Body")); + for (TMap::TConstIterator It(Body); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("EventName")); writer->WriteValue(EventName); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FWriteClientPlayerEventRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* BodyObject; + if (obj->TryGetObjectField(TEXT("Body"), BodyObject)) + { + for (TMap>::TConstIterator It((*BodyObject)->Values); It; ++It) + { + Body.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + const TSharedPtr EventNameValue = obj->TryGetField(TEXT("EventName")); + if (EventNameValue.IsValid() && !EventNameValue->IsNull()) + { + FString TmpValue; + if (EventNameValue->TryGetString(TmpValue)) { EventName = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + +PlayFab::ClientModels::FWriteEventResponse::~FWriteEventResponse() +{ + +} + +void PlayFab::ClientModels::FWriteEventResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EventId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EventId")); writer->WriteValue(EventId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FWriteEventResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EventIdValue = obj->TryGetField(TEXT("EventId")); + if (EventIdValue.IsValid() && !EventIdValue->IsNull()) + { + FString TmpValue; + if (EventIdValue->TryGetString(TmpValue)) { EventId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ClientModels::FWriteTitleEventRequest::~FWriteTitleEventRequest() +{ + +} + +void PlayFab::ClientModels::FWriteTitleEventRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.Num() != 0) + { + writer->WriteObjectStart(TEXT("Body")); + for (TMap::TConstIterator It(Body); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("EventName")); writer->WriteValue(EventName); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ClientModels::FWriteTitleEventRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* BodyObject; + if (obj->TryGetObjectField(TEXT("Body"), BodyObject)) + { + for (TMap>::TConstIterator It((*BodyObject)->Values); It; ++It) + { + Body.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + const TSharedPtr EventNameValue = obj->TryGetField(TEXT("EventName")); + if (EventNameValue.IsValid() && !EventNameValue->IsNull()) + { + FString TmpValue; + if (EventNameValue->TryGetString(TmpValue)) { EventName = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabCloudScriptAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabCloudScriptAPI.cpp new file mode 100644 index 000000000..0b29d4df0 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabCloudScriptAPI.cpp @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabCloudScriptAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::CloudScriptModels; + +UPlayFabCloudScriptAPI::UPlayFabCloudScriptAPI() {} + +UPlayFabCloudScriptAPI::~UPlayFabCloudScriptAPI() {} + +int UPlayFabCloudScriptAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabCloudScriptAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabCloudScriptAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabCloudScriptAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabCloudScriptAPI::ExecuteEntityCloudScript( + CloudScriptModels::FExecuteEntityCloudScriptRequest& request, + const FExecuteEntityCloudScriptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/CloudScript/ExecuteEntityCloudScript")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabCloudScriptAPI::OnExecuteEntityCloudScriptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabCloudScriptAPI::OnExecuteEntityCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExecuteEntityCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + CloudScriptModels::FExecuteCloudScriptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabCloudScriptDataModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabCloudScriptDataModels.cpp new file mode 100644 index 000000000..e16b18e20 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabCloudScriptDataModels.cpp @@ -0,0 +1,380 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabCloudScriptDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::CloudScriptModels; + +void PlayFab::CloudScriptModels::writeCloudScriptRevisionOptionEnumJSON(CloudScriptRevisionOption enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CloudScriptRevisionOptionLive: writer->WriteValue(TEXT("Live")); break; + case CloudScriptRevisionOptionLatest: writer->WriteValue(TEXT("Latest")); break; + case CloudScriptRevisionOptionSpecific: writer->WriteValue(TEXT("Specific")); break; + } +} + +CloudScriptModels::CloudScriptRevisionOption PlayFab::CloudScriptModels::readCloudScriptRevisionOptionFromValue(const TSharedPtr& value) +{ + return readCloudScriptRevisionOptionFromValue(value.IsValid() ? value->AsString() : ""); +} + +CloudScriptModels::CloudScriptRevisionOption PlayFab::CloudScriptModels::readCloudScriptRevisionOptionFromValue(const FString& value) +{ + static TMap _CloudScriptRevisionOptionMap; + if (_CloudScriptRevisionOptionMap.Num() == 0) + { + // Auto-generate the map on the first use + _CloudScriptRevisionOptionMap.Add(TEXT("Live"), CloudScriptRevisionOptionLive); + _CloudScriptRevisionOptionMap.Add(TEXT("Latest"), CloudScriptRevisionOptionLatest); + _CloudScriptRevisionOptionMap.Add(TEXT("Specific"), CloudScriptRevisionOptionSpecific); + + } + + if (!value.IsEmpty()) + { + auto output = _CloudScriptRevisionOptionMap.Find(value); + if (output != nullptr) + return *output; + } + + return CloudScriptRevisionOptionLive; // Basically critical fail +} + +PlayFab::CloudScriptModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::CloudScriptModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::CloudScriptModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::CloudScriptModels::FScriptExecutionError::~FScriptExecutionError() +{ + +} + +void PlayFab::CloudScriptModels::FScriptExecutionError::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + if (StackTrace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StackTrace")); writer->WriteValue(StackTrace); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::CloudScriptModels::FScriptExecutionError::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + const TSharedPtr StackTraceValue = obj->TryGetField(TEXT("StackTrace")); + if (StackTraceValue.IsValid() && !StackTraceValue->IsNull()) + { + FString TmpValue; + if (StackTraceValue->TryGetString(TmpValue)) { StackTrace = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::CloudScriptModels::FLogStatement::~FLogStatement() +{ + +} + +void PlayFab::CloudScriptModels::FLogStatement::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.notNull()) { writer->WriteIdentifierPrefix(TEXT("Data")); Data.writeJSON(writer); } + + if (Level.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Level")); writer->WriteValue(Level); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::CloudScriptModels::FLogStatement::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataValue = obj->TryGetField(TEXT("Data")); + if (DataValue.IsValid() && !DataValue->IsNull()) + { + Data = FJsonKeeper(DataValue); + } + + const TSharedPtr LevelValue = obj->TryGetField(TEXT("Level")); + if (LevelValue.IsValid() && !LevelValue->IsNull()) + { + FString TmpValue; + if (LevelValue->TryGetString(TmpValue)) { Level = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::CloudScriptModels::FExecuteCloudScriptResult::~FExecuteCloudScriptResult() +{ + //if (Error != nullptr) delete Error; + +} + +void PlayFab::CloudScriptModels::FExecuteCloudScriptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("APIRequestsIssued")); writer->WriteValue(APIRequestsIssued); + + if (Error.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Error")); Error->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ExecutionTimeSeconds")); writer->WriteValue(ExecutionTimeSeconds); + + if (FunctionName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); } + + if (FunctionResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResult")); FunctionResult.writeJSON(writer); } + + if (FunctionResultTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResultTooLarge")); writer->WriteValue(FunctionResultTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("HttpRequestsIssued")); writer->WriteValue(HttpRequestsIssued); + + if (Logs.Num() != 0) + { + writer->WriteArrayStart(TEXT("Logs")); + for (const FLogStatement& item : Logs) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (LogsTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("LogsTooLarge")); writer->WriteValue(LogsTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("MemoryConsumedBytes")); writer->WriteValue(static_cast(MemoryConsumedBytes)); + + writer->WriteIdentifierPrefix(TEXT("ProcessorTimeSeconds")); writer->WriteValue(ProcessorTimeSeconds); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteObjectEnd(); +} + +bool PlayFab::CloudScriptModels::FExecuteCloudScriptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr APIRequestsIssuedValue = obj->TryGetField(TEXT("APIRequestsIssued")); + if (APIRequestsIssuedValue.IsValid() && !APIRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (APIRequestsIssuedValue->TryGetNumber(TmpValue)) { APIRequestsIssued = TmpValue; } + } + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + Error = MakeShareable(new FScriptExecutionError(ErrorValue->AsObject())); + } + + const TSharedPtr ExecutionTimeSecondsValue = obj->TryGetField(TEXT("ExecutionTimeSeconds")); + if (ExecutionTimeSecondsValue.IsValid() && !ExecutionTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ExecutionTimeSecondsValue->TryGetNumber(TmpValue)) { ExecutionTimeSeconds = TmpValue; } + } + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionResultValue = obj->TryGetField(TEXT("FunctionResult")); + if (FunctionResultValue.IsValid() && !FunctionResultValue->IsNull()) + { + FunctionResult = FJsonKeeper(FunctionResultValue); + } + + const TSharedPtr FunctionResultTooLargeValue = obj->TryGetField(TEXT("FunctionResultTooLarge")); + if (FunctionResultTooLargeValue.IsValid() && !FunctionResultTooLargeValue->IsNull()) + { + bool TmpValue; + if (FunctionResultTooLargeValue->TryGetBool(TmpValue)) { FunctionResultTooLarge = TmpValue; } + } + + const TSharedPtr HttpRequestsIssuedValue = obj->TryGetField(TEXT("HttpRequestsIssued")); + if (HttpRequestsIssuedValue.IsValid() && !HttpRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (HttpRequestsIssuedValue->TryGetNumber(TmpValue)) { HttpRequestsIssued = TmpValue; } + } + + const TArray>&LogsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Logs")); + for (int32 Idx = 0; Idx < LogsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LogsArray[Idx]; + Logs.Add(FLogStatement(CurrentItem->AsObject())); + } + + + const TSharedPtr LogsTooLargeValue = obj->TryGetField(TEXT("LogsTooLarge")); + if (LogsTooLargeValue.IsValid() && !LogsTooLargeValue->IsNull()) + { + bool TmpValue; + if (LogsTooLargeValue->TryGetBool(TmpValue)) { LogsTooLarge = TmpValue; } + } + + const TSharedPtr MemoryConsumedBytesValue = obj->TryGetField(TEXT("MemoryConsumedBytes")); + if (MemoryConsumedBytesValue.IsValid() && !MemoryConsumedBytesValue->IsNull()) + { + uint32 TmpValue; + if (MemoryConsumedBytesValue->TryGetNumber(TmpValue)) { MemoryConsumedBytes = TmpValue; } + } + + const TSharedPtr ProcessorTimeSecondsValue = obj->TryGetField(TEXT("ProcessorTimeSeconds")); + if (ProcessorTimeSecondsValue.IsValid() && !ProcessorTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ProcessorTimeSecondsValue->TryGetNumber(TmpValue)) { ProcessorTimeSeconds = TmpValue; } + } + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::CloudScriptModels::FExecuteEntityCloudScriptRequest::~FExecuteEntityCloudScriptRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::CloudScriptModels::FExecuteEntityCloudScriptRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); + + if (FunctionParameter.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionParameter")); FunctionParameter.writeJSON(writer); } + + if (GeneratePlayStreamEvent.notNull()) { writer->WriteIdentifierPrefix(TEXT("GeneratePlayStreamEvent")); writer->WriteValue(GeneratePlayStreamEvent); } + + if (RevisionSelection.notNull()) { writer->WriteIdentifierPrefix(TEXT("RevisionSelection")); writeCloudScriptRevisionOptionEnumJSON(RevisionSelection, writer); } + + if (SpecificRevision.notNull()) { writer->WriteIdentifierPrefix(TEXT("SpecificRevision")); writer->WriteValue(SpecificRevision); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::CloudScriptModels::FExecuteEntityCloudScriptRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionParameterValue = obj->TryGetField(TEXT("FunctionParameter")); + if (FunctionParameterValue.IsValid() && !FunctionParameterValue->IsNull()) + { + FunctionParameter = FJsonKeeper(FunctionParameterValue); + } + + const TSharedPtr GeneratePlayStreamEventValue = obj->TryGetField(TEXT("GeneratePlayStreamEvent")); + if (GeneratePlayStreamEventValue.IsValid() && !GeneratePlayStreamEventValue->IsNull()) + { + bool TmpValue; + if (GeneratePlayStreamEventValue->TryGetBool(TmpValue)) { GeneratePlayStreamEvent = TmpValue; } + } + + RevisionSelection = readCloudScriptRevisionOptionFromValue(obj->TryGetField(TEXT("RevisionSelection"))); + + const TSharedPtr SpecificRevisionValue = obj->TryGetField(TEXT("SpecificRevision")); + if (SpecificRevisionValue.IsValid() && !SpecificRevisionValue->IsNull()) + { + int32 TmpValue; + if (SpecificRevisionValue->TryGetNumber(TmpValue)) { SpecificRevision = TmpValue; } + } + + return HasSucceeded; +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabDataAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabDataAPI.cpp new file mode 100644 index 000000000..8f8fc07dd --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabDataAPI.cpp @@ -0,0 +1,227 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabDataAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::DataModels; + +UPlayFabDataAPI::UPlayFabDataAPI() {} + +UPlayFabDataAPI::~UPlayFabDataAPI() {} + +int UPlayFabDataAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabDataAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabDataAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabDataAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabDataAPI::AbortFileUploads( + DataModels::FAbortFileUploadsRequest& request, + const FAbortFileUploadsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/File/AbortFileUploads")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnAbortFileUploadsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnAbortFileUploadsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAbortFileUploadsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FAbortFileUploadsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabDataAPI::DeleteFiles( + DataModels::FDeleteFilesRequest& request, + const FDeleteFilesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/File/DeleteFiles")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnDeleteFilesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnDeleteFilesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteFilesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FDeleteFilesResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabDataAPI::FinalizeFileUploads( + DataModels::FFinalizeFileUploadsRequest& request, + const FFinalizeFileUploadsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/File/FinalizeFileUploads")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnFinalizeFileUploadsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnFinalizeFileUploadsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFinalizeFileUploadsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FFinalizeFileUploadsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabDataAPI::GetFiles( + DataModels::FGetFilesRequest& request, + const FGetFilesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/File/GetFiles")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnGetFilesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnGetFilesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFilesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FGetFilesResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabDataAPI::GetObjects( + DataModels::FGetObjectsRequest& request, + const FGetObjectsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Object/GetObjects")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnGetObjectsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnGetObjectsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetObjectsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FGetObjectsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabDataAPI::InitiateFileUploads( + DataModels::FInitiateFileUploadsRequest& request, + const FInitiateFileUploadsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/File/InitiateFileUploads")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnInitiateFileUploadsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnInitiateFileUploadsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FInitiateFileUploadsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FInitiateFileUploadsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabDataAPI::SetObjects( + DataModels::FSetObjectsRequest& request, + const FSetObjectsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Object/SetObjects")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabDataAPI::OnSetObjectsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabDataAPI::OnSetObjectsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetObjectsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + DataModels::FSetObjectsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabDataDataModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabDataDataModels.cpp new file mode 100644 index 000000000..78eac7787 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabDataDataModels.cpp @@ -0,0 +1,953 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabDataDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::DataModels; + +PlayFab::DataModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::DataModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FAbortFileUploadsRequest::~FAbortFileUploadsRequest() +{ + +} + +void PlayFab::DataModels::FAbortFileUploadsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteArrayStart(TEXT("FileNames")); + for (const FString& item : FileNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + if (ProfileVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FAbortFileUploadsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FileNames"), FileNames); + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FAbortFileUploadsResponse::~FAbortFileUploadsResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::DataModels::FAbortFileUploadsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FAbortFileUploadsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FDeleteFilesRequest::~FDeleteFilesRequest() +{ + +} + +void PlayFab::DataModels::FDeleteFilesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteArrayStart(TEXT("FileNames")); + for (const FString& item : FileNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + if (ProfileVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FDeleteFilesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FileNames"), FileNames); + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FDeleteFilesResponse::~FDeleteFilesResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::DataModels::FDeleteFilesResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FDeleteFilesResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FFinalizeFileUploadsRequest::~FFinalizeFileUploadsRequest() +{ + +} + +void PlayFab::DataModels::FFinalizeFileUploadsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteArrayStart(TEXT("FileNames")); + for (const FString& item : FileNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FFinalizeFileUploadsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FileNames"), FileNames); + + return HasSucceeded; +} + +PlayFab::DataModels::FGetFileMetadata::~FGetFileMetadata() +{ + +} + +void PlayFab::DataModels::FGetFileMetadata::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Checksum.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Checksum")); writer->WriteValue(Checksum); } + + if (DownloadUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DownloadUrl")); writer->WriteValue(DownloadUrl); } + + if (FileName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FileName")); writer->WriteValue(FileName); } + + writer->WriteIdentifierPrefix(TEXT("LastModified")); writeDatetime(LastModified, writer); + + writer->WriteIdentifierPrefix(TEXT("Size")); writer->WriteValue(Size); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FGetFileMetadata::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ChecksumValue = obj->TryGetField(TEXT("Checksum")); + if (ChecksumValue.IsValid() && !ChecksumValue->IsNull()) + { + FString TmpValue; + if (ChecksumValue->TryGetString(TmpValue)) { Checksum = TmpValue; } + } + + const TSharedPtr DownloadUrlValue = obj->TryGetField(TEXT("DownloadUrl")); + if (DownloadUrlValue.IsValid() && !DownloadUrlValue->IsNull()) + { + FString TmpValue; + if (DownloadUrlValue->TryGetString(TmpValue)) { DownloadUrl = TmpValue; } + } + + const TSharedPtr FileNameValue = obj->TryGetField(TEXT("FileName")); + if (FileNameValue.IsValid() && !FileNameValue->IsNull()) + { + FString TmpValue; + if (FileNameValue->TryGetString(TmpValue)) { FileName = TmpValue; } + } + + const TSharedPtr LastModifiedValue = obj->TryGetField(TEXT("LastModified")); + if (LastModifiedValue.IsValid()) + LastModified = readDatetime(LastModifiedValue); + + + const TSharedPtr SizeValue = obj->TryGetField(TEXT("Size")); + if (SizeValue.IsValid() && !SizeValue->IsNull()) + { + int32 TmpValue; + if (SizeValue->TryGetNumber(TmpValue)) { Size = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FFinalizeFileUploadsResponse::~FFinalizeFileUploadsResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::DataModels::FFinalizeFileUploadsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + if (Metadata.Num() != 0) + { + writer->WriteObjectStart(TEXT("Metadata")); + for (TMap::TConstIterator It(Metadata); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FFinalizeFileUploadsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr* MetadataObject; + if (obj->TryGetObjectField(TEXT("Metadata"), MetadataObject)) + { + for (TMap>::TConstIterator It((*MetadataObject)->Values); It; ++It) + { + Metadata.Add(It.Key(), FGetFileMetadata(It.Value()->AsObject())); + } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FGetFilesRequest::~FGetFilesRequest() +{ + +} + +void PlayFab::DataModels::FGetFilesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FGetFilesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::DataModels::FGetFilesResponse::~FGetFilesResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::DataModels::FGetFilesResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + if (Metadata.Num() != 0) + { + writer->WriteObjectStart(TEXT("Metadata")); + for (TMap::TConstIterator It(Metadata); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FGetFilesResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr* MetadataObject; + if (obj->TryGetObjectField(TEXT("Metadata"), MetadataObject)) + { + for (TMap>::TConstIterator It((*MetadataObject)->Values); It; ++It) + { + Metadata.Add(It.Key(), FGetFileMetadata(It.Value()->AsObject())); + } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FGetObjectsRequest::~FGetObjectsRequest() +{ + +} + +void PlayFab::DataModels::FGetObjectsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + if (EscapeObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("EscapeObject")); writer->WriteValue(EscapeObject); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FGetObjectsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr EscapeObjectValue = obj->TryGetField(TEXT("EscapeObject")); + if (EscapeObjectValue.IsValid() && !EscapeObjectValue->IsNull()) + { + bool TmpValue; + if (EscapeObjectValue->TryGetBool(TmpValue)) { EscapeObject = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FObjectResult::~FObjectResult() +{ + +} + +void PlayFab::DataModels::FObjectResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DataObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("DataObject")); DataObject.writeJSON(writer); } + + if (EscapedDataObject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EscapedDataObject")); writer->WriteValue(EscapedDataObject); } + + if (ObjectName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ObjectName")); writer->WriteValue(ObjectName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FObjectResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataObjectValue = obj->TryGetField(TEXT("DataObject")); + if (DataObjectValue.IsValid() && !DataObjectValue->IsNull()) + { + DataObject = FJsonKeeper(DataObjectValue); + } + + const TSharedPtr EscapedDataObjectValue = obj->TryGetField(TEXT("EscapedDataObject")); + if (EscapedDataObjectValue.IsValid() && !EscapedDataObjectValue->IsNull()) + { + FString TmpValue; + if (EscapedDataObjectValue->TryGetString(TmpValue)) { EscapedDataObject = TmpValue; } + } + + const TSharedPtr ObjectNameValue = obj->TryGetField(TEXT("ObjectName")); + if (ObjectNameValue.IsValid() && !ObjectNameValue->IsNull()) + { + FString TmpValue; + if (ObjectNameValue->TryGetString(TmpValue)) { ObjectName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FGetObjectsResponse::~FGetObjectsResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::DataModels::FGetObjectsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + if (Objects.Num() != 0) + { + writer->WriteObjectStart(TEXT("Objects")); + for (TMap::TConstIterator It(Objects); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FGetObjectsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr* ObjectsObject; + if (obj->TryGetObjectField(TEXT("Objects"), ObjectsObject)) + { + for (TMap>::TConstIterator It((*ObjectsObject)->Values); It; ++It) + { + Objects.Add(It.Key(), FObjectResult(It.Value()->AsObject())); + } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FInitiateFileUploadMetadata::~FInitiateFileUploadMetadata() +{ + +} + +void PlayFab::DataModels::FInitiateFileUploadMetadata::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FileName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FileName")); writer->WriteValue(FileName); } + + if (UploadUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UploadUrl")); writer->WriteValue(UploadUrl); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FInitiateFileUploadMetadata::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FileNameValue = obj->TryGetField(TEXT("FileName")); + if (FileNameValue.IsValid() && !FileNameValue->IsNull()) + { + FString TmpValue; + if (FileNameValue->TryGetString(TmpValue)) { FileName = TmpValue; } + } + + const TSharedPtr UploadUrlValue = obj->TryGetField(TEXT("UploadUrl")); + if (UploadUrlValue.IsValid() && !UploadUrlValue->IsNull()) + { + FString TmpValue; + if (UploadUrlValue->TryGetString(TmpValue)) { UploadUrl = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FInitiateFileUploadsRequest::~FInitiateFileUploadsRequest() +{ + +} + +void PlayFab::DataModels::FInitiateFileUploadsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteArrayStart(TEXT("FileNames")); + for (const FString& item : FileNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + if (ProfileVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FInitiateFileUploadsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FileNames"), FileNames); + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FInitiateFileUploadsResponse::~FInitiateFileUploadsResponse() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::DataModels::FInitiateFileUploadsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (UploadDetails.Num() != 0) + { + writer->WriteArrayStart(TEXT("UploadDetails")); + for (const FInitiateFileUploadMetadata& item : UploadDetails) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FInitiateFileUploadsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + const TArray>&UploadDetailsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("UploadDetails")); + for (int32 Idx = 0; Idx < UploadDetailsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = UploadDetailsArray[Idx]; + UploadDetails.Add(FInitiateFileUploadMetadata(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::DataModels::writeOperationTypesEnumJSON(OperationTypes enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case OperationTypesCreated: writer->WriteValue(TEXT("Created")); break; + case OperationTypesUpdated: writer->WriteValue(TEXT("Updated")); break; + case OperationTypesDeleted: writer->WriteValue(TEXT("Deleted")); break; + case OperationTypesNone: writer->WriteValue(TEXT("None")); break; + } +} + +DataModels::OperationTypes PlayFab::DataModels::readOperationTypesFromValue(const TSharedPtr& value) +{ + return readOperationTypesFromValue(value.IsValid() ? value->AsString() : ""); +} + +DataModels::OperationTypes PlayFab::DataModels::readOperationTypesFromValue(const FString& value) +{ + static TMap _OperationTypesMap; + if (_OperationTypesMap.Num() == 0) + { + // Auto-generate the map on the first use + _OperationTypesMap.Add(TEXT("Created"), OperationTypesCreated); + _OperationTypesMap.Add(TEXT("Updated"), OperationTypesUpdated); + _OperationTypesMap.Add(TEXT("Deleted"), OperationTypesDeleted); + _OperationTypesMap.Add(TEXT("None"), OperationTypesNone); + + } + + if (!value.IsEmpty()) + { + auto output = _OperationTypesMap.Find(value); + if (output != nullptr) + return *output; + } + + return OperationTypesCreated; // Basically critical fail +} + +PlayFab::DataModels::FSetObject::~FSetObject() +{ + +} + +void PlayFab::DataModels::FSetObject::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DataObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("DataObject")); DataObject.writeJSON(writer); } + + if (DeleteObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("DeleteObject")); writer->WriteValue(DeleteObject); } + + if (EscapedDataObject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EscapedDataObject")); writer->WriteValue(EscapedDataObject); } + + writer->WriteIdentifierPrefix(TEXT("ObjectName")); writer->WriteValue(ObjectName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FSetObject::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataObjectValue = obj->TryGetField(TEXT("DataObject")); + if (DataObjectValue.IsValid() && !DataObjectValue->IsNull()) + { + DataObject = FJsonKeeper(DataObjectValue); + } + + const TSharedPtr DeleteObjectValue = obj->TryGetField(TEXT("DeleteObject")); + if (DeleteObjectValue.IsValid() && !DeleteObjectValue->IsNull()) + { + bool TmpValue; + if (DeleteObjectValue->TryGetBool(TmpValue)) { DeleteObject = TmpValue; } + } + + const TSharedPtr EscapedDataObjectValue = obj->TryGetField(TEXT("EscapedDataObject")); + if (EscapedDataObjectValue.IsValid() && !EscapedDataObjectValue->IsNull()) + { + FString TmpValue; + if (EscapedDataObjectValue->TryGetString(TmpValue)) { EscapedDataObject = TmpValue; } + } + + const TSharedPtr ObjectNameValue = obj->TryGetField(TEXT("ObjectName")); + if (ObjectNameValue.IsValid() && !ObjectNameValue->IsNull()) + { + FString TmpValue; + if (ObjectNameValue->TryGetString(TmpValue)) { ObjectName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::DataModels::FSetObjectInfo::~FSetObjectInfo() +{ + +} + +void PlayFab::DataModels::FSetObjectInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ObjectName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ObjectName")); writer->WriteValue(ObjectName); } + + if (OperationReason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OperationReason")); writer->WriteValue(OperationReason); } + + if (SetResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("SetResult")); writeOperationTypesEnumJSON(SetResult, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FSetObjectInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ObjectNameValue = obj->TryGetField(TEXT("ObjectName")); + if (ObjectNameValue.IsValid() && !ObjectNameValue->IsNull()) + { + FString TmpValue; + if (ObjectNameValue->TryGetString(TmpValue)) { ObjectName = TmpValue; } + } + + const TSharedPtr OperationReasonValue = obj->TryGetField(TEXT("OperationReason")); + if (OperationReasonValue.IsValid() && !OperationReasonValue->IsNull()) + { + FString TmpValue; + if (OperationReasonValue->TryGetString(TmpValue)) { OperationReason = TmpValue; } + } + + SetResult = readOperationTypesFromValue(obj->TryGetField(TEXT("SetResult"))); + + return HasSucceeded; +} + +PlayFab::DataModels::FSetObjectsRequest::~FSetObjectsRequest() +{ + +} + +void PlayFab::DataModels::FSetObjectsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + if (ExpectedProfileVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("ExpectedProfileVersion")); writer->WriteValue(ExpectedProfileVersion); } + + writer->WriteArrayStart(TEXT("Objects")); + for (const FSetObject& item : Objects) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FSetObjectsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr ExpectedProfileVersionValue = obj->TryGetField(TEXT("ExpectedProfileVersion")); + if (ExpectedProfileVersionValue.IsValid() && !ExpectedProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ExpectedProfileVersionValue->TryGetNumber(TmpValue)) { ExpectedProfileVersion = TmpValue; } + } + + const TArray>&ObjectsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Objects")); + for (int32 Idx = 0; Idx < ObjectsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ObjectsArray[Idx]; + Objects.Add(FSetObject(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::DataModels::FSetObjectsResponse::~FSetObjectsResponse() +{ + +} + +void PlayFab::DataModels::FSetObjectsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (SetResults.Num() != 0) + { + writer->WriteArrayStart(TEXT("SetResults")); + for (const FSetObjectInfo& item : SetResults) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::DataModels::FSetObjectsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + const TArray>&SetResultsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("SetResults")); + for (int32 Idx = 0; Idx < SetResultsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SetResultsArray[Idx]; + SetResults.Add(FSetObjectInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabEventsAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabEventsAPI.cpp new file mode 100644 index 000000000..86c4825d5 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabEventsAPI.cpp @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabEventsAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::EventsModels; + +UPlayFabEventsAPI::UPlayFabEventsAPI() {} + +UPlayFabEventsAPI::~UPlayFabEventsAPI() {} + +int UPlayFabEventsAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabEventsAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabEventsAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabEventsAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabEventsAPI::WriteEvents( + EventsModels::FWriteEventsRequest& request, + const FWriteEventsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Event/WriteEvents")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabEventsAPI::OnWriteEventsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabEventsAPI::OnWriteEventsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteEventsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + EventsModels::FWriteEventsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabEventsDataModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabEventsDataModels.cpp new file mode 100644 index 000000000..61c9680f3 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabEventsDataModels.cpp @@ -0,0 +1,191 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabEventsDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::EventsModels; + +PlayFab::EventsModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::EventsModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::EventsModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::EventsModels::FEventContents::~FEventContents() +{ + +} + +void PlayFab::EventsModels::FEventContents::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("EventNamespace")); writer->WriteValue(EventNamespace); + + writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); + + if (OriginalId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OriginalId")); writer->WriteValue(OriginalId); } + + if (OriginalTimestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("OriginalTimestamp")); writeDatetime(OriginalTimestamp, writer); } + + if (Payload.notNull()) { writer->WriteIdentifierPrefix(TEXT("Payload")); Payload.writeJSON(writer); } + + if (PayloadJSON.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PayloadJSON")); writer->WriteValue(PayloadJSON); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::EventsModels::FEventContents::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr EventNamespaceValue = obj->TryGetField(TEXT("EventNamespace")); + if (EventNamespaceValue.IsValid() && !EventNamespaceValue->IsNull()) + { + FString TmpValue; + if (EventNamespaceValue->TryGetString(TmpValue)) { EventNamespace = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr OriginalIdValue = obj->TryGetField(TEXT("OriginalId")); + if (OriginalIdValue.IsValid() && !OriginalIdValue->IsNull()) + { + FString TmpValue; + if (OriginalIdValue->TryGetString(TmpValue)) { OriginalId = TmpValue; } + } + + const TSharedPtr OriginalTimestampValue = obj->TryGetField(TEXT("OriginalTimestamp")); + if (OriginalTimestampValue.IsValid()) + OriginalTimestamp = readDatetime(OriginalTimestampValue); + + + const TSharedPtr PayloadValue = obj->TryGetField(TEXT("Payload")); + if (PayloadValue.IsValid() && !PayloadValue->IsNull()) + { + Payload = FJsonKeeper(PayloadValue); + } + + const TSharedPtr PayloadJSONValue = obj->TryGetField(TEXT("PayloadJSON")); + if (PayloadJSONValue.IsValid() && !PayloadJSONValue->IsNull()) + { + FString TmpValue; + if (PayloadJSONValue->TryGetString(TmpValue)) { PayloadJSON = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::EventsModels::FWriteEventsRequest::~FWriteEventsRequest() +{ + +} + +void PlayFab::EventsModels::FWriteEventsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Events")); + for (const FEventContents& item : Events) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::EventsModels::FWriteEventsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&EventsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Events")); + for (int32 Idx = 0; Idx < EventsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = EventsArray[Idx]; + Events.Add(FEventContents(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::EventsModels::FWriteEventsResponse::~FWriteEventsResponse() +{ + +} + +void PlayFab::EventsModels::FWriteEventsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AssignedEventIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("AssignedEventIds")); + for (const FString& item : AssignedEventIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::EventsModels::FWriteEventsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("AssignedEventIds"), AssignedEventIds); + + return HasSucceeded; +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabGroupsAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabGroupsAPI.cpp new file mode 100644 index 000000000..4e63b376b --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabGroupsAPI.cpp @@ -0,0 +1,713 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabGroupsAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::GroupsModels; + +UPlayFabGroupsAPI::UPlayFabGroupsAPI() {} + +UPlayFabGroupsAPI::~UPlayFabGroupsAPI() {} + +int UPlayFabGroupsAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabGroupsAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabGroupsAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabGroupsAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabGroupsAPI::AcceptGroupApplication( + GroupsModels::FAcceptGroupApplicationRequest& request, + const FAcceptGroupApplicationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/AcceptGroupApplication")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnAcceptGroupApplicationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnAcceptGroupApplicationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAcceptGroupApplicationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::AcceptGroupInvitation( + GroupsModels::FAcceptGroupInvitationRequest& request, + const FAcceptGroupInvitationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/AcceptGroupInvitation")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnAcceptGroupInvitationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnAcceptGroupInvitationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAcceptGroupInvitationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::AddMembers( + GroupsModels::FAddMembersRequest& request, + const FAddMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/AddMembers")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnAddMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnAddMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ApplyToGroup( + GroupsModels::FApplyToGroupRequest& request, + const FApplyToGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ApplyToGroup")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnApplyToGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnApplyToGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FApplyToGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FApplyToGroupResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::BlockEntity( + GroupsModels::FBlockEntityRequest& request, + const FBlockEntityDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/BlockEntity")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnBlockEntityResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnBlockEntityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FBlockEntityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ChangeMemberRole( + GroupsModels::FChangeMemberRoleRequest& request, + const FChangeMemberRoleDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ChangeMemberRole")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnChangeMemberRoleResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnChangeMemberRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FChangeMemberRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::CreateGroup( + GroupsModels::FCreateGroupRequest& request, + const FCreateGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/CreateGroup")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnCreateGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnCreateGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FCreateGroupResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::CreateRole( + GroupsModels::FCreateGroupRoleRequest& request, + const FCreateRoleDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/CreateRole")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnCreateRoleResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnCreateRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FCreateGroupRoleResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::DeleteGroup( + GroupsModels::FDeleteGroupRequest& request, + const FDeleteGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/DeleteGroup")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnDeleteGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnDeleteGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::DeleteRole( + GroupsModels::FDeleteRoleRequest& request, + const FDeleteRoleDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/DeleteRole")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnDeleteRoleResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnDeleteRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::GetGroup( + GroupsModels::FGetGroupRequest& request, + const FGetGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/GetGroup")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnGetGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnGetGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FGetGroupResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::InviteToGroup( + GroupsModels::FInviteToGroupRequest& request, + const FInviteToGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/InviteToGroup")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnInviteToGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnInviteToGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FInviteToGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FInviteToGroupResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::IsMember( + GroupsModels::FIsMemberRequest& request, + const FIsMemberDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/IsMember")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnIsMemberResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnIsMemberResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FIsMemberDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FIsMemberResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ListGroupApplications( + GroupsModels::FListGroupApplicationsRequest& request, + const FListGroupApplicationsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ListGroupApplications")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnListGroupApplicationsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnListGroupApplicationsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupApplicationsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FListGroupApplicationsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ListGroupBlocks( + GroupsModels::FListGroupBlocksRequest& request, + const FListGroupBlocksDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ListGroupBlocks")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnListGroupBlocksResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnListGroupBlocksResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupBlocksDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FListGroupBlocksResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ListGroupInvitations( + GroupsModels::FListGroupInvitationsRequest& request, + const FListGroupInvitationsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ListGroupInvitations")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnListGroupInvitationsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnListGroupInvitationsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupInvitationsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FListGroupInvitationsResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ListGroupMembers( + GroupsModels::FListGroupMembersRequest& request, + const FListGroupMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ListGroupMembers")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnListGroupMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnListGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FListGroupMembersResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ListMembership( + GroupsModels::FListMembershipRequest& request, + const FListMembershipDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ListMembership")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnListMembershipResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnListMembershipResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMembershipDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FListMembershipResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::ListMembershipOpportunities( + GroupsModels::FListMembershipOpportunitiesRequest& request, + const FListMembershipOpportunitiesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/ListMembershipOpportunities")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnListMembershipOpportunitiesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnListMembershipOpportunitiesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMembershipOpportunitiesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FListMembershipOpportunitiesResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::RemoveGroupApplication( + GroupsModels::FRemoveGroupApplicationRequest& request, + const FRemoveGroupApplicationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/RemoveGroupApplication")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnRemoveGroupApplicationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnRemoveGroupApplicationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveGroupApplicationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::RemoveGroupInvitation( + GroupsModels::FRemoveGroupInvitationRequest& request, + const FRemoveGroupInvitationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/RemoveGroupInvitation")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnRemoveGroupInvitationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnRemoveGroupInvitationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveGroupInvitationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::RemoveMembers( + GroupsModels::FRemoveMembersRequest& request, + const FRemoveMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/RemoveMembers")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnRemoveMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnRemoveMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::UnblockEntity( + GroupsModels::FUnblockEntityRequest& request, + const FUnblockEntityDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/UnblockEntity")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnUnblockEntityResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnUnblockEntityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnblockEntityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::UpdateGroup( + GroupsModels::FUpdateGroupRequest& request, + const FUpdateGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/UpdateGroup")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnUpdateGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnUpdateGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FUpdateGroupResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabGroupsAPI::UpdateRole( + GroupsModels::FUpdateGroupRoleRequest& request, + const FUpdateRoleDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Group/UpdateRole")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabGroupsAPI::OnUpdateRoleResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabGroupsAPI::OnUpdateRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + GroupsModels::FUpdateGroupRoleResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabGroupsDataModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabGroupsDataModels.cpp new file mode 100644 index 000000000..bf56e6c33 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabGroupsDataModels.cpp @@ -0,0 +1,2103 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabGroupsDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::GroupsModels; + +PlayFab::GroupsModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::GroupsModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FAcceptGroupApplicationRequest::~FAcceptGroupApplicationRequest() +{ + +} + +void PlayFab::GroupsModels::FAcceptGroupApplicationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FAcceptGroupApplicationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FAcceptGroupInvitationRequest::~FAcceptGroupInvitationRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::GroupsModels::FAcceptGroupInvitationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FAcceptGroupInvitationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FAddMembersRequest::~FAddMembersRequest() +{ + +} + +void PlayFab::GroupsModels::FAddMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteArrayStart(TEXT("Members")); + for (const FEntityKey& item : Members) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FAddMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TArray>&MembersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Members")); + for (int32 Idx = 0; Idx < MembersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembersArray[Idx]; + Members.Add(FEntityKey(CurrentItem->AsObject())); + } + + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FApplyToGroupRequest::~FApplyToGroupRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::GroupsModels::FApplyToGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AutoAcceptOutstandingInvite.notNull()) { writer->WriteIdentifierPrefix(TEXT("AutoAcceptOutstandingInvite")); writer->WriteValue(AutoAcceptOutstandingInvite); } + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FApplyToGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AutoAcceptOutstandingInviteValue = obj->TryGetField(TEXT("AutoAcceptOutstandingInvite")); + if (AutoAcceptOutstandingInviteValue.IsValid() && !AutoAcceptOutstandingInviteValue->IsNull()) + { + bool TmpValue; + if (AutoAcceptOutstandingInviteValue->TryGetBool(TmpValue)) { AutoAcceptOutstandingInvite = TmpValue; } + } + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FEntityWithLineage::~FEntityWithLineage() +{ + //if (Key != nullptr) delete Key; + +} + +void PlayFab::GroupsModels::FEntityWithLineage::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Key.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Key")); Key->writeJSON(writer); } + + if (Lineage.Num() != 0) + { + writer->WriteObjectStart(TEXT("Lineage")); + for (TMap::TConstIterator It(Lineage); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FEntityWithLineage::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + Key = MakeShareable(new FEntityKey(KeyValue->AsObject())); + } + + const TSharedPtr* LineageObject; + if (obj->TryGetObjectField(TEXT("Lineage"), LineageObject)) + { + for (TMap>::TConstIterator It((*LineageObject)->Values); It; ++It) + { + Lineage.Add(It.Key(), FEntityKey(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FApplyToGroupResponse::~FApplyToGroupResponse() +{ + //if (Entity != nullptr) delete Entity; + //if (Group != nullptr) delete Group; + +} + +void PlayFab::GroupsModels::FApplyToGroupResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); + + if (Group.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Group")); Group->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FApplyToGroupResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityWithLineage(EntityValue->AsObject())); + } + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = MakeShareable(new FEntityKey(GroupValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FBlockEntityRequest::~FBlockEntityRequest() +{ + +} + +void PlayFab::GroupsModels::FBlockEntityRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FBlockEntityRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FChangeMemberRoleRequest::~FChangeMemberRoleRequest() +{ + +} + +void PlayFab::GroupsModels::FChangeMemberRoleRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DestinationRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DestinationRoleId")); writer->WriteValue(DestinationRoleId); } + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteArrayStart(TEXT("Members")); + for (const FEntityKey& item : Members) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("OriginRoleId")); writer->WriteValue(OriginRoleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FChangeMemberRoleRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DestinationRoleIdValue = obj->TryGetField(TEXT("DestinationRoleId")); + if (DestinationRoleIdValue.IsValid() && !DestinationRoleIdValue->IsNull()) + { + FString TmpValue; + if (DestinationRoleIdValue->TryGetString(TmpValue)) { DestinationRoleId = TmpValue; } + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TArray>&MembersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Members")); + for (int32 Idx = 0; Idx < MembersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembersArray[Idx]; + Members.Add(FEntityKey(CurrentItem->AsObject())); + } + + + const TSharedPtr OriginRoleIdValue = obj->TryGetField(TEXT("OriginRoleId")); + if (OriginRoleIdValue.IsValid() && !OriginRoleIdValue->IsNull()) + { + FString TmpValue; + if (OriginRoleIdValue->TryGetString(TmpValue)) { OriginRoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FCreateGroupRequest::~FCreateGroupRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::GroupsModels::FCreateGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("GroupName")); writer->WriteValue(GroupName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FCreateGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr GroupNameValue = obj->TryGetField(TEXT("GroupName")); + if (GroupNameValue.IsValid() && !GroupNameValue->IsNull()) + { + FString TmpValue; + if (GroupNameValue->TryGetString(TmpValue)) { GroupName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FCreateGroupResponse::~FCreateGroupResponse() +{ + +} + +void PlayFab::GroupsModels::FCreateGroupResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdminRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AdminRoleId")); writer->WriteValue(AdminRoleId); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (GroupName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GroupName")); writer->WriteValue(GroupName); } + + if (MemberRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MemberRoleId")); writer->WriteValue(MemberRoleId); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (Roles.Num() != 0) + { + writer->WriteObjectStart(TEXT("Roles")); + for (TMap::TConstIterator It(Roles); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FCreateGroupResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AdminRoleIdValue = obj->TryGetField(TEXT("AdminRoleId")); + if (AdminRoleIdValue.IsValid() && !AdminRoleIdValue->IsNull()) + { + FString TmpValue; + if (AdminRoleIdValue->TryGetString(TmpValue)) { AdminRoleId = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr GroupNameValue = obj->TryGetField(TEXT("GroupName")); + if (GroupNameValue.IsValid() && !GroupNameValue->IsNull()) + { + FString TmpValue; + if (GroupNameValue->TryGetString(TmpValue)) { GroupName = TmpValue; } + } + + const TSharedPtr MemberRoleIdValue = obj->TryGetField(TEXT("MemberRoleId")); + if (MemberRoleIdValue.IsValid() && !MemberRoleIdValue->IsNull()) + { + FString TmpValue; + if (MemberRoleIdValue->TryGetString(TmpValue)) { MemberRoleId = TmpValue; } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + const TSharedPtr* RolesObject; + if (obj->TryGetObjectField(TEXT("Roles"), RolesObject)) + { + for (TMap>::TConstIterator It((*RolesObject)->Values); It; ++It) + { + Roles.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FCreateGroupRoleRequest::~FCreateGroupRoleRequest() +{ + +} + +void PlayFab::GroupsModels::FCreateGroupRoleRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); + + writer->WriteIdentifierPrefix(TEXT("RoleName")); writer->WriteValue(RoleName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FCreateGroupRoleRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + const TSharedPtr RoleNameValue = obj->TryGetField(TEXT("RoleName")); + if (RoleNameValue.IsValid() && !RoleNameValue->IsNull()) + { + FString TmpValue; + if (RoleNameValue->TryGetString(TmpValue)) { RoleName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FCreateGroupRoleResponse::~FCreateGroupRoleResponse() +{ + +} + +void PlayFab::GroupsModels::FCreateGroupRoleResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + if (RoleName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleName")); writer->WriteValue(RoleName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FCreateGroupRoleResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + const TSharedPtr RoleNameValue = obj->TryGetField(TEXT("RoleName")); + if (RoleNameValue.IsValid() && !RoleNameValue->IsNull()) + { + FString TmpValue; + if (RoleNameValue->TryGetString(TmpValue)) { RoleName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FDeleteGroupRequest::~FDeleteGroupRequest() +{ + +} + +void PlayFab::GroupsModels::FDeleteGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FDeleteGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FDeleteRoleRequest::~FDeleteRoleRequest() +{ + +} + +void PlayFab::GroupsModels::FDeleteRoleRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FDeleteRoleRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FEmptyResponse::~FEmptyResponse() +{ + +} + +void PlayFab::GroupsModels::FEmptyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FEmptyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::GroupsModels::FEntityMemberRole::~FEntityMemberRole() +{ + +} + +void PlayFab::GroupsModels::FEntityMemberRole::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Members.Num() != 0) + { + writer->WriteArrayStart(TEXT("Members")); + for (const FEntityWithLineage& item : Members) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + if (RoleName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleName")); writer->WriteValue(RoleName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FEntityMemberRole::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&MembersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Members")); + for (int32 Idx = 0; Idx < MembersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembersArray[Idx]; + Members.Add(FEntityWithLineage(CurrentItem->AsObject())); + } + + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + const TSharedPtr RoleNameValue = obj->TryGetField(TEXT("RoleName")); + if (RoleNameValue.IsValid() && !RoleNameValue->IsNull()) + { + FString TmpValue; + if (RoleNameValue->TryGetString(TmpValue)) { RoleName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGetGroupRequest::~FGetGroupRequest() +{ + //if (Group != nullptr) delete Group; + +} + +void PlayFab::GroupsModels::FGetGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Group.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Group")); Group->writeJSON(writer); } + + if (GroupName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GroupName")); writer->WriteValue(GroupName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGetGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = MakeShareable(new FEntityKey(GroupValue->AsObject())); + } + + const TSharedPtr GroupNameValue = obj->TryGetField(TEXT("GroupName")); + if (GroupNameValue.IsValid() && !GroupNameValue->IsNull()) + { + FString TmpValue; + if (GroupNameValue->TryGetString(TmpValue)) { GroupName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGetGroupResponse::~FGetGroupResponse() +{ + +} + +void PlayFab::GroupsModels::FGetGroupResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdminRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AdminRoleId")); writer->WriteValue(AdminRoleId); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (GroupName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GroupName")); writer->WriteValue(GroupName); } + + if (MemberRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MemberRoleId")); writer->WriteValue(MemberRoleId); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (Roles.Num() != 0) + { + writer->WriteObjectStart(TEXT("Roles")); + for (TMap::TConstIterator It(Roles); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGetGroupResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AdminRoleIdValue = obj->TryGetField(TEXT("AdminRoleId")); + if (AdminRoleIdValue.IsValid() && !AdminRoleIdValue->IsNull()) + { + FString TmpValue; + if (AdminRoleIdValue->TryGetString(TmpValue)) { AdminRoleId = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr GroupNameValue = obj->TryGetField(TEXT("GroupName")); + if (GroupNameValue.IsValid() && !GroupNameValue->IsNull()) + { + FString TmpValue; + if (GroupNameValue->TryGetString(TmpValue)) { GroupName = TmpValue; } + } + + const TSharedPtr MemberRoleIdValue = obj->TryGetField(TEXT("MemberRoleId")); + if (MemberRoleIdValue.IsValid() && !MemberRoleIdValue->IsNull()) + { + FString TmpValue; + if (MemberRoleIdValue->TryGetString(TmpValue)) { MemberRoleId = TmpValue; } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + const TSharedPtr* RolesObject; + if (obj->TryGetObjectField(TEXT("Roles"), RolesObject)) + { + for (TMap>::TConstIterator It((*RolesObject)->Values); It; ++It) + { + Roles.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGroupApplication::~FGroupApplication() +{ + //if (Entity != nullptr) delete Entity; + //if (Group != nullptr) delete Group; + +} + +void PlayFab::GroupsModels::FGroupApplication::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); + + if (Group.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Group")); Group->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGroupApplication::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityWithLineage(EntityValue->AsObject())); + } + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = MakeShareable(new FEntityKey(GroupValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGroupBlock::~FGroupBlock() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::GroupsModels::FGroupBlock::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGroupBlock::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityWithLineage(EntityValue->AsObject())); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGroupInvitation::~FGroupInvitation() +{ + //if (Group != nullptr) delete Group; + //if (InvitedByEntity != nullptr) delete InvitedByEntity; + //if (InvitedEntity != nullptr) delete InvitedEntity; + +} + +void PlayFab::GroupsModels::FGroupInvitation::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); + + if (Group.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Group")); Group->writeJSON(writer); } + + if (InvitedByEntity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InvitedByEntity")); InvitedByEntity->writeJSON(writer); } + + if (InvitedEntity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InvitedEntity")); InvitedEntity->writeJSON(writer); } + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGroupInvitation::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = MakeShareable(new FEntityKey(GroupValue->AsObject())); + } + + const TSharedPtr InvitedByEntityValue = obj->TryGetField(TEXT("InvitedByEntity")); + if (InvitedByEntityValue.IsValid() && !InvitedByEntityValue->IsNull()) + { + InvitedByEntity = MakeShareable(new FEntityWithLineage(InvitedByEntityValue->AsObject())); + } + + const TSharedPtr InvitedEntityValue = obj->TryGetField(TEXT("InvitedEntity")); + if (InvitedEntityValue.IsValid() && !InvitedEntityValue->IsNull()) + { + InvitedEntity = MakeShareable(new FEntityWithLineage(InvitedEntityValue->AsObject())); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGroupRole::~FGroupRole() +{ + +} + +void PlayFab::GroupsModels::FGroupRole::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + if (RoleName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleName")); writer->WriteValue(RoleName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGroupRole::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + const TSharedPtr RoleNameValue = obj->TryGetField(TEXT("RoleName")); + if (RoleNameValue.IsValid() && !RoleNameValue->IsNull()) + { + FString TmpValue; + if (RoleNameValue->TryGetString(TmpValue)) { RoleName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FGroupWithRoles::~FGroupWithRoles() +{ + //if (Group != nullptr) delete Group; + +} + +void PlayFab::GroupsModels::FGroupWithRoles::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Group.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Group")); Group->writeJSON(writer); } + + if (GroupName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GroupName")); writer->WriteValue(GroupName); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (Roles.Num() != 0) + { + writer->WriteArrayStart(TEXT("Roles")); + for (const FGroupRole& item : Roles) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FGroupWithRoles::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = MakeShareable(new FEntityKey(GroupValue->AsObject())); + } + + const TSharedPtr GroupNameValue = obj->TryGetField(TEXT("GroupName")); + if (GroupNameValue.IsValid() && !GroupNameValue->IsNull()) + { + FString TmpValue; + if (GroupNameValue->TryGetString(TmpValue)) { GroupName = TmpValue; } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + const TArray>&RolesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Roles")); + for (int32 Idx = 0; Idx < RolesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = RolesArray[Idx]; + Roles.Add(FGroupRole(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::GroupsModels::FInviteToGroupRequest::~FInviteToGroupRequest() +{ + +} + +void PlayFab::GroupsModels::FInviteToGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AutoAcceptOutstandingApplication.notNull()) { writer->WriteIdentifierPrefix(TEXT("AutoAcceptOutstandingApplication")); writer->WriteValue(AutoAcceptOutstandingApplication); } + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FInviteToGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AutoAcceptOutstandingApplicationValue = obj->TryGetField(TEXT("AutoAcceptOutstandingApplication")); + if (AutoAcceptOutstandingApplicationValue.IsValid() && !AutoAcceptOutstandingApplicationValue->IsNull()) + { + bool TmpValue; + if (AutoAcceptOutstandingApplicationValue->TryGetBool(TmpValue)) { AutoAcceptOutstandingApplication = TmpValue; } + } + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FInviteToGroupResponse::~FInviteToGroupResponse() +{ + //if (Group != nullptr) delete Group; + //if (InvitedByEntity != nullptr) delete InvitedByEntity; + //if (InvitedEntity != nullptr) delete InvitedEntity; + +} + +void PlayFab::GroupsModels::FInviteToGroupResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); + + if (Group.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Group")); Group->writeJSON(writer); } + + if (InvitedByEntity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InvitedByEntity")); InvitedByEntity->writeJSON(writer); } + + if (InvitedEntity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InvitedEntity")); InvitedEntity->writeJSON(writer); } + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FInviteToGroupResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = MakeShareable(new FEntityKey(GroupValue->AsObject())); + } + + const TSharedPtr InvitedByEntityValue = obj->TryGetField(TEXT("InvitedByEntity")); + if (InvitedByEntityValue.IsValid() && !InvitedByEntityValue->IsNull()) + { + InvitedByEntity = MakeShareable(new FEntityWithLineage(InvitedByEntityValue->AsObject())); + } + + const TSharedPtr InvitedEntityValue = obj->TryGetField(TEXT("InvitedEntity")); + if (InvitedEntityValue.IsValid() && !InvitedEntityValue->IsNull()) + { + InvitedEntity = MakeShareable(new FEntityWithLineage(InvitedEntityValue->AsObject())); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FIsMemberRequest::~FIsMemberRequest() +{ + +} + +void PlayFab::GroupsModels::FIsMemberRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FIsMemberRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FIsMemberResponse::~FIsMemberResponse() +{ + +} + +void PlayFab::GroupsModels::FIsMemberResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("IsMember")); writer->WriteValue(IsMember); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FIsMemberResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IsMemberValue = obj->TryGetField(TEXT("IsMember")); + if (IsMemberValue.IsValid() && !IsMemberValue->IsNull()) + { + bool TmpValue; + if (IsMemberValue->TryGetBool(TmpValue)) { IsMember = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupApplicationsRequest::~FListGroupApplicationsRequest() +{ + +} + +void PlayFab::GroupsModels::FListGroupApplicationsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupApplicationsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupApplicationsResponse::~FListGroupApplicationsResponse() +{ + +} + +void PlayFab::GroupsModels::FListGroupApplicationsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Applications.Num() != 0) + { + writer->WriteArrayStart(TEXT("Applications")); + for (const FGroupApplication& item : Applications) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupApplicationsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ApplicationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Applications")); + for (int32 Idx = 0; Idx < ApplicationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ApplicationsArray[Idx]; + Applications.Add(FGroupApplication(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupBlocksRequest::~FListGroupBlocksRequest() +{ + +} + +void PlayFab::GroupsModels::FListGroupBlocksRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupBlocksRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupBlocksResponse::~FListGroupBlocksResponse() +{ + +} + +void PlayFab::GroupsModels::FListGroupBlocksResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BlockedEntities.Num() != 0) + { + writer->WriteArrayStart(TEXT("BlockedEntities")); + for (const FGroupBlock& item : BlockedEntities) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupBlocksResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BlockedEntitiesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BlockedEntities")); + for (int32 Idx = 0; Idx < BlockedEntitiesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BlockedEntitiesArray[Idx]; + BlockedEntities.Add(FGroupBlock(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupInvitationsRequest::~FListGroupInvitationsRequest() +{ + +} + +void PlayFab::GroupsModels::FListGroupInvitationsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupInvitationsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupInvitationsResponse::~FListGroupInvitationsResponse() +{ + +} + +void PlayFab::GroupsModels::FListGroupInvitationsResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Invitations.Num() != 0) + { + writer->WriteArrayStart(TEXT("Invitations")); + for (const FGroupInvitation& item : Invitations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupInvitationsResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&InvitationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Invitations")); + for (int32 Idx = 0; Idx < InvitationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InvitationsArray[Idx]; + Invitations.Add(FGroupInvitation(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupMembersRequest::~FListGroupMembersRequest() +{ + +} + +void PlayFab::GroupsModels::FListGroupMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListGroupMembersResponse::~FListGroupMembersResponse() +{ + +} + +void PlayFab::GroupsModels::FListGroupMembersResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Members.Num() != 0) + { + writer->WriteArrayStart(TEXT("Members")); + for (const FEntityMemberRole& item : Members) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListGroupMembersResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&MembersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Members")); + for (int32 Idx = 0; Idx < MembersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembersArray[Idx]; + Members.Add(FEntityMemberRole(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListMembershipOpportunitiesRequest::~FListMembershipOpportunitiesRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::GroupsModels::FListMembershipOpportunitiesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListMembershipOpportunitiesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListMembershipOpportunitiesResponse::~FListMembershipOpportunitiesResponse() +{ + +} + +void PlayFab::GroupsModels::FListMembershipOpportunitiesResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Applications.Num() != 0) + { + writer->WriteArrayStart(TEXT("Applications")); + for (const FGroupApplication& item : Applications) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Invitations.Num() != 0) + { + writer->WriteArrayStart(TEXT("Invitations")); + for (const FGroupInvitation& item : Invitations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListMembershipOpportunitiesResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ApplicationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Applications")); + for (int32 Idx = 0; Idx < ApplicationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ApplicationsArray[Idx]; + Applications.Add(FGroupApplication(CurrentItem->AsObject())); + } + + + const TArray>&InvitationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Invitations")); + for (int32 Idx = 0; Idx < InvitationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InvitationsArray[Idx]; + Invitations.Add(FGroupInvitation(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListMembershipRequest::~FListMembershipRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::GroupsModels::FListMembershipRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListMembershipRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FListMembershipResponse::~FListMembershipResponse() +{ + +} + +void PlayFab::GroupsModels::FListMembershipResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Groups.Num() != 0) + { + writer->WriteArrayStart(TEXT("Groups")); + for (const FGroupWithRoles& item : Groups) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FListMembershipResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GroupsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Groups")); + for (int32 Idx = 0; Idx < GroupsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GroupsArray[Idx]; + Groups.Add(FGroupWithRoles(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::GroupsModels::writeOperationTypesEnumJSON(OperationTypes enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case OperationTypesCreated: writer->WriteValue(TEXT("Created")); break; + case OperationTypesUpdated: writer->WriteValue(TEXT("Updated")); break; + case OperationTypesDeleted: writer->WriteValue(TEXT("Deleted")); break; + case OperationTypesNone: writer->WriteValue(TEXT("None")); break; + } +} + +GroupsModels::OperationTypes PlayFab::GroupsModels::readOperationTypesFromValue(const TSharedPtr& value) +{ + return readOperationTypesFromValue(value.IsValid() ? value->AsString() : ""); +} + +GroupsModels::OperationTypes PlayFab::GroupsModels::readOperationTypesFromValue(const FString& value) +{ + static TMap _OperationTypesMap; + if (_OperationTypesMap.Num() == 0) + { + // Auto-generate the map on the first use + _OperationTypesMap.Add(TEXT("Created"), OperationTypesCreated); + _OperationTypesMap.Add(TEXT("Updated"), OperationTypesUpdated); + _OperationTypesMap.Add(TEXT("Deleted"), OperationTypesDeleted); + _OperationTypesMap.Add(TEXT("None"), OperationTypesNone); + + } + + if (!value.IsEmpty()) + { + auto output = _OperationTypesMap.Find(value); + if (output != nullptr) + return *output; + } + + return OperationTypesCreated; // Basically critical fail +} + +PlayFab::GroupsModels::FRemoveGroupApplicationRequest::~FRemoveGroupApplicationRequest() +{ + +} + +void PlayFab::GroupsModels::FRemoveGroupApplicationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FRemoveGroupApplicationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FRemoveGroupInvitationRequest::~FRemoveGroupInvitationRequest() +{ + +} + +void PlayFab::GroupsModels::FRemoveGroupInvitationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FRemoveGroupInvitationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FRemoveMembersRequest::~FRemoveMembersRequest() +{ + +} + +void PlayFab::GroupsModels::FRemoveMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteArrayStart(TEXT("Members")); + for (const FEntityKey& item : Members) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FRemoveMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TArray>&MembersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Members")); + for (int32 Idx = 0; Idx < MembersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembersArray[Idx]; + Members.Add(FEntityKey(CurrentItem->AsObject())); + } + + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FUnblockEntityRequest::~FUnblockEntityRequest() +{ + +} + +void PlayFab::GroupsModels::FUnblockEntityRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FUnblockEntityRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FUpdateGroupRequest::~FUpdateGroupRequest() +{ + +} + +void PlayFab::GroupsModels::FUpdateGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdminRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AdminRoleId")); writer->WriteValue(AdminRoleId); } + + if (ExpectedProfileVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("ExpectedProfileVersion")); writer->WriteValue(ExpectedProfileVersion); } + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (GroupName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GroupName")); writer->WriteValue(GroupName); } + + if (MemberRoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MemberRoleId")); writer->WriteValue(MemberRoleId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FUpdateGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AdminRoleIdValue = obj->TryGetField(TEXT("AdminRoleId")); + if (AdminRoleIdValue.IsValid() && !AdminRoleIdValue->IsNull()) + { + FString TmpValue; + if (AdminRoleIdValue->TryGetString(TmpValue)) { AdminRoleId = TmpValue; } + } + + const TSharedPtr ExpectedProfileVersionValue = obj->TryGetField(TEXT("ExpectedProfileVersion")); + if (ExpectedProfileVersionValue.IsValid() && !ExpectedProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ExpectedProfileVersionValue->TryGetNumber(TmpValue)) { ExpectedProfileVersion = TmpValue; } + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr GroupNameValue = obj->TryGetField(TEXT("GroupName")); + if (GroupNameValue.IsValid() && !GroupNameValue->IsNull()) + { + FString TmpValue; + if (GroupNameValue->TryGetString(TmpValue)) { GroupName = TmpValue; } + } + + const TSharedPtr MemberRoleIdValue = obj->TryGetField(TEXT("MemberRoleId")); + if (MemberRoleIdValue.IsValid() && !MemberRoleIdValue->IsNull()) + { + FString TmpValue; + if (MemberRoleIdValue->TryGetString(TmpValue)) { MemberRoleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FUpdateGroupResponse::~FUpdateGroupResponse() +{ + +} + +void PlayFab::GroupsModels::FUpdateGroupResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (OperationReason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OperationReason")); writer->WriteValue(OperationReason); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (SetResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("SetResult")); writeOperationTypesEnumJSON(SetResult, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FUpdateGroupResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OperationReasonValue = obj->TryGetField(TEXT("OperationReason")); + if (OperationReasonValue.IsValid() && !OperationReasonValue->IsNull()) + { + FString TmpValue; + if (OperationReasonValue->TryGetString(TmpValue)) { OperationReason = TmpValue; } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + SetResult = readOperationTypesFromValue(obj->TryGetField(TEXT("SetResult"))); + + return HasSucceeded; +} + +PlayFab::GroupsModels::FUpdateGroupRoleRequest::~FUpdateGroupRoleRequest() +{ + +} + +void PlayFab::GroupsModels::FUpdateGroupRoleRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ExpectedProfileVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("ExpectedProfileVersion")); writer->WriteValue(ExpectedProfileVersion); } + + writer->WriteIdentifierPrefix(TEXT("Group")); Group.writeJSON(writer); + + if (RoleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("RoleId")); writer->WriteValue(RoleId); } + + writer->WriteIdentifierPrefix(TEXT("RoleName")); writer->WriteValue(RoleName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FUpdateGroupRoleRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpectedProfileVersionValue = obj->TryGetField(TEXT("ExpectedProfileVersion")); + if (ExpectedProfileVersionValue.IsValid() && !ExpectedProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ExpectedProfileVersionValue->TryGetNumber(TmpValue)) { ExpectedProfileVersion = TmpValue; } + } + + const TSharedPtr GroupValue = obj->TryGetField(TEXT("Group")); + if (GroupValue.IsValid() && !GroupValue->IsNull()) + { + Group = FEntityKey(GroupValue->AsObject()); + } + + const TSharedPtr RoleIdValue = obj->TryGetField(TEXT("RoleId")); + if (RoleIdValue.IsValid() && !RoleIdValue->IsNull()) + { + FString TmpValue; + if (RoleIdValue->TryGetString(TmpValue)) { RoleId = TmpValue; } + } + + const TSharedPtr RoleNameValue = obj->TryGetField(TEXT("RoleName")); + if (RoleNameValue.IsValid() && !RoleNameValue->IsNull()) + { + FString TmpValue; + if (RoleNameValue->TryGetString(TmpValue)) { RoleName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::GroupsModels::FUpdateGroupRoleResponse::~FUpdateGroupRoleResponse() +{ + +} + +void PlayFab::GroupsModels::FUpdateGroupRoleResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (OperationReason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("OperationReason")); writer->WriteValue(OperationReason); } + + writer->WriteIdentifierPrefix(TEXT("ProfileVersion")); writer->WriteValue(ProfileVersion); + + if (SetResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("SetResult")); writeOperationTypesEnumJSON(SetResult, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::GroupsModels::FUpdateGroupRoleResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr OperationReasonValue = obj->TryGetField(TEXT("OperationReason")); + if (OperationReasonValue.IsValid() && !OperationReasonValue->IsNull()) + { + FString TmpValue; + if (OperationReasonValue->TryGetString(TmpValue)) { OperationReason = TmpValue; } + } + + const TSharedPtr ProfileVersionValue = obj->TryGetField(TEXT("ProfileVersion")); + if (ProfileVersionValue.IsValid() && !ProfileVersionValue->IsNull()) + { + int32 TmpValue; + if (ProfileVersionValue->TryGetNumber(TmpValue)) { ProfileVersion = TmpValue; } + } + + SetResult = readOperationTypesFromValue(obj->TryGetField(TEXT("SetResult"))); + + return HasSucceeded; +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabJsonHelpers.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabJsonHelpers.cpp new file mode 100644 index 000000000..037b1dcb0 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabJsonHelpers.cpp @@ -0,0 +1,139 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFabJsonHelpers.h" +#include "Json.h" + +using namespace PlayFab; + +static TArray< TSharedPtr > EmptyArray; + +const TArray< TSharedPtr >& FPlayFabJsonHelpers::ReadArray(TSharedPtr Item, const FString& Key) +{ + if (Item->HasTypedField(Key)) + { + return Item->GetArrayField(Key); + } + return EmptyArray; +} + + +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const bool Value) +// { +// writer->WriteValue(Identifier, Value); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const double Value) +// { +// writer->WriteValue(Identifier, Value); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const int32 Value) +// { +// writer->WriteValue(Identifier, Value); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const uint32 Value) +// { +// writer->WriteValue(Identifier, static_cast(Value)); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const int64 Value) +// { +// writer->WriteValue(Identifier, Value); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const uint64 Value) +// { +// writer->WriteValue(Identifier, Value); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const FString& Value) +// { +// writer->WriteValue(Identifier, Value); +// } +// +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const TCHAR* Value) +// { +// writer->WriteValue(Identifier, Value); +// } + +// void FPlayFabJsonHelpers::WriteValue(JsonWriter& writer, const FString& Identifier, const time_t Value) +// { +// +// } + +bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, double& OutNumber) +{ + return obj->TryGetNumberField(FieldName, OutNumber); +} + +bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, int32& OutNumber) +{ + return obj->TryGetNumberField(FieldName, OutNumber); +} + +bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, uint32& OutNumber) +{ + return obj->TryGetNumberField(FieldName, OutNumber); +} + +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalBool& OutNumber) +// { +// bool tmp; +// if (obj->TryGetBoolField(FieldName, tmp)) +// { +// OutNumber = tmp; +// } +// return true; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalUint16& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalInt16& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalUint32& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalInt32& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalUint64& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalInt64& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalFloat& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalDouble& OutNumber) +// { +// return false; +// } +// +// bool FPlayFabJsonHelpers::ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalTime& OutNumber) +// { +// return false; +// } + + + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabLocalizationAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabLocalizationAPI.cpp new file mode 100644 index 000000000..e1060545e --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabLocalizationAPI.cpp @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabLocalizationAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::LocalizationModels; + +UPlayFabLocalizationAPI::UPlayFabLocalizationAPI() {} + +UPlayFabLocalizationAPI::~UPlayFabLocalizationAPI() {} + +int UPlayFabLocalizationAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabLocalizationAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabLocalizationAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabLocalizationAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabLocalizationAPI::GetLanguageList( + + const FGetLanguageListDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Locale/GetLanguageList")), TEXT("{}"), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabLocalizationAPI::OnGetLanguageListResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabLocalizationAPI::OnGetLanguageListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLanguageListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + LocalizationModels::FGetLanguageListResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabLocalizationDataModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabLocalizationDataModels.cpp new file mode 100644 index 000000000..2c773d7c2 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabLocalizationDataModels.cpp @@ -0,0 +1,62 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabLocalizationDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::LocalizationModels; + +PlayFab::LocalizationModels::FGetLanguageListRequest::~FGetLanguageListRequest() +{ + +} + +void PlayFab::LocalizationModels::FGetLanguageListRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::LocalizationModels::FGetLanguageListRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::LocalizationModels::FGetLanguageListResponse::~FGetLanguageListResponse() +{ + +} + +void PlayFab::LocalizationModels::FGetLanguageListResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (LanguageList.Num() != 0) + { + writer->WriteArrayStart(TEXT("LanguageList")); + for (const FString& item : LanguageList) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::LocalizationModels::FGetLanguageListResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("LanguageList"), LanguageList); + + return HasSucceeded; +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabMatchmakerAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabMatchmakerAPI.cpp new file mode 100644 index 000000000..23abe4731 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabMatchmakerAPI.cpp @@ -0,0 +1,173 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabMatchmakerAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::MatchmakerModels; + +UPlayFabMatchmakerAPI::UPlayFabMatchmakerAPI() {} + +UPlayFabMatchmakerAPI::~UPlayFabMatchmakerAPI() {} + +int UPlayFabMatchmakerAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabMatchmakerAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabMatchmakerAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabMatchmakerAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabMatchmakerAPI::AuthUser( + MatchmakerModels::FAuthUserRequest& request, + const FAuthUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Matchmaker/AuthUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabMatchmakerAPI::OnAuthUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabMatchmakerAPI::OnAuthUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAuthUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + MatchmakerModels::FAuthUserResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabMatchmakerAPI::PlayerJoined( + MatchmakerModels::FPlayerJoinedRequest& request, + const FPlayerJoinedDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Matchmaker/PlayerJoined")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabMatchmakerAPI::OnPlayerJoinedResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabMatchmakerAPI::OnPlayerJoinedResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPlayerJoinedDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + MatchmakerModels::FPlayerJoinedResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabMatchmakerAPI::PlayerLeft( + MatchmakerModels::FPlayerLeftRequest& request, + const FPlayerLeftDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Matchmaker/PlayerLeft")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabMatchmakerAPI::OnPlayerLeftResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabMatchmakerAPI::OnPlayerLeftResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPlayerLeftDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + MatchmakerModels::FPlayerLeftResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabMatchmakerAPI::StartGame( + MatchmakerModels::FStartGameRequest& request, + const FStartGameDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Matchmaker/StartGame")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabMatchmakerAPI::OnStartGameResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabMatchmakerAPI::OnStartGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FStartGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + MatchmakerModels::FStartGameResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabMatchmakerAPI::UserInfo( + MatchmakerModels::FUserInfoRequest& request, + const FUserInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Matchmaker/UserInfo")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabMatchmakerAPI::OnUserInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabMatchmakerAPI::OnUserInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUserInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + MatchmakerModels::FUserInfoResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabMatchmakerDataModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabMatchmakerDataModels.cpp new file mode 100644 index 000000000..5358efc97 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabMatchmakerDataModels.cpp @@ -0,0 +1,734 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabMatchmakerDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::MatchmakerModels; + +PlayFab::MatchmakerModels::FAuthUserRequest::~FAuthUserRequest() +{ + +} + +void PlayFab::MatchmakerModels::FAuthUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AuthorizationTicket")); writer->WriteValue(AuthorizationTicket); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FAuthUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AuthorizationTicketValue = obj->TryGetField(TEXT("AuthorizationTicket")); + if (AuthorizationTicketValue.IsValid() && !AuthorizationTicketValue->IsNull()) + { + FString TmpValue; + if (AuthorizationTicketValue->TryGetString(TmpValue)) { AuthorizationTicket = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FAuthUserResponse::~FAuthUserResponse() +{ + +} + +void PlayFab::MatchmakerModels::FAuthUserResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Authorized")); writer->WriteValue(Authorized); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FAuthUserResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AuthorizedValue = obj->TryGetField(TEXT("Authorized")); + if (AuthorizedValue.IsValid() && !AuthorizedValue->IsNull()) + { + bool TmpValue; + if (AuthorizedValue->TryGetBool(TmpValue)) { Authorized = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FItemInstance::~FItemInstance() +{ + +} + +void PlayFab::MatchmakerModels::FItemInstance::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (BundleContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundleContents")); + for (const FString& item : BundleContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundleParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BundleParent")); writer->WriteValue(BundleParent); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CustomData.Num() != 0) + { + writer->WriteObjectStart(TEXT("CustomData")); + for (TMap::TConstIterator It(CustomData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Expiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (PurchaseDate.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); } + + if (RemainingUses.notNull()) { writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); } + + if (UnitCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnitCurrency")); writer->WriteValue(UnitCurrency); } + + writer->WriteIdentifierPrefix(TEXT("UnitPrice")); writer->WriteValue(static_cast(UnitPrice)); + + if (UsesIncrementedBy.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsesIncrementedBy")); writer->WriteValue(UsesIncrementedBy); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FItemInstance::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("BundleContents"), BundleContents); + + const TSharedPtr BundleParentValue = obj->TryGetField(TEXT("BundleParent")); + if (BundleParentValue.IsValid() && !BundleParentValue->IsNull()) + { + FString TmpValue; + if (BundleParentValue->TryGetString(TmpValue)) { BundleParent = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr* CustomDataObject; + if (obj->TryGetObjectField(TEXT("CustomData"), CustomDataObject)) + { + for (TMap>::TConstIterator It((*CustomDataObject)->Values); It; ++It) + { + CustomData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + const TSharedPtr UnitCurrencyValue = obj->TryGetField(TEXT("UnitCurrency")); + if (UnitCurrencyValue.IsValid() && !UnitCurrencyValue->IsNull()) + { + FString TmpValue; + if (UnitCurrencyValue->TryGetString(TmpValue)) { UnitCurrency = TmpValue; } + } + + const TSharedPtr UnitPriceValue = obj->TryGetField(TEXT("UnitPrice")); + if (UnitPriceValue.IsValid() && !UnitPriceValue->IsNull()) + { + uint32 TmpValue; + if (UnitPriceValue->TryGetNumber(TmpValue)) { UnitPrice = TmpValue; } + } + + const TSharedPtr UsesIncrementedByValue = obj->TryGetField(TEXT("UsesIncrementedBy")); + if (UsesIncrementedByValue.IsValid() && !UsesIncrementedByValue->IsNull()) + { + int32 TmpValue; + if (UsesIncrementedByValue->TryGetNumber(TmpValue)) { UsesIncrementedBy = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FPlayerJoinedRequest::~FPlayerJoinedRequest() +{ + +} + +void PlayFab::MatchmakerModels::FPlayerJoinedRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FPlayerJoinedRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FPlayerJoinedResponse::~FPlayerJoinedResponse() +{ + +} + +void PlayFab::MatchmakerModels::FPlayerJoinedResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FPlayerJoinedResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FPlayerLeftRequest::~FPlayerLeftRequest() +{ + +} + +void PlayFab::MatchmakerModels::FPlayerLeftRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FPlayerLeftRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FPlayerLeftResponse::~FPlayerLeftResponse() +{ + +} + +void PlayFab::MatchmakerModels::FPlayerLeftResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FPlayerLeftResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +void PlayFab::MatchmakerModels::writeRegionEnumJSON(Region enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case RegionUSCentral: writer->WriteValue(TEXT("USCentral")); break; + case RegionUSEast: writer->WriteValue(TEXT("USEast")); break; + case RegionEUWest: writer->WriteValue(TEXT("EUWest")); break; + case RegionSingapore: writer->WriteValue(TEXT("Singapore")); break; + case RegionJapan: writer->WriteValue(TEXT("Japan")); break; + case RegionBrazil: writer->WriteValue(TEXT("Brazil")); break; + case RegionAustralia: writer->WriteValue(TEXT("Australia")); break; + } +} + +MatchmakerModels::Region PlayFab::MatchmakerModels::readRegionFromValue(const TSharedPtr& value) +{ + return readRegionFromValue(value.IsValid() ? value->AsString() : ""); +} + +MatchmakerModels::Region PlayFab::MatchmakerModels::readRegionFromValue(const FString& value) +{ + static TMap _RegionMap; + if (_RegionMap.Num() == 0) + { + // Auto-generate the map on the first use + _RegionMap.Add(TEXT("USCentral"), RegionUSCentral); + _RegionMap.Add(TEXT("USEast"), RegionUSEast); + _RegionMap.Add(TEXT("EUWest"), RegionEUWest); + _RegionMap.Add(TEXT("Singapore"), RegionSingapore); + _RegionMap.Add(TEXT("Japan"), RegionJapan); + _RegionMap.Add(TEXT("Brazil"), RegionBrazil); + _RegionMap.Add(TEXT("Australia"), RegionAustralia); + + } + + if (!value.IsEmpty()) + { + auto output = _RegionMap.Find(value); + if (output != nullptr) + return *output; + } + + return RegionUSCentral; // Basically critical fail +} + +PlayFab::MatchmakerModels::FStartGameRequest::~FStartGameRequest() +{ + +} + +void PlayFab::MatchmakerModels::FStartGameRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Build")); writer->WriteValue(Build); + + if (CustomCommandLineData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomCommandLineData")); writer->WriteValue(CustomCommandLineData); } + + writer->WriteIdentifierPrefix(TEXT("ExternalMatchmakerEventEndpoint")); writer->WriteValue(ExternalMatchmakerEventEndpoint); + + writer->WriteIdentifierPrefix(TEXT("GameMode")); writer->WriteValue(GameMode); + + writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FStartGameRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildValue = obj->TryGetField(TEXT("Build")); + if (BuildValue.IsValid() && !BuildValue->IsNull()) + { + FString TmpValue; + if (BuildValue->TryGetString(TmpValue)) { Build = TmpValue; } + } + + const TSharedPtr CustomCommandLineDataValue = obj->TryGetField(TEXT("CustomCommandLineData")); + if (CustomCommandLineDataValue.IsValid() && !CustomCommandLineDataValue->IsNull()) + { + FString TmpValue; + if (CustomCommandLineDataValue->TryGetString(TmpValue)) { CustomCommandLineData = TmpValue; } + } + + const TSharedPtr ExternalMatchmakerEventEndpointValue = obj->TryGetField(TEXT("ExternalMatchmakerEventEndpoint")); + if (ExternalMatchmakerEventEndpointValue.IsValid() && !ExternalMatchmakerEventEndpointValue->IsNull()) + { + FString TmpValue; + if (ExternalMatchmakerEventEndpointValue->TryGetString(TmpValue)) { ExternalMatchmakerEventEndpoint = TmpValue; } + } + + const TSharedPtr GameModeValue = obj->TryGetField(TEXT("GameMode")); + if (GameModeValue.IsValid() && !GameModeValue->IsNull()) + { + FString TmpValue; + if (GameModeValue->TryGetString(TmpValue)) { GameMode = TmpValue; } + } + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FStartGameResponse::~FStartGameResponse() +{ + +} + +void PlayFab::MatchmakerModels::FStartGameResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GameID.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameID")); writer->WriteValue(GameID); } + + if (ServerHostname.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerHostname")); writer->WriteValue(ServerHostname); } + + if (ServerIPV4Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV4Address")); writer->WriteValue(ServerIPV4Address); } + + if (ServerIPV6Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV6Address")); writer->WriteValue(ServerIPV6Address); } + + writer->WriteIdentifierPrefix(TEXT("ServerPort")); writer->WriteValue(static_cast(ServerPort)); + + if (ServerPublicDNSName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerPublicDNSName")); writer->WriteValue(ServerPublicDNSName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FStartGameResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameIDValue = obj->TryGetField(TEXT("GameID")); + if (GameIDValue.IsValid() && !GameIDValue->IsNull()) + { + FString TmpValue; + if (GameIDValue->TryGetString(TmpValue)) { GameID = TmpValue; } + } + + const TSharedPtr ServerHostnameValue = obj->TryGetField(TEXT("ServerHostname")); + if (ServerHostnameValue.IsValid() && !ServerHostnameValue->IsNull()) + { + FString TmpValue; + if (ServerHostnameValue->TryGetString(TmpValue)) { ServerHostname = TmpValue; } + } + + const TSharedPtr ServerIPV4AddressValue = obj->TryGetField(TEXT("ServerIPV4Address")); + if (ServerIPV4AddressValue.IsValid() && !ServerIPV4AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV4AddressValue->TryGetString(TmpValue)) { ServerIPV4Address = TmpValue; } + } + + const TSharedPtr ServerIPV6AddressValue = obj->TryGetField(TEXT("ServerIPV6Address")); + if (ServerIPV6AddressValue.IsValid() && !ServerIPV6AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV6AddressValue->TryGetString(TmpValue)) { ServerIPV6Address = TmpValue; } + } + + const TSharedPtr ServerPortValue = obj->TryGetField(TEXT("ServerPort")); + if (ServerPortValue.IsValid() && !ServerPortValue->IsNull()) + { + uint32 TmpValue; + if (ServerPortValue->TryGetNumber(TmpValue)) { ServerPort = TmpValue; } + } + + const TSharedPtr ServerPublicDNSNameValue = obj->TryGetField(TEXT("ServerPublicDNSName")); + if (ServerPublicDNSNameValue.IsValid() && !ServerPublicDNSNameValue->IsNull()) + { + FString TmpValue; + if (ServerPublicDNSNameValue->TryGetString(TmpValue)) { ServerPublicDNSName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FUserInfoRequest::~FUserInfoRequest() +{ + +} + +void PlayFab::MatchmakerModels::FUserInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("MinCatalogVersion")); writer->WriteValue(MinCatalogVersion); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FUserInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MinCatalogVersionValue = obj->TryGetField(TEXT("MinCatalogVersion")); + if (MinCatalogVersionValue.IsValid() && !MinCatalogVersionValue->IsNull()) + { + int32 TmpValue; + if (MinCatalogVersionValue->TryGetNumber(TmpValue)) { MinCatalogVersion = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FVirtualCurrencyRechargeTime::~FVirtualCurrencyRechargeTime() +{ + +} + +void PlayFab::MatchmakerModels::FVirtualCurrencyRechargeTime::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("RechargeMax")); writer->WriteValue(RechargeMax); + + writer->WriteIdentifierPrefix(TEXT("RechargeTime")); writeDatetime(RechargeTime, writer); + + writer->WriteIdentifierPrefix(TEXT("SecondsToRecharge")); writer->WriteValue(SecondsToRecharge); + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FVirtualCurrencyRechargeTime::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RechargeMaxValue = obj->TryGetField(TEXT("RechargeMax")); + if (RechargeMaxValue.IsValid() && !RechargeMaxValue->IsNull()) + { + int32 TmpValue; + if (RechargeMaxValue->TryGetNumber(TmpValue)) { RechargeMax = TmpValue; } + } + + const TSharedPtr RechargeTimeValue = obj->TryGetField(TEXT("RechargeTime")); + if (RechargeTimeValue.IsValid()) + RechargeTime = readDatetime(RechargeTimeValue); + + + const TSharedPtr SecondsToRechargeValue = obj->TryGetField(TEXT("SecondsToRecharge")); + if (SecondsToRechargeValue.IsValid() && !SecondsToRechargeValue->IsNull()) + { + int32 TmpValue; + if (SecondsToRechargeValue->TryGetNumber(TmpValue)) { SecondsToRecharge = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::MatchmakerModels::FUserInfoResponse::~FUserInfoResponse() +{ + +} + +void PlayFab::MatchmakerModels::FUserInfoResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("IsDeveloper")); writer->WriteValue(IsDeveloper); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (SteamId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamId")); writer->WriteValue(SteamId); } + + if (TitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleDisplayName")); writer->WriteValue(TitleDisplayName); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(VirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::MatchmakerModels::FUserInfoResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr IsDeveloperValue = obj->TryGetField(TEXT("IsDeveloper")); + if (IsDeveloperValue.IsValid() && !IsDeveloperValue->IsNull()) + { + bool TmpValue; + if (IsDeveloperValue->TryGetBool(TmpValue)) { IsDeveloper = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr SteamIdValue = obj->TryGetField(TEXT("SteamId")); + if (SteamIdValue.IsValid() && !SteamIdValue->IsNull()) + { + FString TmpValue; + if (SteamIdValue->TryGetString(TmpValue)) { SteamId = TmpValue; } + } + + const TSharedPtr TitleDisplayNameValue = obj->TryGetField(TEXT("TitleDisplayName")); + if (TitleDisplayNameValue.IsValid() && !TitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (TitleDisplayNameValue->TryGetString(TmpValue)) { TitleDisplayName = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyRechargeTimes"), VirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + VirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabProfilesAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabProfilesAPI.cpp new file mode 100644 index 000000000..e4607aba6 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabProfilesAPI.cpp @@ -0,0 +1,200 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabProfilesAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::ProfilesModels; + +UPlayFabProfilesAPI::UPlayFabProfilesAPI() {} + +UPlayFabProfilesAPI::~UPlayFabProfilesAPI() {} + +int UPlayFabProfilesAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabProfilesAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabProfilesAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabProfilesAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabProfilesAPI::GetGlobalPolicy( + + const FGetGlobalPolicyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Profile/GetGlobalPolicy")), TEXT("{}"), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabProfilesAPI::OnGetGlobalPolicyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::OnGetGlobalPolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetGlobalPolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ProfilesModels::FGetGlobalPolicyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabProfilesAPI::GetProfile( + ProfilesModels::FGetEntityProfileRequest& request, + const FGetProfileDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Profile/GetProfile")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabProfilesAPI::OnGetProfileResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::OnGetProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ProfilesModels::FGetEntityProfileResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabProfilesAPI::GetProfiles( + ProfilesModels::FGetEntityProfilesRequest& request, + const FGetProfilesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Profile/GetProfiles")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabProfilesAPI::OnGetProfilesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::OnGetProfilesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetProfilesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ProfilesModels::FGetEntityProfilesResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabProfilesAPI::SetGlobalPolicy( + ProfilesModels::FSetGlobalPolicyRequest& request, + const FSetGlobalPolicyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Profile/SetGlobalPolicy")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabProfilesAPI::OnSetGlobalPolicyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::OnSetGlobalPolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGlobalPolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ProfilesModels::FSetGlobalPolicyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabProfilesAPI::SetProfileLanguage( + ProfilesModels::FSetProfileLanguageRequest& request, + const FSetProfileLanguageDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Profile/SetProfileLanguage")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabProfilesAPI::OnSetProfileLanguageResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::OnSetProfileLanguageResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetProfileLanguageDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ProfilesModels::FSetProfileLanguageResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabProfilesAPI::SetProfilePolicy( + ProfilesModels::FSetEntityProfilePolicyRequest& request, + const FSetProfilePolicyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetEntityToken().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must call GetEntityToken API Method before calling this function.")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Profile/SetProfilePolicy")), request.toJSONString(), TEXT("X-EntityToken"), PlayFabSettings::GetEntityToken()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabProfilesAPI::OnSetProfilePolicyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabProfilesAPI::OnSetProfilePolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetProfilePolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ProfilesModels::FSetEntityProfilePolicyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabProfilesDataModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabProfilesDataModels.cpp new file mode 100644 index 000000000..8c04052a6 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabProfilesDataModels.cpp @@ -0,0 +1,812 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabProfilesDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::ProfilesModels; + +void PlayFab::ProfilesModels::writeEffectTypeEnumJSON(EffectType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case EffectTypeAllow: writer->WriteValue(TEXT("Allow")); break; + case EffectTypeDeny: writer->WriteValue(TEXT("Deny")); break; + } +} + +ProfilesModels::EffectType PlayFab::ProfilesModels::readEffectTypeFromValue(const TSharedPtr& value) +{ + return readEffectTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ProfilesModels::EffectType PlayFab::ProfilesModels::readEffectTypeFromValue(const FString& value) +{ + static TMap _EffectTypeMap; + if (_EffectTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _EffectTypeMap.Add(TEXT("Allow"), EffectTypeAllow); + _EffectTypeMap.Add(TEXT("Deny"), EffectTypeDeny); + + } + + if (!value.IsEmpty()) + { + auto output = _EffectTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return EffectTypeAllow; // Basically critical fail +} + +PlayFab::ProfilesModels::FEntityDataObject::~FEntityDataObject() +{ + +} + +void PlayFab::ProfilesModels::FEntityDataObject::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DataObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("DataObject")); DataObject.writeJSON(writer); } + + if (EscapedDataObject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EscapedDataObject")); writer->WriteValue(EscapedDataObject); } + + if (ObjectName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ObjectName")); writer->WriteValue(ObjectName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FEntityDataObject::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataObjectValue = obj->TryGetField(TEXT("DataObject")); + if (DataObjectValue.IsValid() && !DataObjectValue->IsNull()) + { + DataObject = FJsonKeeper(DataObjectValue); + } + + const TSharedPtr EscapedDataObjectValue = obj->TryGetField(TEXT("EscapedDataObject")); + if (EscapedDataObjectValue.IsValid() && !EscapedDataObjectValue->IsNull()) + { + FString TmpValue; + if (EscapedDataObjectValue->TryGetString(TmpValue)) { EscapedDataObject = TmpValue; } + } + + const TSharedPtr ObjectNameValue = obj->TryGetField(TEXT("ObjectName")); + if (ObjectNameValue.IsValid() && !ObjectNameValue->IsNull()) + { + FString TmpValue; + if (ObjectNameValue->TryGetString(TmpValue)) { ObjectName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::ProfilesModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FEntityPermissionStatement::~FEntityPermissionStatement() +{ + +} + +void PlayFab::ProfilesModels::FEntityPermissionStatement::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Action")); writer->WriteValue(Action); + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + if (Condition.notNull()) { writer->WriteIdentifierPrefix(TEXT("Condition")); Condition.writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Effect")); writeEffectTypeEnumJSON(Effect, writer); + + writer->WriteIdentifierPrefix(TEXT("Principal")); Principal.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("Resource")); writer->WriteValue(Resource); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FEntityPermissionStatement::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActionValue = obj->TryGetField(TEXT("Action")); + if (ActionValue.IsValid() && !ActionValue->IsNull()) + { + FString TmpValue; + if (ActionValue->TryGetString(TmpValue)) { Action = TmpValue; } + } + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ConditionValue = obj->TryGetField(TEXT("Condition")); + if (ConditionValue.IsValid() && !ConditionValue->IsNull()) + { + Condition = FJsonKeeper(ConditionValue); + } + + Effect = readEffectTypeFromValue(obj->TryGetField(TEXT("Effect"))); + + const TSharedPtr PrincipalValue = obj->TryGetField(TEXT("Principal")); + if (PrincipalValue.IsValid() && !PrincipalValue->IsNull()) + { + Principal = FJsonKeeper(PrincipalValue); + } + + const TSharedPtr ResourceValue = obj->TryGetField(TEXT("Resource")); + if (ResourceValue.IsValid() && !ResourceValue->IsNull()) + { + FString TmpValue; + if (ResourceValue->TryGetString(TmpValue)) { Resource = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FEntityProfileFileMetadata::~FEntityProfileFileMetadata() +{ + +} + +void PlayFab::ProfilesModels::FEntityProfileFileMetadata::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Checksum.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Checksum")); writer->WriteValue(Checksum); } + + if (FileName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FileName")); writer->WriteValue(FileName); } + + writer->WriteIdentifierPrefix(TEXT("LastModified")); writeDatetime(LastModified, writer); + + writer->WriteIdentifierPrefix(TEXT("Size")); writer->WriteValue(Size); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FEntityProfileFileMetadata::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ChecksumValue = obj->TryGetField(TEXT("Checksum")); + if (ChecksumValue.IsValid() && !ChecksumValue->IsNull()) + { + FString TmpValue; + if (ChecksumValue->TryGetString(TmpValue)) { Checksum = TmpValue; } + } + + const TSharedPtr FileNameValue = obj->TryGetField(TEXT("FileName")); + if (FileNameValue.IsValid() && !FileNameValue->IsNull()) + { + FString TmpValue; + if (FileNameValue->TryGetString(TmpValue)) { FileName = TmpValue; } + } + + const TSharedPtr LastModifiedValue = obj->TryGetField(TEXT("LastModified")); + if (LastModifiedValue.IsValid()) + LastModified = readDatetime(LastModifiedValue); + + + const TSharedPtr SizeValue = obj->TryGetField(TEXT("Size")); + if (SizeValue.IsValid() && !SizeValue->IsNull()) + { + int32 TmpValue; + if (SizeValue->TryGetNumber(TmpValue)) { Size = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FEntityProfileBody::~FEntityProfileBody() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::ProfilesModels::FEntityProfileBody::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + if (EntityChain.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EntityChain")); writer->WriteValue(EntityChain); } + + if (Files.Num() != 0) + { + writer->WriteObjectStart(TEXT("Files")); + for (TMap::TConstIterator It(Files); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + if (Language.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Language")); writer->WriteValue(Language); } + + if (Objects.Num() != 0) + { + writer->WriteObjectStart(TEXT("Objects")); + for (TMap::TConstIterator It(Objects); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + if (Permissions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Permissions")); + for (const FEntityPermissionStatement& item : Permissions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("VersionNumber")); writer->WriteValue(VersionNumber); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FEntityProfileBody::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr EntityChainValue = obj->TryGetField(TEXT("EntityChain")); + if (EntityChainValue.IsValid() && !EntityChainValue->IsNull()) + { + FString TmpValue; + if (EntityChainValue->TryGetString(TmpValue)) { EntityChain = TmpValue; } + } + + const TSharedPtr* FilesObject; + if (obj->TryGetObjectField(TEXT("Files"), FilesObject)) + { + for (TMap>::TConstIterator It((*FilesObject)->Values); It; ++It) + { + Files.Add(It.Key(), FEntityProfileFileMetadata(It.Value()->AsObject())); + } + } + + const TSharedPtr LanguageValue = obj->TryGetField(TEXT("Language")); + if (LanguageValue.IsValid() && !LanguageValue->IsNull()) + { + FString TmpValue; + if (LanguageValue->TryGetString(TmpValue)) { Language = TmpValue; } + } + + const TSharedPtr* ObjectsObject; + if (obj->TryGetObjectField(TEXT("Objects"), ObjectsObject)) + { + for (TMap>::TConstIterator It((*ObjectsObject)->Values); It; ++It) + { + Objects.Add(It.Key(), FEntityDataObject(It.Value()->AsObject())); + } + } + + const TArray>&PermissionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Permissions")); + for (int32 Idx = 0; Idx < PermissionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PermissionsArray[Idx]; + Permissions.Add(FEntityPermissionStatement(CurrentItem->AsObject())); + } + + + const TSharedPtr VersionNumberValue = obj->TryGetField(TEXT("VersionNumber")); + if (VersionNumberValue.IsValid() && !VersionNumberValue->IsNull()) + { + int32 TmpValue; + if (VersionNumberValue->TryGetNumber(TmpValue)) { VersionNumber = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FGetEntityProfileRequest::~FGetEntityProfileRequest() +{ + +} + +void PlayFab::ProfilesModels::FGetEntityProfileRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DataAsObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("DataAsObject")); writer->WriteValue(DataAsObject); } + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FGetEntityProfileRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataAsObjectValue = obj->TryGetField(TEXT("DataAsObject")); + if (DataAsObjectValue.IsValid() && !DataAsObjectValue->IsNull()) + { + bool TmpValue; + if (DataAsObjectValue->TryGetBool(TmpValue)) { DataAsObject = TmpValue; } + } + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FGetEntityProfileResponse::~FGetEntityProfileResponse() +{ + //if (Profile != nullptr) delete Profile; + +} + +void PlayFab::ProfilesModels::FGetEntityProfileResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Profile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Profile")); Profile->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FGetEntityProfileResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ProfileValue = obj->TryGetField(TEXT("Profile")); + if (ProfileValue.IsValid() && !ProfileValue->IsNull()) + { + Profile = MakeShareable(new FEntityProfileBody(ProfileValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FGetEntityProfilesRequest::~FGetEntityProfilesRequest() +{ + +} + +void PlayFab::ProfilesModels::FGetEntityProfilesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DataAsObject.notNull()) { writer->WriteIdentifierPrefix(TEXT("DataAsObject")); writer->WriteValue(DataAsObject); } + + writer->WriteArrayStart(TEXT("Entities")); + for (const FEntityKey& item : Entities) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FGetEntityProfilesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataAsObjectValue = obj->TryGetField(TEXT("DataAsObject")); + if (DataAsObjectValue.IsValid() && !DataAsObjectValue->IsNull()) + { + bool TmpValue; + if (DataAsObjectValue->TryGetBool(TmpValue)) { DataAsObject = TmpValue; } + } + + const TArray>&EntitiesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Entities")); + for (int32 Idx = 0; Idx < EntitiesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = EntitiesArray[Idx]; + Entities.Add(FEntityKey(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FGetEntityProfilesResponse::~FGetEntityProfilesResponse() +{ + +} + +void PlayFab::ProfilesModels::FGetEntityProfilesResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Profiles.Num() != 0) + { + writer->WriteArrayStart(TEXT("Profiles")); + for (const FEntityProfileBody& item : Profiles) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FGetEntityProfilesResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ProfilesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Profiles")); + for (int32 Idx = 0; Idx < ProfilesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ProfilesArray[Idx]; + Profiles.Add(FEntityProfileBody(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FGetGlobalPolicyRequest::~FGetGlobalPolicyRequest() +{ + +} + +void PlayFab::ProfilesModels::FGetGlobalPolicyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FGetGlobalPolicyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FGetGlobalPolicyResponse::~FGetGlobalPolicyResponse() +{ + +} + +void PlayFab::ProfilesModels::FGetGlobalPolicyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Permissions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Permissions")); + for (const FEntityPermissionStatement& item : Permissions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FGetGlobalPolicyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&PermissionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Permissions")); + for (int32 Idx = 0; Idx < PermissionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PermissionsArray[Idx]; + Permissions.Add(FEntityPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +void PlayFab::ProfilesModels::writeOperationTypesEnumJSON(OperationTypes enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case OperationTypesCreated: writer->WriteValue(TEXT("Created")); break; + case OperationTypesUpdated: writer->WriteValue(TEXT("Updated")); break; + case OperationTypesDeleted: writer->WriteValue(TEXT("Deleted")); break; + case OperationTypesNone: writer->WriteValue(TEXT("None")); break; + } +} + +ProfilesModels::OperationTypes PlayFab::ProfilesModels::readOperationTypesFromValue(const TSharedPtr& value) +{ + return readOperationTypesFromValue(value.IsValid() ? value->AsString() : ""); +} + +ProfilesModels::OperationTypes PlayFab::ProfilesModels::readOperationTypesFromValue(const FString& value) +{ + static TMap _OperationTypesMap; + if (_OperationTypesMap.Num() == 0) + { + // Auto-generate the map on the first use + _OperationTypesMap.Add(TEXT("Created"), OperationTypesCreated); + _OperationTypesMap.Add(TEXT("Updated"), OperationTypesUpdated); + _OperationTypesMap.Add(TEXT("Deleted"), OperationTypesDeleted); + _OperationTypesMap.Add(TEXT("None"), OperationTypesNone); + + } + + if (!value.IsEmpty()) + { + auto output = _OperationTypesMap.Find(value); + if (output != nullptr) + return *output; + } + + return OperationTypesCreated; // Basically critical fail +} + +PlayFab::ProfilesModels::FSetEntityProfilePolicyRequest::~FSetEntityProfilePolicyRequest() +{ + +} + +void PlayFab::ProfilesModels::FSetEntityProfilePolicyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Entity")); Entity.writeJSON(writer); + + if (Statements.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statements")); + for (const FEntityPermissionStatement& item : Statements) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FSetEntityProfilePolicyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = FEntityKey(EntityValue->AsObject()); + } + + const TArray>&StatementsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statements")); + for (int32 Idx = 0; Idx < StatementsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatementsArray[Idx]; + Statements.Add(FEntityPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FSetEntityProfilePolicyResponse::~FSetEntityProfilePolicyResponse() +{ + +} + +void PlayFab::ProfilesModels::FSetEntityProfilePolicyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Permissions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Permissions")); + for (const FEntityPermissionStatement& item : Permissions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FSetEntityProfilePolicyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&PermissionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Permissions")); + for (int32 Idx = 0; Idx < PermissionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PermissionsArray[Idx]; + Permissions.Add(FEntityPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FSetGlobalPolicyRequest::~FSetGlobalPolicyRequest() +{ + +} + +void PlayFab::ProfilesModels::FSetGlobalPolicyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Permissions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Permissions")); + for (const FEntityPermissionStatement& item : Permissions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FSetGlobalPolicyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&PermissionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Permissions")); + for (int32 Idx = 0; Idx < PermissionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PermissionsArray[Idx]; + Permissions.Add(FEntityPermissionStatement(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FSetGlobalPolicyResponse::~FSetGlobalPolicyResponse() +{ + +} + +void PlayFab::ProfilesModels::FSetGlobalPolicyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FSetGlobalPolicyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FSetProfileLanguageRequest::~FSetProfileLanguageRequest() +{ + //if (Entity != nullptr) delete Entity; + +} + +void PlayFab::ProfilesModels::FSetProfileLanguageRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Entity.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Entity")); Entity->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ExpectedVersion")); writer->WriteValue(ExpectedVersion); + + if (Language.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Language")); writer->WriteValue(Language); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FSetProfileLanguageRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EntityValue = obj->TryGetField(TEXT("Entity")); + if (EntityValue.IsValid() && !EntityValue->IsNull()) + { + Entity = MakeShareable(new FEntityKey(EntityValue->AsObject())); + } + + const TSharedPtr ExpectedVersionValue = obj->TryGetField(TEXT("ExpectedVersion")); + if (ExpectedVersionValue.IsValid() && !ExpectedVersionValue->IsNull()) + { + int32 TmpValue; + if (ExpectedVersionValue->TryGetNumber(TmpValue)) { ExpectedVersion = TmpValue; } + } + + const TSharedPtr LanguageValue = obj->TryGetField(TEXT("Language")); + if (LanguageValue.IsValid() && !LanguageValue->IsNull()) + { + FString TmpValue; + if (LanguageValue->TryGetString(TmpValue)) { Language = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ProfilesModels::FSetProfileLanguageResponse::~FSetProfileLanguageResponse() +{ + +} + +void PlayFab::ProfilesModels::FSetProfileLanguageResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (OperationResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("OperationResult")); writeOperationTypesEnumJSON(OperationResult, writer); } + + if (VersionNumber.notNull()) { writer->WriteIdentifierPrefix(TEXT("VersionNumber")); writer->WriteValue(VersionNumber); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ProfilesModels::FSetProfileLanguageResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + OperationResult = readOperationTypesFromValue(obj->TryGetField(TEXT("OperationResult"))); + + const TSharedPtr VersionNumberValue = obj->TryGetField(TEXT("VersionNumber")); + if (VersionNumberValue.IsValid() && !VersionNumberValue->IsNull()) + { + int32 TmpValue; + if (VersionNumberValue->TryGetNumber(TmpValue)) { VersionNumber = TmpValue; } + } + + return HasSucceeded; +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabResultHandler.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabResultHandler.cpp new file mode 100644 index 000000000..7f44b99bf --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabResultHandler.cpp @@ -0,0 +1,115 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFabResultHandler.h" +#include "PlayFabSettings.h" +#include "PlayFab.h" + +using namespace PlayFab; + +int PlayFabRequestHandler::pendingCalls = 0; + +int PlayFabRequestHandler::GetPendingCalls() +{ + return PlayFabRequestHandler::pendingCalls; +} + +TSharedRef PlayFabRequestHandler::SendRequest(const FString& url, const FString& callBody, const FString& authKey, const FString& authValue) +{ + if (PlayFabSettings::GetTitleId().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must define a titleID before making API Calls.")); + } + PlayFabRequestHandler::pendingCalls += 1; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetVerb(TEXT("POST")); + HttpRequest->SetURL(url); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetHeader(TEXT("X-PlayFabSDK"), PlayFabSettings::versionString); + + if (authKey != TEXT("")) + HttpRequest->SetHeader(authKey, authValue); + + HttpRequest->SetContentAsString(callBody); + return HttpRequest; +} + +bool PlayFabRequestHandler::DecodeRequest(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, PlayFab::FPlayFabBaseModel& OutResult, PlayFab::FPlayFabError& OutError) +{ + PlayFabRequestHandler::pendingCalls -= 1; + + FString ResponseStr, ErrorStr; + if (bSucceeded && HttpResponse.IsValid()) + { + if (EHttpResponseCodes::IsOk(HttpResponse->GetResponseCode())) + { + // Create the Json parser + ResponseStr = HttpResponse->GetContentAsString(); + TSharedPtr JsonObject; + TSharedRef > JsonReader = TJsonReaderFactory<>::Create(ResponseStr); + + if (FJsonSerializer::Deserialize(JsonReader, JsonObject) && JsonObject.IsValid()) + { + if (PlayFabRequestHandler::DecodeError(JsonObject, OutError)) + { + return false; + } + + const TSharedPtr* DataJsonObject; + if (JsonObject->TryGetObjectField(TEXT("data"), DataJsonObject)) + { + return OutResult.readFromValue(*DataJsonObject); + } + } + } + else + { + // Create the Json parser + ResponseStr = HttpResponse->GetContentAsString(); + TSharedPtr JsonObject; + TSharedRef > JsonReader = TJsonReaderFactory<>::Create(ResponseStr); + + if (FJsonSerializer::Deserialize(JsonReader, JsonObject) && JsonObject.IsValid()) + { + if (PlayFabRequestHandler::DecodeError(JsonObject, OutError)) + { + return false; + } + } + } + } + + // If we get here, we failed to connect meaningfully to the server - Assume a timeout + OutError.HttpCode = 408; + OutError.ErrorCode = PlayFabErrorConnectionTimeout; + // For text returns, use the non-json response if possible, else default to no response + OutError.ErrorName = OutError.ErrorMessage = OutError.HttpStatus = TEXT("Request Timeout or null response"); + + return false; +} + +bool PlayFabRequestHandler::DecodeError(TSharedPtr JsonObject, PlayFab::FPlayFabError& OutError) +{ + // check if returned json indicates an error + if (JsonObject->HasField(TEXT("errorCode"))) + { + // deserialize the FPlayFabError object + JsonObject->TryGetNumberField(TEXT("errorCode"), OutError.ErrorCode); + JsonObject->TryGetNumberField(TEXT("code"), OutError.HttpCode); + JsonObject->TryGetStringField(TEXT("status"), OutError.HttpStatus); + JsonObject->TryGetStringField(TEXT("error"), OutError.ErrorName); + JsonObject->TryGetStringField(TEXT("errorMessage"), OutError.ErrorMessage); + + // TODO: handle error details properly + //"errorDetails" + + // TODO: handle global error delegate here + + // We encountered no errors parsing the error + return true; + } + + return false; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabServerAPI.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabServerAPI.cpp new file mode 100644 index 000000000..a612d5517 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabServerAPI.cpp @@ -0,0 +1,3089 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#include "Core/PlayFabServerAPI.h" +#include "Core/PlayFabSettings.h" +#include "Core/PlayFabResultHandler.h" +#include "PlayFab.h" + +using namespace PlayFab; +using namespace PlayFab::ServerModels; + +UPlayFabServerAPI::UPlayFabServerAPI() {} + +UPlayFabServerAPI::~UPlayFabServerAPI() {} + +int UPlayFabServerAPI::GetPendingCalls() const +{ + return PlayFabRequestHandler::GetPendingCalls(); +} + +FString UPlayFabServerAPI::GetBuildIdentifier() const +{ + return PlayFabSettings::buildIdentifier; +} + +void UPlayFabServerAPI::SetTitleId(const FString& titleId) +{ + PlayFabSettings::SetTitleId(titleId); +} + +void UPlayFabServerAPI::SetDevSecretKey(const FString& developerSecretKey) +{ + PlayFabSettings::SetDeveloperSecretKey(developerSecretKey); +} + +bool UPlayFabServerAPI::AddCharacterVirtualCurrency( + ServerModels::FAddCharacterVirtualCurrencyRequest& request, + const FAddCharacterVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AddCharacterVirtualCurrency")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAddCharacterVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAddCharacterVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddCharacterVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FModifyCharacterVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::AddFriend( + ServerModels::FAddFriendRequest& request, + const FAddFriendDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AddFriend")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAddFriendResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAddFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::AddPlayerTag( + ServerModels::FAddPlayerTagRequest& request, + const FAddPlayerTagDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AddPlayerTag")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAddPlayerTagResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAddPlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddPlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FAddPlayerTagResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::AddSharedGroupMembers( + ServerModels::FAddSharedGroupMembersRequest& request, + const FAddSharedGroupMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AddSharedGroupMembers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAddSharedGroupMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAddSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FAddSharedGroupMembersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::AddUserVirtualCurrency( + ServerModels::FAddUserVirtualCurrencyRequest& request, + const FAddUserVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AddUserVirtualCurrency")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAddUserVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAddUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FModifyUserVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::AuthenticateSessionTicket( + ServerModels::FAuthenticateSessionTicketRequest& request, + const FAuthenticateSessionTicketDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AuthenticateSessionTicket")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAuthenticateSessionTicketResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAuthenticateSessionTicketResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAuthenticateSessionTicketDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FAuthenticateSessionTicketResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::AwardSteamAchievement( + ServerModels::FAwardSteamAchievementRequest& request, + const FAwardSteamAchievementDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/AwardSteamAchievement")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnAwardSteamAchievementResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnAwardSteamAchievementResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAwardSteamAchievementDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FAwardSteamAchievementResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::BanUsers( + ServerModels::FBanUsersRequest& request, + const FBanUsersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/BanUsers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnBanUsersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnBanUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FBanUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FBanUsersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::ConsumeItem( + ServerModels::FConsumeItemRequest& request, + const FConsumeItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/ConsumeItem")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnConsumeItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnConsumeItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConsumeItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FConsumeItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::CreateSharedGroup( + ServerModels::FCreateSharedGroupRequest& request, + const FCreateSharedGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/CreateSharedGroup")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnCreateSharedGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnCreateSharedGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateSharedGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FCreateSharedGroupResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::DeleteCharacterFromUser( + ServerModels::FDeleteCharacterFromUserRequest& request, + const FDeleteCharacterFromUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/DeleteCharacterFromUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnDeleteCharacterFromUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnDeleteCharacterFromUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteCharacterFromUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FDeleteCharacterFromUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::DeleteSharedGroup( + ServerModels::FDeleteSharedGroupRequest& request, + const FDeleteSharedGroupDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/DeleteSharedGroup")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnDeleteSharedGroupResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnDeleteSharedGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteSharedGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::DeleteUsers( + ServerModels::FDeleteUsersRequest& request, + const FDeleteUsersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/DeleteUsers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnDeleteUsersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnDeleteUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FDeleteUsersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::DeregisterGame( + ServerModels::FDeregisterGameRequest& request, + const FDeregisterGameDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/DeregisterGame")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnDeregisterGameResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnDeregisterGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeregisterGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FDeregisterGameResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::EvaluateRandomResultTable( + ServerModels::FEvaluateRandomResultTableRequest& request, + const FEvaluateRandomResultTableDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/EvaluateRandomResultTable")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnEvaluateRandomResultTableResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnEvaluateRandomResultTableResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FEvaluateRandomResultTableDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEvaluateRandomResultTableResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::ExecuteCloudScript( + ServerModels::FExecuteCloudScriptServerRequest& request, + const FExecuteCloudScriptDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/ExecuteCloudScript")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnExecuteCloudScriptResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnExecuteCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExecuteCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FExecuteCloudScriptResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetAllSegments( + + const FGetAllSegmentsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetAllSegments")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetAllSegmentsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetAllSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetAllSegmentsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetAllUsersCharacters( + ServerModels::FListUsersCharactersRequest& request, + const FGetAllUsersCharactersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetAllUsersCharacters")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetAllUsersCharactersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetAllUsersCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllUsersCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FListUsersCharactersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCatalogItems( + ServerModels::FGetCatalogItemsRequest& request, + const FGetCatalogItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCatalogItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCatalogItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCatalogItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCharacterData( + ServerModels::FGetCharacterDataRequest& request, + const FGetCharacterDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCharacterData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCharacterDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCharacterInternalData( + ServerModels::FGetCharacterDataRequest& request, + const FGetCharacterInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCharacterInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCharacterInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCharacterInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCharacterInventory( + ServerModels::FGetCharacterInventoryRequest& request, + const FGetCharacterInventoryDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCharacterInventory")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCharacterInventoryResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCharacterInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCharacterInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCharacterLeaderboard( + ServerModels::FGetCharacterLeaderboardRequest& request, + const FGetCharacterLeaderboardDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCharacterLeaderboard")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCharacterLeaderboardResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCharacterLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCharacterLeaderboardResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCharacterReadOnlyData( + ServerModels::FGetCharacterDataRequest& request, + const FGetCharacterReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCharacterReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCharacterReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCharacterReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetCharacterStatistics( + ServerModels::FGetCharacterStatisticsRequest& request, + const FGetCharacterStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetCharacterStatistics")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetCharacterStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetCharacterStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetContentDownloadUrl( + ServerModels::FGetContentDownloadUrlRequest& request, + const FGetContentDownloadUrlDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetContentDownloadUrl")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetContentDownloadUrlResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetContentDownloadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentDownloadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetContentDownloadUrlResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetFriendLeaderboard( + ServerModels::FGetFriendLeaderboardRequest& request, + const FGetFriendLeaderboardDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetFriendLeaderboard")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetFriendLeaderboardResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetFriendLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetLeaderboardResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetFriendsList( + ServerModels::FGetFriendsListRequest& request, + const FGetFriendsListDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetFriendsList")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetFriendsListResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetFriendsListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendsListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetFriendsListResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetLeaderboard( + ServerModels::FGetLeaderboardRequest& request, + const FGetLeaderboardDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetLeaderboard")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetLeaderboardResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetLeaderboardResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetLeaderboardAroundCharacter( + ServerModels::FGetLeaderboardAroundCharacterRequest& request, + const FGetLeaderboardAroundCharacterDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetLeaderboardAroundCharacter")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetLeaderboardAroundCharacterResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetLeaderboardAroundCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetLeaderboardAroundCharacterResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetLeaderboardAroundUser( + ServerModels::FGetLeaderboardAroundUserRequest& request, + const FGetLeaderboardAroundUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetLeaderboardAroundUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetLeaderboardAroundUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetLeaderboardAroundUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetLeaderboardAroundUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetLeaderboardForUserCharacters( + ServerModels::FGetLeaderboardForUsersCharactersRequest& request, + const FGetLeaderboardForUserCharactersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetLeaderboardForUserCharacters")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetLeaderboardForUserCharactersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetLeaderboardForUserCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardForUserCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetLeaderboardForUsersCharactersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayerCombinedInfo( + ServerModels::FGetPlayerCombinedInfoRequest& request, + const FGetPlayerCombinedInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayerCombinedInfo")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayerCombinedInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayerCombinedInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerCombinedInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayerCombinedInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayerProfile( + ServerModels::FGetPlayerProfileRequest& request, + const FGetPlayerProfileDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayerProfile")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayerProfileResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayerProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayerProfileResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayerSegments( + ServerModels::FGetPlayersSegmentsRequest& request, + const FGetPlayerSegmentsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayerSegments")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayerSegmentsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayerSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayerSegmentsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayersInSegment( + ServerModels::FGetPlayersInSegmentRequest& request, + const FGetPlayersInSegmentDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayersInSegment")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayersInSegmentResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayersInSegmentResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayersInSegmentDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayersInSegmentResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayerStatistics( + ServerModels::FGetPlayerStatisticsRequest& request, + const FGetPlayerStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayerStatistics")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayerStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayerStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayerStatisticVersions( + ServerModels::FGetPlayerStatisticVersionsRequest& request, + const FGetPlayerStatisticVersionsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayerStatisticVersions")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayerStatisticVersionsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayerStatisticVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayerStatisticVersionsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayerTags( + ServerModels::FGetPlayerTagsRequest& request, + const FGetPlayerTagsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayerTags")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayerTagsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayerTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayerTagsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayFabIDsFromFacebookIDs( + ServerModels::FGetPlayFabIDsFromFacebookIDsRequest& request, + const FGetPlayFabIDsFromFacebookIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayFabIDsFromFacebookIDs")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayFabIDsFromFacebookIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayFabIDsFromFacebookIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayFabIDsFromFacebookIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayFabIDsFromFacebookInstantGamesIds( + ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest& request, + const FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayFabIDsFromFacebookInstantGamesIds")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayFabIDsFromFacebookInstantGamesIdsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayFabIDsFromFacebookInstantGamesIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayFabIDsFromNintendoSwitchDeviceIds( + ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& request, + const FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayFabIDsFromNintendoSwitchDeviceIds")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPlayFabIDsFromSteamIDs( + ServerModels::FGetPlayFabIDsFromSteamIDsRequest& request, + const FGetPlayFabIDsFromSteamIDsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPlayFabIDsFromSteamIDs")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPlayFabIDsFromSteamIDsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPlayFabIDsFromSteamIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromSteamIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPlayFabIDsFromSteamIDsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetPublisherData( + ServerModels::FGetPublisherDataRequest& request, + const FGetPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetPublisherDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetRandomResultTables( + ServerModels::FGetRandomResultTablesRequest& request, + const FGetRandomResultTablesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetRandomResultTables")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetRandomResultTablesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetRandomResultTablesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetRandomResultTablesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetRandomResultTablesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetSharedGroupData( + ServerModels::FGetSharedGroupDataRequest& request, + const FGetSharedGroupDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetSharedGroupData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetSharedGroupDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetSharedGroupDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetTime( + + const FGetTimeDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetTime")), TEXT("{}"), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetTimeResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetTimeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTimeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetTimeResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetTitleData( + ServerModels::FGetTitleDataRequest& request, + const FGetTitleDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetTitleData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetTitleDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetTitleInternalData( + ServerModels::FGetTitleDataRequest& request, + const FGetTitleInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetTitleInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetTitleInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetTitleNews( + ServerModels::FGetTitleNewsRequest& request, + const FGetTitleNewsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetTitleNews")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetTitleNewsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetTitleNewsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleNewsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetTitleNewsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserAccountInfo( + ServerModels::FGetUserAccountInfoRequest& request, + const FGetUserAccountInfoDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserAccountInfo")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserAccountInfoResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserAccountInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserAccountInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserAccountInfoResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserBans( + ServerModels::FGetUserBansRequest& request, + const FGetUserBansDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserBans")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserBansResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserBansResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserData( + ServerModels::FGetUserDataRequest& request, + const FGetUserDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserInternalData( + ServerModels::FGetUserDataRequest& request, + const FGetUserInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserInventory( + ServerModels::FGetUserInventoryRequest& request, + const FGetUserInventoryDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserInventory")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserInventoryResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserPublisherData( + ServerModels::FGetUserDataRequest& request, + const FGetUserPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserPublisherInternalData( + ServerModels::FGetUserDataRequest& request, + const FGetUserPublisherInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserPublisherInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserPublisherInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserPublisherReadOnlyData( + ServerModels::FGetUserDataRequest& request, + const FGetUserPublisherReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserPublisherReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserPublisherReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GetUserReadOnlyData( + ServerModels::FGetUserDataRequest& request, + const FGetUserReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GetUserReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGetUserReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGetUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGetUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GrantCharacterToUser( + ServerModels::FGrantCharacterToUserRequest& request, + const FGrantCharacterToUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GrantCharacterToUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGrantCharacterToUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGrantCharacterToUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantCharacterToUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGrantCharacterToUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GrantItemsToCharacter( + ServerModels::FGrantItemsToCharacterRequest& request, + const FGrantItemsToCharacterDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GrantItemsToCharacter")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGrantItemsToCharacterResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGrantItemsToCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGrantItemsToCharacterResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GrantItemsToUser( + ServerModels::FGrantItemsToUserRequest& request, + const FGrantItemsToUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GrantItemsToUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGrantItemsToUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGrantItemsToUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGrantItemsToUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::GrantItemsToUsers( + ServerModels::FGrantItemsToUsersRequest& request, + const FGrantItemsToUsersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/GrantItemsToUsers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnGrantItemsToUsersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnGrantItemsToUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FGrantItemsToUsersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::ModifyItemUses( + ServerModels::FModifyItemUsesRequest& request, + const FModifyItemUsesDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/ModifyItemUses")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnModifyItemUsesResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnModifyItemUsesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FModifyItemUsesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FModifyItemUsesResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::MoveItemToCharacterFromCharacter( + ServerModels::FMoveItemToCharacterFromCharacterRequest& request, + const FMoveItemToCharacterFromCharacterDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/MoveItemToCharacterFromCharacter")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnMoveItemToCharacterFromCharacterResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnMoveItemToCharacterFromCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveItemToCharacterFromCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FMoveItemToCharacterFromCharacterResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::MoveItemToCharacterFromUser( + ServerModels::FMoveItemToCharacterFromUserRequest& request, + const FMoveItemToCharacterFromUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/MoveItemToCharacterFromUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnMoveItemToCharacterFromUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnMoveItemToCharacterFromUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveItemToCharacterFromUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FMoveItemToCharacterFromUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::MoveItemToUserFromCharacter( + ServerModels::FMoveItemToUserFromCharacterRequest& request, + const FMoveItemToUserFromCharacterDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/MoveItemToUserFromCharacter")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnMoveItemToUserFromCharacterResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnMoveItemToUserFromCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveItemToUserFromCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FMoveItemToUserFromCharacterResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::NotifyMatchmakerPlayerLeft( + ServerModels::FNotifyMatchmakerPlayerLeftRequest& request, + const FNotifyMatchmakerPlayerLeftDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/NotifyMatchmakerPlayerLeft")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnNotifyMatchmakerPlayerLeftResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnNotifyMatchmakerPlayerLeftResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FNotifyMatchmakerPlayerLeftDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FNotifyMatchmakerPlayerLeftResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RedeemCoupon( + ServerModels::FRedeemCouponRequest& request, + const FRedeemCouponDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RedeemCoupon")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRedeemCouponResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRedeemCouponResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRedeemCouponDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRedeemCouponResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RedeemMatchmakerTicket( + ServerModels::FRedeemMatchmakerTicketRequest& request, + const FRedeemMatchmakerTicketDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RedeemMatchmakerTicket")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRedeemMatchmakerTicketResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRedeemMatchmakerTicketResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRedeemMatchmakerTicketDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRedeemMatchmakerTicketResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RefreshGameServerInstanceHeartbeat( + ServerModels::FRefreshGameServerInstanceHeartbeatRequest& request, + const FRefreshGameServerInstanceHeartbeatDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RefreshGameServerInstanceHeartbeat")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRefreshGameServerInstanceHeartbeatResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRefreshGameServerInstanceHeartbeatResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefreshGameServerInstanceHeartbeatDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRefreshGameServerInstanceHeartbeatResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RegisterGame( + ServerModels::FRegisterGameRequest& request, + const FRegisterGameDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RegisterGame")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRegisterGameResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRegisterGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRegisterGameResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RemoveFriend( + ServerModels::FRemoveFriendRequest& request, + const FRemoveFriendDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RemoveFriend")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRemoveFriendResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRemoveFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RemovePlayerTag( + ServerModels::FRemovePlayerTagRequest& request, + const FRemovePlayerTagDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RemovePlayerTag")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRemovePlayerTagResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRemovePlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemovePlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRemovePlayerTagResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RemoveSharedGroupMembers( + ServerModels::FRemoveSharedGroupMembersRequest& request, + const FRemoveSharedGroupMembersDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RemoveSharedGroupMembers")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRemoveSharedGroupMembersResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRemoveSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRemoveSharedGroupMembersResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::ReportPlayer( + ServerModels::FReportPlayerServerRequest& request, + const FReportPlayerDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/ReportPlayer")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnReportPlayerResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnReportPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FReportPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FReportPlayerServerResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RevokeAllBansForUser( + ServerModels::FRevokeAllBansForUserRequest& request, + const FRevokeAllBansForUserDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RevokeAllBansForUser")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRevokeAllBansForUserResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRevokeAllBansForUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeAllBansForUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRevokeAllBansForUserResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RevokeBans( + ServerModels::FRevokeBansRequest& request, + const FRevokeBansDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RevokeBans")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRevokeBansResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRevokeBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRevokeBansResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RevokeInventoryItem( + ServerModels::FRevokeInventoryItemRequest& request, + const FRevokeInventoryItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RevokeInventoryItem")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRevokeInventoryItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRevokeInventoryItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRevokeInventoryResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::RevokeInventoryItems( + ServerModels::FRevokeInventoryItemsRequest& request, + const FRevokeInventoryItemsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/RevokeInventoryItems")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnRevokeInventoryItemsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnRevokeInventoryItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FRevokeInventoryItemsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SendCustomAccountRecoveryEmail( + ServerModels::FSendCustomAccountRecoveryEmailRequest& request, + const FSendCustomAccountRecoveryEmailDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SendCustomAccountRecoveryEmail")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSendCustomAccountRecoveryEmailResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSendCustomAccountRecoveryEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendCustomAccountRecoveryEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSendCustomAccountRecoveryEmailResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SendEmailFromTemplate( + ServerModels::FSendEmailFromTemplateRequest& request, + const FSendEmailFromTemplateDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SendEmailFromTemplate")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSendEmailFromTemplateResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSendEmailFromTemplateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendEmailFromTemplateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSendEmailFromTemplateResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SendPushNotification( + ServerModels::FSendPushNotificationRequest& request, + const FSendPushNotificationDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SendPushNotification")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSendPushNotificationResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSendPushNotificationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendPushNotificationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSendPushNotificationResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetFriendTags( + ServerModels::FSetFriendTagsRequest& request, + const FSetFriendTagsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetFriendTags")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetFriendTagsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetFriendTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetFriendTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetGameServerInstanceData( + ServerModels::FSetGameServerInstanceDataRequest& request, + const FSetGameServerInstanceDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetGameServerInstanceData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetGameServerInstanceDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetGameServerInstanceDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGameServerInstanceDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetGameServerInstanceDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetGameServerInstanceState( + ServerModels::FSetGameServerInstanceStateRequest& request, + const FSetGameServerInstanceStateDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetGameServerInstanceState")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetGameServerInstanceStateResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetGameServerInstanceStateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGameServerInstanceStateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetGameServerInstanceStateResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetGameServerInstanceTags( + ServerModels::FSetGameServerInstanceTagsRequest& request, + const FSetGameServerInstanceTagsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetGameServerInstanceTags")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetGameServerInstanceTagsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetGameServerInstanceTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGameServerInstanceTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetGameServerInstanceTagsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetPlayerSecret( + ServerModels::FSetPlayerSecretRequest& request, + const FSetPlayerSecretDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetPlayerSecret")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetPlayerSecretResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetPlayerSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPlayerSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetPlayerSecretResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetPublisherData( + ServerModels::FSetPublisherDataRequest& request, + const FSetPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetPublisherDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetTitleData( + ServerModels::FSetTitleDataRequest& request, + const FSetTitleDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetTitleData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetTitleDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SetTitleInternalData( + ServerModels::FSetTitleDataRequest& request, + const FSetTitleInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SetTitleInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSetTitleInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FSetTitleDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SubtractCharacterVirtualCurrency( + ServerModels::FSubtractCharacterVirtualCurrencyRequest& request, + const FSubtractCharacterVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SubtractCharacterVirtualCurrency")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSubtractCharacterVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSubtractCharacterVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractCharacterVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FModifyCharacterVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::SubtractUserVirtualCurrency( + ServerModels::FSubtractUserVirtualCurrencyRequest& request, + const FSubtractUserVirtualCurrencyDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/SubtractUserVirtualCurrency")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnSubtractUserVirtualCurrencyResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnSubtractUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FModifyUserVirtualCurrencyResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UnlockContainerInstance( + ServerModels::FUnlockContainerInstanceRequest& request, + const FUnlockContainerInstanceDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UnlockContainerInstance")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUnlockContainerInstanceResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUnlockContainerInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUnlockContainerItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UnlockContainerItem( + ServerModels::FUnlockContainerItemRequest& request, + const FUnlockContainerItemDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UnlockContainerItem")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUnlockContainerItemResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUnlockContainerItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUnlockContainerItemResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateAvatarUrl( + ServerModels::FUpdateAvatarUrlRequest& request, + const FUpdateAvatarUrlDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateAvatarUrl")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateAvatarUrlResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateAvatarUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateAvatarUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateBans( + ServerModels::FUpdateBansRequest& request, + const FUpdateBansDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateBans")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateBansResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateBansResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateCharacterData( + ServerModels::FUpdateCharacterDataRequest& request, + const FUpdateCharacterDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateCharacterData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateCharacterDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateCharacterInternalData( + ServerModels::FUpdateCharacterDataRequest& request, + const FUpdateCharacterInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateCharacterInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateCharacterInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateCharacterInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateCharacterReadOnlyData( + ServerModels::FUpdateCharacterDataRequest& request, + const FUpdateCharacterReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateCharacterReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateCharacterReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateCharacterReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateCharacterDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateCharacterStatistics( + ServerModels::FUpdateCharacterStatisticsRequest& request, + const FUpdateCharacterStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateCharacterStatistics")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateCharacterStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateCharacterStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdatePlayerStatistics( + ServerModels::FUpdatePlayerStatisticsRequest& request, + const FUpdatePlayerStatisticsDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdatePlayerStatistics")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdatePlayerStatisticsResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdatePlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdatePlayerStatisticsResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateSharedGroupData( + ServerModels::FUpdateSharedGroupDataRequest& request, + const FUpdateSharedGroupDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateSharedGroupData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateSharedGroupDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateSharedGroupDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserData( + ServerModels::FUpdateUserDataRequest& request, + const FUpdateUserDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserInternalData( + ServerModels::FUpdateUserInternalDataRequest& request, + const FUpdateUserInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserInventoryItemCustomData( + ServerModels::FUpdateUserInventoryItemDataRequest& request, + const FUpdateUserInventoryItemCustomDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserInventoryItemCustomData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserInventoryItemCustomDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserInventoryItemCustomDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserInventoryItemCustomDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FEmptyResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserPublisherData( + ServerModels::FUpdateUserDataRequest& request, + const FUpdateUserPublisherDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserPublisherData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserPublisherDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserPublisherInternalData( + ServerModels::FUpdateUserInternalDataRequest& request, + const FUpdateUserPublisherInternalDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserPublisherInternalData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserPublisherInternalDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserPublisherReadOnlyData( + ServerModels::FUpdateUserDataRequest& request, + const FUpdateUserPublisherReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserPublisherReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserPublisherReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::UpdateUserReadOnlyData( + ServerModels::FUpdateUserDataRequest& request, + const FUpdateUserReadOnlyDataDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/UpdateUserReadOnlyData")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnUpdateUserReadOnlyDataResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnUpdateUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FUpdateUserDataResult outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::WriteCharacterEvent( + ServerModels::FWriteServerCharacterEventRequest& request, + const FWriteCharacterEventDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/WriteCharacterEvent")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnWriteCharacterEventResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnWriteCharacterEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteCharacterEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FWriteEventResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::WritePlayerEvent( + ServerModels::FWriteServerPlayerEventRequest& request, + const FWritePlayerEventDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/WritePlayerEvent")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnWritePlayerEventResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnWritePlayerEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWritePlayerEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FWriteEventResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + +bool UPlayFabServerAPI::WriteTitleEvent( + ServerModels::FWriteTitleEventRequest& request, + const FWriteTitleEventDelegate& SuccessDelegate, + const FPlayFabErrorDelegate& ErrorDelegate) +{ + if (PlayFabSettings::GetDeveloperSecretKey().Len() == 0) { + UE_LOG(LogPlayFab, Error, TEXT("You must first set your PlayFab developerSecretKey to use this function (Unreal Settings Menu, or in C++ code)")); + } + auto HttpRequest = PlayFabRequestHandler::SendRequest(PlayFabSettings::GetUrl(TEXT("/Server/WriteTitleEvent")), request.toJSONString(), TEXT("X-SecretKey"), PlayFabSettings::GetDeveloperSecretKey()); + HttpRequest->OnProcessRequestComplete().BindRaw(this, &UPlayFabServerAPI::OnWriteTitleEventResult, SuccessDelegate, ErrorDelegate); + return HttpRequest->ProcessRequest(); +} + +void UPlayFabServerAPI::OnWriteTitleEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteTitleEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate) +{ + ServerModels::FWriteEventResponse outResult; + FPlayFabError errorResult; + if (PlayFabRequestHandler::DecodeRequest(HttpRequest, HttpResponse, bSucceeded, outResult, errorResult)) + { + SuccessDelegate.ExecuteIfBound(outResult); + } + else + { + ErrorDelegate.ExecuteIfBound(errorResult); + } +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabServerDataModels.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabServerDataModels.cpp new file mode 100644 index 000000000..be7b4c049 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabServerDataModels.cpp @@ -0,0 +1,14037 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! + +#include "Core/PlayFabServerDataModels.h" +#include "Core/PlayFabJsonHelpers.h" + +using namespace PlayFab; +using namespace PlayFab::ServerModels; + +PlayFab::ServerModels::FAdCampaignAttribution::~FAdCampaignAttribution() +{ + +} + +void PlayFab::ServerModels::FAdCampaignAttribution::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AttributedAt")); writeDatetime(AttributedAt, writer); + + if (CampaignId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CampaignId")); writer->WriteValue(CampaignId); } + + if (Platform.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Platform")); writer->WriteValue(Platform); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAdCampaignAttribution::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AttributedAtValue = obj->TryGetField(TEXT("AttributedAt")); + if (AttributedAtValue.IsValid()) + AttributedAt = readDatetime(AttributedAtValue); + + + const TSharedPtr CampaignIdValue = obj->TryGetField(TEXT("CampaignId")); + if (CampaignIdValue.IsValid() && !CampaignIdValue->IsNull()) + { + FString TmpValue; + if (CampaignIdValue->TryGetString(TmpValue)) { CampaignId = TmpValue; } + } + + const TSharedPtr PlatformValue = obj->TryGetField(TEXT("Platform")); + if (PlatformValue.IsValid() && !PlatformValue->IsNull()) + { + FString TmpValue; + if (PlatformValue->TryGetString(TmpValue)) { Platform = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAdCampaignAttributionModel::~FAdCampaignAttributionModel() +{ + +} + +void PlayFab::ServerModels::FAdCampaignAttributionModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AttributedAt")); writeDatetime(AttributedAt, writer); + + if (CampaignId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CampaignId")); writer->WriteValue(CampaignId); } + + if (Platform.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Platform")); writer->WriteValue(Platform); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAdCampaignAttributionModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AttributedAtValue = obj->TryGetField(TEXT("AttributedAt")); + if (AttributedAtValue.IsValid()) + AttributedAt = readDatetime(AttributedAtValue); + + + const TSharedPtr CampaignIdValue = obj->TryGetField(TEXT("CampaignId")); + if (CampaignIdValue.IsValid() && !CampaignIdValue->IsNull()) + { + FString TmpValue; + if (CampaignIdValue->TryGetString(TmpValue)) { CampaignId = TmpValue; } + } + + const TSharedPtr PlatformValue = obj->TryGetField(TEXT("Platform")); + if (PlatformValue.IsValid() && !PlatformValue->IsNull()) + { + FString TmpValue; + if (PlatformValue->TryGetString(TmpValue)) { Platform = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddCharacterVirtualCurrencyRequest::~FAddCharacterVirtualCurrencyRequest() +{ + +} + +void PlayFab::ServerModels::FAddCharacterVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddCharacterVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddFriendRequest::~FAddFriendRequest() +{ + +} + +void PlayFab::ServerModels::FAddFriendRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FriendEmail.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendEmail")); writer->WriteValue(FriendEmail); } + + if (FriendPlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); } + + if (FriendTitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendTitleDisplayName")); writer->WriteValue(FriendTitleDisplayName); } + + if (FriendUsername.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendUsername")); writer->WriteValue(FriendUsername); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddFriendRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendEmailValue = obj->TryGetField(TEXT("FriendEmail")); + if (FriendEmailValue.IsValid() && !FriendEmailValue->IsNull()) + { + FString TmpValue; + if (FriendEmailValue->TryGetString(TmpValue)) { FriendEmail = TmpValue; } + } + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + const TSharedPtr FriendTitleDisplayNameValue = obj->TryGetField(TEXT("FriendTitleDisplayName")); + if (FriendTitleDisplayNameValue.IsValid() && !FriendTitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (FriendTitleDisplayNameValue->TryGetString(TmpValue)) { FriendTitleDisplayName = TmpValue; } + } + + const TSharedPtr FriendUsernameValue = obj->TryGetField(TEXT("FriendUsername")); + if (FriendUsernameValue.IsValid() && !FriendUsernameValue->IsNull()) + { + FString TmpValue; + if (FriendUsernameValue->TryGetString(TmpValue)) { FriendUsername = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddPlayerTagRequest::~FAddPlayerTagRequest() +{ + +} + +void PlayFab::ServerModels::FAddPlayerTagRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("TagName")); writer->WriteValue(TagName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddPlayerTagRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TagNameValue = obj->TryGetField(TEXT("TagName")); + if (TagNameValue.IsValid() && !TagNameValue->IsNull()) + { + FString TmpValue; + if (TagNameValue->TryGetString(TmpValue)) { TagName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddPlayerTagResult::~FAddPlayerTagResult() +{ + +} + +void PlayFab::ServerModels::FAddPlayerTagResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddPlayerTagResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddSharedGroupMembersRequest::~FAddSharedGroupMembersRequest() +{ + +} + +void PlayFab::ServerModels::FAddSharedGroupMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("PlayFabIds")); + for (const FString& item : PlayFabIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddSharedGroupMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("PlayFabIds"), PlayFabIds); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddSharedGroupMembersResult::~FAddSharedGroupMembersResult() +{ + +} + +void PlayFab::ServerModels::FAddSharedGroupMembersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddSharedGroupMembersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FAddUserVirtualCurrencyRequest::~FAddUserVirtualCurrencyRequest() +{ + +} + +void PlayFab::ServerModels::FAddUserVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAddUserVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writePushNotificationPlatformEnumJSON(PushNotificationPlatform enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case PushNotificationPlatformApplePushNotificationService: writer->WriteValue(TEXT("ApplePushNotificationService")); break; + case PushNotificationPlatformGoogleCloudMessaging: writer->WriteValue(TEXT("GoogleCloudMessaging")); break; + } +} + +ServerModels::PushNotificationPlatform PlayFab::ServerModels::readPushNotificationPlatformFromValue(const TSharedPtr& value) +{ + return readPushNotificationPlatformFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::PushNotificationPlatform PlayFab::ServerModels::readPushNotificationPlatformFromValue(const FString& value) +{ + static TMap _PushNotificationPlatformMap; + if (_PushNotificationPlatformMap.Num() == 0) + { + // Auto-generate the map on the first use + _PushNotificationPlatformMap.Add(TEXT("ApplePushNotificationService"), PushNotificationPlatformApplePushNotificationService); + _PushNotificationPlatformMap.Add(TEXT("GoogleCloudMessaging"), PushNotificationPlatformGoogleCloudMessaging); + + } + + if (!value.IsEmpty()) + { + auto output = _PushNotificationPlatformMap.Find(value); + if (output != nullptr) + return *output; + } + + return PushNotificationPlatformApplePushNotificationService; // Basically critical fail +} + +PlayFab::ServerModels::FAdvancedPushPlatformMsg::~FAdvancedPushPlatformMsg() +{ + +} + +void PlayFab::ServerModels::FAdvancedPushPlatformMsg::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Json")); writer->WriteValue(Json); + + writer->WriteIdentifierPrefix(TEXT("Platform")); writePushNotificationPlatformEnumJSON(Platform, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAdvancedPushPlatformMsg::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr JsonValue = obj->TryGetField(TEXT("Json")); + if (JsonValue.IsValid() && !JsonValue->IsNull()) + { + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) { Json = TmpValue; } + } + + Platform = readPushNotificationPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::ServerModels::FAuthenticateSessionTicketRequest::~FAuthenticateSessionTicketRequest() +{ + +} + +void PlayFab::ServerModels::FAuthenticateSessionTicketRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("SessionTicket")); writer->WriteValue(SessionTicket); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAuthenticateSessionTicketRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SessionTicketValue = obj->TryGetField(TEXT("SessionTicket")); + if (SessionTicketValue.IsValid() && !SessionTicketValue->IsNull()) + { + FString TmpValue; + if (SessionTicketValue->TryGetString(TmpValue)) { SessionTicket = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserAndroidDeviceInfo::~FUserAndroidDeviceInfo() +{ + +} + +void PlayFab::ServerModels::FUserAndroidDeviceInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceId")); writer->WriteValue(AndroidDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserAndroidDeviceInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceIdValue = obj->TryGetField(TEXT("AndroidDeviceId")); + if (AndroidDeviceIdValue.IsValid() && !AndroidDeviceIdValue->IsNull()) + { + FString TmpValue; + if (AndroidDeviceIdValue->TryGetString(TmpValue)) { AndroidDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserCustomIdInfo::~FUserCustomIdInfo() +{ + +} + +void PlayFab::ServerModels::FUserCustomIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CustomId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomId")); writer->WriteValue(CustomId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserCustomIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CustomIdValue = obj->TryGetField(TEXT("CustomId")); + if (CustomIdValue.IsValid() && !CustomIdValue->IsNull()) + { + FString TmpValue; + if (CustomIdValue->TryGetString(TmpValue)) { CustomId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserFacebookInfo::~FUserFacebookInfo() +{ + +} + +void PlayFab::ServerModels::FUserFacebookInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookId")); writer->WriteValue(FacebookId); } + + if (FullName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FullName")); writer->WriteValue(FullName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserFacebookInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookIdValue = obj->TryGetField(TEXT("FacebookId")); + if (FacebookIdValue.IsValid() && !FacebookIdValue->IsNull()) + { + FString TmpValue; + if (FacebookIdValue->TryGetString(TmpValue)) { FacebookId = TmpValue; } + } + + const TSharedPtr FullNameValue = obj->TryGetField(TEXT("FullName")); + if (FullNameValue.IsValid() && !FullNameValue->IsNull()) + { + FString TmpValue; + if (FullNameValue->TryGetString(TmpValue)) { FullName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserFacebookInstantGamesIdInfo::~FUserFacebookInstantGamesIdInfo() +{ + +} + +void PlayFab::ServerModels::FUserFacebookInstantGamesIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookInstantGamesId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesId")); writer->WriteValue(FacebookInstantGamesId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserFacebookInstantGamesIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesIdValue = obj->TryGetField(TEXT("FacebookInstantGamesId")); + if (FacebookInstantGamesIdValue.IsValid() && !FacebookInstantGamesIdValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesIdValue->TryGetString(TmpValue)) { FacebookInstantGamesId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserGameCenterInfo::~FUserGameCenterInfo() +{ + +} + +void PlayFab::ServerModels::FUserGameCenterInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GameCenterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GameCenterId")); writer->WriteValue(GameCenterId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserGameCenterInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameCenterIdValue = obj->TryGetField(TEXT("GameCenterId")); + if (GameCenterIdValue.IsValid() && !GameCenterIdValue->IsNull()) + { + FString TmpValue; + if (GameCenterIdValue->TryGetString(TmpValue)) { GameCenterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserGoogleInfo::~FUserGoogleInfo() +{ + +} + +void PlayFab::ServerModels::FUserGoogleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GoogleEmail.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleEmail")); writer->WriteValue(GoogleEmail); } + + if (GoogleGender.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleGender")); writer->WriteValue(GoogleGender); } + + if (GoogleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleId")); writer->WriteValue(GoogleId); } + + if (GoogleLocale.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("GoogleLocale")); writer->WriteValue(GoogleLocale); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserGoogleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GoogleEmailValue = obj->TryGetField(TEXT("GoogleEmail")); + if (GoogleEmailValue.IsValid() && !GoogleEmailValue->IsNull()) + { + FString TmpValue; + if (GoogleEmailValue->TryGetString(TmpValue)) { GoogleEmail = TmpValue; } + } + + const TSharedPtr GoogleGenderValue = obj->TryGetField(TEXT("GoogleGender")); + if (GoogleGenderValue.IsValid() && !GoogleGenderValue->IsNull()) + { + FString TmpValue; + if (GoogleGenderValue->TryGetString(TmpValue)) { GoogleGender = TmpValue; } + } + + const TSharedPtr GoogleIdValue = obj->TryGetField(TEXT("GoogleId")); + if (GoogleIdValue.IsValid() && !GoogleIdValue->IsNull()) + { + FString TmpValue; + if (GoogleIdValue->TryGetString(TmpValue)) { GoogleId = TmpValue; } + } + + const TSharedPtr GoogleLocaleValue = obj->TryGetField(TEXT("GoogleLocale")); + if (GoogleLocaleValue.IsValid() && !GoogleLocaleValue->IsNull()) + { + FString TmpValue; + if (GoogleLocaleValue->TryGetString(TmpValue)) { GoogleLocale = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserIosDeviceInfo::~FUserIosDeviceInfo() +{ + +} + +void PlayFab::ServerModels::FUserIosDeviceInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IosDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IosDeviceId")); writer->WriteValue(IosDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserIosDeviceInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IosDeviceIdValue = obj->TryGetField(TEXT("IosDeviceId")); + if (IosDeviceIdValue.IsValid() && !IosDeviceIdValue->IsNull()) + { + FString TmpValue; + if (IosDeviceIdValue->TryGetString(TmpValue)) { IosDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserKongregateInfo::~FUserKongregateInfo() +{ + +} + +void PlayFab::ServerModels::FUserKongregateInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (KongregateId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateId")); writer->WriteValue(KongregateId); } + + if (KongregateName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KongregateName")); writer->WriteValue(KongregateName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserKongregateInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KongregateIdValue = obj->TryGetField(TEXT("KongregateId")); + if (KongregateIdValue.IsValid() && !KongregateIdValue->IsNull()) + { + FString TmpValue; + if (KongregateIdValue->TryGetString(TmpValue)) { KongregateId = TmpValue; } + } + + const TSharedPtr KongregateNameValue = obj->TryGetField(TEXT("KongregateName")); + if (KongregateNameValue.IsValid() && !KongregateNameValue->IsNull()) + { + FString TmpValue; + if (KongregateNameValue->TryGetString(TmpValue)) { KongregateName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserNintendoSwitchDeviceIdInfo::~FUserNintendoSwitchDeviceIdInfo() +{ + +} + +void PlayFab::ServerModels::FUserNintendoSwitchDeviceIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserNintendoSwitchDeviceIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserOpenIdInfo::~FUserOpenIdInfo() +{ + +} + +void PlayFab::ServerModels::FUserOpenIdInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ConnectionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ConnectionId")); writer->WriteValue(ConnectionId); } + + if (Issuer.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Issuer")); writer->WriteValue(Issuer); } + + if (Subject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Subject")); writer->WriteValue(Subject); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserOpenIdInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ConnectionIdValue = obj->TryGetField(TEXT("ConnectionId")); + if (ConnectionIdValue.IsValid() && !ConnectionIdValue->IsNull()) + { + FString TmpValue; + if (ConnectionIdValue->TryGetString(TmpValue)) { ConnectionId = TmpValue; } + } + + const TSharedPtr IssuerValue = obj->TryGetField(TEXT("Issuer")); + if (IssuerValue.IsValid() && !IssuerValue->IsNull()) + { + FString TmpValue; + if (IssuerValue->TryGetString(TmpValue)) { Issuer = TmpValue; } + } + + const TSharedPtr SubjectValue = obj->TryGetField(TEXT("Subject")); + if (SubjectValue.IsValid() && !SubjectValue->IsNull()) + { + FString TmpValue; + if (SubjectValue->TryGetString(TmpValue)) { Subject = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserPrivateAccountInfo::~FUserPrivateAccountInfo() +{ + +} + +void PlayFab::ServerModels::FUserPrivateAccountInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserPrivateAccountInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserPsnInfo::~FUserPsnInfo() +{ + +} + +void PlayFab::ServerModels::FUserPsnInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PsnAccountId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PsnAccountId")); writer->WriteValue(PsnAccountId); } + + if (PsnOnlineId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PsnOnlineId")); writer->WriteValue(PsnOnlineId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserPsnInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PsnAccountIdValue = obj->TryGetField(TEXT("PsnAccountId")); + if (PsnAccountIdValue.IsValid() && !PsnAccountIdValue->IsNull()) + { + FString TmpValue; + if (PsnAccountIdValue->TryGetString(TmpValue)) { PsnAccountId = TmpValue; } + } + + const TSharedPtr PsnOnlineIdValue = obj->TryGetField(TEXT("PsnOnlineId")); + if (PsnOnlineIdValue.IsValid() && !PsnOnlineIdValue->IsNull()) + { + FString TmpValue; + if (PsnOnlineIdValue->TryGetString(TmpValue)) { PsnOnlineId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeTitleActivationStatusEnumJSON(TitleActivationStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case TitleActivationStatusNone: writer->WriteValue(TEXT("None")); break; + case TitleActivationStatusActivatedTitleKey: writer->WriteValue(TEXT("ActivatedTitleKey")); break; + case TitleActivationStatusPendingSteam: writer->WriteValue(TEXT("PendingSteam")); break; + case TitleActivationStatusActivatedSteam: writer->WriteValue(TEXT("ActivatedSteam")); break; + case TitleActivationStatusRevokedSteam: writer->WriteValue(TEXT("RevokedSteam")); break; + } +} + +ServerModels::TitleActivationStatus PlayFab::ServerModels::readTitleActivationStatusFromValue(const TSharedPtr& value) +{ + return readTitleActivationStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::TitleActivationStatus PlayFab::ServerModels::readTitleActivationStatusFromValue(const FString& value) +{ + static TMap _TitleActivationStatusMap; + if (_TitleActivationStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _TitleActivationStatusMap.Add(TEXT("None"), TitleActivationStatusNone); + _TitleActivationStatusMap.Add(TEXT("ActivatedTitleKey"), TitleActivationStatusActivatedTitleKey); + _TitleActivationStatusMap.Add(TEXT("PendingSteam"), TitleActivationStatusPendingSteam); + _TitleActivationStatusMap.Add(TEXT("ActivatedSteam"), TitleActivationStatusActivatedSteam); + _TitleActivationStatusMap.Add(TEXT("RevokedSteam"), TitleActivationStatusRevokedSteam); + + } + + if (!value.IsEmpty()) + { + auto output = _TitleActivationStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return TitleActivationStatusNone; // Basically critical fail +} + +void PlayFab::ServerModels::writeCurrencyEnumJSON(Currency enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CurrencyAED: writer->WriteValue(TEXT("AED")); break; + case CurrencyAFN: writer->WriteValue(TEXT("AFN")); break; + case CurrencyALL: writer->WriteValue(TEXT("ALL")); break; + case CurrencyAMD: writer->WriteValue(TEXT("AMD")); break; + case CurrencyANG: writer->WriteValue(TEXT("ANG")); break; + case CurrencyAOA: writer->WriteValue(TEXT("AOA")); break; + case CurrencyARS: writer->WriteValue(TEXT("ARS")); break; + case CurrencyAUD: writer->WriteValue(TEXT("AUD")); break; + case CurrencyAWG: writer->WriteValue(TEXT("AWG")); break; + case CurrencyAZN: writer->WriteValue(TEXT("AZN")); break; + case CurrencyBAM: writer->WriteValue(TEXT("BAM")); break; + case CurrencyBBD: writer->WriteValue(TEXT("BBD")); break; + case CurrencyBDT: writer->WriteValue(TEXT("BDT")); break; + case CurrencyBGN: writer->WriteValue(TEXT("BGN")); break; + case CurrencyBHD: writer->WriteValue(TEXT("BHD")); break; + case CurrencyBIF: writer->WriteValue(TEXT("BIF")); break; + case CurrencyBMD: writer->WriteValue(TEXT("BMD")); break; + case CurrencyBND: writer->WriteValue(TEXT("BND")); break; + case CurrencyBOB: writer->WriteValue(TEXT("BOB")); break; + case CurrencyBRL: writer->WriteValue(TEXT("BRL")); break; + case CurrencyBSD: writer->WriteValue(TEXT("BSD")); break; + case CurrencyBTN: writer->WriteValue(TEXT("BTN")); break; + case CurrencyBWP: writer->WriteValue(TEXT("BWP")); break; + case CurrencyBYR: writer->WriteValue(TEXT("BYR")); break; + case CurrencyBZD: writer->WriteValue(TEXT("BZD")); break; + case CurrencyCAD: writer->WriteValue(TEXT("CAD")); break; + case CurrencyCDF: writer->WriteValue(TEXT("CDF")); break; + case CurrencyCHF: writer->WriteValue(TEXT("CHF")); break; + case CurrencyCLP: writer->WriteValue(TEXT("CLP")); break; + case CurrencyCNY: writer->WriteValue(TEXT("CNY")); break; + case CurrencyCOP: writer->WriteValue(TEXT("COP")); break; + case CurrencyCRC: writer->WriteValue(TEXT("CRC")); break; + case CurrencyCUC: writer->WriteValue(TEXT("CUC")); break; + case CurrencyCUP: writer->WriteValue(TEXT("CUP")); break; + case CurrencyCVE: writer->WriteValue(TEXT("CVE")); break; + case CurrencyCZK: writer->WriteValue(TEXT("CZK")); break; + case CurrencyDJF: writer->WriteValue(TEXT("DJF")); break; + case CurrencyDKK: writer->WriteValue(TEXT("DKK")); break; + case CurrencyDOP: writer->WriteValue(TEXT("DOP")); break; + case CurrencyDZD: writer->WriteValue(TEXT("DZD")); break; + case CurrencyEGP: writer->WriteValue(TEXT("EGP")); break; + case CurrencyERN: writer->WriteValue(TEXT("ERN")); break; + case CurrencyETB: writer->WriteValue(TEXT("ETB")); break; + case CurrencyEUR: writer->WriteValue(TEXT("EUR")); break; + case CurrencyFJD: writer->WriteValue(TEXT("FJD")); break; + case CurrencyFKP: writer->WriteValue(TEXT("FKP")); break; + case CurrencyGBP: writer->WriteValue(TEXT("GBP")); break; + case CurrencyGEL: writer->WriteValue(TEXT("GEL")); break; + case CurrencyGGP: writer->WriteValue(TEXT("GGP")); break; + case CurrencyGHS: writer->WriteValue(TEXT("GHS")); break; + case CurrencyGIP: writer->WriteValue(TEXT("GIP")); break; + case CurrencyGMD: writer->WriteValue(TEXT("GMD")); break; + case CurrencyGNF: writer->WriteValue(TEXT("GNF")); break; + case CurrencyGTQ: writer->WriteValue(TEXT("GTQ")); break; + case CurrencyGYD: writer->WriteValue(TEXT("GYD")); break; + case CurrencyHKD: writer->WriteValue(TEXT("HKD")); break; + case CurrencyHNL: writer->WriteValue(TEXT("HNL")); break; + case CurrencyHRK: writer->WriteValue(TEXT("HRK")); break; + case CurrencyHTG: writer->WriteValue(TEXT("HTG")); break; + case CurrencyHUF: writer->WriteValue(TEXT("HUF")); break; + case CurrencyIDR: writer->WriteValue(TEXT("IDR")); break; + case CurrencyILS: writer->WriteValue(TEXT("ILS")); break; + case CurrencyIMP: writer->WriteValue(TEXT("IMP")); break; + case CurrencyINR: writer->WriteValue(TEXT("INR")); break; + case CurrencyIQD: writer->WriteValue(TEXT("IQD")); break; + case CurrencyIRR: writer->WriteValue(TEXT("IRR")); break; + case CurrencyISK: writer->WriteValue(TEXT("ISK")); break; + case CurrencyJEP: writer->WriteValue(TEXT("JEP")); break; + case CurrencyJMD: writer->WriteValue(TEXT("JMD")); break; + case CurrencyJOD: writer->WriteValue(TEXT("JOD")); break; + case CurrencyJPY: writer->WriteValue(TEXT("JPY")); break; + case CurrencyKES: writer->WriteValue(TEXT("KES")); break; + case CurrencyKGS: writer->WriteValue(TEXT("KGS")); break; + case CurrencyKHR: writer->WriteValue(TEXT("KHR")); break; + case CurrencyKMF: writer->WriteValue(TEXT("KMF")); break; + case CurrencyKPW: writer->WriteValue(TEXT("KPW")); break; + case CurrencyKRW: writer->WriteValue(TEXT("KRW")); break; + case CurrencyKWD: writer->WriteValue(TEXT("KWD")); break; + case CurrencyKYD: writer->WriteValue(TEXT("KYD")); break; + case CurrencyKZT: writer->WriteValue(TEXT("KZT")); break; + case CurrencyLAK: writer->WriteValue(TEXT("LAK")); break; + case CurrencyLBP: writer->WriteValue(TEXT("LBP")); break; + case CurrencyLKR: writer->WriteValue(TEXT("LKR")); break; + case CurrencyLRD: writer->WriteValue(TEXT("LRD")); break; + case CurrencyLSL: writer->WriteValue(TEXT("LSL")); break; + case CurrencyLYD: writer->WriteValue(TEXT("LYD")); break; + case CurrencyMAD: writer->WriteValue(TEXT("MAD")); break; + case CurrencyMDL: writer->WriteValue(TEXT("MDL")); break; + case CurrencyMGA: writer->WriteValue(TEXT("MGA")); break; + case CurrencyMKD: writer->WriteValue(TEXT("MKD")); break; + case CurrencyMMK: writer->WriteValue(TEXT("MMK")); break; + case CurrencyMNT: writer->WriteValue(TEXT("MNT")); break; + case CurrencyMOP: writer->WriteValue(TEXT("MOP")); break; + case CurrencyMRO: writer->WriteValue(TEXT("MRO")); break; + case CurrencyMUR: writer->WriteValue(TEXT("MUR")); break; + case CurrencyMVR: writer->WriteValue(TEXT("MVR")); break; + case CurrencyMWK: writer->WriteValue(TEXT("MWK")); break; + case CurrencyMXN: writer->WriteValue(TEXT("MXN")); break; + case CurrencyMYR: writer->WriteValue(TEXT("MYR")); break; + case CurrencyMZN: writer->WriteValue(TEXT("MZN")); break; + case CurrencyNAD: writer->WriteValue(TEXT("NAD")); break; + case CurrencyNGN: writer->WriteValue(TEXT("NGN")); break; + case CurrencyNIO: writer->WriteValue(TEXT("NIO")); break; + case CurrencyNOK: writer->WriteValue(TEXT("NOK")); break; + case CurrencyNPR: writer->WriteValue(TEXT("NPR")); break; + case CurrencyNZD: writer->WriteValue(TEXT("NZD")); break; + case CurrencyOMR: writer->WriteValue(TEXT("OMR")); break; + case CurrencyPAB: writer->WriteValue(TEXT("PAB")); break; + case CurrencyPEN: writer->WriteValue(TEXT("PEN")); break; + case CurrencyPGK: writer->WriteValue(TEXT("PGK")); break; + case CurrencyPHP: writer->WriteValue(TEXT("PHP")); break; + case CurrencyPKR: writer->WriteValue(TEXT("PKR")); break; + case CurrencyPLN: writer->WriteValue(TEXT("PLN")); break; + case CurrencyPYG: writer->WriteValue(TEXT("PYG")); break; + case CurrencyQAR: writer->WriteValue(TEXT("QAR")); break; + case CurrencyRON: writer->WriteValue(TEXT("RON")); break; + case CurrencyRSD: writer->WriteValue(TEXT("RSD")); break; + case CurrencyRUB: writer->WriteValue(TEXT("RUB")); break; + case CurrencyRWF: writer->WriteValue(TEXT("RWF")); break; + case CurrencySAR: writer->WriteValue(TEXT("SAR")); break; + case CurrencySBD: writer->WriteValue(TEXT("SBD")); break; + case CurrencySCR: writer->WriteValue(TEXT("SCR")); break; + case CurrencySDG: writer->WriteValue(TEXT("SDG")); break; + case CurrencySEK: writer->WriteValue(TEXT("SEK")); break; + case CurrencySGD: writer->WriteValue(TEXT("SGD")); break; + case CurrencySHP: writer->WriteValue(TEXT("SHP")); break; + case CurrencySLL: writer->WriteValue(TEXT("SLL")); break; + case CurrencySOS: writer->WriteValue(TEXT("SOS")); break; + case CurrencySPL: writer->WriteValue(TEXT("SPL")); break; + case CurrencySRD: writer->WriteValue(TEXT("SRD")); break; + case CurrencySTD: writer->WriteValue(TEXT("STD")); break; + case CurrencySVC: writer->WriteValue(TEXT("SVC")); break; + case CurrencySYP: writer->WriteValue(TEXT("SYP")); break; + case CurrencySZL: writer->WriteValue(TEXT("SZL")); break; + case CurrencyTHB: writer->WriteValue(TEXT("THB")); break; + case CurrencyTJS: writer->WriteValue(TEXT("TJS")); break; + case CurrencyTMT: writer->WriteValue(TEXT("TMT")); break; + case CurrencyTND: writer->WriteValue(TEXT("TND")); break; + case CurrencyTOP: writer->WriteValue(TEXT("TOP")); break; + case CurrencyTRY: writer->WriteValue(TEXT("TRY")); break; + case CurrencyTTD: writer->WriteValue(TEXT("TTD")); break; + case CurrencyTVD: writer->WriteValue(TEXT("TVD")); break; + case CurrencyTWD: writer->WriteValue(TEXT("TWD")); break; + case CurrencyTZS: writer->WriteValue(TEXT("TZS")); break; + case CurrencyUAH: writer->WriteValue(TEXT("UAH")); break; + case CurrencyUGX: writer->WriteValue(TEXT("UGX")); break; + case CurrencyUSD: writer->WriteValue(TEXT("USD")); break; + case CurrencyUYU: writer->WriteValue(TEXT("UYU")); break; + case CurrencyUZS: writer->WriteValue(TEXT("UZS")); break; + case CurrencyVEF: writer->WriteValue(TEXT("VEF")); break; + case CurrencyVND: writer->WriteValue(TEXT("VND")); break; + case CurrencyVUV: writer->WriteValue(TEXT("VUV")); break; + case CurrencyWST: writer->WriteValue(TEXT("WST")); break; + case CurrencyXAF: writer->WriteValue(TEXT("XAF")); break; + case CurrencyXCD: writer->WriteValue(TEXT("XCD")); break; + case CurrencyXDR: writer->WriteValue(TEXT("XDR")); break; + case CurrencyXOF: writer->WriteValue(TEXT("XOF")); break; + case CurrencyXPF: writer->WriteValue(TEXT("XPF")); break; + case CurrencyYER: writer->WriteValue(TEXT("YER")); break; + case CurrencyZAR: writer->WriteValue(TEXT("ZAR")); break; + case CurrencyZMW: writer->WriteValue(TEXT("ZMW")); break; + case CurrencyZWD: writer->WriteValue(TEXT("ZWD")); break; + } +} + +ServerModels::Currency PlayFab::ServerModels::readCurrencyFromValue(const TSharedPtr& value) +{ + return readCurrencyFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::Currency PlayFab::ServerModels::readCurrencyFromValue(const FString& value) +{ + static TMap _CurrencyMap; + if (_CurrencyMap.Num() == 0) + { + // Auto-generate the map on the first use + _CurrencyMap.Add(TEXT("AED"), CurrencyAED); + _CurrencyMap.Add(TEXT("AFN"), CurrencyAFN); + _CurrencyMap.Add(TEXT("ALL"), CurrencyALL); + _CurrencyMap.Add(TEXT("AMD"), CurrencyAMD); + _CurrencyMap.Add(TEXT("ANG"), CurrencyANG); + _CurrencyMap.Add(TEXT("AOA"), CurrencyAOA); + _CurrencyMap.Add(TEXT("ARS"), CurrencyARS); + _CurrencyMap.Add(TEXT("AUD"), CurrencyAUD); + _CurrencyMap.Add(TEXT("AWG"), CurrencyAWG); + _CurrencyMap.Add(TEXT("AZN"), CurrencyAZN); + _CurrencyMap.Add(TEXT("BAM"), CurrencyBAM); + _CurrencyMap.Add(TEXT("BBD"), CurrencyBBD); + _CurrencyMap.Add(TEXT("BDT"), CurrencyBDT); + _CurrencyMap.Add(TEXT("BGN"), CurrencyBGN); + _CurrencyMap.Add(TEXT("BHD"), CurrencyBHD); + _CurrencyMap.Add(TEXT("BIF"), CurrencyBIF); + _CurrencyMap.Add(TEXT("BMD"), CurrencyBMD); + _CurrencyMap.Add(TEXT("BND"), CurrencyBND); + _CurrencyMap.Add(TEXT("BOB"), CurrencyBOB); + _CurrencyMap.Add(TEXT("BRL"), CurrencyBRL); + _CurrencyMap.Add(TEXT("BSD"), CurrencyBSD); + _CurrencyMap.Add(TEXT("BTN"), CurrencyBTN); + _CurrencyMap.Add(TEXT("BWP"), CurrencyBWP); + _CurrencyMap.Add(TEXT("BYR"), CurrencyBYR); + _CurrencyMap.Add(TEXT("BZD"), CurrencyBZD); + _CurrencyMap.Add(TEXT("CAD"), CurrencyCAD); + _CurrencyMap.Add(TEXT("CDF"), CurrencyCDF); + _CurrencyMap.Add(TEXT("CHF"), CurrencyCHF); + _CurrencyMap.Add(TEXT("CLP"), CurrencyCLP); + _CurrencyMap.Add(TEXT("CNY"), CurrencyCNY); + _CurrencyMap.Add(TEXT("COP"), CurrencyCOP); + _CurrencyMap.Add(TEXT("CRC"), CurrencyCRC); + _CurrencyMap.Add(TEXT("CUC"), CurrencyCUC); + _CurrencyMap.Add(TEXT("CUP"), CurrencyCUP); + _CurrencyMap.Add(TEXT("CVE"), CurrencyCVE); + _CurrencyMap.Add(TEXT("CZK"), CurrencyCZK); + _CurrencyMap.Add(TEXT("DJF"), CurrencyDJF); + _CurrencyMap.Add(TEXT("DKK"), CurrencyDKK); + _CurrencyMap.Add(TEXT("DOP"), CurrencyDOP); + _CurrencyMap.Add(TEXT("DZD"), CurrencyDZD); + _CurrencyMap.Add(TEXT("EGP"), CurrencyEGP); + _CurrencyMap.Add(TEXT("ERN"), CurrencyERN); + _CurrencyMap.Add(TEXT("ETB"), CurrencyETB); + _CurrencyMap.Add(TEXT("EUR"), CurrencyEUR); + _CurrencyMap.Add(TEXT("FJD"), CurrencyFJD); + _CurrencyMap.Add(TEXT("FKP"), CurrencyFKP); + _CurrencyMap.Add(TEXT("GBP"), CurrencyGBP); + _CurrencyMap.Add(TEXT("GEL"), CurrencyGEL); + _CurrencyMap.Add(TEXT("GGP"), CurrencyGGP); + _CurrencyMap.Add(TEXT("GHS"), CurrencyGHS); + _CurrencyMap.Add(TEXT("GIP"), CurrencyGIP); + _CurrencyMap.Add(TEXT("GMD"), CurrencyGMD); + _CurrencyMap.Add(TEXT("GNF"), CurrencyGNF); + _CurrencyMap.Add(TEXT("GTQ"), CurrencyGTQ); + _CurrencyMap.Add(TEXT("GYD"), CurrencyGYD); + _CurrencyMap.Add(TEXT("HKD"), CurrencyHKD); + _CurrencyMap.Add(TEXT("HNL"), CurrencyHNL); + _CurrencyMap.Add(TEXT("HRK"), CurrencyHRK); + _CurrencyMap.Add(TEXT("HTG"), CurrencyHTG); + _CurrencyMap.Add(TEXT("HUF"), CurrencyHUF); + _CurrencyMap.Add(TEXT("IDR"), CurrencyIDR); + _CurrencyMap.Add(TEXT("ILS"), CurrencyILS); + _CurrencyMap.Add(TEXT("IMP"), CurrencyIMP); + _CurrencyMap.Add(TEXT("INR"), CurrencyINR); + _CurrencyMap.Add(TEXT("IQD"), CurrencyIQD); + _CurrencyMap.Add(TEXT("IRR"), CurrencyIRR); + _CurrencyMap.Add(TEXT("ISK"), CurrencyISK); + _CurrencyMap.Add(TEXT("JEP"), CurrencyJEP); + _CurrencyMap.Add(TEXT("JMD"), CurrencyJMD); + _CurrencyMap.Add(TEXT("JOD"), CurrencyJOD); + _CurrencyMap.Add(TEXT("JPY"), CurrencyJPY); + _CurrencyMap.Add(TEXT("KES"), CurrencyKES); + _CurrencyMap.Add(TEXT("KGS"), CurrencyKGS); + _CurrencyMap.Add(TEXT("KHR"), CurrencyKHR); + _CurrencyMap.Add(TEXT("KMF"), CurrencyKMF); + _CurrencyMap.Add(TEXT("KPW"), CurrencyKPW); + _CurrencyMap.Add(TEXT("KRW"), CurrencyKRW); + _CurrencyMap.Add(TEXT("KWD"), CurrencyKWD); + _CurrencyMap.Add(TEXT("KYD"), CurrencyKYD); + _CurrencyMap.Add(TEXT("KZT"), CurrencyKZT); + _CurrencyMap.Add(TEXT("LAK"), CurrencyLAK); + _CurrencyMap.Add(TEXT("LBP"), CurrencyLBP); + _CurrencyMap.Add(TEXT("LKR"), CurrencyLKR); + _CurrencyMap.Add(TEXT("LRD"), CurrencyLRD); + _CurrencyMap.Add(TEXT("LSL"), CurrencyLSL); + _CurrencyMap.Add(TEXT("LYD"), CurrencyLYD); + _CurrencyMap.Add(TEXT("MAD"), CurrencyMAD); + _CurrencyMap.Add(TEXT("MDL"), CurrencyMDL); + _CurrencyMap.Add(TEXT("MGA"), CurrencyMGA); + _CurrencyMap.Add(TEXT("MKD"), CurrencyMKD); + _CurrencyMap.Add(TEXT("MMK"), CurrencyMMK); + _CurrencyMap.Add(TEXT("MNT"), CurrencyMNT); + _CurrencyMap.Add(TEXT("MOP"), CurrencyMOP); + _CurrencyMap.Add(TEXT("MRO"), CurrencyMRO); + _CurrencyMap.Add(TEXT("MUR"), CurrencyMUR); + _CurrencyMap.Add(TEXT("MVR"), CurrencyMVR); + _CurrencyMap.Add(TEXT("MWK"), CurrencyMWK); + _CurrencyMap.Add(TEXT("MXN"), CurrencyMXN); + _CurrencyMap.Add(TEXT("MYR"), CurrencyMYR); + _CurrencyMap.Add(TEXT("MZN"), CurrencyMZN); + _CurrencyMap.Add(TEXT("NAD"), CurrencyNAD); + _CurrencyMap.Add(TEXT("NGN"), CurrencyNGN); + _CurrencyMap.Add(TEXT("NIO"), CurrencyNIO); + _CurrencyMap.Add(TEXT("NOK"), CurrencyNOK); + _CurrencyMap.Add(TEXT("NPR"), CurrencyNPR); + _CurrencyMap.Add(TEXT("NZD"), CurrencyNZD); + _CurrencyMap.Add(TEXT("OMR"), CurrencyOMR); + _CurrencyMap.Add(TEXT("PAB"), CurrencyPAB); + _CurrencyMap.Add(TEXT("PEN"), CurrencyPEN); + _CurrencyMap.Add(TEXT("PGK"), CurrencyPGK); + _CurrencyMap.Add(TEXT("PHP"), CurrencyPHP); + _CurrencyMap.Add(TEXT("PKR"), CurrencyPKR); + _CurrencyMap.Add(TEXT("PLN"), CurrencyPLN); + _CurrencyMap.Add(TEXT("PYG"), CurrencyPYG); + _CurrencyMap.Add(TEXT("QAR"), CurrencyQAR); + _CurrencyMap.Add(TEXT("RON"), CurrencyRON); + _CurrencyMap.Add(TEXT("RSD"), CurrencyRSD); + _CurrencyMap.Add(TEXT("RUB"), CurrencyRUB); + _CurrencyMap.Add(TEXT("RWF"), CurrencyRWF); + _CurrencyMap.Add(TEXT("SAR"), CurrencySAR); + _CurrencyMap.Add(TEXT("SBD"), CurrencySBD); + _CurrencyMap.Add(TEXT("SCR"), CurrencySCR); + _CurrencyMap.Add(TEXT("SDG"), CurrencySDG); + _CurrencyMap.Add(TEXT("SEK"), CurrencySEK); + _CurrencyMap.Add(TEXT("SGD"), CurrencySGD); + _CurrencyMap.Add(TEXT("SHP"), CurrencySHP); + _CurrencyMap.Add(TEXT("SLL"), CurrencySLL); + _CurrencyMap.Add(TEXT("SOS"), CurrencySOS); + _CurrencyMap.Add(TEXT("SPL"), CurrencySPL); + _CurrencyMap.Add(TEXT("SRD"), CurrencySRD); + _CurrencyMap.Add(TEXT("STD"), CurrencySTD); + _CurrencyMap.Add(TEXT("SVC"), CurrencySVC); + _CurrencyMap.Add(TEXT("SYP"), CurrencySYP); + _CurrencyMap.Add(TEXT("SZL"), CurrencySZL); + _CurrencyMap.Add(TEXT("THB"), CurrencyTHB); + _CurrencyMap.Add(TEXT("TJS"), CurrencyTJS); + _CurrencyMap.Add(TEXT("TMT"), CurrencyTMT); + _CurrencyMap.Add(TEXT("TND"), CurrencyTND); + _CurrencyMap.Add(TEXT("TOP"), CurrencyTOP); + _CurrencyMap.Add(TEXT("TRY"), CurrencyTRY); + _CurrencyMap.Add(TEXT("TTD"), CurrencyTTD); + _CurrencyMap.Add(TEXT("TVD"), CurrencyTVD); + _CurrencyMap.Add(TEXT("TWD"), CurrencyTWD); + _CurrencyMap.Add(TEXT("TZS"), CurrencyTZS); + _CurrencyMap.Add(TEXT("UAH"), CurrencyUAH); + _CurrencyMap.Add(TEXT("UGX"), CurrencyUGX); + _CurrencyMap.Add(TEXT("USD"), CurrencyUSD); + _CurrencyMap.Add(TEXT("UYU"), CurrencyUYU); + _CurrencyMap.Add(TEXT("UZS"), CurrencyUZS); + _CurrencyMap.Add(TEXT("VEF"), CurrencyVEF); + _CurrencyMap.Add(TEXT("VND"), CurrencyVND); + _CurrencyMap.Add(TEXT("VUV"), CurrencyVUV); + _CurrencyMap.Add(TEXT("WST"), CurrencyWST); + _CurrencyMap.Add(TEXT("XAF"), CurrencyXAF); + _CurrencyMap.Add(TEXT("XCD"), CurrencyXCD); + _CurrencyMap.Add(TEXT("XDR"), CurrencyXDR); + _CurrencyMap.Add(TEXT("XOF"), CurrencyXOF); + _CurrencyMap.Add(TEXT("XPF"), CurrencyXPF); + _CurrencyMap.Add(TEXT("YER"), CurrencyYER); + _CurrencyMap.Add(TEXT("ZAR"), CurrencyZAR); + _CurrencyMap.Add(TEXT("ZMW"), CurrencyZMW); + _CurrencyMap.Add(TEXT("ZWD"), CurrencyZWD); + + } + + if (!value.IsEmpty()) + { + auto output = _CurrencyMap.Find(value); + if (output != nullptr) + return *output; + } + + return CurrencyAED; // Basically critical fail +} + +PlayFab::ServerModels::FUserSteamInfo::~FUserSteamInfo() +{ + +} + +void PlayFab::ServerModels::FUserSteamInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SteamActivationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("SteamActivationStatus")); writeTitleActivationStatusEnumJSON(SteamActivationStatus, writer); } + + if (SteamCountry.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamCountry")); writer->WriteValue(SteamCountry); } + + if (SteamCurrency.notNull()) { writer->WriteIdentifierPrefix(TEXT("SteamCurrency")); writeCurrencyEnumJSON(SteamCurrency, writer); } + + if (SteamId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamId")); writer->WriteValue(SteamId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserSteamInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + SteamActivationStatus = readTitleActivationStatusFromValue(obj->TryGetField(TEXT("SteamActivationStatus"))); + + const TSharedPtr SteamCountryValue = obj->TryGetField(TEXT("SteamCountry")); + if (SteamCountryValue.IsValid() && !SteamCountryValue->IsNull()) + { + FString TmpValue; + if (SteamCountryValue->TryGetString(TmpValue)) { SteamCountry = TmpValue; } + } + + SteamCurrency = readCurrencyFromValue(obj->TryGetField(TEXT("SteamCurrency"))); + + const TSharedPtr SteamIdValue = obj->TryGetField(TEXT("SteamId")); + if (SteamIdValue.IsValid() && !SteamIdValue->IsNull()) + { + FString TmpValue; + if (SteamIdValue->TryGetString(TmpValue)) { SteamId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeUserOriginationEnumJSON(UserOrigination enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case UserOriginationOrganic: writer->WriteValue(TEXT("Organic")); break; + case UserOriginationSteam: writer->WriteValue(TEXT("Steam")); break; + case UserOriginationGoogle: writer->WriteValue(TEXT("Google")); break; + case UserOriginationAmazon: writer->WriteValue(TEXT("Amazon")); break; + case UserOriginationFacebook: writer->WriteValue(TEXT("Facebook")); break; + case UserOriginationKongregate: writer->WriteValue(TEXT("Kongregate")); break; + case UserOriginationGamersFirst: writer->WriteValue(TEXT("GamersFirst")); break; + case UserOriginationUnknown: writer->WriteValue(TEXT("Unknown")); break; + case UserOriginationIOS: writer->WriteValue(TEXT("IOS")); break; + case UserOriginationLoadTest: writer->WriteValue(TEXT("LoadTest")); break; + case UserOriginationAndroid: writer->WriteValue(TEXT("Android")); break; + case UserOriginationPSN: writer->WriteValue(TEXT("PSN")); break; + case UserOriginationGameCenter: writer->WriteValue(TEXT("GameCenter")); break; + case UserOriginationCustomId: writer->WriteValue(TEXT("CustomId")); break; + case UserOriginationXboxLive: writer->WriteValue(TEXT("XboxLive")); break; + case UserOriginationParse: writer->WriteValue(TEXT("Parse")); break; + case UserOriginationTwitch: writer->WriteValue(TEXT("Twitch")); break; + case UserOriginationWindowsHello: writer->WriteValue(TEXT("WindowsHello")); break; + case UserOriginationServerCustomId: writer->WriteValue(TEXT("ServerCustomId")); break; + case UserOriginationNintendoSwitchDeviceId: writer->WriteValue(TEXT("NintendoSwitchDeviceId")); break; + case UserOriginationFacebookInstantGamesId: writer->WriteValue(TEXT("FacebookInstantGamesId")); break; + case UserOriginationOpenIdConnect: writer->WriteValue(TEXT("OpenIdConnect")); break; + } +} + +ServerModels::UserOrigination PlayFab::ServerModels::readUserOriginationFromValue(const TSharedPtr& value) +{ + return readUserOriginationFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::UserOrigination PlayFab::ServerModels::readUserOriginationFromValue(const FString& value) +{ + static TMap _UserOriginationMap; + if (_UserOriginationMap.Num() == 0) + { + // Auto-generate the map on the first use + _UserOriginationMap.Add(TEXT("Organic"), UserOriginationOrganic); + _UserOriginationMap.Add(TEXT("Steam"), UserOriginationSteam); + _UserOriginationMap.Add(TEXT("Google"), UserOriginationGoogle); + _UserOriginationMap.Add(TEXT("Amazon"), UserOriginationAmazon); + _UserOriginationMap.Add(TEXT("Facebook"), UserOriginationFacebook); + _UserOriginationMap.Add(TEXT("Kongregate"), UserOriginationKongregate); + _UserOriginationMap.Add(TEXT("GamersFirst"), UserOriginationGamersFirst); + _UserOriginationMap.Add(TEXT("Unknown"), UserOriginationUnknown); + _UserOriginationMap.Add(TEXT("IOS"), UserOriginationIOS); + _UserOriginationMap.Add(TEXT("LoadTest"), UserOriginationLoadTest); + _UserOriginationMap.Add(TEXT("Android"), UserOriginationAndroid); + _UserOriginationMap.Add(TEXT("PSN"), UserOriginationPSN); + _UserOriginationMap.Add(TEXT("GameCenter"), UserOriginationGameCenter); + _UserOriginationMap.Add(TEXT("CustomId"), UserOriginationCustomId); + _UserOriginationMap.Add(TEXT("XboxLive"), UserOriginationXboxLive); + _UserOriginationMap.Add(TEXT("Parse"), UserOriginationParse); + _UserOriginationMap.Add(TEXT("Twitch"), UserOriginationTwitch); + _UserOriginationMap.Add(TEXT("WindowsHello"), UserOriginationWindowsHello); + _UserOriginationMap.Add(TEXT("ServerCustomId"), UserOriginationServerCustomId); + _UserOriginationMap.Add(TEXT("NintendoSwitchDeviceId"), UserOriginationNintendoSwitchDeviceId); + _UserOriginationMap.Add(TEXT("FacebookInstantGamesId"), UserOriginationFacebookInstantGamesId); + _UserOriginationMap.Add(TEXT("OpenIdConnect"), UserOriginationOpenIdConnect); + + } + + if (!value.IsEmpty()) + { + auto output = _UserOriginationMap.Find(value); + if (output != nullptr) + return *output; + } + + return UserOriginationOrganic; // Basically critical fail +} + +PlayFab::ServerModels::FEntityKey::~FEntityKey() +{ + +} + +void PlayFab::ServerModels::FEntityKey::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Type.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Type")); writer->WriteValue(Type); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FEntityKey::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr TypeValue = obj->TryGetField(TEXT("Type")); + if (TypeValue.IsValid() && !TypeValue->IsNull()) + { + FString TmpValue; + if (TypeValue->TryGetString(TmpValue)) { Type = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserTitleInfo::~FUserTitleInfo() +{ + //if (TitlePlayerAccount != nullptr) delete TitlePlayerAccount; + +} + +void PlayFab::ServerModels::FUserTitleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (FirstLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("FirstLogin")); writeDatetime(FirstLogin, writer); } + + if (isBanned.notNull()) { writer->WriteIdentifierPrefix(TEXT("isBanned")); writer->WriteValue(isBanned); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeUserOriginationEnumJSON(Origination, writer); } + + if (TitlePlayerAccount.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TitlePlayerAccount")); TitlePlayerAccount->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserTitleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr FirstLoginValue = obj->TryGetField(TEXT("FirstLogin")); + if (FirstLoginValue.IsValid()) + FirstLogin = readDatetime(FirstLoginValue); + + + const TSharedPtr isBannedValue = obj->TryGetField(TEXT("isBanned")); + if (isBannedValue.IsValid() && !isBannedValue->IsNull()) + { + bool TmpValue; + if (isBannedValue->TryGetBool(TmpValue)) { isBanned = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + Origination = readUserOriginationFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr TitlePlayerAccountValue = obj->TryGetField(TEXT("TitlePlayerAccount")); + if (TitlePlayerAccountValue.IsValid() && !TitlePlayerAccountValue->IsNull()) + { + TitlePlayerAccount = MakeShareable(new FEntityKey(TitlePlayerAccountValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserTwitchInfo::~FUserTwitchInfo() +{ + +} + +void PlayFab::ServerModels::FUserTwitchInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TwitchId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchId")); writer->WriteValue(TwitchId); } + + if (TwitchUserName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TwitchUserName")); writer->WriteValue(TwitchUserName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserTwitchInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TwitchIdValue = obj->TryGetField(TEXT("TwitchId")); + if (TwitchIdValue.IsValid() && !TwitchIdValue->IsNull()) + { + FString TmpValue; + if (TwitchIdValue->TryGetString(TmpValue)) { TwitchId = TmpValue; } + } + + const TSharedPtr TwitchUserNameValue = obj->TryGetField(TEXT("TwitchUserName")); + if (TwitchUserNameValue.IsValid() && !TwitchUserNameValue->IsNull()) + { + FString TmpValue; + if (TwitchUserNameValue->TryGetString(TmpValue)) { TwitchUserName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserWindowsHelloInfo::~FUserWindowsHelloInfo() +{ + +} + +void PlayFab::ServerModels::FUserWindowsHelloInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (WindowsHelloDeviceName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloDeviceName")); writer->WriteValue(WindowsHelloDeviceName); } + + if (WindowsHelloPublicKeyHash.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloPublicKeyHash")); writer->WriteValue(WindowsHelloPublicKeyHash); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserWindowsHelloInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr WindowsHelloDeviceNameValue = obj->TryGetField(TEXT("WindowsHelloDeviceName")); + if (WindowsHelloDeviceNameValue.IsValid() && !WindowsHelloDeviceNameValue->IsNull()) + { + FString TmpValue; + if (WindowsHelloDeviceNameValue->TryGetString(TmpValue)) { WindowsHelloDeviceName = TmpValue; } + } + + const TSharedPtr WindowsHelloPublicKeyHashValue = obj->TryGetField(TEXT("WindowsHelloPublicKeyHash")); + if (WindowsHelloPublicKeyHashValue.IsValid() && !WindowsHelloPublicKeyHashValue->IsNull()) + { + FString TmpValue; + if (WindowsHelloPublicKeyHashValue->TryGetString(TmpValue)) { WindowsHelloPublicKeyHash = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserXboxInfo::~FUserXboxInfo() +{ + +} + +void PlayFab::ServerModels::FUserXboxInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (XboxUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxUserId")); writer->WriteValue(XboxUserId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserXboxInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr XboxUserIdValue = obj->TryGetField(TEXT("XboxUserId")); + if (XboxUserIdValue.IsValid() && !XboxUserIdValue->IsNull()) + { + FString TmpValue; + if (XboxUserIdValue->TryGetString(TmpValue)) { XboxUserId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUserAccountInfo::~FUserAccountInfo() +{ + //if (AndroidDeviceInfo != nullptr) delete AndroidDeviceInfo; + //if (CustomIdInfo != nullptr) delete CustomIdInfo; + //if (FacebookInfo != nullptr) delete FacebookInfo; + //if (FacebookInstantGamesIdInfo != nullptr) delete FacebookInstantGamesIdInfo; + //if (GameCenterInfo != nullptr) delete GameCenterInfo; + //if (GoogleInfo != nullptr) delete GoogleInfo; + //if (IosDeviceInfo != nullptr) delete IosDeviceInfo; + //if (KongregateInfo != nullptr) delete KongregateInfo; + //if (NintendoSwitchDeviceIdInfo != nullptr) delete NintendoSwitchDeviceIdInfo; + //if (PrivateInfo != nullptr) delete PrivateInfo; + //if (PsnInfo != nullptr) delete PsnInfo; + //if (SteamInfo != nullptr) delete SteamInfo; + //if (TitleInfo != nullptr) delete TitleInfo; + //if (TwitchInfo != nullptr) delete TwitchInfo; + //if (WindowsHelloInfo != nullptr) delete WindowsHelloInfo; + //if (XboxInfo != nullptr) delete XboxInfo; + +} + +void PlayFab::ServerModels::FUserAccountInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AndroidDeviceInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("AndroidDeviceInfo")); AndroidDeviceInfo->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); + + if (CustomIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("CustomIdInfo")); CustomIdInfo->writeJSON(writer); } + + if (FacebookInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInfo")); FacebookInfo->writeJSON(writer); } + + if (FacebookInstantGamesIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesIdInfo")); FacebookInstantGamesIdInfo->writeJSON(writer); } + + if (GameCenterInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GameCenterInfo")); GameCenterInfo->writeJSON(writer); } + + if (GoogleInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GoogleInfo")); GoogleInfo->writeJSON(writer); } + + if (IosDeviceInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("IosDeviceInfo")); IosDeviceInfo->writeJSON(writer); } + + if (KongregateInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("KongregateInfo")); KongregateInfo->writeJSON(writer); } + + if (NintendoSwitchDeviceIdInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceIdInfo")); NintendoSwitchDeviceIdInfo->writeJSON(writer); } + + if (OpenIdInfo.Num() != 0) + { + writer->WriteArrayStart(TEXT("OpenIdInfo")); + for (const FUserOpenIdInfo& item : OpenIdInfo) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (PrivateInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PrivateInfo")); PrivateInfo->writeJSON(writer); } + + if (PsnInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PsnInfo")); PsnInfo->writeJSON(writer); } + + if (SteamInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SteamInfo")); SteamInfo->writeJSON(writer); } + + if (TitleInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TitleInfo")); TitleInfo->writeJSON(writer); } + + if (TwitchInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("TwitchInfo")); TwitchInfo->writeJSON(writer); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + if (WindowsHelloInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("WindowsHelloInfo")); WindowsHelloInfo->writeJSON(writer); } + + if (XboxInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("XboxInfo")); XboxInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserAccountInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AndroidDeviceInfoValue = obj->TryGetField(TEXT("AndroidDeviceInfo")); + if (AndroidDeviceInfoValue.IsValid() && !AndroidDeviceInfoValue->IsNull()) + { + AndroidDeviceInfo = MakeShareable(new FUserAndroidDeviceInfo(AndroidDeviceInfoValue->AsObject())); + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr CustomIdInfoValue = obj->TryGetField(TEXT("CustomIdInfo")); + if (CustomIdInfoValue.IsValid() && !CustomIdInfoValue->IsNull()) + { + CustomIdInfo = MakeShareable(new FUserCustomIdInfo(CustomIdInfoValue->AsObject())); + } + + const TSharedPtr FacebookInfoValue = obj->TryGetField(TEXT("FacebookInfo")); + if (FacebookInfoValue.IsValid() && !FacebookInfoValue->IsNull()) + { + FacebookInfo = MakeShareable(new FUserFacebookInfo(FacebookInfoValue->AsObject())); + } + + const TSharedPtr FacebookInstantGamesIdInfoValue = obj->TryGetField(TEXT("FacebookInstantGamesIdInfo")); + if (FacebookInstantGamesIdInfoValue.IsValid() && !FacebookInstantGamesIdInfoValue->IsNull()) + { + FacebookInstantGamesIdInfo = MakeShareable(new FUserFacebookInstantGamesIdInfo(FacebookInstantGamesIdInfoValue->AsObject())); + } + + const TSharedPtr GameCenterInfoValue = obj->TryGetField(TEXT("GameCenterInfo")); + if (GameCenterInfoValue.IsValid() && !GameCenterInfoValue->IsNull()) + { + GameCenterInfo = MakeShareable(new FUserGameCenterInfo(GameCenterInfoValue->AsObject())); + } + + const TSharedPtr GoogleInfoValue = obj->TryGetField(TEXT("GoogleInfo")); + if (GoogleInfoValue.IsValid() && !GoogleInfoValue->IsNull()) + { + GoogleInfo = MakeShareable(new FUserGoogleInfo(GoogleInfoValue->AsObject())); + } + + const TSharedPtr IosDeviceInfoValue = obj->TryGetField(TEXT("IosDeviceInfo")); + if (IosDeviceInfoValue.IsValid() && !IosDeviceInfoValue->IsNull()) + { + IosDeviceInfo = MakeShareable(new FUserIosDeviceInfo(IosDeviceInfoValue->AsObject())); + } + + const TSharedPtr KongregateInfoValue = obj->TryGetField(TEXT("KongregateInfo")); + if (KongregateInfoValue.IsValid() && !KongregateInfoValue->IsNull()) + { + KongregateInfo = MakeShareable(new FUserKongregateInfo(KongregateInfoValue->AsObject())); + } + + const TSharedPtr NintendoSwitchDeviceIdInfoValue = obj->TryGetField(TEXT("NintendoSwitchDeviceIdInfo")); + if (NintendoSwitchDeviceIdInfoValue.IsValid() && !NintendoSwitchDeviceIdInfoValue->IsNull()) + { + NintendoSwitchDeviceIdInfo = MakeShareable(new FUserNintendoSwitchDeviceIdInfo(NintendoSwitchDeviceIdInfoValue->AsObject())); + } + + const TArray>&OpenIdInfoArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("OpenIdInfo")); + for (int32 Idx = 0; Idx < OpenIdInfoArray.Num(); Idx++) + { + TSharedPtr CurrentItem = OpenIdInfoArray[Idx]; + OpenIdInfo.Add(FUserOpenIdInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PrivateInfoValue = obj->TryGetField(TEXT("PrivateInfo")); + if (PrivateInfoValue.IsValid() && !PrivateInfoValue->IsNull()) + { + PrivateInfo = MakeShareable(new FUserPrivateAccountInfo(PrivateInfoValue->AsObject())); + } + + const TSharedPtr PsnInfoValue = obj->TryGetField(TEXT("PsnInfo")); + if (PsnInfoValue.IsValid() && !PsnInfoValue->IsNull()) + { + PsnInfo = MakeShareable(new FUserPsnInfo(PsnInfoValue->AsObject())); + } + + const TSharedPtr SteamInfoValue = obj->TryGetField(TEXT("SteamInfo")); + if (SteamInfoValue.IsValid() && !SteamInfoValue->IsNull()) + { + SteamInfo = MakeShareable(new FUserSteamInfo(SteamInfoValue->AsObject())); + } + + const TSharedPtr TitleInfoValue = obj->TryGetField(TEXT("TitleInfo")); + if (TitleInfoValue.IsValid() && !TitleInfoValue->IsNull()) + { + TitleInfo = MakeShareable(new FUserTitleInfo(TitleInfoValue->AsObject())); + } + + const TSharedPtr TwitchInfoValue = obj->TryGetField(TEXT("TwitchInfo")); + if (TwitchInfoValue.IsValid() && !TwitchInfoValue->IsNull()) + { + TwitchInfo = MakeShareable(new FUserTwitchInfo(TwitchInfoValue->AsObject())); + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + const TSharedPtr WindowsHelloInfoValue = obj->TryGetField(TEXT("WindowsHelloInfo")); + if (WindowsHelloInfoValue.IsValid() && !WindowsHelloInfoValue->IsNull()) + { + WindowsHelloInfo = MakeShareable(new FUserWindowsHelloInfo(WindowsHelloInfoValue->AsObject())); + } + + const TSharedPtr XboxInfoValue = obj->TryGetField(TEXT("XboxInfo")); + if (XboxInfoValue.IsValid() && !XboxInfoValue->IsNull()) + { + XboxInfo = MakeShareable(new FUserXboxInfo(XboxInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAuthenticateSessionTicketResult::~FAuthenticateSessionTicketResult() +{ + //if (UserInfo != nullptr) delete UserInfo; + +} + +void PlayFab::ServerModels::FAuthenticateSessionTicketResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (UserInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("UserInfo")); UserInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAuthenticateSessionTicketResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UserInfoValue = obj->TryGetField(TEXT("UserInfo")); + if (UserInfoValue.IsValid() && !UserInfoValue->IsNull()) + { + UserInfo = MakeShareable(new FUserAccountInfo(UserInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAwardSteamAchievementItem::~FAwardSteamAchievementItem() +{ + +} + +void PlayFab::ServerModels::FAwardSteamAchievementItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("AchievementName")); writer->WriteValue(AchievementName); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("Result")); writer->WriteValue(Result); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAwardSteamAchievementItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AchievementNameValue = obj->TryGetField(TEXT("AchievementName")); + if (AchievementNameValue.IsValid() && !AchievementNameValue->IsNull()) + { + FString TmpValue; + if (AchievementNameValue->TryGetString(TmpValue)) { AchievementName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ResultValue = obj->TryGetField(TEXT("Result")); + if (ResultValue.IsValid() && !ResultValue->IsNull()) + { + bool TmpValue; + if (ResultValue->TryGetBool(TmpValue)) { Result = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FAwardSteamAchievementRequest::~FAwardSteamAchievementRequest() +{ + +} + +void PlayFab::ServerModels::FAwardSteamAchievementRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Achievements")); + for (const FAwardSteamAchievementItem& item : Achievements) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAwardSteamAchievementRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AchievementsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Achievements")); + for (int32 Idx = 0; Idx < AchievementsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AchievementsArray[Idx]; + Achievements.Add(FAwardSteamAchievementItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FAwardSteamAchievementResult::~FAwardSteamAchievementResult() +{ + +} + +void PlayFab::ServerModels::FAwardSteamAchievementResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AchievementResults.Num() != 0) + { + writer->WriteArrayStart(TEXT("AchievementResults")); + for (const FAwardSteamAchievementItem& item : AchievementResults) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FAwardSteamAchievementResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AchievementResultsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AchievementResults")); + for (int32 Idx = 0; Idx < AchievementResultsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AchievementResultsArray[Idx]; + AchievementResults.Add(FAwardSteamAchievementItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FBanInfo::~FBanInfo() +{ + +} + +void PlayFab::ServerModels::FBanInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Active")); writer->WriteValue(Active); + + if (BanId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BanId")); writer->WriteValue(BanId); } + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (Expires.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); } + + if (IPAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IPAddress")); writer->WriteValue(IPAddress); } + + if (MACAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MACAddress")); writer->WriteValue(MACAddress); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FBanInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActiveValue = obj->TryGetField(TEXT("Active")); + if (ActiveValue.IsValid() && !ActiveValue->IsNull()) + { + bool TmpValue; + if (ActiveValue->TryGetBool(TmpValue)) { Active = TmpValue; } + } + + const TSharedPtr BanIdValue = obj->TryGetField(TEXT("BanId")); + if (BanIdValue.IsValid() && !BanIdValue->IsNull()) + { + FString TmpValue; + if (BanIdValue->TryGetString(TmpValue)) { BanId = TmpValue; } + } + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr IPAddressValue = obj->TryGetField(TEXT("IPAddress")); + if (IPAddressValue.IsValid() && !IPAddressValue->IsNull()) + { + FString TmpValue; + if (IPAddressValue->TryGetString(TmpValue)) { IPAddress = TmpValue; } + } + + const TSharedPtr MACAddressValue = obj->TryGetField(TEXT("MACAddress")); + if (MACAddressValue.IsValid() && !MACAddressValue->IsNull()) + { + FString TmpValue; + if (MACAddressValue->TryGetString(TmpValue)) { MACAddress = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FBanRequest::~FBanRequest() +{ + +} + +void PlayFab::ServerModels::FBanRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DurationInHours.notNull()) { writer->WriteIdentifierPrefix(TEXT("DurationInHours")); writer->WriteValue(static_cast(DurationInHours)); } + + if (IPAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IPAddress")); writer->WriteValue(IPAddress); } + + if (MACAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MACAddress")); writer->WriteValue(MACAddress); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FBanRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DurationInHoursValue = obj->TryGetField(TEXT("DurationInHours")); + if (DurationInHoursValue.IsValid() && !DurationInHoursValue->IsNull()) + { + uint32 TmpValue; + if (DurationInHoursValue->TryGetNumber(TmpValue)) { DurationInHours = TmpValue; } + } + + const TSharedPtr IPAddressValue = obj->TryGetField(TEXT("IPAddress")); + if (IPAddressValue.IsValid() && !IPAddressValue->IsNull()) + { + FString TmpValue; + if (IPAddressValue->TryGetString(TmpValue)) { IPAddress = TmpValue; } + } + + const TSharedPtr MACAddressValue = obj->TryGetField(TEXT("MACAddress")); + if (MACAddressValue.IsValid() && !MACAddressValue->IsNull()) + { + FString TmpValue; + if (MACAddressValue->TryGetString(TmpValue)) { MACAddress = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FBanUsersRequest::~FBanUsersRequest() +{ + +} + +void PlayFab::ServerModels::FBanUsersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Bans")); + for (const FBanRequest& item : Bans) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FBanUsersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BansArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Bans")); + for (int32 Idx = 0; Idx < BansArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BansArray[Idx]; + Bans.Add(FBanRequest(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FBanUsersResult::~FBanUsersResult() +{ + +} + +void PlayFab::ServerModels::FBanUsersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FBanUsersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FCatalogItemBundleInfo::~FCatalogItemBundleInfo() +{ + +} + +void PlayFab::ServerModels::FCatalogItemBundleInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BundledItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundledItems")); + for (const FString& item : BundledItems) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundledResultTables.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundledResultTables")); + for (const FString& item : BundledResultTables) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundledVirtualCurrencies.Num() != 0) + { + writer->WriteObjectStart(TEXT("BundledVirtualCurrencies")); + for (TMap::TConstIterator It(BundledVirtualCurrencies); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCatalogItemBundleInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("BundledItems"), BundledItems); + + obj->TryGetStringArrayField(TEXT("BundledResultTables"), BundledResultTables); + + const TSharedPtr* BundledVirtualCurrenciesObject; + if (obj->TryGetObjectField(TEXT("BundledVirtualCurrencies"), BundledVirtualCurrenciesObject)) + { + for (TMap>::TConstIterator It((*BundledVirtualCurrenciesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + BundledVirtualCurrencies.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FCatalogItemConsumableInfo::~FCatalogItemConsumableInfo() +{ + +} + +void PlayFab::ServerModels::FCatalogItemConsumableInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (UsageCount.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsageCount")); writer->WriteValue(static_cast(UsageCount)); } + + if (UsagePeriod.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsagePeriod")); writer->WriteValue(static_cast(UsagePeriod)); } + + if (UsagePeriodGroup.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UsagePeriodGroup")); writer->WriteValue(UsagePeriodGroup); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCatalogItemConsumableInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UsageCountValue = obj->TryGetField(TEXT("UsageCount")); + if (UsageCountValue.IsValid() && !UsageCountValue->IsNull()) + { + uint32 TmpValue; + if (UsageCountValue->TryGetNumber(TmpValue)) { UsageCount = TmpValue; } + } + + const TSharedPtr UsagePeriodValue = obj->TryGetField(TEXT("UsagePeriod")); + if (UsagePeriodValue.IsValid() && !UsagePeriodValue->IsNull()) + { + uint32 TmpValue; + if (UsagePeriodValue->TryGetNumber(TmpValue)) { UsagePeriod = TmpValue; } + } + + const TSharedPtr UsagePeriodGroupValue = obj->TryGetField(TEXT("UsagePeriodGroup")); + if (UsagePeriodGroupValue.IsValid() && !UsagePeriodGroupValue->IsNull()) + { + FString TmpValue; + if (UsagePeriodGroupValue->TryGetString(TmpValue)) { UsagePeriodGroup = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FCatalogItemContainerInfo::~FCatalogItemContainerInfo() +{ + +} + +void PlayFab::ServerModels::FCatalogItemContainerInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemContents")); + for (const FString& item : ItemContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (KeyItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KeyItemId")); writer->WriteValue(KeyItemId); } + + if (ResultTableContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("ResultTableContents")); + for (const FString& item : ResultTableContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyContents.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyContents")); + for (TMap::TConstIterator It(VirtualCurrencyContents); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCatalogItemContainerInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("ItemContents"), ItemContents); + + const TSharedPtr KeyItemIdValue = obj->TryGetField(TEXT("KeyItemId")); + if (KeyItemIdValue.IsValid() && !KeyItemIdValue->IsNull()) + { + FString TmpValue; + if (KeyItemIdValue->TryGetString(TmpValue)) { KeyItemId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("ResultTableContents"), ResultTableContents); + + const TSharedPtr* VirtualCurrencyContentsObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyContents"), VirtualCurrencyContentsObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyContentsObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyContents.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FCatalogItem::~FCatalogItem() +{ + //if (Bundle != nullptr) delete Bundle; + //if (Consumable != nullptr) delete Consumable; + //if (Container != nullptr) delete Container; + +} + +void PlayFab::ServerModels::FCatalogItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Bundle.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Bundle")); Bundle->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("CanBecomeCharacter")); writer->WriteValue(CanBecomeCharacter); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (Consumable.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Consumable")); Consumable->writeJSON(writer); } + + if (Container.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Container")); Container->writeJSON(writer); } + + if (CustomData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomData")); writer->WriteValue(CustomData); } + + if (Description.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Description")); writer->WriteValue(Description); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + writer->WriteIdentifierPrefix(TEXT("InitialLimitedEditionCount")); writer->WriteValue(InitialLimitedEditionCount); + + writer->WriteIdentifierPrefix(TEXT("IsLimitedEdition")); writer->WriteValue(IsLimitedEdition); + + writer->WriteIdentifierPrefix(TEXT("IsStackable")); writer->WriteValue(IsStackable); + + writer->WriteIdentifierPrefix(TEXT("IsTradable")); writer->WriteValue(IsTradable); + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (ItemImageUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemImageUrl")); writer->WriteValue(ItemImageUrl); } + + if (RealCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("RealCurrencyPrices")); + for (TMap::TConstIterator It(RealCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (VirtualCurrencyPrices.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyPrices")); + for (TMap::TConstIterator It(VirtualCurrencyPrices); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCatalogItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BundleValue = obj->TryGetField(TEXT("Bundle")); + if (BundleValue.IsValid() && !BundleValue->IsNull()) + { + Bundle = MakeShareable(new FCatalogItemBundleInfo(BundleValue->AsObject())); + } + + const TSharedPtr CanBecomeCharacterValue = obj->TryGetField(TEXT("CanBecomeCharacter")); + if (CanBecomeCharacterValue.IsValid() && !CanBecomeCharacterValue->IsNull()) + { + bool TmpValue; + if (CanBecomeCharacterValue->TryGetBool(TmpValue)) { CanBecomeCharacter = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr ConsumableValue = obj->TryGetField(TEXT("Consumable")); + if (ConsumableValue.IsValid() && !ConsumableValue->IsNull()) + { + Consumable = MakeShareable(new FCatalogItemConsumableInfo(ConsumableValue->AsObject())); + } + + const TSharedPtr ContainerValue = obj->TryGetField(TEXT("Container")); + if (ContainerValue.IsValid() && !ContainerValue->IsNull()) + { + Container = MakeShareable(new FCatalogItemContainerInfo(ContainerValue->AsObject())); + } + + const TSharedPtr CustomDataValue = obj->TryGetField(TEXT("CustomData")); + if (CustomDataValue.IsValid() && !CustomDataValue->IsNull()) + { + FString TmpValue; + if (CustomDataValue->TryGetString(TmpValue)) { CustomData = TmpValue; } + } + + const TSharedPtr DescriptionValue = obj->TryGetField(TEXT("Description")); + if (DescriptionValue.IsValid() && !DescriptionValue->IsNull()) + { + FString TmpValue; + if (DescriptionValue->TryGetString(TmpValue)) { Description = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr InitialLimitedEditionCountValue = obj->TryGetField(TEXT("InitialLimitedEditionCount")); + if (InitialLimitedEditionCountValue.IsValid() && !InitialLimitedEditionCountValue->IsNull()) + { + int32 TmpValue; + if (InitialLimitedEditionCountValue->TryGetNumber(TmpValue)) { InitialLimitedEditionCount = TmpValue; } + } + + const TSharedPtr IsLimitedEditionValue = obj->TryGetField(TEXT("IsLimitedEdition")); + if (IsLimitedEditionValue.IsValid() && !IsLimitedEditionValue->IsNull()) + { + bool TmpValue; + if (IsLimitedEditionValue->TryGetBool(TmpValue)) { IsLimitedEdition = TmpValue; } + } + + const TSharedPtr IsStackableValue = obj->TryGetField(TEXT("IsStackable")); + if (IsStackableValue.IsValid() && !IsStackableValue->IsNull()) + { + bool TmpValue; + if (IsStackableValue->TryGetBool(TmpValue)) { IsStackable = TmpValue; } + } + + const TSharedPtr IsTradableValue = obj->TryGetField(TEXT("IsTradable")); + if (IsTradableValue.IsValid() && !IsTradableValue->IsNull()) + { + bool TmpValue; + if (IsTradableValue->TryGetBool(TmpValue)) { IsTradable = TmpValue; } + } + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemImageUrlValue = obj->TryGetField(TEXT("ItemImageUrl")); + if (ItemImageUrlValue.IsValid() && !ItemImageUrlValue->IsNull()) + { + FString TmpValue; + if (ItemImageUrlValue->TryGetString(TmpValue)) { ItemImageUrl = TmpValue; } + } + + const TSharedPtr* RealCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("RealCurrencyPrices"), RealCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*RealCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + RealCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr* VirtualCurrencyPricesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyPrices"), VirtualCurrencyPricesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyPricesObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyPrices.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FItemInstance::~FItemInstance() +{ + +} + +void PlayFab::ServerModels::FItemInstance::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (BundleContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundleContents")); + for (const FString& item : BundleContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundleParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BundleParent")); writer->WriteValue(BundleParent); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CustomData.Num() != 0) + { + writer->WriteObjectStart(TEXT("CustomData")); + for (TMap::TConstIterator It(CustomData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Expiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (PurchaseDate.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); } + + if (RemainingUses.notNull()) { writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); } + + if (UnitCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnitCurrency")); writer->WriteValue(UnitCurrency); } + + writer->WriteIdentifierPrefix(TEXT("UnitPrice")); writer->WriteValue(static_cast(UnitPrice)); + + if (UsesIncrementedBy.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsesIncrementedBy")); writer->WriteValue(UsesIncrementedBy); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FItemInstance::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("BundleContents"), BundleContents); + + const TSharedPtr BundleParentValue = obj->TryGetField(TEXT("BundleParent")); + if (BundleParentValue.IsValid() && !BundleParentValue->IsNull()) + { + FString TmpValue; + if (BundleParentValue->TryGetString(TmpValue)) { BundleParent = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr* CustomDataObject; + if (obj->TryGetObjectField(TEXT("CustomData"), CustomDataObject)) + { + for (TMap>::TConstIterator It((*CustomDataObject)->Values); It; ++It) + { + CustomData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + const TSharedPtr UnitCurrencyValue = obj->TryGetField(TEXT("UnitCurrency")); + if (UnitCurrencyValue.IsValid() && !UnitCurrencyValue->IsNull()) + { + FString TmpValue; + if (UnitCurrencyValue->TryGetString(TmpValue)) { UnitCurrency = TmpValue; } + } + + const TSharedPtr UnitPriceValue = obj->TryGetField(TEXT("UnitPrice")); + if (UnitPriceValue.IsValid() && !UnitPriceValue->IsNull()) + { + uint32 TmpValue; + if (UnitPriceValue->TryGetNumber(TmpValue)) { UnitPrice = TmpValue; } + } + + const TSharedPtr UsesIncrementedByValue = obj->TryGetField(TEXT("UsesIncrementedBy")); + if (UsesIncrementedByValue.IsValid() && !UsesIncrementedByValue->IsNull()) + { + int32 TmpValue; + if (UsesIncrementedByValue->TryGetNumber(TmpValue)) { UsesIncrementedBy = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FCharacterInventory::~FCharacterInventory() +{ + +} + +void PlayFab::ServerModels::FCharacterInventory::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCharacterInventory::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FCharacterLeaderboardEntry::~FCharacterLeaderboardEntry() +{ + +} + +void PlayFab::ServerModels::FCharacterLeaderboardEntry::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CharacterName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterName")); writer->WriteValue(CharacterName); } + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteIdentifierPrefix(TEXT("Position")); writer->WriteValue(Position); + + writer->WriteIdentifierPrefix(TEXT("StatValue")); writer->WriteValue(StatValue); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCharacterLeaderboardEntry::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterNameValue = obj->TryGetField(TEXT("CharacterName")); + if (CharacterNameValue.IsValid() && !CharacterNameValue->IsNull()) + { + FString TmpValue; + if (CharacterNameValue->TryGetString(TmpValue)) { CharacterName = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PositionValue = obj->TryGetField(TEXT("Position")); + if (PositionValue.IsValid() && !PositionValue->IsNull()) + { + int32 TmpValue; + if (PositionValue->TryGetNumber(TmpValue)) { Position = TmpValue; } + } + + const TSharedPtr StatValueValue = obj->TryGetField(TEXT("StatValue")); + if (StatValueValue.IsValid() && !StatValueValue->IsNull()) + { + int32 TmpValue; + if (StatValueValue->TryGetNumber(TmpValue)) { StatValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FCharacterResult::~FCharacterResult() +{ + +} + +void PlayFab::ServerModels::FCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CharacterName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterName")); writer->WriteValue(CharacterName); } + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterNameValue = obj->TryGetField(TEXT("CharacterName")); + if (CharacterNameValue.IsValid() && !CharacterNameValue->IsNull()) + { + FString TmpValue; + if (CharacterNameValue->TryGetString(TmpValue)) { CharacterName = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeCloudScriptRevisionOptionEnumJSON(CloudScriptRevisionOption enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CloudScriptRevisionOptionLive: writer->WriteValue(TEXT("Live")); break; + case CloudScriptRevisionOptionLatest: writer->WriteValue(TEXT("Latest")); break; + case CloudScriptRevisionOptionSpecific: writer->WriteValue(TEXT("Specific")); break; + } +} + +ServerModels::CloudScriptRevisionOption PlayFab::ServerModels::readCloudScriptRevisionOptionFromValue(const TSharedPtr& value) +{ + return readCloudScriptRevisionOptionFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::CloudScriptRevisionOption PlayFab::ServerModels::readCloudScriptRevisionOptionFromValue(const FString& value) +{ + static TMap _CloudScriptRevisionOptionMap; + if (_CloudScriptRevisionOptionMap.Num() == 0) + { + // Auto-generate the map on the first use + _CloudScriptRevisionOptionMap.Add(TEXT("Live"), CloudScriptRevisionOptionLive); + _CloudScriptRevisionOptionMap.Add(TEXT("Latest"), CloudScriptRevisionOptionLatest); + _CloudScriptRevisionOptionMap.Add(TEXT("Specific"), CloudScriptRevisionOptionSpecific); + + } + + if (!value.IsEmpty()) + { + auto output = _CloudScriptRevisionOptionMap.Find(value); + if (output != nullptr) + return *output; + } + + return CloudScriptRevisionOptionLive; // Basically critical fail +} + +PlayFab::ServerModels::FConsumeItemRequest::~FConsumeItemRequest() +{ + +} + +void PlayFab::ServerModels::FConsumeItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ConsumeCount")); writer->WriteValue(ConsumeCount); + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FConsumeItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ConsumeCountValue = obj->TryGetField(TEXT("ConsumeCount")); + if (ConsumeCountValue.IsValid() && !ConsumeCountValue->IsNull()) + { + int32 TmpValue; + if (ConsumeCountValue->TryGetNumber(TmpValue)) { ConsumeCount = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FConsumeItemResult::~FConsumeItemResult() +{ + +} + +void PlayFab::ServerModels::FConsumeItemResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FConsumeItemResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeEmailVerificationStatusEnumJSON(EmailVerificationStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case EmailVerificationStatusUnverified: writer->WriteValue(TEXT("Unverified")); break; + case EmailVerificationStatusPending: writer->WriteValue(TEXT("Pending")); break; + case EmailVerificationStatusConfirmed: writer->WriteValue(TEXT("Confirmed")); break; + } +} + +ServerModels::EmailVerificationStatus PlayFab::ServerModels::readEmailVerificationStatusFromValue(const TSharedPtr& value) +{ + return readEmailVerificationStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::EmailVerificationStatus PlayFab::ServerModels::readEmailVerificationStatusFromValue(const FString& value) +{ + static TMap _EmailVerificationStatusMap; + if (_EmailVerificationStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _EmailVerificationStatusMap.Add(TEXT("Unverified"), EmailVerificationStatusUnverified); + _EmailVerificationStatusMap.Add(TEXT("Pending"), EmailVerificationStatusPending); + _EmailVerificationStatusMap.Add(TEXT("Confirmed"), EmailVerificationStatusConfirmed); + + } + + if (!value.IsEmpty()) + { + auto output = _EmailVerificationStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return EmailVerificationStatusUnverified; // Basically critical fail +} + +PlayFab::ServerModels::FContactEmailInfo::~FContactEmailInfo() +{ + +} + +void PlayFab::ServerModels::FContactEmailInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EmailAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailAddress")); writer->WriteValue(EmailAddress); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + if (VerificationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("VerificationStatus")); writeEmailVerificationStatusEnumJSON(VerificationStatus, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FContactEmailInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailAddressValue = obj->TryGetField(TEXT("EmailAddress")); + if (EmailAddressValue.IsValid() && !EmailAddressValue->IsNull()) + { + FString TmpValue; + if (EmailAddressValue->TryGetString(TmpValue)) { EmailAddress = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + VerificationStatus = readEmailVerificationStatusFromValue(obj->TryGetField(TEXT("VerificationStatus"))); + + return HasSucceeded; +} + +PlayFab::ServerModels::FContactEmailInfoModel::~FContactEmailInfoModel() +{ + +} + +void PlayFab::ServerModels::FContactEmailInfoModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EmailAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EmailAddress")); writer->WriteValue(EmailAddress); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + if (VerificationStatus.notNull()) { writer->WriteIdentifierPrefix(TEXT("VerificationStatus")); writeEmailVerificationStatusEnumJSON(VerificationStatus, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FContactEmailInfoModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailAddressValue = obj->TryGetField(TEXT("EmailAddress")); + if (EmailAddressValue.IsValid() && !EmailAddressValue->IsNull()) + { + FString TmpValue; + if (EmailAddressValue->TryGetString(TmpValue)) { EmailAddress = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + VerificationStatus = readEmailVerificationStatusFromValue(obj->TryGetField(TEXT("VerificationStatus"))); + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeContinentCodeEnumJSON(ContinentCode enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ContinentCodeAF: writer->WriteValue(TEXT("AF")); break; + case ContinentCodeAN: writer->WriteValue(TEXT("AN")); break; + case ContinentCodeAS: writer->WriteValue(TEXT("AS")); break; + case ContinentCodeEU: writer->WriteValue(TEXT("EU")); break; + case ContinentCodeNA: writer->WriteValue(TEXT("NA")); break; + case ContinentCodeOC: writer->WriteValue(TEXT("OC")); break; + case ContinentCodeSA: writer->WriteValue(TEXT("SA")); break; + } +} + +ServerModels::ContinentCode PlayFab::ServerModels::readContinentCodeFromValue(const TSharedPtr& value) +{ + return readContinentCodeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::ContinentCode PlayFab::ServerModels::readContinentCodeFromValue(const FString& value) +{ + static TMap _ContinentCodeMap; + if (_ContinentCodeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ContinentCodeMap.Add(TEXT("AF"), ContinentCodeAF); + _ContinentCodeMap.Add(TEXT("AN"), ContinentCodeAN); + _ContinentCodeMap.Add(TEXT("AS"), ContinentCodeAS); + _ContinentCodeMap.Add(TEXT("EU"), ContinentCodeEU); + _ContinentCodeMap.Add(TEXT("NA"), ContinentCodeNA); + _ContinentCodeMap.Add(TEXT("OC"), ContinentCodeOC); + _ContinentCodeMap.Add(TEXT("SA"), ContinentCodeSA); + + } + + if (!value.IsEmpty()) + { + auto output = _ContinentCodeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ContinentCodeAF; // Basically critical fail +} + +void PlayFab::ServerModels::writeCountryCodeEnumJSON(CountryCode enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case CountryCodeAF: writer->WriteValue(TEXT("AF")); break; + case CountryCodeAX: writer->WriteValue(TEXT("AX")); break; + case CountryCodeAL: writer->WriteValue(TEXT("AL")); break; + case CountryCodeDZ: writer->WriteValue(TEXT("DZ")); break; + case CountryCodeAS: writer->WriteValue(TEXT("AS")); break; + case CountryCodeAD: writer->WriteValue(TEXT("AD")); break; + case CountryCodeAO: writer->WriteValue(TEXT("AO")); break; + case CountryCodeAI: writer->WriteValue(TEXT("AI")); break; + case CountryCodeAQ: writer->WriteValue(TEXT("AQ")); break; + case CountryCodeAG: writer->WriteValue(TEXT("AG")); break; + case CountryCodeAR: writer->WriteValue(TEXT("AR")); break; + case CountryCodeAM: writer->WriteValue(TEXT("AM")); break; + case CountryCodeAW: writer->WriteValue(TEXT("AW")); break; + case CountryCodeAU: writer->WriteValue(TEXT("AU")); break; + case CountryCodeAT: writer->WriteValue(TEXT("AT")); break; + case CountryCodeAZ: writer->WriteValue(TEXT("AZ")); break; + case CountryCodeBS: writer->WriteValue(TEXT("BS")); break; + case CountryCodeBH: writer->WriteValue(TEXT("BH")); break; + case CountryCodeBD: writer->WriteValue(TEXT("BD")); break; + case CountryCodeBB: writer->WriteValue(TEXT("BB")); break; + case CountryCodeBY: writer->WriteValue(TEXT("BY")); break; + case CountryCodeBE: writer->WriteValue(TEXT("BE")); break; + case CountryCodeBZ: writer->WriteValue(TEXT("BZ")); break; + case CountryCodeBJ: writer->WriteValue(TEXT("BJ")); break; + case CountryCodeBM: writer->WriteValue(TEXT("BM")); break; + case CountryCodeBT: writer->WriteValue(TEXT("BT")); break; + case CountryCodeBO: writer->WriteValue(TEXT("BO")); break; + case CountryCodeBQ: writer->WriteValue(TEXT("BQ")); break; + case CountryCodeBA: writer->WriteValue(TEXT("BA")); break; + case CountryCodeBW: writer->WriteValue(TEXT("BW")); break; + case CountryCodeBV: writer->WriteValue(TEXT("BV")); break; + case CountryCodeBR: writer->WriteValue(TEXT("BR")); break; + case CountryCodeIO: writer->WriteValue(TEXT("IO")); break; + case CountryCodeBN: writer->WriteValue(TEXT("BN")); break; + case CountryCodeBG: writer->WriteValue(TEXT("BG")); break; + case CountryCodeBF: writer->WriteValue(TEXT("BF")); break; + case CountryCodeBI: writer->WriteValue(TEXT("BI")); break; + case CountryCodeKH: writer->WriteValue(TEXT("KH")); break; + case CountryCodeCM: writer->WriteValue(TEXT("CM")); break; + case CountryCodeCA: writer->WriteValue(TEXT("CA")); break; + case CountryCodeCV: writer->WriteValue(TEXT("CV")); break; + case CountryCodeKY: writer->WriteValue(TEXT("KY")); break; + case CountryCodeCF: writer->WriteValue(TEXT("CF")); break; + case CountryCodeTD: writer->WriteValue(TEXT("TD")); break; + case CountryCodeCL: writer->WriteValue(TEXT("CL")); break; + case CountryCodeCN: writer->WriteValue(TEXT("CN")); break; + case CountryCodeCX: writer->WriteValue(TEXT("CX")); break; + case CountryCodeCC: writer->WriteValue(TEXT("CC")); break; + case CountryCodeCO: writer->WriteValue(TEXT("CO")); break; + case CountryCodeKM: writer->WriteValue(TEXT("KM")); break; + case CountryCodeCG: writer->WriteValue(TEXT("CG")); break; + case CountryCodeCD: writer->WriteValue(TEXT("CD")); break; + case CountryCodeCK: writer->WriteValue(TEXT("CK")); break; + case CountryCodeCR: writer->WriteValue(TEXT("CR")); break; + case CountryCodeCI: writer->WriteValue(TEXT("CI")); break; + case CountryCodeHR: writer->WriteValue(TEXT("HR")); break; + case CountryCodeCU: writer->WriteValue(TEXT("CU")); break; + case CountryCodeCW: writer->WriteValue(TEXT("CW")); break; + case CountryCodeCY: writer->WriteValue(TEXT("CY")); break; + case CountryCodeCZ: writer->WriteValue(TEXT("CZ")); break; + case CountryCodeDK: writer->WriteValue(TEXT("DK")); break; + case CountryCodeDJ: writer->WriteValue(TEXT("DJ")); break; + case CountryCodeDM: writer->WriteValue(TEXT("DM")); break; + case CountryCodeDO: writer->WriteValue(TEXT("DO")); break; + case CountryCodeEC: writer->WriteValue(TEXT("EC")); break; + case CountryCodeEG: writer->WriteValue(TEXT("EG")); break; + case CountryCodeSV: writer->WriteValue(TEXT("SV")); break; + case CountryCodeGQ: writer->WriteValue(TEXT("GQ")); break; + case CountryCodeER: writer->WriteValue(TEXT("ER")); break; + case CountryCodeEE: writer->WriteValue(TEXT("EE")); break; + case CountryCodeET: writer->WriteValue(TEXT("ET")); break; + case CountryCodeFK: writer->WriteValue(TEXT("FK")); break; + case CountryCodeFO: writer->WriteValue(TEXT("FO")); break; + case CountryCodeFJ: writer->WriteValue(TEXT("FJ")); break; + case CountryCodeFI: writer->WriteValue(TEXT("FI")); break; + case CountryCodeFR: writer->WriteValue(TEXT("FR")); break; + case CountryCodeGF: writer->WriteValue(TEXT("GF")); break; + case CountryCodePF: writer->WriteValue(TEXT("PF")); break; + case CountryCodeTF: writer->WriteValue(TEXT("TF")); break; + case CountryCodeGA: writer->WriteValue(TEXT("GA")); break; + case CountryCodeGM: writer->WriteValue(TEXT("GM")); break; + case CountryCodeGE: writer->WriteValue(TEXT("GE")); break; + case CountryCodeDE: writer->WriteValue(TEXT("DE")); break; + case CountryCodeGH: writer->WriteValue(TEXT("GH")); break; + case CountryCodeGI: writer->WriteValue(TEXT("GI")); break; + case CountryCodeGR: writer->WriteValue(TEXT("GR")); break; + case CountryCodeGL: writer->WriteValue(TEXT("GL")); break; + case CountryCodeGD: writer->WriteValue(TEXT("GD")); break; + case CountryCodeGP: writer->WriteValue(TEXT("GP")); break; + case CountryCodeGU: writer->WriteValue(TEXT("GU")); break; + case CountryCodeGT: writer->WriteValue(TEXT("GT")); break; + case CountryCodeGG: writer->WriteValue(TEXT("GG")); break; + case CountryCodeGN: writer->WriteValue(TEXT("GN")); break; + case CountryCodeGW: writer->WriteValue(TEXT("GW")); break; + case CountryCodeGY: writer->WriteValue(TEXT("GY")); break; + case CountryCodeHT: writer->WriteValue(TEXT("HT")); break; + case CountryCodeHM: writer->WriteValue(TEXT("HM")); break; + case CountryCodeVA: writer->WriteValue(TEXT("VA")); break; + case CountryCodeHN: writer->WriteValue(TEXT("HN")); break; + case CountryCodeHK: writer->WriteValue(TEXT("HK")); break; + case CountryCodeHU: writer->WriteValue(TEXT("HU")); break; + case CountryCodeIS: writer->WriteValue(TEXT("IS")); break; + case CountryCodeIN: writer->WriteValue(TEXT("IN")); break; + case CountryCodeID: writer->WriteValue(TEXT("ID")); break; + case CountryCodeIR: writer->WriteValue(TEXT("IR")); break; + case CountryCodeIQ: writer->WriteValue(TEXT("IQ")); break; + case CountryCodeIE: writer->WriteValue(TEXT("IE")); break; + case CountryCodeIM: writer->WriteValue(TEXT("IM")); break; + case CountryCodeIL: writer->WriteValue(TEXT("IL")); break; + case CountryCodeIT: writer->WriteValue(TEXT("IT")); break; + case CountryCodeJM: writer->WriteValue(TEXT("JM")); break; + case CountryCodeJP: writer->WriteValue(TEXT("JP")); break; + case CountryCodeJE: writer->WriteValue(TEXT("JE")); break; + case CountryCodeJO: writer->WriteValue(TEXT("JO")); break; + case CountryCodeKZ: writer->WriteValue(TEXT("KZ")); break; + case CountryCodeKE: writer->WriteValue(TEXT("KE")); break; + case CountryCodeKI: writer->WriteValue(TEXT("KI")); break; + case CountryCodeKP: writer->WriteValue(TEXT("KP")); break; + case CountryCodeKR: writer->WriteValue(TEXT("KR")); break; + case CountryCodeKW: writer->WriteValue(TEXT("KW")); break; + case CountryCodeKG: writer->WriteValue(TEXT("KG")); break; + case CountryCodeLA: writer->WriteValue(TEXT("LA")); break; + case CountryCodeLV: writer->WriteValue(TEXT("LV")); break; + case CountryCodeLB: writer->WriteValue(TEXT("LB")); break; + case CountryCodeLS: writer->WriteValue(TEXT("LS")); break; + case CountryCodeLR: writer->WriteValue(TEXT("LR")); break; + case CountryCodeLY: writer->WriteValue(TEXT("LY")); break; + case CountryCodeLI: writer->WriteValue(TEXT("LI")); break; + case CountryCodeLT: writer->WriteValue(TEXT("LT")); break; + case CountryCodeLU: writer->WriteValue(TEXT("LU")); break; + case CountryCodeMO: writer->WriteValue(TEXT("MO")); break; + case CountryCodeMK: writer->WriteValue(TEXT("MK")); break; + case CountryCodeMG: writer->WriteValue(TEXT("MG")); break; + case CountryCodeMW: writer->WriteValue(TEXT("MW")); break; + case CountryCodeMY: writer->WriteValue(TEXT("MY")); break; + case CountryCodeMV: writer->WriteValue(TEXT("MV")); break; + case CountryCodeML: writer->WriteValue(TEXT("ML")); break; + case CountryCodeMT: writer->WriteValue(TEXT("MT")); break; + case CountryCodeMH: writer->WriteValue(TEXT("MH")); break; + case CountryCodeMQ: writer->WriteValue(TEXT("MQ")); break; + case CountryCodeMR: writer->WriteValue(TEXT("MR")); break; + case CountryCodeMU: writer->WriteValue(TEXT("MU")); break; + case CountryCodeYT: writer->WriteValue(TEXT("YT")); break; + case CountryCodeMX: writer->WriteValue(TEXT("MX")); break; + case CountryCodeFM: writer->WriteValue(TEXT("FM")); break; + case CountryCodeMD: writer->WriteValue(TEXT("MD")); break; + case CountryCodeMC: writer->WriteValue(TEXT("MC")); break; + case CountryCodeMN: writer->WriteValue(TEXT("MN")); break; + case CountryCodeME: writer->WriteValue(TEXT("ME")); break; + case CountryCodeMS: writer->WriteValue(TEXT("MS")); break; + case CountryCodeMA: writer->WriteValue(TEXT("MA")); break; + case CountryCodeMZ: writer->WriteValue(TEXT("MZ")); break; + case CountryCodeMM: writer->WriteValue(TEXT("MM")); break; + case CountryCodeNA: writer->WriteValue(TEXT("NA")); break; + case CountryCodeNR: writer->WriteValue(TEXT("NR")); break; + case CountryCodeNP: writer->WriteValue(TEXT("NP")); break; + case CountryCodeNL: writer->WriteValue(TEXT("NL")); break; + case CountryCodeNC: writer->WriteValue(TEXT("NC")); break; + case CountryCodeNZ: writer->WriteValue(TEXT("NZ")); break; + case CountryCodeNI: writer->WriteValue(TEXT("NI")); break; + case CountryCodeNE: writer->WriteValue(TEXT("NE")); break; + case CountryCodeNG: writer->WriteValue(TEXT("NG")); break; + case CountryCodeNU: writer->WriteValue(TEXT("NU")); break; + case CountryCodeNF: writer->WriteValue(TEXT("NF")); break; + case CountryCodeMP: writer->WriteValue(TEXT("MP")); break; + case CountryCodeNO: writer->WriteValue(TEXT("NO")); break; + case CountryCodeOM: writer->WriteValue(TEXT("OM")); break; + case CountryCodePK: writer->WriteValue(TEXT("PK")); break; + case CountryCodePW: writer->WriteValue(TEXT("PW")); break; + case CountryCodePS: writer->WriteValue(TEXT("PS")); break; + case CountryCodePA: writer->WriteValue(TEXT("PA")); break; + case CountryCodePG: writer->WriteValue(TEXT("PG")); break; + case CountryCodePY: writer->WriteValue(TEXT("PY")); break; + case CountryCodePE: writer->WriteValue(TEXT("PE")); break; + case CountryCodePH: writer->WriteValue(TEXT("PH")); break; + case CountryCodePN: writer->WriteValue(TEXT("PN")); break; + case CountryCodePL: writer->WriteValue(TEXT("PL")); break; + case CountryCodePT: writer->WriteValue(TEXT("PT")); break; + case CountryCodePR: writer->WriteValue(TEXT("PR")); break; + case CountryCodeQA: writer->WriteValue(TEXT("QA")); break; + case CountryCodeRE: writer->WriteValue(TEXT("RE")); break; + case CountryCodeRO: writer->WriteValue(TEXT("RO")); break; + case CountryCodeRU: writer->WriteValue(TEXT("RU")); break; + case CountryCodeRW: writer->WriteValue(TEXT("RW")); break; + case CountryCodeBL: writer->WriteValue(TEXT("BL")); break; + case CountryCodeSH: writer->WriteValue(TEXT("SH")); break; + case CountryCodeKN: writer->WriteValue(TEXT("KN")); break; + case CountryCodeLC: writer->WriteValue(TEXT("LC")); break; + case CountryCodeMF: writer->WriteValue(TEXT("MF")); break; + case CountryCodePM: writer->WriteValue(TEXT("PM")); break; + case CountryCodeVC: writer->WriteValue(TEXT("VC")); break; + case CountryCodeWS: writer->WriteValue(TEXT("WS")); break; + case CountryCodeSM: writer->WriteValue(TEXT("SM")); break; + case CountryCodeST: writer->WriteValue(TEXT("ST")); break; + case CountryCodeSA: writer->WriteValue(TEXT("SA")); break; + case CountryCodeSN: writer->WriteValue(TEXT("SN")); break; + case CountryCodeRS: writer->WriteValue(TEXT("RS")); break; + case CountryCodeSC: writer->WriteValue(TEXT("SC")); break; + case CountryCodeSL: writer->WriteValue(TEXT("SL")); break; + case CountryCodeSG: writer->WriteValue(TEXT("SG")); break; + case CountryCodeSX: writer->WriteValue(TEXT("SX")); break; + case CountryCodeSK: writer->WriteValue(TEXT("SK")); break; + case CountryCodeSI: writer->WriteValue(TEXT("SI")); break; + case CountryCodeSB: writer->WriteValue(TEXT("SB")); break; + case CountryCodeSO: writer->WriteValue(TEXT("SO")); break; + case CountryCodeZA: writer->WriteValue(TEXT("ZA")); break; + case CountryCodeGS: writer->WriteValue(TEXT("GS")); break; + case CountryCodeSS: writer->WriteValue(TEXT("SS")); break; + case CountryCodeES: writer->WriteValue(TEXT("ES")); break; + case CountryCodeLK: writer->WriteValue(TEXT("LK")); break; + case CountryCodeSD: writer->WriteValue(TEXT("SD")); break; + case CountryCodeSR: writer->WriteValue(TEXT("SR")); break; + case CountryCodeSJ: writer->WriteValue(TEXT("SJ")); break; + case CountryCodeSZ: writer->WriteValue(TEXT("SZ")); break; + case CountryCodeSE: writer->WriteValue(TEXT("SE")); break; + case CountryCodeCH: writer->WriteValue(TEXT("CH")); break; + case CountryCodeSY: writer->WriteValue(TEXT("SY")); break; + case CountryCodeTW: writer->WriteValue(TEXT("TW")); break; + case CountryCodeTJ: writer->WriteValue(TEXT("TJ")); break; + case CountryCodeTZ: writer->WriteValue(TEXT("TZ")); break; + case CountryCodeTH: writer->WriteValue(TEXT("TH")); break; + case CountryCodeTL: writer->WriteValue(TEXT("TL")); break; + case CountryCodeTG: writer->WriteValue(TEXT("TG")); break; + case CountryCodeTK: writer->WriteValue(TEXT("TK")); break; + case CountryCodeTO: writer->WriteValue(TEXT("TO")); break; + case CountryCodeTT: writer->WriteValue(TEXT("TT")); break; + case CountryCodeTN: writer->WriteValue(TEXT("TN")); break; + case CountryCodeTR: writer->WriteValue(TEXT("TR")); break; + case CountryCodeTM: writer->WriteValue(TEXT("TM")); break; + case CountryCodeTC: writer->WriteValue(TEXT("TC")); break; + case CountryCodeTV: writer->WriteValue(TEXT("TV")); break; + case CountryCodeUG: writer->WriteValue(TEXT("UG")); break; + case CountryCodeUA: writer->WriteValue(TEXT("UA")); break; + case CountryCodeAE: writer->WriteValue(TEXT("AE")); break; + case CountryCodeGB: writer->WriteValue(TEXT("GB")); break; + case CountryCodeUS: writer->WriteValue(TEXT("US")); break; + case CountryCodeUM: writer->WriteValue(TEXT("UM")); break; + case CountryCodeUY: writer->WriteValue(TEXT("UY")); break; + case CountryCodeUZ: writer->WriteValue(TEXT("UZ")); break; + case CountryCodeVU: writer->WriteValue(TEXT("VU")); break; + case CountryCodeVE: writer->WriteValue(TEXT("VE")); break; + case CountryCodeVN: writer->WriteValue(TEXT("VN")); break; + case CountryCodeVG: writer->WriteValue(TEXT("VG")); break; + case CountryCodeVI: writer->WriteValue(TEXT("VI")); break; + case CountryCodeWF: writer->WriteValue(TEXT("WF")); break; + case CountryCodeEH: writer->WriteValue(TEXT("EH")); break; + case CountryCodeYE: writer->WriteValue(TEXT("YE")); break; + case CountryCodeZM: writer->WriteValue(TEXT("ZM")); break; + case CountryCodeZW: writer->WriteValue(TEXT("ZW")); break; + } +} + +ServerModels::CountryCode PlayFab::ServerModels::readCountryCodeFromValue(const TSharedPtr& value) +{ + return readCountryCodeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::CountryCode PlayFab::ServerModels::readCountryCodeFromValue(const FString& value) +{ + static TMap _CountryCodeMap; + if (_CountryCodeMap.Num() == 0) + { + // Auto-generate the map on the first use + _CountryCodeMap.Add(TEXT("AF"), CountryCodeAF); + _CountryCodeMap.Add(TEXT("AX"), CountryCodeAX); + _CountryCodeMap.Add(TEXT("AL"), CountryCodeAL); + _CountryCodeMap.Add(TEXT("DZ"), CountryCodeDZ); + _CountryCodeMap.Add(TEXT("AS"), CountryCodeAS); + _CountryCodeMap.Add(TEXT("AD"), CountryCodeAD); + _CountryCodeMap.Add(TEXT("AO"), CountryCodeAO); + _CountryCodeMap.Add(TEXT("AI"), CountryCodeAI); + _CountryCodeMap.Add(TEXT("AQ"), CountryCodeAQ); + _CountryCodeMap.Add(TEXT("AG"), CountryCodeAG); + _CountryCodeMap.Add(TEXT("AR"), CountryCodeAR); + _CountryCodeMap.Add(TEXT("AM"), CountryCodeAM); + _CountryCodeMap.Add(TEXT("AW"), CountryCodeAW); + _CountryCodeMap.Add(TEXT("AU"), CountryCodeAU); + _CountryCodeMap.Add(TEXT("AT"), CountryCodeAT); + _CountryCodeMap.Add(TEXT("AZ"), CountryCodeAZ); + _CountryCodeMap.Add(TEXT("BS"), CountryCodeBS); + _CountryCodeMap.Add(TEXT("BH"), CountryCodeBH); + _CountryCodeMap.Add(TEXT("BD"), CountryCodeBD); + _CountryCodeMap.Add(TEXT("BB"), CountryCodeBB); + _CountryCodeMap.Add(TEXT("BY"), CountryCodeBY); + _CountryCodeMap.Add(TEXT("BE"), CountryCodeBE); + _CountryCodeMap.Add(TEXT("BZ"), CountryCodeBZ); + _CountryCodeMap.Add(TEXT("BJ"), CountryCodeBJ); + _CountryCodeMap.Add(TEXT("BM"), CountryCodeBM); + _CountryCodeMap.Add(TEXT("BT"), CountryCodeBT); + _CountryCodeMap.Add(TEXT("BO"), CountryCodeBO); + _CountryCodeMap.Add(TEXT("BQ"), CountryCodeBQ); + _CountryCodeMap.Add(TEXT("BA"), CountryCodeBA); + _CountryCodeMap.Add(TEXT("BW"), CountryCodeBW); + _CountryCodeMap.Add(TEXT("BV"), CountryCodeBV); + _CountryCodeMap.Add(TEXT("BR"), CountryCodeBR); + _CountryCodeMap.Add(TEXT("IO"), CountryCodeIO); + _CountryCodeMap.Add(TEXT("BN"), CountryCodeBN); + _CountryCodeMap.Add(TEXT("BG"), CountryCodeBG); + _CountryCodeMap.Add(TEXT("BF"), CountryCodeBF); + _CountryCodeMap.Add(TEXT("BI"), CountryCodeBI); + _CountryCodeMap.Add(TEXT("KH"), CountryCodeKH); + _CountryCodeMap.Add(TEXT("CM"), CountryCodeCM); + _CountryCodeMap.Add(TEXT("CA"), CountryCodeCA); + _CountryCodeMap.Add(TEXT("CV"), CountryCodeCV); + _CountryCodeMap.Add(TEXT("KY"), CountryCodeKY); + _CountryCodeMap.Add(TEXT("CF"), CountryCodeCF); + _CountryCodeMap.Add(TEXT("TD"), CountryCodeTD); + _CountryCodeMap.Add(TEXT("CL"), CountryCodeCL); + _CountryCodeMap.Add(TEXT("CN"), CountryCodeCN); + _CountryCodeMap.Add(TEXT("CX"), CountryCodeCX); + _CountryCodeMap.Add(TEXT("CC"), CountryCodeCC); + _CountryCodeMap.Add(TEXT("CO"), CountryCodeCO); + _CountryCodeMap.Add(TEXT("KM"), CountryCodeKM); + _CountryCodeMap.Add(TEXT("CG"), CountryCodeCG); + _CountryCodeMap.Add(TEXT("CD"), CountryCodeCD); + _CountryCodeMap.Add(TEXT("CK"), CountryCodeCK); + _CountryCodeMap.Add(TEXT("CR"), CountryCodeCR); + _CountryCodeMap.Add(TEXT("CI"), CountryCodeCI); + _CountryCodeMap.Add(TEXT("HR"), CountryCodeHR); + _CountryCodeMap.Add(TEXT("CU"), CountryCodeCU); + _CountryCodeMap.Add(TEXT("CW"), CountryCodeCW); + _CountryCodeMap.Add(TEXT("CY"), CountryCodeCY); + _CountryCodeMap.Add(TEXT("CZ"), CountryCodeCZ); + _CountryCodeMap.Add(TEXT("DK"), CountryCodeDK); + _CountryCodeMap.Add(TEXT("DJ"), CountryCodeDJ); + _CountryCodeMap.Add(TEXT("DM"), CountryCodeDM); + _CountryCodeMap.Add(TEXT("DO"), CountryCodeDO); + _CountryCodeMap.Add(TEXT("EC"), CountryCodeEC); + _CountryCodeMap.Add(TEXT("EG"), CountryCodeEG); + _CountryCodeMap.Add(TEXT("SV"), CountryCodeSV); + _CountryCodeMap.Add(TEXT("GQ"), CountryCodeGQ); + _CountryCodeMap.Add(TEXT("ER"), CountryCodeER); + _CountryCodeMap.Add(TEXT("EE"), CountryCodeEE); + _CountryCodeMap.Add(TEXT("ET"), CountryCodeET); + _CountryCodeMap.Add(TEXT("FK"), CountryCodeFK); + _CountryCodeMap.Add(TEXT("FO"), CountryCodeFO); + _CountryCodeMap.Add(TEXT("FJ"), CountryCodeFJ); + _CountryCodeMap.Add(TEXT("FI"), CountryCodeFI); + _CountryCodeMap.Add(TEXT("FR"), CountryCodeFR); + _CountryCodeMap.Add(TEXT("GF"), CountryCodeGF); + _CountryCodeMap.Add(TEXT("PF"), CountryCodePF); + _CountryCodeMap.Add(TEXT("TF"), CountryCodeTF); + _CountryCodeMap.Add(TEXT("GA"), CountryCodeGA); + _CountryCodeMap.Add(TEXT("GM"), CountryCodeGM); + _CountryCodeMap.Add(TEXT("GE"), CountryCodeGE); + _CountryCodeMap.Add(TEXT("DE"), CountryCodeDE); + _CountryCodeMap.Add(TEXT("GH"), CountryCodeGH); + _CountryCodeMap.Add(TEXT("GI"), CountryCodeGI); + _CountryCodeMap.Add(TEXT("GR"), CountryCodeGR); + _CountryCodeMap.Add(TEXT("GL"), CountryCodeGL); + _CountryCodeMap.Add(TEXT("GD"), CountryCodeGD); + _CountryCodeMap.Add(TEXT("GP"), CountryCodeGP); + _CountryCodeMap.Add(TEXT("GU"), CountryCodeGU); + _CountryCodeMap.Add(TEXT("GT"), CountryCodeGT); + _CountryCodeMap.Add(TEXT("GG"), CountryCodeGG); + _CountryCodeMap.Add(TEXT("GN"), CountryCodeGN); + _CountryCodeMap.Add(TEXT("GW"), CountryCodeGW); + _CountryCodeMap.Add(TEXT("GY"), CountryCodeGY); + _CountryCodeMap.Add(TEXT("HT"), CountryCodeHT); + _CountryCodeMap.Add(TEXT("HM"), CountryCodeHM); + _CountryCodeMap.Add(TEXT("VA"), CountryCodeVA); + _CountryCodeMap.Add(TEXT("HN"), CountryCodeHN); + _CountryCodeMap.Add(TEXT("HK"), CountryCodeHK); + _CountryCodeMap.Add(TEXT("HU"), CountryCodeHU); + _CountryCodeMap.Add(TEXT("IS"), CountryCodeIS); + _CountryCodeMap.Add(TEXT("IN"), CountryCodeIN); + _CountryCodeMap.Add(TEXT("ID"), CountryCodeID); + _CountryCodeMap.Add(TEXT("IR"), CountryCodeIR); + _CountryCodeMap.Add(TEXT("IQ"), CountryCodeIQ); + _CountryCodeMap.Add(TEXT("IE"), CountryCodeIE); + _CountryCodeMap.Add(TEXT("IM"), CountryCodeIM); + _CountryCodeMap.Add(TEXT("IL"), CountryCodeIL); + _CountryCodeMap.Add(TEXT("IT"), CountryCodeIT); + _CountryCodeMap.Add(TEXT("JM"), CountryCodeJM); + _CountryCodeMap.Add(TEXT("JP"), CountryCodeJP); + _CountryCodeMap.Add(TEXT("JE"), CountryCodeJE); + _CountryCodeMap.Add(TEXT("JO"), CountryCodeJO); + _CountryCodeMap.Add(TEXT("KZ"), CountryCodeKZ); + _CountryCodeMap.Add(TEXT("KE"), CountryCodeKE); + _CountryCodeMap.Add(TEXT("KI"), CountryCodeKI); + _CountryCodeMap.Add(TEXT("KP"), CountryCodeKP); + _CountryCodeMap.Add(TEXT("KR"), CountryCodeKR); + _CountryCodeMap.Add(TEXT("KW"), CountryCodeKW); + _CountryCodeMap.Add(TEXT("KG"), CountryCodeKG); + _CountryCodeMap.Add(TEXT("LA"), CountryCodeLA); + _CountryCodeMap.Add(TEXT("LV"), CountryCodeLV); + _CountryCodeMap.Add(TEXT("LB"), CountryCodeLB); + _CountryCodeMap.Add(TEXT("LS"), CountryCodeLS); + _CountryCodeMap.Add(TEXT("LR"), CountryCodeLR); + _CountryCodeMap.Add(TEXT("LY"), CountryCodeLY); + _CountryCodeMap.Add(TEXT("LI"), CountryCodeLI); + _CountryCodeMap.Add(TEXT("LT"), CountryCodeLT); + _CountryCodeMap.Add(TEXT("LU"), CountryCodeLU); + _CountryCodeMap.Add(TEXT("MO"), CountryCodeMO); + _CountryCodeMap.Add(TEXT("MK"), CountryCodeMK); + _CountryCodeMap.Add(TEXT("MG"), CountryCodeMG); + _CountryCodeMap.Add(TEXT("MW"), CountryCodeMW); + _CountryCodeMap.Add(TEXT("MY"), CountryCodeMY); + _CountryCodeMap.Add(TEXT("MV"), CountryCodeMV); + _CountryCodeMap.Add(TEXT("ML"), CountryCodeML); + _CountryCodeMap.Add(TEXT("MT"), CountryCodeMT); + _CountryCodeMap.Add(TEXT("MH"), CountryCodeMH); + _CountryCodeMap.Add(TEXT("MQ"), CountryCodeMQ); + _CountryCodeMap.Add(TEXT("MR"), CountryCodeMR); + _CountryCodeMap.Add(TEXT("MU"), CountryCodeMU); + _CountryCodeMap.Add(TEXT("YT"), CountryCodeYT); + _CountryCodeMap.Add(TEXT("MX"), CountryCodeMX); + _CountryCodeMap.Add(TEXT("FM"), CountryCodeFM); + _CountryCodeMap.Add(TEXT("MD"), CountryCodeMD); + _CountryCodeMap.Add(TEXT("MC"), CountryCodeMC); + _CountryCodeMap.Add(TEXT("MN"), CountryCodeMN); + _CountryCodeMap.Add(TEXT("ME"), CountryCodeME); + _CountryCodeMap.Add(TEXT("MS"), CountryCodeMS); + _CountryCodeMap.Add(TEXT("MA"), CountryCodeMA); + _CountryCodeMap.Add(TEXT("MZ"), CountryCodeMZ); + _CountryCodeMap.Add(TEXT("MM"), CountryCodeMM); + _CountryCodeMap.Add(TEXT("NA"), CountryCodeNA); + _CountryCodeMap.Add(TEXT("NR"), CountryCodeNR); + _CountryCodeMap.Add(TEXT("NP"), CountryCodeNP); + _CountryCodeMap.Add(TEXT("NL"), CountryCodeNL); + _CountryCodeMap.Add(TEXT("NC"), CountryCodeNC); + _CountryCodeMap.Add(TEXT("NZ"), CountryCodeNZ); + _CountryCodeMap.Add(TEXT("NI"), CountryCodeNI); + _CountryCodeMap.Add(TEXT("NE"), CountryCodeNE); + _CountryCodeMap.Add(TEXT("NG"), CountryCodeNG); + _CountryCodeMap.Add(TEXT("NU"), CountryCodeNU); + _CountryCodeMap.Add(TEXT("NF"), CountryCodeNF); + _CountryCodeMap.Add(TEXT("MP"), CountryCodeMP); + _CountryCodeMap.Add(TEXT("NO"), CountryCodeNO); + _CountryCodeMap.Add(TEXT("OM"), CountryCodeOM); + _CountryCodeMap.Add(TEXT("PK"), CountryCodePK); + _CountryCodeMap.Add(TEXT("PW"), CountryCodePW); + _CountryCodeMap.Add(TEXT("PS"), CountryCodePS); + _CountryCodeMap.Add(TEXT("PA"), CountryCodePA); + _CountryCodeMap.Add(TEXT("PG"), CountryCodePG); + _CountryCodeMap.Add(TEXT("PY"), CountryCodePY); + _CountryCodeMap.Add(TEXT("PE"), CountryCodePE); + _CountryCodeMap.Add(TEXT("PH"), CountryCodePH); + _CountryCodeMap.Add(TEXT("PN"), CountryCodePN); + _CountryCodeMap.Add(TEXT("PL"), CountryCodePL); + _CountryCodeMap.Add(TEXT("PT"), CountryCodePT); + _CountryCodeMap.Add(TEXT("PR"), CountryCodePR); + _CountryCodeMap.Add(TEXT("QA"), CountryCodeQA); + _CountryCodeMap.Add(TEXT("RE"), CountryCodeRE); + _CountryCodeMap.Add(TEXT("RO"), CountryCodeRO); + _CountryCodeMap.Add(TEXT("RU"), CountryCodeRU); + _CountryCodeMap.Add(TEXT("RW"), CountryCodeRW); + _CountryCodeMap.Add(TEXT("BL"), CountryCodeBL); + _CountryCodeMap.Add(TEXT("SH"), CountryCodeSH); + _CountryCodeMap.Add(TEXT("KN"), CountryCodeKN); + _CountryCodeMap.Add(TEXT("LC"), CountryCodeLC); + _CountryCodeMap.Add(TEXT("MF"), CountryCodeMF); + _CountryCodeMap.Add(TEXT("PM"), CountryCodePM); + _CountryCodeMap.Add(TEXT("VC"), CountryCodeVC); + _CountryCodeMap.Add(TEXT("WS"), CountryCodeWS); + _CountryCodeMap.Add(TEXT("SM"), CountryCodeSM); + _CountryCodeMap.Add(TEXT("ST"), CountryCodeST); + _CountryCodeMap.Add(TEXT("SA"), CountryCodeSA); + _CountryCodeMap.Add(TEXT("SN"), CountryCodeSN); + _CountryCodeMap.Add(TEXT("RS"), CountryCodeRS); + _CountryCodeMap.Add(TEXT("SC"), CountryCodeSC); + _CountryCodeMap.Add(TEXT("SL"), CountryCodeSL); + _CountryCodeMap.Add(TEXT("SG"), CountryCodeSG); + _CountryCodeMap.Add(TEXT("SX"), CountryCodeSX); + _CountryCodeMap.Add(TEXT("SK"), CountryCodeSK); + _CountryCodeMap.Add(TEXT("SI"), CountryCodeSI); + _CountryCodeMap.Add(TEXT("SB"), CountryCodeSB); + _CountryCodeMap.Add(TEXT("SO"), CountryCodeSO); + _CountryCodeMap.Add(TEXT("ZA"), CountryCodeZA); + _CountryCodeMap.Add(TEXT("GS"), CountryCodeGS); + _CountryCodeMap.Add(TEXT("SS"), CountryCodeSS); + _CountryCodeMap.Add(TEXT("ES"), CountryCodeES); + _CountryCodeMap.Add(TEXT("LK"), CountryCodeLK); + _CountryCodeMap.Add(TEXT("SD"), CountryCodeSD); + _CountryCodeMap.Add(TEXT("SR"), CountryCodeSR); + _CountryCodeMap.Add(TEXT("SJ"), CountryCodeSJ); + _CountryCodeMap.Add(TEXT("SZ"), CountryCodeSZ); + _CountryCodeMap.Add(TEXT("SE"), CountryCodeSE); + _CountryCodeMap.Add(TEXT("CH"), CountryCodeCH); + _CountryCodeMap.Add(TEXT("SY"), CountryCodeSY); + _CountryCodeMap.Add(TEXT("TW"), CountryCodeTW); + _CountryCodeMap.Add(TEXT("TJ"), CountryCodeTJ); + _CountryCodeMap.Add(TEXT("TZ"), CountryCodeTZ); + _CountryCodeMap.Add(TEXT("TH"), CountryCodeTH); + _CountryCodeMap.Add(TEXT("TL"), CountryCodeTL); + _CountryCodeMap.Add(TEXT("TG"), CountryCodeTG); + _CountryCodeMap.Add(TEXT("TK"), CountryCodeTK); + _CountryCodeMap.Add(TEXT("TO"), CountryCodeTO); + _CountryCodeMap.Add(TEXT("TT"), CountryCodeTT); + _CountryCodeMap.Add(TEXT("TN"), CountryCodeTN); + _CountryCodeMap.Add(TEXT("TR"), CountryCodeTR); + _CountryCodeMap.Add(TEXT("TM"), CountryCodeTM); + _CountryCodeMap.Add(TEXT("TC"), CountryCodeTC); + _CountryCodeMap.Add(TEXT("TV"), CountryCodeTV); + _CountryCodeMap.Add(TEXT("UG"), CountryCodeUG); + _CountryCodeMap.Add(TEXT("UA"), CountryCodeUA); + _CountryCodeMap.Add(TEXT("AE"), CountryCodeAE); + _CountryCodeMap.Add(TEXT("GB"), CountryCodeGB); + _CountryCodeMap.Add(TEXT("US"), CountryCodeUS); + _CountryCodeMap.Add(TEXT("UM"), CountryCodeUM); + _CountryCodeMap.Add(TEXT("UY"), CountryCodeUY); + _CountryCodeMap.Add(TEXT("UZ"), CountryCodeUZ); + _CountryCodeMap.Add(TEXT("VU"), CountryCodeVU); + _CountryCodeMap.Add(TEXT("VE"), CountryCodeVE); + _CountryCodeMap.Add(TEXT("VN"), CountryCodeVN); + _CountryCodeMap.Add(TEXT("VG"), CountryCodeVG); + _CountryCodeMap.Add(TEXT("VI"), CountryCodeVI); + _CountryCodeMap.Add(TEXT("WF"), CountryCodeWF); + _CountryCodeMap.Add(TEXT("EH"), CountryCodeEH); + _CountryCodeMap.Add(TEXT("YE"), CountryCodeYE); + _CountryCodeMap.Add(TEXT("ZM"), CountryCodeZM); + _CountryCodeMap.Add(TEXT("ZW"), CountryCodeZW); + + } + + if (!value.IsEmpty()) + { + auto output = _CountryCodeMap.Find(value); + if (output != nullptr) + return *output; + } + + return CountryCodeAF; // Basically critical fail +} + +PlayFab::ServerModels::FCreateSharedGroupRequest::~FCreateSharedGroupRequest() +{ + +} + +void PlayFab::ServerModels::FCreateSharedGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SharedGroupId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCreateSharedGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FCreateSharedGroupResult::~FCreateSharedGroupResult() +{ + +} + +void PlayFab::ServerModels::FCreateSharedGroupResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SharedGroupId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FCreateSharedGroupResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeleteCharacterFromUserRequest::~FDeleteCharacterFromUserRequest() +{ + +} + +void PlayFab::ServerModels::FDeleteCharacterFromUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("SaveCharacterInventory")); writer->WriteValue(SaveCharacterInventory); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeleteCharacterFromUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr SaveCharacterInventoryValue = obj->TryGetField(TEXT("SaveCharacterInventory")); + if (SaveCharacterInventoryValue.IsValid() && !SaveCharacterInventoryValue->IsNull()) + { + bool TmpValue; + if (SaveCharacterInventoryValue->TryGetBool(TmpValue)) { SaveCharacterInventory = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeleteCharacterFromUserResult::~FDeleteCharacterFromUserResult() +{ + +} + +void PlayFab::ServerModels::FDeleteCharacterFromUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeleteCharacterFromUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeleteSharedGroupRequest::~FDeleteSharedGroupRequest() +{ + +} + +void PlayFab::ServerModels::FDeleteSharedGroupRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeleteSharedGroupRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeleteUsersRequest::~FDeleteUsersRequest() +{ + +} + +void PlayFab::ServerModels::FDeleteUsersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("PlayFabIds")); + for (const FString& item : PlayFabIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeleteUsersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("PlayFabIds"), PlayFabIds); + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeleteUsersResult::~FDeleteUsersResult() +{ + +} + +void PlayFab::ServerModels::FDeleteUsersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeleteUsersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeregisterGameRequest::~FDeregisterGameRequest() +{ + +} + +void PlayFab::ServerModels::FDeregisterGameRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeregisterGameRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FDeregisterGameResponse::~FDeregisterGameResponse() +{ + +} + +void PlayFab::ServerModels::FDeregisterGameResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FDeregisterGameResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FEmptyResponse::~FEmptyResponse() +{ + +} + +void PlayFab::ServerModels::FEmptyResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FEmptyResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FEvaluateRandomResultTableRequest::~FEvaluateRandomResultTableRequest() +{ + +} + +void PlayFab::ServerModels::FEvaluateRandomResultTableRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("TableId")); writer->WriteValue(TableId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FEvaluateRandomResultTableRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr TableIdValue = obj->TryGetField(TEXT("TableId")); + if (TableIdValue.IsValid() && !TableIdValue->IsNull()) + { + FString TmpValue; + if (TableIdValue->TryGetString(TmpValue)) { TableId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FEvaluateRandomResultTableResult::~FEvaluateRandomResultTableResult() +{ + +} + +void PlayFab::ServerModels::FEvaluateRandomResultTableResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ResultItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ResultItemId")); writer->WriteValue(ResultItemId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FEvaluateRandomResultTableResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ResultItemIdValue = obj->TryGetField(TEXT("ResultItemId")); + if (ResultItemIdValue.IsValid() && !ResultItemIdValue->IsNull()) + { + FString TmpValue; + if (ResultItemIdValue->TryGetString(TmpValue)) { ResultItemId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FScriptExecutionError::~FScriptExecutionError() +{ + +} + +void PlayFab::ServerModels::FScriptExecutionError::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + if (StackTrace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StackTrace")); writer->WriteValue(StackTrace); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FScriptExecutionError::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + const TSharedPtr StackTraceValue = obj->TryGetField(TEXT("StackTrace")); + if (StackTraceValue.IsValid() && !StackTraceValue->IsNull()) + { + FString TmpValue; + if (StackTraceValue->TryGetString(TmpValue)) { StackTrace = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FLogStatement::~FLogStatement() +{ + +} + +void PlayFab::ServerModels::FLogStatement::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.notNull()) { writer->WriteIdentifierPrefix(TEXT("Data")); Data.writeJSON(writer); } + + if (Level.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Level")); writer->WriteValue(Level); } + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FLogStatement::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataValue = obj->TryGetField(TEXT("Data")); + if (DataValue.IsValid() && !DataValue->IsNull()) + { + Data = FJsonKeeper(DataValue); + } + + const TSharedPtr LevelValue = obj->TryGetField(TEXT("Level")); + if (LevelValue.IsValid() && !LevelValue->IsNull()) + { + FString TmpValue; + if (LevelValue->TryGetString(TmpValue)) { Level = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FExecuteCloudScriptResult::~FExecuteCloudScriptResult() +{ + //if (Error != nullptr) delete Error; + +} + +void PlayFab::ServerModels::FExecuteCloudScriptResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("APIRequestsIssued")); writer->WriteValue(APIRequestsIssued); + + if (Error.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Error")); Error->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("ExecutionTimeSeconds")); writer->WriteValue(ExecutionTimeSeconds); + + if (FunctionName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); } + + if (FunctionResult.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResult")); FunctionResult.writeJSON(writer); } + + if (FunctionResultTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionResultTooLarge")); writer->WriteValue(FunctionResultTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("HttpRequestsIssued")); writer->WriteValue(HttpRequestsIssued); + + if (Logs.Num() != 0) + { + writer->WriteArrayStart(TEXT("Logs")); + for (const FLogStatement& item : Logs) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (LogsTooLarge.notNull()) { writer->WriteIdentifierPrefix(TEXT("LogsTooLarge")); writer->WriteValue(LogsTooLarge); } + + writer->WriteIdentifierPrefix(TEXT("MemoryConsumedBytes")); writer->WriteValue(static_cast(MemoryConsumedBytes)); + + writer->WriteIdentifierPrefix(TEXT("ProcessorTimeSeconds")); writer->WriteValue(ProcessorTimeSeconds); + + writer->WriteIdentifierPrefix(TEXT("Revision")); writer->WriteValue(Revision); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FExecuteCloudScriptResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr APIRequestsIssuedValue = obj->TryGetField(TEXT("APIRequestsIssued")); + if (APIRequestsIssuedValue.IsValid() && !APIRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (APIRequestsIssuedValue->TryGetNumber(TmpValue)) { APIRequestsIssued = TmpValue; } + } + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + Error = MakeShareable(new FScriptExecutionError(ErrorValue->AsObject())); + } + + const TSharedPtr ExecutionTimeSecondsValue = obj->TryGetField(TEXT("ExecutionTimeSeconds")); + if (ExecutionTimeSecondsValue.IsValid() && !ExecutionTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ExecutionTimeSecondsValue->TryGetNumber(TmpValue)) { ExecutionTimeSeconds = TmpValue; } + } + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionResultValue = obj->TryGetField(TEXT("FunctionResult")); + if (FunctionResultValue.IsValid() && !FunctionResultValue->IsNull()) + { + FunctionResult = FJsonKeeper(FunctionResultValue); + } + + const TSharedPtr FunctionResultTooLargeValue = obj->TryGetField(TEXT("FunctionResultTooLarge")); + if (FunctionResultTooLargeValue.IsValid() && !FunctionResultTooLargeValue->IsNull()) + { + bool TmpValue; + if (FunctionResultTooLargeValue->TryGetBool(TmpValue)) { FunctionResultTooLarge = TmpValue; } + } + + const TSharedPtr HttpRequestsIssuedValue = obj->TryGetField(TEXT("HttpRequestsIssued")); + if (HttpRequestsIssuedValue.IsValid() && !HttpRequestsIssuedValue->IsNull()) + { + int32 TmpValue; + if (HttpRequestsIssuedValue->TryGetNumber(TmpValue)) { HttpRequestsIssued = TmpValue; } + } + + const TArray>&LogsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Logs")); + for (int32 Idx = 0; Idx < LogsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LogsArray[Idx]; + Logs.Add(FLogStatement(CurrentItem->AsObject())); + } + + + const TSharedPtr LogsTooLargeValue = obj->TryGetField(TEXT("LogsTooLarge")); + if (LogsTooLargeValue.IsValid() && !LogsTooLargeValue->IsNull()) + { + bool TmpValue; + if (LogsTooLargeValue->TryGetBool(TmpValue)) { LogsTooLarge = TmpValue; } + } + + const TSharedPtr MemoryConsumedBytesValue = obj->TryGetField(TEXT("MemoryConsumedBytes")); + if (MemoryConsumedBytesValue.IsValid() && !MemoryConsumedBytesValue->IsNull()) + { + uint32 TmpValue; + if (MemoryConsumedBytesValue->TryGetNumber(TmpValue)) { MemoryConsumedBytes = TmpValue; } + } + + const TSharedPtr ProcessorTimeSecondsValue = obj->TryGetField(TEXT("ProcessorTimeSeconds")); + if (ProcessorTimeSecondsValue.IsValid() && !ProcessorTimeSecondsValue->IsNull()) + { + double TmpValue; + if (ProcessorTimeSecondsValue->TryGetNumber(TmpValue)) { ProcessorTimeSeconds = TmpValue; } + } + + const TSharedPtr RevisionValue = obj->TryGetField(TEXT("Revision")); + if (RevisionValue.IsValid() && !RevisionValue->IsNull()) + { + int32 TmpValue; + if (RevisionValue->TryGetNumber(TmpValue)) { Revision = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FExecuteCloudScriptServerRequest::~FExecuteCloudScriptServerRequest() +{ + +} + +void PlayFab::ServerModels::FExecuteCloudScriptServerRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FunctionName")); writer->WriteValue(FunctionName); + + if (FunctionParameter.notNull()) { writer->WriteIdentifierPrefix(TEXT("FunctionParameter")); FunctionParameter.writeJSON(writer); } + + if (GeneratePlayStreamEvent.notNull()) { writer->WriteIdentifierPrefix(TEXT("GeneratePlayStreamEvent")); writer->WriteValue(GeneratePlayStreamEvent); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (RevisionSelection.notNull()) { writer->WriteIdentifierPrefix(TEXT("RevisionSelection")); writeCloudScriptRevisionOptionEnumJSON(RevisionSelection, writer); } + + if (SpecificRevision.notNull()) { writer->WriteIdentifierPrefix(TEXT("SpecificRevision")); writer->WriteValue(SpecificRevision); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FExecuteCloudScriptServerRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FunctionNameValue = obj->TryGetField(TEXT("FunctionName")); + if (FunctionNameValue.IsValid() && !FunctionNameValue->IsNull()) + { + FString TmpValue; + if (FunctionNameValue->TryGetString(TmpValue)) { FunctionName = TmpValue; } + } + + const TSharedPtr FunctionParameterValue = obj->TryGetField(TEXT("FunctionParameter")); + if (FunctionParameterValue.IsValid() && !FunctionParameterValue->IsNull()) + { + FunctionParameter = FJsonKeeper(FunctionParameterValue); + } + + const TSharedPtr GeneratePlayStreamEventValue = obj->TryGetField(TEXT("GeneratePlayStreamEvent")); + if (GeneratePlayStreamEventValue.IsValid() && !GeneratePlayStreamEventValue->IsNull()) + { + bool TmpValue; + if (GeneratePlayStreamEventValue->TryGetBool(TmpValue)) { GeneratePlayStreamEvent = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + RevisionSelection = readCloudScriptRevisionOptionFromValue(obj->TryGetField(TEXT("RevisionSelection"))); + + const TSharedPtr SpecificRevisionValue = obj->TryGetField(TEXT("SpecificRevision")); + if (SpecificRevisionValue.IsValid() && !SpecificRevisionValue->IsNull()) + { + int32 TmpValue; + if (SpecificRevisionValue->TryGetNumber(TmpValue)) { SpecificRevision = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FFacebookInstantGamesPlayFabIdPair::~FFacebookInstantGamesPlayFabIdPair() +{ + +} + +void PlayFab::ServerModels::FFacebookInstantGamesPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookInstantGamesId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookInstantGamesId")); writer->WriteValue(FacebookInstantGamesId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FFacebookInstantGamesPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookInstantGamesIdValue = obj->TryGetField(TEXT("FacebookInstantGamesId")); + if (FacebookInstantGamesIdValue.IsValid() && !FacebookInstantGamesIdValue->IsNull()) + { + FString TmpValue; + if (FacebookInstantGamesIdValue->TryGetString(TmpValue)) { FacebookInstantGamesId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FFacebookPlayFabIdPair::~FFacebookPlayFabIdPair() +{ + +} + +void PlayFab::ServerModels::FFacebookPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (FacebookId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FacebookId")); writer->WriteValue(FacebookId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FFacebookPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FacebookIdValue = obj->TryGetField(TEXT("FacebookId")); + if (FacebookIdValue.IsValid() && !FacebookIdValue->IsNull()) + { + FString TmpValue; + if (FacebookIdValue->TryGetString(TmpValue)) { FacebookId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeLoginIdentityProviderEnumJSON(LoginIdentityProvider enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case LoginIdentityProviderUnknown: writer->WriteValue(TEXT("Unknown")); break; + case LoginIdentityProviderPlayFab: writer->WriteValue(TEXT("PlayFab")); break; + case LoginIdentityProviderCustom: writer->WriteValue(TEXT("Custom")); break; + case LoginIdentityProviderGameCenter: writer->WriteValue(TEXT("GameCenter")); break; + case LoginIdentityProviderGooglePlay: writer->WriteValue(TEXT("GooglePlay")); break; + case LoginIdentityProviderSteam: writer->WriteValue(TEXT("Steam")); break; + case LoginIdentityProviderXBoxLive: writer->WriteValue(TEXT("XBoxLive")); break; + case LoginIdentityProviderPSN: writer->WriteValue(TEXT("PSN")); break; + case LoginIdentityProviderKongregate: writer->WriteValue(TEXT("Kongregate")); break; + case LoginIdentityProviderFacebook: writer->WriteValue(TEXT("Facebook")); break; + case LoginIdentityProviderIOSDevice: writer->WriteValue(TEXT("IOSDevice")); break; + case LoginIdentityProviderAndroidDevice: writer->WriteValue(TEXT("AndroidDevice")); break; + case LoginIdentityProviderTwitch: writer->WriteValue(TEXT("Twitch")); break; + case LoginIdentityProviderWindowsHello: writer->WriteValue(TEXT("WindowsHello")); break; + case LoginIdentityProviderGameServer: writer->WriteValue(TEXT("GameServer")); break; + case LoginIdentityProviderCustomServer: writer->WriteValue(TEXT("CustomServer")); break; + case LoginIdentityProviderNintendoSwitch: writer->WriteValue(TEXT("NintendoSwitch")); break; + case LoginIdentityProviderFacebookInstantGames: writer->WriteValue(TEXT("FacebookInstantGames")); break; + case LoginIdentityProviderOpenIdConnect: writer->WriteValue(TEXT("OpenIdConnect")); break; + } +} + +ServerModels::LoginIdentityProvider PlayFab::ServerModels::readLoginIdentityProviderFromValue(const TSharedPtr& value) +{ + return readLoginIdentityProviderFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::LoginIdentityProvider PlayFab::ServerModels::readLoginIdentityProviderFromValue(const FString& value) +{ + static TMap _LoginIdentityProviderMap; + if (_LoginIdentityProviderMap.Num() == 0) + { + // Auto-generate the map on the first use + _LoginIdentityProviderMap.Add(TEXT("Unknown"), LoginIdentityProviderUnknown); + _LoginIdentityProviderMap.Add(TEXT("PlayFab"), LoginIdentityProviderPlayFab); + _LoginIdentityProviderMap.Add(TEXT("Custom"), LoginIdentityProviderCustom); + _LoginIdentityProviderMap.Add(TEXT("GameCenter"), LoginIdentityProviderGameCenter); + _LoginIdentityProviderMap.Add(TEXT("GooglePlay"), LoginIdentityProviderGooglePlay); + _LoginIdentityProviderMap.Add(TEXT("Steam"), LoginIdentityProviderSteam); + _LoginIdentityProviderMap.Add(TEXT("XBoxLive"), LoginIdentityProviderXBoxLive); + _LoginIdentityProviderMap.Add(TEXT("PSN"), LoginIdentityProviderPSN); + _LoginIdentityProviderMap.Add(TEXT("Kongregate"), LoginIdentityProviderKongregate); + _LoginIdentityProviderMap.Add(TEXT("Facebook"), LoginIdentityProviderFacebook); + _LoginIdentityProviderMap.Add(TEXT("IOSDevice"), LoginIdentityProviderIOSDevice); + _LoginIdentityProviderMap.Add(TEXT("AndroidDevice"), LoginIdentityProviderAndroidDevice); + _LoginIdentityProviderMap.Add(TEXT("Twitch"), LoginIdentityProviderTwitch); + _LoginIdentityProviderMap.Add(TEXT("WindowsHello"), LoginIdentityProviderWindowsHello); + _LoginIdentityProviderMap.Add(TEXT("GameServer"), LoginIdentityProviderGameServer); + _LoginIdentityProviderMap.Add(TEXT("CustomServer"), LoginIdentityProviderCustomServer); + _LoginIdentityProviderMap.Add(TEXT("NintendoSwitch"), LoginIdentityProviderNintendoSwitch); + _LoginIdentityProviderMap.Add(TEXT("FacebookInstantGames"), LoginIdentityProviderFacebookInstantGames); + _LoginIdentityProviderMap.Add(TEXT("OpenIdConnect"), LoginIdentityProviderOpenIdConnect); + + } + + if (!value.IsEmpty()) + { + auto output = _LoginIdentityProviderMap.Find(value); + if (output != nullptr) + return *output; + } + + return LoginIdentityProviderUnknown; // Basically critical fail +} + +PlayFab::ServerModels::FLinkedPlatformAccountModel::~FLinkedPlatformAccountModel() +{ + +} + +void PlayFab::ServerModels::FLinkedPlatformAccountModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writeLoginIdentityProviderEnumJSON(Platform, writer); } + + if (PlatformUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlatformUserId")); writer->WriteValue(PlatformUserId); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FLinkedPlatformAccountModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + Platform = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Platform"))); + + const TSharedPtr PlatformUserIdValue = obj->TryGetField(TEXT("PlatformUserId")); + if (PlatformUserIdValue.IsValid() && !PlatformUserIdValue->IsNull()) + { + FString TmpValue; + if (PlatformUserIdValue->TryGetString(TmpValue)) { PlatformUserId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FLocationModel::~FLocationModel() +{ + +} + +void PlayFab::ServerModels::FLocationModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (City.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("City")); writer->WriteValue(City); } + + if (pfContinentCode.notNull()) { writer->WriteIdentifierPrefix(TEXT("ContinentCode")); writeContinentCodeEnumJSON(pfContinentCode, writer); } + + if (pfCountryCode.notNull()) { writer->WriteIdentifierPrefix(TEXT("CountryCode")); writeCountryCodeEnumJSON(pfCountryCode, writer); } + + if (Latitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Latitude")); writer->WriteValue(Latitude); } + + if (Longitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Longitude")); writer->WriteValue(Longitude); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FLocationModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CityValue = obj->TryGetField(TEXT("City")); + if (CityValue.IsValid() && !CityValue->IsNull()) + { + FString TmpValue; + if (CityValue->TryGetString(TmpValue)) { City = TmpValue; } + } + + pfContinentCode = readContinentCodeFromValue(obj->TryGetField(TEXT("ContinentCode"))); + + pfCountryCode = readCountryCodeFromValue(obj->TryGetField(TEXT("CountryCode"))); + + const TSharedPtr LatitudeValue = obj->TryGetField(TEXT("Latitude")); + if (LatitudeValue.IsValid() && !LatitudeValue->IsNull()) + { + double TmpValue; + if (LatitudeValue->TryGetNumber(TmpValue)) { Latitude = TmpValue; } + } + + const TSharedPtr LongitudeValue = obj->TryGetField(TEXT("Longitude")); + if (LongitudeValue.IsValid() && !LongitudeValue->IsNull()) + { + double TmpValue; + if (LongitudeValue->TryGetNumber(TmpValue)) { Longitude = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeSubscriptionProviderStatusEnumJSON(SubscriptionProviderStatus enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case SubscriptionProviderStatusNoError: writer->WriteValue(TEXT("NoError")); break; + case SubscriptionProviderStatusCancelled: writer->WriteValue(TEXT("Cancelled")); break; + case SubscriptionProviderStatusUnknownError: writer->WriteValue(TEXT("UnknownError")); break; + case SubscriptionProviderStatusBillingError: writer->WriteValue(TEXT("BillingError")); break; + case SubscriptionProviderStatusProductUnavailable: writer->WriteValue(TEXT("ProductUnavailable")); break; + case SubscriptionProviderStatusCustomerDidNotAcceptPriceChange: writer->WriteValue(TEXT("CustomerDidNotAcceptPriceChange")); break; + case SubscriptionProviderStatusFreeTrial: writer->WriteValue(TEXT("FreeTrial")); break; + case SubscriptionProviderStatusPaymentPending: writer->WriteValue(TEXT("PaymentPending")); break; + } +} + +ServerModels::SubscriptionProviderStatus PlayFab::ServerModels::readSubscriptionProviderStatusFromValue(const TSharedPtr& value) +{ + return readSubscriptionProviderStatusFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::SubscriptionProviderStatus PlayFab::ServerModels::readSubscriptionProviderStatusFromValue(const FString& value) +{ + static TMap _SubscriptionProviderStatusMap; + if (_SubscriptionProviderStatusMap.Num() == 0) + { + // Auto-generate the map on the first use + _SubscriptionProviderStatusMap.Add(TEXT("NoError"), SubscriptionProviderStatusNoError); + _SubscriptionProviderStatusMap.Add(TEXT("Cancelled"), SubscriptionProviderStatusCancelled); + _SubscriptionProviderStatusMap.Add(TEXT("UnknownError"), SubscriptionProviderStatusUnknownError); + _SubscriptionProviderStatusMap.Add(TEXT("BillingError"), SubscriptionProviderStatusBillingError); + _SubscriptionProviderStatusMap.Add(TEXT("ProductUnavailable"), SubscriptionProviderStatusProductUnavailable); + _SubscriptionProviderStatusMap.Add(TEXT("CustomerDidNotAcceptPriceChange"), SubscriptionProviderStatusCustomerDidNotAcceptPriceChange); + _SubscriptionProviderStatusMap.Add(TEXT("FreeTrial"), SubscriptionProviderStatusFreeTrial); + _SubscriptionProviderStatusMap.Add(TEXT("PaymentPending"), SubscriptionProviderStatusPaymentPending); + + } + + if (!value.IsEmpty()) + { + auto output = _SubscriptionProviderStatusMap.Find(value); + if (output != nullptr) + return *output; + } + + return SubscriptionProviderStatusNoError; // Basically critical fail +} + +PlayFab::ServerModels::FSubscriptionModel::~FSubscriptionModel() +{ + +} + +void PlayFab::ServerModels::FSubscriptionModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); + + writer->WriteIdentifierPrefix(TEXT("InitialSubscriptionTime")); writeDatetime(InitialSubscriptionTime, writer); + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + if (Status.notNull()) { writer->WriteIdentifierPrefix(TEXT("Status")); writeSubscriptionProviderStatusEnumJSON(Status, writer); } + + if (SubscriptionId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionId")); writer->WriteValue(SubscriptionId); } + + if (SubscriptionItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionItemId")); writer->WriteValue(SubscriptionItemId); } + + if (SubscriptionProvider.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SubscriptionProvider")); writer->WriteValue(SubscriptionProvider); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSubscriptionModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr InitialSubscriptionTimeValue = obj->TryGetField(TEXT("InitialSubscriptionTime")); + if (InitialSubscriptionTimeValue.IsValid()) + InitialSubscriptionTime = readDatetime(InitialSubscriptionTimeValue); + + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + Status = readSubscriptionProviderStatusFromValue(obj->TryGetField(TEXT("Status"))); + + const TSharedPtr SubscriptionIdValue = obj->TryGetField(TEXT("SubscriptionId")); + if (SubscriptionIdValue.IsValid() && !SubscriptionIdValue->IsNull()) + { + FString TmpValue; + if (SubscriptionIdValue->TryGetString(TmpValue)) { SubscriptionId = TmpValue; } + } + + const TSharedPtr SubscriptionItemIdValue = obj->TryGetField(TEXT("SubscriptionItemId")); + if (SubscriptionItemIdValue.IsValid() && !SubscriptionItemIdValue->IsNull()) + { + FString TmpValue; + if (SubscriptionItemIdValue->TryGetString(TmpValue)) { SubscriptionItemId = TmpValue; } + } + + const TSharedPtr SubscriptionProviderValue = obj->TryGetField(TEXT("SubscriptionProvider")); + if (SubscriptionProviderValue.IsValid() && !SubscriptionProviderValue->IsNull()) + { + FString TmpValue; + if (SubscriptionProviderValue->TryGetString(TmpValue)) { SubscriptionProvider = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FMembershipModel::~FMembershipModel() +{ + +} + +void PlayFab::ServerModels::FMembershipModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("IsActive")); writer->WriteValue(IsActive); + + writer->WriteIdentifierPrefix(TEXT("MembershipExpiration")); writeDatetime(MembershipExpiration, writer); + + if (MembershipId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MembershipId")); writer->WriteValue(MembershipId); } + + if (OverrideExpiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("OverrideExpiration")); writeDatetime(OverrideExpiration, writer); } + + if (OverrideIsSet.notNull()) { writer->WriteIdentifierPrefix(TEXT("OverrideIsSet")); writer->WriteValue(OverrideIsSet); } + + if (Subscriptions.Num() != 0) + { + writer->WriteArrayStart(TEXT("Subscriptions")); + for (const FSubscriptionModel& item : Subscriptions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMembershipModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IsActiveValue = obj->TryGetField(TEXT("IsActive")); + if (IsActiveValue.IsValid() && !IsActiveValue->IsNull()) + { + bool TmpValue; + if (IsActiveValue->TryGetBool(TmpValue)) { IsActive = TmpValue; } + } + + const TSharedPtr MembershipExpirationValue = obj->TryGetField(TEXT("MembershipExpiration")); + if (MembershipExpirationValue.IsValid()) + MembershipExpiration = readDatetime(MembershipExpirationValue); + + + const TSharedPtr MembershipIdValue = obj->TryGetField(TEXT("MembershipId")); + if (MembershipIdValue.IsValid() && !MembershipIdValue->IsNull()) + { + FString TmpValue; + if (MembershipIdValue->TryGetString(TmpValue)) { MembershipId = TmpValue; } + } + + const TSharedPtr OverrideExpirationValue = obj->TryGetField(TEXT("OverrideExpiration")); + if (OverrideExpirationValue.IsValid()) + OverrideExpiration = readDatetime(OverrideExpirationValue); + + + const TSharedPtr OverrideIsSetValue = obj->TryGetField(TEXT("OverrideIsSet")); + if (OverrideIsSetValue.IsValid() && !OverrideIsSetValue->IsNull()) + { + bool TmpValue; + if (OverrideIsSetValue->TryGetBool(TmpValue)) { OverrideIsSet = TmpValue; } + } + + const TArray>&SubscriptionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Subscriptions")); + for (int32 Idx = 0; Idx < SubscriptionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SubscriptionsArray[Idx]; + Subscriptions.Add(FSubscriptionModel(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FPushNotificationRegistrationModel::~FPushNotificationRegistrationModel() +{ + +} + +void PlayFab::ServerModels::FPushNotificationRegistrationModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NotificationEndpointARN.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NotificationEndpointARN")); writer->WriteValue(NotificationEndpointARN); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writePushNotificationPlatformEnumJSON(Platform, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPushNotificationRegistrationModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NotificationEndpointARNValue = obj->TryGetField(TEXT("NotificationEndpointARN")); + if (NotificationEndpointARNValue.IsValid() && !NotificationEndpointARNValue->IsNull()) + { + FString TmpValue; + if (NotificationEndpointARNValue->TryGetString(TmpValue)) { NotificationEndpointARN = TmpValue; } + } + + Platform = readPushNotificationPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::ServerModels::FStatisticModel::~FStatisticModel() +{ + +} + +void PlayFab::ServerModels::FStatisticModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FStatisticModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FTagModel::~FTagModel() +{ + +} + +void PlayFab::ServerModels::FTagModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (TagValue.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TagValue")); writer->WriteValue(TagValue); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FTagModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TagValueValue = obj->TryGetField(TEXT("TagValue")); + if (TagValueValue.IsValid() && !TagValueValue->IsNull()) + { + FString TmpValue; + if (TagValueValue->TryGetString(TmpValue)) { TagValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FValueToDateModel::~FValueToDateModel() +{ + +} + +void PlayFab::ServerModels::FValueToDateModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Currency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Currency")); writer->WriteValue(Currency); } + + writer->WriteIdentifierPrefix(TEXT("TotalValue")); writer->WriteValue(static_cast(TotalValue)); + + if (TotalValueAsDecimal.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TotalValueAsDecimal")); writer->WriteValue(TotalValueAsDecimal); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FValueToDateModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrencyValue = obj->TryGetField(TEXT("Currency")); + if (CurrencyValue.IsValid() && !CurrencyValue->IsNull()) + { + FString TmpValue; + if (CurrencyValue->TryGetString(TmpValue)) { Currency = TmpValue; } + } + + const TSharedPtr TotalValueValue = obj->TryGetField(TEXT("TotalValue")); + if (TotalValueValue.IsValid() && !TotalValueValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueValue->TryGetNumber(TmpValue)) { TotalValue = TmpValue; } + } + + const TSharedPtr TotalValueAsDecimalValue = obj->TryGetField(TEXT("TotalValueAsDecimal")); + if (TotalValueAsDecimalValue.IsValid() && !TotalValueAsDecimalValue->IsNull()) + { + FString TmpValue; + if (TotalValueAsDecimalValue->TryGetString(TmpValue)) { TotalValueAsDecimal = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerProfileModel::~FPlayerProfileModel() +{ + +} + +void PlayFab::ServerModels::FPlayerProfileModel::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdCampaignAttributions.Num() != 0) + { + writer->WriteArrayStart(TEXT("AdCampaignAttributions")); + for (const FAdCampaignAttributionModel& item : AdCampaignAttributions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + if (BannedUntil.notNull()) { writer->WriteIdentifierPrefix(TEXT("BannedUntil")); writeDatetime(BannedUntil, writer); } + + if (ContactEmailAddresses.Num() != 0) + { + writer->WriteArrayStart(TEXT("ContactEmailAddresses")); + for (const FContactEmailInfoModel& item : ContactEmailAddresses) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (LinkedAccounts.Num() != 0) + { + writer->WriteArrayStart(TEXT("LinkedAccounts")); + for (const FLinkedPlatformAccountModel& item : LinkedAccounts) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Locations.Num() != 0) + { + writer->WriteArrayStart(TEXT("Locations")); + for (const FLocationModel& item : Locations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Memberships.Num() != 0) + { + writer->WriteArrayStart(TEXT("Memberships")); + for (const FMembershipModel& item : Memberships) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeLoginIdentityProviderEnumJSON(Origination, writer); } + + if (PlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerId")); writer->WriteValue(PlayerId); } + + if (PublisherId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PublisherId")); writer->WriteValue(PublisherId); } + + if (PushNotificationRegistrations.Num() != 0) + { + writer->WriteArrayStart(TEXT("PushNotificationRegistrations")); + for (const FPushNotificationRegistrationModel& item : PushNotificationRegistrations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Statistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticModel& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FTagModel& item : Tags) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + if (TotalValueToDateInUSD.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalValueToDateInUSD")); writer->WriteValue(static_cast(TotalValueToDateInUSD)); } + + if (ValuesToDate.Num() != 0) + { + writer->WriteArrayStart(TEXT("ValuesToDate")); + for (const FValueToDateModel& item : ValuesToDate) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerProfileModel::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AdCampaignAttributionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AdCampaignAttributions")); + for (int32 Idx = 0; Idx < AdCampaignAttributionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AdCampaignAttributionsArray[Idx]; + AdCampaignAttributions.Add(FAdCampaignAttributionModel(CurrentItem->AsObject())); + } + + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr BannedUntilValue = obj->TryGetField(TEXT("BannedUntil")); + if (BannedUntilValue.IsValid()) + BannedUntil = readDatetime(BannedUntilValue); + + + const TArray>&ContactEmailAddressesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ContactEmailAddresses")); + for (int32 Idx = 0; Idx < ContactEmailAddressesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContactEmailAddressesArray[Idx]; + ContactEmailAddresses.Add(FContactEmailInfoModel(CurrentItem->AsObject())); + } + + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + const TArray>&LinkedAccountsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("LinkedAccounts")); + for (int32 Idx = 0; Idx < LinkedAccountsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LinkedAccountsArray[Idx]; + LinkedAccounts.Add(FLinkedPlatformAccountModel(CurrentItem->AsObject())); + } + + + const TArray>&LocationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Locations")); + for (int32 Idx = 0; Idx < LocationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LocationsArray[Idx]; + Locations.Add(FLocationModel(CurrentItem->AsObject())); + } + + + const TArray>&MembershipsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Memberships")); + for (int32 Idx = 0; Idx < MembershipsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = MembershipsArray[Idx]; + Memberships.Add(FMembershipModel(CurrentItem->AsObject())); + } + + + Origination = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr PlayerIdValue = obj->TryGetField(TEXT("PlayerId")); + if (PlayerIdValue.IsValid() && !PlayerIdValue->IsNull()) + { + FString TmpValue; + if (PlayerIdValue->TryGetString(TmpValue)) { PlayerId = TmpValue; } + } + + const TSharedPtr PublisherIdValue = obj->TryGetField(TEXT("PublisherId")); + if (PublisherIdValue.IsValid() && !PublisherIdValue->IsNull()) + { + FString TmpValue; + if (PublisherIdValue->TryGetString(TmpValue)) { PublisherId = TmpValue; } + } + + const TArray>&PushNotificationRegistrationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PushNotificationRegistrations")); + for (int32 Idx = 0; Idx < PushNotificationRegistrationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PushNotificationRegistrationsArray[Idx]; + PushNotificationRegistrations.Add(FPushNotificationRegistrationModel(CurrentItem->AsObject())); + } + + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticModel(CurrentItem->AsObject())); + } + + + const TArray>&TagsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Tags")); + for (int32 Idx = 0; Idx < TagsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = TagsArray[Idx]; + Tags.Add(FTagModel(CurrentItem->AsObject())); + } + + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr TotalValueToDateInUSDValue = obj->TryGetField(TEXT("TotalValueToDateInUSD")); + if (TotalValueToDateInUSDValue.IsValid() && !TotalValueToDateInUSDValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueToDateInUSDValue->TryGetNumber(TmpValue)) { TotalValueToDateInUSD = TmpValue; } + } + + const TArray>&ValuesToDateArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ValuesToDate")); + for (int32 Idx = 0; Idx < ValuesToDateArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ValuesToDateArray[Idx]; + ValuesToDate.Add(FValueToDateModel(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FFriendInfo::~FFriendInfo() +{ + //if (FacebookInfo != nullptr) delete FacebookInfo; + //if (GameCenterInfo != nullptr) delete GameCenterInfo; + //if (Profile != nullptr) delete Profile; + //if (PSNInfo != nullptr) delete PSNInfo; + //if (SteamInfo != nullptr) delete SteamInfo; + //if (XboxInfo != nullptr) delete XboxInfo; + +} + +void PlayFab::ServerModels::FFriendInfo::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CurrentMatchmakerLobbyId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CurrentMatchmakerLobbyId")); writer->WriteValue(CurrentMatchmakerLobbyId); } + + if (FacebookInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("FacebookInfo")); FacebookInfo->writeJSON(writer); } + + if (FriendPlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); } + + if (GameCenterInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("GameCenterInfo")); GameCenterInfo->writeJSON(writer); } + + if (Profile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Profile")); Profile->writeJSON(writer); } + + if (PSNInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PSNInfo")); PSNInfo->writeJSON(writer); } + + if (SteamInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("SteamInfo")); SteamInfo->writeJSON(writer); } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (TitleDisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleDisplayName")); writer->WriteValue(TitleDisplayName); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + if (XboxInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("XboxInfo")); XboxInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FFriendInfo::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CurrentMatchmakerLobbyIdValue = obj->TryGetField(TEXT("CurrentMatchmakerLobbyId")); + if (CurrentMatchmakerLobbyIdValue.IsValid() && !CurrentMatchmakerLobbyIdValue->IsNull()) + { + FString TmpValue; + if (CurrentMatchmakerLobbyIdValue->TryGetString(TmpValue)) { CurrentMatchmakerLobbyId = TmpValue; } + } + + const TSharedPtr FacebookInfoValue = obj->TryGetField(TEXT("FacebookInfo")); + if (FacebookInfoValue.IsValid() && !FacebookInfoValue->IsNull()) + { + FacebookInfo = MakeShareable(new FUserFacebookInfo(FacebookInfoValue->AsObject())); + } + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + const TSharedPtr GameCenterInfoValue = obj->TryGetField(TEXT("GameCenterInfo")); + if (GameCenterInfoValue.IsValid() && !GameCenterInfoValue->IsNull()) + { + GameCenterInfo = MakeShareable(new FUserGameCenterInfo(GameCenterInfoValue->AsObject())); + } + + const TSharedPtr ProfileValue = obj->TryGetField(TEXT("Profile")); + if (ProfileValue.IsValid() && !ProfileValue->IsNull()) + { + Profile = MakeShareable(new FPlayerProfileModel(ProfileValue->AsObject())); + } + + const TSharedPtr PSNInfoValue = obj->TryGetField(TEXT("PSNInfo")); + if (PSNInfoValue.IsValid() && !PSNInfoValue->IsNull()) + { + PSNInfo = MakeShareable(new FUserPsnInfo(PSNInfoValue->AsObject())); + } + + const TSharedPtr SteamInfoValue = obj->TryGetField(TEXT("SteamInfo")); + if (SteamInfoValue.IsValid() && !SteamInfoValue->IsNull()) + { + SteamInfo = MakeShareable(new FUserSteamInfo(SteamInfoValue->AsObject())); + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr TitleDisplayNameValue = obj->TryGetField(TEXT("TitleDisplayName")); + if (TitleDisplayNameValue.IsValid() && !TitleDisplayNameValue->IsNull()) + { + FString TmpValue; + if (TitleDisplayNameValue->TryGetString(TmpValue)) { TitleDisplayName = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + const TSharedPtr XboxInfoValue = obj->TryGetField(TEXT("XboxInfo")); + if (XboxInfoValue.IsValid() && !XboxInfoValue->IsNull()) + { + XboxInfo = MakeShareable(new FUserXboxInfo(XboxInfoValue->AsObject())); + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeGameInstanceStateEnumJSON(GameInstanceState enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case GameInstanceStateOpen: writer->WriteValue(TEXT("Open")); break; + case GameInstanceStateClosed: writer->WriteValue(TEXT("Closed")); break; + } +} + +ServerModels::GameInstanceState PlayFab::ServerModels::readGameInstanceStateFromValue(const TSharedPtr& value) +{ + return readGameInstanceStateFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::GameInstanceState PlayFab::ServerModels::readGameInstanceStateFromValue(const FString& value) +{ + static TMap _GameInstanceStateMap; + if (_GameInstanceStateMap.Num() == 0) + { + // Auto-generate the map on the first use + _GameInstanceStateMap.Add(TEXT("Open"), GameInstanceStateOpen); + _GameInstanceStateMap.Add(TEXT("Closed"), GameInstanceStateClosed); + + } + + if (!value.IsEmpty()) + { + auto output = _GameInstanceStateMap.Find(value); + if (output != nullptr) + return *output; + } + + return GameInstanceStateOpen; // Basically critical fail +} + +PlayFab::ServerModels::FGetAllSegmentsRequest::~FGetAllSegmentsRequest() +{ + +} + +void PlayFab::ServerModels::FGetAllSegmentsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetAllSegmentsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetSegmentResult::~FGetSegmentResult() +{ + +} + +void PlayFab::ServerModels::FGetSegmentResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ABTestParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ABTestParent")); writer->WriteValue(ABTestParent); } + + writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetSegmentResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ABTestParentValue = obj->TryGetField(TEXT("ABTestParent")); + if (ABTestParentValue.IsValid() && !ABTestParentValue->IsNull()) + { + FString TmpValue; + if (ABTestParentValue->TryGetString(TmpValue)) { ABTestParent = TmpValue; } + } + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetAllSegmentsResult::~FGetAllSegmentsResult() +{ + +} + +void PlayFab::ServerModels::FGetAllSegmentsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Segments.Num() != 0) + { + writer->WriteArrayStart(TEXT("Segments")); + for (const FGetSegmentResult& item : Segments) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetAllSegmentsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SegmentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Segments")); + for (int32 Idx = 0; Idx < SegmentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SegmentsArray[Idx]; + Segments.Add(FGetSegmentResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCatalogItemsRequest::~FGetCatalogItemsRequest() +{ + +} + +void PlayFab::ServerModels::FGetCatalogItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCatalogItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCatalogItemsResult::~FGetCatalogItemsResult() +{ + +} + +void PlayFab::ServerModels::FGetCatalogItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Catalog.Num() != 0) + { + writer->WriteArrayStart(TEXT("Catalog")); + for (const FCatalogItem& item : Catalog) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCatalogItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&CatalogArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Catalog")); + for (int32 Idx = 0; Idx < CatalogArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CatalogArray[Idx]; + Catalog.Add(FCatalogItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterDataRequest::~FGetCharacterDataRequest() +{ + +} + +void PlayFab::ServerModels::FGetCharacterDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (IfChangedFromDataVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("IfChangedFromDataVersion")); writer->WriteValue(static_cast(IfChangedFromDataVersion)); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr IfChangedFromDataVersionValue = obj->TryGetField(TEXT("IfChangedFromDataVersion")); + if (IfChangedFromDataVersionValue.IsValid() && !IfChangedFromDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (IfChangedFromDataVersionValue->TryGetNumber(TmpValue)) { IfChangedFromDataVersion = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeUserDataPermissionEnumJSON(UserDataPermission enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case UserDataPermissionPrivate: writer->WriteValue(TEXT("Private")); break; + case UserDataPermissionPublic: writer->WriteValue(TEXT("Public")); break; + } +} + +ServerModels::UserDataPermission PlayFab::ServerModels::readUserDataPermissionFromValue(const TSharedPtr& value) +{ + return readUserDataPermissionFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::UserDataPermission PlayFab::ServerModels::readUserDataPermissionFromValue(const FString& value) +{ + static TMap _UserDataPermissionMap; + if (_UserDataPermissionMap.Num() == 0) + { + // Auto-generate the map on the first use + _UserDataPermissionMap.Add(TEXT("Private"), UserDataPermissionPrivate); + _UserDataPermissionMap.Add(TEXT("Public"), UserDataPermissionPublic); + + } + + if (!value.IsEmpty()) + { + auto output = _UserDataPermissionMap.Find(value); + if (output != nullptr) + return *output; + } + + return UserDataPermissionPrivate; // Basically critical fail +} + +PlayFab::ServerModels::FUserDataRecord::~FUserDataRecord() +{ + +} + +void PlayFab::ServerModels::FUserDataRecord::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LastUpdated")); writeDatetime(LastUpdated, writer); + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUserDataRecord::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LastUpdatedValue = obj->TryGetField(TEXT("LastUpdated")); + if (LastUpdatedValue.IsValid()) + LastUpdated = readDatetime(LastUpdatedValue); + + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterDataResult::~FGetCharacterDataResult() +{ + +} + +void PlayFab::ServerModels::FGetCharacterDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterInventoryRequest::~FGetCharacterInventoryRequest() +{ + +} + +void PlayFab::ServerModels::FGetCharacterInventoryRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterInventoryRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FVirtualCurrencyRechargeTime::~FVirtualCurrencyRechargeTime() +{ + +} + +void PlayFab::ServerModels::FVirtualCurrencyRechargeTime::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("RechargeMax")); writer->WriteValue(RechargeMax); + + writer->WriteIdentifierPrefix(TEXT("RechargeTime")); writeDatetime(RechargeTime, writer); + + writer->WriteIdentifierPrefix(TEXT("SecondsToRecharge")); writer->WriteValue(SecondsToRecharge); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FVirtualCurrencyRechargeTime::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr RechargeMaxValue = obj->TryGetField(TEXT("RechargeMax")); + if (RechargeMaxValue.IsValid() && !RechargeMaxValue->IsNull()) + { + int32 TmpValue; + if (RechargeMaxValue->TryGetNumber(TmpValue)) { RechargeMax = TmpValue; } + } + + const TSharedPtr RechargeTimeValue = obj->TryGetField(TEXT("RechargeTime")); + if (RechargeTimeValue.IsValid()) + RechargeTime = readDatetime(RechargeTimeValue); + + + const TSharedPtr SecondsToRechargeValue = obj->TryGetField(TEXT("SecondsToRecharge")); + if (SecondsToRechargeValue.IsValid() && !SecondsToRechargeValue->IsNull()) + { + int32 TmpValue; + if (SecondsToRechargeValue->TryGetNumber(TmpValue)) { SecondsToRecharge = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterInventoryResult::~FGetCharacterInventoryResult() +{ + +} + +void PlayFab::ServerModels::FGetCharacterInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(VirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyRechargeTimes"), VirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + VirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterLeaderboardRequest::~FGetCharacterLeaderboardRequest() +{ + +} + +void PlayFab::ServerModels::FGetCharacterLeaderboardRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + writer->WriteIdentifierPrefix(TEXT("StartPosition")); writer->WriteValue(StartPosition); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterLeaderboardRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr StartPositionValue = obj->TryGetField(TEXT("StartPosition")); + if (StartPositionValue.IsValid() && !StartPositionValue->IsNull()) + { + int32 TmpValue; + if (StartPositionValue->TryGetNumber(TmpValue)) { StartPosition = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterLeaderboardResult::~FGetCharacterLeaderboardResult() +{ + +} + +void PlayFab::ServerModels::FGetCharacterLeaderboardResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FCharacterLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterLeaderboardResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FCharacterLeaderboardEntry(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterStatisticsRequest::~FGetCharacterStatisticsRequest() +{ + +} + +void PlayFab::ServerModels::FGetCharacterStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetCharacterStatisticsResult::~FGetCharacterStatisticsResult() +{ + +} + +void PlayFab::ServerModels::FGetCharacterStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CharacterStatistics.Num() != 0) + { + writer->WriteObjectStart(TEXT("CharacterStatistics")); + for (TMap::TConstIterator It(CharacterStatistics); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetCharacterStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* CharacterStatisticsObject; + if (obj->TryGetObjectField(TEXT("CharacterStatistics"), CharacterStatisticsObject)) + { + for (TMap>::TConstIterator It((*CharacterStatisticsObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + CharacterStatistics.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetContentDownloadUrlRequest::~FGetContentDownloadUrlRequest() +{ + +} + +void PlayFab::ServerModels::FGetContentDownloadUrlRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (HttpMethod.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("HttpMethod")); writer->WriteValue(HttpMethod); } + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + if (ThruCDN.notNull()) { writer->WriteIdentifierPrefix(TEXT("ThruCDN")); writer->WriteValue(ThruCDN); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetContentDownloadUrlRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr HttpMethodValue = obj->TryGetField(TEXT("HttpMethod")); + if (HttpMethodValue.IsValid() && !HttpMethodValue->IsNull()) + { + FString TmpValue; + if (HttpMethodValue->TryGetString(TmpValue)) { HttpMethod = TmpValue; } + } + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr ThruCDNValue = obj->TryGetField(TEXT("ThruCDN")); + if (ThruCDNValue.IsValid() && !ThruCDNValue->IsNull()) + { + bool TmpValue; + if (ThruCDNValue->TryGetBool(TmpValue)) { ThruCDN = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetContentDownloadUrlResult::~FGetContentDownloadUrlResult() +{ + +} + +void PlayFab::ServerModels::FGetContentDownloadUrlResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (URL.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("URL")); writer->WriteValue(URL); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetContentDownloadUrlResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr URLValue = obj->TryGetField(TEXT("URL")); + if (URLValue.IsValid() && !URLValue->IsNull()) + { + FString TmpValue; + if (URLValue->TryGetString(TmpValue)) { URL = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerProfileViewConstraints::~FPlayerProfileViewConstraints() +{ + +} + +void PlayFab::ServerModels::FPlayerProfileViewConstraints::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ShowAvatarUrl")); writer->WriteValue(ShowAvatarUrl); + + writer->WriteIdentifierPrefix(TEXT("ShowBannedUntil")); writer->WriteValue(ShowBannedUntil); + + writer->WriteIdentifierPrefix(TEXT("ShowCampaignAttributions")); writer->WriteValue(ShowCampaignAttributions); + + writer->WriteIdentifierPrefix(TEXT("ShowContactEmailAddresses")); writer->WriteValue(ShowContactEmailAddresses); + + writer->WriteIdentifierPrefix(TEXT("ShowCreated")); writer->WriteValue(ShowCreated); + + writer->WriteIdentifierPrefix(TEXT("ShowDisplayName")); writer->WriteValue(ShowDisplayName); + + writer->WriteIdentifierPrefix(TEXT("ShowLastLogin")); writer->WriteValue(ShowLastLogin); + + writer->WriteIdentifierPrefix(TEXT("ShowLinkedAccounts")); writer->WriteValue(ShowLinkedAccounts); + + writer->WriteIdentifierPrefix(TEXT("ShowLocations")); writer->WriteValue(ShowLocations); + + writer->WriteIdentifierPrefix(TEXT("ShowMemberships")); writer->WriteValue(ShowMemberships); + + writer->WriteIdentifierPrefix(TEXT("ShowOrigination")); writer->WriteValue(ShowOrigination); + + writer->WriteIdentifierPrefix(TEXT("ShowPushNotificationRegistrations")); writer->WriteValue(ShowPushNotificationRegistrations); + + writer->WriteIdentifierPrefix(TEXT("ShowStatistics")); writer->WriteValue(ShowStatistics); + + writer->WriteIdentifierPrefix(TEXT("ShowTags")); writer->WriteValue(ShowTags); + + writer->WriteIdentifierPrefix(TEXT("ShowTotalValueToDateInUsd")); writer->WriteValue(ShowTotalValueToDateInUsd); + + writer->WriteIdentifierPrefix(TEXT("ShowValuesToDate")); writer->WriteValue(ShowValuesToDate); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerProfileViewConstraints::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ShowAvatarUrlValue = obj->TryGetField(TEXT("ShowAvatarUrl")); + if (ShowAvatarUrlValue.IsValid() && !ShowAvatarUrlValue->IsNull()) + { + bool TmpValue; + if (ShowAvatarUrlValue->TryGetBool(TmpValue)) { ShowAvatarUrl = TmpValue; } + } + + const TSharedPtr ShowBannedUntilValue = obj->TryGetField(TEXT("ShowBannedUntil")); + if (ShowBannedUntilValue.IsValid() && !ShowBannedUntilValue->IsNull()) + { + bool TmpValue; + if (ShowBannedUntilValue->TryGetBool(TmpValue)) { ShowBannedUntil = TmpValue; } + } + + const TSharedPtr ShowCampaignAttributionsValue = obj->TryGetField(TEXT("ShowCampaignAttributions")); + if (ShowCampaignAttributionsValue.IsValid() && !ShowCampaignAttributionsValue->IsNull()) + { + bool TmpValue; + if (ShowCampaignAttributionsValue->TryGetBool(TmpValue)) { ShowCampaignAttributions = TmpValue; } + } + + const TSharedPtr ShowContactEmailAddressesValue = obj->TryGetField(TEXT("ShowContactEmailAddresses")); + if (ShowContactEmailAddressesValue.IsValid() && !ShowContactEmailAddressesValue->IsNull()) + { + bool TmpValue; + if (ShowContactEmailAddressesValue->TryGetBool(TmpValue)) { ShowContactEmailAddresses = TmpValue; } + } + + const TSharedPtr ShowCreatedValue = obj->TryGetField(TEXT("ShowCreated")); + if (ShowCreatedValue.IsValid() && !ShowCreatedValue->IsNull()) + { + bool TmpValue; + if (ShowCreatedValue->TryGetBool(TmpValue)) { ShowCreated = TmpValue; } + } + + const TSharedPtr ShowDisplayNameValue = obj->TryGetField(TEXT("ShowDisplayName")); + if (ShowDisplayNameValue.IsValid() && !ShowDisplayNameValue->IsNull()) + { + bool TmpValue; + if (ShowDisplayNameValue->TryGetBool(TmpValue)) { ShowDisplayName = TmpValue; } + } + + const TSharedPtr ShowLastLoginValue = obj->TryGetField(TEXT("ShowLastLogin")); + if (ShowLastLoginValue.IsValid() && !ShowLastLoginValue->IsNull()) + { + bool TmpValue; + if (ShowLastLoginValue->TryGetBool(TmpValue)) { ShowLastLogin = TmpValue; } + } + + const TSharedPtr ShowLinkedAccountsValue = obj->TryGetField(TEXT("ShowLinkedAccounts")); + if (ShowLinkedAccountsValue.IsValid() && !ShowLinkedAccountsValue->IsNull()) + { + bool TmpValue; + if (ShowLinkedAccountsValue->TryGetBool(TmpValue)) { ShowLinkedAccounts = TmpValue; } + } + + const TSharedPtr ShowLocationsValue = obj->TryGetField(TEXT("ShowLocations")); + if (ShowLocationsValue.IsValid() && !ShowLocationsValue->IsNull()) + { + bool TmpValue; + if (ShowLocationsValue->TryGetBool(TmpValue)) { ShowLocations = TmpValue; } + } + + const TSharedPtr ShowMembershipsValue = obj->TryGetField(TEXT("ShowMemberships")); + if (ShowMembershipsValue.IsValid() && !ShowMembershipsValue->IsNull()) + { + bool TmpValue; + if (ShowMembershipsValue->TryGetBool(TmpValue)) { ShowMemberships = TmpValue; } + } + + const TSharedPtr ShowOriginationValue = obj->TryGetField(TEXT("ShowOrigination")); + if (ShowOriginationValue.IsValid() && !ShowOriginationValue->IsNull()) + { + bool TmpValue; + if (ShowOriginationValue->TryGetBool(TmpValue)) { ShowOrigination = TmpValue; } + } + + const TSharedPtr ShowPushNotificationRegistrationsValue = obj->TryGetField(TEXT("ShowPushNotificationRegistrations")); + if (ShowPushNotificationRegistrationsValue.IsValid() && !ShowPushNotificationRegistrationsValue->IsNull()) + { + bool TmpValue; + if (ShowPushNotificationRegistrationsValue->TryGetBool(TmpValue)) { ShowPushNotificationRegistrations = TmpValue; } + } + + const TSharedPtr ShowStatisticsValue = obj->TryGetField(TEXT("ShowStatistics")); + if (ShowStatisticsValue.IsValid() && !ShowStatisticsValue->IsNull()) + { + bool TmpValue; + if (ShowStatisticsValue->TryGetBool(TmpValue)) { ShowStatistics = TmpValue; } + } + + const TSharedPtr ShowTagsValue = obj->TryGetField(TEXT("ShowTags")); + if (ShowTagsValue.IsValid() && !ShowTagsValue->IsNull()) + { + bool TmpValue; + if (ShowTagsValue->TryGetBool(TmpValue)) { ShowTags = TmpValue; } + } + + const TSharedPtr ShowTotalValueToDateInUsdValue = obj->TryGetField(TEXT("ShowTotalValueToDateInUsd")); + if (ShowTotalValueToDateInUsdValue.IsValid() && !ShowTotalValueToDateInUsdValue->IsNull()) + { + bool TmpValue; + if (ShowTotalValueToDateInUsdValue->TryGetBool(TmpValue)) { ShowTotalValueToDateInUsd = TmpValue; } + } + + const TSharedPtr ShowValuesToDateValue = obj->TryGetField(TEXT("ShowValuesToDate")); + if (ShowValuesToDateValue.IsValid() && !ShowValuesToDateValue->IsNull()) + { + bool TmpValue; + if (ShowValuesToDateValue->TryGetBool(TmpValue)) { ShowValuesToDate = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetFriendLeaderboardRequest::~FGetFriendLeaderboardRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ServerModels::FGetFriendLeaderboardRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IncludeFacebookFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeFacebookFriends")); writer->WriteValue(IncludeFacebookFriends); } + + if (IncludeSteamFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeSteamFriends")); writer->WriteValue(IncludeSteamFriends); } + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StartPosition")); writer->WriteValue(StartPosition); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + if (XboxToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetFriendLeaderboardRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IncludeFacebookFriendsValue = obj->TryGetField(TEXT("IncludeFacebookFriends")); + if (IncludeFacebookFriendsValue.IsValid() && !IncludeFacebookFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeFacebookFriendsValue->TryGetBool(TmpValue)) { IncludeFacebookFriends = TmpValue; } + } + + const TSharedPtr IncludeSteamFriendsValue = obj->TryGetField(TEXT("IncludeSteamFriends")); + if (IncludeSteamFriendsValue.IsValid() && !IncludeSteamFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeSteamFriendsValue->TryGetBool(TmpValue)) { IncludeSteamFriends = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StartPositionValue = obj->TryGetField(TEXT("StartPosition")); + if (StartPositionValue.IsValid() && !StartPositionValue->IsNull()) + { + int32 TmpValue; + if (StartPositionValue->TryGetNumber(TmpValue)) { StartPosition = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetFriendsListRequest::~FGetFriendsListRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ServerModels::FGetFriendsListRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IncludeFacebookFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeFacebookFriends")); writer->WriteValue(IncludeFacebookFriends); } + + if (IncludeSteamFriends.notNull()) { writer->WriteIdentifierPrefix(TEXT("IncludeSteamFriends")); writer->WriteValue(IncludeSteamFriends); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + if (XboxToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("XboxToken")); writer->WriteValue(XboxToken); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetFriendsListRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IncludeFacebookFriendsValue = obj->TryGetField(TEXT("IncludeFacebookFriends")); + if (IncludeFacebookFriendsValue.IsValid() && !IncludeFacebookFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeFacebookFriendsValue->TryGetBool(TmpValue)) { IncludeFacebookFriends = TmpValue; } + } + + const TSharedPtr IncludeSteamFriendsValue = obj->TryGetField(TEXT("IncludeSteamFriends")); + if (IncludeSteamFriendsValue.IsValid() && !IncludeSteamFriendsValue->IsNull()) + { + bool TmpValue; + if (IncludeSteamFriendsValue->TryGetBool(TmpValue)) { IncludeSteamFriends = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr XboxTokenValue = obj->TryGetField(TEXT("XboxToken")); + if (XboxTokenValue.IsValid() && !XboxTokenValue->IsNull()) + { + FString TmpValue; + if (XboxTokenValue->TryGetString(TmpValue)) { XboxToken = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetFriendsListResult::~FGetFriendsListResult() +{ + +} + +void PlayFab::ServerModels::FGetFriendsListResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Friends.Num() != 0) + { + writer->WriteArrayStart(TEXT("Friends")); + for (const FFriendInfo& item : Friends) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetFriendsListResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&FriendsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Friends")); + for (int32 Idx = 0; Idx < FriendsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = FriendsArray[Idx]; + Friends.Add(FFriendInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardAroundCharacterRequest::~FGetLeaderboardAroundCharacterRequest() +{ + +} + +void PlayFab::ServerModels::FGetLeaderboardAroundCharacterRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (CharacterType.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); } + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardAroundCharacterRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardAroundCharacterResult::~FGetLeaderboardAroundCharacterResult() +{ + +} + +void PlayFab::ServerModels::FGetLeaderboardAroundCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FCharacterLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardAroundCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FCharacterLeaderboardEntry(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardAroundUserRequest::~FGetLeaderboardAroundUserRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ServerModels::FGetLeaderboardAroundUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardAroundUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerLeaderboardEntry::~FPlayerLeaderboardEntry() +{ + //if (Profile != nullptr) delete Profile; + +} + +void PlayFab::ServerModels::FPlayerLeaderboardEntry::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteIdentifierPrefix(TEXT("Position")); writer->WriteValue(Position); + + if (Profile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Profile")); Profile->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StatValue")); writer->WriteValue(StatValue); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerLeaderboardEntry::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PositionValue = obj->TryGetField(TEXT("Position")); + if (PositionValue.IsValid() && !PositionValue->IsNull()) + { + int32 TmpValue; + if (PositionValue->TryGetNumber(TmpValue)) { Position = TmpValue; } + } + + const TSharedPtr ProfileValue = obj->TryGetField(TEXT("Profile")); + if (ProfileValue.IsValid() && !ProfileValue->IsNull()) + { + Profile = MakeShareable(new FPlayerProfileModel(ProfileValue->AsObject())); + } + + const TSharedPtr StatValueValue = obj->TryGetField(TEXT("StatValue")); + if (StatValueValue.IsValid() && !StatValueValue->IsNull()) + { + int32 TmpValue; + if (StatValueValue->TryGetNumber(TmpValue)) { StatValue = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardAroundUserResult::~FGetLeaderboardAroundUserResult() +{ + +} + +void PlayFab::ServerModels::FGetLeaderboardAroundUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FPlayerLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (NextReset.notNull()) { writer->WriteIdentifierPrefix(TEXT("NextReset")); writeDatetime(NextReset, writer); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardAroundUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FPlayerLeaderboardEntry(CurrentItem->AsObject())); + } + + + const TSharedPtr NextResetValue = obj->TryGetField(TEXT("NextReset")); + if (NextResetValue.IsValid()) + NextReset = readDatetime(NextResetValue); + + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardForUsersCharactersRequest::~FGetLeaderboardForUsersCharactersRequest() +{ + +} + +void PlayFab::ServerModels::FGetLeaderboardForUsersCharactersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardForUsersCharactersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardForUsersCharactersResult::~FGetLeaderboardForUsersCharactersResult() +{ + +} + +void PlayFab::ServerModels::FGetLeaderboardForUsersCharactersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FCharacterLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardForUsersCharactersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FCharacterLeaderboardEntry(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardRequest::~FGetLeaderboardRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ServerModels::FGetLeaderboardRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("MaxResultsCount")); writer->WriteValue(MaxResultsCount); + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("StartPosition")); writer->WriteValue(StartPosition); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + if (UseSpecificVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("UseSpecificVersion")); writer->WriteValue(UseSpecificVersion); } + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr MaxResultsCountValue = obj->TryGetField(TEXT("MaxResultsCount")); + if (MaxResultsCountValue.IsValid() && !MaxResultsCountValue->IsNull()) + { + int32 TmpValue; + if (MaxResultsCountValue->TryGetNumber(TmpValue)) { MaxResultsCount = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + const TSharedPtr StartPositionValue = obj->TryGetField(TEXT("StartPosition")); + if (StartPositionValue.IsValid() && !StartPositionValue->IsNull()) + { + int32 TmpValue; + if (StartPositionValue->TryGetNumber(TmpValue)) { StartPosition = TmpValue; } + } + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr UseSpecificVersionValue = obj->TryGetField(TEXT("UseSpecificVersion")); + if (UseSpecificVersionValue.IsValid() && !UseSpecificVersionValue->IsNull()) + { + bool TmpValue; + if (UseSpecificVersionValue->TryGetBool(TmpValue)) { UseSpecificVersion = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetLeaderboardResult::~FGetLeaderboardResult() +{ + +} + +void PlayFab::ServerModels::FGetLeaderboardResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Leaderboard.Num() != 0) + { + writer->WriteArrayStart(TEXT("Leaderboard")); + for (const FPlayerLeaderboardEntry& item : Leaderboard) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (NextReset.notNull()) { writer->WriteIdentifierPrefix(TEXT("NextReset")); writeDatetime(NextReset, writer); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(Version); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetLeaderboardResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&LeaderboardArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Leaderboard")); + for (int32 Idx = 0; Idx < LeaderboardArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LeaderboardArray[Idx]; + Leaderboard.Add(FPlayerLeaderboardEntry(CurrentItem->AsObject())); + } + + + const TSharedPtr NextResetValue = obj->TryGetField(TEXT("NextReset")); + if (NextResetValue.IsValid()) + NextReset = readDatetime(NextResetValue); + + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + int32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerCombinedInfoRequestParams::~FGetPlayerCombinedInfoRequestParams() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ServerModels::FGetPlayerCombinedInfoRequestParams::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GetCharacterInventories")); writer->WriteValue(GetCharacterInventories); + + writer->WriteIdentifierPrefix(TEXT("GetCharacterList")); writer->WriteValue(GetCharacterList); + + writer->WriteIdentifierPrefix(TEXT("GetPlayerProfile")); writer->WriteValue(GetPlayerProfile); + + writer->WriteIdentifierPrefix(TEXT("GetPlayerStatistics")); writer->WriteValue(GetPlayerStatistics); + + writer->WriteIdentifierPrefix(TEXT("GetTitleData")); writer->WriteValue(GetTitleData); + + writer->WriteIdentifierPrefix(TEXT("GetUserAccountInfo")); writer->WriteValue(GetUserAccountInfo); + + writer->WriteIdentifierPrefix(TEXT("GetUserData")); writer->WriteValue(GetUserData); + + writer->WriteIdentifierPrefix(TEXT("GetUserInventory")); writer->WriteValue(GetUserInventory); + + writer->WriteIdentifierPrefix(TEXT("GetUserReadOnlyData")); writer->WriteValue(GetUserReadOnlyData); + + writer->WriteIdentifierPrefix(TEXT("GetUserVirtualCurrency")); writer->WriteValue(GetUserVirtualCurrency); + + if (PlayerStatisticNames.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerStatisticNames")); + for (const FString& item : PlayerStatisticNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + if (TitleDataKeys.Num() != 0) + { + writer->WriteArrayStart(TEXT("TitleDataKeys")); + for (const FString& item : TitleDataKeys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (UserDataKeys.Num() != 0) + { + writer->WriteArrayStart(TEXT("UserDataKeys")); + for (const FString& item : UserDataKeys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (UserReadOnlyDataKeys.Num() != 0) + { + writer->WriteArrayStart(TEXT("UserReadOnlyDataKeys")); + for (const FString& item : UserReadOnlyDataKeys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerCombinedInfoRequestParams::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GetCharacterInventoriesValue = obj->TryGetField(TEXT("GetCharacterInventories")); + if (GetCharacterInventoriesValue.IsValid() && !GetCharacterInventoriesValue->IsNull()) + { + bool TmpValue; + if (GetCharacterInventoriesValue->TryGetBool(TmpValue)) { GetCharacterInventories = TmpValue; } + } + + const TSharedPtr GetCharacterListValue = obj->TryGetField(TEXT("GetCharacterList")); + if (GetCharacterListValue.IsValid() && !GetCharacterListValue->IsNull()) + { + bool TmpValue; + if (GetCharacterListValue->TryGetBool(TmpValue)) { GetCharacterList = TmpValue; } + } + + const TSharedPtr GetPlayerProfileValue = obj->TryGetField(TEXT("GetPlayerProfile")); + if (GetPlayerProfileValue.IsValid() && !GetPlayerProfileValue->IsNull()) + { + bool TmpValue; + if (GetPlayerProfileValue->TryGetBool(TmpValue)) { GetPlayerProfile = TmpValue; } + } + + const TSharedPtr GetPlayerStatisticsValue = obj->TryGetField(TEXT("GetPlayerStatistics")); + if (GetPlayerStatisticsValue.IsValid() && !GetPlayerStatisticsValue->IsNull()) + { + bool TmpValue; + if (GetPlayerStatisticsValue->TryGetBool(TmpValue)) { GetPlayerStatistics = TmpValue; } + } + + const TSharedPtr GetTitleDataValue = obj->TryGetField(TEXT("GetTitleData")); + if (GetTitleDataValue.IsValid() && !GetTitleDataValue->IsNull()) + { + bool TmpValue; + if (GetTitleDataValue->TryGetBool(TmpValue)) { GetTitleData = TmpValue; } + } + + const TSharedPtr GetUserAccountInfoValue = obj->TryGetField(TEXT("GetUserAccountInfo")); + if (GetUserAccountInfoValue.IsValid() && !GetUserAccountInfoValue->IsNull()) + { + bool TmpValue; + if (GetUserAccountInfoValue->TryGetBool(TmpValue)) { GetUserAccountInfo = TmpValue; } + } + + const TSharedPtr GetUserDataValue = obj->TryGetField(TEXT("GetUserData")); + if (GetUserDataValue.IsValid() && !GetUserDataValue->IsNull()) + { + bool TmpValue; + if (GetUserDataValue->TryGetBool(TmpValue)) { GetUserData = TmpValue; } + } + + const TSharedPtr GetUserInventoryValue = obj->TryGetField(TEXT("GetUserInventory")); + if (GetUserInventoryValue.IsValid() && !GetUserInventoryValue->IsNull()) + { + bool TmpValue; + if (GetUserInventoryValue->TryGetBool(TmpValue)) { GetUserInventory = TmpValue; } + } + + const TSharedPtr GetUserReadOnlyDataValue = obj->TryGetField(TEXT("GetUserReadOnlyData")); + if (GetUserReadOnlyDataValue.IsValid() && !GetUserReadOnlyDataValue->IsNull()) + { + bool TmpValue; + if (GetUserReadOnlyDataValue->TryGetBool(TmpValue)) { GetUserReadOnlyData = TmpValue; } + } + + const TSharedPtr GetUserVirtualCurrencyValue = obj->TryGetField(TEXT("GetUserVirtualCurrency")); + if (GetUserVirtualCurrencyValue.IsValid() && !GetUserVirtualCurrencyValue->IsNull()) + { + bool TmpValue; + if (GetUserVirtualCurrencyValue->TryGetBool(TmpValue)) { GetUserVirtualCurrency = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("PlayerStatisticNames"), PlayerStatisticNames); + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + obj->TryGetStringArrayField(TEXT("TitleDataKeys"), TitleDataKeys); + + obj->TryGetStringArrayField(TEXT("UserDataKeys"), UserDataKeys); + + obj->TryGetStringArrayField(TEXT("UserReadOnlyDataKeys"), UserReadOnlyDataKeys); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerCombinedInfoRequest::~FGetPlayerCombinedInfoRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayerCombinedInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("InfoRequestParameters")); InfoRequestParameters.writeJSON(writer); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerCombinedInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr InfoRequestParametersValue = obj->TryGetField(TEXT("InfoRequestParameters")); + if (InfoRequestParametersValue.IsValid() && !InfoRequestParametersValue->IsNull()) + { + InfoRequestParameters = FGetPlayerCombinedInfoRequestParams(InfoRequestParametersValue->AsObject()); + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FStatisticValue::~FStatisticValue() +{ + +} + +void PlayFab::ServerModels::FStatisticValue::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FStatisticValue::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerCombinedInfoResultPayload::~FGetPlayerCombinedInfoResultPayload() +{ + //if (AccountInfo != nullptr) delete AccountInfo; + //if (PlayerProfile != nullptr) delete PlayerProfile; + +} + +void PlayFab::ServerModels::FGetPlayerCombinedInfoResultPayload::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AccountInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("AccountInfo")); AccountInfo->writeJSON(writer); } + + if (CharacterInventories.Num() != 0) + { + writer->WriteArrayStart(TEXT("CharacterInventories")); + for (const FCharacterInventory& item : CharacterInventories) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (CharacterList.Num() != 0) + { + writer->WriteArrayStart(TEXT("CharacterList")); + for (const FCharacterResult& item : CharacterList) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayerProfile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PlayerProfile")); PlayerProfile->writeJSON(writer); } + + if (PlayerStatistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerStatistics")); + for (const FStatisticValue& item : PlayerStatistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (TitleData.Num() != 0) + { + writer->WriteObjectStart(TEXT("TitleData")); + for (TMap::TConstIterator It(TitleData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (UserData.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserData")); + for (TMap::TConstIterator It(UserData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("UserDataVersion")); writer->WriteValue(static_cast(UserDataVersion)); + + if (UserInventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("UserInventory")); + for (const FItemInstance& item : UserInventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (UserReadOnlyData.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserReadOnlyData")); + for (TMap::TConstIterator It(UserReadOnlyData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("UserReadOnlyDataVersion")); writer->WriteValue(static_cast(UserReadOnlyDataVersion)); + + if (UserVirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserVirtualCurrency")); + for (TMap::TConstIterator It(UserVirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (UserVirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("UserVirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(UserVirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerCombinedInfoResultPayload::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AccountInfoValue = obj->TryGetField(TEXT("AccountInfo")); + if (AccountInfoValue.IsValid() && !AccountInfoValue->IsNull()) + { + AccountInfo = MakeShareable(new FUserAccountInfo(AccountInfoValue->AsObject())); + } + + const TArray>&CharacterInventoriesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("CharacterInventories")); + for (int32 Idx = 0; Idx < CharacterInventoriesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CharacterInventoriesArray[Idx]; + CharacterInventories.Add(FCharacterInventory(CurrentItem->AsObject())); + } + + + const TArray>&CharacterListArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("CharacterList")); + for (int32 Idx = 0; Idx < CharacterListArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CharacterListArray[Idx]; + CharacterList.Add(FCharacterResult(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayerProfileValue = obj->TryGetField(TEXT("PlayerProfile")); + if (PlayerProfileValue.IsValid() && !PlayerProfileValue->IsNull()) + { + PlayerProfile = MakeShareable(new FPlayerProfileModel(PlayerProfileValue->AsObject())); + } + + const TArray>&PlayerStatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PlayerStatistics")); + for (int32 Idx = 0; Idx < PlayerStatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PlayerStatisticsArray[Idx]; + PlayerStatistics.Add(FStatisticValue(CurrentItem->AsObject())); + } + + + const TSharedPtr* TitleDataObject; + if (obj->TryGetObjectField(TEXT("TitleData"), TitleDataObject)) + { + for (TMap>::TConstIterator It((*TitleDataObject)->Values); It; ++It) + { + TitleData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr* UserDataObject; + if (obj->TryGetObjectField(TEXT("UserData"), UserDataObject)) + { + for (TMap>::TConstIterator It((*UserDataObject)->Values); It; ++It) + { + UserData.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr UserDataVersionValue = obj->TryGetField(TEXT("UserDataVersion")); + if (UserDataVersionValue.IsValid() && !UserDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (UserDataVersionValue->TryGetNumber(TmpValue)) { UserDataVersion = TmpValue; } + } + + const TArray>&UserInventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("UserInventory")); + for (int32 Idx = 0; Idx < UserInventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = UserInventoryArray[Idx]; + UserInventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr* UserReadOnlyDataObject; + if (obj->TryGetObjectField(TEXT("UserReadOnlyData"), UserReadOnlyDataObject)) + { + for (TMap>::TConstIterator It((*UserReadOnlyDataObject)->Values); It; ++It) + { + UserReadOnlyData.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr UserReadOnlyDataVersionValue = obj->TryGetField(TEXT("UserReadOnlyDataVersion")); + if (UserReadOnlyDataVersionValue.IsValid() && !UserReadOnlyDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (UserReadOnlyDataVersionValue->TryGetNumber(TmpValue)) { UserReadOnlyDataVersion = TmpValue; } + } + + const TSharedPtr* UserVirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("UserVirtualCurrency"), UserVirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*UserVirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + UserVirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* UserVirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("UserVirtualCurrencyRechargeTimes"), UserVirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*UserVirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + UserVirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerCombinedInfoResult::~FGetPlayerCombinedInfoResult() +{ + //if (InfoResultPayload != nullptr) delete InfoResultPayload; + +} + +void PlayFab::ServerModels::FGetPlayerCombinedInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (InfoResultPayload.IsValid()) { writer->WriteIdentifierPrefix(TEXT("InfoResultPayload")); InfoResultPayload->writeJSON(writer); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerCombinedInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr InfoResultPayloadValue = obj->TryGetField(TEXT("InfoResultPayload")); + if (InfoResultPayloadValue.IsValid() && !InfoResultPayloadValue->IsNull()) + { + InfoResultPayload = MakeShareable(new FGetPlayerCombinedInfoResultPayload(InfoResultPayloadValue->AsObject())); + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerProfileRequest::~FGetPlayerProfileRequest() +{ + //if (ProfileConstraints != nullptr) delete ProfileConstraints; + +} + +void PlayFab::ServerModels::FGetPlayerProfileRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (ProfileConstraints.IsValid()) { writer->WriteIdentifierPrefix(TEXT("ProfileConstraints")); ProfileConstraints->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerProfileRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ProfileConstraintsValue = obj->TryGetField(TEXT("ProfileConstraints")); + if (ProfileConstraintsValue.IsValid() && !ProfileConstraintsValue->IsNull()) + { + ProfileConstraints = MakeShareable(new FPlayerProfileViewConstraints(ProfileConstraintsValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerProfileResult::~FGetPlayerProfileResult() +{ + //if (PlayerProfile != nullptr) delete PlayerProfile; + +} + +void PlayFab::ServerModels::FGetPlayerProfileResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayerProfile.IsValid()) { writer->WriteIdentifierPrefix(TEXT("PlayerProfile")); PlayerProfile->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerProfileResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayerProfileValue = obj->TryGetField(TEXT("PlayerProfile")); + if (PlayerProfileValue.IsValid() && !PlayerProfileValue->IsNull()) + { + PlayerProfile = MakeShareable(new FPlayerProfileModel(PlayerProfileValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerSegmentsResult::~FGetPlayerSegmentsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayerSegmentsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Segments.Num() != 0) + { + writer->WriteArrayStart(TEXT("Segments")); + for (const FGetSegmentResult& item : Segments) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerSegmentsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&SegmentsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Segments")); + for (int32 Idx = 0; Idx < SegmentsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = SegmentsArray[Idx]; + Segments.Add(FGetSegmentResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayersInSegmentRequest::~FGetPlayersInSegmentRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayersInSegmentRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ContinuationToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ContinuationToken")); writer->WriteValue(ContinuationToken); } + + if (MaxBatchSize.notNull()) { writer->WriteIdentifierPrefix(TEXT("MaxBatchSize")); writer->WriteValue(static_cast(MaxBatchSize)); } + + if (SecondsToLive.notNull()) { writer->WriteIdentifierPrefix(TEXT("SecondsToLive")); writer->WriteValue(static_cast(SecondsToLive)); } + + writer->WriteIdentifierPrefix(TEXT("SegmentId")); writer->WriteValue(SegmentId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayersInSegmentRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ContinuationTokenValue = obj->TryGetField(TEXT("ContinuationToken")); + if (ContinuationTokenValue.IsValid() && !ContinuationTokenValue->IsNull()) + { + FString TmpValue; + if (ContinuationTokenValue->TryGetString(TmpValue)) { ContinuationToken = TmpValue; } + } + + const TSharedPtr MaxBatchSizeValue = obj->TryGetField(TEXT("MaxBatchSize")); + if (MaxBatchSizeValue.IsValid() && !MaxBatchSizeValue->IsNull()) + { + uint32 TmpValue; + if (MaxBatchSizeValue->TryGetNumber(TmpValue)) { MaxBatchSize = TmpValue; } + } + + const TSharedPtr SecondsToLiveValue = obj->TryGetField(TEXT("SecondsToLive")); + if (SecondsToLiveValue.IsValid() && !SecondsToLiveValue->IsNull()) + { + uint32 TmpValue; + if (SecondsToLiveValue->TryGetNumber(TmpValue)) { SecondsToLive = TmpValue; } + } + + const TSharedPtr SegmentIdValue = obj->TryGetField(TEXT("SegmentId")); + if (SegmentIdValue.IsValid() && !SegmentIdValue->IsNull()) + { + FString TmpValue; + if (SegmentIdValue->TryGetString(TmpValue)) { SegmentId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerLinkedAccount::~FPlayerLinkedAccount() +{ + +} + +void PlayFab::ServerModels::FPlayerLinkedAccount::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writeLoginIdentityProviderEnumJSON(Platform, writer); } + + if (PlatformUserId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlatformUserId")); writer->WriteValue(PlatformUserId); } + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerLinkedAccount::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + Platform = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Platform"))); + + const TSharedPtr PlatformUserIdValue = obj->TryGetField(TEXT("PlatformUserId")); + if (PlatformUserIdValue.IsValid() && !PlatformUserIdValue->IsNull()) + { + FString TmpValue; + if (PlatformUserIdValue->TryGetString(TmpValue)) { PlatformUserId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerLocation::~FPlayerLocation() +{ + +} + +void PlayFab::ServerModels::FPlayerLocation::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (City.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("City")); writer->WriteValue(City); } + + writer->WriteIdentifierPrefix(TEXT("ContinentCode")); writeContinentCodeEnumJSON(pfContinentCode, writer); + + writer->WriteIdentifierPrefix(TEXT("CountryCode")); writeCountryCodeEnumJSON(pfCountryCode, writer); + + if (Latitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Latitude")); writer->WriteValue(Latitude); } + + if (Longitude.notNull()) { writer->WriteIdentifierPrefix(TEXT("Longitude")); writer->WriteValue(Longitude); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerLocation::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CityValue = obj->TryGetField(TEXT("City")); + if (CityValue.IsValid() && !CityValue->IsNull()) + { + FString TmpValue; + if (CityValue->TryGetString(TmpValue)) { City = TmpValue; } + } + + pfContinentCode = readContinentCodeFromValue(obj->TryGetField(TEXT("ContinentCode"))); + + pfCountryCode = readCountryCodeFromValue(obj->TryGetField(TEXT("CountryCode"))); + + const TSharedPtr LatitudeValue = obj->TryGetField(TEXT("Latitude")); + if (LatitudeValue.IsValid() && !LatitudeValue->IsNull()) + { + double TmpValue; + if (LatitudeValue->TryGetNumber(TmpValue)) { Latitude = TmpValue; } + } + + const TSharedPtr LongitudeValue = obj->TryGetField(TEXT("Longitude")); + if (LongitudeValue.IsValid() && !LongitudeValue->IsNull()) + { + double TmpValue; + if (LongitudeValue->TryGetNumber(TmpValue)) { Longitude = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerStatistic::~FPlayerStatistic() +{ + +} + +void PlayFab::ServerModels::FPlayerStatistic::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Id.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Id")); writer->WriteValue(Id); } + + if (Name.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Name")); writer->WriteValue(Name); } + + writer->WriteIdentifierPrefix(TEXT("StatisticValue")); writer->WriteValue(StatisticValue); + + writer->WriteIdentifierPrefix(TEXT("StatisticVersion")); writer->WriteValue(StatisticVersion); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerStatistic::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IdValue = obj->TryGetField(TEXT("Id")); + if (IdValue.IsValid() && !IdValue->IsNull()) + { + FString TmpValue; + if (IdValue->TryGetString(TmpValue)) { Id = TmpValue; } + } + + const TSharedPtr NameValue = obj->TryGetField(TEXT("Name")); + if (NameValue.IsValid() && !NameValue->IsNull()) + { + FString TmpValue; + if (NameValue->TryGetString(TmpValue)) { Name = TmpValue; } + } + + const TSharedPtr StatisticValueValue = obj->TryGetField(TEXT("StatisticValue")); + if (StatisticValueValue.IsValid() && !StatisticValueValue->IsNull()) + { + int32 TmpValue; + if (StatisticValueValue->TryGetNumber(TmpValue)) { StatisticValue = TmpValue; } + } + + const TSharedPtr StatisticVersionValue = obj->TryGetField(TEXT("StatisticVersion")); + if (StatisticVersionValue.IsValid() && !StatisticVersionValue->IsNull()) + { + int32 TmpValue; + if (StatisticVersionValue->TryGetNumber(TmpValue)) { StatisticVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPushNotificationRegistration::~FPushNotificationRegistration() +{ + +} + +void PlayFab::ServerModels::FPushNotificationRegistration::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NotificationEndpointARN.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NotificationEndpointARN")); writer->WriteValue(NotificationEndpointARN); } + + if (Platform.notNull()) { writer->WriteIdentifierPrefix(TEXT("Platform")); writePushNotificationPlatformEnumJSON(Platform, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPushNotificationRegistration::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NotificationEndpointARNValue = obj->TryGetField(TEXT("NotificationEndpointARN")); + if (NotificationEndpointARNValue.IsValid() && !NotificationEndpointARNValue->IsNull()) + { + FString TmpValue; + if (NotificationEndpointARNValue->TryGetString(TmpValue)) { NotificationEndpointARN = TmpValue; } + } + + Platform = readPushNotificationPlatformFromValue(obj->TryGetField(TEXT("Platform"))); + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerProfile::~FPlayerProfile() +{ + +} + +void PlayFab::ServerModels::FPlayerProfile::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdCampaignAttributions.Num() != 0) + { + writer->WriteArrayStart(TEXT("AdCampaignAttributions")); + for (const FAdCampaignAttribution& item : AdCampaignAttributions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (AvatarUrl.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("AvatarUrl")); writer->WriteValue(AvatarUrl); } + + if (BannedUntil.notNull()) { writer->WriteIdentifierPrefix(TEXT("BannedUntil")); writeDatetime(BannedUntil, writer); } + + if (ContactEmailAddresses.Num() != 0) + { + writer->WriteArrayStart(TEXT("ContactEmailAddresses")); + for (const FContactEmailInfo& item : ContactEmailAddresses) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Created.notNull()) { writer->WriteIdentifierPrefix(TEXT("Created")); writeDatetime(Created, writer); } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (LastLogin.notNull()) { writer->WriteIdentifierPrefix(TEXT("LastLogin")); writeDatetime(LastLogin, writer); } + + if (LinkedAccounts.Num() != 0) + { + writer->WriteArrayStart(TEXT("LinkedAccounts")); + for (const FPlayerLinkedAccount& item : LinkedAccounts) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Locations.Num() != 0) + { + writer->WriteObjectStart(TEXT("Locations")); + for (TMap::TConstIterator It(Locations); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + if (Origination.notNull()) { writer->WriteIdentifierPrefix(TEXT("Origination")); writeLoginIdentityProviderEnumJSON(Origination, writer); } + + if (PlayerId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayerId")); writer->WriteValue(PlayerId); } + + if (PlayerStatistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerStatistics")); + for (const FPlayerStatistic& item : PlayerStatistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PublisherId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PublisherId")); writer->WriteValue(PublisherId); } + + if (PushNotificationRegistrations.Num() != 0) + { + writer->WriteArrayStart(TEXT("PushNotificationRegistrations")); + for (const FPushNotificationRegistration& item : PushNotificationRegistrations) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Statistics.Num() != 0) + { + writer->WriteObjectStart(TEXT("Statistics")); + for (TMap::TConstIterator It(Statistics); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (Tags.Num() != 0) + { + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (TitleId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("TitleId")); writer->WriteValue(TitleId); } + + if (TotalValueToDateInUSD.notNull()) { writer->WriteIdentifierPrefix(TEXT("TotalValueToDateInUSD")); writer->WriteValue(static_cast(TotalValueToDateInUSD)); } + + if (ValuesToDate.Num() != 0) + { + writer->WriteObjectStart(TEXT("ValuesToDate")); + for (TMap::TConstIterator It(ValuesToDate); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyBalances.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyBalances")); + for (TMap::TConstIterator It(VirtualCurrencyBalances); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerProfile::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AdCampaignAttributionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AdCampaignAttributions")); + for (int32 Idx = 0; Idx < AdCampaignAttributionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AdCampaignAttributionsArray[Idx]; + AdCampaignAttributions.Add(FAdCampaignAttribution(CurrentItem->AsObject())); + } + + + const TSharedPtr AvatarUrlValue = obj->TryGetField(TEXT("AvatarUrl")); + if (AvatarUrlValue.IsValid() && !AvatarUrlValue->IsNull()) + { + FString TmpValue; + if (AvatarUrlValue->TryGetString(TmpValue)) { AvatarUrl = TmpValue; } + } + + const TSharedPtr BannedUntilValue = obj->TryGetField(TEXT("BannedUntil")); + if (BannedUntilValue.IsValid()) + BannedUntil = readDatetime(BannedUntilValue); + + + const TArray>&ContactEmailAddressesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ContactEmailAddresses")); + for (int32 Idx = 0; Idx < ContactEmailAddressesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ContactEmailAddressesArray[Idx]; + ContactEmailAddresses.Add(FContactEmailInfo(CurrentItem->AsObject())); + } + + + const TSharedPtr CreatedValue = obj->TryGetField(TEXT("Created")); + if (CreatedValue.IsValid()) + Created = readDatetime(CreatedValue); + + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr LastLoginValue = obj->TryGetField(TEXT("LastLogin")); + if (LastLoginValue.IsValid()) + LastLogin = readDatetime(LastLoginValue); + + + const TArray>&LinkedAccountsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("LinkedAccounts")); + for (int32 Idx = 0; Idx < LinkedAccountsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = LinkedAccountsArray[Idx]; + LinkedAccounts.Add(FPlayerLinkedAccount(CurrentItem->AsObject())); + } + + + const TSharedPtr* LocationsObject; + if (obj->TryGetObjectField(TEXT("Locations"), LocationsObject)) + { + for (TMap>::TConstIterator It((*LocationsObject)->Values); It; ++It) + { + Locations.Add(It.Key(), FPlayerLocation(It.Value()->AsObject())); + } + } + + Origination = readLoginIdentityProviderFromValue(obj->TryGetField(TEXT("Origination"))); + + const TSharedPtr PlayerIdValue = obj->TryGetField(TEXT("PlayerId")); + if (PlayerIdValue.IsValid() && !PlayerIdValue->IsNull()) + { + FString TmpValue; + if (PlayerIdValue->TryGetString(TmpValue)) { PlayerId = TmpValue; } + } + + const TArray>&PlayerStatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PlayerStatistics")); + for (int32 Idx = 0; Idx < PlayerStatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PlayerStatisticsArray[Idx]; + PlayerStatistics.Add(FPlayerStatistic(CurrentItem->AsObject())); + } + + + const TSharedPtr PublisherIdValue = obj->TryGetField(TEXT("PublisherId")); + if (PublisherIdValue.IsValid() && !PublisherIdValue->IsNull()) + { + FString TmpValue; + if (PublisherIdValue->TryGetString(TmpValue)) { PublisherId = TmpValue; } + } + + const TArray>&PushNotificationRegistrationsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PushNotificationRegistrations")); + for (int32 Idx = 0; Idx < PushNotificationRegistrationsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PushNotificationRegistrationsArray[Idx]; + PushNotificationRegistrations.Add(FPushNotificationRegistration(CurrentItem->AsObject())); + } + + + const TSharedPtr* StatisticsObject; + if (obj->TryGetObjectField(TEXT("Statistics"), StatisticsObject)) + { + for (TMap>::TConstIterator It((*StatisticsObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + Statistics.Add(It.Key(), TmpValue); + } + } + + obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + const TSharedPtr TitleIdValue = obj->TryGetField(TEXT("TitleId")); + if (TitleIdValue.IsValid() && !TitleIdValue->IsNull()) + { + FString TmpValue; + if (TitleIdValue->TryGetString(TmpValue)) { TitleId = TmpValue; } + } + + const TSharedPtr TotalValueToDateInUSDValue = obj->TryGetField(TEXT("TotalValueToDateInUSD")); + if (TotalValueToDateInUSDValue.IsValid() && !TotalValueToDateInUSDValue->IsNull()) + { + uint32 TmpValue; + if (TotalValueToDateInUSDValue->TryGetNumber(TmpValue)) { TotalValueToDateInUSD = TmpValue; } + } + + const TSharedPtr* ValuesToDateObject; + if (obj->TryGetObjectField(TEXT("ValuesToDate"), ValuesToDateObject)) + { + for (TMap>::TConstIterator It((*ValuesToDateObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + ValuesToDate.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyBalancesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyBalances"), VirtualCurrencyBalancesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyBalancesObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrencyBalances.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayersInSegmentResult::~FGetPlayersInSegmentResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayersInSegmentResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ContinuationToken.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ContinuationToken")); writer->WriteValue(ContinuationToken); } + + if (PlayerProfiles.Num() != 0) + { + writer->WriteArrayStart(TEXT("PlayerProfiles")); + for (const FPlayerProfile& item : PlayerProfiles) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("ProfilesInSegment")); writer->WriteValue(ProfilesInSegment); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayersInSegmentResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ContinuationTokenValue = obj->TryGetField(TEXT("ContinuationToken")); + if (ContinuationTokenValue.IsValid() && !ContinuationTokenValue->IsNull()) + { + FString TmpValue; + if (ContinuationTokenValue->TryGetString(TmpValue)) { ContinuationToken = TmpValue; } + } + + const TArray>&PlayerProfilesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("PlayerProfiles")); + for (int32 Idx = 0; Idx < PlayerProfilesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = PlayerProfilesArray[Idx]; + PlayerProfiles.Add(FPlayerProfile(CurrentItem->AsObject())); + } + + + const TSharedPtr ProfilesInSegmentValue = obj->TryGetField(TEXT("ProfilesInSegment")); + if (ProfilesInSegmentValue.IsValid() && !ProfilesInSegmentValue->IsNull()) + { + int32 TmpValue; + if (ProfilesInSegmentValue->TryGetNumber(TmpValue)) { ProfilesInSegment = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayersSegmentsRequest::~FGetPlayersSegmentsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayersSegmentsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayersSegmentsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FStatisticNameVersion::~FStatisticNameVersion() +{ + +} + +void PlayFab::ServerModels::FStatisticNameVersion::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FStatisticNameVersion::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerStatisticsRequest::~FGetPlayerStatisticsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayerStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (StatisticNames.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticNames")); + for (const FString& item : StatisticNames) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (StatisticNameVersions.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticNameVersions")); + for (const FStatisticNameVersion& item : StatisticNameVersions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("StatisticNames"), StatisticNames); + + const TArray>&StatisticNameVersionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("StatisticNameVersions")); + for (int32 Idx = 0; Idx < StatisticNameVersionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticNameVersionsArray[Idx]; + StatisticNameVersions.Add(FStatisticNameVersion(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerStatisticsResult::~FGetPlayerStatisticsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayerStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (Statistics.Num() != 0) + { + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticValue& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticValue(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerStatisticVersionsRequest::~FGetPlayerStatisticVersionsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayerStatisticVersionsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerStatisticVersionsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FPlayerStatisticVersion::~FPlayerStatisticVersion() +{ + +} + +void PlayFab::ServerModels::FPlayerStatisticVersion::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ActivationTime")); writeDatetime(ActivationTime, writer); + + if (DeactivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("DeactivationTime")); writeDatetime(DeactivationTime, writer); } + + if (ScheduledActivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("ScheduledActivationTime")); writeDatetime(ScheduledActivationTime, writer); } + + if (ScheduledDeactivationTime.notNull()) { writer->WriteIdentifierPrefix(TEXT("ScheduledDeactivationTime")); writeDatetime(ScheduledDeactivationTime, writer); } + + if (StatisticName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); } + + writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPlayerStatisticVersion::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActivationTimeValue = obj->TryGetField(TEXT("ActivationTime")); + if (ActivationTimeValue.IsValid()) + ActivationTime = readDatetime(ActivationTimeValue); + + + const TSharedPtr DeactivationTimeValue = obj->TryGetField(TEXT("DeactivationTime")); + if (DeactivationTimeValue.IsValid()) + DeactivationTime = readDatetime(DeactivationTimeValue); + + + const TSharedPtr ScheduledActivationTimeValue = obj->TryGetField(TEXT("ScheduledActivationTime")); + if (ScheduledActivationTimeValue.IsValid()) + ScheduledActivationTime = readDatetime(ScheduledActivationTimeValue); + + + const TSharedPtr ScheduledDeactivationTimeValue = obj->TryGetField(TEXT("ScheduledDeactivationTime")); + if (ScheduledDeactivationTimeValue.IsValid()) + ScheduledDeactivationTime = readDatetime(ScheduledDeactivationTimeValue); + + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerStatisticVersionsResult::~FGetPlayerStatisticVersionsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayerStatisticVersionsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (StatisticVersions.Num() != 0) + { + writer->WriteArrayStart(TEXT("StatisticVersions")); + for (const FPlayerStatisticVersion& item : StatisticVersions) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerStatisticVersionsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&StatisticVersionsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("StatisticVersions")); + for (int32 Idx = 0; Idx < StatisticVersionsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticVersionsArray[Idx]; + StatisticVersions.Add(FPlayerStatisticVersion(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerTagsRequest::~FGetPlayerTagsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayerTagsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Namespace.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Namespace")); writer->WriteValue(Namespace); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerTagsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NamespaceValue = obj->TryGetField(TEXT("Namespace")); + if (NamespaceValue.IsValid() && !NamespaceValue->IsNull()) + { + FString TmpValue; + if (NamespaceValue->TryGetString(TmpValue)) { Namespace = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayerTagsResult::~FGetPlayerTagsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayerTagsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayerTagsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromFacebookIDsRequest::~FGetPlayFabIDsFromFacebookIDsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromFacebookIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("FacebookIDs")); + for (const FString& item : FacebookIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromFacebookIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FacebookIDs"), FacebookIDs); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromFacebookIDsResult::~FGetPlayFabIDsFromFacebookIDsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromFacebookIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FFacebookPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromFacebookIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FFacebookPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest::~FGetPlayFabIDsFromFacebookInstantGamesIdsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("FacebookInstantGamesIds")); + for (const FString& item : FacebookInstantGamesIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("FacebookInstantGamesIds"), FacebookInstantGamesIds); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult::~FGetPlayFabIDsFromFacebookInstantGamesIdsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FFacebookInstantGamesPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FFacebookInstantGamesPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest::~FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("NintendoSwitchDeviceIds")); + for (const FString& item : NintendoSwitchDeviceIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("NintendoSwitchDeviceIds"), NintendoSwitchDeviceIds); + + return HasSucceeded; +} + +PlayFab::ServerModels::FNintendoSwitchPlayFabIdPair::~FNintendoSwitchPlayFabIdPair() +{ + +} + +void PlayFab::ServerModels::FNintendoSwitchPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (NintendoSwitchDeviceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NintendoSwitchDeviceId")); writer->WriteValue(NintendoSwitchDeviceId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FNintendoSwitchPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr NintendoSwitchDeviceIdValue = obj->TryGetField(TEXT("NintendoSwitchDeviceId")); + if (NintendoSwitchDeviceIdValue.IsValid() && !NintendoSwitchDeviceIdValue->IsNull()) + { + FString TmpValue; + if (NintendoSwitchDeviceIdValue->TryGetString(TmpValue)) { NintendoSwitchDeviceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult::~FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FNintendoSwitchPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FNintendoSwitchPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromSteamIDsRequest::~FGetPlayFabIDsFromSteamIDsRequest() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromSteamIDsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (SteamStringIDs.Num() != 0) + { + writer->WriteArrayStart(TEXT("SteamStringIDs")); + for (const FString& item : SteamStringIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromSteamIDsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("SteamStringIDs"), SteamStringIDs); + + return HasSucceeded; +} + +PlayFab::ServerModels::FSteamPlayFabIdPair::~FSteamPlayFabIdPair() +{ + +} + +void PlayFab::ServerModels::FSteamPlayFabIdPair::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (SteamStringId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("SteamStringId")); writer->WriteValue(SteamStringId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSteamPlayFabIdPair::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr SteamStringIdValue = obj->TryGetField(TEXT("SteamStringId")); + if (SteamStringIdValue.IsValid() && !SteamStringIdValue->IsNull()) + { + FString TmpValue; + if (SteamStringIdValue->TryGetString(TmpValue)) { SteamStringId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPlayFabIDsFromSteamIDsResult::~FGetPlayFabIDsFromSteamIDsResult() +{ + +} + +void PlayFab::ServerModels::FGetPlayFabIDsFromSteamIDsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteArrayStart(TEXT("Data")); + for (const FSteamPlayFabIdPair& item : Data) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPlayFabIDsFromSteamIDsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&DataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Data")); + for (int32 Idx = 0; Idx < DataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = DataArray[Idx]; + Data.Add(FSteamPlayFabIdPair(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPublisherDataRequest::~FGetPublisherDataRequest() +{ + +} + +void PlayFab::ServerModels::FGetPublisherDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPublisherDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetPublisherDataResult::~FGetPublisherDataResult() +{ + +} + +void PlayFab::ServerModels::FGetPublisherDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetPublisherDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetRandomResultTablesRequest::~FGetRandomResultTablesRequest() +{ + +} + +void PlayFab::ServerModels::FGetRandomResultTablesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("TableIDs")); + for (const FString& item : TableIDs) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetRandomResultTablesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("TableIDs"), TableIDs); + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeResultTableNodeTypeEnumJSON(ResultTableNodeType enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case ResultTableNodeTypeItemId: writer->WriteValue(TEXT("ItemId")); break; + case ResultTableNodeTypeTableId: writer->WriteValue(TEXT("TableId")); break; + } +} + +ServerModels::ResultTableNodeType PlayFab::ServerModels::readResultTableNodeTypeFromValue(const TSharedPtr& value) +{ + return readResultTableNodeTypeFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::ResultTableNodeType PlayFab::ServerModels::readResultTableNodeTypeFromValue(const FString& value) +{ + static TMap _ResultTableNodeTypeMap; + if (_ResultTableNodeTypeMap.Num() == 0) + { + // Auto-generate the map on the first use + _ResultTableNodeTypeMap.Add(TEXT("ItemId"), ResultTableNodeTypeItemId); + _ResultTableNodeTypeMap.Add(TEXT("TableId"), ResultTableNodeTypeTableId); + + } + + if (!value.IsEmpty()) + { + auto output = _ResultTableNodeTypeMap.Find(value); + if (output != nullptr) + return *output; + } + + return ResultTableNodeTypeItemId; // Basically critical fail +} + +PlayFab::ServerModels::FResultTableNode::~FResultTableNode() +{ + +} + +void PlayFab::ServerModels::FResultTableNode::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ResultItem")); writer->WriteValue(ResultItem); + + writer->WriteIdentifierPrefix(TEXT("ResultItemType")); writeResultTableNodeTypeEnumJSON(ResultItemType, writer); + + writer->WriteIdentifierPrefix(TEXT("Weight")); writer->WriteValue(Weight); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FResultTableNode::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ResultItemValue = obj->TryGetField(TEXT("ResultItem")); + if (ResultItemValue.IsValid() && !ResultItemValue->IsNull()) + { + FString TmpValue; + if (ResultItemValue->TryGetString(TmpValue)) { ResultItem = TmpValue; } + } + + ResultItemType = readResultTableNodeTypeFromValue(obj->TryGetField(TEXT("ResultItemType"))); + + const TSharedPtr WeightValue = obj->TryGetField(TEXT("Weight")); + if (WeightValue.IsValid() && !WeightValue->IsNull()) + { + int32 TmpValue; + if (WeightValue->TryGetNumber(TmpValue)) { Weight = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRandomResultTableListing::~FRandomResultTableListing() +{ + +} + +void PlayFab::ServerModels::FRandomResultTableListing::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("Nodes")); + for (const FResultTableNode& item : Nodes) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("TableId")); writer->WriteValue(TableId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRandomResultTableListing::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TArray>&NodesArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Nodes")); + for (int32 Idx = 0; Idx < NodesArray.Num(); Idx++) + { + TSharedPtr CurrentItem = NodesArray[Idx]; + Nodes.Add(FResultTableNode(CurrentItem->AsObject())); + } + + + const TSharedPtr TableIdValue = obj->TryGetField(TEXT("TableId")); + if (TableIdValue.IsValid() && !TableIdValue->IsNull()) + { + FString TmpValue; + if (TableIdValue->TryGetString(TmpValue)) { TableId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetRandomResultTablesResult::~FGetRandomResultTablesResult() +{ + +} + +void PlayFab::ServerModels::FGetRandomResultTablesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Tables.Num() != 0) + { + writer->WriteObjectStart(TEXT("Tables")); + for (TMap::TConstIterator It(Tables); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetRandomResultTablesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* TablesObject; + if (obj->TryGetObjectField(TEXT("Tables"), TablesObject)) + { + for (TMap>::TConstIterator It((*TablesObject)->Values); It; ++It) + { + Tables.Add(It.Key(), FRandomResultTableListing(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetSharedGroupDataRequest::~FGetSharedGroupDataRequest() +{ + +} + +void PlayFab::ServerModels::FGetSharedGroupDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GetMembers.notNull()) { writer->WriteIdentifierPrefix(TEXT("GetMembers")); writer->WriteValue(GetMembers); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetSharedGroupDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GetMembersValue = obj->TryGetField(TEXT("GetMembers")); + if (GetMembersValue.IsValid() && !GetMembersValue->IsNull()) + { + bool TmpValue; + if (GetMembersValue->TryGetBool(TmpValue)) { GetMembers = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSharedGroupDataRecord::~FSharedGroupDataRecord() +{ + +} + +void PlayFab::ServerModels::FSharedGroupDataRecord::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LastUpdated")); writeDatetime(LastUpdated, writer); + + if (LastUpdatedBy.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LastUpdatedBy")); writer->WriteValue(LastUpdatedBy); } + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSharedGroupDataRecord::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LastUpdatedValue = obj->TryGetField(TEXT("LastUpdated")); + if (LastUpdatedValue.IsValid()) + LastUpdated = readDatetime(LastUpdatedValue); + + + const TSharedPtr LastUpdatedByValue = obj->TryGetField(TEXT("LastUpdatedBy")); + if (LastUpdatedByValue.IsValid() && !LastUpdatedByValue->IsNull()) + { + FString TmpValue; + if (LastUpdatedByValue->TryGetString(TmpValue)) { LastUpdatedBy = TmpValue; } + } + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetSharedGroupDataResult::~FGetSharedGroupDataResult() +{ + +} + +void PlayFab::ServerModels::FGetSharedGroupDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + if (Members.Num() != 0) + { + writer->WriteArrayStart(TEXT("Members")); + for (const FString& item : Members) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetSharedGroupDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FSharedGroupDataRecord(It.Value()->AsObject())); + } + } + + obj->TryGetStringArrayField(TEXT("Members"), Members); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetTimeRequest::~FGetTimeRequest() +{ + +} + +void PlayFab::ServerModels::FGetTimeRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetTimeRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetTimeResult::~FGetTimeResult() +{ + +} + +void PlayFab::ServerModels::FGetTimeResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Time")); writeDatetime(Time, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetTimeResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr TimeValue = obj->TryGetField(TEXT("Time")); + if (TimeValue.IsValid()) + Time = readDatetime(TimeValue); + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetTitleDataRequest::~FGetTitleDataRequest() +{ + +} + +void PlayFab::ServerModels::FGetTitleDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetTitleDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetTitleDataResult::~FGetTitleDataResult() +{ + +} + +void PlayFab::ServerModels::FGetTitleDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetTitleDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetTitleNewsRequest::~FGetTitleNewsRequest() +{ + +} + +void PlayFab::ServerModels::FGetTitleNewsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Count.notNull()) { writer->WriteIdentifierPrefix(TEXT("Count")); writer->WriteValue(Count); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetTitleNewsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CountValue = obj->TryGetField(TEXT("Count")); + if (CountValue.IsValid() && !CountValue->IsNull()) + { + int32 TmpValue; + if (CountValue->TryGetNumber(TmpValue)) { Count = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FTitleNewsItem::~FTitleNewsItem() +{ + +} + +void PlayFab::ServerModels::FTitleNewsItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Body")); writer->WriteValue(Body); } + + if (NewsId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("NewsId")); writer->WriteValue(NewsId); } + + writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); + + if (Title.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Title")); writer->WriteValue(Title); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FTitleNewsItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BodyValue = obj->TryGetField(TEXT("Body")); + if (BodyValue.IsValid() && !BodyValue->IsNull()) + { + FString TmpValue; + if (BodyValue->TryGetString(TmpValue)) { Body = TmpValue; } + } + + const TSharedPtr NewsIdValue = obj->TryGetField(TEXT("NewsId")); + if (NewsIdValue.IsValid() && !NewsIdValue->IsNull()) + { + FString TmpValue; + if (NewsIdValue->TryGetString(TmpValue)) { NewsId = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + const TSharedPtr TitleValue = obj->TryGetField(TEXT("Title")); + if (TitleValue.IsValid() && !TitleValue->IsNull()) + { + FString TmpValue; + if (TitleValue->TryGetString(TmpValue)) { Title = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetTitleNewsResult::~FGetTitleNewsResult() +{ + +} + +void PlayFab::ServerModels::FGetTitleNewsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (News.Num() != 0) + { + writer->WriteArrayStart(TEXT("News")); + for (const FTitleNewsItem& item : News) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetTitleNewsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&NewsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("News")); + for (int32 Idx = 0; Idx < NewsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = NewsArray[Idx]; + News.Add(FTitleNewsItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserAccountInfoRequest::~FGetUserAccountInfoRequest() +{ + +} + +void PlayFab::ServerModels::FGetUserAccountInfoRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserAccountInfoRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserAccountInfoResult::~FGetUserAccountInfoResult() +{ + //if (UserInfo != nullptr) delete UserInfo; + +} + +void PlayFab::ServerModels::FGetUserAccountInfoResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (UserInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("UserInfo")); UserInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserAccountInfoResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr UserInfoValue = obj->TryGetField(TEXT("UserInfo")); + if (UserInfoValue.IsValid() && !UserInfoValue->IsNull()) + { + UserInfo = MakeShareable(new FUserAccountInfo(UserInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserBansRequest::~FGetUserBansRequest() +{ + +} + +void PlayFab::ServerModels::FGetUserBansRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserBansRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserBansResult::~FGetUserBansResult() +{ + +} + +void PlayFab::ServerModels::FGetUserBansResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserBansResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserDataRequest::~FGetUserDataRequest() +{ + +} + +void PlayFab::ServerModels::FGetUserDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (IfChangedFromDataVersion.notNull()) { writer->WriteIdentifierPrefix(TEXT("IfChangedFromDataVersion")); writer->WriteValue(static_cast(IfChangedFromDataVersion)); } + + if (Keys.Num() != 0) + { + writer->WriteArrayStart(TEXT("Keys")); + for (const FString& item : Keys) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr IfChangedFromDataVersionValue = obj->TryGetField(TEXT("IfChangedFromDataVersion")); + if (IfChangedFromDataVersionValue.IsValid() && !IfChangedFromDataVersionValue->IsNull()) + { + uint32 TmpValue; + if (IfChangedFromDataVersionValue->TryGetNumber(TmpValue)) { IfChangedFromDataVersion = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("Keys"), Keys); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserDataResult::~FGetUserDataResult() +{ + +} + +void PlayFab::ServerModels::FGetUserDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), FUserDataRecord(It.Value()->AsObject())); + } + } + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserInventoryRequest::~FGetUserInventoryRequest() +{ + +} + +void PlayFab::ServerModels::FGetUserInventoryRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserInventoryRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGetUserInventoryResult::~FGetUserInventoryResult() +{ + +} + +void PlayFab::ServerModels::FGetUserInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Inventory.Num() != 0) + { + writer->WriteArrayStart(TEXT("Inventory")); + for (const FItemInstance& item : Inventory) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (VirtualCurrencyRechargeTimes.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrencyRechargeTimes")); + for (TMap::TConstIterator It(VirtualCurrencyRechargeTimes); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGetUserInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&InventoryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Inventory")); + for (int32 Idx = 0; Idx < InventoryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = InventoryArray[Idx]; + Inventory.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr* VirtualCurrencyRechargeTimesObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrencyRechargeTimes"), VirtualCurrencyRechargeTimesObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyRechargeTimesObject)->Values); It; ++It) + { + VirtualCurrencyRechargeTimes.Add(It.Key(), FVirtualCurrencyRechargeTime(It.Value()->AsObject())); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantCharacterToUserRequest::~FGrantCharacterToUserRequest() +{ + +} + +void PlayFab::ServerModels::FGrantCharacterToUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterName")); writer->WriteValue(CharacterName); + + writer->WriteIdentifierPrefix(TEXT("CharacterType")); writer->WriteValue(CharacterType); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantCharacterToUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterNameValue = obj->TryGetField(TEXT("CharacterName")); + if (CharacterNameValue.IsValid() && !CharacterNameValue->IsNull()) + { + FString TmpValue; + if (CharacterNameValue->TryGetString(TmpValue)) { CharacterName = TmpValue; } + } + + const TSharedPtr CharacterTypeValue = obj->TryGetField(TEXT("CharacterType")); + if (CharacterTypeValue.IsValid() && !CharacterTypeValue->IsNull()) + { + FString TmpValue; + if (CharacterTypeValue->TryGetString(TmpValue)) { CharacterType = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantCharacterToUserResult::~FGrantCharacterToUserResult() +{ + +} + +void PlayFab::ServerModels::FGrantCharacterToUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantCharacterToUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantedItemInstance::~FGrantedItemInstance() +{ + +} + +void PlayFab::ServerModels::FGrantedItemInstance::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (BundleContents.Num() != 0) + { + writer->WriteArrayStart(TEXT("BundleContents")); + for (const FString& item : BundleContents) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (BundleParent.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("BundleParent")); writer->WriteValue(BundleParent); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (CustomData.Num() != 0) + { + writer->WriteObjectStart(TEXT("CustomData")); + for (TMap::TConstIterator It(CustomData); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (DisplayName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("DisplayName")); writer->WriteValue(DisplayName); } + + if (Expiration.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expiration")); writeDatetime(Expiration, writer); } + + if (ItemClass.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemClass")); writer->WriteValue(ItemClass); } + + if (ItemId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); } + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (PurchaseDate.notNull()) { writer->WriteIdentifierPrefix(TEXT("PurchaseDate")); writeDatetime(PurchaseDate, writer); } + + if (RemainingUses.notNull()) { writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); } + + writer->WriteIdentifierPrefix(TEXT("Result")); writer->WriteValue(Result); + + if (UnitCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnitCurrency")); writer->WriteValue(UnitCurrency); } + + writer->WriteIdentifierPrefix(TEXT("UnitPrice")); writer->WriteValue(static_cast(UnitPrice)); + + if (UsesIncrementedBy.notNull()) { writer->WriteIdentifierPrefix(TEXT("UsesIncrementedBy")); writer->WriteValue(UsesIncrementedBy); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantedItemInstance::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("BundleContents"), BundleContents); + + const TSharedPtr BundleParentValue = obj->TryGetField(TEXT("BundleParent")); + if (BundleParentValue.IsValid() && !BundleParentValue->IsNull()) + { + FString TmpValue; + if (BundleParentValue->TryGetString(TmpValue)) { BundleParent = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* CustomDataObject; + if (obj->TryGetObjectField(TEXT("CustomData"), CustomDataObject)) + { + for (TMap>::TConstIterator It((*CustomDataObject)->Values); It; ++It) + { + CustomData.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr DisplayNameValue = obj->TryGetField(TEXT("DisplayName")); + if (DisplayNameValue.IsValid() && !DisplayNameValue->IsNull()) + { + FString TmpValue; + if (DisplayNameValue->TryGetString(TmpValue)) { DisplayName = TmpValue; } + } + + const TSharedPtr ExpirationValue = obj->TryGetField(TEXT("Expiration")); + if (ExpirationValue.IsValid()) + Expiration = readDatetime(ExpirationValue); + + + const TSharedPtr ItemClassValue = obj->TryGetField(TEXT("ItemClass")); + if (ItemClassValue.IsValid() && !ItemClassValue->IsNull()) + { + FString TmpValue; + if (ItemClassValue->TryGetString(TmpValue)) { ItemClass = TmpValue; } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr PurchaseDateValue = obj->TryGetField(TEXT("PurchaseDate")); + if (PurchaseDateValue.IsValid()) + PurchaseDate = readDatetime(PurchaseDateValue); + + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + const TSharedPtr ResultValue = obj->TryGetField(TEXT("Result")); + if (ResultValue.IsValid() && !ResultValue->IsNull()) + { + bool TmpValue; + if (ResultValue->TryGetBool(TmpValue)) { Result = TmpValue; } + } + + const TSharedPtr UnitCurrencyValue = obj->TryGetField(TEXT("UnitCurrency")); + if (UnitCurrencyValue.IsValid() && !UnitCurrencyValue->IsNull()) + { + FString TmpValue; + if (UnitCurrencyValue->TryGetString(TmpValue)) { UnitCurrency = TmpValue; } + } + + const TSharedPtr UnitPriceValue = obj->TryGetField(TEXT("UnitPrice")); + if (UnitPriceValue.IsValid() && !UnitPriceValue->IsNull()) + { + uint32 TmpValue; + if (UnitPriceValue->TryGetNumber(TmpValue)) { UnitPrice = TmpValue; } + } + + const TSharedPtr UsesIncrementedByValue = obj->TryGetField(TEXT("UsesIncrementedBy")); + if (UsesIncrementedByValue.IsValid() && !UsesIncrementedByValue->IsNull()) + { + int32 TmpValue; + if (UsesIncrementedByValue->TryGetNumber(TmpValue)) { UsesIncrementedBy = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantItemsToCharacterRequest::~FGrantItemsToCharacterRequest() +{ + +} + +void PlayFab::ServerModels::FGrantItemsToCharacterRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (ItemIds.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemIds")); + for (const FString& item : ItemIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantItemsToCharacterRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("ItemIds"), ItemIds); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantItemsToCharacterResult::~FGrantItemsToCharacterResult() +{ + +} + +void PlayFab::ServerModels::FGrantItemsToCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemGrantResults.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemGrantResults")); + for (const FGrantedItemInstance& item : ItemGrantResults) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantItemsToCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemGrantResultsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ItemGrantResults")); + for (int32 Idx = 0; Idx < ItemGrantResultsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemGrantResultsArray[Idx]; + ItemGrantResults.Add(FGrantedItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantItemsToUserRequest::~FGrantItemsToUserRequest() +{ + +} + +void PlayFab::ServerModels::FGrantItemsToUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("ItemIds")); + for (const FString& item : ItemIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantItemsToUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("ItemIds"), ItemIds); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantItemsToUserResult::~FGrantItemsToUserResult() +{ + +} + +void PlayFab::ServerModels::FGrantItemsToUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemGrantResults.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemGrantResults")); + for (const FGrantedItemInstance& item : ItemGrantResults) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantItemsToUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemGrantResultsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ItemGrantResults")); + for (int32 Idx = 0; Idx < ItemGrantResultsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemGrantResultsArray[Idx]; + ItemGrantResults.Add(FGrantedItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FItemGrant::~FItemGrant() +{ + +} + +void PlayFab::ServerModels::FItemGrant::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Annotation.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Annotation")); writer->WriteValue(Annotation); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("ItemId")); writer->WriteValue(ItemId); + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FItemGrant::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AnnotationValue = obj->TryGetField(TEXT("Annotation")); + if (AnnotationValue.IsValid() && !AnnotationValue->IsNull()) + { + FString TmpValue; + if (AnnotationValue->TryGetString(TmpValue)) { Annotation = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr ItemIdValue = obj->TryGetField(TEXT("ItemId")); + if (ItemIdValue.IsValid() && !ItemIdValue->IsNull()) + { + FString TmpValue; + if (ItemIdValue->TryGetString(TmpValue)) { ItemId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantItemsToUsersRequest::~FGrantItemsToUsersRequest() +{ + +} + +void PlayFab::ServerModels::FGrantItemsToUsersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + writer->WriteArrayStart(TEXT("ItemGrants")); + for (const FItemGrant& item : ItemGrants) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantItemsToUsersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TArray>&ItemGrantsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ItemGrants")); + for (int32 Idx = 0; Idx < ItemGrantsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemGrantsArray[Idx]; + ItemGrants.Add(FItemGrant(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FGrantItemsToUsersResult::~FGrantItemsToUsersResult() +{ + +} + +void PlayFab::ServerModels::FGrantItemsToUsersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemGrantResults.Num() != 0) + { + writer->WriteArrayStart(TEXT("ItemGrantResults")); + for (const FGrantedItemInstance& item : ItemGrantResults) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FGrantItemsToUsersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemGrantResultsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("ItemGrantResults")); + for (int32 Idx = 0; Idx < ItemGrantResultsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemGrantResultsArray[Idx]; + ItemGrantResults.Add(FGrantedItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FListUsersCharactersRequest::~FListUsersCharactersRequest() +{ + +} + +void PlayFab::ServerModels::FListUsersCharactersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FListUsersCharactersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FListUsersCharactersResult::~FListUsersCharactersResult() +{ + +} + +void PlayFab::ServerModels::FListUsersCharactersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Characters.Num() != 0) + { + writer->WriteArrayStart(TEXT("Characters")); + for (const FCharacterResult& item : Characters) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FListUsersCharactersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&CharactersArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Characters")); + for (int32 Idx = 0; Idx < CharactersArray.Num(); Idx++) + { + TSharedPtr CurrentItem = CharactersArray[Idx]; + Characters.Add(FCharacterResult(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FModifyCharacterVirtualCurrencyResult::~FModifyCharacterVirtualCurrencyResult() +{ + +} + +void PlayFab::ServerModels::FModifyCharacterVirtualCurrencyResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Balance")); writer->WriteValue(Balance); + + if (VirtualCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FModifyCharacterVirtualCurrencyResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BalanceValue = obj->TryGetField(TEXT("Balance")); + if (BalanceValue.IsValid() && !BalanceValue->IsNull()) + { + int32 TmpValue; + if (BalanceValue->TryGetNumber(TmpValue)) { Balance = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FModifyItemUsesRequest::~FModifyItemUsesRequest() +{ + +} + +void PlayFab::ServerModels::FModifyItemUsesRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("UsesToAdd")); writer->WriteValue(UsesToAdd); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FModifyItemUsesRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr UsesToAddValue = obj->TryGetField(TEXT("UsesToAdd")); + if (UsesToAddValue.IsValid() && !UsesToAddValue->IsNull()) + { + int32 TmpValue; + if (UsesToAddValue->TryGetNumber(TmpValue)) { UsesToAdd = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FModifyItemUsesResult::~FModifyItemUsesResult() +{ + +} + +void PlayFab::ServerModels::FModifyItemUsesResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); } + + writer->WriteIdentifierPrefix(TEXT("RemainingUses")); writer->WriteValue(RemainingUses); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FModifyItemUsesResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr RemainingUsesValue = obj->TryGetField(TEXT("RemainingUses")); + if (RemainingUsesValue.IsValid() && !RemainingUsesValue->IsNull()) + { + int32 TmpValue; + if (RemainingUsesValue->TryGetNumber(TmpValue)) { RemainingUses = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FModifyUserVirtualCurrencyResult::~FModifyUserVirtualCurrencyResult() +{ + +} + +void PlayFab::ServerModels::FModifyUserVirtualCurrencyResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Balance")); writer->WriteValue(Balance); + + writer->WriteIdentifierPrefix(TEXT("BalanceChange")); writer->WriteValue(BalanceChange); + + if (PlayFabId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); } + + if (VirtualCurrency.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FModifyUserVirtualCurrencyResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BalanceValue = obj->TryGetField(TEXT("Balance")); + if (BalanceValue.IsValid() && !BalanceValue->IsNull()) + { + int32 TmpValue; + if (BalanceValue->TryGetNumber(TmpValue)) { Balance = TmpValue; } + } + + const TSharedPtr BalanceChangeValue = obj->TryGetField(TEXT("BalanceChange")); + if (BalanceChangeValue.IsValid() && !BalanceChangeValue->IsNull()) + { + int32 TmpValue; + if (BalanceChangeValue->TryGetNumber(TmpValue)) { BalanceChange = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FMoveItemToCharacterFromCharacterRequest::~FMoveItemToCharacterFromCharacterRequest() +{ + +} + +void PlayFab::ServerModels::FMoveItemToCharacterFromCharacterRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GivingCharacterId")); writer->WriteValue(GivingCharacterId); + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("ReceivingCharacterId")); writer->WriteValue(ReceivingCharacterId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMoveItemToCharacterFromCharacterRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GivingCharacterIdValue = obj->TryGetField(TEXT("GivingCharacterId")); + if (GivingCharacterIdValue.IsValid() && !GivingCharacterIdValue->IsNull()) + { + FString TmpValue; + if (GivingCharacterIdValue->TryGetString(TmpValue)) { GivingCharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr ReceivingCharacterIdValue = obj->TryGetField(TEXT("ReceivingCharacterId")); + if (ReceivingCharacterIdValue.IsValid() && !ReceivingCharacterIdValue->IsNull()) + { + FString TmpValue; + if (ReceivingCharacterIdValue->TryGetString(TmpValue)) { ReceivingCharacterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FMoveItemToCharacterFromCharacterResult::~FMoveItemToCharacterFromCharacterResult() +{ + +} + +void PlayFab::ServerModels::FMoveItemToCharacterFromCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMoveItemToCharacterFromCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FMoveItemToCharacterFromUserRequest::~FMoveItemToCharacterFromUserRequest() +{ + +} + +void PlayFab::ServerModels::FMoveItemToCharacterFromUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMoveItemToCharacterFromUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FMoveItemToCharacterFromUserResult::~FMoveItemToCharacterFromUserResult() +{ + +} + +void PlayFab::ServerModels::FMoveItemToCharacterFromUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMoveItemToCharacterFromUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FMoveItemToUserFromCharacterRequest::~FMoveItemToUserFromCharacterRequest() +{ + +} + +void PlayFab::ServerModels::FMoveItemToUserFromCharacterRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMoveItemToUserFromCharacterRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FMoveItemToUserFromCharacterResult::~FMoveItemToUserFromCharacterResult() +{ + +} + +void PlayFab::ServerModels::FMoveItemToUserFromCharacterResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FMoveItemToUserFromCharacterResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FNotifyMatchmakerPlayerLeftRequest::~FNotifyMatchmakerPlayerLeftRequest() +{ + +} + +void PlayFab::ServerModels::FNotifyMatchmakerPlayerLeftRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FNotifyMatchmakerPlayerLeftRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +void PlayFab::ServerModels::writePlayerConnectionStateEnumJSON(PlayerConnectionState enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case PlayerConnectionStateUnassigned: writer->WriteValue(TEXT("Unassigned")); break; + case PlayerConnectionStateConnecting: writer->WriteValue(TEXT("Connecting")); break; + case PlayerConnectionStateParticipating: writer->WriteValue(TEXT("Participating")); break; + case PlayerConnectionStateParticipated: writer->WriteValue(TEXT("Participated")); break; + } +} + +ServerModels::PlayerConnectionState PlayFab::ServerModels::readPlayerConnectionStateFromValue(const TSharedPtr& value) +{ + return readPlayerConnectionStateFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::PlayerConnectionState PlayFab::ServerModels::readPlayerConnectionStateFromValue(const FString& value) +{ + static TMap _PlayerConnectionStateMap; + if (_PlayerConnectionStateMap.Num() == 0) + { + // Auto-generate the map on the first use + _PlayerConnectionStateMap.Add(TEXT("Unassigned"), PlayerConnectionStateUnassigned); + _PlayerConnectionStateMap.Add(TEXT("Connecting"), PlayerConnectionStateConnecting); + _PlayerConnectionStateMap.Add(TEXT("Participating"), PlayerConnectionStateParticipating); + _PlayerConnectionStateMap.Add(TEXT("Participated"), PlayerConnectionStateParticipated); + + } + + if (!value.IsEmpty()) + { + auto output = _PlayerConnectionStateMap.Find(value); + if (output != nullptr) + return *output; + } + + return PlayerConnectionStateUnassigned; // Basically critical fail +} + +PlayFab::ServerModels::FNotifyMatchmakerPlayerLeftResult::~FNotifyMatchmakerPlayerLeftResult() +{ + +} + +void PlayFab::ServerModels::FNotifyMatchmakerPlayerLeftResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (PlayerState.notNull()) { writer->WriteIdentifierPrefix(TEXT("PlayerState")); writePlayerConnectionStateEnumJSON(PlayerState, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FNotifyMatchmakerPlayerLeftResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + PlayerState = readPlayerConnectionStateFromValue(obj->TryGetField(TEXT("PlayerState"))); + + return HasSucceeded; +} + +PlayFab::ServerModels::FPushNotificationPackage::~FPushNotificationPackage() +{ + +} + +void PlayFab::ServerModels::FPushNotificationPackage::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Badge")); writer->WriteValue(Badge); + + if (CustomData.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CustomData")); writer->WriteValue(CustomData); } + + if (Icon.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Icon")); writer->WriteValue(Icon); } + + writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); + + if (Sound.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Sound")); writer->WriteValue(Sound); } + + writer->WriteIdentifierPrefix(TEXT("Title")); writer->WriteValue(Title); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FPushNotificationPackage::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BadgeValue = obj->TryGetField(TEXT("Badge")); + if (BadgeValue.IsValid() && !BadgeValue->IsNull()) + { + int32 TmpValue; + if (BadgeValue->TryGetNumber(TmpValue)) { Badge = TmpValue; } + } + + const TSharedPtr CustomDataValue = obj->TryGetField(TEXT("CustomData")); + if (CustomDataValue.IsValid() && !CustomDataValue->IsNull()) + { + FString TmpValue; + if (CustomDataValue->TryGetString(TmpValue)) { CustomData = TmpValue; } + } + + const TSharedPtr IconValue = obj->TryGetField(TEXT("Icon")); + if (IconValue.IsValid() && !IconValue->IsNull()) + { + FString TmpValue; + if (IconValue->TryGetString(TmpValue)) { Icon = TmpValue; } + } + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + const TSharedPtr SoundValue = obj->TryGetField(TEXT("Sound")); + if (SoundValue.IsValid() && !SoundValue->IsNull()) + { + FString TmpValue; + if (SoundValue->TryGetString(TmpValue)) { Sound = TmpValue; } + } + + const TSharedPtr TitleValue = obj->TryGetField(TEXT("Title")); + if (TitleValue.IsValid() && !TitleValue->IsNull()) + { + FString TmpValue; + if (TitleValue->TryGetString(TmpValue)) { Title = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRedeemCouponRequest::~FRedeemCouponRequest() +{ + +} + +void PlayFab::ServerModels::FRedeemCouponRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("CouponCode")); writer->WriteValue(CouponCode); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRedeemCouponRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr CouponCodeValue = obj->TryGetField(TEXT("CouponCode")); + if (CouponCodeValue.IsValid() && !CouponCodeValue->IsNull()) + { + FString TmpValue; + if (CouponCodeValue->TryGetString(TmpValue)) { CouponCode = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRedeemCouponResult::~FRedeemCouponResult() +{ + +} + +void PlayFab::ServerModels::FRedeemCouponResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GrantedItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("GrantedItems")); + for (const FItemInstance& item : GrantedItems) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRedeemCouponResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GrantedItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GrantedItems")); + for (int32 Idx = 0; Idx < GrantedItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GrantedItemsArray[Idx]; + GrantedItems.Add(FItemInstance(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FRedeemMatchmakerTicketRequest::~FRedeemMatchmakerTicketRequest() +{ + +} + +void PlayFab::ServerModels::FRedeemMatchmakerTicketRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteIdentifierPrefix(TEXT("Ticket")); writer->WriteValue(Ticket); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRedeemMatchmakerTicketRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + const TSharedPtr TicketValue = obj->TryGetField(TEXT("Ticket")); + if (TicketValue.IsValid() && !TicketValue->IsNull()) + { + FString TmpValue; + if (TicketValue->TryGetString(TmpValue)) { Ticket = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRedeemMatchmakerTicketResult::~FRedeemMatchmakerTicketResult() +{ + //if (UserInfo != nullptr) delete UserInfo; + +} + +void PlayFab::ServerModels::FRedeemMatchmakerTicketResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + writer->WriteIdentifierPrefix(TEXT("TicketIsValid")); writer->WriteValue(TicketIsValid); + + if (UserInfo.IsValid()) { writer->WriteIdentifierPrefix(TEXT("UserInfo")); UserInfo->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRedeemMatchmakerTicketResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr TicketIsValidValue = obj->TryGetField(TEXT("TicketIsValid")); + if (TicketIsValidValue.IsValid() && !TicketIsValidValue->IsNull()) + { + bool TmpValue; + if (TicketIsValidValue->TryGetBool(TmpValue)) { TicketIsValid = TmpValue; } + } + + const TSharedPtr UserInfoValue = obj->TryGetField(TEXT("UserInfo")); + if (UserInfoValue.IsValid() && !UserInfoValue->IsNull()) + { + UserInfo = MakeShareable(new FUserAccountInfo(UserInfoValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRefreshGameServerInstanceHeartbeatRequest::~FRefreshGameServerInstanceHeartbeatRequest() +{ + +} + +void PlayFab::ServerModels::FRefreshGameServerInstanceHeartbeatRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRefreshGameServerInstanceHeartbeatRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRefreshGameServerInstanceHeartbeatResult::~FRefreshGameServerInstanceHeartbeatResult() +{ + +} + +void PlayFab::ServerModels::FRefreshGameServerInstanceHeartbeatResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRefreshGameServerInstanceHeartbeatResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +void PlayFab::ServerModels::writeRegionEnumJSON(Region enumVal, JsonWriter& writer) +{ + switch (enumVal) + { + + case RegionUSCentral: writer->WriteValue(TEXT("USCentral")); break; + case RegionUSEast: writer->WriteValue(TEXT("USEast")); break; + case RegionEUWest: writer->WriteValue(TEXT("EUWest")); break; + case RegionSingapore: writer->WriteValue(TEXT("Singapore")); break; + case RegionJapan: writer->WriteValue(TEXT("Japan")); break; + case RegionBrazil: writer->WriteValue(TEXT("Brazil")); break; + case RegionAustralia: writer->WriteValue(TEXT("Australia")); break; + } +} + +ServerModels::Region PlayFab::ServerModels::readRegionFromValue(const TSharedPtr& value) +{ + return readRegionFromValue(value.IsValid() ? value->AsString() : ""); +} + +ServerModels::Region PlayFab::ServerModels::readRegionFromValue(const FString& value) +{ + static TMap _RegionMap; + if (_RegionMap.Num() == 0) + { + // Auto-generate the map on the first use + _RegionMap.Add(TEXT("USCentral"), RegionUSCentral); + _RegionMap.Add(TEXT("USEast"), RegionUSEast); + _RegionMap.Add(TEXT("EUWest"), RegionEUWest); + _RegionMap.Add(TEXT("Singapore"), RegionSingapore); + _RegionMap.Add(TEXT("Japan"), RegionJapan); + _RegionMap.Add(TEXT("Brazil"), RegionBrazil); + _RegionMap.Add(TEXT("Australia"), RegionAustralia); + + } + + if (!value.IsEmpty()) + { + auto output = _RegionMap.Find(value); + if (output != nullptr) + return *output; + } + + return RegionUSCentral; // Basically critical fail +} + +PlayFab::ServerModels::FRegisterGameRequest::~FRegisterGameRequest() +{ + +} + +void PlayFab::ServerModels::FRegisterGameRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Build")); writer->WriteValue(Build); + + writer->WriteIdentifierPrefix(TEXT("GameMode")); writer->WriteValue(GameMode); + + if (LobbyId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); } + + writer->WriteIdentifierPrefix(TEXT("Region")); writeRegionEnumJSON(pfRegion, writer); + + if (ServerHost.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerHost")); writer->WriteValue(ServerHost); } + + if (ServerIPV4Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV4Address")); writer->WriteValue(ServerIPV4Address); } + + if (ServerIPV6Address.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerIPV6Address")); writer->WriteValue(ServerIPV6Address); } + + writer->WriteIdentifierPrefix(TEXT("ServerPort")); writer->WriteValue(ServerPort); + + if (ServerPublicDNSName.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("ServerPublicDNSName")); writer->WriteValue(ServerPublicDNSName); } + + if (Tags.Num() != 0) + { + writer->WriteObjectStart(TEXT("Tags")); + for (TMap::TConstIterator It(Tags); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRegisterGameRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr BuildValue = obj->TryGetField(TEXT("Build")); + if (BuildValue.IsValid() && !BuildValue->IsNull()) + { + FString TmpValue; + if (BuildValue->TryGetString(TmpValue)) { Build = TmpValue; } + } + + const TSharedPtr GameModeValue = obj->TryGetField(TEXT("GameMode")); + if (GameModeValue.IsValid() && !GameModeValue->IsNull()) + { + FString TmpValue; + if (GameModeValue->TryGetString(TmpValue)) { GameMode = TmpValue; } + } + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + pfRegion = readRegionFromValue(obj->TryGetField(TEXT("Region"))); + + const TSharedPtr ServerHostValue = obj->TryGetField(TEXT("ServerHost")); + if (ServerHostValue.IsValid() && !ServerHostValue->IsNull()) + { + FString TmpValue; + if (ServerHostValue->TryGetString(TmpValue)) { ServerHost = TmpValue; } + } + + const TSharedPtr ServerIPV4AddressValue = obj->TryGetField(TEXT("ServerIPV4Address")); + if (ServerIPV4AddressValue.IsValid() && !ServerIPV4AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV4AddressValue->TryGetString(TmpValue)) { ServerIPV4Address = TmpValue; } + } + + const TSharedPtr ServerIPV6AddressValue = obj->TryGetField(TEXT("ServerIPV6Address")); + if (ServerIPV6AddressValue.IsValid() && !ServerIPV6AddressValue->IsNull()) + { + FString TmpValue; + if (ServerIPV6AddressValue->TryGetString(TmpValue)) { ServerIPV6Address = TmpValue; } + } + + const TSharedPtr ServerPortValue = obj->TryGetField(TEXT("ServerPort")); + if (ServerPortValue.IsValid() && !ServerPortValue->IsNull()) + { + FString TmpValue; + if (ServerPortValue->TryGetString(TmpValue)) { ServerPort = TmpValue; } + } + + const TSharedPtr ServerPublicDNSNameValue = obj->TryGetField(TEXT("ServerPublicDNSName")); + if (ServerPublicDNSNameValue.IsValid() && !ServerPublicDNSNameValue->IsNull()) + { + FString TmpValue; + if (ServerPublicDNSNameValue->TryGetString(TmpValue)) { ServerPublicDNSName = TmpValue; } + } + + const TSharedPtr* TagsObject; + if (obj->TryGetObjectField(TEXT("Tags"), TagsObject)) + { + for (TMap>::TConstIterator It((*TagsObject)->Values); It; ++It) + { + Tags.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRegisterGameResponse::~FRegisterGameResponse() +{ + +} + +void PlayFab::ServerModels::FRegisterGameResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (LobbyId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRegisterGameResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRemoveFriendRequest::~FRemoveFriendRequest() +{ + +} + +void PlayFab::ServerModels::FRemoveFriendRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRemoveFriendRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRemovePlayerTagRequest::~FRemovePlayerTagRequest() +{ + +} + +void PlayFab::ServerModels::FRemovePlayerTagRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("TagName")); writer->WriteValue(TagName); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRemovePlayerTagRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TagNameValue = obj->TryGetField(TEXT("TagName")); + if (TagNameValue.IsValid() && !TagNameValue->IsNull()) + { + FString TmpValue; + if (TagNameValue->TryGetString(TmpValue)) { TagName = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRemovePlayerTagResult::~FRemovePlayerTagResult() +{ + +} + +void PlayFab::ServerModels::FRemovePlayerTagResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRemovePlayerTagResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FRemoveSharedGroupMembersRequest::~FRemoveSharedGroupMembersRequest() +{ + +} + +void PlayFab::ServerModels::FRemoveSharedGroupMembersRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("PlayFabIds")); + for (const FString& item : PlayFabIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRemoveSharedGroupMembersRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("PlayFabIds"), PlayFabIds); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRemoveSharedGroupMembersResult::~FRemoveSharedGroupMembersResult() +{ + +} + +void PlayFab::ServerModels::FRemoveSharedGroupMembersResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRemoveSharedGroupMembersResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FReportPlayerServerRequest::~FReportPlayerServerRequest() +{ + +} + +void PlayFab::ServerModels::FReportPlayerServerRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Comment.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Comment")); writer->WriteValue(Comment); } + + writer->WriteIdentifierPrefix(TEXT("ReporteeId")); writer->WriteValue(ReporteeId); + + writer->WriteIdentifierPrefix(TEXT("ReporterId")); writer->WriteValue(ReporterId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FReportPlayerServerRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CommentValue = obj->TryGetField(TEXT("Comment")); + if (CommentValue.IsValid() && !CommentValue->IsNull()) + { + FString TmpValue; + if (CommentValue->TryGetString(TmpValue)) { Comment = TmpValue; } + } + + const TSharedPtr ReporteeIdValue = obj->TryGetField(TEXT("ReporteeId")); + if (ReporteeIdValue.IsValid() && !ReporteeIdValue->IsNull()) + { + FString TmpValue; + if (ReporteeIdValue->TryGetString(TmpValue)) { ReporteeId = TmpValue; } + } + + const TSharedPtr ReporterIdValue = obj->TryGetField(TEXT("ReporterId")); + if (ReporterIdValue.IsValid() && !ReporterIdValue->IsNull()) + { + FString TmpValue; + if (ReporterIdValue->TryGetString(TmpValue)) { ReporterId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FReportPlayerServerResult::~FReportPlayerServerResult() +{ + +} + +void PlayFab::ServerModels::FReportPlayerServerResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("SubmissionsRemaining")); writer->WriteValue(SubmissionsRemaining); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FReportPlayerServerResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr SubmissionsRemainingValue = obj->TryGetField(TEXT("SubmissionsRemaining")); + if (SubmissionsRemainingValue.IsValid() && !SubmissionsRemainingValue->IsNull()) + { + int32 TmpValue; + if (SubmissionsRemainingValue->TryGetNumber(TmpValue)) { SubmissionsRemaining = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeAllBansForUserRequest::~FRevokeAllBansForUserRequest() +{ + +} + +void PlayFab::ServerModels::FRevokeAllBansForUserRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeAllBansForUserRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeAllBansForUserResult::~FRevokeAllBansForUserResult() +{ + +} + +void PlayFab::ServerModels::FRevokeAllBansForUserResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeAllBansForUserResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeBansRequest::~FRevokeBansRequest() +{ + +} + +void PlayFab::ServerModels::FRevokeBansRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("BanIds")); + for (const FString& item : BanIds) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeBansRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("BanIds"), BanIds); + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeBansResult::~FRevokeBansResult() +{ + +} + +void PlayFab::ServerModels::FRevokeBansResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeBansResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeInventoryItem::~FRevokeInventoryItem() +{ + +} + +void PlayFab::ServerModels::FRevokeInventoryItem::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeInventoryItem::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeInventoryItemRequest::~FRevokeInventoryItemRequest() +{ + +} + +void PlayFab::ServerModels::FRevokeInventoryItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeInventoryItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeInventoryItemsRequest::~FRevokeInventoryItemsRequest() +{ + +} + +void PlayFab::ServerModels::FRevokeInventoryItemsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Items")); + for (const FRevokeInventoryItem& item : Items) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeInventoryItemsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Items")); + for (int32 Idx = 0; Idx < ItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ItemsArray[Idx]; + Items.Add(FRevokeInventoryItem(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeItemError::~FRevokeItemError() +{ + //if (Item != nullptr) delete Item; + +} + +void PlayFab::ServerModels::FRevokeItemError::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Error.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Error")); writer->WriteValue(Error); } + + if (Item.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Item")); Item->writeJSON(writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeItemError::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ErrorValue = obj->TryGetField(TEXT("Error")); + if (ErrorValue.IsValid() && !ErrorValue->IsNull()) + { + FString TmpValue; + if (ErrorValue->TryGetString(TmpValue)) { Error = TmpValue; } + } + + const TSharedPtr ItemValue = obj->TryGetField(TEXT("Item")); + if (ItemValue.IsValid() && !ItemValue->IsNull()) + { + Item = MakeShareable(new FRevokeInventoryItem(ItemValue->AsObject())); + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeInventoryItemsResult::~FRevokeInventoryItemsResult() +{ + +} + +void PlayFab::ServerModels::FRevokeInventoryItemsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Errors.Num() != 0) + { + writer->WriteArrayStart(TEXT("Errors")); + for (const FRevokeItemError& item : Errors) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeInventoryItemsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&ErrorsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Errors")); + for (int32 Idx = 0; Idx < ErrorsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = ErrorsArray[Idx]; + Errors.Add(FRevokeItemError(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FRevokeInventoryResult::~FRevokeInventoryResult() +{ + +} + +void PlayFab::ServerModels::FRevokeInventoryResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FRevokeInventoryResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSendCustomAccountRecoveryEmailRequest::~FSendCustomAccountRecoveryEmailRequest() +{ + +} + +void PlayFab::ServerModels::FSendCustomAccountRecoveryEmailRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Email.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Email")); writer->WriteValue(Email); } + + writer->WriteIdentifierPrefix(TEXT("EmailTemplateId")); writer->WriteValue(EmailTemplateId); + + if (Username.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Username")); writer->WriteValue(Username); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSendCustomAccountRecoveryEmailRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailValue = obj->TryGetField(TEXT("Email")); + if (EmailValue.IsValid() && !EmailValue->IsNull()) + { + FString TmpValue; + if (EmailValue->TryGetString(TmpValue)) { Email = TmpValue; } + } + + const TSharedPtr EmailTemplateIdValue = obj->TryGetField(TEXT("EmailTemplateId")); + if (EmailTemplateIdValue.IsValid() && !EmailTemplateIdValue->IsNull()) + { + FString TmpValue; + if (EmailTemplateIdValue->TryGetString(TmpValue)) { EmailTemplateId = TmpValue; } + } + + const TSharedPtr UsernameValue = obj->TryGetField(TEXT("Username")); + if (UsernameValue.IsValid() && !UsernameValue->IsNull()) + { + FString TmpValue; + if (UsernameValue->TryGetString(TmpValue)) { Username = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSendCustomAccountRecoveryEmailResult::~FSendCustomAccountRecoveryEmailResult() +{ + +} + +void PlayFab::ServerModels::FSendCustomAccountRecoveryEmailResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSendCustomAccountRecoveryEmailResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSendEmailFromTemplateRequest::~FSendEmailFromTemplateRequest() +{ + +} + +void PlayFab::ServerModels::FSendEmailFromTemplateRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("EmailTemplateId")); writer->WriteValue(EmailTemplateId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSendEmailFromTemplateRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EmailTemplateIdValue = obj->TryGetField(TEXT("EmailTemplateId")); + if (EmailTemplateIdValue.IsValid() && !EmailTemplateIdValue->IsNull()) + { + FString TmpValue; + if (EmailTemplateIdValue->TryGetString(TmpValue)) { EmailTemplateId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSendEmailFromTemplateResult::~FSendEmailFromTemplateResult() +{ + +} + +void PlayFab::ServerModels::FSendEmailFromTemplateResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSendEmailFromTemplateResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSendPushNotificationRequest::~FSendPushNotificationRequest() +{ + //if (Package != nullptr) delete Package; + +} + +void PlayFab::ServerModels::FSendPushNotificationRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (AdvancedPlatformDelivery.Num() != 0) + { + writer->WriteArrayStart(TEXT("AdvancedPlatformDelivery")); + for (const FAdvancedPushPlatformMsg& item : AdvancedPlatformDelivery) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (Message.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Message")); writer->WriteValue(Message); } + + if (Package.IsValid()) { writer->WriteIdentifierPrefix(TEXT("Package")); Package->writeJSON(writer); } + + writer->WriteIdentifierPrefix(TEXT("Recipient")); writer->WriteValue(Recipient); + + if (Subject.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Subject")); writer->WriteValue(Subject); } + + if (TargetPlatforms.Num() != 0) + { + writer->WriteArrayStart(TEXT("TargetPlatforms")); + for (const PushNotificationPlatform& item : TargetPlatforms) + writePushNotificationPlatformEnumJSON(item, writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSendPushNotificationRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&AdvancedPlatformDeliveryArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("AdvancedPlatformDelivery")); + for (int32 Idx = 0; Idx < AdvancedPlatformDeliveryArray.Num(); Idx++) + { + TSharedPtr CurrentItem = AdvancedPlatformDeliveryArray[Idx]; + AdvancedPlatformDelivery.Add(FAdvancedPushPlatformMsg(CurrentItem->AsObject())); + } + + + const TSharedPtr MessageValue = obj->TryGetField(TEXT("Message")); + if (MessageValue.IsValid() && !MessageValue->IsNull()) + { + FString TmpValue; + if (MessageValue->TryGetString(TmpValue)) { Message = TmpValue; } + } + + const TSharedPtr PackageValue = obj->TryGetField(TEXT("Package")); + if (PackageValue.IsValid() && !PackageValue->IsNull()) + { + Package = MakeShareable(new FPushNotificationPackage(PackageValue->AsObject())); + } + + const TSharedPtr RecipientValue = obj->TryGetField(TEXT("Recipient")); + if (RecipientValue.IsValid() && !RecipientValue->IsNull()) + { + FString TmpValue; + if (RecipientValue->TryGetString(TmpValue)) { Recipient = TmpValue; } + } + + const TSharedPtr SubjectValue = obj->TryGetField(TEXT("Subject")); + if (SubjectValue.IsValid() && !SubjectValue->IsNull()) + { + FString TmpValue; + if (SubjectValue->TryGetString(TmpValue)) { Subject = TmpValue; } + } + + const TArray>&TargetPlatformsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("TargetPlatforms")); + for (int32 Idx = 0; Idx < TargetPlatformsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = TargetPlatformsArray[Idx]; + TargetPlatforms.Add(readPushNotificationPlatformFromValue(CurrentItem)); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FSendPushNotificationResult::~FSendPushNotificationResult() +{ + +} + +void PlayFab::ServerModels::FSendPushNotificationResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSendPushNotificationResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetFriendTagsRequest::~FSetFriendTagsRequest() +{ + +} + +void PlayFab::ServerModels::FSetFriendTagsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("FriendPlayFabId")); writer->WriteValue(FriendPlayFabId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteArrayStart(TEXT("Tags")); + for (const FString& item : Tags) + writer->WriteValue(item); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetFriendTagsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr FriendPlayFabIdValue = obj->TryGetField(TEXT("FriendPlayFabId")); + if (FriendPlayFabIdValue.IsValid() && !FriendPlayFabIdValue->IsNull()) + { + FString TmpValue; + if (FriendPlayFabIdValue->TryGetString(TmpValue)) { FriendPlayFabId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + HasSucceeded &= obj->TryGetStringArrayField(TEXT("Tags"), Tags); + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetGameServerInstanceDataRequest::~FSetGameServerInstanceDataRequest() +{ + +} + +void PlayFab::ServerModels::FSetGameServerInstanceDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("GameServerData")); writer->WriteValue(GameServerData); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetGameServerInstanceDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr GameServerDataValue = obj->TryGetField(TEXT("GameServerData")); + if (GameServerDataValue.IsValid() && !GameServerDataValue->IsNull()) + { + FString TmpValue; + if (GameServerDataValue->TryGetString(TmpValue)) { GameServerData = TmpValue; } + } + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetGameServerInstanceDataResult::~FSetGameServerInstanceDataResult() +{ + +} + +void PlayFab::ServerModels::FSetGameServerInstanceDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetGameServerInstanceDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetGameServerInstanceStateRequest::~FSetGameServerInstanceStateRequest() +{ + +} + +void PlayFab::ServerModels::FSetGameServerInstanceStateRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteIdentifierPrefix(TEXT("State")); writeGameInstanceStateEnumJSON(State, writer); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetGameServerInstanceStateRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + State = readGameInstanceStateFromValue(obj->TryGetField(TEXT("State"))); + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetGameServerInstanceStateResult::~FSetGameServerInstanceStateResult() +{ + +} + +void PlayFab::ServerModels::FSetGameServerInstanceStateResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetGameServerInstanceStateResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetGameServerInstanceTagsRequest::~FSetGameServerInstanceTagsRequest() +{ + +} + +void PlayFab::ServerModels::FSetGameServerInstanceTagsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("LobbyId")); writer->WriteValue(LobbyId); + + writer->WriteObjectStart(TEXT("Tags")); + for (TMap::TConstIterator It(Tags); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetGameServerInstanceTagsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr LobbyIdValue = obj->TryGetField(TEXT("LobbyId")); + if (LobbyIdValue.IsValid() && !LobbyIdValue->IsNull()) + { + FString TmpValue; + if (LobbyIdValue->TryGetString(TmpValue)) { LobbyId = TmpValue; } + } + + const TSharedPtr* TagsObject; + if (obj->TryGetObjectField(TEXT("Tags"), TagsObject)) + { + for (TMap>::TConstIterator It((*TagsObject)->Values); It; ++It) + { + Tags.Add(It.Key(), It.Value()->AsString()); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetGameServerInstanceTagsResult::~FSetGameServerInstanceTagsResult() +{ + +} + +void PlayFab::ServerModels::FSetGameServerInstanceTagsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetGameServerInstanceTagsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetPlayerSecretRequest::~FSetPlayerSecretRequest() +{ + +} + +void PlayFab::ServerModels::FSetPlayerSecretRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("PlayerSecret")); writer->WriteValue(PlayerSecret); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetPlayerSecretRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr PlayerSecretValue = obj->TryGetField(TEXT("PlayerSecret")); + if (PlayerSecretValue.IsValid() && !PlayerSecretValue->IsNull()) + { + FString TmpValue; + if (PlayerSecretValue->TryGetString(TmpValue)) { PlayerSecret = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetPlayerSecretResult::~FSetPlayerSecretResult() +{ + +} + +void PlayFab::ServerModels::FSetPlayerSecretResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetPlayerSecretResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetPublisherDataRequest::~FSetPublisherDataRequest() +{ + +} + +void PlayFab::ServerModels::FSetPublisherDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetPublisherDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetPublisherDataResult::~FSetPublisherDataResult() +{ + +} + +void PlayFab::ServerModels::FSetPublisherDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetPublisherDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetTitleDataRequest::~FSetTitleDataRequest() +{ + +} + +void PlayFab::ServerModels::FSetTitleDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Key")); writer->WriteValue(Key); + + if (Value.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetTitleDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr KeyValue = obj->TryGetField(TEXT("Key")); + if (KeyValue.IsValid() && !KeyValue->IsNull()) + { + FString TmpValue; + if (KeyValue->TryGetString(TmpValue)) { Key = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + FString TmpValue; + if (ValueValue->TryGetString(TmpValue)) { Value = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSetTitleDataResult::~FSetTitleDataResult() +{ + +} + +void PlayFab::ServerModels::FSetTitleDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSetTitleDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FStatisticUpdate::~FStatisticUpdate() +{ + +} + +void PlayFab::ServerModels::FStatisticUpdate::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("StatisticName")); writer->WriteValue(StatisticName); + + writer->WriteIdentifierPrefix(TEXT("Value")); writer->WriteValue(Value); + + if (Version.notNull()) { writer->WriteIdentifierPrefix(TEXT("Version")); writer->WriteValue(static_cast(Version)); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FStatisticUpdate::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr StatisticNameValue = obj->TryGetField(TEXT("StatisticName")); + if (StatisticNameValue.IsValid() && !StatisticNameValue->IsNull()) + { + FString TmpValue; + if (StatisticNameValue->TryGetString(TmpValue)) { StatisticName = TmpValue; } + } + + const TSharedPtr ValueValue = obj->TryGetField(TEXT("Value")); + if (ValueValue.IsValid() && !ValueValue->IsNull()) + { + int32 TmpValue; + if (ValueValue->TryGetNumber(TmpValue)) { Value = TmpValue; } + } + + const TSharedPtr VersionValue = obj->TryGetField(TEXT("Version")); + if (VersionValue.IsValid() && !VersionValue->IsNull()) + { + uint32 TmpValue; + if (VersionValue->TryGetNumber(TmpValue)) { Version = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSubtractCharacterVirtualCurrencyRequest::~FSubtractCharacterVirtualCurrencyRequest() +{ + +} + +void PlayFab::ServerModels::FSubtractCharacterVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSubtractCharacterVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FSubtractUserVirtualCurrencyRequest::~FSubtractUserVirtualCurrencyRequest() +{ + +} + +void PlayFab::ServerModels::FSubtractUserVirtualCurrencyRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("Amount")); writer->WriteValue(Amount); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteIdentifierPrefix(TEXT("VirtualCurrency")); writer->WriteValue(VirtualCurrency); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FSubtractUserVirtualCurrencyRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr AmountValue = obj->TryGetField(TEXT("Amount")); + if (AmountValue.IsValid() && !AmountValue->IsNull()) + { + int32 TmpValue; + if (AmountValue->TryGetNumber(TmpValue)) { Amount = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr VirtualCurrencyValue = obj->TryGetField(TEXT("VirtualCurrency")); + if (VirtualCurrencyValue.IsValid() && !VirtualCurrencyValue->IsNull()) + { + FString TmpValue; + if (VirtualCurrencyValue->TryGetString(TmpValue)) { VirtualCurrency = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUnlockContainerInstanceRequest::~FUnlockContainerInstanceRequest() +{ + +} + +void PlayFab::ServerModels::FUnlockContainerInstanceRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ContainerItemInstanceId")); writer->WriteValue(ContainerItemInstanceId); + + if (KeyItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("KeyItemInstanceId")); writer->WriteValue(KeyItemInstanceId); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUnlockContainerInstanceRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ContainerItemInstanceIdValue = obj->TryGetField(TEXT("ContainerItemInstanceId")); + if (ContainerItemInstanceIdValue.IsValid() && !ContainerItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ContainerItemInstanceIdValue->TryGetString(TmpValue)) { ContainerItemInstanceId = TmpValue; } + } + + const TSharedPtr KeyItemInstanceIdValue = obj->TryGetField(TEXT("KeyItemInstanceId")); + if (KeyItemInstanceIdValue.IsValid() && !KeyItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (KeyItemInstanceIdValue->TryGetString(TmpValue)) { KeyItemInstanceId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUnlockContainerItemRequest::~FUnlockContainerItemRequest() +{ + +} + +void PlayFab::ServerModels::FUnlockContainerItemRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CatalogVersion.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CatalogVersion")); writer->WriteValue(CatalogVersion); } + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + writer->WriteIdentifierPrefix(TEXT("ContainerItemId")); writer->WriteValue(ContainerItemId); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUnlockContainerItemRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CatalogVersionValue = obj->TryGetField(TEXT("CatalogVersion")); + if (CatalogVersionValue.IsValid() && !CatalogVersionValue->IsNull()) + { + FString TmpValue; + if (CatalogVersionValue->TryGetString(TmpValue)) { CatalogVersion = TmpValue; } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr ContainerItemIdValue = obj->TryGetField(TEXT("ContainerItemId")); + if (ContainerItemIdValue.IsValid() && !ContainerItemIdValue->IsNull()) + { + FString TmpValue; + if (ContainerItemIdValue->TryGetString(TmpValue)) { ContainerItemId = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUnlockContainerItemResult::~FUnlockContainerItemResult() +{ + +} + +void PlayFab::ServerModels::FUnlockContainerItemResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (GrantedItems.Num() != 0) + { + writer->WriteArrayStart(TEXT("GrantedItems")); + for (const FItemInstance& item : GrantedItems) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + if (UnlockedItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnlockedItemInstanceId")); writer->WriteValue(UnlockedItemInstanceId); } + + if (UnlockedWithItemInstanceId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("UnlockedWithItemInstanceId")); writer->WriteValue(UnlockedWithItemInstanceId); } + + if (VirtualCurrency.Num() != 0) + { + writer->WriteObjectStart(TEXT("VirtualCurrency")); + for (TMap::TConstIterator It(VirtualCurrency); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue(static_cast((*It).Value)); + } + writer->WriteObjectEnd(); + } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUnlockContainerItemResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&GrantedItemsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("GrantedItems")); + for (int32 Idx = 0; Idx < GrantedItemsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = GrantedItemsArray[Idx]; + GrantedItems.Add(FItemInstance(CurrentItem->AsObject())); + } + + + const TSharedPtr UnlockedItemInstanceIdValue = obj->TryGetField(TEXT("UnlockedItemInstanceId")); + if (UnlockedItemInstanceIdValue.IsValid() && !UnlockedItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (UnlockedItemInstanceIdValue->TryGetString(TmpValue)) { UnlockedItemInstanceId = TmpValue; } + } + + const TSharedPtr UnlockedWithItemInstanceIdValue = obj->TryGetField(TEXT("UnlockedWithItemInstanceId")); + if (UnlockedWithItemInstanceIdValue.IsValid() && !UnlockedWithItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (UnlockedWithItemInstanceIdValue->TryGetString(TmpValue)) { UnlockedWithItemInstanceId = TmpValue; } + } + + const TSharedPtr* VirtualCurrencyObject; + if (obj->TryGetObjectField(TEXT("VirtualCurrency"), VirtualCurrencyObject)) + { + for (TMap>::TConstIterator It((*VirtualCurrencyObject)->Values); It; ++It) + { + uint32 TmpValue; It.Value()->TryGetNumber(TmpValue); + VirtualCurrency.Add(It.Key(), TmpValue); + } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateAvatarUrlRequest::~FUpdateAvatarUrlRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateAvatarUrlRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("ImageUrl")); writer->WriteValue(ImageUrl); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateAvatarUrlRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ImageUrlValue = obj->TryGetField(TEXT("ImageUrl")); + if (ImageUrlValue.IsValid() && !ImageUrlValue->IsNull()) + { + FString TmpValue; + if (ImageUrlValue->TryGetString(TmpValue)) { ImageUrl = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateBanRequest::~FUpdateBanRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateBanRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Active.notNull()) { writer->WriteIdentifierPrefix(TEXT("Active")); writer->WriteValue(Active); } + + writer->WriteIdentifierPrefix(TEXT("BanId")); writer->WriteValue(BanId); + + if (Expires.notNull()) { writer->WriteIdentifierPrefix(TEXT("Expires")); writeDatetime(Expires, writer); } + + if (IPAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("IPAddress")); writer->WriteValue(IPAddress); } + + if (MACAddress.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("MACAddress")); writer->WriteValue(MACAddress); } + + if (Permanent.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permanent")); writer->WriteValue(Permanent); } + + if (Reason.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("Reason")); writer->WriteValue(Reason); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateBanRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ActiveValue = obj->TryGetField(TEXT("Active")); + if (ActiveValue.IsValid() && !ActiveValue->IsNull()) + { + bool TmpValue; + if (ActiveValue->TryGetBool(TmpValue)) { Active = TmpValue; } + } + + const TSharedPtr BanIdValue = obj->TryGetField(TEXT("BanId")); + if (BanIdValue.IsValid() && !BanIdValue->IsNull()) + { + FString TmpValue; + if (BanIdValue->TryGetString(TmpValue)) { BanId = TmpValue; } + } + + const TSharedPtr ExpiresValue = obj->TryGetField(TEXT("Expires")); + if (ExpiresValue.IsValid()) + Expires = readDatetime(ExpiresValue); + + + const TSharedPtr IPAddressValue = obj->TryGetField(TEXT("IPAddress")); + if (IPAddressValue.IsValid() && !IPAddressValue->IsNull()) + { + FString TmpValue; + if (IPAddressValue->TryGetString(TmpValue)) { IPAddress = TmpValue; } + } + + const TSharedPtr MACAddressValue = obj->TryGetField(TEXT("MACAddress")); + if (MACAddressValue.IsValid() && !MACAddressValue->IsNull()) + { + FString TmpValue; + if (MACAddressValue->TryGetString(TmpValue)) { MACAddress = TmpValue; } + } + + const TSharedPtr PermanentValue = obj->TryGetField(TEXT("Permanent")); + if (PermanentValue.IsValid() && !PermanentValue->IsNull()) + { + bool TmpValue; + if (PermanentValue->TryGetBool(TmpValue)) { Permanent = TmpValue; } + } + + const TSharedPtr ReasonValue = obj->TryGetField(TEXT("Reason")); + if (ReasonValue.IsValid() && !ReasonValue->IsNull()) + { + FString TmpValue; + if (ReasonValue->TryGetString(TmpValue)) { Reason = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateBansRequest::~FUpdateBansRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateBansRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteArrayStart(TEXT("Bans")); + for (const FUpdateBanRequest& item : Bans) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateBansRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BansArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Bans")); + for (int32 Idx = 0; Idx < BansArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BansArray[Idx]; + Bans.Add(FUpdateBanRequest(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateBansResult::~FUpdateBansResult() +{ + +} + +void PlayFab::ServerModels::FUpdateBansResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (BanData.Num() != 0) + { + writer->WriteArrayStart(TEXT("BanData")); + for (const FBanInfo& item : BanData) + item.writeJSON(writer); + writer->WriteArrayEnd(); + } + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateBansResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TArray>&BanDataArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("BanData")); + for (int32 Idx = 0; Idx < BanDataArray.Num(); Idx++) + { + TSharedPtr CurrentItem = BanDataArray[Idx]; + BanData.Add(FBanInfo(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateCharacterDataRequest::~FUpdateCharacterDataRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateCharacterDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateCharacterDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateCharacterDataResult::~FUpdateCharacterDataResult() +{ + +} + +void PlayFab::ServerModels::FUpdateCharacterDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateCharacterDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateCharacterStatisticsRequest::~FUpdateCharacterStatisticsRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateCharacterStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + if (CharacterStatistics.Num() != 0) + { + writer->WriteObjectStart(TEXT("CharacterStatistics")); + for (TMap::TConstIterator It(CharacterStatistics); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateCharacterStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* CharacterStatisticsObject; + if (obj->TryGetObjectField(TEXT("CharacterStatistics"), CharacterStatisticsObject)) + { + for (TMap>::TConstIterator It((*CharacterStatisticsObject)->Values); It; ++It) + { + int32 TmpValue; It.Value()->TryGetNumber(TmpValue); + CharacterStatistics.Add(It.Key(), TmpValue); + } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateCharacterStatisticsResult::~FUpdateCharacterStatisticsResult() +{ + +} + +void PlayFab::ServerModels::FUpdateCharacterStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateCharacterStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdatePlayerStatisticsRequest::~FUpdatePlayerStatisticsRequest() +{ + +} + +void PlayFab::ServerModels::FUpdatePlayerStatisticsRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (ForceUpdate.notNull()) { writer->WriteIdentifierPrefix(TEXT("ForceUpdate")); writer->WriteValue(ForceUpdate); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteArrayStart(TEXT("Statistics")); + for (const FStatisticUpdate& item : Statistics) + item.writeJSON(writer); + writer->WriteArrayEnd(); + + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdatePlayerStatisticsRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr ForceUpdateValue = obj->TryGetField(TEXT("ForceUpdate")); + if (ForceUpdateValue.IsValid() && !ForceUpdateValue->IsNull()) + { + bool TmpValue; + if (ForceUpdateValue->TryGetBool(TmpValue)) { ForceUpdate = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TArray>&StatisticsArray = FPlayFabJsonHelpers::ReadArray(obj, TEXT("Statistics")); + for (int32 Idx = 0; Idx < StatisticsArray.Num(); Idx++) + { + TSharedPtr CurrentItem = StatisticsArray[Idx]; + Statistics.Add(FStatisticUpdate(CurrentItem->AsObject())); + } + + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdatePlayerStatisticsResult::~FUpdatePlayerStatisticsResult() +{ + +} + +void PlayFab::ServerModels::FUpdatePlayerStatisticsResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdatePlayerStatisticsResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateSharedGroupDataRequest::~FUpdateSharedGroupDataRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateSharedGroupDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteIdentifierPrefix(TEXT("SharedGroupId")); writer->WriteValue(SharedGroupId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateSharedGroupDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr SharedGroupIdValue = obj->TryGetField(TEXT("SharedGroupId")); + if (SharedGroupIdValue.IsValid() && !SharedGroupIdValue->IsNull()) + { + FString TmpValue; + if (SharedGroupIdValue->TryGetString(TmpValue)) { SharedGroupId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateSharedGroupDataResult::~FUpdateSharedGroupDataResult() +{ + +} + +void PlayFab::ServerModels::FUpdateSharedGroupDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateSharedGroupDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateUserDataRequest::~FUpdateUserDataRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateUserDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + if (Permission.notNull()) { writer->WriteIdentifierPrefix(TEXT("Permission")); writeUserDataPermissionEnumJSON(Permission, writer); } + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateUserDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + Permission = readUserDataPermissionFromValue(obj->TryGetField(TEXT("Permission"))); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateUserDataResult::~FUpdateUserDataResult() +{ + +} + +void PlayFab::ServerModels::FUpdateUserDataResult::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + writer->WriteIdentifierPrefix(TEXT("DataVersion")); writer->WriteValue(static_cast(DataVersion)); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateUserDataResult::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr DataVersionValue = obj->TryGetField(TEXT("DataVersion")); + if (DataVersionValue.IsValid() && !DataVersionValue->IsNull()) + { + uint32 TmpValue; + if (DataVersionValue->TryGetNumber(TmpValue)) { DataVersion = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateUserInternalDataRequest::~FUpdateUserInternalDataRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateUserInternalDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateUserInternalDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FUpdateUserInventoryItemDataRequest::~FUpdateUserInventoryItemDataRequest() +{ + +} + +void PlayFab::ServerModels::FUpdateUserInventoryItemDataRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (CharacterId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); } + + if (Data.Num() != 0) + { + writer->WriteObjectStart(TEXT("Data")); + for (TMap::TConstIterator It(Data); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + writer->WriteValue((*It).Value); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("ItemInstanceId")); writer->WriteValue(ItemInstanceId); + + if (KeysToRemove.Num() != 0) + { + writer->WriteArrayStart(TEXT("KeysToRemove")); + for (const FString& item : KeysToRemove) + writer->WriteValue(item); + writer->WriteArrayEnd(); + } + + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FUpdateUserInventoryItemDataRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr* DataObject; + if (obj->TryGetObjectField(TEXT("Data"), DataObject)) + { + for (TMap>::TConstIterator It((*DataObject)->Values); It; ++It) + { + Data.Add(It.Key(), It.Value()->AsString()); + } + } + + const TSharedPtr ItemInstanceIdValue = obj->TryGetField(TEXT("ItemInstanceId")); + if (ItemInstanceIdValue.IsValid() && !ItemInstanceIdValue->IsNull()) + { + FString TmpValue; + if (ItemInstanceIdValue->TryGetString(TmpValue)) { ItemInstanceId = TmpValue; } + } + + obj->TryGetStringArrayField(TEXT("KeysToRemove"), KeysToRemove); + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FWriteEventResponse::~FWriteEventResponse() +{ + +} + +void PlayFab::ServerModels::FWriteEventResponse::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (EventId.IsEmpty() == false) { writer->WriteIdentifierPrefix(TEXT("EventId")); writer->WriteValue(EventId); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FWriteEventResponse::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr EventIdValue = obj->TryGetField(TEXT("EventId")); + if (EventIdValue.IsValid() && !EventIdValue->IsNull()) + { + FString TmpValue; + if (EventIdValue->TryGetString(TmpValue)) { EventId = TmpValue; } + } + + return HasSucceeded; +} + +PlayFab::ServerModels::FWriteServerCharacterEventRequest::~FWriteServerCharacterEventRequest() +{ + +} + +void PlayFab::ServerModels::FWriteServerCharacterEventRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.Num() != 0) + { + writer->WriteObjectStart(TEXT("Body")); + for (TMap::TConstIterator It(Body); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("CharacterId")); writer->WriteValue(CharacterId); + + writer->WriteIdentifierPrefix(TEXT("EventName")); writer->WriteValue(EventName); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FWriteServerCharacterEventRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* BodyObject; + if (obj->TryGetObjectField(TEXT("Body"), BodyObject)) + { + for (TMap>::TConstIterator It((*BodyObject)->Values); It; ++It) + { + Body.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + const TSharedPtr CharacterIdValue = obj->TryGetField(TEXT("CharacterId")); + if (CharacterIdValue.IsValid() && !CharacterIdValue->IsNull()) + { + FString TmpValue; + if (CharacterIdValue->TryGetString(TmpValue)) { CharacterId = TmpValue; } + } + + const TSharedPtr EventNameValue = obj->TryGetField(TEXT("EventName")); + if (EventNameValue.IsValid() && !EventNameValue->IsNull()) + { + FString TmpValue; + if (EventNameValue->TryGetString(TmpValue)) { EventName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + +PlayFab::ServerModels::FWriteServerPlayerEventRequest::~FWriteServerPlayerEventRequest() +{ + +} + +void PlayFab::ServerModels::FWriteServerPlayerEventRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.Num() != 0) + { + writer->WriteObjectStart(TEXT("Body")); + for (TMap::TConstIterator It(Body); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("EventName")); writer->WriteValue(EventName); + + writer->WriteIdentifierPrefix(TEXT("PlayFabId")); writer->WriteValue(PlayFabId); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FWriteServerPlayerEventRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* BodyObject; + if (obj->TryGetObjectField(TEXT("Body"), BodyObject)) + { + for (TMap>::TConstIterator It((*BodyObject)->Values); It; ++It) + { + Body.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + const TSharedPtr EventNameValue = obj->TryGetField(TEXT("EventName")); + if (EventNameValue.IsValid() && !EventNameValue->IsNull()) + { + FString TmpValue; + if (EventNameValue->TryGetString(TmpValue)) { EventName = TmpValue; } + } + + const TSharedPtr PlayFabIdValue = obj->TryGetField(TEXT("PlayFabId")); + if (PlayFabIdValue.IsValid() && !PlayFabIdValue->IsNull()) + { + FString TmpValue; + if (PlayFabIdValue->TryGetString(TmpValue)) { PlayFabId = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + +PlayFab::ServerModels::FWriteTitleEventRequest::~FWriteTitleEventRequest() +{ + +} + +void PlayFab::ServerModels::FWriteTitleEventRequest::writeJSON(JsonWriter& writer) const +{ + writer->WriteObjectStart(); + + if (Body.Num() != 0) + { + writer->WriteObjectStart(TEXT("Body")); + for (TMap::TConstIterator It(Body); It; ++It) + { + writer->WriteIdentifierPrefix((*It).Key); + (*It).Value.writeJSON(writer); + } + writer->WriteObjectEnd(); + } + + writer->WriteIdentifierPrefix(TEXT("EventName")); writer->WriteValue(EventName); + + if (Timestamp.notNull()) { writer->WriteIdentifierPrefix(TEXT("Timestamp")); writeDatetime(Timestamp, writer); } + + writer->WriteObjectEnd(); +} + +bool PlayFab::ServerModels::FWriteTitleEventRequest::readFromValue(const TSharedPtr& obj) +{ + bool HasSucceeded = true; + + const TSharedPtr* BodyObject; + if (obj->TryGetObjectField(TEXT("Body"), BodyObject)) + { + for (TMap>::TConstIterator It((*BodyObject)->Values); It; ++It) + { + Body.Add(It.Key(), FJsonKeeper(It.Value())); + } + } + + const TSharedPtr EventNameValue = obj->TryGetField(TEXT("EventName")); + if (EventNameValue.IsValid() && !EventNameValue->IsNull()) + { + FString TmpValue; + if (EventNameValue->TryGetString(TmpValue)) { EventName = TmpValue; } + } + + const TSharedPtr TimestampValue = obj->TryGetField(TEXT("Timestamp")); + if (TimestampValue.IsValid()) + Timestamp = readDatetime(TimestampValue); + + + return HasSucceeded; +} + diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabSettings.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabSettings.cpp new file mode 100644 index 000000000..14c92e81a --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/Core/PlayFabSettings.cpp @@ -0,0 +1,97 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFabSettings.h" +#include "PlayFabCommon.h" + +namespace PlayFab +{ + const FString PlayFabSettings::sdkVersion = IPlayFabCommonModuleInterface::Get().GetSdkVersion(); + const FString PlayFabSettings::buildIdentifier = IPlayFabCommonModuleInterface::Get().GetBuildIdentifier(); + const FString PlayFabSettings::versionString = IPlayFabCommonModuleInterface::Get().GetVersionString(); + + const FString PlayFabSettings::AD_TYPE_IDFA = IPlayFabCommonModuleInterface::Get().GetAD_TYPE_IDFA(); + const FString PlayFabSettings::AD_TYPE_ANDROID_ID = IPlayFabCommonModuleInterface::Get().GetAD_TYPE_ANDROID_ID(); + + // Getters + FString PlayFabSettings::GetServerURL() + { + return IPlayFabCommonModuleInterface::Get().GetServerURL(); + } + FString PlayFabSettings::GetProductionEnvironmentURL() + { + return IPlayFabCommonModuleInterface::Get().GetProductionEnvironmentURL(); + } + FString PlayFabSettings::GetTitleId() + { + return IPlayFabCommonModuleInterface::Get().GetTitleId(); + } + FString PlayFabSettings::GetClientSessionTicket() + { + return IPlayFabCommonModuleInterface::Get().GetClientSessionTicket(); + } + FString PlayFabSettings::GetDeveloperSecretKey() + { + return IPlayFabCommonModuleInterface::Get().GetDeveloperSecretKey(); + } + FString PlayFabSettings::GetEntityToken() + { + return IPlayFabCommonModuleInterface::Get().GetEntityToken(); + } + FString PlayFabSettings::GetAdvertisingIdType() + { + return IPlayFabCommonModuleInterface::Get().GetAdvertisingIdType(); + } + FString PlayFabSettings::GetAdvertisingIdValue() + { + return IPlayFabCommonModuleInterface::Get().GetAdvertisingIdValue(); + } + bool PlayFabSettings::GetDisableAdvertising() + { + return IPlayFabCommonModuleInterface::Get().GetDisableAdvertising(); + } + FString PlayFabSettings::GetUrl(const FString& callPath) + { + return IPlayFabCommonModuleInterface::Get().GetUrl(callPath); + } + + // Setters + void PlayFabSettings::SetServerURL(const FString& serverURL) + { + IPlayFabCommonModuleInterface::Get().SetServerURL(serverURL); + } + void PlayFabSettings::SetProductionEnvironmentURL(const FString& productionEnvironmentURL) + { + IPlayFabCommonModuleInterface::Get().SetProductionEnvironmentURL(productionEnvironmentURL); + } + void PlayFabSettings::SetTitleId(const FString& titleId) + { + IPlayFabCommonModuleInterface::Get().SetTitleId(titleId); + } + void PlayFabSettings::SetClientSessionTicket(const FString& clientSessionTicket) + { + IPlayFabCommonModuleInterface::Get().SetClientSessionTicket(clientSessionTicket); + } + void PlayFabSettings::SetDeveloperSecretKey(const FString& developerSecretKey) + { + IPlayFabCommonModuleInterface::Get().SetDeveloperSecretKey(developerSecretKey); + } + void PlayFabSettings::SetEntityToken(const FString& entityToken) + { + IPlayFabCommonModuleInterface::Get().SetEntityToken(entityToken); + } + void PlayFabSettings::SetAdvertisingIdType(const FString& advertisingIdType) + { + IPlayFabCommonModuleInterface::Get().SetAdvertisingIdType(advertisingIdType); + } + void PlayFabSettings::SetAdvertisingIdValue(const FString& advertisingIdValue) + { + IPlayFabCommonModuleInterface::Get().SetAdvertisingIdValue(advertisingIdValue); + } + void PlayFabSettings::SetDisableAdvertising(bool disableAdvertising) + { + IPlayFabCommonModuleInterface::Get().SetDisableAdvertising(disableAdvertising); + } +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/PlayFab.cpp b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/PlayFab.cpp new file mode 100644 index 000000000..b8c1bb817 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Private/PlayFab.cpp @@ -0,0 +1,82 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#include "PlayFab.h" + +#include "PlayFabSettings.h" + +// Api's +#include "Core/PlayFabAdminAPI.h" +#include "Core/PlayFabClientAPI.h" +#include "Core/PlayFabMatchmakerAPI.h" +#include "Core/PlayFabServerAPI.h" +#include "Core/PlayFabAuthenticationAPI.h" +#include "Core/PlayFabCloudScriptAPI.h" +#include "Core/PlayFabDataAPI.h" +#include "Core/PlayFabEventsAPI.h" +#include "Core/PlayFabGroupsAPI.h" +#include "Core/PlayFabLocalizationAPI.h" +#include "Core/PlayFabProfilesAPI.h" + +DEFINE_LOG_CATEGORY(LogPlayFab); + +class FPlayFabModule : public IPlayFabModuleInterface +{ + /** IModuleInterface implementation */ + virtual void StartupModule() override; + virtual void ShutdownModule() override; + + FString GetTitleId() const override { return PlayFab::PlayFabSettings::GetTitleId(); }; + + PlayFabAdminPtr GetAdminAPI() const override { return AdminAPI; }; + PlayFabClientPtr GetClientAPI() const override { return ClientAPI; }; + PlayFabMatchmakerPtr GetMatchmakerAPI() const override { return MatchmakerAPI; }; + PlayFabServerPtr GetServerAPI() const override { return ServerAPI; }; + PlayFabAuthenticationPtr GetAuthenticationAPI() const override { return AuthenticationAPI; }; + PlayFabCloudScriptPtr GetCloudScriptAPI() const override { return CloudScriptAPI; }; + PlayFabDataPtr GetDataAPI() const override { return DataAPI; }; + PlayFabEventsPtr GetEventsAPI() const override { return EventsAPI; }; + PlayFabGroupsPtr GetGroupsAPI() const override { return GroupsAPI; }; + PlayFabLocalizationPtr GetLocalizationAPI() const override { return LocalizationAPI; }; + PlayFabProfilesPtr GetProfilesAPI() const override { return ProfilesAPI; }; + + PlayFabAdminPtr AdminAPI; + PlayFabClientPtr ClientAPI; + PlayFabMatchmakerPtr MatchmakerAPI; + PlayFabServerPtr ServerAPI; + PlayFabAuthenticationPtr AuthenticationAPI; + PlayFabCloudScriptPtr CloudScriptAPI; + PlayFabDataPtr DataAPI; + PlayFabEventsPtr EventsAPI; + PlayFabGroupsPtr GroupsAPI; + PlayFabLocalizationPtr LocalizationAPI; + PlayFabProfilesPtr ProfilesAPI; + + +}; + +void FPlayFabModule::StartupModule() +{ + // create the API + + AdminAPI = MakeShareable(new PlayFab::UPlayFabAdminAPI()); + ClientAPI = MakeShareable(new PlayFab::UPlayFabClientAPI()); + MatchmakerAPI = MakeShareable(new PlayFab::UPlayFabMatchmakerAPI()); + ServerAPI = MakeShareable(new PlayFab::UPlayFabServerAPI()); + AuthenticationAPI = MakeShareable(new PlayFab::UPlayFabAuthenticationAPI()); + CloudScriptAPI = MakeShareable(new PlayFab::UPlayFabCloudScriptAPI()); + DataAPI = MakeShareable(new PlayFab::UPlayFabDataAPI()); + EventsAPI = MakeShareable(new PlayFab::UPlayFabEventsAPI()); + GroupsAPI = MakeShareable(new PlayFab::UPlayFabGroupsAPI()); + LocalizationAPI = MakeShareable(new PlayFab::UPlayFabLocalizationAPI()); + ProfilesAPI = MakeShareable(new PlayFab::UPlayFabProfilesAPI()); +} + +void FPlayFabModule::ShutdownModule() +{ + +} + +IMPLEMENT_MODULE(FPlayFabModule, PlayFabCpp) diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAdminAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAdminAPI.h new file mode 100644 index 000000000..9230e8add --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAdminAPI.h @@ -0,0 +1,735 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabAdminDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabAdminAPI + { + public: + DECLARE_DELEGATE_OneParam(FAbortTaskInstanceDelegate, const AdminModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FAddNewsDelegate, const AdminModels::FAddNewsResult&); + DECLARE_DELEGATE_OneParam(FAddPlayerTagDelegate, const AdminModels::FAddPlayerTagResult&); + DECLARE_DELEGATE_OneParam(FAddServerBuildDelegate, const AdminModels::FAddServerBuildResult&); + DECLARE_DELEGATE_OneParam(FAddUserVirtualCurrencyDelegate, const AdminModels::FModifyUserVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FAddVirtualCurrencyTypesDelegate, const AdminModels::FBlankResult&); + DECLARE_DELEGATE_OneParam(FBanUsersDelegate, const AdminModels::FBanUsersResult&); + DECLARE_DELEGATE_OneParam(FCheckLimitedEditionItemAvailabilityDelegate, const AdminModels::FCheckLimitedEditionItemAvailabilityResult&); + DECLARE_DELEGATE_OneParam(FCreateActionsOnPlayersInSegmentTaskDelegate, const AdminModels::FCreateTaskResult&); + DECLARE_DELEGATE_OneParam(FCreateCloudScriptTaskDelegate, const AdminModels::FCreateTaskResult&); + DECLARE_DELEGATE_OneParam(FCreatePlayerSharedSecretDelegate, const AdminModels::FCreatePlayerSharedSecretResult&); + DECLARE_DELEGATE_OneParam(FCreatePlayerStatisticDefinitionDelegate, const AdminModels::FCreatePlayerStatisticDefinitionResult&); + DECLARE_DELEGATE_OneParam(FDeleteContentDelegate, const AdminModels::FBlankResult&); + DECLARE_DELEGATE_OneParam(FDeleteMasterPlayerAccountDelegate, const AdminModels::FDeleteMasterPlayerAccountResult&); + DECLARE_DELEGATE_OneParam(FDeletePlayerDelegate, const AdminModels::FDeletePlayerResult&); + DECLARE_DELEGATE_OneParam(FDeletePlayerSharedSecretDelegate, const AdminModels::FDeletePlayerSharedSecretResult&); + DECLARE_DELEGATE_OneParam(FDeleteStoreDelegate, const AdminModels::FDeleteStoreResult&); + DECLARE_DELEGATE_OneParam(FDeleteTaskDelegate, const AdminModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FDeleteTitleDelegate, const AdminModels::FDeleteTitleResult&); + DECLARE_DELEGATE_OneParam(FExportMasterPlayerDataDelegate, const AdminModels::FExportMasterPlayerDataResult&); + DECLARE_DELEGATE_OneParam(FGetActionsOnPlayersInSegmentTaskInstanceDelegate, const AdminModels::FGetActionsOnPlayersInSegmentTaskInstanceResult&); + DECLARE_DELEGATE_OneParam(FGetAllSegmentsDelegate, const AdminModels::FGetAllSegmentsResult&); + DECLARE_DELEGATE_OneParam(FGetCatalogItemsDelegate, const AdminModels::FGetCatalogItemsResult&); + DECLARE_DELEGATE_OneParam(FGetCloudScriptRevisionDelegate, const AdminModels::FGetCloudScriptRevisionResult&); + DECLARE_DELEGATE_OneParam(FGetCloudScriptTaskInstanceDelegate, const AdminModels::FGetCloudScriptTaskInstanceResult&); + DECLARE_DELEGATE_OneParam(FGetCloudScriptVersionsDelegate, const AdminModels::FGetCloudScriptVersionsResult&); + DECLARE_DELEGATE_OneParam(FGetContentListDelegate, const AdminModels::FGetContentListResult&); + DECLARE_DELEGATE_OneParam(FGetContentUploadUrlDelegate, const AdminModels::FGetContentUploadUrlResult&); + DECLARE_DELEGATE_OneParam(FGetDataReportDelegate, const AdminModels::FGetDataReportResult&); + DECLARE_DELEGATE_OneParam(FGetMatchmakerGameInfoDelegate, const AdminModels::FGetMatchmakerGameInfoResult&); + DECLARE_DELEGATE_OneParam(FGetMatchmakerGameModesDelegate, const AdminModels::FGetMatchmakerGameModesResult&); + DECLARE_DELEGATE_OneParam(FGetPlayedTitleListDelegate, const AdminModels::FGetPlayedTitleListResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerIdFromAuthTokenDelegate, const AdminModels::FGetPlayerIdFromAuthTokenResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerProfileDelegate, const AdminModels::FGetPlayerProfileResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerSegmentsDelegate, const AdminModels::FGetPlayerSegmentsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerSharedSecretsDelegate, const AdminModels::FGetPlayerSharedSecretsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayersInSegmentDelegate, const AdminModels::FGetPlayersInSegmentResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerStatisticDefinitionsDelegate, const AdminModels::FGetPlayerStatisticDefinitionsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerStatisticVersionsDelegate, const AdminModels::FGetPlayerStatisticVersionsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerTagsDelegate, const AdminModels::FGetPlayerTagsResult&); + DECLARE_DELEGATE_OneParam(FGetPolicyDelegate, const AdminModels::FGetPolicyResponse&); + DECLARE_DELEGATE_OneParam(FGetPublisherDataDelegate, const AdminModels::FGetPublisherDataResult&); + DECLARE_DELEGATE_OneParam(FGetRandomResultTablesDelegate, const AdminModels::FGetRandomResultTablesResult&); + DECLARE_DELEGATE_OneParam(FGetServerBuildInfoDelegate, const AdminModels::FGetServerBuildInfoResult&); + DECLARE_DELEGATE_OneParam(FGetServerBuildUploadUrlDelegate, const AdminModels::FGetServerBuildUploadURLResult&); + DECLARE_DELEGATE_OneParam(FGetStoreItemsDelegate, const AdminModels::FGetStoreItemsResult&); + DECLARE_DELEGATE_OneParam(FGetTaskInstancesDelegate, const AdminModels::FGetTaskInstancesResult&); + DECLARE_DELEGATE_OneParam(FGetTasksDelegate, const AdminModels::FGetTasksResult&); + DECLARE_DELEGATE_OneParam(FGetTitleDataDelegate, const AdminModels::FGetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FGetTitleInternalDataDelegate, const AdminModels::FGetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserAccountInfoDelegate, const AdminModels::FLookupUserAccountInfoResult&); + DECLARE_DELEGATE_OneParam(FGetUserBansDelegate, const AdminModels::FGetUserBansResult&); + DECLARE_DELEGATE_OneParam(FGetUserDataDelegate, const AdminModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserInternalDataDelegate, const AdminModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserInventoryDelegate, const AdminModels::FGetUserInventoryResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherDataDelegate, const AdminModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherInternalDataDelegate, const AdminModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherReadOnlyDataDelegate, const AdminModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserReadOnlyDataDelegate, const AdminModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGrantItemsToUsersDelegate, const AdminModels::FGrantItemsToUsersResult&); + DECLARE_DELEGATE_OneParam(FIncrementLimitedEditionItemAvailabilityDelegate, const AdminModels::FIncrementLimitedEditionItemAvailabilityResult&); + DECLARE_DELEGATE_OneParam(FIncrementPlayerStatisticVersionDelegate, const AdminModels::FIncrementPlayerStatisticVersionResult&); + DECLARE_DELEGATE_OneParam(FListServerBuildsDelegate, const AdminModels::FListBuildsResult&); + DECLARE_DELEGATE_OneParam(FListVirtualCurrencyTypesDelegate, const AdminModels::FListVirtualCurrencyTypesResult&); + DECLARE_DELEGATE_OneParam(FModifyMatchmakerGameModesDelegate, const AdminModels::FModifyMatchmakerGameModesResult&); + DECLARE_DELEGATE_OneParam(FModifyServerBuildDelegate, const AdminModels::FModifyServerBuildResult&); + DECLARE_DELEGATE_OneParam(FRefundPurchaseDelegate, const AdminModels::FRefundPurchaseResponse&); + DECLARE_DELEGATE_OneParam(FRemovePlayerTagDelegate, const AdminModels::FRemovePlayerTagResult&); + DECLARE_DELEGATE_OneParam(FRemoveServerBuildDelegate, const AdminModels::FRemoveServerBuildResult&); + DECLARE_DELEGATE_OneParam(FRemoveVirtualCurrencyTypesDelegate, const AdminModels::FBlankResult&); + DECLARE_DELEGATE_OneParam(FResetCharacterStatisticsDelegate, const AdminModels::FResetCharacterStatisticsResult&); + DECLARE_DELEGATE_OneParam(FResetPasswordDelegate, const AdminModels::FResetPasswordResult&); + DECLARE_DELEGATE_OneParam(FResetUserStatisticsDelegate, const AdminModels::FResetUserStatisticsResult&); + DECLARE_DELEGATE_OneParam(FResolvePurchaseDisputeDelegate, const AdminModels::FResolvePurchaseDisputeResponse&); + DECLARE_DELEGATE_OneParam(FRevokeAllBansForUserDelegate, const AdminModels::FRevokeAllBansForUserResult&); + DECLARE_DELEGATE_OneParam(FRevokeBansDelegate, const AdminModels::FRevokeBansResult&); + DECLARE_DELEGATE_OneParam(FRevokeInventoryItemDelegate, const AdminModels::FRevokeInventoryResult&); + DECLARE_DELEGATE_OneParam(FRevokeInventoryItemsDelegate, const AdminModels::FRevokeInventoryItemsResult&); + DECLARE_DELEGATE_OneParam(FRunTaskDelegate, const AdminModels::FRunTaskResult&); + DECLARE_DELEGATE_OneParam(FSendAccountRecoveryEmailDelegate, const AdminModels::FSendAccountRecoveryEmailResult&); + DECLARE_DELEGATE_OneParam(FSetCatalogItemsDelegate, const AdminModels::FUpdateCatalogItemsResult&); + DECLARE_DELEGATE_OneParam(FSetPlayerSecretDelegate, const AdminModels::FSetPlayerSecretResult&); + DECLARE_DELEGATE_OneParam(FSetPublishedRevisionDelegate, const AdminModels::FSetPublishedRevisionResult&); + DECLARE_DELEGATE_OneParam(FSetPublisherDataDelegate, const AdminModels::FSetPublisherDataResult&); + DECLARE_DELEGATE_OneParam(FSetStoreItemsDelegate, const AdminModels::FUpdateStoreItemsResult&); + DECLARE_DELEGATE_OneParam(FSetTitleDataDelegate, const AdminModels::FSetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FSetTitleInternalDataDelegate, const AdminModels::FSetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FSetupPushNotificationDelegate, const AdminModels::FSetupPushNotificationResult&); + DECLARE_DELEGATE_OneParam(FSubtractUserVirtualCurrencyDelegate, const AdminModels::FModifyUserVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FUpdateBansDelegate, const AdminModels::FUpdateBansResult&); + DECLARE_DELEGATE_OneParam(FUpdateCatalogItemsDelegate, const AdminModels::FUpdateCatalogItemsResult&); + DECLARE_DELEGATE_OneParam(FUpdateCloudScriptDelegate, const AdminModels::FUpdateCloudScriptResult&); + DECLARE_DELEGATE_OneParam(FUpdatePlayerSharedSecretDelegate, const AdminModels::FUpdatePlayerSharedSecretResult&); + DECLARE_DELEGATE_OneParam(FUpdatePlayerStatisticDefinitionDelegate, const AdminModels::FUpdatePlayerStatisticDefinitionResult&); + DECLARE_DELEGATE_OneParam(FUpdatePolicyDelegate, const AdminModels::FUpdatePolicyResponse&); + DECLARE_DELEGATE_OneParam(FUpdateRandomResultTablesDelegate, const AdminModels::FUpdateRandomResultTablesResult&); + DECLARE_DELEGATE_OneParam(FUpdateStoreItemsDelegate, const AdminModels::FUpdateStoreItemsResult&); + DECLARE_DELEGATE_OneParam(FUpdateTaskDelegate, const AdminModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FUpdateUserDataDelegate, const AdminModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserInternalDataDelegate, const AdminModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherDataDelegate, const AdminModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherInternalDataDelegate, const AdminModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherReadOnlyDataDelegate, const AdminModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserReadOnlyDataDelegate, const AdminModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserTitleDisplayNameDelegate, const AdminModels::FUpdateUserTitleDisplayNameResult&); + + UPlayFabAdminAPI(); + ~UPlayFabAdminAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Abort an ongoing task instance. + * If the task instance has already completed, there will be no-op. + */ + bool AbortTaskInstance(AdminModels::FAbortTaskInstanceRequest& request, const FAbortTaskInstanceDelegate& SuccessDelegate = FAbortTaskInstanceDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Adds a new news item to the title's news feed + bool AddNews(AdminModels::FAddNewsRequest& request, const FAddNewsDelegate& SuccessDelegate = FAddNewsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + * This API will trigger a player_tag_added event and add a tag with the given TagName and PlayFabID to the corresponding player profile. TagName can be used for segmentation and it is limited to 256 characters. Also there is a limit on the number of tags a title can have. + */ + bool AddPlayerTag(AdminModels::FAddPlayerTagRequest& request, const FAddPlayerTagDelegate& SuccessDelegate = FAddPlayerTagDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the game server executable specified (previously uploaded - see GetServerBuildUploadUrl) to the set of those a + * client is permitted to request in a call to StartGame + */ + bool AddServerBuild(AdminModels::FAddServerBuildRequest& request, const FAddServerBuildDelegate& SuccessDelegate = FAddServerBuildDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Increments the specified virtual currency by the stated amount + bool AddUserVirtualCurrency(AdminModels::FAddUserVirtualCurrencyRequest& request, const FAddUserVirtualCurrencyDelegate& SuccessDelegate = FAddUserVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds one or more virtual currencies to the set defined for the title. Virtual Currencies have a maximum value of + * 2,147,483,647 when granted to a player. Any value over that will be discarded. + * This operation is additive. Any new currencies defined in the array will be added to the set of those available for the title, while any CurrencyCode identifiers matching existing ones in the game will be overwritten with the new values. + */ + bool AddVirtualCurrencyTypes(AdminModels::FAddVirtualCurrencyTypesRequest& request, const FAddVirtualCurrencyTypesDelegate& SuccessDelegate = FAddVirtualCurrencyTypesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + * The existence of each user will not be verified. When banning by IP or MAC address, multiple players may be affected, so use this feature with caution. Returns information about the new bans. + */ + bool BanUsers(AdminModels::FBanUsersRequest& request, const FBanUsersDelegate& SuccessDelegate = FBanUsersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Checks the global count for the limited edition item. + * This returns the total number of these items available. + */ + bool CheckLimitedEditionItemAvailability(AdminModels::FCheckLimitedEditionItemAvailabilityRequest& request, const FCheckLimitedEditionItemAvailabilityDelegate& SuccessDelegate = FCheckLimitedEditionItemAvailabilityDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Create an ActionsOnPlayersInSegment task, which iterates through all players in a segment to execute action. + * Task name is unique within a title. Using a task name that's already taken will cause a name conflict error. Too many create-task requests within a short time will cause a create conflict error. + */ + bool CreateActionsOnPlayersInSegmentTask(AdminModels::FCreateActionsOnPlayerSegmentTaskRequest& request, const FCreateActionsOnPlayersInSegmentTaskDelegate& SuccessDelegate = FCreateActionsOnPlayersInSegmentTaskDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Create a CloudScript task, which can run a CloudScript on a schedule. + * Task name is unique within a title. Using a task name that's already taken will cause a name conflict error. Too many create-task requests within a short time will cause a create conflict error. + */ + bool CreateCloudScriptTask(AdminModels::FCreateCloudScriptTaskRequest& request, const FCreateCloudScriptTaskDelegate& SuccessDelegate = FCreateCloudScriptTaskDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates a new Player Shared Secret Key. It may take up to 5 minutes for this key to become generally available after + * this API returns. + * Player Shared Secret Keys are used for the call to Client/GetTitlePublicKey, which exchanges the shared secret for an RSA CSP blob to be used to encrypt the payload of account creation requests when that API requires a signature header. + */ + bool CreatePlayerSharedSecret(AdminModels::FCreatePlayerSharedSecretRequest& request, const FCreatePlayerSharedSecretDelegate& SuccessDelegate = FCreatePlayerSharedSecretDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds a new player statistic configuration to the title, optionally allowing the developer to specify a reset interval + * and an aggregation method. + * Statistics are numeric values, with each statistic in the title also generating a leaderboard. The ResetInterval enables automatically resetting leaderboards on a specified interval. Upon reset, the statistic updates to a new version with no values (effectively removing all players from the leaderboard). The previous version's statistic values are also archived for retrieval, if needed (see GetPlayerStatisticVersions). Statistics not created via a call to CreatePlayerStatisticDefinition by default have a VersionChangeInterval of Never, meaning they do not reset on a schedule, but they can be set to do so via a call to UpdatePlayerStatisticDefinition. Once a statistic has been reset (sometimes referred to as versioned or incremented), the now-previous version can still be written to for up a short, pre-defined period (currently 10 seconds), to prevent issues with levels completing around the time of the reset. Also, once reset, the historical statistics for players in the title may be retrieved using the URL specified in the version information (GetPlayerStatisticVersions). The AggregationMethod determines what action is taken when a new statistic value is submitted - always update with the new value (Last), use the highest of the old and new values (Max), use the smallest (Min), or add them together (Sum). + */ + bool CreatePlayerStatisticDefinition(AdminModels::FCreatePlayerStatisticDefinitionRequest& request, const FCreatePlayerStatisticDefinitionDelegate& SuccessDelegate = FCreatePlayerStatisticDefinitionDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Delete a content file from the title. When deleting a file that does not exist, it returns success. + bool DeleteContent(AdminModels::FDeleteContentRequest& request, const FDeleteContentDelegate& SuccessDelegate = FDeleteContentDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes a master player account entirely from all titles and deletes all associated data + * Deletes all data associated with the master player account, including data from all titles the player has played, such as statistics, custom data, inventory, purchases, virtual currency balances, characters, group memberships, publisher data, credential data, account linkages, friends list and PlayStream event history. Removes the player from all leaderboards and player search indexes. Note, this API queues the player for deletion and returns a receipt immediately. Record the receipt ID for future reference. It may take some time before all player data is fully deleted. Upon completion of the deletion, an email will be sent to the notification email address configured for the title confirming the deletion. Until the player data is fully deleted, attempts to recreate the player with the same user account in the same title will fail with the 'AccountDeleted' error. It is highly recommended to know the impact of the deletion by calling GetPlayedTitleList, before calling this API. + */ + bool DeleteMasterPlayerAccount(AdminModels::FDeleteMasterPlayerAccountRequest& request, const FDeleteMasterPlayerAccountDelegate& SuccessDelegate = FDeleteMasterPlayerAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes a user's player account from a title and deletes all associated data + * Deletes all data associated with the player, including statistics, custom data, inventory, purchases, virtual currency balances, characters and shared group memberships. Removes the player from all leaderboards and player search indexes. Does not delete PlayStream event history associated with the player. Does not delete the publisher user account that created the player in the title nor associated data such as username, password, email address, account linkages, or friends list. Note, this API queues the player for deletion and returns immediately. It may take several minutes or more before all player data is fully deleted. Until the player data is fully deleted, attempts to recreate the player with the same user account in the same title will fail with the 'AccountDeleted' error. + */ + bool DeletePlayer(AdminModels::FDeletePlayerRequest& request, const FDeletePlayerDelegate& SuccessDelegate = FDeletePlayerDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes an existing Player Shared Secret Key. It may take up to 5 minutes for this delete to be reflected after this API + * returns. + * Player Shared Secret Keys are used for the call to Client/GetTitlePublicKey, which exchanges the shared secret for an RSA CSP blob to be used to encrypt the payload of account creation requests when that API requires a signature header. + */ + bool DeletePlayerSharedSecret(AdminModels::FDeletePlayerSharedSecretRequest& request, const FDeletePlayerSharedSecretDelegate& SuccessDelegate = FDeletePlayerSharedSecretDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes an existing virtual item store + * This non-reversible operation will permanently delete the requested store. + */ + bool DeleteStore(AdminModels::FDeleteStoreRequest& request, const FDeleteStoreDelegate& SuccessDelegate = FDeleteStoreDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Delete a task. + * After a task is deleted, for tracking purposes, the task instances belonging to this task will still remain. They will become orphaned and does not belongs to any task. Executions of any in-progress task instances will continue. If the task specified does not exist, the deletion is considered a success. + */ + bool DeleteTask(AdminModels::FDeleteTaskRequest& request, const FDeleteTaskDelegate& SuccessDelegate = FDeleteTaskDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Permanently deletes a title and all associated configuration + * Deletes all data associated with the title, including catalog, virtual currencies, leaderboard statistics, Cloud Script revisions, segment definitions, event rules, tasks, add-ons, secret keys, data encryption keys, and permission policies. Removes the title from its studio and removes all associated developer roles and permissions. Does not delete PlayStream event history associated with the title. Note, this API queues the title for deletion and returns immediately. It may take several hours or more before all title data is fully deleted. All player accounts in the title must be deleted before deleting the title. If any player accounts exist, the API will return a 'TitleContainsUserAccounts' error. Until the title data is fully deleted, attempts to call APIs with the title will fail with the 'TitleDeleted' error. + */ + + bool DeleteTitle(const FDeleteTitleDelegate& SuccessDelegate = FDeleteTitleDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Exports all associated data of a master player account + * Exports all data associated with the master player account, including data from all titles the player has played, such as statistics, custom data, inventory, purchases, virtual currency balances, characters, group memberships, publisher data, credential data, account linkages, friends list and PlayStream event history. Note, this API queues the player for export and returns a receipt immediately. Record the receipt ID for future reference. It may take some time before the export is available for download. Upon completion of the export, an email containing the URL to download the export dump will be sent to the notification email address configured for the title. + */ + bool ExportMasterPlayerData(AdminModels::FExportMasterPlayerDataRequest& request, const FExportMasterPlayerDataDelegate& SuccessDelegate = FExportMasterPlayerDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Get information about a ActionsOnPlayersInSegment task instance. + * The result includes detail information that's specific to an ActionsOnPlayersInSegment task. To get a list of task instances with generic basic information, use GetTaskInstances. + */ + bool GetActionsOnPlayersInSegmentTaskInstance(AdminModels::FGetTaskInstanceRequest& request, const FGetActionsOnPlayersInSegmentTaskInstanceDelegate& SuccessDelegate = FGetActionsOnPlayersInSegmentTaskInstanceDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as + * GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. + * Request has no paramaters. + */ + + bool GetAllSegments(const FGetAllSegmentsDelegate& SuccessDelegate = FGetAllSegmentsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the specified version of the title's catalog of virtual goods, including all defined properties + bool GetCatalogItems(AdminModels::FGetCatalogItemsRequest& request, const FGetCatalogItemsDelegate& SuccessDelegate = FGetCatalogItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Gets the contents and information of a specific Cloud Script revision. + bool GetCloudScriptRevision(AdminModels::FGetCloudScriptRevisionRequest& request, const FGetCloudScriptRevisionDelegate& SuccessDelegate = FGetCloudScriptRevisionDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Get detail information about a CloudScript task instance. + * The result includes detail information that's specific to a CloudScript tasks. To get a list of task instances with generic basic information, use GetTaskInstances. + */ + bool GetCloudScriptTaskInstance(AdminModels::FGetTaskInstanceRequest& request, const FGetCloudScriptTaskInstanceDelegate& SuccessDelegate = FGetCloudScriptTaskInstanceDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all the current cloud script versions. For each version, information about the current published and latest + * revisions is also listed. + */ + + bool GetCloudScriptVersions(const FGetCloudScriptVersionsDelegate& SuccessDelegate = FGetCloudScriptVersionsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // List all contents of the title and get statistics such as size + bool GetContentList(AdminModels::FGetContentListRequest& request, const FGetContentListDelegate& SuccessDelegate = FGetContentListDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the pre-signed URL for uploading a content file. A subsequent HTTP PUT to the returned URL uploads the + * content. Also, please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN + * rates apply. + */ + bool GetContentUploadUrl(AdminModels::FGetContentUploadUrlRequest& request, const FGetContentUploadUrlDelegate& SuccessDelegate = FGetContentUploadUrlDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves a download URL for the requested report + * Gets the download URL for the requested report data (in CSV form). The reports available through this API call are those available in the Game Manager, in the Analytics->Reports tab. + */ + bool GetDataReport(AdminModels::FGetDataReportRequest& request, const FGetDataReportDelegate& SuccessDelegate = FGetDataReportDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the details for a specific completed session, including links to standard out and standard error logs + bool GetMatchmakerGameInfo(AdminModels::FGetMatchmakerGameInfoRequest& request, const FGetMatchmakerGameInfoDelegate& SuccessDelegate = FGetMatchmakerGameInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the details of defined game modes for the specified game server executable + * These details are used by the PlayFab matchmaking service to determine if an existing Game Server Instance has room for additional users, and by the PlayFab game server management service to determine when a new Game Server Host should be created in order to prevent excess load on existing Hosts. + */ + bool GetMatchmakerGameModes(AdminModels::FGetMatchmakerGameModesRequest& request, const FGetMatchmakerGameModesDelegate& SuccessDelegate = FGetMatchmakerGameModesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Get the list of titles that the player has played + * Useful for identifying titles of which the player's data will be deleted by DeleteMasterPlayer. + */ + bool GetPlayedTitleList(AdminModels::FGetPlayedTitleListRequest& request, const FGetPlayedTitleListDelegate& SuccessDelegate = FGetPlayedTitleListDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Gets a player's ID from an auth token. + * Gets a player ID from an auth token. The token expires after 30 minutes and cannot be used to look up a player when expired. + */ + bool GetPlayerIdFromAuthToken(AdminModels::FGetPlayerIdFromAuthTokenRequest& request, const FGetPlayerIdFromAuthTokenDelegate& SuccessDelegate = FGetPlayerIdFromAuthTokenDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the player's profile + * This API allows for access to details regarding a user in the PlayFab service, usually for purposes of customer support. Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool GetPlayerProfile(AdminModels::FGetPlayerProfileRequest& request, const FGetPlayerProfileDelegate& SuccessDelegate = FGetPlayerProfileDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // List all segments that a player currently belongs to at this moment in time. + bool GetPlayerSegments(AdminModels::FGetPlayersSegmentsRequest& request, const FGetPlayerSegmentsDelegate& SuccessDelegate = FGetPlayerSegmentsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Returns all Player Shared Secret Keys including disabled and expired. + * Player Shared Secret Keys are used for the call to Client/GetTitlePublicKey, which exchanges the shared secret for an RSA CSP blob to be used to encrypt the payload of account creation requests when that API requires a signature header. + */ + + bool GetPlayerSharedSecrets(const FGetPlayerSharedSecretsDelegate& SuccessDelegate = FGetPlayerSharedSecretsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match + * the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span + * on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected + * in the results. AB Test segments are currently not supported by this operation. + * Initial request must contain at least a Segment ID. Subsequent requests must contain the Segment ID as well as the Continuation Token. Failure to send the Continuation Token will result in a new player segment list being generated. Each time the Continuation Token is passed in the length of the Total Seconds to Live is refreshed. If too much time passes between requests to the point that a subsequent request is past the Total Seconds to Live an error will be returned and paging will be terminated. This API is resource intensive and should not be used in scenarios which might generate high request volumes. Only one request to this API at a time should be made per title. Concurrent requests to the API may be rejected with the APIConcurrentRequestLimitExceeded error. + */ + bool GetPlayersInSegment(AdminModels::FGetPlayersInSegmentRequest& request, const FGetPlayersInSegmentDelegate& SuccessDelegate = FGetPlayersInSegmentDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the configuration information for all player statistics defined in the title, regardless of whether they have + * a reset interval. + */ + + bool GetPlayerStatisticDefinitions(const FGetPlayerStatisticDefinitionsDelegate& SuccessDelegate = FGetPlayerStatisticDefinitionsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the information on the available versions of the specified statistic. + bool GetPlayerStatisticVersions(AdminModels::FGetPlayerStatisticVersionsRequest& request, const FGetPlayerStatisticVersionsDelegate& SuccessDelegate = FGetPlayerStatisticVersionsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Get all tags with a given Namespace (optional) from a player profile. + * This API will return a list of canonical tags which includes both namespace and tag's name. If namespace is not provided, the result is a list of all canonical tags. TagName can be used for segmentation and Namespace is limited to 128 characters. + */ + bool GetPlayerTags(AdminModels::FGetPlayerTagsRequest& request, const FGetPlayerTagsDelegate& SuccessDelegate = FGetPlayerTagsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Gets the requested policy. + * Views the requested policy. Today, the only supported policy is 'ApiPolicy'. + */ + bool GetPolicy(AdminModels::FGetPolicyRequest& request, const FGetPolicyDelegate& SuccessDelegate = FGetPolicyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom publisher settings + * This API is designed to return publisher-specific values which can be read, but not written to, by the client. This data is shared across all titles assigned to a particular publisher, and can be used for cross-game coordination. Only titles assigned to a publisher can use this API. For more information email devrel@playfab.com. This AdminAPI call for getting title data guarantees no delay in between update and retrieval of newly set data. + */ + bool GetPublisherData(AdminModels::FGetPublisherDataRequest& request, const FGetPublisherDataDelegate& SuccessDelegate = FGetPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the random drop table configuration for the title + bool GetRandomResultTables(AdminModels::FGetRandomResultTablesRequest& request, const FGetRandomResultTablesDelegate& SuccessDelegate = FGetRandomResultTablesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the build details for the specified game server executable + bool GetServerBuildInfo(AdminModels::FGetServerBuildInfoRequest& request, const FGetServerBuildInfoDelegate& SuccessDelegate = FGetServerBuildInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the pre-authorized URL for uploading a game server package containing a build (does not enable the build for + * use - see AddServerBuild) + */ + bool GetServerBuildUploadUrl(AdminModels::FGetServerBuildUploadURLRequest& request, const FGetServerBuildUploadUrlDelegate& SuccessDelegate = FGetServerBuildUploadUrlDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the set of items defined for the specified store, including all prices defined + * A store contains an array of references to items defined in the catalog, along with the prices for the item, in both real world and virtual currencies. These prices act as an override to any prices defined in the catalog. In this way, the base definitions of the items may be defined in the catalog, with all associated properties, while the pricing can be set for each store, as needed. This allows for subsets of goods to be defined for different purposes (in order to simplify showing some, but not all catalog items to users, based upon different characteristics), along with unique prices. Note that all prices defined in the catalog and store definitions for the item are considered valid, and that a compromised client can be made to send a request for an item based upon any of these definitions. If no price is specified in the store for an item, the price set in the catalog should be displayed to the user. + */ + bool GetStoreItems(AdminModels::FGetStoreItemsRequest& request, const FGetStoreItemsDelegate& SuccessDelegate = FGetStoreItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Query for task instances by task, status, or time range. + * Only the most recent 100 task instances are returned, ordered by start time descending. The results are generic basic information for task instances. To get detail information specific to each task type, use Get*TaskInstance based on its corresponding task type. + */ + bool GetTaskInstances(AdminModels::FGetTaskInstancesRequest& request, const FGetTaskInstancesDelegate& SuccessDelegate = FGetTaskInstancesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Get definition information on a specified task or all tasks within a title. + bool GetTasks(AdminModels::FGetTasksRequest& request, const FGetTasksDelegate& SuccessDelegate = FGetTasksDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom title settings which can be read by the client + * This API method is designed to return title specific values which can be read by the client. For example, a developer could choose to store values which modify the user experience, such as enemy spawn rates, weapon strengths, movement speeds, etc. This allows a developer to update the title without the need to create,test, and ship a new build. Note that due to caching, there may up to a minute delay in between updating title data and a query returning the newest value. + */ + bool GetTitleData(AdminModels::FGetTitleDataRequest& request, const FGetTitleDataDelegate& SuccessDelegate = FGetTitleDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom title settings which cannot be read by the client + * This API method is designed to return title specific values which are accessible only by the server. These values can be used to tweak settings used by game servers and Cloud Scripts without the need to update and re-deploy. Note that due to caching, there may up to a minute delay in between updating title data and this query returning the newest value. + */ + bool GetTitleInternalData(AdminModels::FGetTitleDataRequest& request, const FGetTitleInternalDataDelegate& SuccessDelegate = FGetTitleInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the relevant details for a specified user, based upon a match against a supplied unique identifier + * This API allows for access to details regarding a user in the PlayFab service, usually for purposes of customer support. Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool GetUserAccountInfo(AdminModels::FLookupUserAccountInfoRequest& request, const FGetUserAccountInfoDelegate& SuccessDelegate = FGetUserAccountInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Gets all bans for a user. + * Get all bans for a user, including inactive and expired bans. + */ + bool GetUserBans(AdminModels::FGetUserBansRequest& request, const FGetUserBansDelegate& SuccessDelegate = FGetUserBansDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserData(AdminModels::FGetUserDataRequest& request, const FGetUserDataDelegate& SuccessDelegate = FGetUserDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which cannot be accessed by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserInternalData(AdminModels::FGetUserDataRequest& request, const FGetUserInternalDataDelegate& SuccessDelegate = FGetUserInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the specified user's current inventory of virtual goods + * All items currently in the user inventory will be returned, irrespective of how they were acquired (via purchasing, grants, coupons, etc.). Items that are expired, fully consumed, or are no longer valid are not considered to be in the user's current inventory, and so will not be not included. + */ + bool GetUserInventory(AdminModels::FGetUserInventoryRequest& request, const FGetUserInventoryDelegate& SuccessDelegate = FGetUserInventoryDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherData(AdminModels::FGetUserDataRequest& request, const FGetUserPublisherDataDelegate& SuccessDelegate = FGetUserPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which cannot be accessed by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherInternalData(AdminModels::FGetUserDataRequest& request, const FGetUserPublisherInternalDataDelegate& SuccessDelegate = FGetUserPublisherInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherReadOnlyData(AdminModels::FGetUserDataRequest& request, const FGetUserPublisherReadOnlyDataDelegate& SuccessDelegate = FGetUserPublisherReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserReadOnlyData(AdminModels::FGetUserDataRequest& request, const FGetUserReadOnlyDataDelegate& SuccessDelegate = FGetUserReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the specified items to the specified user inventories + * This function directly adds inventory items to user inventories. As a result of this operations, the user will not be charged any transaction fee, regardless of the inventory item catalog definition. Please note that the processing time for inventory grants and purchases increases fractionally the more items are in the inventory, and the more items are in the grant/purchase operation. + */ + bool GrantItemsToUsers(AdminModels::FGrantItemsToUsersRequest& request, const FGrantItemsToUsersDelegate& SuccessDelegate = FGrantItemsToUsersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Increases the global count for the given scarce resource. + * This operation will increment the global counter for the number of these items available. This number cannot be decremented, except by actual grants. + */ + bool IncrementLimitedEditionItemAvailability(AdminModels::FIncrementLimitedEditionItemAvailabilityRequest& request, const FIncrementLimitedEditionItemAvailabilityDelegate& SuccessDelegate = FIncrementLimitedEditionItemAvailabilityDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Resets the indicated statistic, removing all player entries for it and backing up the old values. + * Statistics are numeric values, with each statistic in the title also generating a leaderboard. When this call is made on a given statistic, this forces a reset of that statistic. Upon reset, the statistic updates to a new version with no values (effectively removing all players from the leaderboard). The previous version's statistic values are also archived for retrieval, if needed (see GetPlayerStatisticVersions). Statistics not created via a call to CreatePlayerStatisticDefinition by default have a VersionChangeInterval of Never, meaning they do not reset on a schedule, but they can be set to do so via a call to UpdatePlayerStatisticDefinition. Once a statistic has been reset (sometimes referred to as versioned or incremented), the now-previous version can still be written to for up a short, pre-defined period (currently 10 seconds), to prevent issues with levels completing around the time of the reset. Also, once reset, the historical statistics for players in the title may be retrieved using the URL specified in the version information (GetPlayerStatisticVersions). + */ + bool IncrementPlayerStatisticVersion(AdminModels::FIncrementPlayerStatisticVersionRequest& request, const FIncrementPlayerStatisticVersionDelegate& SuccessDelegate = FIncrementPlayerStatisticVersionDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the build details for all game server executables which are currently defined for the title + + bool ListServerBuilds(const FListServerBuildsDelegate& SuccessDelegate = FListServerBuildsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retuns the list of all defined virtual currencies for the title + + bool ListVirtualCurrencyTypes(const FListVirtualCurrencyTypesDelegate& SuccessDelegate = FListVirtualCurrencyTypesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the game server mode details for the specified game server executable + * These details are used by the PlayFab matchmaking service to determine if an existing Game Server Instance has room for additional users, and by the PlayFab game server management service to determine when a new Game Server Host should be created in order to prevent excess load on existing Hosts. This operation is not additive. Using it will cause the game mode definition for the game server executable in question to be created from scratch. If there is an existing game server mode definition for the given BuildVersion, it will be deleted and replaced with the data specified in this call. + */ + bool ModifyMatchmakerGameModes(AdminModels::FModifyMatchmakerGameModesRequest& request, const FModifyMatchmakerGameModesDelegate& SuccessDelegate = FModifyMatchmakerGameModesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Updates the build details for the specified game server executable + bool ModifyServerBuild(AdminModels::FModifyServerBuildRequest& request, const FModifyServerBuildDelegate& SuccessDelegate = FModifyServerBuildDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Attempts to process an order refund through the original real money payment provider. + bool RefundPurchase(AdminModels::FRefundPurchaseRequest& request, const FRefundPurchaseDelegate& SuccessDelegate = FRefundPurchaseDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + * This API will trigger a player_tag_removed event and remove a tag with the given TagName and PlayFabID from the corresponding player profile. TagName can be used for segmentation and it is limited to 256 characters + */ + bool RemovePlayerTag(AdminModels::FRemovePlayerTagRequest& request, const FRemovePlayerTagDelegate& SuccessDelegate = FRemovePlayerTagDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes the game server executable specified from the set of those a client is permitted to request in a call to + * StartGame + */ + bool RemoveServerBuild(AdminModels::FRemoveServerBuildRequest& request, const FRemoveServerBuildDelegate& SuccessDelegate = FRemoveServerBuildDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes one or more virtual currencies from the set defined for the title. + * Virtual currencies to be removed cannot have entries in any catalog nor store for the title. Note that this operation will not remove player balances for the removed currencies; if a deleted currency is recreated at any point, user balances will be in an undefined state. + */ + bool RemoveVirtualCurrencyTypes(AdminModels::FRemoveVirtualCurrencyTypesRequest& request, const FRemoveVirtualCurrencyTypesDelegate& SuccessDelegate = FRemoveVirtualCurrencyTypesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Completely removes all statistics for the specified character, for the current game + * Note that this action cannot be un-done. All statistics for this character will be deleted, removing the user from all leaderboards for the game. + */ + bool ResetCharacterStatistics(AdminModels::FResetCharacterStatisticsRequest& request, const FResetCharacterStatisticsDelegate& SuccessDelegate = FResetCharacterStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Reset a player's password for a given title. + * Resets a player's password taking in a new password based and validating the user based off of a token sent to the playerto their email. The token expires after 30 minutes. + */ + bool ResetPassword(AdminModels::FResetPasswordRequest& request, const FResetPasswordDelegate& SuccessDelegate = FResetPasswordDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Completely removes all statistics for the specified user, for the current game + * Note that this action cannot be un-done. All statistics for this user will be deleted, removing the user from all leaderboards for the game. + */ + bool ResetUserStatistics(AdminModels::FResetUserStatisticsRequest& request, const FResetUserStatisticsDelegate& SuccessDelegate = FResetUserStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Attempts to resolve a dispute with the original order's payment provider. + bool ResolvePurchaseDispute(AdminModels::FResolvePurchaseDisputeRequest& request, const FResolvePurchaseDisputeDelegate& SuccessDelegate = FResolvePurchaseDisputeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revoke all active bans for a user. + * Setting the active state of all non-expired bans for a user to Inactive. Expired bans with an Active state will be ignored, however. Returns information about applied updates only. + */ + bool RevokeAllBansForUser(AdminModels::FRevokeAllBansForUserRequest& request, const FRevokeAllBansForUserDelegate& SuccessDelegate = FRevokeAllBansForUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revoke all active bans specified with BanId. + * Setting the active state of all bans requested to Inactive regardless of whether that ban has already expired. BanIds that do not exist will be skipped. Returns information about applied updates only. + */ + bool RevokeBans(AdminModels::FRevokeBansRequest& request, const FRevokeBansDelegate& SuccessDelegate = FRevokeBansDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revokes access to an item in a user's inventory + * In cases where the inventory item in question is a "crate", and the items it contained have already been dispensed, this will not revoke access or otherwise remove the items which were dispensed. + */ + bool RevokeInventoryItem(AdminModels::FRevokeInventoryItemRequest& request, const FRevokeInventoryItemDelegate& SuccessDelegate = FRevokeInventoryItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revokes access for up to 25 items across multiple users and characters. + * In cases where the inventory item in question is a "crate", and the items it contained have already been dispensed, this will not revoke access or otherwise remove the items which were dispensed. + */ + bool RevokeInventoryItems(AdminModels::FRevokeInventoryItemsRequest& request, const FRevokeInventoryItemsDelegate& SuccessDelegate = FRevokeInventoryItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Run a task immediately regardless of its schedule. + * The returned task instance ID can be used to query for task execution status. + */ + bool RunTask(AdminModels::FRunTaskRequest& request, const FRunTaskDelegate& SuccessDelegate = FRunTaskDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to + * change the password.If an account recovery email template ID is provided, an email using the custom email template will + * be used. + * If the account in question is a "temporary" account (for example, one that was created via a call to LoginFromIOSDeviceID), thisfunction will have no effect. Only PlayFab accounts which have valid email addresses will be able to receive a password reset email using this API. + */ + bool SendAccountRecoveryEmail(AdminModels::FSendAccountRecoveryEmailRequest& request, const FSendAccountRecoveryEmailDelegate& SuccessDelegate = FSendAccountRecoveryEmailDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates the catalog configuration of all virtual goods for the specified catalog version + * This operation is not additive. Using it will cause the indicated catalog version to be created from scratch. If there is an existing catalog with the version number in question, it will be deleted and replaced with only the items specified in this call. + */ + bool SetCatalogItems(AdminModels::FUpdateCatalogItemsRequest& request, const FSetCatalogItemsDelegate& SuccessDelegate = FSetCatalogItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets or resets the player's secret. Player secrets are used to sign API requests. + * APIs that require signatures require that the player have a configured Player Secret Key that is used to sign all requests. Players that don't have a secret will be blocked from making API calls until it is configured. To create a signature header add a SHA256 hashed string containing UTF8 encoded JSON body as it will be sent to the server, the current time in UTC formatted to ISO 8601, and the players secret formatted as 'body.date.secret'. Place the resulting hash into the header X-PlayFab-Signature, along with a header X-PlayFab-Timestamp of the same UTC timestamp used in the signature. + */ + bool SetPlayerSecret(AdminModels::FSetPlayerSecretRequest& request, const FSetPlayerSecretDelegate& SuccessDelegate = FSetPlayerSecretDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Sets the currently published revision of a title Cloud Script + bool SetPublishedRevision(AdminModels::FSetPublishedRevisionRequest& request, const FSetPublishedRevisionDelegate& SuccessDelegate = FSetPublishedRevisionDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the key-value store of custom publisher settings + * This API is designed to store publisher-specific values which can be read, but not written to, by the client. This data is shared across all titles assigned to a particular publisher, and can be used for cross-game coordination. Only titles assigned to a publisher can use this API. This operation is additive. If a Key does not exist in the current dataset, it will be added with the specified Value. If it already exists, the Value for that key will be overwritten with the new Value. For more information email devrel@playfab.com + */ + bool SetPublisherData(AdminModels::FSetPublisherDataRequest& request, const FSetPublisherDataDelegate& SuccessDelegate = FSetPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets all the items in one virtual store + * This operation is not additive. Using it will cause the indicated virtual store to be created from scratch. If there is an existing store with the same storeId, it will be deleted and replaced with only the items specified in this call. A store contains an array of references to items defined inthe catalog, along with the prices for the item, in both real world and virtual currencies. These prices act as an override to any prices defined in the catalog. In this way, the base definitions of the items may be defined in the catalog, with all associated properties, while the pricing can be set for each store, as needed. This allows for subsets of goods to be defined for different purposes (in order to simplify showing some, but not all catalog items to users, based upon different characteristics), along with unique prices. Note that all prices defined in the catalog and store definitions for the item are considered valid, and that a compromised client can be made to send a request for an item based upon any of these definitions. If no price is specified in the store for an item, the price set in the catalog should be displayed to the user. + */ + bool SetStoreItems(AdminModels::FUpdateStoreItemsRequest& request, const FSetStoreItemsDelegate& SuccessDelegate = FSetStoreItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates and updates the key-value store of custom title settings which can be read by the client + * This API method is designed to store title specific values which can be read by the client. For example, a developer could choose to store values which modify the user experience, such as enemy spawn rates, weapon strengths, movement speeds, etc. This allows a developer to update the title without the need to create, test, and ship a new build. This operation is additive. If a Key does not exist in the current dataset, it will be added with the specified Value. If it already exists, the Value for that key will be overwritten with the new Value. + */ + bool SetTitleData(AdminModels::FSetTitleDataRequest& request, const FSetTitleDataDelegate& SuccessDelegate = FSetTitleDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the key-value store of custom title settings which cannot be read by the client + * This API method is designed to store title specific values which are accessible only by the server. These values can be used to tweak settings used by game servers and Cloud Scripts without the need to update and re-deploy. This operation is additive. If a Key does not exist in the current dataset, it will be added with the specified Value. If it already exists, the Value for that key will be overwritten with the new Value. + */ + bool SetTitleInternalData(AdminModels::FSetTitleDataRequest& request, const FSetTitleInternalDataDelegate& SuccessDelegate = FSetTitleInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets the Amazon Resource Name (ARN) for iOS and Android push notifications. Documentation on the exact restrictions can + * be found at: http://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformApplication.html. Currently, Amazon device + * Messaging is not supported. + * When using the Apple Push Notification service (APNS) or the development version (APNS_SANDBOX), the APNS Private Key should be used as the Credential in this call. With Google Cloud Messaging (GCM), the Android API Key should be used. The current ARN (if one exists) can be overwritten by setting the OverwriteOldARN boolean to true. + */ + bool SetupPushNotification(AdminModels::FSetupPushNotificationRequest& request, const FSetupPushNotificationDelegate& SuccessDelegate = FSetupPushNotificationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Decrements the specified virtual currency by the stated amount + bool SubtractUserVirtualCurrency(AdminModels::FSubtractUserVirtualCurrencyRequest& request, const FSubtractUserVirtualCurrencyDelegate& SuccessDelegate = FSubtractUserVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates information of a list of existing bans specified with Ban Ids. + * For each ban, only updates the values that are set. Leave any value to null for no change. If a ban could not be found, the rest are still applied. Returns information about applied updates only. + */ + bool UpdateBans(AdminModels::FUpdateBansRequest& request, const FUpdateBansDelegate& SuccessDelegate = FUpdateBansDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the catalog configuration for virtual goods in the specified catalog version + * This operation is additive. Items with ItemId values not currently in the catalog will be added, while those with ItemId values matching items currently in the catalog will overwrite those items with the given values. + */ + bool UpdateCatalogItems(AdminModels::FUpdateCatalogItemsRequest& request, const FUpdateCatalogItemsDelegate& SuccessDelegate = FUpdateCatalogItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates a new Cloud Script revision and uploads source code to it. Note that at this time, only one file should be + * submitted in the revision. + */ + bool UpdateCloudScript(AdminModels::FUpdateCloudScriptRequest& request, const FUpdateCloudScriptDelegate& SuccessDelegate = FUpdateCloudScriptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates a existing Player Shared Secret Key. It may take up to 5 minutes for this update to become generally available + * after this API returns. + * Player Shared Secret Keys are used for the call to Client/GetTitlePublicKey, which exchanges the shared secret for an RSA CSP blob to be used to encrypt the payload of account creation requests when that API requires a signature header. + */ + bool UpdatePlayerSharedSecret(AdminModels::FUpdatePlayerSharedSecretRequest& request, const FUpdatePlayerSharedSecretDelegate& SuccessDelegate = FUpdatePlayerSharedSecretDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates a player statistic configuration for the title, optionally allowing the developer to specify a reset interval. + * Statistics are numeric values, with each statistic in the title also generating a leaderboard. The ResetInterval enables automatically resetting leaderboards on a specified interval. Upon reset, the statistic updates to a new version with no values (effectively removing all players from the leaderboard). The previous version's statistic values are also archived for retrieval, if needed (see GetPlayerStatisticVersions). Statistics not created via a call to CreatePlayerStatisticDefinition by default have a VersionChangeInterval of Never, meaning they do not reset on a schedule, but they can be set to do so via a call to UpdatePlayerStatisticDefinition. Once a statistic has been reset (sometimes referred to as versioned or incremented), the now-previous version can still be written to for up a short, pre-defined period (currently 10 seconds), to prevent issues with levels completing around the time of the reset. Also, once reset, the historical statistics for players in the title may be retrieved using the URL specified in the version information (GetPlayerStatisticVersions). The AggregationMethod determines what action is taken when a new statistic value is submitted - always update with the new value (Last), use the highest of the old and new values (Max), use the smallest (Min), or add them together (Sum). + */ + bool UpdatePlayerStatisticDefinition(AdminModels::FUpdatePlayerStatisticDefinitionRequest& request, const FUpdatePlayerStatisticDefinitionDelegate& SuccessDelegate = FUpdatePlayerStatisticDefinitionDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Changes a policy for a title + * Updates permissions for your title. Policies affect what is allowed to happen on your title. Your policy is a collection of statements that, together, govern particular area for your title. Today, the only allowed policy is called 'ApiPolicy' and it governs what calls players are allowed to make. + */ + bool UpdatePolicy(AdminModels::FUpdatePolicyRequest& request, const FUpdatePolicyDelegate& SuccessDelegate = FUpdatePolicyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the random drop table configuration for the title + * This operation is additive. Tables with TableId values not currently defined will be added, while those with TableId values matching Tables currently in the catalog will be overwritten with the given values. + */ + bool UpdateRandomResultTables(AdminModels::FUpdateRandomResultTablesRequest& request, const FUpdateRandomResultTablesDelegate& SuccessDelegate = FUpdateRandomResultTablesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates an existing virtual item store with new or modified items + * This operation is additive. Items with ItemId values not currently in the store will be added, while those with ItemId values matching items currently in the catalog will overwrite those items with the given values. A store contains an array of references to items defined in the catalog, along with the prices for the item, in both real world and virtual currencies. These prices act as an override to any prices defined in the catalog. In this way, the base definitions of the items may be defined in the catalog, with all associated properties, while the pricing can be set for each store, as needed. This allows for subsets of goods to be defined for different purposes (in order to simplify showing some, but not all catalog items to users, based upon different characteristics), along with unique prices. Note that all prices defined in the catalog and store definitions for the item are considered valid, and that a compromised client can be made to send a request for an item based upon any of these definitions. If no price is specified in the store for an item, the price set in the catalog should be displayed to the user. + */ + bool UpdateStoreItems(AdminModels::FUpdateStoreItemsRequest& request, const FUpdateStoreItemsDelegate& SuccessDelegate = FUpdateStoreItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Update an existing task. + * Note that when calling this API, all properties of the task have to be provided, including properties that you do not want to change. Parameters not specified would be set to default value. If the task name in the update request is new, a task rename operation will be executed before updating other fields of the task. WARNING: Renaming of a task may break logics where the task name is used as an identifier. + */ + bool UpdateTask(AdminModels::FUpdateTaskRequest& request, const FUpdateTaskDelegate& SuccessDelegate = FUpdateTaskDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user which is readable and writable by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserData(AdminModels::FUpdateUserDataRequest& request, const FUpdateUserDataDelegate& SuccessDelegate = FUpdateUserDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user which cannot be accessed by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserInternalData(AdminModels::FUpdateUserInternalDataRequest& request, const FUpdateUserInternalDataDelegate& SuccessDelegate = FUpdateUserInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the publisher-specific custom data for the user which is readable and writable by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. Note that in the example call provided, title-specific data is used, as there may be a need to share this across titles (in sequels, for example). + */ + bool UpdateUserPublisherData(AdminModels::FUpdateUserDataRequest& request, const FUpdateUserPublisherDataDelegate& SuccessDelegate = FUpdateUserPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the publisher-specific custom data for the user which cannot be accessed by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. Note that in the example call provided, title-specific data is used, as there may be a need to share this across titles (in sequels, for example). + */ + bool UpdateUserPublisherInternalData(AdminModels::FUpdateUserInternalDataRequest& request, const FUpdateUserPublisherInternalDataDelegate& SuccessDelegate = FUpdateUserPublisherInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the publisher-specific custom data for the user which can only be read by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. Note that in the example call provided, title-specific data is used, as there may be a need to share this across titles (in sequels, for example). + */ + bool UpdateUserPublisherReadOnlyData(AdminModels::FUpdateUserDataRequest& request, const FUpdateUserPublisherReadOnlyDataDelegate& SuccessDelegate = FUpdateUserPublisherReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user which can only be read by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserReadOnlyData(AdminModels::FUpdateUserDataRequest& request, const FUpdateUserReadOnlyDataDelegate& SuccessDelegate = FUpdateUserReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title specific display name for a user + * In addition to the PlayFab username, titles can make use of a DisplayName which is also a unique identifier, but specific to the title. This allows for unique names which more closely match the theme or genre of a title, for example. This API enables changing that name, whether due to a customer request, an offensive name choice, etc. + */ + bool UpdateUserTitleDisplayName(AdminModels::FUpdateUserTitleDisplayNameRequest& request, const FUpdateUserTitleDisplayNameDelegate& SuccessDelegate = FUpdateUserTitleDisplayNameDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnAbortTaskInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAbortTaskInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddNewsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddNewsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddPlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddPlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddServerBuildResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddServerBuildDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddVirtualCurrencyTypesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddVirtualCurrencyTypesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnBanUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FBanUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCheckLimitedEditionItemAvailabilityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCheckLimitedEditionItemAvailabilityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreateActionsOnPlayersInSegmentTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateActionsOnPlayersInSegmentTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreateCloudScriptTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateCloudScriptTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreatePlayerSharedSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreatePlayerSharedSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreatePlayerStatisticDefinitionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreatePlayerStatisticDefinitionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteContentResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteContentDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteMasterPlayerAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteMasterPlayerAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeletePlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeletePlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeletePlayerSharedSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeletePlayerSharedSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteStoreResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteStoreDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteTitleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteTitleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnExportMasterPlayerDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExportMasterPlayerDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetActionsOnPlayersInSegmentTaskInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetActionsOnPlayersInSegmentTaskInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetAllSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCloudScriptRevisionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCloudScriptRevisionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCloudScriptTaskInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCloudScriptTaskInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCloudScriptVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCloudScriptVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetContentListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetContentUploadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentUploadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetDataReportResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetDataReportDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetMatchmakerGameInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetMatchmakerGameInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetMatchmakerGameModesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetMatchmakerGameModesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayedTitleListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayedTitleListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerIdFromAuthTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerIdFromAuthTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerSharedSecretsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSharedSecretsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayersInSegmentResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayersInSegmentDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerStatisticDefinitionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticDefinitionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerStatisticVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetRandomResultTablesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetRandomResultTablesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetServerBuildInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetServerBuildInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetServerBuildUploadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetServerBuildUploadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTaskInstancesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTaskInstancesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTasksResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTasksDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserAccountInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserAccountInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGrantItemsToUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnIncrementLimitedEditionItemAvailabilityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FIncrementLimitedEditionItemAvailabilityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnIncrementPlayerStatisticVersionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FIncrementPlayerStatisticVersionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListServerBuildsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListServerBuildsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListVirtualCurrencyTypesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListVirtualCurrencyTypesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnModifyMatchmakerGameModesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FModifyMatchmakerGameModesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnModifyServerBuildResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FModifyServerBuildDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRefundPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefundPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemovePlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemovePlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveServerBuildResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveServerBuildDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveVirtualCurrencyTypesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveVirtualCurrencyTypesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnResetCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResetCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnResetPasswordResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResetPasswordDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnResetUserStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResetUserStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnResolvePurchaseDisputeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FResolvePurchaseDisputeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeAllBansForUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeAllBansForUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeInventoryItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeInventoryItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRunTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRunTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSendAccountRecoveryEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendAccountRecoveryEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetPlayerSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPlayerSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetPublishedRevisionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPublishedRevisionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetupPushNotificationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetupPushNotificationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSubtractUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdatePlayerSharedSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerSharedSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdatePlayerStatisticDefinitionResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerStatisticDefinitionDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdatePolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateRandomResultTablesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateRandomResultTablesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateTaskResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateTaskDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserTitleDisplayNameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserTitleDisplayNameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAdminDataModels.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAdminDataModels.h new file mode 100644 index 000000000..9b86bef0a --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAdminDataModels.h @@ -0,0 +1,9719 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace AdminModels +{ + + struct PLAYFABCPP_API FAbortTaskInstanceRequest : public FPlayFabBaseModel + { + // ID of a task instance that is being aborted. + FString TaskInstanceId; + + FAbortTaskInstanceRequest() : + FPlayFabBaseModel(), + TaskInstanceId() + {} + + FAbortTaskInstanceRequest(const FAbortTaskInstanceRequest& src) : + FPlayFabBaseModel(), + TaskInstanceId(src.TaskInstanceId) + {} + + FAbortTaskInstanceRequest(const TSharedPtr& obj) : FAbortTaskInstanceRequest() + { + readFromValue(obj); + } + + ~FAbortTaskInstanceRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FActionsOnPlayersInSegmentTaskParameter : public FPlayFabBaseModel + { + // ID of the action to perform on each player in segment. + FString ActionId; + + // ID of the segment to perform actions on. + FString SegmentId; + + FActionsOnPlayersInSegmentTaskParameter() : + FPlayFabBaseModel(), + ActionId(), + SegmentId() + {} + + FActionsOnPlayersInSegmentTaskParameter(const FActionsOnPlayersInSegmentTaskParameter& src) : + FPlayFabBaseModel(), + ActionId(src.ActionId), + SegmentId(src.SegmentId) + {} + + FActionsOnPlayersInSegmentTaskParameter(const TSharedPtr& obj) : FActionsOnPlayersInSegmentTaskParameter() + { + readFromValue(obj); + } + + ~FActionsOnPlayersInSegmentTaskParameter(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum TaskInstanceStatus + { + TaskInstanceStatusSucceeded, + TaskInstanceStatusStarting, + TaskInstanceStatusInProgress, + TaskInstanceStatusFailed, + TaskInstanceStatusAborted, + TaskInstanceStatusPending + }; + + PLAYFABCPP_API void writeTaskInstanceStatusEnumJSON(TaskInstanceStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API TaskInstanceStatus readTaskInstanceStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API TaskInstanceStatus readTaskInstanceStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FNameIdentifier : public FPlayFabBaseModel + { + // [optional] Id Identifier, if present + FString Id; + + // [optional] Name Identifier, if present + FString Name; + + FNameIdentifier() : + FPlayFabBaseModel(), + Id(), + Name() + {} + + FNameIdentifier(const FNameIdentifier& src) : + FPlayFabBaseModel(), + Id(src.Id), + Name(src.Name) + {} + + FNameIdentifier(const TSharedPtr& obj) : FNameIdentifier() + { + readFromValue(obj); + } + + ~FNameIdentifier(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FActionsOnPlayersInSegmentTaskSummary : public FPlayFabBaseModel + { + // [optional] UTC timestamp when the task completed. + Boxed CompletedAt; + + // [optional] Error message for last processing attempt, if an error occured. + FString ErrorMessage; + + // [optional] Flag indicating if the error was fatal, if false job will be retried. + Boxed ErrorWasFatal; + + // [optional] Estimated time remaining in seconds. + Boxed EstimatedSecondsRemaining; + + // [optional] Progress represented as percentage. + Boxed PercentComplete; + + // [optional] If manually scheduled, ID of user who scheduled the task. + FString ScheduledByUserId; + + // UTC timestamp when the task started. + FDateTime StartedAt; + + // [optional] Current status of the task instance. + Boxed Status; + + // [optional] Identifier of the task this instance belongs to. + TSharedPtr TaskIdentifier; + + // [optional] ID of the task instance. + FString TaskInstanceId; + + // [optional] Total players in segment when task was started. + Boxed TotalPlayersInSegment; + + // [optional] Total number of players that have had the actions applied to. + Boxed TotalPlayersProcessed; + + FActionsOnPlayersInSegmentTaskSummary() : + FPlayFabBaseModel(), + CompletedAt(), + ErrorMessage(), + ErrorWasFatal(), + EstimatedSecondsRemaining(), + PercentComplete(), + ScheduledByUserId(), + StartedAt(0), + Status(), + TaskIdentifier(nullptr), + TaskInstanceId(), + TotalPlayersInSegment(), + TotalPlayersProcessed() + {} + + FActionsOnPlayersInSegmentTaskSummary(const FActionsOnPlayersInSegmentTaskSummary& src) : + FPlayFabBaseModel(), + CompletedAt(src.CompletedAt), + ErrorMessage(src.ErrorMessage), + ErrorWasFatal(src.ErrorWasFatal), + EstimatedSecondsRemaining(src.EstimatedSecondsRemaining), + PercentComplete(src.PercentComplete), + ScheduledByUserId(src.ScheduledByUserId), + StartedAt(src.StartedAt), + Status(src.Status), + TaskIdentifier(src.TaskIdentifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.TaskIdentifier)) : nullptr), + TaskInstanceId(src.TaskInstanceId), + TotalPlayersInSegment(src.TotalPlayersInSegment), + TotalPlayersProcessed(src.TotalPlayersProcessed) + {} + + FActionsOnPlayersInSegmentTaskSummary(const TSharedPtr& obj) : FActionsOnPlayersInSegmentTaskSummary() + { + readFromValue(obj); + } + + ~FActionsOnPlayersInSegmentTaskSummary(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAdCampaignAttribution : public FPlayFabBaseModel + { + // UTC time stamp of attribution + FDateTime AttributedAt; + + // [optional] Attribution campaign identifier + FString CampaignId; + + // [optional] Attribution network name + FString Platform; + + FAdCampaignAttribution() : + FPlayFabBaseModel(), + AttributedAt(0), + CampaignId(), + Platform() + {} + + FAdCampaignAttribution(const FAdCampaignAttribution& src) : + FPlayFabBaseModel(), + AttributedAt(src.AttributedAt), + CampaignId(src.CampaignId), + Platform(src.Platform) + {} + + FAdCampaignAttribution(const TSharedPtr& obj) : FAdCampaignAttribution() + { + readFromValue(obj); + } + + ~FAdCampaignAttribution(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAdCampaignAttributionModel : public FPlayFabBaseModel + { + // UTC time stamp of attribution + FDateTime AttributedAt; + + // [optional] Attribution campaign identifier + FString CampaignId; + + // [optional] Attribution network name + FString Platform; + + FAdCampaignAttributionModel() : + FPlayFabBaseModel(), + AttributedAt(0), + CampaignId(), + Platform() + {} + + FAdCampaignAttributionModel(const FAdCampaignAttributionModel& src) : + FPlayFabBaseModel(), + AttributedAt(src.AttributedAt), + CampaignId(src.CampaignId), + Platform(src.Platform) + {} + + FAdCampaignAttributionModel(const TSharedPtr& obj) : FAdCampaignAttributionModel() + { + readFromValue(obj); + } + + ~FAdCampaignAttributionModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddNewsRequest : public FPlayFabBaseModel + { + // Body text of the news + FString Body; + + // [optional] Time this news was published. If not set, defaults to now. + Boxed Timestamp; + + // Title (headline) of the news item + FString Title; + + FAddNewsRequest() : + FPlayFabBaseModel(), + Body(), + Timestamp(), + Title() + {} + + FAddNewsRequest(const FAddNewsRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + Timestamp(src.Timestamp), + Title(src.Title) + {} + + FAddNewsRequest(const TSharedPtr& obj) : FAddNewsRequest() + { + readFromValue(obj); + } + + ~FAddNewsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddNewsResult : public FPlayFabBaseModel + { + // [optional] Unique id of the new news item + FString NewsId; + + FAddNewsResult() : + FPlayFabBaseModel(), + NewsId() + {} + + FAddNewsResult(const FAddNewsResult& src) : + FPlayFabBaseModel(), + NewsId(src.NewsId) + {} + + FAddNewsResult(const TSharedPtr& obj) : FAddNewsResult() + { + readFromValue(obj); + } + + ~FAddNewsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddPlayerTagRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique tag for player profile. + FString TagName; + + FAddPlayerTagRequest() : + FPlayFabBaseModel(), + PlayFabId(), + TagName() + {} + + FAddPlayerTagRequest(const FAddPlayerTagRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + TagName(src.TagName) + {} + + FAddPlayerTagRequest(const TSharedPtr& obj) : FAddPlayerTagRequest() + { + readFromValue(obj); + } + + ~FAddPlayerTagRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddPlayerTagResult : public FPlayFabBaseModel + { + FAddPlayerTagResult() : + FPlayFabBaseModel() + {} + + FAddPlayerTagResult(const FAddPlayerTagResult& src) : + FPlayFabBaseModel() + {} + + FAddPlayerTagResult(const TSharedPtr& obj) : FAddPlayerTagResult() + { + readFromValue(obj); + } + + ~FAddPlayerTagResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum Region + { + RegionUSCentral, + RegionUSEast, + RegionEUWest, + RegionSingapore, + RegionJapan, + RegionBrazil, + RegionAustralia + }; + + PLAYFABCPP_API void writeRegionEnumJSON(Region enumVal, JsonWriter& writer); + PLAYFABCPP_API Region readRegionFromValue(const TSharedPtr& value); + PLAYFABCPP_API Region readRegionFromValue(const FString& value); + + struct PLAYFABCPP_API FAddServerBuildRequest : public FPlayFabBaseModel + { + // [optional] server host regions in which this build should be running and available + TArray ActiveRegions; + // unique identifier for the build executable + FString BuildId; + + // [optional] appended to the end of the command line when starting game servers + FString CommandLineTemplate; + + // [optional] developer comment(s) for this build + FString Comment; + + // [optional] path to the game server executable. Defaults to gameserver.exe + FString ExecutablePath; + + // maximum number of game server instances that can run on a single host machine + int32 MaxGamesPerHost; + + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + int32 MinFreeGameSlots; + + FAddServerBuildRequest() : + FPlayFabBaseModel(), + ActiveRegions(), + BuildId(), + CommandLineTemplate(), + Comment(), + ExecutablePath(), + MaxGamesPerHost(0), + MinFreeGameSlots(0) + {} + + FAddServerBuildRequest(const FAddServerBuildRequest& src) : + FPlayFabBaseModel(), + ActiveRegions(src.ActiveRegions), + BuildId(src.BuildId), + CommandLineTemplate(src.CommandLineTemplate), + Comment(src.Comment), + ExecutablePath(src.ExecutablePath), + MaxGamesPerHost(src.MaxGamesPerHost), + MinFreeGameSlots(src.MinFreeGameSlots) + {} + + FAddServerBuildRequest(const TSharedPtr& obj) : FAddServerBuildRequest() + { + readFromValue(obj); + } + + ~FAddServerBuildRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum GameBuildStatus + { + GameBuildStatusAvailable, + GameBuildStatusValidating, + GameBuildStatusInvalidBuildPackage, + GameBuildStatusProcessing, + GameBuildStatusFailedToProcess + }; + + PLAYFABCPP_API void writeGameBuildStatusEnumJSON(GameBuildStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API GameBuildStatus readGameBuildStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API GameBuildStatus readGameBuildStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FAddServerBuildResult : public FPlayFabBaseModel + { + // [optional] array of regions where this build can used, when it is active + TArray ActiveRegions; + // [optional] unique identifier for this build executable + FString BuildId; + + // [optional] appended to the end of the command line when starting game servers + FString CommandLineTemplate; + + // [optional] developer comment(s) for this build + FString Comment; + + // [optional] path to the game server executable. Defaults to gameserver.exe + FString ExecutablePath; + + // maximum number of game server instances that can run on a single host machine + int32 MaxGamesPerHost; + + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + int32 MinFreeGameSlots; + + // [optional] the current status of the build validation and processing steps + Boxed Status; + + // time this build was last modified (or uploaded, if this build has never been modified) + FDateTime Timestamp; + + /** + * [optional] Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FAddServerBuildResult() : + FPlayFabBaseModel(), + ActiveRegions(), + BuildId(), + CommandLineTemplate(), + Comment(), + ExecutablePath(), + MaxGamesPerHost(0), + MinFreeGameSlots(0), + Status(), + Timestamp(0), + TitleId() + {} + + FAddServerBuildResult(const FAddServerBuildResult& src) : + FPlayFabBaseModel(), + ActiveRegions(src.ActiveRegions), + BuildId(src.BuildId), + CommandLineTemplate(src.CommandLineTemplate), + Comment(src.Comment), + ExecutablePath(src.ExecutablePath), + MaxGamesPerHost(src.MaxGamesPerHost), + MinFreeGameSlots(src.MinFreeGameSlots), + Status(src.Status), + Timestamp(src.Timestamp), + TitleId(src.TitleId) + {} + + FAddServerBuildResult(const TSharedPtr& obj) : FAddServerBuildResult() + { + readFromValue(obj); + } + + ~FAddServerBuildResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddUserVirtualCurrencyRequest : public FPlayFabBaseModel + { + /** + * Amount to be added to the user balance of the specified virtual currency. Maximum VC balance is Int32 (2,147,483,647). + * Any increase over this value will be discarded. + */ + int32 Amount; + + // PlayFab unique identifier of the user whose virtual currency balance is to be increased. + FString PlayFabId; + + // Name of the virtual currency which is to be incremented. + FString VirtualCurrency; + + FAddUserVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + PlayFabId(), + VirtualCurrency() + {} + + FAddUserVirtualCurrencyRequest(const FAddUserVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FAddUserVirtualCurrencyRequest(const TSharedPtr& obj) : FAddUserVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FAddUserVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FVirtualCurrencyData : public FPlayFabBaseModel + { + // unique two-character identifier for this currency type (e.g.: "CC") + FString CurrencyCode; + + // [optional] friendly name to show in the developer portal, reports, etc. + FString DisplayName; + + // [optional] amount to automatically grant users upon first login to the title + Boxed InitialDeposit; + + // [optional] maximum amount to which the currency will recharge (cannot exceed MaxAmount, but can be less) + Boxed RechargeMax; + + // [optional] rate at which the currency automatically be added to over time, in units per day (24 hours) + Boxed RechargeRate; + + FVirtualCurrencyData() : + FPlayFabBaseModel(), + CurrencyCode(), + DisplayName(), + InitialDeposit(), + RechargeMax(), + RechargeRate() + {} + + FVirtualCurrencyData(const FVirtualCurrencyData& src) : + FPlayFabBaseModel(), + CurrencyCode(src.CurrencyCode), + DisplayName(src.DisplayName), + InitialDeposit(src.InitialDeposit), + RechargeMax(src.RechargeMax), + RechargeRate(src.RechargeRate) + {} + + FVirtualCurrencyData(const TSharedPtr& obj) : FVirtualCurrencyData() + { + readFromValue(obj); + } + + ~FVirtualCurrencyData(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddVirtualCurrencyTypesRequest : public FPlayFabBaseModel + { + /** + * List of virtual currencies and their initial deposits (the amount a user is granted when signing in for the first time) + * to the title + */ + TArray VirtualCurrencies; + FAddVirtualCurrencyTypesRequest() : + FPlayFabBaseModel(), + VirtualCurrencies() + {} + + FAddVirtualCurrencyTypesRequest(const FAddVirtualCurrencyTypesRequest& src) : + FPlayFabBaseModel(), + VirtualCurrencies(src.VirtualCurrencies) + {} + + FAddVirtualCurrencyTypesRequest(const TSharedPtr& obj) : FAddVirtualCurrencyTypesRequest() + { + readFromValue(obj); + } + + ~FAddVirtualCurrencyTypesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum Conditionals + { + ConditionalsAny, + ConditionalsTrue, + ConditionalsFalse + }; + + PLAYFABCPP_API void writeConditionalsEnumJSON(Conditionals enumVal, JsonWriter& writer); + PLAYFABCPP_API Conditionals readConditionalsFromValue(const TSharedPtr& value); + PLAYFABCPP_API Conditionals readConditionalsFromValue(const FString& value); + + struct PLAYFABCPP_API FApiCondition : public FPlayFabBaseModel + { + // [optional] Require that API calls contain an RSA encrypted payload or signed headers. + Boxed HasSignatureOrEncryption; + + FApiCondition() : + FPlayFabBaseModel(), + HasSignatureOrEncryption() + {} + + FApiCondition(const FApiCondition& src) : + FPlayFabBaseModel(), + HasSignatureOrEncryption(src.HasSignatureOrEncryption) + {} + + FApiCondition(const TSharedPtr& obj) : FApiCondition() + { + readFromValue(obj); + } + + ~FApiCondition(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum AuthTokenType + { + AuthTokenTypeEmail + }; + + PLAYFABCPP_API void writeAuthTokenTypeEnumJSON(AuthTokenType enumVal, JsonWriter& writer); + PLAYFABCPP_API AuthTokenType readAuthTokenTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API AuthTokenType readAuthTokenTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FBanInfo : public FPlayFabBaseModel + { + // The active state of this ban. Expired bans may still have this value set to true but they will have no effect. + bool Active; + + // [optional] The unique Ban Id associated with this ban. + FString BanId; + + // [optional] The time when this ban was applied. + Boxed Created; + + // [optional] The time when this ban expires. Permanent bans do not have expiration date. + Boxed Expires; + + // [optional] The IP address on which the ban was applied. May affect multiple players. + FString IPAddress; + + // [optional] The MAC address on which the ban was applied. May affect multiple players. + FString MACAddress; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] The reason why this ban was applied. + FString Reason; + + FBanInfo() : + FPlayFabBaseModel(), + Active(false), + BanId(), + Created(), + Expires(), + IPAddress(), + MACAddress(), + PlayFabId(), + Reason() + {} + + FBanInfo(const FBanInfo& src) : + FPlayFabBaseModel(), + Active(src.Active), + BanId(src.BanId), + Created(src.Created), + Expires(src.Expires), + IPAddress(src.IPAddress), + MACAddress(src.MACAddress), + PlayFabId(src.PlayFabId), + Reason(src.Reason) + {} + + FBanInfo(const TSharedPtr& obj) : FBanInfo() + { + readFromValue(obj); + } + + ~FBanInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanRequest : public FPlayFabBaseModel + { + // [optional] The duration in hours for the ban. Leave this blank for a permanent ban. + Boxed DurationInHours; + + // [optional] IP address to be banned. May affect multiple players. + FString IPAddress; + + // [optional] MAC address to be banned. May affect multiple players. + FString MACAddress; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] The reason for this ban. Maximum 140 characters. + FString Reason; + + FBanRequest() : + FPlayFabBaseModel(), + DurationInHours(), + IPAddress(), + MACAddress(), + PlayFabId(), + Reason() + {} + + FBanRequest(const FBanRequest& src) : + FPlayFabBaseModel(), + DurationInHours(src.DurationInHours), + IPAddress(src.IPAddress), + MACAddress(src.MACAddress), + PlayFabId(src.PlayFabId), + Reason(src.Reason) + {} + + FBanRequest(const TSharedPtr& obj) : FBanRequest() + { + readFromValue(obj); + } + + ~FBanRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanUsersRequest : public FPlayFabBaseModel + { + // List of ban requests to be applied. Maximum 100. + TArray Bans; + FBanUsersRequest() : + FPlayFabBaseModel(), + Bans() + {} + + FBanUsersRequest(const FBanUsersRequest& src) : + FPlayFabBaseModel(), + Bans(src.Bans) + {} + + FBanUsersRequest(const TSharedPtr& obj) : FBanUsersRequest() + { + readFromValue(obj); + } + + ~FBanUsersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanUsersResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were applied + TArray BanData; + FBanUsersResult() : + FPlayFabBaseModel(), + BanData() + {} + + FBanUsersResult(const FBanUsersResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FBanUsersResult(const TSharedPtr& obj) : FBanUsersResult() + { + readFromValue(obj); + } + + ~FBanUsersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBlankResult : public FPlayFabBaseModel + { + FBlankResult() : + FPlayFabBaseModel() + {} + + FBlankResult(const FBlankResult& src) : + FPlayFabBaseModel() + {} + + FBlankResult(const TSharedPtr& obj) : FBlankResult() + { + readFromValue(obj); + } + + ~FBlankResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemBundleInfo : public FPlayFabBaseModel + { + // [optional] unique ItemId values for all items which will be added to the player inventory when the bundle is added + TArray BundledItems; + /** + * [optional] unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and + * add the relevant items to the player inventory when the bundle is added) + */ + TArray BundledResultTables; + // [optional] virtual currency types and balances which will be added to the player inventory when the bundle is added + TMap BundledVirtualCurrencies; + FCatalogItemBundleInfo() : + FPlayFabBaseModel(), + BundledItems(), + BundledResultTables(), + BundledVirtualCurrencies() + {} + + FCatalogItemBundleInfo(const FCatalogItemBundleInfo& src) : + FPlayFabBaseModel(), + BundledItems(src.BundledItems), + BundledResultTables(src.BundledResultTables), + BundledVirtualCurrencies(src.BundledVirtualCurrencies) + {} + + FCatalogItemBundleInfo(const TSharedPtr& obj) : FCatalogItemBundleInfo() + { + readFromValue(obj); + } + + ~FCatalogItemBundleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemConsumableInfo : public FPlayFabBaseModel + { + // [optional] number of times this object can be used, after which it will be removed from the player inventory + Boxed UsageCount; + + /** + * [optional] duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed + * (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on + * this item's details have completed) + */ + Boxed UsagePeriod; + + /** + * [optional] all inventory item instances in the player inventory sharing a non-null UsagePeriodGroup have their UsagePeriod values + * added together, and share the result - when that period has elapsed, all the items in the group will be removed + */ + FString UsagePeriodGroup; + + FCatalogItemConsumableInfo() : + FPlayFabBaseModel(), + UsageCount(), + UsagePeriod(), + UsagePeriodGroup() + {} + + FCatalogItemConsumableInfo(const FCatalogItemConsumableInfo& src) : + FPlayFabBaseModel(), + UsageCount(src.UsageCount), + UsagePeriod(src.UsagePeriod), + UsagePeriodGroup(src.UsagePeriodGroup) + {} + + FCatalogItemConsumableInfo(const TSharedPtr& obj) : FCatalogItemConsumableInfo() + { + readFromValue(obj); + } + + ~FCatalogItemConsumableInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemContainerInfo : public FPlayFabBaseModel + { + // [optional] unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked + TArray ItemContents; + /** + * [optional] ItemId for the catalog item used to unlock the container, if any (if not specified, a call to UnlockContainerItem will + * open the container, adding the contents to the player inventory and currency balances) + */ + FString KeyItemId; + + /** + * [optional] unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables + * will be resolved and add the relevant items to the player inventory) + */ + TArray ResultTableContents; + // [optional] virtual currency types and balances which will be added to the player inventory when the container is unlocked + TMap VirtualCurrencyContents; + FCatalogItemContainerInfo() : + FPlayFabBaseModel(), + ItemContents(), + KeyItemId(), + ResultTableContents(), + VirtualCurrencyContents() + {} + + FCatalogItemContainerInfo(const FCatalogItemContainerInfo& src) : + FPlayFabBaseModel(), + ItemContents(src.ItemContents), + KeyItemId(src.KeyItemId), + ResultTableContents(src.ResultTableContents), + VirtualCurrencyContents(src.VirtualCurrencyContents) + {} + + FCatalogItemContainerInfo(const TSharedPtr& obj) : FCatalogItemContainerInfo() + { + readFromValue(obj); + } + + ~FCatalogItemContainerInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItem : public FPlayFabBaseModel + { + /** + * [optional] defines the bundle properties for the item - bundles are items which contain other items, including random drop tables + * and virtual currencies + */ + TSharedPtr Bundle; + + // if true, then an item instance of this type can be used to grant a character to a user. + bool CanBecomeCharacter; + + // [optional] catalog version for this item + FString CatalogVersion; + + // [optional] defines the consumable properties (number of uses, timeout) for the item + TSharedPtr Consumable; + + /** + * [optional] defines the container properties for the item - what items it contains, including random drop tables and virtual + * currencies, and what item (if any) is required to open it via the UnlockContainerItem API + */ + TSharedPtr Container; + + // [optional] game specific custom data + FString CustomData; + + // [optional] text description of item, to show in-game + FString Description; + + // [optional] text name for the item, to show in-game + FString DisplayName; + + /** + * If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited + * edition item, this value determines the total number of instances to allocate for the title. Once this limit has been + * reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of + * false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less + * than zero, it will be ignored. + */ + int32 InitialLimitedEditionCount; + + // BETA: If true, then only a fixed number can ever be granted. + bool IsLimitedEdition; + + /** + * if true, then only one item instance of this type will exist and its remaininguses will be incremented instead. + * RemainingUses will cap out at Int32.Max (2,147,483,647). All subsequent increases will be discarded + */ + bool IsStackable; + + // if true, then an item instance of this type can be traded between players using the trading APIs + bool IsTradable; + + // [optional] class to which the item belongs + FString ItemClass; + + // unique identifier for this item + FString ItemId; + + /** + * [optional] URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP + * URL. + */ + FString ItemImageUrl; + + // [optional] override prices for this item for specific currencies + TMap RealCurrencyPrices; + // [optional] list of item tags + TArray Tags; + // [optional] price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + TMap VirtualCurrencyPrices; + FCatalogItem() : + FPlayFabBaseModel(), + Bundle(nullptr), + CanBecomeCharacter(false), + CatalogVersion(), + Consumable(nullptr), + Container(nullptr), + CustomData(), + Description(), + DisplayName(), + InitialLimitedEditionCount(0), + IsLimitedEdition(false), + IsStackable(false), + IsTradable(false), + ItemClass(), + ItemId(), + ItemImageUrl(), + RealCurrencyPrices(), + Tags(), + VirtualCurrencyPrices() + {} + + FCatalogItem(const FCatalogItem& src) : + FPlayFabBaseModel(), + Bundle(src.Bundle.IsValid() ? MakeShareable(new FCatalogItemBundleInfo(*src.Bundle)) : nullptr), + CanBecomeCharacter(src.CanBecomeCharacter), + CatalogVersion(src.CatalogVersion), + Consumable(src.Consumable.IsValid() ? MakeShareable(new FCatalogItemConsumableInfo(*src.Consumable)) : nullptr), + Container(src.Container.IsValid() ? MakeShareable(new FCatalogItemContainerInfo(*src.Container)) : nullptr), + CustomData(src.CustomData), + Description(src.Description), + DisplayName(src.DisplayName), + InitialLimitedEditionCount(src.InitialLimitedEditionCount), + IsLimitedEdition(src.IsLimitedEdition), + IsStackable(src.IsStackable), + IsTradable(src.IsTradable), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemImageUrl(src.ItemImageUrl), + RealCurrencyPrices(src.RealCurrencyPrices), + Tags(src.Tags), + VirtualCurrencyPrices(src.VirtualCurrencyPrices) + {} + + FCatalogItem(const TSharedPtr& obj) : FCatalogItem() + { + readFromValue(obj); + } + + ~FCatalogItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCheckLimitedEditionItemAvailabilityRequest : public FPlayFabBaseModel + { + // [optional] Which catalog is being updated. If null, uses the default catalog. + FString CatalogVersion; + + // The item to check for. + FString ItemId; + + FCheckLimitedEditionItemAvailabilityRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + ItemId() + {} + + FCheckLimitedEditionItemAvailabilityRequest(const FCheckLimitedEditionItemAvailabilityRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + ItemId(src.ItemId) + {} + + FCheckLimitedEditionItemAvailabilityRequest(const TSharedPtr& obj) : FCheckLimitedEditionItemAvailabilityRequest() + { + readFromValue(obj); + } + + ~FCheckLimitedEditionItemAvailabilityRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCheckLimitedEditionItemAvailabilityResult : public FPlayFabBaseModel + { + // The amount of the specified resource remaining. + int32 Amount; + + FCheckLimitedEditionItemAvailabilityResult() : + FPlayFabBaseModel(), + Amount(0) + {} + + FCheckLimitedEditionItemAvailabilityResult(const FCheckLimitedEditionItemAvailabilityResult& src) : + FPlayFabBaseModel(), + Amount(src.Amount) + {} + + FCheckLimitedEditionItemAvailabilityResult(const TSharedPtr& obj) : FCheckLimitedEditionItemAvailabilityResult() + { + readFromValue(obj); + } + + ~FCheckLimitedEditionItemAvailabilityResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCloudScriptFile : public FPlayFabBaseModel + { + // Contents of the Cloud Script javascript. Must be string-escaped javascript. + FString FileContents; + + /** + * Name of the javascript file. These names are not used internally by the server, they are only for developer + * organizational purposes. + */ + FString Filename; + + FCloudScriptFile() : + FPlayFabBaseModel(), + FileContents(), + Filename() + {} + + FCloudScriptFile(const FCloudScriptFile& src) : + FPlayFabBaseModel(), + FileContents(src.FileContents), + Filename(src.Filename) + {} + + FCloudScriptFile(const TSharedPtr& obj) : FCloudScriptFile() + { + readFromValue(obj); + } + + ~FCloudScriptFile(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCloudScriptTaskParameter : public FPlayFabBaseModel + { + // [optional] Argument to pass to the CloudScript function. + FJsonKeeper Argument; + + // [optional] Name of the CloudScript function to execute. + FString FunctionName; + + FCloudScriptTaskParameter() : + FPlayFabBaseModel(), + Argument(), + FunctionName() + {} + + FCloudScriptTaskParameter(const FCloudScriptTaskParameter& src) : + FPlayFabBaseModel(), + Argument(src.Argument), + FunctionName(src.FunctionName) + {} + + FCloudScriptTaskParameter(const TSharedPtr& obj) : FCloudScriptTaskParameter() + { + readFromValue(obj); + } + + ~FCloudScriptTaskParameter(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FScriptExecutionError : public FPlayFabBaseModel + { + /** + * [optional] Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, + * CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError + */ + FString Error; + + // [optional] Details about the error + FString Message; + + // [optional] Point during the execution of the script at which the error occurred, if any + FString StackTrace; + + FScriptExecutionError() : + FPlayFabBaseModel(), + Error(), + Message(), + StackTrace() + {} + + FScriptExecutionError(const FScriptExecutionError& src) : + FPlayFabBaseModel(), + Error(src.Error), + Message(src.Message), + StackTrace(src.StackTrace) + {} + + FScriptExecutionError(const TSharedPtr& obj) : FScriptExecutionError() + { + readFromValue(obj); + } + + ~FScriptExecutionError(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLogStatement : public FPlayFabBaseModel + { + // [optional] Optional object accompanying the message as contextual information + FJsonKeeper Data; + + // [optional] 'Debug', 'Info', or 'Error' + FString Level; + + // [optional] undefined + FString Message; + + FLogStatement() : + FPlayFabBaseModel(), + Data(), + Level(), + Message() + {} + + FLogStatement(const FLogStatement& src) : + FPlayFabBaseModel(), + Data(src.Data), + Level(src.Level), + Message(src.Message) + {} + + FLogStatement(const TSharedPtr& obj) : FLogStatement() + { + readFromValue(obj); + } + + ~FLogStatement(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteCloudScriptResult : public FPlayFabBaseModel + { + // Number of PlayFab API requests issued by the CloudScript function + int32 APIRequestsIssued; + + // [optional] Information about the error, if any, that occurred during execution + TSharedPtr Error; + + double ExecutionTimeSeconds; + + // [optional] The name of the function that executed + FString FunctionName; + + // [optional] The object returned from the CloudScript function, if any + FJsonKeeper FunctionResult; + + /** + * [optional] Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + Boxed FunctionResultTooLarge; + + // Number of external HTTP requests issued by the CloudScript function + int32 HttpRequestsIssued; + + /** + * [optional] Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + TArray Logs; + /** + * [optional] Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + Boxed LogsTooLarge; + + uint32 MemoryConsumedBytes; + + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + double ProcessorTimeSeconds; + + // The revision of the CloudScript that executed + int32 Revision; + + FExecuteCloudScriptResult() : + FPlayFabBaseModel(), + APIRequestsIssued(0), + Error(nullptr), + ExecutionTimeSeconds(0), + FunctionName(), + FunctionResult(), + FunctionResultTooLarge(), + HttpRequestsIssued(0), + Logs(), + LogsTooLarge(), + MemoryConsumedBytes(0), + ProcessorTimeSeconds(0), + Revision(0) + {} + + FExecuteCloudScriptResult(const FExecuteCloudScriptResult& src) : + FPlayFabBaseModel(), + APIRequestsIssued(src.APIRequestsIssued), + Error(src.Error.IsValid() ? MakeShareable(new FScriptExecutionError(*src.Error)) : nullptr), + ExecutionTimeSeconds(src.ExecutionTimeSeconds), + FunctionName(src.FunctionName), + FunctionResult(src.FunctionResult), + FunctionResultTooLarge(src.FunctionResultTooLarge), + HttpRequestsIssued(src.HttpRequestsIssued), + Logs(src.Logs), + LogsTooLarge(src.LogsTooLarge), + MemoryConsumedBytes(src.MemoryConsumedBytes), + ProcessorTimeSeconds(src.ProcessorTimeSeconds), + Revision(src.Revision) + {} + + FExecuteCloudScriptResult(const TSharedPtr& obj) : FExecuteCloudScriptResult() + { + readFromValue(obj); + } + + ~FExecuteCloudScriptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCloudScriptTaskSummary : public FPlayFabBaseModel + { + // [optional] UTC timestamp when the task completed. + Boxed CompletedAt; + + // [optional] Estimated time remaining in seconds. + Boxed EstimatedSecondsRemaining; + + // [optional] Progress represented as percentage. + Boxed PercentComplete; + + // [optional] Result of CloudScript execution + TSharedPtr Result; + + // [optional] If manually scheduled, ID of user who scheduled the task. + FString ScheduledByUserId; + + // UTC timestamp when the task started. + FDateTime StartedAt; + + // [optional] Current status of the task instance. + Boxed Status; + + // [optional] Identifier of the task this instance belongs to. + TSharedPtr TaskIdentifier; + + // [optional] ID of the task instance. + FString TaskInstanceId; + + FCloudScriptTaskSummary() : + FPlayFabBaseModel(), + CompletedAt(), + EstimatedSecondsRemaining(), + PercentComplete(), + Result(nullptr), + ScheduledByUserId(), + StartedAt(0), + Status(), + TaskIdentifier(nullptr), + TaskInstanceId() + {} + + FCloudScriptTaskSummary(const FCloudScriptTaskSummary& src) : + FPlayFabBaseModel(), + CompletedAt(src.CompletedAt), + EstimatedSecondsRemaining(src.EstimatedSecondsRemaining), + PercentComplete(src.PercentComplete), + Result(src.Result.IsValid() ? MakeShareable(new FExecuteCloudScriptResult(*src.Result)) : nullptr), + ScheduledByUserId(src.ScheduledByUserId), + StartedAt(src.StartedAt), + Status(src.Status), + TaskIdentifier(src.TaskIdentifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.TaskIdentifier)) : nullptr), + TaskInstanceId(src.TaskInstanceId) + {} + + FCloudScriptTaskSummary(const TSharedPtr& obj) : FCloudScriptTaskSummary() + { + readFromValue(obj); + } + + ~FCloudScriptTaskSummary(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCloudScriptVersionStatus : public FPlayFabBaseModel + { + // Most recent revision for this Cloud Script version + int32 LatestRevision; + + // Published code revision for this Cloud Script version + int32 PublishedRevision; + + // Version number + int32 Version; + + FCloudScriptVersionStatus() : + FPlayFabBaseModel(), + LatestRevision(0), + PublishedRevision(0), + Version(0) + {} + + FCloudScriptVersionStatus(const FCloudScriptVersionStatus& src) : + FPlayFabBaseModel(), + LatestRevision(src.LatestRevision), + PublishedRevision(src.PublishedRevision), + Version(src.Version) + {} + + FCloudScriptVersionStatus(const TSharedPtr& obj) : FCloudScriptVersionStatus() + { + readFromValue(obj); + } + + ~FCloudScriptVersionStatus(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum EmailVerificationStatus + { + EmailVerificationStatusUnverified, + EmailVerificationStatusPending, + EmailVerificationStatusConfirmed + }; + + PLAYFABCPP_API void writeEmailVerificationStatusEnumJSON(EmailVerificationStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API EmailVerificationStatus readEmailVerificationStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API EmailVerificationStatus readEmailVerificationStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FContactEmailInfo : public FPlayFabBaseModel + { + // [optional] The email address + FString EmailAddress; + + // [optional] The name of the email info data + FString Name; + + // [optional] The verification status of the email + Boxed VerificationStatus; + + FContactEmailInfo() : + FPlayFabBaseModel(), + EmailAddress(), + Name(), + VerificationStatus() + {} + + FContactEmailInfo(const FContactEmailInfo& src) : + FPlayFabBaseModel(), + EmailAddress(src.EmailAddress), + Name(src.Name), + VerificationStatus(src.VerificationStatus) + {} + + FContactEmailInfo(const TSharedPtr& obj) : FContactEmailInfo() + { + readFromValue(obj); + } + + ~FContactEmailInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FContactEmailInfoModel : public FPlayFabBaseModel + { + // [optional] The email address + FString EmailAddress; + + // [optional] The name of the email info data + FString Name; + + // [optional] The verification status of the email + Boxed VerificationStatus; + + FContactEmailInfoModel() : + FPlayFabBaseModel(), + EmailAddress(), + Name(), + VerificationStatus() + {} + + FContactEmailInfoModel(const FContactEmailInfoModel& src) : + FPlayFabBaseModel(), + EmailAddress(src.EmailAddress), + Name(src.Name), + VerificationStatus(src.VerificationStatus) + {} + + FContactEmailInfoModel(const TSharedPtr& obj) : FContactEmailInfoModel() + { + readFromValue(obj); + } + + ~FContactEmailInfoModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FContentInfo : public FPlayFabBaseModel + { + // [optional] Key of the content + FString Key; + + // Last modified time + FDateTime LastModified; + + // Size of the content in bytes + uint32 Size; + + FContentInfo() : + FPlayFabBaseModel(), + Key(), + LastModified(0), + Size(0) + {} + + FContentInfo(const FContentInfo& src) : + FPlayFabBaseModel(), + Key(src.Key), + LastModified(src.LastModified), + Size(src.Size) + {} + + FContentInfo(const TSharedPtr& obj) : FContentInfo() + { + readFromValue(obj); + } + + ~FContentInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ContinentCode + { + ContinentCodeAF, + ContinentCodeAN, + ContinentCodeAS, + ContinentCodeEU, + ContinentCodeNA, + ContinentCodeOC, + ContinentCodeSA + }; + + PLAYFABCPP_API void writeContinentCodeEnumJSON(ContinentCode enumVal, JsonWriter& writer); + PLAYFABCPP_API ContinentCode readContinentCodeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ContinentCode readContinentCodeFromValue(const FString& value); + + enum CountryCode + { + CountryCodeAF, + CountryCodeAX, + CountryCodeAL, + CountryCodeDZ, + CountryCodeAS, + CountryCodeAD, + CountryCodeAO, + CountryCodeAI, + CountryCodeAQ, + CountryCodeAG, + CountryCodeAR, + CountryCodeAM, + CountryCodeAW, + CountryCodeAU, + CountryCodeAT, + CountryCodeAZ, + CountryCodeBS, + CountryCodeBH, + CountryCodeBD, + CountryCodeBB, + CountryCodeBY, + CountryCodeBE, + CountryCodeBZ, + CountryCodeBJ, + CountryCodeBM, + CountryCodeBT, + CountryCodeBO, + CountryCodeBQ, + CountryCodeBA, + CountryCodeBW, + CountryCodeBV, + CountryCodeBR, + CountryCodeIO, + CountryCodeBN, + CountryCodeBG, + CountryCodeBF, + CountryCodeBI, + CountryCodeKH, + CountryCodeCM, + CountryCodeCA, + CountryCodeCV, + CountryCodeKY, + CountryCodeCF, + CountryCodeTD, + CountryCodeCL, + CountryCodeCN, + CountryCodeCX, + CountryCodeCC, + CountryCodeCO, + CountryCodeKM, + CountryCodeCG, + CountryCodeCD, + CountryCodeCK, + CountryCodeCR, + CountryCodeCI, + CountryCodeHR, + CountryCodeCU, + CountryCodeCW, + CountryCodeCY, + CountryCodeCZ, + CountryCodeDK, + CountryCodeDJ, + CountryCodeDM, + CountryCodeDO, + CountryCodeEC, + CountryCodeEG, + CountryCodeSV, + CountryCodeGQ, + CountryCodeER, + CountryCodeEE, + CountryCodeET, + CountryCodeFK, + CountryCodeFO, + CountryCodeFJ, + CountryCodeFI, + CountryCodeFR, + CountryCodeGF, + CountryCodePF, + CountryCodeTF, + CountryCodeGA, + CountryCodeGM, + CountryCodeGE, + CountryCodeDE, + CountryCodeGH, + CountryCodeGI, + CountryCodeGR, + CountryCodeGL, + CountryCodeGD, + CountryCodeGP, + CountryCodeGU, + CountryCodeGT, + CountryCodeGG, + CountryCodeGN, + CountryCodeGW, + CountryCodeGY, + CountryCodeHT, + CountryCodeHM, + CountryCodeVA, + CountryCodeHN, + CountryCodeHK, + CountryCodeHU, + CountryCodeIS, + CountryCodeIN, + CountryCodeID, + CountryCodeIR, + CountryCodeIQ, + CountryCodeIE, + CountryCodeIM, + CountryCodeIL, + CountryCodeIT, + CountryCodeJM, + CountryCodeJP, + CountryCodeJE, + CountryCodeJO, + CountryCodeKZ, + CountryCodeKE, + CountryCodeKI, + CountryCodeKP, + CountryCodeKR, + CountryCodeKW, + CountryCodeKG, + CountryCodeLA, + CountryCodeLV, + CountryCodeLB, + CountryCodeLS, + CountryCodeLR, + CountryCodeLY, + CountryCodeLI, + CountryCodeLT, + CountryCodeLU, + CountryCodeMO, + CountryCodeMK, + CountryCodeMG, + CountryCodeMW, + CountryCodeMY, + CountryCodeMV, + CountryCodeML, + CountryCodeMT, + CountryCodeMH, + CountryCodeMQ, + CountryCodeMR, + CountryCodeMU, + CountryCodeYT, + CountryCodeMX, + CountryCodeFM, + CountryCodeMD, + CountryCodeMC, + CountryCodeMN, + CountryCodeME, + CountryCodeMS, + CountryCodeMA, + CountryCodeMZ, + CountryCodeMM, + CountryCodeNA, + CountryCodeNR, + CountryCodeNP, + CountryCodeNL, + CountryCodeNC, + CountryCodeNZ, + CountryCodeNI, + CountryCodeNE, + CountryCodeNG, + CountryCodeNU, + CountryCodeNF, + CountryCodeMP, + CountryCodeNO, + CountryCodeOM, + CountryCodePK, + CountryCodePW, + CountryCodePS, + CountryCodePA, + CountryCodePG, + CountryCodePY, + CountryCodePE, + CountryCodePH, + CountryCodePN, + CountryCodePL, + CountryCodePT, + CountryCodePR, + CountryCodeQA, + CountryCodeRE, + CountryCodeRO, + CountryCodeRU, + CountryCodeRW, + CountryCodeBL, + CountryCodeSH, + CountryCodeKN, + CountryCodeLC, + CountryCodeMF, + CountryCodePM, + CountryCodeVC, + CountryCodeWS, + CountryCodeSM, + CountryCodeST, + CountryCodeSA, + CountryCodeSN, + CountryCodeRS, + CountryCodeSC, + CountryCodeSL, + CountryCodeSG, + CountryCodeSX, + CountryCodeSK, + CountryCodeSI, + CountryCodeSB, + CountryCodeSO, + CountryCodeZA, + CountryCodeGS, + CountryCodeSS, + CountryCodeES, + CountryCodeLK, + CountryCodeSD, + CountryCodeSR, + CountryCodeSJ, + CountryCodeSZ, + CountryCodeSE, + CountryCodeCH, + CountryCodeSY, + CountryCodeTW, + CountryCodeTJ, + CountryCodeTZ, + CountryCodeTH, + CountryCodeTL, + CountryCodeTG, + CountryCodeTK, + CountryCodeTO, + CountryCodeTT, + CountryCodeTN, + CountryCodeTR, + CountryCodeTM, + CountryCodeTC, + CountryCodeTV, + CountryCodeUG, + CountryCodeUA, + CountryCodeAE, + CountryCodeGB, + CountryCodeUS, + CountryCodeUM, + CountryCodeUY, + CountryCodeUZ, + CountryCodeVU, + CountryCodeVE, + CountryCodeVN, + CountryCodeVG, + CountryCodeVI, + CountryCodeWF, + CountryCodeEH, + CountryCodeYE, + CountryCodeZM, + CountryCodeZW + }; + + PLAYFABCPP_API void writeCountryCodeEnumJSON(CountryCode enumVal, JsonWriter& writer); + PLAYFABCPP_API CountryCode readCountryCodeFromValue(const TSharedPtr& value); + PLAYFABCPP_API CountryCode readCountryCodeFromValue(const FString& value); + + struct PLAYFABCPP_API FCreateActionsOnPlayerSegmentTaskRequest : public FPlayFabBaseModel + { + // [optional] Description the task + FString Description; + + // Whether the schedule is active. Inactive schedule will not trigger task execution. + bool IsActive; + + // Name of the task. This is a unique identifier for tasks in the title. + FString Name; + + // Task details related to segment and action + FActionsOnPlayersInSegmentTaskParameter Parameter; + + // [optional] Cron expression for the run schedule of the task. The expression should be in UTC. + FString Schedule; + + FCreateActionsOnPlayerSegmentTaskRequest() : + FPlayFabBaseModel(), + Description(), + IsActive(false), + Name(), + Parameter(), + Schedule() + {} + + FCreateActionsOnPlayerSegmentTaskRequest(const FCreateActionsOnPlayerSegmentTaskRequest& src) : + FPlayFabBaseModel(), + Description(src.Description), + IsActive(src.IsActive), + Name(src.Name), + Parameter(src.Parameter), + Schedule(src.Schedule) + {} + + FCreateActionsOnPlayerSegmentTaskRequest(const TSharedPtr& obj) : FCreateActionsOnPlayerSegmentTaskRequest() + { + readFromValue(obj); + } + + ~FCreateActionsOnPlayerSegmentTaskRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateCloudScriptTaskRequest : public FPlayFabBaseModel + { + // [optional] Description the task + FString Description; + + // Whether the schedule is active. Inactive schedule will not trigger task execution. + bool IsActive; + + // Name of the task. This is a unique identifier for tasks in the title. + FString Name; + + // Task details related to CloudScript + FCloudScriptTaskParameter Parameter; + + // [optional] Cron expression for the run schedule of the task. The expression should be in UTC. + FString Schedule; + + FCreateCloudScriptTaskRequest() : + FPlayFabBaseModel(), + Description(), + IsActive(false), + Name(), + Parameter(), + Schedule() + {} + + FCreateCloudScriptTaskRequest(const FCreateCloudScriptTaskRequest& src) : + FPlayFabBaseModel(), + Description(src.Description), + IsActive(src.IsActive), + Name(src.Name), + Parameter(src.Parameter), + Schedule(src.Schedule) + {} + + FCreateCloudScriptTaskRequest(const TSharedPtr& obj) : FCreateCloudScriptTaskRequest() + { + readFromValue(obj); + } + + ~FCreateCloudScriptTaskRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreatePlayerSharedSecretRequest : public FPlayFabBaseModel + { + // [optional] Friendly name for this key + FString FriendlyName; + + FCreatePlayerSharedSecretRequest() : + FPlayFabBaseModel(), + FriendlyName() + {} + + FCreatePlayerSharedSecretRequest(const FCreatePlayerSharedSecretRequest& src) : + FPlayFabBaseModel(), + FriendlyName(src.FriendlyName) + {} + + FCreatePlayerSharedSecretRequest(const TSharedPtr& obj) : FCreatePlayerSharedSecretRequest() + { + readFromValue(obj); + } + + ~FCreatePlayerSharedSecretRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreatePlayerSharedSecretResult : public FPlayFabBaseModel + { + // [optional] The player shared secret to use when calling Client/GetTitlePublicKey + FString SecretKey; + + FCreatePlayerSharedSecretResult() : + FPlayFabBaseModel(), + SecretKey() + {} + + FCreatePlayerSharedSecretResult(const FCreatePlayerSharedSecretResult& src) : + FPlayFabBaseModel(), + SecretKey(src.SecretKey) + {} + + FCreatePlayerSharedSecretResult(const TSharedPtr& obj) : FCreatePlayerSharedSecretResult() + { + readFromValue(obj); + } + + ~FCreatePlayerSharedSecretResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum StatisticAggregationMethod + { + StatisticAggregationMethodLast, + StatisticAggregationMethodMin, + StatisticAggregationMethodMax, + StatisticAggregationMethodSum + }; + + PLAYFABCPP_API void writeStatisticAggregationMethodEnumJSON(StatisticAggregationMethod enumVal, JsonWriter& writer); + PLAYFABCPP_API StatisticAggregationMethod readStatisticAggregationMethodFromValue(const TSharedPtr& value); + PLAYFABCPP_API StatisticAggregationMethod readStatisticAggregationMethodFromValue(const FString& value); + + enum StatisticResetIntervalOption + { + StatisticResetIntervalOptionNever, + StatisticResetIntervalOptionHour, + StatisticResetIntervalOptionDay, + StatisticResetIntervalOptionWeek, + StatisticResetIntervalOptionMonth + }; + + PLAYFABCPP_API void writeStatisticResetIntervalOptionEnumJSON(StatisticResetIntervalOption enumVal, JsonWriter& writer); + PLAYFABCPP_API StatisticResetIntervalOption readStatisticResetIntervalOptionFromValue(const TSharedPtr& value); + PLAYFABCPP_API StatisticResetIntervalOption readStatisticResetIntervalOptionFromValue(const FString& value); + + struct PLAYFABCPP_API FCreatePlayerStatisticDefinitionRequest : public FPlayFabBaseModel + { + // [optional] the aggregation method to use in updating the statistic (defaults to last) + Boxed AggregationMethod; + + // unique name of the statistic + FString StatisticName; + + // [optional] interval at which the values of the statistic for all players are reset (resets begin at the next interval boundary) + Boxed VersionChangeInterval; + + FCreatePlayerStatisticDefinitionRequest() : + FPlayFabBaseModel(), + AggregationMethod(), + StatisticName(), + VersionChangeInterval() + {} + + FCreatePlayerStatisticDefinitionRequest(const FCreatePlayerStatisticDefinitionRequest& src) : + FPlayFabBaseModel(), + AggregationMethod(src.AggregationMethod), + StatisticName(src.StatisticName), + VersionChangeInterval(src.VersionChangeInterval) + {} + + FCreatePlayerStatisticDefinitionRequest(const TSharedPtr& obj) : FCreatePlayerStatisticDefinitionRequest() + { + readFromValue(obj); + } + + ~FCreatePlayerStatisticDefinitionRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerStatisticDefinition : public FPlayFabBaseModel + { + // [optional] the aggregation method to use in updating the statistic (defaults to last) + Boxed AggregationMethod; + + // current active version of the statistic, incremented each time the statistic resets + uint32 CurrentVersion; + + // [optional] unique name of the statistic + FString StatisticName; + + // [optional] interval at which the values of the statistic for all players are reset automatically + Boxed VersionChangeInterval; + + FPlayerStatisticDefinition() : + FPlayFabBaseModel(), + AggregationMethod(), + CurrentVersion(0), + StatisticName(), + VersionChangeInterval() + {} + + FPlayerStatisticDefinition(const FPlayerStatisticDefinition& src) : + FPlayFabBaseModel(), + AggregationMethod(src.AggregationMethod), + CurrentVersion(src.CurrentVersion), + StatisticName(src.StatisticName), + VersionChangeInterval(src.VersionChangeInterval) + {} + + FPlayerStatisticDefinition(const TSharedPtr& obj) : FPlayerStatisticDefinition() + { + readFromValue(obj); + } + + ~FPlayerStatisticDefinition(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreatePlayerStatisticDefinitionResult : public FPlayFabBaseModel + { + // [optional] created statistic definition + TSharedPtr Statistic; + + FCreatePlayerStatisticDefinitionResult() : + FPlayFabBaseModel(), + Statistic(nullptr) + {} + + FCreatePlayerStatisticDefinitionResult(const FCreatePlayerStatisticDefinitionResult& src) : + FPlayFabBaseModel(), + Statistic(src.Statistic.IsValid() ? MakeShareable(new FPlayerStatisticDefinition(*src.Statistic)) : nullptr) + {} + + FCreatePlayerStatisticDefinitionResult(const TSharedPtr& obj) : FCreatePlayerStatisticDefinitionResult() + { + readFromValue(obj); + } + + ~FCreatePlayerStatisticDefinitionResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateTaskResult : public FPlayFabBaseModel + { + // [optional] ID of the task + FString TaskId; + + FCreateTaskResult() : + FPlayFabBaseModel(), + TaskId() + {} + + FCreateTaskResult(const FCreateTaskResult& src) : + FPlayFabBaseModel(), + TaskId(src.TaskId) + {} + + FCreateTaskResult(const TSharedPtr& obj) : FCreateTaskResult() + { + readFromValue(obj); + } + + ~FCreateTaskResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum Currency + { + CurrencyAED, + CurrencyAFN, + CurrencyALL, + CurrencyAMD, + CurrencyANG, + CurrencyAOA, + CurrencyARS, + CurrencyAUD, + CurrencyAWG, + CurrencyAZN, + CurrencyBAM, + CurrencyBBD, + CurrencyBDT, + CurrencyBGN, + CurrencyBHD, + CurrencyBIF, + CurrencyBMD, + CurrencyBND, + CurrencyBOB, + CurrencyBRL, + CurrencyBSD, + CurrencyBTN, + CurrencyBWP, + CurrencyBYR, + CurrencyBZD, + CurrencyCAD, + CurrencyCDF, + CurrencyCHF, + CurrencyCLP, + CurrencyCNY, + CurrencyCOP, + CurrencyCRC, + CurrencyCUC, + CurrencyCUP, + CurrencyCVE, + CurrencyCZK, + CurrencyDJF, + CurrencyDKK, + CurrencyDOP, + CurrencyDZD, + CurrencyEGP, + CurrencyERN, + CurrencyETB, + CurrencyEUR, + CurrencyFJD, + CurrencyFKP, + CurrencyGBP, + CurrencyGEL, + CurrencyGGP, + CurrencyGHS, + CurrencyGIP, + CurrencyGMD, + CurrencyGNF, + CurrencyGTQ, + CurrencyGYD, + CurrencyHKD, + CurrencyHNL, + CurrencyHRK, + CurrencyHTG, + CurrencyHUF, + CurrencyIDR, + CurrencyILS, + CurrencyIMP, + CurrencyINR, + CurrencyIQD, + CurrencyIRR, + CurrencyISK, + CurrencyJEP, + CurrencyJMD, + CurrencyJOD, + CurrencyJPY, + CurrencyKES, + CurrencyKGS, + CurrencyKHR, + CurrencyKMF, + CurrencyKPW, + CurrencyKRW, + CurrencyKWD, + CurrencyKYD, + CurrencyKZT, + CurrencyLAK, + CurrencyLBP, + CurrencyLKR, + CurrencyLRD, + CurrencyLSL, + CurrencyLYD, + CurrencyMAD, + CurrencyMDL, + CurrencyMGA, + CurrencyMKD, + CurrencyMMK, + CurrencyMNT, + CurrencyMOP, + CurrencyMRO, + CurrencyMUR, + CurrencyMVR, + CurrencyMWK, + CurrencyMXN, + CurrencyMYR, + CurrencyMZN, + CurrencyNAD, + CurrencyNGN, + CurrencyNIO, + CurrencyNOK, + CurrencyNPR, + CurrencyNZD, + CurrencyOMR, + CurrencyPAB, + CurrencyPEN, + CurrencyPGK, + CurrencyPHP, + CurrencyPKR, + CurrencyPLN, + CurrencyPYG, + CurrencyQAR, + CurrencyRON, + CurrencyRSD, + CurrencyRUB, + CurrencyRWF, + CurrencySAR, + CurrencySBD, + CurrencySCR, + CurrencySDG, + CurrencySEK, + CurrencySGD, + CurrencySHP, + CurrencySLL, + CurrencySOS, + CurrencySPL, + CurrencySRD, + CurrencySTD, + CurrencySVC, + CurrencySYP, + CurrencySZL, + CurrencyTHB, + CurrencyTJS, + CurrencyTMT, + CurrencyTND, + CurrencyTOP, + CurrencyTRY, + CurrencyTTD, + CurrencyTVD, + CurrencyTWD, + CurrencyTZS, + CurrencyUAH, + CurrencyUGX, + CurrencyUSD, + CurrencyUYU, + CurrencyUZS, + CurrencyVEF, + CurrencyVND, + CurrencyVUV, + CurrencyWST, + CurrencyXAF, + CurrencyXCD, + CurrencyXDR, + CurrencyXOF, + CurrencyXPF, + CurrencyYER, + CurrencyZAR, + CurrencyZMW, + CurrencyZWD + }; + + PLAYFABCPP_API void writeCurrencyEnumJSON(Currency enumVal, JsonWriter& writer); + PLAYFABCPP_API Currency readCurrencyFromValue(const TSharedPtr& value); + PLAYFABCPP_API Currency readCurrencyFromValue(const FString& value); + + struct PLAYFABCPP_API FDeleteContentRequest : public FPlayFabBaseModel + { + // Key of the content item to be deleted + FString Key; + + FDeleteContentRequest() : + FPlayFabBaseModel(), + Key() + {} + + FDeleteContentRequest(const FDeleteContentRequest& src) : + FPlayFabBaseModel(), + Key(src.Key) + {} + + FDeleteContentRequest(const TSharedPtr& obj) : FDeleteContentRequest() + { + readFromValue(obj); + } + + ~FDeleteContentRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteMasterPlayerAccountRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FDeleteMasterPlayerAccountRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FDeleteMasterPlayerAccountRequest(const FDeleteMasterPlayerAccountRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FDeleteMasterPlayerAccountRequest(const TSharedPtr& obj) : FDeleteMasterPlayerAccountRequest() + { + readFromValue(obj); + } + + ~FDeleteMasterPlayerAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteMasterPlayerAccountResult : public FPlayFabBaseModel + { + /** + * [optional] A notification email with this job receipt Id will be sent to the title notification email address when deletion is + * complete. + */ + FString JobReceiptId; + + // [optional] List of titles from which the player's data will be deleted. + TArray TitleIds; + FDeleteMasterPlayerAccountResult() : + FPlayFabBaseModel(), + JobReceiptId(), + TitleIds() + {} + + FDeleteMasterPlayerAccountResult(const FDeleteMasterPlayerAccountResult& src) : + FPlayFabBaseModel(), + JobReceiptId(src.JobReceiptId), + TitleIds(src.TitleIds) + {} + + FDeleteMasterPlayerAccountResult(const TSharedPtr& obj) : FDeleteMasterPlayerAccountResult() + { + readFromValue(obj); + } + + ~FDeleteMasterPlayerAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeletePlayerRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FDeletePlayerRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FDeletePlayerRequest(const FDeletePlayerRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FDeletePlayerRequest(const TSharedPtr& obj) : FDeletePlayerRequest() + { + readFromValue(obj); + } + + ~FDeletePlayerRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeletePlayerResult : public FPlayFabBaseModel + { + FDeletePlayerResult() : + FPlayFabBaseModel() + {} + + FDeletePlayerResult(const FDeletePlayerResult& src) : + FPlayFabBaseModel() + {} + + FDeletePlayerResult(const TSharedPtr& obj) : FDeletePlayerResult() + { + readFromValue(obj); + } + + ~FDeletePlayerResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeletePlayerSharedSecretRequest : public FPlayFabBaseModel + { + // [optional] The shared secret key to delete + FString SecretKey; + + FDeletePlayerSharedSecretRequest() : + FPlayFabBaseModel(), + SecretKey() + {} + + FDeletePlayerSharedSecretRequest(const FDeletePlayerSharedSecretRequest& src) : + FPlayFabBaseModel(), + SecretKey(src.SecretKey) + {} + + FDeletePlayerSharedSecretRequest(const TSharedPtr& obj) : FDeletePlayerSharedSecretRequest() + { + readFromValue(obj); + } + + ~FDeletePlayerSharedSecretRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeletePlayerSharedSecretResult : public FPlayFabBaseModel + { + FDeletePlayerSharedSecretResult() : + FPlayFabBaseModel() + {} + + FDeletePlayerSharedSecretResult(const FDeletePlayerSharedSecretResult& src) : + FPlayFabBaseModel() + {} + + FDeletePlayerSharedSecretResult(const TSharedPtr& obj) : FDeletePlayerSharedSecretResult() + { + readFromValue(obj); + } + + ~FDeletePlayerSharedSecretResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteStoreRequest : public FPlayFabBaseModel + { + // [optional] catalog version of the store to delete. If null, uses the default catalog. + FString CatalogVersion; + + // unqiue identifier for the store which is to be deleted + FString StoreId; + + FDeleteStoreRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + StoreId() + {} + + FDeleteStoreRequest(const FDeleteStoreRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + StoreId(src.StoreId) + {} + + FDeleteStoreRequest(const TSharedPtr& obj) : FDeleteStoreRequest() + { + readFromValue(obj); + } + + ~FDeleteStoreRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteStoreResult : public FPlayFabBaseModel + { + FDeleteStoreResult() : + FPlayFabBaseModel() + {} + + FDeleteStoreResult(const FDeleteStoreResult& src) : + FPlayFabBaseModel() + {} + + FDeleteStoreResult(const TSharedPtr& obj) : FDeleteStoreResult() + { + readFromValue(obj); + } + + ~FDeleteStoreResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteTaskRequest : public FPlayFabBaseModel + { + // [optional] Specify either the task ID or the name of task to be deleted. + TSharedPtr Identifier; + + FDeleteTaskRequest() : + FPlayFabBaseModel(), + Identifier(nullptr) + {} + + FDeleteTaskRequest(const FDeleteTaskRequest& src) : + FPlayFabBaseModel(), + Identifier(src.Identifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.Identifier)) : nullptr) + {} + + FDeleteTaskRequest(const TSharedPtr& obj) : FDeleteTaskRequest() + { + readFromValue(obj); + } + + ~FDeleteTaskRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteTitleRequest : public FPlayFabBaseModel + { + FDeleteTitleRequest() : + FPlayFabBaseModel() + {} + + FDeleteTitleRequest(const FDeleteTitleRequest& src) : + FPlayFabBaseModel() + {} + + FDeleteTitleRequest(const TSharedPtr& obj) : FDeleteTitleRequest() + { + readFromValue(obj); + } + + ~FDeleteTitleRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteTitleResult : public FPlayFabBaseModel + { + FDeleteTitleResult() : + FPlayFabBaseModel() + {} + + FDeleteTitleResult(const FDeleteTitleResult& src) : + FPlayFabBaseModel() + {} + + FDeleteTitleResult(const TSharedPtr& obj) : FDeleteTitleResult() + { + readFromValue(obj); + } + + ~FDeleteTitleResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum EffectType + { + EffectTypeAllow, + EffectTypeDeny + }; + + PLAYFABCPP_API void writeEffectTypeEnumJSON(EffectType enumVal, JsonWriter& writer); + PLAYFABCPP_API EffectType readEffectTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API EffectType readEffectTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FEmptyResponse : public FPlayFabBaseModel + { + FEmptyResponse() : + FPlayFabBaseModel() + {} + + FEmptyResponse(const FEmptyResponse& src) : + FPlayFabBaseModel() + {} + + FEmptyResponse(const TSharedPtr& obj) : FEmptyResponse() + { + readFromValue(obj); + } + + ~FEmptyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExportMasterPlayerDataRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FExportMasterPlayerDataRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FExportMasterPlayerDataRequest(const FExportMasterPlayerDataRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FExportMasterPlayerDataRequest(const TSharedPtr& obj) : FExportMasterPlayerDataRequest() + { + readFromValue(obj); + } + + ~FExportMasterPlayerDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExportMasterPlayerDataResult : public FPlayFabBaseModel + { + /** + * [optional] An email with this job receipt Id containing the export download link will be sent to the title notification email + * address when the export is complete. + */ + FString JobReceiptId; + + FExportMasterPlayerDataResult() : + FPlayFabBaseModel(), + JobReceiptId() + {} + + FExportMasterPlayerDataResult(const FExportMasterPlayerDataResult& src) : + FPlayFabBaseModel(), + JobReceiptId(src.JobReceiptId) + {} + + FExportMasterPlayerDataResult(const TSharedPtr& obj) : FExportMasterPlayerDataResult() + { + readFromValue(obj); + } + + ~FExportMasterPlayerDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGameModeInfo : public FPlayFabBaseModel + { + // specific game mode type + FString Gamemode; + + // maximum user count a specific Game Server Instance can support + uint32 MaxPlayerCount; + + // minimum user count required for this Game Server Instance to continue (usually 1) + uint32 MinPlayerCount; + + // [optional] whether to start as an open session, meaning that players can matchmake into it (defaults to true) + Boxed StartOpen; + + FGameModeInfo() : + FPlayFabBaseModel(), + Gamemode(), + MaxPlayerCount(0), + MinPlayerCount(0), + StartOpen() + {} + + FGameModeInfo(const FGameModeInfo& src) : + FPlayFabBaseModel(), + Gamemode(src.Gamemode), + MaxPlayerCount(src.MaxPlayerCount), + MinPlayerCount(src.MinPlayerCount), + StartOpen(src.StartOpen) + {} + + FGameModeInfo(const TSharedPtr& obj) : FGameModeInfo() + { + readFromValue(obj); + } + + ~FGameModeInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetActionsOnPlayersInSegmentTaskInstanceResult : public FPlayFabBaseModel + { + // [optional] Parameter of this task instance + TSharedPtr Parameter; + + // [optional] Status summary of the actions-on-players-in-segment task instance + TSharedPtr Summary; + + FGetActionsOnPlayersInSegmentTaskInstanceResult() : + FPlayFabBaseModel(), + Parameter(nullptr), + Summary(nullptr) + {} + + FGetActionsOnPlayersInSegmentTaskInstanceResult(const FGetActionsOnPlayersInSegmentTaskInstanceResult& src) : + FPlayFabBaseModel(), + Parameter(src.Parameter.IsValid() ? MakeShareable(new FActionsOnPlayersInSegmentTaskParameter(*src.Parameter)) : nullptr), + Summary(src.Summary.IsValid() ? MakeShareable(new FActionsOnPlayersInSegmentTaskSummary(*src.Summary)) : nullptr) + {} + + FGetActionsOnPlayersInSegmentTaskInstanceResult(const TSharedPtr& obj) : FGetActionsOnPlayersInSegmentTaskInstanceResult() + { + readFromValue(obj); + } + + ~FGetActionsOnPlayersInSegmentTaskInstanceResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetAllSegmentsRequest : public FPlayFabBaseModel + { + FGetAllSegmentsRequest() : + FPlayFabBaseModel() + {} + + FGetAllSegmentsRequest(const FGetAllSegmentsRequest& src) : + FPlayFabBaseModel() + {} + + FGetAllSegmentsRequest(const TSharedPtr& obj) : FGetAllSegmentsRequest() + { + readFromValue(obj); + } + + ~FGetAllSegmentsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSegmentResult : public FPlayFabBaseModel + { + // [optional] Identifier of the segments AB Test, if it is attached to one. + FString ABTestParent; + + // Unique identifier for this segment. + FString Id; + + // [optional] Segment name. + FString Name; + + FGetSegmentResult() : + FPlayFabBaseModel(), + ABTestParent(), + Id(), + Name() + {} + + FGetSegmentResult(const FGetSegmentResult& src) : + FPlayFabBaseModel(), + ABTestParent(src.ABTestParent), + Id(src.Id), + Name(src.Name) + {} + + FGetSegmentResult(const TSharedPtr& obj) : FGetSegmentResult() + { + readFromValue(obj); + } + + ~FGetSegmentResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetAllSegmentsResult : public FPlayFabBaseModel + { + // [optional] Array of segments for this title. + TArray Segments; + FGetAllSegmentsResult() : + FPlayFabBaseModel(), + Segments() + {} + + FGetAllSegmentsResult(const FGetAllSegmentsResult& src) : + FPlayFabBaseModel(), + Segments(src.Segments) + {} + + FGetAllSegmentsResult(const TSharedPtr& obj) : FGetAllSegmentsResult() + { + readFromValue(obj); + } + + ~FGetAllSegmentsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCatalogItemsRequest : public FPlayFabBaseModel + { + // [optional] Which catalog is being requested. If null, uses the default catalog. + FString CatalogVersion; + + FGetCatalogItemsRequest() : + FPlayFabBaseModel(), + CatalogVersion() + {} + + FGetCatalogItemsRequest(const FGetCatalogItemsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion) + {} + + FGetCatalogItemsRequest(const TSharedPtr& obj) : FGetCatalogItemsRequest() + { + readFromValue(obj); + } + + ~FGetCatalogItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCatalogItemsResult : public FPlayFabBaseModel + { + // [optional] Array of items which can be purchased. + TArray Catalog; + FGetCatalogItemsResult() : + FPlayFabBaseModel(), + Catalog() + {} + + FGetCatalogItemsResult(const FGetCatalogItemsResult& src) : + FPlayFabBaseModel(), + Catalog(src.Catalog) + {} + + FGetCatalogItemsResult(const TSharedPtr& obj) : FGetCatalogItemsResult() + { + readFromValue(obj); + } + + ~FGetCatalogItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCloudScriptRevisionRequest : public FPlayFabBaseModel + { + // [optional] Revision number. If left null, defaults to the latest revision + Boxed Revision; + + // [optional] Version number. If left null, defaults to the latest version + Boxed Version; + + FGetCloudScriptRevisionRequest() : + FPlayFabBaseModel(), + Revision(), + Version() + {} + + FGetCloudScriptRevisionRequest(const FGetCloudScriptRevisionRequest& src) : + FPlayFabBaseModel(), + Revision(src.Revision), + Version(src.Version) + {} + + FGetCloudScriptRevisionRequest(const TSharedPtr& obj) : FGetCloudScriptRevisionRequest() + { + readFromValue(obj); + } + + ~FGetCloudScriptRevisionRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCloudScriptRevisionResult : public FPlayFabBaseModel + { + // Time this revision was created + FDateTime CreatedAt; + + // [optional] List of Cloud Script files in this revision. + TArray Files; + // True if this is the currently published revision + bool IsPublished; + + // Revision number. + int32 Revision; + + // Version number. + int32 Version; + + FGetCloudScriptRevisionResult() : + FPlayFabBaseModel(), + CreatedAt(0), + Files(), + IsPublished(false), + Revision(0), + Version(0) + {} + + FGetCloudScriptRevisionResult(const FGetCloudScriptRevisionResult& src) : + FPlayFabBaseModel(), + CreatedAt(src.CreatedAt), + Files(src.Files), + IsPublished(src.IsPublished), + Revision(src.Revision), + Version(src.Version) + {} + + FGetCloudScriptRevisionResult(const TSharedPtr& obj) : FGetCloudScriptRevisionResult() + { + readFromValue(obj); + } + + ~FGetCloudScriptRevisionResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCloudScriptTaskInstanceResult : public FPlayFabBaseModel + { + // [optional] Parameter of this task instance + TSharedPtr Parameter; + + // [optional] Status summary of the CloudScript task instance + TSharedPtr Summary; + + FGetCloudScriptTaskInstanceResult() : + FPlayFabBaseModel(), + Parameter(nullptr), + Summary(nullptr) + {} + + FGetCloudScriptTaskInstanceResult(const FGetCloudScriptTaskInstanceResult& src) : + FPlayFabBaseModel(), + Parameter(src.Parameter.IsValid() ? MakeShareable(new FCloudScriptTaskParameter(*src.Parameter)) : nullptr), + Summary(src.Summary.IsValid() ? MakeShareable(new FCloudScriptTaskSummary(*src.Summary)) : nullptr) + {} + + FGetCloudScriptTaskInstanceResult(const TSharedPtr& obj) : FGetCloudScriptTaskInstanceResult() + { + readFromValue(obj); + } + + ~FGetCloudScriptTaskInstanceResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCloudScriptVersionsRequest : public FPlayFabBaseModel + { + FGetCloudScriptVersionsRequest() : + FPlayFabBaseModel() + {} + + FGetCloudScriptVersionsRequest(const FGetCloudScriptVersionsRequest& src) : + FPlayFabBaseModel() + {} + + FGetCloudScriptVersionsRequest(const TSharedPtr& obj) : FGetCloudScriptVersionsRequest() + { + readFromValue(obj); + } + + ~FGetCloudScriptVersionsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCloudScriptVersionsResult : public FPlayFabBaseModel + { + // [optional] List of versions + TArray Versions; + FGetCloudScriptVersionsResult() : + FPlayFabBaseModel(), + Versions() + {} + + FGetCloudScriptVersionsResult(const FGetCloudScriptVersionsResult& src) : + FPlayFabBaseModel(), + Versions(src.Versions) + {} + + FGetCloudScriptVersionsResult(const TSharedPtr& obj) : FGetCloudScriptVersionsResult() + { + readFromValue(obj); + } + + ~FGetCloudScriptVersionsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentListRequest : public FPlayFabBaseModel + { + /** + * [optional] Limits the response to keys that begin with the specified prefix. You can use prefixes to list contents under a folder, + * or for a specified version, etc. + */ + FString Prefix; + + FGetContentListRequest() : + FPlayFabBaseModel(), + Prefix() + {} + + FGetContentListRequest(const FGetContentListRequest& src) : + FPlayFabBaseModel(), + Prefix(src.Prefix) + {} + + FGetContentListRequest(const TSharedPtr& obj) : FGetContentListRequest() + { + readFromValue(obj); + } + + ~FGetContentListRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentListResult : public FPlayFabBaseModel + { + // [optional] List of content items. + TArray Contents; + // Number of content items returned. We currently have a maximum of 1000 items limit. + int32 ItemCount; + + // The total size of listed contents in bytes. + uint32 TotalSize; + + FGetContentListResult() : + FPlayFabBaseModel(), + Contents(), + ItemCount(0), + TotalSize(0) + {} + + FGetContentListResult(const FGetContentListResult& src) : + FPlayFabBaseModel(), + Contents(src.Contents), + ItemCount(src.ItemCount), + TotalSize(src.TotalSize) + {} + + FGetContentListResult(const TSharedPtr& obj) : FGetContentListResult() + { + readFromValue(obj); + } + + ~FGetContentListResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentUploadUrlRequest : public FPlayFabBaseModel + { + /** + * [optional] A standard MIME type describing the format of the contents. The same MIME type has to be set in the header when + * uploading the content. If not specified, the MIME type is 'binary/octet-stream' by default. + */ + FString ContentType; + + // Key of the content item to upload, usually formatted as a path, e.g. images/a.png + FString Key; + + FGetContentUploadUrlRequest() : + FPlayFabBaseModel(), + ContentType(), + Key() + {} + + FGetContentUploadUrlRequest(const FGetContentUploadUrlRequest& src) : + FPlayFabBaseModel(), + ContentType(src.ContentType), + Key(src.Key) + {} + + FGetContentUploadUrlRequest(const TSharedPtr& obj) : FGetContentUploadUrlRequest() + { + readFromValue(obj); + } + + ~FGetContentUploadUrlRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentUploadUrlResult : public FPlayFabBaseModel + { + // [optional] URL for uploading content via HTTP PUT method. The URL will expire in approximately one hour. + FString URL; + + FGetContentUploadUrlResult() : + FPlayFabBaseModel(), + URL() + {} + + FGetContentUploadUrlResult(const FGetContentUploadUrlResult& src) : + FPlayFabBaseModel(), + URL(src.URL) + {} + + FGetContentUploadUrlResult(const TSharedPtr& obj) : FGetContentUploadUrlResult() + { + readFromValue(obj); + } + + ~FGetContentUploadUrlResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetDataReportRequest : public FPlayFabBaseModel + { + // Reporting year (UTC) + int32 Day; + + // Reporting month (UTC) + int32 Month; + + // Report name + FString ReportName; + + // Reporting year (UTC) + int32 Year; + + FGetDataReportRequest() : + FPlayFabBaseModel(), + Day(0), + Month(0), + ReportName(), + Year(0) + {} + + FGetDataReportRequest(const FGetDataReportRequest& src) : + FPlayFabBaseModel(), + Day(src.Day), + Month(src.Month), + ReportName(src.ReportName), + Year(src.Year) + {} + + FGetDataReportRequest(const TSharedPtr& obj) : FGetDataReportRequest() + { + readFromValue(obj); + } + + ~FGetDataReportRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetDataReportResult : public FPlayFabBaseModel + { + // [optional] The URL where the requested report can be downloaded. + FString DownloadUrl; + + FGetDataReportResult() : + FPlayFabBaseModel(), + DownloadUrl() + {} + + FGetDataReportResult(const FGetDataReportResult& src) : + FPlayFabBaseModel(), + DownloadUrl(src.DownloadUrl) + {} + + FGetDataReportResult(const TSharedPtr& obj) : FGetDataReportResult() + { + readFromValue(obj); + } + + ~FGetDataReportResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetMatchmakerGameInfoRequest : public FPlayFabBaseModel + { + // unique identifier of the lobby for which info is being requested + FString LobbyId; + + FGetMatchmakerGameInfoRequest() : + FPlayFabBaseModel(), + LobbyId() + {} + + FGetMatchmakerGameInfoRequest(const FGetMatchmakerGameInfoRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId) + {} + + FGetMatchmakerGameInfoRequest(const TSharedPtr& obj) : FGetMatchmakerGameInfoRequest() + { + readFromValue(obj); + } + + ~FGetMatchmakerGameInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetMatchmakerGameInfoResult : public FPlayFabBaseModel + { + // [optional] version identifier of the game server executable binary being run + FString BuildVersion; + + // [optional] time when Game Server Instance is currently scheduled to end + Boxed EndTime; + + // [optional] unique identifier of the lobby + FString LobbyId; + + // [optional] game mode for this Game Server Instance + FString Mode; + + // [optional] array of unique PlayFab identifiers for users currently connected to this Game Server Instance + TArray Players; + // [optional] region in which the Game Server Instance is running + Boxed pfRegion; + + // [optional] IPV4 address of the game server instance + FString ServerAddress; + + // [optional] IPV4 address of the server + FString ServerIPV4Address; + + // [optional] IPV6 address of the server + FString ServerIPV6Address; + + // communication port for this Game Server Instance + uint32 ServerPort; + + // [optional] Public DNS name (if any) of the server + FString ServerPublicDNSName; + + // time when the Game Server Instance was created + FDateTime StartTime; + + // [optional] unique identifier of the Game Server Instance for this lobby + FString TitleId; + + FGetMatchmakerGameInfoResult() : + FPlayFabBaseModel(), + BuildVersion(), + EndTime(), + LobbyId(), + Mode(), + Players(), + pfRegion(), + ServerAddress(), + ServerIPV4Address(), + ServerIPV6Address(), + ServerPort(0), + ServerPublicDNSName(), + StartTime(0), + TitleId() + {} + + FGetMatchmakerGameInfoResult(const FGetMatchmakerGameInfoResult& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + EndTime(src.EndTime), + LobbyId(src.LobbyId), + Mode(src.Mode), + Players(src.Players), + pfRegion(src.pfRegion), + ServerAddress(src.ServerAddress), + ServerIPV4Address(src.ServerIPV4Address), + ServerIPV6Address(src.ServerIPV6Address), + ServerPort(src.ServerPort), + ServerPublicDNSName(src.ServerPublicDNSName), + StartTime(src.StartTime), + TitleId(src.TitleId) + {} + + FGetMatchmakerGameInfoResult(const TSharedPtr& obj) : FGetMatchmakerGameInfoResult() + { + readFromValue(obj); + } + + ~FGetMatchmakerGameInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetMatchmakerGameModesRequest : public FPlayFabBaseModel + { + // previously uploaded build version for which game modes are being requested + FString BuildVersion; + + FGetMatchmakerGameModesRequest() : + FPlayFabBaseModel(), + BuildVersion() + {} + + FGetMatchmakerGameModesRequest(const FGetMatchmakerGameModesRequest& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion) + {} + + FGetMatchmakerGameModesRequest(const TSharedPtr& obj) : FGetMatchmakerGameModesRequest() + { + readFromValue(obj); + } + + ~FGetMatchmakerGameModesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetMatchmakerGameModesResult : public FPlayFabBaseModel + { + // [optional] array of game modes available for the specified build + TArray GameModes; + FGetMatchmakerGameModesResult() : + FPlayFabBaseModel(), + GameModes() + {} + + FGetMatchmakerGameModesResult(const FGetMatchmakerGameModesResult& src) : + FPlayFabBaseModel(), + GameModes(src.GameModes) + {} + + FGetMatchmakerGameModesResult(const TSharedPtr& obj) : FGetMatchmakerGameModesResult() + { + readFromValue(obj); + } + + ~FGetMatchmakerGameModesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayedTitleListRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayedTitleListRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetPlayedTitleListRequest(const FGetPlayedTitleListRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetPlayedTitleListRequest(const TSharedPtr& obj) : FGetPlayedTitleListRequest() + { + readFromValue(obj); + } + + ~FGetPlayedTitleListRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayedTitleListResult : public FPlayFabBaseModel + { + // [optional] List of titles the player has played + TArray TitleIds; + FGetPlayedTitleListResult() : + FPlayFabBaseModel(), + TitleIds() + {} + + FGetPlayedTitleListResult(const FGetPlayedTitleListResult& src) : + FPlayFabBaseModel(), + TitleIds(src.TitleIds) + {} + + FGetPlayedTitleListResult(const TSharedPtr& obj) : FGetPlayedTitleListResult() + { + readFromValue(obj); + } + + ~FGetPlayedTitleListResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerIdFromAuthTokenRequest : public FPlayFabBaseModel + { + // The auth token of the player requesting the password reset. + FString Token; + + // The type of auth token of the player requesting the password reset. + AuthTokenType TokenType; + + FGetPlayerIdFromAuthTokenRequest() : + FPlayFabBaseModel(), + Token(), + TokenType() + {} + + FGetPlayerIdFromAuthTokenRequest(const FGetPlayerIdFromAuthTokenRequest& src) : + FPlayFabBaseModel(), + Token(src.Token), + TokenType(src.TokenType) + {} + + FGetPlayerIdFromAuthTokenRequest(const TSharedPtr& obj) : FGetPlayerIdFromAuthTokenRequest() + { + readFromValue(obj); + } + + ~FGetPlayerIdFromAuthTokenRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerIdFromAuthTokenResult : public FPlayFabBaseModel + { + // [optional] The player ID from the token passed in + FString PlayFabId; + + FGetPlayerIdFromAuthTokenResult() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetPlayerIdFromAuthTokenResult(const FGetPlayerIdFromAuthTokenResult& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerIdFromAuthTokenResult(const TSharedPtr& obj) : FGetPlayerIdFromAuthTokenResult() + { + readFromValue(obj); + } + + ~FGetPlayerIdFromAuthTokenResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfileViewConstraints : public FPlayFabBaseModel + { + // Whether to show player's avatar URL. Defaults to false + bool ShowAvatarUrl; + + // Whether to show the banned until time. Defaults to false + bool ShowBannedUntil; + + // Whether to show campaign attributions. Defaults to false + bool ShowCampaignAttributions; + + // Whether to show contact email addresses. Defaults to false + bool ShowContactEmailAddresses; + + // Whether to show the created date. Defaults to false + bool ShowCreated; + + // Whether to show the display name. Defaults to false + bool ShowDisplayName; + + // Whether to show the last login time. Defaults to false + bool ShowLastLogin; + + // Whether to show the linked accounts. Defaults to false + bool ShowLinkedAccounts; + + // Whether to show player's locations. Defaults to false + bool ShowLocations; + + // Whether to show player's membership information. Defaults to false + bool ShowMemberships; + + // Whether to show origination. Defaults to false + bool ShowOrigination; + + // Whether to show push notification registrations. Defaults to false + bool ShowPushNotificationRegistrations; + + // Reserved for future development + bool ShowStatistics; + + // Whether to show tags. Defaults to false + bool ShowTags; + + // Whether to show the total value to date in usd. Defaults to false + bool ShowTotalValueToDateInUsd; + + // Whether to show the values to date. Defaults to false + bool ShowValuesToDate; + + FPlayerProfileViewConstraints() : + FPlayFabBaseModel(), + ShowAvatarUrl(false), + ShowBannedUntil(false), + ShowCampaignAttributions(false), + ShowContactEmailAddresses(false), + ShowCreated(false), + ShowDisplayName(false), + ShowLastLogin(false), + ShowLinkedAccounts(false), + ShowLocations(false), + ShowMemberships(false), + ShowOrigination(false), + ShowPushNotificationRegistrations(false), + ShowStatistics(false), + ShowTags(false), + ShowTotalValueToDateInUsd(false), + ShowValuesToDate(false) + {} + + FPlayerProfileViewConstraints(const FPlayerProfileViewConstraints& src) : + FPlayFabBaseModel(), + ShowAvatarUrl(src.ShowAvatarUrl), + ShowBannedUntil(src.ShowBannedUntil), + ShowCampaignAttributions(src.ShowCampaignAttributions), + ShowContactEmailAddresses(src.ShowContactEmailAddresses), + ShowCreated(src.ShowCreated), + ShowDisplayName(src.ShowDisplayName), + ShowLastLogin(src.ShowLastLogin), + ShowLinkedAccounts(src.ShowLinkedAccounts), + ShowLocations(src.ShowLocations), + ShowMemberships(src.ShowMemberships), + ShowOrigination(src.ShowOrigination), + ShowPushNotificationRegistrations(src.ShowPushNotificationRegistrations), + ShowStatistics(src.ShowStatistics), + ShowTags(src.ShowTags), + ShowTotalValueToDateInUsd(src.ShowTotalValueToDateInUsd), + ShowValuesToDate(src.ShowValuesToDate) + {} + + FPlayerProfileViewConstraints(const TSharedPtr& obj) : FPlayerProfileViewConstraints() + { + readFromValue(obj); + } + + ~FPlayerProfileViewConstraints(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerProfileRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + FGetPlayerProfileRequest() : + FPlayFabBaseModel(), + PlayFabId(), + ProfileConstraints(nullptr) + {} + + FGetPlayerProfileRequest(const FGetPlayerProfileRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr) + {} + + FGetPlayerProfileRequest(const TSharedPtr& obj) : FGetPlayerProfileRequest() + { + readFromValue(obj); + } + + ~FGetPlayerProfileRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum LoginIdentityProvider + { + LoginIdentityProviderUnknown, + LoginIdentityProviderPlayFab, + LoginIdentityProviderCustom, + LoginIdentityProviderGameCenter, + LoginIdentityProviderGooglePlay, + LoginIdentityProviderSteam, + LoginIdentityProviderXBoxLive, + LoginIdentityProviderPSN, + LoginIdentityProviderKongregate, + LoginIdentityProviderFacebook, + LoginIdentityProviderIOSDevice, + LoginIdentityProviderAndroidDevice, + LoginIdentityProviderTwitch, + LoginIdentityProviderWindowsHello, + LoginIdentityProviderGameServer, + LoginIdentityProviderCustomServer, + LoginIdentityProviderNintendoSwitch, + LoginIdentityProviderFacebookInstantGames, + LoginIdentityProviderOpenIdConnect + }; + + PLAYFABCPP_API void writeLoginIdentityProviderEnumJSON(LoginIdentityProvider enumVal, JsonWriter& writer); + PLAYFABCPP_API LoginIdentityProvider readLoginIdentityProviderFromValue(const TSharedPtr& value); + PLAYFABCPP_API LoginIdentityProvider readLoginIdentityProviderFromValue(const FString& value); + + struct PLAYFABCPP_API FLinkedPlatformAccountModel : public FPlayFabBaseModel + { + // [optional] Linked account email of the user on the platform, if available + FString Email; + + // [optional] Authentication platform + Boxed Platform; + + // [optional] Unique account identifier of the user on the platform + FString PlatformUserId; + + // [optional] Linked account username of the user on the platform, if available + FString Username; + + FLinkedPlatformAccountModel() : + FPlayFabBaseModel(), + Email(), + Platform(), + PlatformUserId(), + Username() + {} + + FLinkedPlatformAccountModel(const FLinkedPlatformAccountModel& src) : + FPlayFabBaseModel(), + Email(src.Email), + Platform(src.Platform), + PlatformUserId(src.PlatformUserId), + Username(src.Username) + {} + + FLinkedPlatformAccountModel(const TSharedPtr& obj) : FLinkedPlatformAccountModel() + { + readFromValue(obj); + } + + ~FLinkedPlatformAccountModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLocationModel : public FPlayFabBaseModel + { + // [optional] City name. + FString City; + + // [optional] The two-character continent code for this location + Boxed pfContinentCode; + + // [optional] The two-character ISO 3166-1 country code for the country associated with the location + Boxed pfCountryCode; + + // [optional] Latitude coordinate of the geographic location. + Boxed Latitude; + + // [optional] Longitude coordinate of the geographic location. + Boxed Longitude; + + FLocationModel() : + FPlayFabBaseModel(), + City(), + pfContinentCode(), + pfCountryCode(), + Latitude(), + Longitude() + {} + + FLocationModel(const FLocationModel& src) : + FPlayFabBaseModel(), + City(src.City), + pfContinentCode(src.pfContinentCode), + pfCountryCode(src.pfCountryCode), + Latitude(src.Latitude), + Longitude(src.Longitude) + {} + + FLocationModel(const TSharedPtr& obj) : FLocationModel() + { + readFromValue(obj); + } + + ~FLocationModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum SubscriptionProviderStatus + { + SubscriptionProviderStatusNoError, + SubscriptionProviderStatusCancelled, + SubscriptionProviderStatusUnknownError, + SubscriptionProviderStatusBillingError, + SubscriptionProviderStatusProductUnavailable, + SubscriptionProviderStatusCustomerDidNotAcceptPriceChange, + SubscriptionProviderStatusFreeTrial, + SubscriptionProviderStatusPaymentPending + }; + + PLAYFABCPP_API void writeSubscriptionProviderStatusEnumJSON(SubscriptionProviderStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API SubscriptionProviderStatus readSubscriptionProviderStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API SubscriptionProviderStatus readSubscriptionProviderStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FSubscriptionModel : public FPlayFabBaseModel + { + // When this subscription expires. + FDateTime Expiration; + + // The time the subscription was orignially purchased + FDateTime InitialSubscriptionTime; + + // Whether this subscription is currently active. That is, if Expiration > now. + bool IsActive; + + // [optional] The status of this subscription, according to the subscription provider. + Boxed Status; + + // [optional] The id for this subscription + FString SubscriptionId; + + // [optional] The item id for this subscription from the primary catalog + FString SubscriptionItemId; + + // [optional] The provider for this subscription. Apple or Google Play are supported today. + FString SubscriptionProvider; + + FSubscriptionModel() : + FPlayFabBaseModel(), + Expiration(0), + InitialSubscriptionTime(0), + IsActive(false), + Status(), + SubscriptionId(), + SubscriptionItemId(), + SubscriptionProvider() + {} + + FSubscriptionModel(const FSubscriptionModel& src) : + FPlayFabBaseModel(), + Expiration(src.Expiration), + InitialSubscriptionTime(src.InitialSubscriptionTime), + IsActive(src.IsActive), + Status(src.Status), + SubscriptionId(src.SubscriptionId), + SubscriptionItemId(src.SubscriptionItemId), + SubscriptionProvider(src.SubscriptionProvider) + {} + + FSubscriptionModel(const TSharedPtr& obj) : FSubscriptionModel() + { + readFromValue(obj); + } + + ~FSubscriptionModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMembershipModel : public FPlayFabBaseModel + { + // Whether this membership is active. That is, whether the MembershipExpiration time has been reached. + bool IsActive; + + // The time this membership expires + FDateTime MembershipExpiration; + + // [optional] The id of the membership + FString MembershipId; + + /** + * [optional] Membership expirations can be explicitly overridden (via game manager or the admin api). If this membership has been + * overridden, this will be the new expiration time. + */ + Boxed OverrideExpiration; + + // [optional] Whether the override expiration is set. + Boxed OverrideIsSet; + + // [optional] The list of subscriptions that this player has for this membership + TArray Subscriptions; + FMembershipModel() : + FPlayFabBaseModel(), + IsActive(false), + MembershipExpiration(0), + MembershipId(), + OverrideExpiration(), + OverrideIsSet(), + Subscriptions() + {} + + FMembershipModel(const FMembershipModel& src) : + FPlayFabBaseModel(), + IsActive(src.IsActive), + MembershipExpiration(src.MembershipExpiration), + MembershipId(src.MembershipId), + OverrideExpiration(src.OverrideExpiration), + OverrideIsSet(src.OverrideIsSet), + Subscriptions(src.Subscriptions) + {} + + FMembershipModel(const TSharedPtr& obj) : FMembershipModel() + { + readFromValue(obj); + } + + ~FMembershipModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum PushNotificationPlatform + { + PushNotificationPlatformApplePushNotificationService, + PushNotificationPlatformGoogleCloudMessaging + }; + + PLAYFABCPP_API void writePushNotificationPlatformEnumJSON(PushNotificationPlatform enumVal, JsonWriter& writer); + PLAYFABCPP_API PushNotificationPlatform readPushNotificationPlatformFromValue(const TSharedPtr& value); + PLAYFABCPP_API PushNotificationPlatform readPushNotificationPlatformFromValue(const FString& value); + + struct PLAYFABCPP_API FPushNotificationRegistrationModel : public FPlayFabBaseModel + { + // [optional] Notification configured endpoint + FString NotificationEndpointARN; + + // [optional] Push notification platform + Boxed Platform; + + FPushNotificationRegistrationModel() : + FPlayFabBaseModel(), + NotificationEndpointARN(), + Platform() + {} + + FPushNotificationRegistrationModel(const FPushNotificationRegistrationModel& src) : + FPlayFabBaseModel(), + NotificationEndpointARN(src.NotificationEndpointARN), + Platform(src.Platform) + {} + + FPushNotificationRegistrationModel(const TSharedPtr& obj) : FPushNotificationRegistrationModel() + { + readFromValue(obj); + } + + ~FPushNotificationRegistrationModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticModel : public FPlayFabBaseModel + { + // [optional] Statistic name + FString Name; + + // Statistic value + int32 Value; + + // Statistic version (0 if not a versioned statistic) + int32 Version; + + FStatisticModel() : + FPlayFabBaseModel(), + Name(), + Value(0), + Version(0) + {} + + FStatisticModel(const FStatisticModel& src) : + FPlayFabBaseModel(), + Name(src.Name), + Value(src.Value), + Version(src.Version) + {} + + FStatisticModel(const TSharedPtr& obj) : FStatisticModel() + { + readFromValue(obj); + } + + ~FStatisticModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FTagModel : public FPlayFabBaseModel + { + // [optional] Full value of the tag, including namespace + FString TagValue; + + FTagModel() : + FPlayFabBaseModel(), + TagValue() + {} + + FTagModel(const FTagModel& src) : + FPlayFabBaseModel(), + TagValue(src.TagValue) + {} + + FTagModel(const TSharedPtr& obj) : FTagModel() + { + readFromValue(obj); + } + + ~FTagModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValueToDateModel : public FPlayFabBaseModel + { + // [optional] ISO 4217 code of the currency used in the purchases + FString Currency; + + /** + * Total value of the purchases in a whole number of 1/100 monetary units. For example, 999 indicates nine dollars and + * ninety-nine cents when Currency is 'USD') + */ + uint32 TotalValue; + + /** + * [optional] Total value of the purchases in a string representation of decimal monetary units. For example, '9.99' indicates nine + * dollars and ninety-nine cents when Currency is 'USD'. + */ + FString TotalValueAsDecimal; + + FValueToDateModel() : + FPlayFabBaseModel(), + Currency(), + TotalValue(0), + TotalValueAsDecimal() + {} + + FValueToDateModel(const FValueToDateModel& src) : + FPlayFabBaseModel(), + Currency(src.Currency), + TotalValue(src.TotalValue), + TotalValueAsDecimal(src.TotalValueAsDecimal) + {} + + FValueToDateModel(const TSharedPtr& obj) : FValueToDateModel() + { + readFromValue(obj); + } + + ~FValueToDateModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfileModel : public FPlayFabBaseModel + { + // [optional] List of advertising campaigns the player has been attributed to + TArray AdCampaignAttributions; + // [optional] URL of the player's avatar image + FString AvatarUrl; + + // [optional] If the player is currently banned, the UTC Date when the ban expires + Boxed BannedUntil; + + // [optional] List of all contact email info associated with the player account + TArray ContactEmailAddresses; + // [optional] Player record created + Boxed Created; + + // [optional] Player display name + FString DisplayName; + + // [optional] UTC time when the player most recently logged in to the title + Boxed LastLogin; + + // [optional] List of all authentication systems linked to this player account + TArray LinkedAccounts; + // [optional] List of geographic locations from which the player has logged in to the title + TArray Locations; + // [optional] List of memberships for the player, along with whether are expired. + TArray Memberships; + // [optional] Player account origination + Boxed Origination; + + // [optional] PlayFab player account unique identifier + FString PlayerId; + + // [optional] Publisher this player belongs to + FString PublisherId; + + // [optional] List of configured end points registered for sending the player push notifications + TArray PushNotificationRegistrations; + // [optional] List of leaderboard statistic values for the player + TArray Statistics; + // [optional] List of player's tags for segmentation + TArray Tags; + // [optional] Title ID this player profile applies to + FString TitleId; + + /** + * [optional] Sum of the player's purchases made with real-money currencies, converted to US dollars equivalent and represented as a + * whole number of cents (1/100 USD). For example, 999 indicates nine dollars and ninety-nine cents. + */ + Boxed TotalValueToDateInUSD; + + // [optional] List of the player's lifetime purchase totals, summed by real-money currency + TArray ValuesToDate; + FPlayerProfileModel() : + FPlayFabBaseModel(), + AdCampaignAttributions(), + AvatarUrl(), + BannedUntil(), + ContactEmailAddresses(), + Created(), + DisplayName(), + LastLogin(), + LinkedAccounts(), + Locations(), + Memberships(), + Origination(), + PlayerId(), + PublisherId(), + PushNotificationRegistrations(), + Statistics(), + Tags(), + TitleId(), + TotalValueToDateInUSD(), + ValuesToDate() + {} + + FPlayerProfileModel(const FPlayerProfileModel& src) : + FPlayFabBaseModel(), + AdCampaignAttributions(src.AdCampaignAttributions), + AvatarUrl(src.AvatarUrl), + BannedUntil(src.BannedUntil), + ContactEmailAddresses(src.ContactEmailAddresses), + Created(src.Created), + DisplayName(src.DisplayName), + LastLogin(src.LastLogin), + LinkedAccounts(src.LinkedAccounts), + Locations(src.Locations), + Memberships(src.Memberships), + Origination(src.Origination), + PlayerId(src.PlayerId), + PublisherId(src.PublisherId), + PushNotificationRegistrations(src.PushNotificationRegistrations), + Statistics(src.Statistics), + Tags(src.Tags), + TitleId(src.TitleId), + TotalValueToDateInUSD(src.TotalValueToDateInUSD), + ValuesToDate(src.ValuesToDate) + {} + + FPlayerProfileModel(const TSharedPtr& obj) : FPlayerProfileModel() + { + readFromValue(obj); + } + + ~FPlayerProfileModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerProfileResult : public FPlayFabBaseModel + { + /** + * [optional] The profile of the player. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + TSharedPtr PlayerProfile; + + FGetPlayerProfileResult() : + FPlayFabBaseModel(), + PlayerProfile(nullptr) + {} + + FGetPlayerProfileResult(const FGetPlayerProfileResult& src) : + FPlayFabBaseModel(), + PlayerProfile(src.PlayerProfile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.PlayerProfile)) : nullptr) + {} + + FGetPlayerProfileResult(const TSharedPtr& obj) : FGetPlayerProfileResult() + { + readFromValue(obj); + } + + ~FGetPlayerProfileResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerSegmentsResult : public FPlayFabBaseModel + { + // [optional] Array of segments the requested player currently belongs to. + TArray Segments; + FGetPlayerSegmentsResult() : + FPlayFabBaseModel(), + Segments() + {} + + FGetPlayerSegmentsResult(const FGetPlayerSegmentsResult& src) : + FPlayFabBaseModel(), + Segments(src.Segments) + {} + + FGetPlayerSegmentsResult(const TSharedPtr& obj) : FGetPlayerSegmentsResult() + { + readFromValue(obj); + } + + ~FGetPlayerSegmentsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerSharedSecretsRequest : public FPlayFabBaseModel + { + FGetPlayerSharedSecretsRequest() : + FPlayFabBaseModel() + {} + + FGetPlayerSharedSecretsRequest(const FGetPlayerSharedSecretsRequest& src) : + FPlayFabBaseModel() + {} + + FGetPlayerSharedSecretsRequest(const TSharedPtr& obj) : FGetPlayerSharedSecretsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerSharedSecretsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSharedSecret : public FPlayFabBaseModel + { + // Flag to indicate if this key is disabled + bool Disabled; + + // [optional] Friendly name for this key + FString FriendlyName; + + // [optional] The player shared secret to use when calling Client/GetTitlePublicKey + FString SecretKey; + + FSharedSecret() : + FPlayFabBaseModel(), + Disabled(false), + FriendlyName(), + SecretKey() + {} + + FSharedSecret(const FSharedSecret& src) : + FPlayFabBaseModel(), + Disabled(src.Disabled), + FriendlyName(src.FriendlyName), + SecretKey(src.SecretKey) + {} + + FSharedSecret(const TSharedPtr& obj) : FSharedSecret() + { + readFromValue(obj); + } + + ~FSharedSecret(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerSharedSecretsResult : public FPlayFabBaseModel + { + // [optional] The player shared secret to use when calling Client/GetTitlePublicKey + TArray SharedSecrets; + FGetPlayerSharedSecretsResult() : + FPlayFabBaseModel(), + SharedSecrets() + {} + + FGetPlayerSharedSecretsResult(const FGetPlayerSharedSecretsResult& src) : + FPlayFabBaseModel(), + SharedSecrets(src.SharedSecrets) + {} + + FGetPlayerSharedSecretsResult(const TSharedPtr& obj) : FGetPlayerSharedSecretsResult() + { + readFromValue(obj); + } + + ~FGetPlayerSharedSecretsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayersInSegmentRequest : public FPlayFabBaseModel + { + // [optional] Continuation token if retrieving subsequent pages of results. + FString ContinuationToken; + + // [optional] Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. + Boxed MaxBatchSize; + + /** + * [optional] Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging + * results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). + */ + Boxed SecondsToLive; + + // Unique identifier for this segment. + FString SegmentId; + + FGetPlayersInSegmentRequest() : + FPlayFabBaseModel(), + ContinuationToken(), + MaxBatchSize(), + SecondsToLive(), + SegmentId() + {} + + FGetPlayersInSegmentRequest(const FGetPlayersInSegmentRequest& src) : + FPlayFabBaseModel(), + ContinuationToken(src.ContinuationToken), + MaxBatchSize(src.MaxBatchSize), + SecondsToLive(src.SecondsToLive), + SegmentId(src.SegmentId) + {} + + FGetPlayersInSegmentRequest(const TSharedPtr& obj) : FGetPlayersInSegmentRequest() + { + readFromValue(obj); + } + + ~FGetPlayersInSegmentRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLinkedAccount : public FPlayFabBaseModel + { + // [optional] Linked account's email + FString Email; + + // [optional] Authentication platform + Boxed Platform; + + // [optional] Platform user identifier + FString PlatformUserId; + + // [optional] Linked account's username + FString Username; + + FPlayerLinkedAccount() : + FPlayFabBaseModel(), + Email(), + Platform(), + PlatformUserId(), + Username() + {} + + FPlayerLinkedAccount(const FPlayerLinkedAccount& src) : + FPlayFabBaseModel(), + Email(src.Email), + Platform(src.Platform), + PlatformUserId(src.PlatformUserId), + Username(src.Username) + {} + + FPlayerLinkedAccount(const TSharedPtr& obj) : FPlayerLinkedAccount() + { + readFromValue(obj); + } + + ~FPlayerLinkedAccount(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLocation : public FPlayFabBaseModel + { + // [optional] City of the player's geographic location. + FString City; + + // The two-character continent code for this location + ContinentCode pfContinentCode; + + // The two-character ISO 3166-1 country code for the country associated with the location + CountryCode pfCountryCode; + + // [optional] Latitude coordinate of the player's geographic location. + Boxed Latitude; + + // [optional] Longitude coordinate of the player's geographic location. + Boxed Longitude; + + FPlayerLocation() : + FPlayFabBaseModel(), + City(), + pfContinentCode(), + pfCountryCode(), + Latitude(), + Longitude() + {} + + FPlayerLocation(const FPlayerLocation& src) : + FPlayFabBaseModel(), + City(src.City), + pfContinentCode(src.pfContinentCode), + pfCountryCode(src.pfCountryCode), + Latitude(src.Latitude), + Longitude(src.Longitude) + {} + + FPlayerLocation(const TSharedPtr& obj) : FPlayerLocation() + { + readFromValue(obj); + } + + ~FPlayerLocation(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerStatistic : public FPlayFabBaseModel + { + // [optional] Statistic ID + FString Id; + + // [optional] Statistic name + FString Name; + + // Current statistic value + int32 StatisticValue; + + // Statistic version (0 if not a versioned statistic) + int32 StatisticVersion; + + FPlayerStatistic() : + FPlayFabBaseModel(), + Id(), + Name(), + StatisticValue(0), + StatisticVersion(0) + {} + + FPlayerStatistic(const FPlayerStatistic& src) : + FPlayFabBaseModel(), + Id(src.Id), + Name(src.Name), + StatisticValue(src.StatisticValue), + StatisticVersion(src.StatisticVersion) + {} + + FPlayerStatistic(const TSharedPtr& obj) : FPlayerStatistic() + { + readFromValue(obj); + } + + ~FPlayerStatistic(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPushNotificationRegistration : public FPlayFabBaseModel + { + // [optional] Notification configured endpoint + FString NotificationEndpointARN; + + // [optional] Push notification platform + Boxed Platform; + + FPushNotificationRegistration() : + FPlayFabBaseModel(), + NotificationEndpointARN(), + Platform() + {} + + FPushNotificationRegistration(const FPushNotificationRegistration& src) : + FPlayFabBaseModel(), + NotificationEndpointARN(src.NotificationEndpointARN), + Platform(src.Platform) + {} + + FPushNotificationRegistration(const TSharedPtr& obj) : FPushNotificationRegistration() + { + readFromValue(obj); + } + + ~FPushNotificationRegistration(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfile : public FPlayFabBaseModel + { + // [optional] Array of ad campaigns player has been attributed to + TArray AdCampaignAttributions; + // [optional] Image URL of the player's avatar. + FString AvatarUrl; + + // [optional] Banned until UTC Date. If permanent ban this is set for 20 years after the original ban date. + Boxed BannedUntil; + + // [optional] Array of contact email addresses associated with the player + TArray ContactEmailAddresses; + // [optional] Player record created + Boxed Created; + + // [optional] Player Display Name + FString DisplayName; + + // [optional] Last login + Boxed LastLogin; + + // [optional] Array of third party accounts linked to this player + TArray LinkedAccounts; + // [optional] Dictionary of player's locations by type. + TMap Locations; + // [optional] Player account origination + Boxed Origination; + + // [optional] PlayFab Player ID + FString PlayerId; + + // [optional] Array of player statistics + TArray PlayerStatistics; + // [optional] Publisher this player belongs to + FString PublisherId; + + // [optional] Array of configured push notification end points + TArray PushNotificationRegistrations; + // [optional] Dictionary of player's statistics using only the latest version's value + TMap Statistics; + // [optional] List of player's tags for segmentation. + TArray Tags; + // [optional] Title ID this profile applies to + FString TitleId; + + // [optional] A sum of player's total purchases in USD across all currencies. + Boxed TotalValueToDateInUSD; + + // [optional] Dictionary of player's total purchases by currency. + TMap ValuesToDate; + // [optional] Dictionary of player's virtual currency balances + TMap VirtualCurrencyBalances; + FPlayerProfile() : + FPlayFabBaseModel(), + AdCampaignAttributions(), + AvatarUrl(), + BannedUntil(), + ContactEmailAddresses(), + Created(), + DisplayName(), + LastLogin(), + LinkedAccounts(), + Locations(), + Origination(), + PlayerId(), + PlayerStatistics(), + PublisherId(), + PushNotificationRegistrations(), + Statistics(), + Tags(), + TitleId(), + TotalValueToDateInUSD(), + ValuesToDate(), + VirtualCurrencyBalances() + {} + + FPlayerProfile(const FPlayerProfile& src) : + FPlayFabBaseModel(), + AdCampaignAttributions(src.AdCampaignAttributions), + AvatarUrl(src.AvatarUrl), + BannedUntil(src.BannedUntil), + ContactEmailAddresses(src.ContactEmailAddresses), + Created(src.Created), + DisplayName(src.DisplayName), + LastLogin(src.LastLogin), + LinkedAccounts(src.LinkedAccounts), + Locations(src.Locations), + Origination(src.Origination), + PlayerId(src.PlayerId), + PlayerStatistics(src.PlayerStatistics), + PublisherId(src.PublisherId), + PushNotificationRegistrations(src.PushNotificationRegistrations), + Statistics(src.Statistics), + Tags(src.Tags), + TitleId(src.TitleId), + TotalValueToDateInUSD(src.TotalValueToDateInUSD), + ValuesToDate(src.ValuesToDate), + VirtualCurrencyBalances(src.VirtualCurrencyBalances) + {} + + FPlayerProfile(const TSharedPtr& obj) : FPlayerProfile() + { + readFromValue(obj); + } + + ~FPlayerProfile(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayersInSegmentResult : public FPlayFabBaseModel + { + // [optional] Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. + FString ContinuationToken; + + // [optional] Array of player profiles in this segment. + TArray PlayerProfiles; + // Count of profiles matching this segment. + int32 ProfilesInSegment; + + FGetPlayersInSegmentResult() : + FPlayFabBaseModel(), + ContinuationToken(), + PlayerProfiles(), + ProfilesInSegment(0) + {} + + FGetPlayersInSegmentResult(const FGetPlayersInSegmentResult& src) : + FPlayFabBaseModel(), + ContinuationToken(src.ContinuationToken), + PlayerProfiles(src.PlayerProfiles), + ProfilesInSegment(src.ProfilesInSegment) + {} + + FGetPlayersInSegmentResult(const TSharedPtr& obj) : FGetPlayersInSegmentResult() + { + readFromValue(obj); + } + + ~FGetPlayersInSegmentResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayersSegmentsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayersSegmentsRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetPlayersSegmentsRequest(const FGetPlayersSegmentsRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetPlayersSegmentsRequest(const TSharedPtr& obj) : FGetPlayersSegmentsRequest() + { + readFromValue(obj); + } + + ~FGetPlayersSegmentsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticDefinitionsRequest : public FPlayFabBaseModel + { + FGetPlayerStatisticDefinitionsRequest() : + FPlayFabBaseModel() + {} + + FGetPlayerStatisticDefinitionsRequest(const FGetPlayerStatisticDefinitionsRequest& src) : + FPlayFabBaseModel() + {} + + FGetPlayerStatisticDefinitionsRequest(const TSharedPtr& obj) : FGetPlayerStatisticDefinitionsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticDefinitionsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticDefinitionsResult : public FPlayFabBaseModel + { + // [optional] the player statistic definitions for the title + TArray Statistics; + FGetPlayerStatisticDefinitionsResult() : + FPlayFabBaseModel(), + Statistics() + {} + + FGetPlayerStatisticDefinitionsResult(const FGetPlayerStatisticDefinitionsResult& src) : + FPlayFabBaseModel(), + Statistics(src.Statistics) + {} + + FGetPlayerStatisticDefinitionsResult(const TSharedPtr& obj) : FGetPlayerStatisticDefinitionsResult() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticDefinitionsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticVersionsRequest : public FPlayFabBaseModel + { + // [optional] unique name of the statistic + FString StatisticName; + + FGetPlayerStatisticVersionsRequest() : + FPlayFabBaseModel(), + StatisticName() + {} + + FGetPlayerStatisticVersionsRequest(const FGetPlayerStatisticVersionsRequest& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName) + {} + + FGetPlayerStatisticVersionsRequest(const TSharedPtr& obj) : FGetPlayerStatisticVersionsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticVersionsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum StatisticVersionStatus + { + StatisticVersionStatusActive, + StatisticVersionStatusSnapshotPending, + StatisticVersionStatusSnapshot, + StatisticVersionStatusArchivalPending, + StatisticVersionStatusArchived + }; + + PLAYFABCPP_API void writeStatisticVersionStatusEnumJSON(StatisticVersionStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API StatisticVersionStatus readStatisticVersionStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API StatisticVersionStatus readStatisticVersionStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FPlayerStatisticVersion : public FPlayFabBaseModel + { + // time when the statistic version became active + FDateTime ActivationTime; + + // [optional] URL for the downloadable archive of player statistic values, if available + FString ArchiveDownloadUrl; + + // [optional] time when the statistic version became inactive due to statistic version incrementing + Boxed DeactivationTime; + + // [optional] time at which the statistic version was scheduled to become active, based on the configured ResetInterval + Boxed ScheduledActivationTime; + + // [optional] time at which the statistic version was scheduled to become inactive, based on the configured ResetInterval + Boxed ScheduledDeactivationTime; + + // [optional] name of the statistic when the version became active + FString StatisticName; + + // [optional] status of the statistic version + Boxed Status; + + // version of the statistic + uint32 Version; + + FPlayerStatisticVersion() : + FPlayFabBaseModel(), + ActivationTime(0), + ArchiveDownloadUrl(), + DeactivationTime(), + ScheduledActivationTime(), + ScheduledDeactivationTime(), + StatisticName(), + Status(), + Version(0) + {} + + FPlayerStatisticVersion(const FPlayerStatisticVersion& src) : + FPlayFabBaseModel(), + ActivationTime(src.ActivationTime), + ArchiveDownloadUrl(src.ArchiveDownloadUrl), + DeactivationTime(src.DeactivationTime), + ScheduledActivationTime(src.ScheduledActivationTime), + ScheduledDeactivationTime(src.ScheduledDeactivationTime), + StatisticName(src.StatisticName), + Status(src.Status), + Version(src.Version) + {} + + FPlayerStatisticVersion(const TSharedPtr& obj) : FPlayerStatisticVersion() + { + readFromValue(obj); + } + + ~FPlayerStatisticVersion(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticVersionsResult : public FPlayFabBaseModel + { + // [optional] version change history of the statistic + TArray StatisticVersions; + FGetPlayerStatisticVersionsResult() : + FPlayFabBaseModel(), + StatisticVersions() + {} + + FGetPlayerStatisticVersionsResult(const FGetPlayerStatisticVersionsResult& src) : + FPlayFabBaseModel(), + StatisticVersions(src.StatisticVersions) + {} + + FGetPlayerStatisticVersionsResult(const TSharedPtr& obj) : FGetPlayerStatisticVersionsResult() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticVersionsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTagsRequest : public FPlayFabBaseModel + { + // [optional] Optional namespace to filter results by + FString Namespace; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayerTagsRequest() : + FPlayFabBaseModel(), + Namespace(), + PlayFabId() + {} + + FGetPlayerTagsRequest(const FGetPlayerTagsRequest& src) : + FPlayFabBaseModel(), + Namespace(src.Namespace), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerTagsRequest(const TSharedPtr& obj) : FGetPlayerTagsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerTagsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTagsResult : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Canonical tags (including namespace and tag's name) for the requested user + TArray Tags; + FGetPlayerTagsResult() : + FPlayFabBaseModel(), + PlayFabId(), + Tags() + {} + + FGetPlayerTagsResult(const FGetPlayerTagsResult& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + Tags(src.Tags) + {} + + FGetPlayerTagsResult(const TSharedPtr& obj) : FGetPlayerTagsResult() + { + readFromValue(obj); + } + + ~FGetPlayerTagsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPolicyRequest : public FPlayFabBaseModel + { + // [optional] The name of the policy to read. Only supported name is 'ApiPolicy'. + FString PolicyName; + + FGetPolicyRequest() : + FPlayFabBaseModel(), + PolicyName() + {} + + FGetPolicyRequest(const FGetPolicyRequest& src) : + FPlayFabBaseModel(), + PolicyName(src.PolicyName) + {} + + FGetPolicyRequest(const TSharedPtr& obj) : FGetPolicyRequest() + { + readFromValue(obj); + } + + ~FGetPolicyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPermissionStatement : public FPlayFabBaseModel + { + // The action this statement effects. The only supported action is 'Execute'. + FString Action; + + // [optional] Additional conditions to be applied for API Resources. + TSharedPtr ApiConditions; + + // [optional] A comment about the statement. Intended solely for bookkeeping and debugging. + FString Comment; + + // The effect this statement will have. It could be either Allow or Deny + EffectType Effect; + + // The principal this statement will effect. The only supported principal is '*'. + FString Principal; + + /** + * The resource this statements effects. The only supported resources look like 'pfrn:api--*' for all apis, or + * 'pfrn:api--/Client/ConfirmPurchase' for specific apis. + */ + FString Resource; + + FPermissionStatement() : + FPlayFabBaseModel(), + Action(), + ApiConditions(nullptr), + Comment(), + Effect(), + Principal(), + Resource() + {} + + FPermissionStatement(const FPermissionStatement& src) : + FPlayFabBaseModel(), + Action(src.Action), + ApiConditions(src.ApiConditions.IsValid() ? MakeShareable(new FApiCondition(*src.ApiConditions)) : nullptr), + Comment(src.Comment), + Effect(src.Effect), + Principal(src.Principal), + Resource(src.Resource) + {} + + FPermissionStatement(const TSharedPtr& obj) : FPermissionStatement() + { + readFromValue(obj); + } + + ~FPermissionStatement(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPolicyResponse : public FPlayFabBaseModel + { + // [optional] The name of the policy read. + FString PolicyName; + + // [optional] The statements in the requested policy. + TArray Statements; + FGetPolicyResponse() : + FPlayFabBaseModel(), + PolicyName(), + Statements() + {} + + FGetPolicyResponse(const FGetPolicyResponse& src) : + FPlayFabBaseModel(), + PolicyName(src.PolicyName), + Statements(src.Statements) + {} + + FGetPolicyResponse(const TSharedPtr& obj) : FGetPolicyResponse() + { + readFromValue(obj); + } + + ~FGetPolicyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPublisherDataRequest : public FPlayFabBaseModel + { + // array of keys to get back data from the Publisher data blob, set by the admin tools + TArray Keys; + FGetPublisherDataRequest() : + FPlayFabBaseModel(), + Keys() + {} + + FGetPublisherDataRequest(const FGetPublisherDataRequest& src) : + FPlayFabBaseModel(), + Keys(src.Keys) + {} + + FGetPublisherDataRequest(const TSharedPtr& obj) : FGetPublisherDataRequest() + { + readFromValue(obj); + } + + ~FGetPublisherDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPublisherDataResult : public FPlayFabBaseModel + { + // [optional] a dictionary object of key / value pairs + TMap Data; + FGetPublisherDataResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPublisherDataResult(const FGetPublisherDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPublisherDataResult(const TSharedPtr& obj) : FGetPublisherDataResult() + { + readFromValue(obj); + } + + ~FGetPublisherDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetRandomResultTablesRequest : public FPlayFabBaseModel + { + // [optional] catalog version to fetch tables from. Use default catalog version if null + FString CatalogVersion; + + FGetRandomResultTablesRequest() : + FPlayFabBaseModel(), + CatalogVersion() + {} + + FGetRandomResultTablesRequest(const FGetRandomResultTablesRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion) + {} + + FGetRandomResultTablesRequest(const TSharedPtr& obj) : FGetRandomResultTablesRequest() + { + readFromValue(obj); + } + + ~FGetRandomResultTablesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ResultTableNodeType + { + ResultTableNodeTypeItemId, + ResultTableNodeTypeTableId + }; + + PLAYFABCPP_API void writeResultTableNodeTypeEnumJSON(ResultTableNodeType enumVal, JsonWriter& writer); + PLAYFABCPP_API ResultTableNodeType readResultTableNodeTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ResultTableNodeType readResultTableNodeTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FResultTableNode : public FPlayFabBaseModel + { + // Either an ItemId, or the TableId of another random result table + FString ResultItem; + + // Whether this entry in the table is an item or a link to another table + ResultTableNodeType ResultItemType; + + // How likely this is to be rolled - larger numbers add more weight + int32 Weight; + + FResultTableNode() : + FPlayFabBaseModel(), + ResultItem(), + ResultItemType(), + Weight(0) + {} + + FResultTableNode(const FResultTableNode& src) : + FPlayFabBaseModel(), + ResultItem(src.ResultItem), + ResultItemType(src.ResultItemType), + Weight(src.Weight) + {} + + FResultTableNode(const TSharedPtr& obj) : FResultTableNode() + { + readFromValue(obj); + } + + ~FResultTableNode(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRandomResultTableListing : public FPlayFabBaseModel + { + // [optional] Catalog version this table is associated with + FString CatalogVersion; + + // Child nodes that indicate what kind of drop table item this actually is. + TArray Nodes; + // Unique name for this drop table + FString TableId; + + FRandomResultTableListing() : + FPlayFabBaseModel(), + CatalogVersion(), + Nodes(), + TableId() + {} + + FRandomResultTableListing(const FRandomResultTableListing& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + Nodes(src.Nodes), + TableId(src.TableId) + {} + + FRandomResultTableListing(const TSharedPtr& obj) : FRandomResultTableListing() + { + readFromValue(obj); + } + + ~FRandomResultTableListing(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetRandomResultTablesResult : public FPlayFabBaseModel + { + // [optional] array of random result tables currently available + TMap Tables; + FGetRandomResultTablesResult() : + FPlayFabBaseModel(), + Tables() + {} + + FGetRandomResultTablesResult(const FGetRandomResultTablesResult& src) : + FPlayFabBaseModel(), + Tables(src.Tables) + {} + + FGetRandomResultTablesResult(const TSharedPtr& obj) : FGetRandomResultTablesResult() + { + readFromValue(obj); + } + + ~FGetRandomResultTablesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetServerBuildInfoRequest : public FPlayFabBaseModel + { + // unique identifier of the previously uploaded build executable for which information is being requested + FString BuildId; + + FGetServerBuildInfoRequest() : + FPlayFabBaseModel(), + BuildId() + {} + + FGetServerBuildInfoRequest(const FGetServerBuildInfoRequest& src) : + FPlayFabBaseModel(), + BuildId(src.BuildId) + {} + + FGetServerBuildInfoRequest(const TSharedPtr& obj) : FGetServerBuildInfoRequest() + { + readFromValue(obj); + } + + ~FGetServerBuildInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetServerBuildInfoResult : public FPlayFabBaseModel + { + // [optional] array of regions where this build can used, when it is active + TArray ActiveRegions; + // [optional] unique identifier for this build executable + FString BuildId; + + // [optional] developer comment(s) for this build + FString Comment; + + // [optional] error message, if any, about this build + FString ErrorMessage; + + // maximum number of game server instances that can run on a single host machine + int32 MaxGamesPerHost; + + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + int32 MinFreeGameSlots; + + // [optional] the current status of the build validation and processing steps + Boxed Status; + + // time this build was last modified (or uploaded, if this build has never been modified) + FDateTime Timestamp; + + /** + * [optional] Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FGetServerBuildInfoResult() : + FPlayFabBaseModel(), + ActiveRegions(), + BuildId(), + Comment(), + ErrorMessage(), + MaxGamesPerHost(0), + MinFreeGameSlots(0), + Status(), + Timestamp(0), + TitleId() + {} + + FGetServerBuildInfoResult(const FGetServerBuildInfoResult& src) : + FPlayFabBaseModel(), + ActiveRegions(src.ActiveRegions), + BuildId(src.BuildId), + Comment(src.Comment), + ErrorMessage(src.ErrorMessage), + MaxGamesPerHost(src.MaxGamesPerHost), + MinFreeGameSlots(src.MinFreeGameSlots), + Status(src.Status), + Timestamp(src.Timestamp), + TitleId(src.TitleId) + {} + + FGetServerBuildInfoResult(const TSharedPtr& obj) : FGetServerBuildInfoResult() + { + readFromValue(obj); + } + + ~FGetServerBuildInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetServerBuildUploadURLRequest : public FPlayFabBaseModel + { + // unique identifier of the game server build to upload + FString BuildId; + + FGetServerBuildUploadURLRequest() : + FPlayFabBaseModel(), + BuildId() + {} + + FGetServerBuildUploadURLRequest(const FGetServerBuildUploadURLRequest& src) : + FPlayFabBaseModel(), + BuildId(src.BuildId) + {} + + FGetServerBuildUploadURLRequest(const TSharedPtr& obj) : FGetServerBuildUploadURLRequest() + { + readFromValue(obj); + } + + ~FGetServerBuildUploadURLRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetServerBuildUploadURLResult : public FPlayFabBaseModel + { + // [optional] pre-authorized URL for uploading the game server build package + FString URL; + + FGetServerBuildUploadURLResult() : + FPlayFabBaseModel(), + URL() + {} + + FGetServerBuildUploadURLResult(const FGetServerBuildUploadURLResult& src) : + FPlayFabBaseModel(), + URL(src.URL) + {} + + FGetServerBuildUploadURLResult(const TSharedPtr& obj) : FGetServerBuildUploadURLResult() + { + readFromValue(obj); + } + + ~FGetServerBuildUploadURLResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetStoreItemsRequest : public FPlayFabBaseModel + { + // [optional] catalog version to store items from. Use default catalog version if null + FString CatalogVersion; + + // Unqiue identifier for the store which is being requested. + FString StoreId; + + FGetStoreItemsRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + StoreId() + {} + + FGetStoreItemsRequest(const FGetStoreItemsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + StoreId(src.StoreId) + {} + + FGetStoreItemsRequest(const TSharedPtr& obj) : FGetStoreItemsRequest() + { + readFromValue(obj); + } + + ~FGetStoreItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStoreMarketingModel : public FPlayFabBaseModel + { + // [optional] Tagline for a store. + FString Description; + + // [optional] Display name of a store as it will appear to users. + FString DisplayName; + + // [optional] Custom data about a store. + FJsonKeeper Metadata; + + FStoreMarketingModel() : + FPlayFabBaseModel(), + Description(), + DisplayName(), + Metadata() + {} + + FStoreMarketingModel(const FStoreMarketingModel& src) : + FPlayFabBaseModel(), + Description(src.Description), + DisplayName(src.DisplayName), + Metadata(src.Metadata) + {} + + FStoreMarketingModel(const TSharedPtr& obj) : FStoreMarketingModel() + { + readFromValue(obj); + } + + ~FStoreMarketingModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum SourceType + { + SourceTypeAdmin, + SourceTypeBackEnd, + SourceTypeGameClient, + SourceTypeGameServer, + SourceTypePartner, + SourceTypeCustom, + SourceTypeAPI + }; + + PLAYFABCPP_API void writeSourceTypeEnumJSON(SourceType enumVal, JsonWriter& writer); + PLAYFABCPP_API SourceType readSourceTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API SourceType readSourceTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FStoreItem : public FPlayFabBaseModel + { + // [optional] Store specific custom data. The data only exists as part of this store; it is not transferred to item instances + FJsonKeeper CustomData; + + // [optional] Intended display position for this item. Note that 0 is the first position + Boxed DisplayPosition; + + /** + * Unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the + * catalog + */ + FString ItemId; + + // [optional] Override prices for this item for specific currencies + TMap RealCurrencyPrices; + // [optional] Override prices for this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + TMap VirtualCurrencyPrices; + FStoreItem() : + FPlayFabBaseModel(), + CustomData(), + DisplayPosition(), + ItemId(), + RealCurrencyPrices(), + VirtualCurrencyPrices() + {} + + FStoreItem(const FStoreItem& src) : + FPlayFabBaseModel(), + CustomData(src.CustomData), + DisplayPosition(src.DisplayPosition), + ItemId(src.ItemId), + RealCurrencyPrices(src.RealCurrencyPrices), + VirtualCurrencyPrices(src.VirtualCurrencyPrices) + {} + + FStoreItem(const TSharedPtr& obj) : FStoreItem() + { + readFromValue(obj); + } + + ~FStoreItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetStoreItemsResult : public FPlayFabBaseModel + { + // [optional] The base catalog that this store is a part of. + FString CatalogVersion; + + // [optional] Additional data about the store. + TSharedPtr MarketingData; + + // [optional] How the store was last updated (Admin or a third party). + Boxed Source; + + // [optional] Array of items which can be purchased from this store. + TArray Store; + // [optional] The ID of this store. + FString StoreId; + + FGetStoreItemsResult() : + FPlayFabBaseModel(), + CatalogVersion(), + MarketingData(nullptr), + Source(), + Store(), + StoreId() + {} + + FGetStoreItemsResult(const FGetStoreItemsResult& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + MarketingData(src.MarketingData.IsValid() ? MakeShareable(new FStoreMarketingModel(*src.MarketingData)) : nullptr), + Source(src.Source), + Store(src.Store), + StoreId(src.StoreId) + {} + + FGetStoreItemsResult(const TSharedPtr& obj) : FGetStoreItemsResult() + { + readFromValue(obj); + } + + ~FGetStoreItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTaskInstanceRequest : public FPlayFabBaseModel + { + // ID of the requested task instance. + FString TaskInstanceId; + + FGetTaskInstanceRequest() : + FPlayFabBaseModel(), + TaskInstanceId() + {} + + FGetTaskInstanceRequest(const FGetTaskInstanceRequest& src) : + FPlayFabBaseModel(), + TaskInstanceId(src.TaskInstanceId) + {} + + FGetTaskInstanceRequest(const TSharedPtr& obj) : FGetTaskInstanceRequest() + { + readFromValue(obj); + } + + ~FGetTaskInstanceRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTaskInstancesRequest : public FPlayFabBaseModel + { + // [optional] Optional range-from filter for task instances' StartedAt timestamp. + Boxed StartedAtRangeFrom; + + // [optional] Optional range-to filter for task instances' StartedAt timestamp. + Boxed StartedAtRangeTo; + + // [optional] Optional filter for task instances that are of a specific status. + Boxed StatusFilter; + + /** + * [optional] Name or ID of the task whose instances are being queried. If not specified, return all task instances that satisfy + * conditions set by other filters. + */ + TSharedPtr TaskIdentifier; + + FGetTaskInstancesRequest() : + FPlayFabBaseModel(), + StartedAtRangeFrom(), + StartedAtRangeTo(), + StatusFilter(), + TaskIdentifier(nullptr) + {} + + FGetTaskInstancesRequest(const FGetTaskInstancesRequest& src) : + FPlayFabBaseModel(), + StartedAtRangeFrom(src.StartedAtRangeFrom), + StartedAtRangeTo(src.StartedAtRangeTo), + StatusFilter(src.StatusFilter), + TaskIdentifier(src.TaskIdentifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.TaskIdentifier)) : nullptr) + {} + + FGetTaskInstancesRequest(const TSharedPtr& obj) : FGetTaskInstancesRequest() + { + readFromValue(obj); + } + + ~FGetTaskInstancesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ScheduledTaskType + { + ScheduledTaskTypeCloudScript, + ScheduledTaskTypeActionsOnPlayerSegment + }; + + PLAYFABCPP_API void writeScheduledTaskTypeEnumJSON(ScheduledTaskType enumVal, JsonWriter& writer); + PLAYFABCPP_API ScheduledTaskType readScheduledTaskTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ScheduledTaskType readScheduledTaskTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FTaskInstanceBasicSummary : public FPlayFabBaseModel + { + // [optional] UTC timestamp when the task completed. + Boxed CompletedAt; + + // [optional] Estimated time remaining in seconds. + Boxed EstimatedSecondsRemaining; + + // [optional] Progress represented as percentage. + Boxed PercentComplete; + + // [optional] If manually scheduled, ID of user who scheduled the task. + FString ScheduledByUserId; + + // UTC timestamp when the task started. + FDateTime StartedAt; + + // [optional] Current status of the task instance. + Boxed Status; + + // [optional] Identifier of the task this instance belongs to. + TSharedPtr TaskIdentifier; + + // [optional] ID of the task instance. + FString TaskInstanceId; + + // [optional] Type of the task. + Boxed Type; + + FTaskInstanceBasicSummary() : + FPlayFabBaseModel(), + CompletedAt(), + EstimatedSecondsRemaining(), + PercentComplete(), + ScheduledByUserId(), + StartedAt(0), + Status(), + TaskIdentifier(nullptr), + TaskInstanceId(), + Type() + {} + + FTaskInstanceBasicSummary(const FTaskInstanceBasicSummary& src) : + FPlayFabBaseModel(), + CompletedAt(src.CompletedAt), + EstimatedSecondsRemaining(src.EstimatedSecondsRemaining), + PercentComplete(src.PercentComplete), + ScheduledByUserId(src.ScheduledByUserId), + StartedAt(src.StartedAt), + Status(src.Status), + TaskIdentifier(src.TaskIdentifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.TaskIdentifier)) : nullptr), + TaskInstanceId(src.TaskInstanceId), + Type(src.Type) + {} + + FTaskInstanceBasicSummary(const TSharedPtr& obj) : FTaskInstanceBasicSummary() + { + readFromValue(obj); + } + + ~FTaskInstanceBasicSummary(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTaskInstancesResult : public FPlayFabBaseModel + { + /** + * [optional] Basic status summaries of the queried task instances. Empty If no task instances meets the filter criteria. To get + * detailed status summary, use Get*TaskInstance API according to task type (e.g. + * GetActionsOnPlayersInSegmentTaskInstance). + */ + TArray Summaries; + FGetTaskInstancesResult() : + FPlayFabBaseModel(), + Summaries() + {} + + FGetTaskInstancesResult(const FGetTaskInstancesResult& src) : + FPlayFabBaseModel(), + Summaries(src.Summaries) + {} + + FGetTaskInstancesResult(const TSharedPtr& obj) : FGetTaskInstancesResult() + { + readFromValue(obj); + } + + ~FGetTaskInstancesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTasksRequest : public FPlayFabBaseModel + { + // [optional] Provide either the task ID or the task name to get a specific task. If not specified, return all defined tasks. + TSharedPtr Identifier; + + FGetTasksRequest() : + FPlayFabBaseModel(), + Identifier(nullptr) + {} + + FGetTasksRequest(const FGetTasksRequest& src) : + FPlayFabBaseModel(), + Identifier(src.Identifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.Identifier)) : nullptr) + {} + + FGetTasksRequest(const TSharedPtr& obj) : FGetTasksRequest() + { + readFromValue(obj); + } + + ~FGetTasksRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FScheduledTask : public FPlayFabBaseModel + { + // [optional] Description the task + FString Description; + + // Whether the schedule is active. Inactive schedule will not trigger task execution. + bool IsActive; + + // [optional] UTC time of last run + Boxed LastRunTime; + + // Name of the task. This is a unique identifier for tasks in the title. + FString Name; + + // [optional] UTC time of next run + Boxed NextRunTime; + + /** + * [optional] Task parameter. Different types of task have different parameter structure. See each task type's create API + * documentation for the details. + */ + FJsonKeeper Parameter; + + // [optional] Cron expression for the run schedule of the task. The expression should be in UTC. + FString Schedule; + + // [optional] ID of the task + FString TaskId; + + // [optional] Task type. + Boxed Type; + + FScheduledTask() : + FPlayFabBaseModel(), + Description(), + IsActive(false), + LastRunTime(), + Name(), + NextRunTime(), + Parameter(), + Schedule(), + TaskId(), + Type() + {} + + FScheduledTask(const FScheduledTask& src) : + FPlayFabBaseModel(), + Description(src.Description), + IsActive(src.IsActive), + LastRunTime(src.LastRunTime), + Name(src.Name), + NextRunTime(src.NextRunTime), + Parameter(src.Parameter), + Schedule(src.Schedule), + TaskId(src.TaskId), + Type(src.Type) + {} + + FScheduledTask(const TSharedPtr& obj) : FScheduledTask() + { + readFromValue(obj); + } + + ~FScheduledTask(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTasksResult : public FPlayFabBaseModel + { + // [optional] Result tasks. Empty if there is no task found. + TArray Tasks; + FGetTasksResult() : + FPlayFabBaseModel(), + Tasks() + {} + + FGetTasksResult(const FGetTasksResult& src) : + FPlayFabBaseModel(), + Tasks(src.Tasks) + {} + + FGetTasksResult(const TSharedPtr& obj) : FGetTasksResult() + { + readFromValue(obj); + } + + ~FGetTasksResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleDataRequest : public FPlayFabBaseModel + { + // [optional] Specific keys to search for in the title data (leave null to get all keys) + TArray Keys; + FGetTitleDataRequest() : + FPlayFabBaseModel(), + Keys() + {} + + FGetTitleDataRequest(const FGetTitleDataRequest& src) : + FPlayFabBaseModel(), + Keys(src.Keys) + {} + + FGetTitleDataRequest(const TSharedPtr& obj) : FGetTitleDataRequest() + { + readFromValue(obj); + } + + ~FGetTitleDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleDataResult : public FPlayFabBaseModel + { + // [optional] a dictionary object of key / value pairs + TMap Data; + FGetTitleDataResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetTitleDataResult(const FGetTitleDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetTitleDataResult(const TSharedPtr& obj) : FGetTitleDataResult() + { + readFromValue(obj); + } + + ~FGetTitleDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserBansRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserBansRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetUserBansRequest(const FGetUserBansRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetUserBansRequest(const TSharedPtr& obj) : FGetUserBansRequest() + { + readFromValue(obj); + } + + ~FGetUserBansRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserBansResult : public FPlayFabBaseModel + { + // [optional] Information about the bans + TArray BanData; + FGetUserBansResult() : + FPlayFabBaseModel(), + BanData() + {} + + FGetUserBansResult(const FGetUserBansResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FGetUserBansResult(const TSharedPtr& obj) : FGetUserBansResult() + { + readFromValue(obj); + } + + ~FGetUserBansResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserDataRequest : public FPlayFabBaseModel + { + /** + * [optional] The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + Boxed IfChangedFromDataVersion; + + // [optional] Specific keys to search for in the custom user data. + TArray Keys; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserDataRequest() : + FPlayFabBaseModel(), + IfChangedFromDataVersion(), + Keys(), + PlayFabId() + {} + + FGetUserDataRequest(const FGetUserDataRequest& src) : + FPlayFabBaseModel(), + IfChangedFromDataVersion(src.IfChangedFromDataVersion), + Keys(src.Keys), + PlayFabId(src.PlayFabId) + {} + + FGetUserDataRequest(const TSharedPtr& obj) : FGetUserDataRequest() + { + readFromValue(obj); + } + + ~FGetUserDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum UserDataPermission + { + UserDataPermissionPrivate, + UserDataPermissionPublic + }; + + PLAYFABCPP_API void writeUserDataPermissionEnumJSON(UserDataPermission enumVal, JsonWriter& writer); + PLAYFABCPP_API UserDataPermission readUserDataPermissionFromValue(const TSharedPtr& value); + PLAYFABCPP_API UserDataPermission readUserDataPermissionFromValue(const FString& value); + + struct PLAYFABCPP_API FUserDataRecord : public FPlayFabBaseModel + { + // Timestamp for when this data was last updated. + FDateTime LastUpdated; + + /** + * [optional] Indicates whether this data can be read by all users (public) or only the user (private). This is used for GetUserData + * requests being made by one player about another player. + */ + Boxed Permission; + + // [optional] Data stored for the specified user data key. + FString Value; + + FUserDataRecord() : + FPlayFabBaseModel(), + LastUpdated(0), + Permission(), + Value() + {} + + FUserDataRecord(const FUserDataRecord& src) : + FPlayFabBaseModel(), + LastUpdated(src.LastUpdated), + Permission(src.Permission), + Value(src.Value) + {} + + FUserDataRecord(const TSharedPtr& obj) : FUserDataRecord() + { + readFromValue(obj); + } + + ~FUserDataRecord(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserDataResult : public FPlayFabBaseModel + { + // [optional] User specific data for this title. + TMap Data; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + // [optional] PlayFab unique identifier of the user whose custom data is being returned. + FString PlayFabId; + + FGetUserDataResult() : + FPlayFabBaseModel(), + Data(), + DataVersion(0), + PlayFabId() + {} + + FGetUserDataResult(const FGetUserDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data), + DataVersion(src.DataVersion), + PlayFabId(src.PlayFabId) + {} + + FGetUserDataResult(const TSharedPtr& obj) : FGetUserDataResult() + { + readFromValue(obj); + } + + ~FGetUserDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserInventoryRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserInventoryRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetUserInventoryRequest(const FGetUserInventoryRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetUserInventoryRequest(const TSharedPtr& obj) : FGetUserInventoryRequest() + { + readFromValue(obj); + } + + ~FGetUserInventoryRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemInstance : public FPlayFabBaseModel + { + // [optional] Game specific comment associated with this instance when it was added to the user inventory. + FString Annotation; + + // [optional] Array of unique items that were awarded when this catalog item was purchased. + TArray BundleContents; + /** + * [optional] Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or + * container. + */ + FString BundleParent; + + // [optional] Catalog version for the inventory item, when this instance was created. + FString CatalogVersion; + + // [optional] A set of custom key-value pairs on the inventory item. + TMap CustomData; + // [optional] CatalogItem.DisplayName at the time this item was purchased. + FString DisplayName; + + // [optional] Timestamp for when this instance will expire. + Boxed Expiration; + + // [optional] Class name for the inventory item, as defined in the catalog. + FString ItemClass; + + // [optional] Unique identifier for the inventory item, as defined in the catalog. + FString ItemId; + + // [optional] Unique item identifier for this specific instance of the item. + FString ItemInstanceId; + + // [optional] Timestamp for when this instance was purchased. + Boxed PurchaseDate; + + // [optional] Total number of remaining uses, if this is a consumable item. + Boxed RemainingUses; + + // [optional] Currency type for the cost of the catalog item. + FString UnitCurrency; + + // Cost of the catalog item in the given currency. + uint32 UnitPrice; + + // [optional] The number of uses that were added or removed to this item in this call. + Boxed UsesIncrementedBy; + + FItemInstance() : + FPlayFabBaseModel(), + Annotation(), + BundleContents(), + BundleParent(), + CatalogVersion(), + CustomData(), + DisplayName(), + Expiration(), + ItemClass(), + ItemId(), + ItemInstanceId(), + PurchaseDate(), + RemainingUses(), + UnitCurrency(), + UnitPrice(0), + UsesIncrementedBy() + {} + + FItemInstance(const FItemInstance& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + BundleContents(src.BundleContents), + BundleParent(src.BundleParent), + CatalogVersion(src.CatalogVersion), + CustomData(src.CustomData), + DisplayName(src.DisplayName), + Expiration(src.Expiration), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + PurchaseDate(src.PurchaseDate), + RemainingUses(src.RemainingUses), + UnitCurrency(src.UnitCurrency), + UnitPrice(src.UnitPrice), + UsesIncrementedBy(src.UsesIncrementedBy) + {} + + FItemInstance(const TSharedPtr& obj) : FItemInstance() + { + readFromValue(obj); + } + + ~FItemInstance(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FVirtualCurrencyRechargeTime : public FPlayFabBaseModel + { + /** + * Maximum value to which the regenerating currency will automatically increment. Note that it can exceed this value + * through use of the AddUserVirtualCurrency API call. However, it will not regenerate automatically until it has fallen + * below this value. + */ + int32 RechargeMax; + + // Server timestamp in UTC indicating the next time the virtual currency will be incremented. + FDateTime RechargeTime; + + // Time remaining (in seconds) before the next recharge increment of the virtual currency. + int32 SecondsToRecharge; + + FVirtualCurrencyRechargeTime() : + FPlayFabBaseModel(), + RechargeMax(0), + RechargeTime(0), + SecondsToRecharge(0) + {} + + FVirtualCurrencyRechargeTime(const FVirtualCurrencyRechargeTime& src) : + FPlayFabBaseModel(), + RechargeMax(src.RechargeMax), + RechargeTime(src.RechargeTime), + SecondsToRecharge(src.SecondsToRecharge) + {} + + FVirtualCurrencyRechargeTime(const TSharedPtr& obj) : FVirtualCurrencyRechargeTime() + { + readFromValue(obj); + } + + ~FVirtualCurrencyRechargeTime(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserInventoryResult : public FPlayFabBaseModel + { + // [optional] Array of inventory items belonging to the user. + TArray Inventory; + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] Array of virtual currency balance(s) belonging to the user. + TMap VirtualCurrency; + // [optional] Array of remaining times and timestamps for virtual currencies. + TMap VirtualCurrencyRechargeTimes; + FGetUserInventoryResult() : + FPlayFabBaseModel(), + Inventory(), + PlayFabId(), + VirtualCurrency(), + VirtualCurrencyRechargeTimes() + {} + + FGetUserInventoryResult(const FGetUserInventoryResult& src) : + FPlayFabBaseModel(), + Inventory(src.Inventory), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency), + VirtualCurrencyRechargeTimes(src.VirtualCurrencyRechargeTimes) + {} + + FGetUserInventoryResult(const TSharedPtr& obj) : FGetUserInventoryResult() + { + readFromValue(obj); + } + + ~FGetUserInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantedItemInstance : public FPlayFabBaseModel + { + // [optional] Game specific comment associated with this instance when it was added to the user inventory. + FString Annotation; + + // [optional] Array of unique items that were awarded when this catalog item was purchased. + TArray BundleContents; + /** + * [optional] Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or + * container. + */ + FString BundleParent; + + // [optional] Catalog version for the inventory item, when this instance was created. + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] A set of custom key-value pairs on the inventory item. + TMap CustomData; + // [optional] CatalogItem.DisplayName at the time this item was purchased. + FString DisplayName; + + // [optional] Timestamp for when this instance will expire. + Boxed Expiration; + + // [optional] Class name for the inventory item, as defined in the catalog. + FString ItemClass; + + // [optional] Unique identifier for the inventory item, as defined in the catalog. + FString ItemId; + + // [optional] Unique item identifier for this specific instance of the item. + FString ItemInstanceId; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] Timestamp for when this instance was purchased. + Boxed PurchaseDate; + + // [optional] Total number of remaining uses, if this is a consumable item. + Boxed RemainingUses; + + // Result of this operation. + bool Result; + + // [optional] Currency type for the cost of the catalog item. + FString UnitCurrency; + + // Cost of the catalog item in the given currency. + uint32 UnitPrice; + + // [optional] The number of uses that were added or removed to this item in this call. + Boxed UsesIncrementedBy; + + FGrantedItemInstance() : + FPlayFabBaseModel(), + Annotation(), + BundleContents(), + BundleParent(), + CatalogVersion(), + CharacterId(), + CustomData(), + DisplayName(), + Expiration(), + ItemClass(), + ItemId(), + ItemInstanceId(), + PlayFabId(), + PurchaseDate(), + RemainingUses(), + Result(false), + UnitCurrency(), + UnitPrice(0), + UsesIncrementedBy() + {} + + FGrantedItemInstance(const FGrantedItemInstance& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + BundleContents(src.BundleContents), + BundleParent(src.BundleParent), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + CustomData(src.CustomData), + DisplayName(src.DisplayName), + Expiration(src.Expiration), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId), + PurchaseDate(src.PurchaseDate), + RemainingUses(src.RemainingUses), + Result(src.Result), + UnitCurrency(src.UnitCurrency), + UnitPrice(src.UnitPrice), + UsesIncrementedBy(src.UsesIncrementedBy) + {} + + FGrantedItemInstance(const TSharedPtr& obj) : FGrantedItemInstance() + { + readFromValue(obj); + } + + ~FGrantedItemInstance(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemGrant : public FPlayFabBaseModel + { + // [optional] String detailing any additional information concerning this operation. + FString Annotation; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + // Unique identifier of the catalog item to be granted to the user. + FString ItemId; + + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FItemGrant() : + FPlayFabBaseModel(), + Annotation(), + CharacterId(), + Data(), + ItemId(), + KeysToRemove(), + PlayFabId() + {} + + FItemGrant(const FItemGrant& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + CharacterId(src.CharacterId), + Data(src.Data), + ItemId(src.ItemId), + KeysToRemove(src.KeysToRemove), + PlayFabId(src.PlayFabId) + {} + + FItemGrant(const TSharedPtr& obj) : FItemGrant() + { + readFromValue(obj); + } + + ~FItemGrant(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToUsersRequest : public FPlayFabBaseModel + { + // [optional] Catalog version from which items are to be granted. + FString CatalogVersion; + + // Array of items to grant and the users to whom the items are to be granted. + TArray ItemGrants; + FGrantItemsToUsersRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + ItemGrants() + {} + + FGrantItemsToUsersRequest(const FGrantItemsToUsersRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + ItemGrants(src.ItemGrants) + {} + + FGrantItemsToUsersRequest(const TSharedPtr& obj) : FGrantItemsToUsersRequest() + { + readFromValue(obj); + } + + ~FGrantItemsToUsersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToUsersResult : public FPlayFabBaseModel + { + // [optional] Array of items granted to users. + TArray ItemGrantResults; + FGrantItemsToUsersResult() : + FPlayFabBaseModel(), + ItemGrantResults() + {} + + FGrantItemsToUsersResult(const FGrantItemsToUsersResult& src) : + FPlayFabBaseModel(), + ItemGrantResults(src.ItemGrantResults) + {} + + FGrantItemsToUsersResult(const TSharedPtr& obj) : FGrantItemsToUsersResult() + { + readFromValue(obj); + } + + ~FGrantItemsToUsersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FIncrementLimitedEditionItemAvailabilityRequest : public FPlayFabBaseModel + { + // Amount to increase availability by. + int32 Amount; + + // [optional] Which catalog is being updated. If null, uses the default catalog. + FString CatalogVersion; + + // The item which needs more availability. + FString ItemId; + + FIncrementLimitedEditionItemAvailabilityRequest() : + FPlayFabBaseModel(), + Amount(0), + CatalogVersion(), + ItemId() + {} + + FIncrementLimitedEditionItemAvailabilityRequest(const FIncrementLimitedEditionItemAvailabilityRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + CatalogVersion(src.CatalogVersion), + ItemId(src.ItemId) + {} + + FIncrementLimitedEditionItemAvailabilityRequest(const TSharedPtr& obj) : FIncrementLimitedEditionItemAvailabilityRequest() + { + readFromValue(obj); + } + + ~FIncrementLimitedEditionItemAvailabilityRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FIncrementLimitedEditionItemAvailabilityResult : public FPlayFabBaseModel + { + FIncrementLimitedEditionItemAvailabilityResult() : + FPlayFabBaseModel() + {} + + FIncrementLimitedEditionItemAvailabilityResult(const FIncrementLimitedEditionItemAvailabilityResult& src) : + FPlayFabBaseModel() + {} + + FIncrementLimitedEditionItemAvailabilityResult(const TSharedPtr& obj) : FIncrementLimitedEditionItemAvailabilityResult() + { + readFromValue(obj); + } + + ~FIncrementLimitedEditionItemAvailabilityResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FIncrementPlayerStatisticVersionRequest : public FPlayFabBaseModel + { + // [optional] unique name of the statistic + FString StatisticName; + + FIncrementPlayerStatisticVersionRequest() : + FPlayFabBaseModel(), + StatisticName() + {} + + FIncrementPlayerStatisticVersionRequest(const FIncrementPlayerStatisticVersionRequest& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName) + {} + + FIncrementPlayerStatisticVersionRequest(const TSharedPtr& obj) : FIncrementPlayerStatisticVersionRequest() + { + readFromValue(obj); + } + + ~FIncrementPlayerStatisticVersionRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FIncrementPlayerStatisticVersionResult : public FPlayFabBaseModel + { + // [optional] version change history of the statistic + TSharedPtr StatisticVersion; + + FIncrementPlayerStatisticVersionResult() : + FPlayFabBaseModel(), + StatisticVersion(nullptr) + {} + + FIncrementPlayerStatisticVersionResult(const FIncrementPlayerStatisticVersionResult& src) : + FPlayFabBaseModel(), + StatisticVersion(src.StatisticVersion.IsValid() ? MakeShareable(new FPlayerStatisticVersion(*src.StatisticVersion)) : nullptr) + {} + + FIncrementPlayerStatisticVersionResult(const TSharedPtr& obj) : FIncrementPlayerStatisticVersionResult() + { + readFromValue(obj); + } + + ~FIncrementPlayerStatisticVersionResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListBuildsRequest : public FPlayFabBaseModel + { + FListBuildsRequest() : + FPlayFabBaseModel() + {} + + FListBuildsRequest(const FListBuildsRequest& src) : + FPlayFabBaseModel() + {} + + FListBuildsRequest(const TSharedPtr& obj) : FListBuildsRequest() + { + readFromValue(obj); + } + + ~FListBuildsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListBuildsResult : public FPlayFabBaseModel + { + // [optional] array of uploaded game server builds + TArray Builds; + FListBuildsResult() : + FPlayFabBaseModel(), + Builds() + {} + + FListBuildsResult(const FListBuildsResult& src) : + FPlayFabBaseModel(), + Builds(src.Builds) + {} + + FListBuildsResult(const TSharedPtr& obj) : FListBuildsResult() + { + readFromValue(obj); + } + + ~FListBuildsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListVirtualCurrencyTypesRequest : public FPlayFabBaseModel + { + FListVirtualCurrencyTypesRequest() : + FPlayFabBaseModel() + {} + + FListVirtualCurrencyTypesRequest(const FListVirtualCurrencyTypesRequest& src) : + FPlayFabBaseModel() + {} + + FListVirtualCurrencyTypesRequest(const TSharedPtr& obj) : FListVirtualCurrencyTypesRequest() + { + readFromValue(obj); + } + + ~FListVirtualCurrencyTypesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListVirtualCurrencyTypesResult : public FPlayFabBaseModel + { + // [optional] List of virtual currency names defined for this title + TArray VirtualCurrencies; + FListVirtualCurrencyTypesResult() : + FPlayFabBaseModel(), + VirtualCurrencies() + {} + + FListVirtualCurrencyTypesResult(const FListVirtualCurrencyTypesResult& src) : + FPlayFabBaseModel(), + VirtualCurrencies(src.VirtualCurrencies) + {} + + FListVirtualCurrencyTypesResult(const TSharedPtr& obj) : FListVirtualCurrencyTypesResult() + { + readFromValue(obj); + } + + ~FListVirtualCurrencyTypesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLookupUserAccountInfoRequest : public FPlayFabBaseModel + { + // [optional] User email address attached to their account + FString Email; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] Title specific username to match against existing user accounts + FString TitleDisplayName; + + // [optional] PlayFab username for the account (3-20 characters) + FString Username; + + FLookupUserAccountInfoRequest() : + FPlayFabBaseModel(), + Email(), + PlayFabId(), + TitleDisplayName(), + Username() + {} + + FLookupUserAccountInfoRequest(const FLookupUserAccountInfoRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + PlayFabId(src.PlayFabId), + TitleDisplayName(src.TitleDisplayName), + Username(src.Username) + {} + + FLookupUserAccountInfoRequest(const TSharedPtr& obj) : FLookupUserAccountInfoRequest() + { + readFromValue(obj); + } + + ~FLookupUserAccountInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserAndroidDeviceInfo : public FPlayFabBaseModel + { + // [optional] Android device ID + FString AndroidDeviceId; + + FUserAndroidDeviceInfo() : + FPlayFabBaseModel(), + AndroidDeviceId() + {} + + FUserAndroidDeviceInfo(const FUserAndroidDeviceInfo& src) : + FPlayFabBaseModel(), + AndroidDeviceId(src.AndroidDeviceId) + {} + + FUserAndroidDeviceInfo(const TSharedPtr& obj) : FUserAndroidDeviceInfo() + { + readFromValue(obj); + } + + ~FUserAndroidDeviceInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserCustomIdInfo : public FPlayFabBaseModel + { + // [optional] Custom ID + FString CustomId; + + FUserCustomIdInfo() : + FPlayFabBaseModel(), + CustomId() + {} + + FUserCustomIdInfo(const FUserCustomIdInfo& src) : + FPlayFabBaseModel(), + CustomId(src.CustomId) + {} + + FUserCustomIdInfo(const TSharedPtr& obj) : FUserCustomIdInfo() + { + readFromValue(obj); + } + + ~FUserCustomIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserFacebookInfo : public FPlayFabBaseModel + { + // [optional] Facebook identifier + FString FacebookId; + + // [optional] Facebook full name + FString FullName; + + FUserFacebookInfo() : + FPlayFabBaseModel(), + FacebookId(), + FullName() + {} + + FUserFacebookInfo(const FUserFacebookInfo& src) : + FPlayFabBaseModel(), + FacebookId(src.FacebookId), + FullName(src.FullName) + {} + + FUserFacebookInfo(const TSharedPtr& obj) : FUserFacebookInfo() + { + readFromValue(obj); + } + + ~FUserFacebookInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserFacebookInstantGamesIdInfo : public FPlayFabBaseModel + { + // [optional] Facebook Instant Games ID + FString FacebookInstantGamesId; + + FUserFacebookInstantGamesIdInfo() : + FPlayFabBaseModel(), + FacebookInstantGamesId() + {} + + FUserFacebookInstantGamesIdInfo(const FUserFacebookInstantGamesIdInfo& src) : + FPlayFabBaseModel(), + FacebookInstantGamesId(src.FacebookInstantGamesId) + {} + + FUserFacebookInstantGamesIdInfo(const TSharedPtr& obj) : FUserFacebookInstantGamesIdInfo() + { + readFromValue(obj); + } + + ~FUserFacebookInstantGamesIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserGameCenterInfo : public FPlayFabBaseModel + { + // [optional] Gamecenter identifier + FString GameCenterId; + + FUserGameCenterInfo() : + FPlayFabBaseModel(), + GameCenterId() + {} + + FUserGameCenterInfo(const FUserGameCenterInfo& src) : + FPlayFabBaseModel(), + GameCenterId(src.GameCenterId) + {} + + FUserGameCenterInfo(const TSharedPtr& obj) : FUserGameCenterInfo() + { + readFromValue(obj); + } + + ~FUserGameCenterInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserGoogleInfo : public FPlayFabBaseModel + { + // [optional] Email address of the Google account + FString GoogleEmail; + + // [optional] Gender information of the Google account + FString GoogleGender; + + // [optional] Google ID + FString GoogleId; + + // [optional] Locale of the Google account + FString GoogleLocale; + + FUserGoogleInfo() : + FPlayFabBaseModel(), + GoogleEmail(), + GoogleGender(), + GoogleId(), + GoogleLocale() + {} + + FUserGoogleInfo(const FUserGoogleInfo& src) : + FPlayFabBaseModel(), + GoogleEmail(src.GoogleEmail), + GoogleGender(src.GoogleGender), + GoogleId(src.GoogleId), + GoogleLocale(src.GoogleLocale) + {} + + FUserGoogleInfo(const TSharedPtr& obj) : FUserGoogleInfo() + { + readFromValue(obj); + } + + ~FUserGoogleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserIosDeviceInfo : public FPlayFabBaseModel + { + // [optional] iOS device ID + FString IosDeviceId; + + FUserIosDeviceInfo() : + FPlayFabBaseModel(), + IosDeviceId() + {} + + FUserIosDeviceInfo(const FUserIosDeviceInfo& src) : + FPlayFabBaseModel(), + IosDeviceId(src.IosDeviceId) + {} + + FUserIosDeviceInfo(const TSharedPtr& obj) : FUserIosDeviceInfo() + { + readFromValue(obj); + } + + ~FUserIosDeviceInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserKongregateInfo : public FPlayFabBaseModel + { + // [optional] Kongregate ID + FString KongregateId; + + // [optional] Kongregate Username + FString KongregateName; + + FUserKongregateInfo() : + FPlayFabBaseModel(), + KongregateId(), + KongregateName() + {} + + FUserKongregateInfo(const FUserKongregateInfo& src) : + FPlayFabBaseModel(), + KongregateId(src.KongregateId), + KongregateName(src.KongregateName) + {} + + FUserKongregateInfo(const TSharedPtr& obj) : FUserKongregateInfo() + { + readFromValue(obj); + } + + ~FUserKongregateInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserNintendoSwitchDeviceIdInfo : public FPlayFabBaseModel + { + // [optional] Nintendo Switch Device ID + FString NintendoSwitchDeviceId; + + FUserNintendoSwitchDeviceIdInfo() : + FPlayFabBaseModel(), + NintendoSwitchDeviceId() + {} + + FUserNintendoSwitchDeviceIdInfo(const FUserNintendoSwitchDeviceIdInfo& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId) + {} + + FUserNintendoSwitchDeviceIdInfo(const TSharedPtr& obj) : FUserNintendoSwitchDeviceIdInfo() + { + readFromValue(obj); + } + + ~FUserNintendoSwitchDeviceIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserOpenIdInfo : public FPlayFabBaseModel + { + // [optional] OpenID Connection ID + FString ConnectionId; + + // [optional] OpenID Issuer + FString Issuer; + + // [optional] OpenID Subject + FString Subject; + + FUserOpenIdInfo() : + FPlayFabBaseModel(), + ConnectionId(), + Issuer(), + Subject() + {} + + FUserOpenIdInfo(const FUserOpenIdInfo& src) : + FPlayFabBaseModel(), + ConnectionId(src.ConnectionId), + Issuer(src.Issuer), + Subject(src.Subject) + {} + + FUserOpenIdInfo(const TSharedPtr& obj) : FUserOpenIdInfo() + { + readFromValue(obj); + } + + ~FUserOpenIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserPrivateAccountInfo : public FPlayFabBaseModel + { + // [optional] user email address + FString Email; + + FUserPrivateAccountInfo() : + FPlayFabBaseModel(), + Email() + {} + + FUserPrivateAccountInfo(const FUserPrivateAccountInfo& src) : + FPlayFabBaseModel(), + Email(src.Email) + {} + + FUserPrivateAccountInfo(const TSharedPtr& obj) : FUserPrivateAccountInfo() + { + readFromValue(obj); + } + + ~FUserPrivateAccountInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserPsnInfo : public FPlayFabBaseModel + { + // [optional] PSN account ID + FString PsnAccountId; + + // [optional] PSN online ID + FString PsnOnlineId; + + FUserPsnInfo() : + FPlayFabBaseModel(), + PsnAccountId(), + PsnOnlineId() + {} + + FUserPsnInfo(const FUserPsnInfo& src) : + FPlayFabBaseModel(), + PsnAccountId(src.PsnAccountId), + PsnOnlineId(src.PsnOnlineId) + {} + + FUserPsnInfo(const TSharedPtr& obj) : FUserPsnInfo() + { + readFromValue(obj); + } + + ~FUserPsnInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum TitleActivationStatus + { + TitleActivationStatusNone, + TitleActivationStatusActivatedTitleKey, + TitleActivationStatusPendingSteam, + TitleActivationStatusActivatedSteam, + TitleActivationStatusRevokedSteam + }; + + PLAYFABCPP_API void writeTitleActivationStatusEnumJSON(TitleActivationStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API TitleActivationStatus readTitleActivationStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API TitleActivationStatus readTitleActivationStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FUserSteamInfo : public FPlayFabBaseModel + { + // [optional] what stage of game ownership the user is listed as being in, from Steam + Boxed SteamActivationStatus; + + // [optional] the country in which the player resides, from Steam data + FString SteamCountry; + + // [optional] currency type set in the user Steam account + Boxed SteamCurrency; + + // [optional] Steam identifier + FString SteamId; + + FUserSteamInfo() : + FPlayFabBaseModel(), + SteamActivationStatus(), + SteamCountry(), + SteamCurrency(), + SteamId() + {} + + FUserSteamInfo(const FUserSteamInfo& src) : + FPlayFabBaseModel(), + SteamActivationStatus(src.SteamActivationStatus), + SteamCountry(src.SteamCountry), + SteamCurrency(src.SteamCurrency), + SteamId(src.SteamId) + {} + + FUserSteamInfo(const TSharedPtr& obj) : FUserSteamInfo() + { + readFromValue(obj); + } + + ~FUserSteamInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum UserOrigination + { + UserOriginationOrganic, + UserOriginationSteam, + UserOriginationGoogle, + UserOriginationAmazon, + UserOriginationFacebook, + UserOriginationKongregate, + UserOriginationGamersFirst, + UserOriginationUnknown, + UserOriginationIOS, + UserOriginationLoadTest, + UserOriginationAndroid, + UserOriginationPSN, + UserOriginationGameCenter, + UserOriginationCustomId, + UserOriginationXboxLive, + UserOriginationParse, + UserOriginationTwitch, + UserOriginationWindowsHello, + UserOriginationServerCustomId, + UserOriginationNintendoSwitchDeviceId, + UserOriginationFacebookInstantGamesId, + UserOriginationOpenIdConnect + }; + + PLAYFABCPP_API void writeUserOriginationEnumJSON(UserOrigination enumVal, JsonWriter& writer); + PLAYFABCPP_API UserOrigination readUserOriginationFromValue(const TSharedPtr& value); + PLAYFABCPP_API UserOrigination readUserOriginationFromValue(const FString& value); + + struct PLAYFABCPP_API FUserTitleInfo : public FPlayFabBaseModel + { + // [optional] URL to the player's avatar. + FString AvatarUrl; + + /** + * timestamp indicating when the user was first associated with this game (this can differ significantly from when the user + * first registered with PlayFab) + */ + FDateTime Created; + + // [optional] name of the user, as it is displayed in-game + FString DisplayName; + + /** + * [optional] timestamp indicating when the user first signed into this game (this can differ from the Created timestamp, as other + * events, such as issuing a beta key to the user, can associate the title to the user) + */ + Boxed FirstLogin; + + // [optional] boolean indicating whether or not the user is currently banned for a title + Boxed isBanned; + + // [optional] timestamp for the last user login for this title + Boxed LastLogin; + + // [optional] source by which the user first joined the game, if known + Boxed Origination; + + // [optional] Title player account entity for this user + TSharedPtr TitlePlayerAccount; + + FUserTitleInfo() : + FPlayFabBaseModel(), + AvatarUrl(), + Created(0), + DisplayName(), + FirstLogin(), + isBanned(), + LastLogin(), + Origination(), + TitlePlayerAccount(nullptr) + {} + + FUserTitleInfo(const FUserTitleInfo& src) : + FPlayFabBaseModel(), + AvatarUrl(src.AvatarUrl), + Created(src.Created), + DisplayName(src.DisplayName), + FirstLogin(src.FirstLogin), + isBanned(src.isBanned), + LastLogin(src.LastLogin), + Origination(src.Origination), + TitlePlayerAccount(src.TitlePlayerAccount.IsValid() ? MakeShareable(new FEntityKey(*src.TitlePlayerAccount)) : nullptr) + {} + + FUserTitleInfo(const TSharedPtr& obj) : FUserTitleInfo() + { + readFromValue(obj); + } + + ~FUserTitleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserTwitchInfo : public FPlayFabBaseModel + { + // [optional] Twitch ID + FString TwitchId; + + // [optional] Twitch Username + FString TwitchUserName; + + FUserTwitchInfo() : + FPlayFabBaseModel(), + TwitchId(), + TwitchUserName() + {} + + FUserTwitchInfo(const FUserTwitchInfo& src) : + FPlayFabBaseModel(), + TwitchId(src.TwitchId), + TwitchUserName(src.TwitchUserName) + {} + + FUserTwitchInfo(const TSharedPtr& obj) : FUserTwitchInfo() + { + readFromValue(obj); + } + + ~FUserTwitchInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserWindowsHelloInfo : public FPlayFabBaseModel + { + // [optional] Windows Hello Device Name + FString WindowsHelloDeviceName; + + // [optional] Windows Hello Public Key Hash + FString WindowsHelloPublicKeyHash; + + FUserWindowsHelloInfo() : + FPlayFabBaseModel(), + WindowsHelloDeviceName(), + WindowsHelloPublicKeyHash() + {} + + FUserWindowsHelloInfo(const FUserWindowsHelloInfo& src) : + FPlayFabBaseModel(), + WindowsHelloDeviceName(src.WindowsHelloDeviceName), + WindowsHelloPublicKeyHash(src.WindowsHelloPublicKeyHash) + {} + + FUserWindowsHelloInfo(const TSharedPtr& obj) : FUserWindowsHelloInfo() + { + readFromValue(obj); + } + + ~FUserWindowsHelloInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserXboxInfo : public FPlayFabBaseModel + { + // [optional] XBox user ID + FString XboxUserId; + + FUserXboxInfo() : + FPlayFabBaseModel(), + XboxUserId() + {} + + FUserXboxInfo(const FUserXboxInfo& src) : + FPlayFabBaseModel(), + XboxUserId(src.XboxUserId) + {} + + FUserXboxInfo(const TSharedPtr& obj) : FUserXboxInfo() + { + readFromValue(obj); + } + + ~FUserXboxInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserAccountInfo : public FPlayFabBaseModel + { + // [optional] User Android device information, if an Android device has been linked + TSharedPtr AndroidDeviceInfo; + + // Timestamp indicating when the user account was created + FDateTime Created; + + // [optional] Custom ID information, if a custom ID has been assigned + TSharedPtr CustomIdInfo; + + // [optional] User Facebook information, if a Facebook account has been linked + TSharedPtr FacebookInfo; + + // [optional] Facebook Instant Games account information, if a Facebook Instant Games account has been linked + TSharedPtr FacebookInstantGamesIdInfo; + + // [optional] User Gamecenter information, if a Gamecenter account has been linked + TSharedPtr GameCenterInfo; + + // [optional] User Google account information, if a Google account has been linked + TSharedPtr GoogleInfo; + + // [optional] User iOS device information, if an iOS device has been linked + TSharedPtr IosDeviceInfo; + + // [optional] User Kongregate account information, if a Kongregate account has been linked + TSharedPtr KongregateInfo; + + // [optional] Nintendo Switch account information, if a Nintendo Switch account has been linked + TSharedPtr NintendoSwitchDeviceIdInfo; + + // [optional] OpenID Connect information, if any OpenID Connect accounts have been linked + TArray OpenIdInfo; + // [optional] Unique identifier for the user account + FString PlayFabId; + + // [optional] Personal information for the user which is considered more sensitive + TSharedPtr PrivateInfo; + + // [optional] User PSN account information, if a PSN account has been linked + TSharedPtr PsnInfo; + + // [optional] User Steam information, if a Steam account has been linked + TSharedPtr SteamInfo; + + // [optional] Title-specific information for the user account + TSharedPtr TitleInfo; + + // [optional] User Twitch account information, if a Twitch account has been linked + TSharedPtr TwitchInfo; + + // [optional] User account name in the PlayFab service + FString Username; + + // [optional] Windows Hello account information, if a Windows Hello account has been linked + TSharedPtr WindowsHelloInfo; + + // [optional] User XBox account information, if a XBox account has been linked + TSharedPtr XboxInfo; + + FUserAccountInfo() : + FPlayFabBaseModel(), + AndroidDeviceInfo(nullptr), + Created(0), + CustomIdInfo(nullptr), + FacebookInfo(nullptr), + FacebookInstantGamesIdInfo(nullptr), + GameCenterInfo(nullptr), + GoogleInfo(nullptr), + IosDeviceInfo(nullptr), + KongregateInfo(nullptr), + NintendoSwitchDeviceIdInfo(nullptr), + OpenIdInfo(), + PlayFabId(), + PrivateInfo(nullptr), + PsnInfo(nullptr), + SteamInfo(nullptr), + TitleInfo(nullptr), + TwitchInfo(nullptr), + Username(), + WindowsHelloInfo(nullptr), + XboxInfo(nullptr) + {} + + FUserAccountInfo(const FUserAccountInfo& src) : + FPlayFabBaseModel(), + AndroidDeviceInfo(src.AndroidDeviceInfo.IsValid() ? MakeShareable(new FUserAndroidDeviceInfo(*src.AndroidDeviceInfo)) : nullptr), + Created(src.Created), + CustomIdInfo(src.CustomIdInfo.IsValid() ? MakeShareable(new FUserCustomIdInfo(*src.CustomIdInfo)) : nullptr), + FacebookInfo(src.FacebookInfo.IsValid() ? MakeShareable(new FUserFacebookInfo(*src.FacebookInfo)) : nullptr), + FacebookInstantGamesIdInfo(src.FacebookInstantGamesIdInfo.IsValid() ? MakeShareable(new FUserFacebookInstantGamesIdInfo(*src.FacebookInstantGamesIdInfo)) : nullptr), + GameCenterInfo(src.GameCenterInfo.IsValid() ? MakeShareable(new FUserGameCenterInfo(*src.GameCenterInfo)) : nullptr), + GoogleInfo(src.GoogleInfo.IsValid() ? MakeShareable(new FUserGoogleInfo(*src.GoogleInfo)) : nullptr), + IosDeviceInfo(src.IosDeviceInfo.IsValid() ? MakeShareable(new FUserIosDeviceInfo(*src.IosDeviceInfo)) : nullptr), + KongregateInfo(src.KongregateInfo.IsValid() ? MakeShareable(new FUserKongregateInfo(*src.KongregateInfo)) : nullptr), + NintendoSwitchDeviceIdInfo(src.NintendoSwitchDeviceIdInfo.IsValid() ? MakeShareable(new FUserNintendoSwitchDeviceIdInfo(*src.NintendoSwitchDeviceIdInfo)) : nullptr), + OpenIdInfo(src.OpenIdInfo), + PlayFabId(src.PlayFabId), + PrivateInfo(src.PrivateInfo.IsValid() ? MakeShareable(new FUserPrivateAccountInfo(*src.PrivateInfo)) : nullptr), + PsnInfo(src.PsnInfo.IsValid() ? MakeShareable(new FUserPsnInfo(*src.PsnInfo)) : nullptr), + SteamInfo(src.SteamInfo.IsValid() ? MakeShareable(new FUserSteamInfo(*src.SteamInfo)) : nullptr), + TitleInfo(src.TitleInfo.IsValid() ? MakeShareable(new FUserTitleInfo(*src.TitleInfo)) : nullptr), + TwitchInfo(src.TwitchInfo.IsValid() ? MakeShareable(new FUserTwitchInfo(*src.TwitchInfo)) : nullptr), + Username(src.Username), + WindowsHelloInfo(src.WindowsHelloInfo.IsValid() ? MakeShareable(new FUserWindowsHelloInfo(*src.WindowsHelloInfo)) : nullptr), + XboxInfo(src.XboxInfo.IsValid() ? MakeShareable(new FUserXboxInfo(*src.XboxInfo)) : nullptr) + {} + + FUserAccountInfo(const TSharedPtr& obj) : FUserAccountInfo() + { + readFromValue(obj); + } + + ~FUserAccountInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLookupUserAccountInfoResult : public FPlayFabBaseModel + { + // [optional] User info for the user matching the request + TSharedPtr UserInfo; + + FLookupUserAccountInfoResult() : + FPlayFabBaseModel(), + UserInfo(nullptr) + {} + + FLookupUserAccountInfoResult(const FLookupUserAccountInfoResult& src) : + FPlayFabBaseModel(), + UserInfo(src.UserInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.UserInfo)) : nullptr) + {} + + FLookupUserAccountInfoResult(const TSharedPtr& obj) : FLookupUserAccountInfoResult() + { + readFromValue(obj); + } + + ~FLookupUserAccountInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyMatchmakerGameModesRequest : public FPlayFabBaseModel + { + // previously uploaded build version for which game modes are being specified + FString BuildVersion; + + // array of game modes (Note: this will replace all game modes for the indicated build version) + TArray GameModes; + FModifyMatchmakerGameModesRequest() : + FPlayFabBaseModel(), + BuildVersion(), + GameModes() + {} + + FModifyMatchmakerGameModesRequest(const FModifyMatchmakerGameModesRequest& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + GameModes(src.GameModes) + {} + + FModifyMatchmakerGameModesRequest(const TSharedPtr& obj) : FModifyMatchmakerGameModesRequest() + { + readFromValue(obj); + } + + ~FModifyMatchmakerGameModesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyMatchmakerGameModesResult : public FPlayFabBaseModel + { + FModifyMatchmakerGameModesResult() : + FPlayFabBaseModel() + {} + + FModifyMatchmakerGameModesResult(const FModifyMatchmakerGameModesResult& src) : + FPlayFabBaseModel() + {} + + FModifyMatchmakerGameModesResult(const TSharedPtr& obj) : FModifyMatchmakerGameModesResult() + { + readFromValue(obj); + } + + ~FModifyMatchmakerGameModesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyServerBuildRequest : public FPlayFabBaseModel + { + // [optional] array of regions where this build can used, when it is active + TArray ActiveRegions; + // unique identifier of the previously uploaded build executable to be updated + FString BuildId; + + // [optional] appended to the end of the command line when starting game servers + FString CommandLineTemplate; + + // [optional] developer comment(s) for this build + FString Comment; + + // [optional] path to the game server executable. Defaults to gameserver.exe + FString ExecutablePath; + + // maximum number of game server instances that can run on a single host machine + int32 MaxGamesPerHost; + + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + int32 MinFreeGameSlots; + + // [optional] new timestamp + Boxed Timestamp; + + FModifyServerBuildRequest() : + FPlayFabBaseModel(), + ActiveRegions(), + BuildId(), + CommandLineTemplate(), + Comment(), + ExecutablePath(), + MaxGamesPerHost(0), + MinFreeGameSlots(0), + Timestamp() + {} + + FModifyServerBuildRequest(const FModifyServerBuildRequest& src) : + FPlayFabBaseModel(), + ActiveRegions(src.ActiveRegions), + BuildId(src.BuildId), + CommandLineTemplate(src.CommandLineTemplate), + Comment(src.Comment), + ExecutablePath(src.ExecutablePath), + MaxGamesPerHost(src.MaxGamesPerHost), + MinFreeGameSlots(src.MinFreeGameSlots), + Timestamp(src.Timestamp) + {} + + FModifyServerBuildRequest(const TSharedPtr& obj) : FModifyServerBuildRequest() + { + readFromValue(obj); + } + + ~FModifyServerBuildRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyServerBuildResult : public FPlayFabBaseModel + { + // [optional] array of regions where this build can used, when it is active + TArray ActiveRegions; + // [optional] unique identifier for this build executable + FString BuildId; + + // [optional] appended to the end of the command line when starting game servers + FString CommandLineTemplate; + + // [optional] developer comment(s) for this build + FString Comment; + + // [optional] path to the game server executable. Defaults to gameserver.exe + FString ExecutablePath; + + // maximum number of game server instances that can run on a single host machine + int32 MaxGamesPerHost; + + /** + * minimum capacity of additional game server instances that can be started before the autoscaling service starts new host + * machines (given the number of current running host machines and game server instances) + */ + int32 MinFreeGameSlots; + + // [optional] the current status of the build validation and processing steps + Boxed Status; + + // time this build was last modified (or uploaded, if this build has never been modified) + FDateTime Timestamp; + + /** + * [optional] Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FModifyServerBuildResult() : + FPlayFabBaseModel(), + ActiveRegions(), + BuildId(), + CommandLineTemplate(), + Comment(), + ExecutablePath(), + MaxGamesPerHost(0), + MinFreeGameSlots(0), + Status(), + Timestamp(0), + TitleId() + {} + + FModifyServerBuildResult(const FModifyServerBuildResult& src) : + FPlayFabBaseModel(), + ActiveRegions(src.ActiveRegions), + BuildId(src.BuildId), + CommandLineTemplate(src.CommandLineTemplate), + Comment(src.Comment), + ExecutablePath(src.ExecutablePath), + MaxGamesPerHost(src.MaxGamesPerHost), + MinFreeGameSlots(src.MinFreeGameSlots), + Status(src.Status), + Timestamp(src.Timestamp), + TitleId(src.TitleId) + {} + + FModifyServerBuildResult(const TSharedPtr& obj) : FModifyServerBuildResult() + { + readFromValue(obj); + } + + ~FModifyServerBuildResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyUserVirtualCurrencyResult : public FPlayFabBaseModel + { + // Balance of the virtual currency after modification. + int32 Balance; + + /** + * Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase + * over this value will be discarded. + */ + int32 BalanceChange; + + // [optional] User currency was subtracted from. + FString PlayFabId; + + // [optional] Name of the virtual currency which was modified. + FString VirtualCurrency; + + FModifyUserVirtualCurrencyResult() : + FPlayFabBaseModel(), + Balance(0), + BalanceChange(0), + PlayFabId(), + VirtualCurrency() + {} + + FModifyUserVirtualCurrencyResult(const FModifyUserVirtualCurrencyResult& src) : + FPlayFabBaseModel(), + Balance(src.Balance), + BalanceChange(src.BalanceChange), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FModifyUserVirtualCurrencyResult(const TSharedPtr& obj) : FModifyUserVirtualCurrencyResult() + { + readFromValue(obj); + } + + ~FModifyUserVirtualCurrencyResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum PushSetupPlatform + { + PushSetupPlatformGCM, + PushSetupPlatformAPNS, + PushSetupPlatformAPNS_SANDBOX + }; + + PLAYFABCPP_API void writePushSetupPlatformEnumJSON(PushSetupPlatform enumVal, JsonWriter& writer); + PLAYFABCPP_API PushSetupPlatform readPushSetupPlatformFromValue(const TSharedPtr& value); + PLAYFABCPP_API PushSetupPlatform readPushSetupPlatformFromValue(const FString& value); + + struct PLAYFABCPP_API FRandomResultTable : public FPlayFabBaseModel + { + // Child nodes that indicate what kind of drop table item this actually is. + TArray Nodes; + // Unique name for this drop table + FString TableId; + + FRandomResultTable() : + FPlayFabBaseModel(), + Nodes(), + TableId() + {} + + FRandomResultTable(const FRandomResultTable& src) : + FPlayFabBaseModel(), + Nodes(src.Nodes), + TableId(src.TableId) + {} + + FRandomResultTable(const TSharedPtr& obj) : FRandomResultTable() + { + readFromValue(obj); + } + + ~FRandomResultTable(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRefundPurchaseRequest : public FPlayFabBaseModel + { + // Unique order ID for the purchase in question. + FString OrderId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * [optional] The Reason parameter should correspond with the payment providers reason field, if they require one such as Facebook. In + * the case of Facebook this must match one of their refund or dispute resolution enums (See: + * https://developers.facebook.com/docs/payments/implementation-guide/handling-disputes-refunds) + */ + FString Reason; + + FRefundPurchaseRequest() : + FPlayFabBaseModel(), + OrderId(), + PlayFabId(), + Reason() + {} + + FRefundPurchaseRequest(const FRefundPurchaseRequest& src) : + FPlayFabBaseModel(), + OrderId(src.OrderId), + PlayFabId(src.PlayFabId), + Reason(src.Reason) + {} + + FRefundPurchaseRequest(const TSharedPtr& obj) : FRefundPurchaseRequest() + { + readFromValue(obj); + } + + ~FRefundPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRefundPurchaseResponse : public FPlayFabBaseModel + { + // [optional] The order's updated purchase status. + FString PurchaseStatus; + + FRefundPurchaseResponse() : + FPlayFabBaseModel(), + PurchaseStatus() + {} + + FRefundPurchaseResponse(const FRefundPurchaseResponse& src) : + FPlayFabBaseModel(), + PurchaseStatus(src.PurchaseStatus) + {} + + FRefundPurchaseResponse(const TSharedPtr& obj) : FRefundPurchaseResponse() + { + readFromValue(obj); + } + + ~FRefundPurchaseResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemovePlayerTagRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique tag for player profile. + FString TagName; + + FRemovePlayerTagRequest() : + FPlayFabBaseModel(), + PlayFabId(), + TagName() + {} + + FRemovePlayerTagRequest(const FRemovePlayerTagRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + TagName(src.TagName) + {} + + FRemovePlayerTagRequest(const TSharedPtr& obj) : FRemovePlayerTagRequest() + { + readFromValue(obj); + } + + ~FRemovePlayerTagRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemovePlayerTagResult : public FPlayFabBaseModel + { + FRemovePlayerTagResult() : + FPlayFabBaseModel() + {} + + FRemovePlayerTagResult(const FRemovePlayerTagResult& src) : + FPlayFabBaseModel() + {} + + FRemovePlayerTagResult(const TSharedPtr& obj) : FRemovePlayerTagResult() + { + readFromValue(obj); + } + + ~FRemovePlayerTagResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveServerBuildRequest : public FPlayFabBaseModel + { + // unique identifier of the previously uploaded build executable to be removed + FString BuildId; + + FRemoveServerBuildRequest() : + FPlayFabBaseModel(), + BuildId() + {} + + FRemoveServerBuildRequest(const FRemoveServerBuildRequest& src) : + FPlayFabBaseModel(), + BuildId(src.BuildId) + {} + + FRemoveServerBuildRequest(const TSharedPtr& obj) : FRemoveServerBuildRequest() + { + readFromValue(obj); + } + + ~FRemoveServerBuildRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveServerBuildResult : public FPlayFabBaseModel + { + FRemoveServerBuildResult() : + FPlayFabBaseModel() + {} + + FRemoveServerBuildResult(const FRemoveServerBuildResult& src) : + FPlayFabBaseModel() + {} + + FRemoveServerBuildResult(const TSharedPtr& obj) : FRemoveServerBuildResult() + { + readFromValue(obj); + } + + ~FRemoveServerBuildResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveVirtualCurrencyTypesRequest : public FPlayFabBaseModel + { + // List of virtual currencies to delete + TArray VirtualCurrencies; + FRemoveVirtualCurrencyTypesRequest() : + FPlayFabBaseModel(), + VirtualCurrencies() + {} + + FRemoveVirtualCurrencyTypesRequest(const FRemoveVirtualCurrencyTypesRequest& src) : + FPlayFabBaseModel(), + VirtualCurrencies(src.VirtualCurrencies) + {} + + FRemoveVirtualCurrencyTypesRequest(const TSharedPtr& obj) : FRemoveVirtualCurrencyTypesRequest() + { + readFromValue(obj); + } + + ~FRemoveVirtualCurrencyTypesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResetCharacterStatisticsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FResetCharacterStatisticsRequest() : + FPlayFabBaseModel(), + CharacterId(), + PlayFabId() + {} + + FResetCharacterStatisticsRequest(const FResetCharacterStatisticsRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + PlayFabId(src.PlayFabId) + {} + + FResetCharacterStatisticsRequest(const TSharedPtr& obj) : FResetCharacterStatisticsRequest() + { + readFromValue(obj); + } + + ~FResetCharacterStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResetCharacterStatisticsResult : public FPlayFabBaseModel + { + FResetCharacterStatisticsResult() : + FPlayFabBaseModel() + {} + + FResetCharacterStatisticsResult(const FResetCharacterStatisticsResult& src) : + FPlayFabBaseModel() + {} + + FResetCharacterStatisticsResult(const TSharedPtr& obj) : FResetCharacterStatisticsResult() + { + readFromValue(obj); + } + + ~FResetCharacterStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResetPasswordRequest : public FPlayFabBaseModel + { + // The new password for the player. + FString Password; + + // The token of the player requesting the password reset. + FString Token; + + FResetPasswordRequest() : + FPlayFabBaseModel(), + Password(), + Token() + {} + + FResetPasswordRequest(const FResetPasswordRequest& src) : + FPlayFabBaseModel(), + Password(src.Password), + Token(src.Token) + {} + + FResetPasswordRequest(const TSharedPtr& obj) : FResetPasswordRequest() + { + readFromValue(obj); + } + + ~FResetPasswordRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResetPasswordResult : public FPlayFabBaseModel + { + FResetPasswordResult() : + FPlayFabBaseModel() + {} + + FResetPasswordResult(const FResetPasswordResult& src) : + FPlayFabBaseModel() + {} + + FResetPasswordResult(const TSharedPtr& obj) : FResetPasswordResult() + { + readFromValue(obj); + } + + ~FResetPasswordResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResetUserStatisticsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FResetUserStatisticsRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FResetUserStatisticsRequest(const FResetUserStatisticsRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FResetUserStatisticsRequest(const TSharedPtr& obj) : FResetUserStatisticsRequest() + { + readFromValue(obj); + } + + ~FResetUserStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResetUserStatisticsResult : public FPlayFabBaseModel + { + FResetUserStatisticsResult() : + FPlayFabBaseModel() + {} + + FResetUserStatisticsResult(const FResetUserStatisticsResult& src) : + FPlayFabBaseModel() + {} + + FResetUserStatisticsResult(const TSharedPtr& obj) : FResetUserStatisticsResult() + { + readFromValue(obj); + } + + ~FResetUserStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ResolutionOutcome + { + ResolutionOutcomeRevoke, + ResolutionOutcomeReinstate, + ResolutionOutcomeManual + }; + + PLAYFABCPP_API void writeResolutionOutcomeEnumJSON(ResolutionOutcome enumVal, JsonWriter& writer); + PLAYFABCPP_API ResolutionOutcome readResolutionOutcomeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ResolutionOutcome readResolutionOutcomeFromValue(const FString& value); + + struct PLAYFABCPP_API FResolvePurchaseDisputeRequest : public FPlayFabBaseModel + { + // Unique order ID for the purchase in question. + FString OrderId; + + /** + * Enum for the desired purchase result state after notifying the payment provider. Valid values are Revoke, Reinstate and + * Manual. Manual will cause no change to the order state. + */ + ResolutionOutcome Outcome; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * [optional] The Reason parameter should correspond with the payment providers reason field, if they require one such as Facebook. In + * the case of Facebook this must match one of their refund or dispute resolution enums (See: + * https://developers.facebook.com/docs/payments/implementation-guide/handling-disputes-refunds) + */ + FString Reason; + + FResolvePurchaseDisputeRequest() : + FPlayFabBaseModel(), + OrderId(), + Outcome(), + PlayFabId(), + Reason() + {} + + FResolvePurchaseDisputeRequest(const FResolvePurchaseDisputeRequest& src) : + FPlayFabBaseModel(), + OrderId(src.OrderId), + Outcome(src.Outcome), + PlayFabId(src.PlayFabId), + Reason(src.Reason) + {} + + FResolvePurchaseDisputeRequest(const TSharedPtr& obj) : FResolvePurchaseDisputeRequest() + { + readFromValue(obj); + } + + ~FResolvePurchaseDisputeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FResolvePurchaseDisputeResponse : public FPlayFabBaseModel + { + // [optional] The order's updated purchase status. + FString PurchaseStatus; + + FResolvePurchaseDisputeResponse() : + FPlayFabBaseModel(), + PurchaseStatus() + {} + + FResolvePurchaseDisputeResponse(const FResolvePurchaseDisputeResponse& src) : + FPlayFabBaseModel(), + PurchaseStatus(src.PurchaseStatus) + {} + + FResolvePurchaseDisputeResponse(const TSharedPtr& obj) : FResolvePurchaseDisputeResponse() + { + readFromValue(obj); + } + + ~FResolvePurchaseDisputeResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeAllBansForUserRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRevokeAllBansForUserRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FRevokeAllBansForUserRequest(const FRevokeAllBansForUserRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FRevokeAllBansForUserRequest(const TSharedPtr& obj) : FRevokeAllBansForUserRequest() + { + readFromValue(obj); + } + + ~FRevokeAllBansForUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeAllBansForUserResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were revoked. + TArray BanData; + FRevokeAllBansForUserResult() : + FPlayFabBaseModel(), + BanData() + {} + + FRevokeAllBansForUserResult(const FRevokeAllBansForUserResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FRevokeAllBansForUserResult(const TSharedPtr& obj) : FRevokeAllBansForUserResult() + { + readFromValue(obj); + } + + ~FRevokeAllBansForUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeBansRequest : public FPlayFabBaseModel + { + // Ids of the bans to be revoked. Maximum 100. + TArray BanIds; + FRevokeBansRequest() : + FPlayFabBaseModel(), + BanIds() + {} + + FRevokeBansRequest(const FRevokeBansRequest& src) : + FPlayFabBaseModel(), + BanIds(src.BanIds) + {} + + FRevokeBansRequest(const TSharedPtr& obj) : FRevokeBansRequest() + { + readFromValue(obj); + } + + ~FRevokeBansRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeBansResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were revoked + TArray BanData; + FRevokeBansResult() : + FPlayFabBaseModel(), + BanData() + {} + + FRevokeBansResult(const FRevokeBansResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FRevokeBansResult(const TSharedPtr& obj) : FRevokeBansResult() + { + readFromValue(obj); + } + + ~FRevokeBansResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItem : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRevokeInventoryItem() : + FPlayFabBaseModel(), + CharacterId(), + ItemInstanceId(), + PlayFabId() + {} + + FRevokeInventoryItem(const FRevokeInventoryItem& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FRevokeInventoryItem(const TSharedPtr& obj) : FRevokeInventoryItem() + { + readFromValue(obj); + } + + ~FRevokeInventoryItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItemRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRevokeInventoryItemRequest() : + FPlayFabBaseModel(), + CharacterId(), + ItemInstanceId(), + PlayFabId() + {} + + FRevokeInventoryItemRequest(const FRevokeInventoryItemRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FRevokeInventoryItemRequest(const TSharedPtr& obj) : FRevokeInventoryItemRequest() + { + readFromValue(obj); + } + + ~FRevokeInventoryItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItemsRequest : public FPlayFabBaseModel + { + // Array of player items to revoke, between 1 and 25 items. + TArray Items; + FRevokeInventoryItemsRequest() : + FPlayFabBaseModel(), + Items() + {} + + FRevokeInventoryItemsRequest(const FRevokeInventoryItemsRequest& src) : + FPlayFabBaseModel(), + Items(src.Items) + {} + + FRevokeInventoryItemsRequest(const TSharedPtr& obj) : FRevokeInventoryItemsRequest() + { + readFromValue(obj); + } + + ~FRevokeInventoryItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeItemError : public FPlayFabBaseModel + { + // [optional] Specific error that was encountered. + FString Error; + + // [optional] Item information that failed to be revoked. + TSharedPtr Item; + + FRevokeItemError() : + FPlayFabBaseModel(), + Error(), + Item(nullptr) + {} + + FRevokeItemError(const FRevokeItemError& src) : + FPlayFabBaseModel(), + Error(src.Error), + Item(src.Item.IsValid() ? MakeShareable(new FRevokeInventoryItem(*src.Item)) : nullptr) + {} + + FRevokeItemError(const TSharedPtr& obj) : FRevokeItemError() + { + readFromValue(obj); + } + + ~FRevokeItemError(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItemsResult : public FPlayFabBaseModel + { + // [optional] Collection of any errors that occurred during processing. + TArray Errors; + FRevokeInventoryItemsResult() : + FPlayFabBaseModel(), + Errors() + {} + + FRevokeInventoryItemsResult(const FRevokeInventoryItemsResult& src) : + FPlayFabBaseModel(), + Errors(src.Errors) + {} + + FRevokeInventoryItemsResult(const TSharedPtr& obj) : FRevokeInventoryItemsResult() + { + readFromValue(obj); + } + + ~FRevokeInventoryItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryResult : public FPlayFabBaseModel + { + FRevokeInventoryResult() : + FPlayFabBaseModel() + {} + + FRevokeInventoryResult(const FRevokeInventoryResult& src) : + FPlayFabBaseModel() + {} + + FRevokeInventoryResult(const TSharedPtr& obj) : FRevokeInventoryResult() + { + readFromValue(obj); + } + + ~FRevokeInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRunTaskRequest : public FPlayFabBaseModel + { + // [optional] Provide either the task ID or the task name to run a task. + TSharedPtr Identifier; + + FRunTaskRequest() : + FPlayFabBaseModel(), + Identifier(nullptr) + {} + + FRunTaskRequest(const FRunTaskRequest& src) : + FPlayFabBaseModel(), + Identifier(src.Identifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.Identifier)) : nullptr) + {} + + FRunTaskRequest(const TSharedPtr& obj) : FRunTaskRequest() + { + readFromValue(obj); + } + + ~FRunTaskRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRunTaskResult : public FPlayFabBaseModel + { + /** + * [optional] ID of the task instance that is started. This can be used in Get*TaskInstance (e.g. GetCloudScriptTaskInstance) API call + * to retrieve status for the task instance. + */ + FString TaskInstanceId; + + FRunTaskResult() : + FPlayFabBaseModel(), + TaskInstanceId() + {} + + FRunTaskResult(const FRunTaskResult& src) : + FPlayFabBaseModel(), + TaskInstanceId(src.TaskInstanceId) + {} + + FRunTaskResult(const TSharedPtr& obj) : FRunTaskResult() + { + readFromValue(obj); + } + + ~FRunTaskResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendAccountRecoveryEmailRequest : public FPlayFabBaseModel + { + // User email address attached to their account + FString Email; + + // [optional] The email template id of the account recovery email template to send. + FString EmailTemplateId; + + FSendAccountRecoveryEmailRequest() : + FPlayFabBaseModel(), + Email(), + EmailTemplateId() + {} + + FSendAccountRecoveryEmailRequest(const FSendAccountRecoveryEmailRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + EmailTemplateId(src.EmailTemplateId) + {} + + FSendAccountRecoveryEmailRequest(const TSharedPtr& obj) : FSendAccountRecoveryEmailRequest() + { + readFromValue(obj); + } + + ~FSendAccountRecoveryEmailRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendAccountRecoveryEmailResult : public FPlayFabBaseModel + { + FSendAccountRecoveryEmailResult() : + FPlayFabBaseModel() + {} + + FSendAccountRecoveryEmailResult(const FSendAccountRecoveryEmailResult& src) : + FPlayFabBaseModel() + {} + + FSendAccountRecoveryEmailResult(const TSharedPtr& obj) : FSendAccountRecoveryEmailResult() + { + readFromValue(obj); + } + + ~FSendAccountRecoveryEmailResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPlayerSecretRequest : public FPlayFabBaseModel + { + // Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FSetPlayerSecretRequest() : + FPlayFabBaseModel(), + PlayerSecret(), + PlayFabId() + {} + + FSetPlayerSecretRequest(const FSetPlayerSecretRequest& src) : + FPlayFabBaseModel(), + PlayerSecret(src.PlayerSecret), + PlayFabId(src.PlayFabId) + {} + + FSetPlayerSecretRequest(const TSharedPtr& obj) : FSetPlayerSecretRequest() + { + readFromValue(obj); + } + + ~FSetPlayerSecretRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPlayerSecretResult : public FPlayFabBaseModel + { + FSetPlayerSecretResult() : + FPlayFabBaseModel() + {} + + FSetPlayerSecretResult(const FSetPlayerSecretResult& src) : + FPlayFabBaseModel() + {} + + FSetPlayerSecretResult(const TSharedPtr& obj) : FSetPlayerSecretResult() + { + readFromValue(obj); + } + + ~FSetPlayerSecretResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPublishedRevisionRequest : public FPlayFabBaseModel + { + // Revision to make the current published revision + int32 Revision; + + // Version number + int32 Version; + + FSetPublishedRevisionRequest() : + FPlayFabBaseModel(), + Revision(0), + Version(0) + {} + + FSetPublishedRevisionRequest(const FSetPublishedRevisionRequest& src) : + FPlayFabBaseModel(), + Revision(src.Revision), + Version(src.Version) + {} + + FSetPublishedRevisionRequest(const TSharedPtr& obj) : FSetPublishedRevisionRequest() + { + readFromValue(obj); + } + + ~FSetPublishedRevisionRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPublishedRevisionResult : public FPlayFabBaseModel + { + FSetPublishedRevisionResult() : + FPlayFabBaseModel() + {} + + FSetPublishedRevisionResult(const FSetPublishedRevisionResult& src) : + FPlayFabBaseModel() + {} + + FSetPublishedRevisionResult(const TSharedPtr& obj) : FSetPublishedRevisionResult() + { + readFromValue(obj); + } + + ~FSetPublishedRevisionResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPublisherDataRequest : public FPlayFabBaseModel + { + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + FString Key; + + // [optional] new value to set. Set to null to remove a value + FString Value; + + FSetPublisherDataRequest() : + FPlayFabBaseModel(), + Key(), + Value() + {} + + FSetPublisherDataRequest(const FSetPublisherDataRequest& src) : + FPlayFabBaseModel(), + Key(src.Key), + Value(src.Value) + {} + + FSetPublisherDataRequest(const TSharedPtr& obj) : FSetPublisherDataRequest() + { + readFromValue(obj); + } + + ~FSetPublisherDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPublisherDataResult : public FPlayFabBaseModel + { + FSetPublisherDataResult() : + FPlayFabBaseModel() + {} + + FSetPublisherDataResult(const FSetPublisherDataResult& src) : + FPlayFabBaseModel() + {} + + FSetPublisherDataResult(const TSharedPtr& obj) : FSetPublisherDataResult() + { + readFromValue(obj); + } + + ~FSetPublisherDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetTitleDataRequest : public FPlayFabBaseModel + { + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + FString Key; + + // [optional] new value to set. Set to null to remove a value + FString Value; + + FSetTitleDataRequest() : + FPlayFabBaseModel(), + Key(), + Value() + {} + + FSetTitleDataRequest(const FSetTitleDataRequest& src) : + FPlayFabBaseModel(), + Key(src.Key), + Value(src.Value) + {} + + FSetTitleDataRequest(const TSharedPtr& obj) : FSetTitleDataRequest() + { + readFromValue(obj); + } + + ~FSetTitleDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetTitleDataResult : public FPlayFabBaseModel + { + FSetTitleDataResult() : + FPlayFabBaseModel() + {} + + FSetTitleDataResult(const FSetTitleDataResult& src) : + FPlayFabBaseModel() + {} + + FSetTitleDataResult(const TSharedPtr& obj) : FSetTitleDataResult() + { + readFromValue(obj); + } + + ~FSetTitleDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetupPushNotificationRequest : public FPlayFabBaseModel + { + // Credential is the Private Key for APNS/APNS_SANDBOX, and the API Key for GCM + FString Credential; + + // [optional] for APNS, this is the PlatformPrincipal (SSL Certificate) + FString Key; + + /** + * name of the application sending the message (application names must be made up of only uppercase and lowercase ASCII + * letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long) + */ + FString Name; + + /** + * replace any existing ARN with the newly generated one. If this is set to false, an error will be returned if + * notifications have already setup for this platform. + */ + bool OverwriteOldARN; + + /** + * supported notification platforms are Apple Push Notification Service (APNS and APNS_SANDBOX) for iOS and Google Cloud + * Messaging (GCM) for Android + */ + PushSetupPlatform Platform; + + FSetupPushNotificationRequest() : + FPlayFabBaseModel(), + Credential(), + Key(), + Name(), + OverwriteOldARN(false), + Platform() + {} + + FSetupPushNotificationRequest(const FSetupPushNotificationRequest& src) : + FPlayFabBaseModel(), + Credential(src.Credential), + Key(src.Key), + Name(src.Name), + OverwriteOldARN(src.OverwriteOldARN), + Platform(src.Platform) + {} + + FSetupPushNotificationRequest(const TSharedPtr& obj) : FSetupPushNotificationRequest() + { + readFromValue(obj); + } + + ~FSetupPushNotificationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetupPushNotificationResult : public FPlayFabBaseModel + { + // [optional] Amazon Resource Name for the created notification topic. + FString ARN; + + FSetupPushNotificationResult() : + FPlayFabBaseModel(), + ARN() + {} + + FSetupPushNotificationResult(const FSetupPushNotificationResult& src) : + FPlayFabBaseModel(), + ARN(src.ARN) + {} + + FSetupPushNotificationResult(const TSharedPtr& obj) : FSetupPushNotificationResult() + { + readFromValue(obj); + } + + ~FSetupPushNotificationResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum StatisticVersionArchivalStatus + { + StatisticVersionArchivalStatusNotScheduled, + StatisticVersionArchivalStatusScheduled, + StatisticVersionArchivalStatusQueued, + StatisticVersionArchivalStatusInProgress, + StatisticVersionArchivalStatusComplete + }; + + PLAYFABCPP_API void writeStatisticVersionArchivalStatusEnumJSON(StatisticVersionArchivalStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API StatisticVersionArchivalStatus readStatisticVersionArchivalStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API StatisticVersionArchivalStatus readStatisticVersionArchivalStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FSubtractUserVirtualCurrencyRequest : public FPlayFabBaseModel + { + // Amount to be subtracted from the user balance of the specified virtual currency. + int32 Amount; + + // PlayFab unique identifier of the user whose virtual currency balance is to be decreased. + FString PlayFabId; + + // Name of the virtual currency which is to be decremented. + FString VirtualCurrency; + + FSubtractUserVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + PlayFabId(), + VirtualCurrency() + {} + + FSubtractUserVirtualCurrencyRequest(const FSubtractUserVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FSubtractUserVirtualCurrencyRequest(const TSharedPtr& obj) : FSubtractUserVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FSubtractUserVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateBanRequest : public FPlayFabBaseModel + { + // [optional] The updated active state for the ban. Null for no change. + Boxed Active; + + // The id of the ban to be updated. + FString BanId; + + // [optional] The updated expiration date for the ban. Null for no change. + Boxed Expires; + + // [optional] The updated IP address for the ban. Null for no change. + FString IPAddress; + + // [optional] The updated MAC address for the ban. Null for no change. + FString MACAddress; + + // [optional] Whether to make this ban permanent. Set to true to make this ban permanent. This will not modify Active state. + Boxed Permanent; + + // [optional] The updated reason for the ban to be updated. Maximum 140 characters. Null for no change. + FString Reason; + + FUpdateBanRequest() : + FPlayFabBaseModel(), + Active(), + BanId(), + Expires(), + IPAddress(), + MACAddress(), + Permanent(), + Reason() + {} + + FUpdateBanRequest(const FUpdateBanRequest& src) : + FPlayFabBaseModel(), + Active(src.Active), + BanId(src.BanId), + Expires(src.Expires), + IPAddress(src.IPAddress), + MACAddress(src.MACAddress), + Permanent(src.Permanent), + Reason(src.Reason) + {} + + FUpdateBanRequest(const TSharedPtr& obj) : FUpdateBanRequest() + { + readFromValue(obj); + } + + ~FUpdateBanRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateBansRequest : public FPlayFabBaseModel + { + // List of bans to be updated. Maximum 100. + TArray Bans; + FUpdateBansRequest() : + FPlayFabBaseModel(), + Bans() + {} + + FUpdateBansRequest(const FUpdateBansRequest& src) : + FPlayFabBaseModel(), + Bans(src.Bans) + {} + + FUpdateBansRequest(const TSharedPtr& obj) : FUpdateBansRequest() + { + readFromValue(obj); + } + + ~FUpdateBansRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateBansResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were updated + TArray BanData; + FUpdateBansResult() : + FPlayFabBaseModel(), + BanData() + {} + + FUpdateBansResult(const FUpdateBansResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FUpdateBansResult(const TSharedPtr& obj) : FUpdateBansResult() + { + readFromValue(obj); + } + + ~FUpdateBansResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCatalogItemsRequest : public FPlayFabBaseModel + { + /** + * [optional] Array of catalog items to be submitted. Note that while CatalogItem has a parameter for CatalogVersion, it is not + * required and ignored in this call. + */ + TArray Catalog; + // [optional] Which catalog is being updated. If null, uses the default catalog. + FString CatalogVersion; + + /** + * [optional] Should this catalog be set as the default catalog. Defaults to true. If there is currently no default catalog, this will + * always set it. + */ + Boxed SetAsDefaultCatalog; + + FUpdateCatalogItemsRequest() : + FPlayFabBaseModel(), + Catalog(), + CatalogVersion(), + SetAsDefaultCatalog() + {} + + FUpdateCatalogItemsRequest(const FUpdateCatalogItemsRequest& src) : + FPlayFabBaseModel(), + Catalog(src.Catalog), + CatalogVersion(src.CatalogVersion), + SetAsDefaultCatalog(src.SetAsDefaultCatalog) + {} + + FUpdateCatalogItemsRequest(const TSharedPtr& obj) : FUpdateCatalogItemsRequest() + { + readFromValue(obj); + } + + ~FUpdateCatalogItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCatalogItemsResult : public FPlayFabBaseModel + { + FUpdateCatalogItemsResult() : + FPlayFabBaseModel() + {} + + FUpdateCatalogItemsResult(const FUpdateCatalogItemsResult& src) : + FPlayFabBaseModel() + {} + + FUpdateCatalogItemsResult(const TSharedPtr& obj) : FUpdateCatalogItemsResult() + { + readFromValue(obj); + } + + ~FUpdateCatalogItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCloudScriptRequest : public FPlayFabBaseModel + { + // [optional] PlayFab user ID of the developer initiating the request. + FString DeveloperPlayFabId; + + // List of Cloud Script files to upload to create the new revision. Must have at least one file. + TArray Files; + // Immediately publish the new revision + bool Publish; + + FUpdateCloudScriptRequest() : + FPlayFabBaseModel(), + DeveloperPlayFabId(), + Files(), + Publish(false) + {} + + FUpdateCloudScriptRequest(const FUpdateCloudScriptRequest& src) : + FPlayFabBaseModel(), + DeveloperPlayFabId(src.DeveloperPlayFabId), + Files(src.Files), + Publish(src.Publish) + {} + + FUpdateCloudScriptRequest(const TSharedPtr& obj) : FUpdateCloudScriptRequest() + { + readFromValue(obj); + } + + ~FUpdateCloudScriptRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCloudScriptResult : public FPlayFabBaseModel + { + // New revision number created + int32 Revision; + + // Cloud Script version updated + int32 Version; + + FUpdateCloudScriptResult() : + FPlayFabBaseModel(), + Revision(0), + Version(0) + {} + + FUpdateCloudScriptResult(const FUpdateCloudScriptResult& src) : + FPlayFabBaseModel(), + Revision(src.Revision), + Version(src.Version) + {} + + FUpdateCloudScriptResult(const TSharedPtr& obj) : FUpdateCloudScriptResult() + { + readFromValue(obj); + } + + ~FUpdateCloudScriptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerSharedSecretRequest : public FPlayFabBaseModel + { + // Disable or Enable this key + bool Disabled; + + // [optional] Friendly name for this key + FString FriendlyName; + + // [optional] The shared secret key to update + FString SecretKey; + + FUpdatePlayerSharedSecretRequest() : + FPlayFabBaseModel(), + Disabled(false), + FriendlyName(), + SecretKey() + {} + + FUpdatePlayerSharedSecretRequest(const FUpdatePlayerSharedSecretRequest& src) : + FPlayFabBaseModel(), + Disabled(src.Disabled), + FriendlyName(src.FriendlyName), + SecretKey(src.SecretKey) + {} + + FUpdatePlayerSharedSecretRequest(const TSharedPtr& obj) : FUpdatePlayerSharedSecretRequest() + { + readFromValue(obj); + } + + ~FUpdatePlayerSharedSecretRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerSharedSecretResult : public FPlayFabBaseModel + { + FUpdatePlayerSharedSecretResult() : + FPlayFabBaseModel() + {} + + FUpdatePlayerSharedSecretResult(const FUpdatePlayerSharedSecretResult& src) : + FPlayFabBaseModel() + {} + + FUpdatePlayerSharedSecretResult(const TSharedPtr& obj) : FUpdatePlayerSharedSecretResult() + { + readFromValue(obj); + } + + ~FUpdatePlayerSharedSecretResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerStatisticDefinitionRequest : public FPlayFabBaseModel + { + // [optional] the aggregation method to use in updating the statistic (defaults to last) + Boxed AggregationMethod; + + // unique name of the statistic + FString StatisticName; + + /** + * [optional] interval at which the values of the statistic for all players are reset (changes are effective at the next occurance of + * the new interval boundary) + */ + Boxed VersionChangeInterval; + + FUpdatePlayerStatisticDefinitionRequest() : + FPlayFabBaseModel(), + AggregationMethod(), + StatisticName(), + VersionChangeInterval() + {} + + FUpdatePlayerStatisticDefinitionRequest(const FUpdatePlayerStatisticDefinitionRequest& src) : + FPlayFabBaseModel(), + AggregationMethod(src.AggregationMethod), + StatisticName(src.StatisticName), + VersionChangeInterval(src.VersionChangeInterval) + {} + + FUpdatePlayerStatisticDefinitionRequest(const TSharedPtr& obj) : FUpdatePlayerStatisticDefinitionRequest() + { + readFromValue(obj); + } + + ~FUpdatePlayerStatisticDefinitionRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerStatisticDefinitionResult : public FPlayFabBaseModel + { + // [optional] updated statistic definition + TSharedPtr Statistic; + + FUpdatePlayerStatisticDefinitionResult() : + FPlayFabBaseModel(), + Statistic(nullptr) + {} + + FUpdatePlayerStatisticDefinitionResult(const FUpdatePlayerStatisticDefinitionResult& src) : + FPlayFabBaseModel(), + Statistic(src.Statistic.IsValid() ? MakeShareable(new FPlayerStatisticDefinition(*src.Statistic)) : nullptr) + {} + + FUpdatePlayerStatisticDefinitionResult(const TSharedPtr& obj) : FUpdatePlayerStatisticDefinitionResult() + { + readFromValue(obj); + } + + ~FUpdatePlayerStatisticDefinitionResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePolicyRequest : public FPlayFabBaseModel + { + // Whether to overwrite or append to the existing policy. + bool OverwritePolicy; + + // The name of the policy being updated. Only supported name is 'ApiPolicy' + FString PolicyName; + + // The new statements to include in the policy. + TArray Statements; + FUpdatePolicyRequest() : + FPlayFabBaseModel(), + OverwritePolicy(false), + PolicyName(), + Statements() + {} + + FUpdatePolicyRequest(const FUpdatePolicyRequest& src) : + FPlayFabBaseModel(), + OverwritePolicy(src.OverwritePolicy), + PolicyName(src.PolicyName), + Statements(src.Statements) + {} + + FUpdatePolicyRequest(const TSharedPtr& obj) : FUpdatePolicyRequest() + { + readFromValue(obj); + } + + ~FUpdatePolicyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePolicyResponse : public FPlayFabBaseModel + { + // [optional] The name of the policy that was updated. + FString PolicyName; + + // [optional] The statements included in the new version of the policy. + TArray Statements; + FUpdatePolicyResponse() : + FPlayFabBaseModel(), + PolicyName(), + Statements() + {} + + FUpdatePolicyResponse(const FUpdatePolicyResponse& src) : + FPlayFabBaseModel(), + PolicyName(src.PolicyName), + Statements(src.Statements) + {} + + FUpdatePolicyResponse(const TSharedPtr& obj) : FUpdatePolicyResponse() + { + readFromValue(obj); + } + + ~FUpdatePolicyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateRandomResultTablesRequest : public FPlayFabBaseModel + { + // [optional] which catalog is being updated. If null, update the current default catalog version + FString CatalogVersion; + + /** + * [optional] array of random result tables to make available (Note: specifying an existing TableId will result in overwriting that + * table, while any others will be added to the available set) + */ + TArray Tables; + FUpdateRandomResultTablesRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + Tables() + {} + + FUpdateRandomResultTablesRequest(const FUpdateRandomResultTablesRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + Tables(src.Tables) + {} + + FUpdateRandomResultTablesRequest(const TSharedPtr& obj) : FUpdateRandomResultTablesRequest() + { + readFromValue(obj); + } + + ~FUpdateRandomResultTablesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateRandomResultTablesResult : public FPlayFabBaseModel + { + FUpdateRandomResultTablesResult() : + FPlayFabBaseModel() + {} + + FUpdateRandomResultTablesResult(const FUpdateRandomResultTablesResult& src) : + FPlayFabBaseModel() + {} + + FUpdateRandomResultTablesResult(const TSharedPtr& obj) : FUpdateRandomResultTablesResult() + { + readFromValue(obj); + } + + ~FUpdateRandomResultTablesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateStoreItemsRequest : public FPlayFabBaseModel + { + // [optional] Catalog version of the store to update. If null, uses the default catalog. + FString CatalogVersion; + + // [optional] Additional data about the store + TSharedPtr MarketingData; + + // [optional] Array of store items - references to catalog items, with specific pricing - to be added + TArray Store; + // Unique identifier for the store which is to be updated + FString StoreId; + + FUpdateStoreItemsRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + MarketingData(nullptr), + Store(), + StoreId() + {} + + FUpdateStoreItemsRequest(const FUpdateStoreItemsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + MarketingData(src.MarketingData.IsValid() ? MakeShareable(new FStoreMarketingModel(*src.MarketingData)) : nullptr), + Store(src.Store), + StoreId(src.StoreId) + {} + + FUpdateStoreItemsRequest(const TSharedPtr& obj) : FUpdateStoreItemsRequest() + { + readFromValue(obj); + } + + ~FUpdateStoreItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateStoreItemsResult : public FPlayFabBaseModel + { + FUpdateStoreItemsResult() : + FPlayFabBaseModel() + {} + + FUpdateStoreItemsResult(const FUpdateStoreItemsResult& src) : + FPlayFabBaseModel() + {} + + FUpdateStoreItemsResult(const TSharedPtr& obj) : FUpdateStoreItemsResult() + { + readFromValue(obj); + } + + ~FUpdateStoreItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateTaskRequest : public FPlayFabBaseModel + { + // [optional] Description the task + FString Description; + + // [optional] Specify either the task ID or the name of the task to be updated. + TSharedPtr Identifier; + + // Whether the schedule is active. Inactive schedule will not trigger task execution. + bool IsActive; + + // Name of the task. This is a unique identifier for tasks in the title. + FString Name; + + // [optional] Parameter object specific to the task type. See each task type's create API documentation for details. + FJsonKeeper Parameter; + + // [optional] Cron expression for the run schedule of the task. The expression should be in UTC. + FString Schedule; + + // Task type. + ScheduledTaskType Type; + + FUpdateTaskRequest() : + FPlayFabBaseModel(), + Description(), + Identifier(nullptr), + IsActive(false), + Name(), + Parameter(), + Schedule(), + Type() + {} + + FUpdateTaskRequest(const FUpdateTaskRequest& src) : + FPlayFabBaseModel(), + Description(src.Description), + Identifier(src.Identifier.IsValid() ? MakeShareable(new FNameIdentifier(*src.Identifier)) : nullptr), + IsActive(src.IsActive), + Name(src.Name), + Parameter(src.Parameter), + Schedule(src.Schedule), + Type(src.Type) + {} + + FUpdateTaskRequest(const TSharedPtr& obj) : FUpdateTaskRequest() + { + readFromValue(obj); + } + + ~FUpdateTaskRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // [optional] Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. + Boxed Permission; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateUserDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + Permission(), + PlayFabId() + {} + + FUpdateUserDataRequest(const FUpdateUserDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission), + PlayFabId(src.PlayFabId) + {} + + FUpdateUserDataRequest(const TSharedPtr& obj) : FUpdateUserDataRequest() + { + readFromValue(obj); + } + + ~FUpdateUserDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserDataResult : public FPlayFabBaseModel + { + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FUpdateUserDataResult() : + FPlayFabBaseModel(), + DataVersion(0) + {} + + FUpdateUserDataResult(const FUpdateUserDataResult& src) : + FPlayFabBaseModel(), + DataVersion(src.DataVersion) + {} + + FUpdateUserDataResult(const TSharedPtr& obj) : FUpdateUserDataResult() + { + readFromValue(obj); + } + + ~FUpdateUserDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserInternalDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateUserInternalDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + PlayFabId() + {} + + FUpdateUserInternalDataRequest(const FUpdateUserInternalDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + PlayFabId(src.PlayFabId) + {} + + FUpdateUserInternalDataRequest(const TSharedPtr& obj) : FUpdateUserInternalDataRequest() + { + readFromValue(obj); + } + + ~FUpdateUserInternalDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserTitleDisplayNameRequest : public FPlayFabBaseModel + { + // New title display name for the user - must be between 3 and 25 characters + FString DisplayName; + + // PlayFab unique identifier of the user whose title specific display name is to be changed + FString PlayFabId; + + FUpdateUserTitleDisplayNameRequest() : + FPlayFabBaseModel(), + DisplayName(), + PlayFabId() + {} + + FUpdateUserTitleDisplayNameRequest(const FUpdateUserTitleDisplayNameRequest& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName), + PlayFabId(src.PlayFabId) + {} + + FUpdateUserTitleDisplayNameRequest(const TSharedPtr& obj) : FUpdateUserTitleDisplayNameRequest() + { + readFromValue(obj); + } + + ~FUpdateUserTitleDisplayNameRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserTitleDisplayNameResult : public FPlayFabBaseModel + { + // [optional] current title display name for the user (this will be the original display name if the rename attempt failed) + FString DisplayName; + + FUpdateUserTitleDisplayNameResult() : + FPlayFabBaseModel(), + DisplayName() + {} + + FUpdateUserTitleDisplayNameResult(const FUpdateUserTitleDisplayNameResult& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName) + {} + + FUpdateUserTitleDisplayNameResult(const TSharedPtr& obj) : FUpdateUserTitleDisplayNameResult() + { + readFromValue(obj); + } + + ~FUpdateUserTitleDisplayNameResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAuthenticationAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAuthenticationAPI.h new file mode 100644 index 000000000..7681c0a0d --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAuthenticationAPI.h @@ -0,0 +1,44 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabAuthenticationDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabAuthenticationAPI + { + public: + DECLARE_DELEGATE_OneParam(FGetEntityTokenDelegate, const AuthenticationModels::FGetEntityTokenResponse&); + + UPlayFabAuthenticationAPI(); + ~UPlayFabAuthenticationAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Method to exchange a legacy AuthenticationTicket or title SecretKey for an Entity Token or to refresh a still valid + * Entity Token. + * This API must be called with X-SecretKey, X-Authentication or X-EntityToken headers. An optional EntityKey may be included to attempt to set the resulting EntityToken to a specific entity, however the entity must be a relation of the caller, such as the master_player_account of a character. If sending X-EntityToken the account will be marked as freshly logged in and will issue a new token. If using X-Authentication or X-EntityToken the header must still be valid and cannot be expired or revoked. + */ + bool GetEntityToken(AuthenticationModels::FGetEntityTokenRequest& request, const FGetEntityTokenDelegate& SuccessDelegate = FGetEntityTokenDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnGetEntityTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetEntityTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAuthenticationDataModels.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAuthenticationDataModels.h new file mode 100644 index 000000000..6b710d43c --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabAuthenticationDataModels.h @@ -0,0 +1,111 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace AuthenticationModels +{ + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetEntityTokenRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + FGetEntityTokenRequest() : + FPlayFabBaseModel(), + Entity(nullptr) + {} + + FGetEntityTokenRequest(const FGetEntityTokenRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr) + {} + + FGetEntityTokenRequest(const TSharedPtr& obj) : FGetEntityTokenRequest() + { + readFromValue(obj); + } + + ~FGetEntityTokenRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetEntityTokenResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // [optional] The token used to set X-EntityToken for all entity based API calls. + FString EntityToken; + + // [optional] The time the token will expire, if it is an expiring token, in UTC. + Boxed TokenExpiration; + + FGetEntityTokenResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + EntityToken(), + TokenExpiration() + {} + + FGetEntityTokenResponse(const FGetEntityTokenResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + EntityToken(src.EntityToken), + TokenExpiration(src.TokenExpiration) + {} + + FGetEntityTokenResponse(const TSharedPtr& obj) : FGetEntityTokenResponse() + { + readFromValue(obj); + } + + ~FGetEntityTokenResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabBaseModel.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabBaseModel.h new file mode 100644 index 000000000..04ffaf386 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabBaseModel.h @@ -0,0 +1,98 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" +#include "Json.h" + +namespace PlayFab +{ + typedef TSharedRef< TJsonWriter > > JsonWriter; + typedef TSharedRef< TJsonReader > JsonReader; + + template + class Boxed + { + public: + BoxedType mValue; + + Boxed() : mValue(), mIsSet(false) {} + Boxed(BoxedType value) : mValue(value), mIsSet(true) {} + + Boxed& operator=(BoxedType value) { mValue = value; mIsSet = true; return *this; } + operator BoxedType() { return mValue; } + operator BoxedType() const { return mValue; } + + void setNull() { mIsSet = false; } + bool notNull() { return mIsSet; } + bool notNull() const { return mIsSet; } + bool isNull() { return !mIsSet; } + bool isNull() const { return !mIsSet; } + private: + bool mIsSet; + }; + + struct PLAYFABCPP_API FPlayFabBaseModel + { + virtual ~FPlayFabBaseModel() {} + virtual void writeJSON(JsonWriter& Json) const = 0; + virtual bool readFromValue(const TSharedPtr& obj) = 0; + virtual bool readFromValue(const TSharedPtr& value) { return false; }; + + FString toJSONString() const; + }; + + struct PLAYFABCPP_API FJsonKeeper : public FPlayFabBaseModel + { + private: + TSharedRef JsonValue; // Reference so that any time this struct is avaiable, the JsonValue is aswell, even if a FJsonValueNull + + public: + FJsonKeeper() : JsonValue(MakeShareable(new FJsonValueNull())) {} + FJsonKeeper(const TSharedPtr& val) : JsonValue(val.ToSharedRef()) {} + FJsonKeeper(const TSharedPtr& val) : JsonValue(MakeShareable(new FJsonValueObject(val))) {} + FJsonKeeper(const FString& val) : JsonValue(MakeShareable(new FJsonValueString(val))) {} + FJsonKeeper(const bool& val) : JsonValue(MakeShareable(new FJsonValueBoolean(val))) {} + FJsonKeeper(const int8& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const int16& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const int32& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const int64& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const uint8& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const uint16& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const uint32& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const uint64& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const float& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + FJsonKeeper(const double& val) : JsonValue(MakeShareable(new FJsonValueNumber(val))) {} + + bool notNull() const { return !isNull(); } + bool isNull() const { return JsonValue->IsNull(); } + + FJsonKeeper& operator=(const TSharedPtr& val) { JsonValue = val.ToSharedRef(); return *this; } + FJsonKeeper& operator=(const TSharedPtr& val) { JsonValue = MakeShareable(new FJsonValueObject(val)); return *this; } + FJsonKeeper& operator=(const FString& val) { JsonValue = MakeShareable(new FJsonValueString(val)); return *this; } + FJsonKeeper& operator=(const bool& val) { JsonValue = MakeShareable(new FJsonValueBoolean(val)); return *this; } + FJsonKeeper& operator=(const int8& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const int16& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const int32& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const int64& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const uint8& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const uint16& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const uint32& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const uint64& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const float& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + FJsonKeeper& operator=(const double& val) { JsonValue = MakeShareable(new FJsonValueNumber(val)); return *this; } + + ~FJsonKeeper() {} + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + bool readFromValue(const TSharedPtr& value) override; + + TSharedPtr GetJsonValue() const { return JsonValue; }; + }; + + void writeDatetime(FDateTime datetime, JsonWriter& writer); + FDateTime readDatetime(const TSharedPtr& value); +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabClientAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabClientAPI.h new file mode 100644 index 000000000..7ac7116ed --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabClientAPI.h @@ -0,0 +1,998 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabClientDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabClientAPI + { + public: + DECLARE_DELEGATE_OneParam(FAcceptTradeDelegate, const ClientModels::FAcceptTradeResponse&); + DECLARE_DELEGATE_OneParam(FAddFriendDelegate, const ClientModels::FAddFriendResult&); + DECLARE_DELEGATE_OneParam(FAddGenericIDDelegate, const ClientModels::FAddGenericIDResult&); + DECLARE_DELEGATE_OneParam(FAddOrUpdateContactEmailDelegate, const ClientModels::FAddOrUpdateContactEmailResult&); + DECLARE_DELEGATE_OneParam(FAddSharedGroupMembersDelegate, const ClientModels::FAddSharedGroupMembersResult&); + DECLARE_DELEGATE_OneParam(FAddUsernamePasswordDelegate, const ClientModels::FAddUsernamePasswordResult&); + DECLARE_DELEGATE_OneParam(FAddUserVirtualCurrencyDelegate, const ClientModels::FModifyUserVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FAndroidDevicePushNotificationRegistrationDelegate, const ClientModels::FAndroidDevicePushNotificationRegistrationResult&); + DECLARE_DELEGATE_OneParam(FAttributeInstallDelegate, const ClientModels::FAttributeInstallResult&); + DECLARE_DELEGATE_OneParam(FCancelTradeDelegate, const ClientModels::FCancelTradeResponse&); + DECLARE_DELEGATE_OneParam(FConfirmPurchaseDelegate, const ClientModels::FConfirmPurchaseResult&); + DECLARE_DELEGATE_OneParam(FConsumeItemDelegate, const ClientModels::FConsumeItemResult&); + DECLARE_DELEGATE_OneParam(FConsumeXboxEntitlementsDelegate, const ClientModels::FConsumeXboxEntitlementsResult&); + DECLARE_DELEGATE_OneParam(FCreateSharedGroupDelegate, const ClientModels::FCreateSharedGroupResult&); + DECLARE_DELEGATE_OneParam(FExecuteCloudScriptDelegate, const ClientModels::FExecuteCloudScriptResult&); + DECLARE_DELEGATE_OneParam(FGetAccountInfoDelegate, const ClientModels::FGetAccountInfoResult&); + DECLARE_DELEGATE_OneParam(FGetAllUsersCharactersDelegate, const ClientModels::FListUsersCharactersResult&); + DECLARE_DELEGATE_OneParam(FGetCatalogItemsDelegate, const ClientModels::FGetCatalogItemsResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterDataDelegate, const ClientModels::FGetCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterInventoryDelegate, const ClientModels::FGetCharacterInventoryResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterLeaderboardDelegate, const ClientModels::FGetCharacterLeaderboardResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterReadOnlyDataDelegate, const ClientModels::FGetCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterStatisticsDelegate, const ClientModels::FGetCharacterStatisticsResult&); + DECLARE_DELEGATE_OneParam(FGetContentDownloadUrlDelegate, const ClientModels::FGetContentDownloadUrlResult&); + DECLARE_DELEGATE_OneParam(FGetCurrentGamesDelegate, const ClientModels::FCurrentGamesResult&); + DECLARE_DELEGATE_OneParam(FGetFriendLeaderboardDelegate, const ClientModels::FGetLeaderboardResult&); + DECLARE_DELEGATE_OneParam(FGetFriendLeaderboardAroundPlayerDelegate, const ClientModels::FGetFriendLeaderboardAroundPlayerResult&); + DECLARE_DELEGATE_OneParam(FGetFriendsListDelegate, const ClientModels::FGetFriendsListResult&); + DECLARE_DELEGATE_OneParam(FGetGameServerRegionsDelegate, const ClientModels::FGameServerRegionsResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardDelegate, const ClientModels::FGetLeaderboardResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardAroundCharacterDelegate, const ClientModels::FGetLeaderboardAroundCharacterResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardAroundPlayerDelegate, const ClientModels::FGetLeaderboardAroundPlayerResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardForUserCharactersDelegate, const ClientModels::FGetLeaderboardForUsersCharactersResult&); + DECLARE_DELEGATE_OneParam(FGetPaymentTokenDelegate, const ClientModels::FGetPaymentTokenResult&); + DECLARE_DELEGATE_OneParam(FGetPhotonAuthenticationTokenDelegate, const ClientModels::FGetPhotonAuthenticationTokenResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerCombinedInfoDelegate, const ClientModels::FGetPlayerCombinedInfoResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerProfileDelegate, const ClientModels::FGetPlayerProfileResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerSegmentsDelegate, const ClientModels::FGetPlayerSegmentsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerStatisticsDelegate, const ClientModels::FGetPlayerStatisticsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerStatisticVersionsDelegate, const ClientModels::FGetPlayerStatisticVersionsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerTagsDelegate, const ClientModels::FGetPlayerTagsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerTradesDelegate, const ClientModels::FGetPlayerTradesResponse&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromFacebookIDsDelegate, const ClientModels::FGetPlayFabIDsFromFacebookIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate, const ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromGameCenterIDsDelegate, const ClientModels::FGetPlayFabIDsFromGameCenterIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromGenericIDsDelegate, const ClientModels::FGetPlayFabIDsFromGenericIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromGoogleIDsDelegate, const ClientModels::FGetPlayFabIDsFromGoogleIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromKongregateIDsDelegate, const ClientModels::FGetPlayFabIDsFromKongregateIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate, const ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromSteamIDsDelegate, const ClientModels::FGetPlayFabIDsFromSteamIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromTwitchIDsDelegate, const ClientModels::FGetPlayFabIDsFromTwitchIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPublisherDataDelegate, const ClientModels::FGetPublisherDataResult&); + DECLARE_DELEGATE_OneParam(FGetPurchaseDelegate, const ClientModels::FGetPurchaseResult&); + DECLARE_DELEGATE_OneParam(FGetSharedGroupDataDelegate, const ClientModels::FGetSharedGroupDataResult&); + DECLARE_DELEGATE_OneParam(FGetStoreItemsDelegate, const ClientModels::FGetStoreItemsResult&); + DECLARE_DELEGATE_OneParam(FGetTimeDelegate, const ClientModels::FGetTimeResult&); + DECLARE_DELEGATE_OneParam(FGetTitleDataDelegate, const ClientModels::FGetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FGetTitleNewsDelegate, const ClientModels::FGetTitleNewsResult&); + DECLARE_DELEGATE_OneParam(FGetTitlePublicKeyDelegate, const ClientModels::FGetTitlePublicKeyResult&); + DECLARE_DELEGATE_OneParam(FGetTradeStatusDelegate, const ClientModels::FGetTradeStatusResponse&); + DECLARE_DELEGATE_OneParam(FGetUserDataDelegate, const ClientModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserInventoryDelegate, const ClientModels::FGetUserInventoryResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherDataDelegate, const ClientModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherReadOnlyDataDelegate, const ClientModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserReadOnlyDataDelegate, const ClientModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetWindowsHelloChallengeDelegate, const ClientModels::FGetWindowsHelloChallengeResponse&); + DECLARE_DELEGATE_OneParam(FGrantCharacterToUserDelegate, const ClientModels::FGrantCharacterToUserResult&); + DECLARE_DELEGATE_OneParam(FLinkAndroidDeviceIDDelegate, const ClientModels::FLinkAndroidDeviceIDResult&); + DECLARE_DELEGATE_OneParam(FLinkCustomIDDelegate, const ClientModels::FLinkCustomIDResult&); + DECLARE_DELEGATE_OneParam(FLinkFacebookAccountDelegate, const ClientModels::FLinkFacebookAccountResult&); + DECLARE_DELEGATE_OneParam(FLinkFacebookInstantGamesIdDelegate, const ClientModels::FLinkFacebookInstantGamesIdResult&); + DECLARE_DELEGATE_OneParam(FLinkGameCenterAccountDelegate, const ClientModels::FLinkGameCenterAccountResult&); + DECLARE_DELEGATE_OneParam(FLinkGoogleAccountDelegate, const ClientModels::FLinkGoogleAccountResult&); + DECLARE_DELEGATE_OneParam(FLinkIOSDeviceIDDelegate, const ClientModels::FLinkIOSDeviceIDResult&); + DECLARE_DELEGATE_OneParam(FLinkKongregateDelegate, const ClientModels::FLinkKongregateAccountResult&); + DECLARE_DELEGATE_OneParam(FLinkNintendoSwitchDeviceIdDelegate, const ClientModels::FLinkNintendoSwitchDeviceIdResult&); + DECLARE_DELEGATE_OneParam(FLinkSteamAccountDelegate, const ClientModels::FLinkSteamAccountResult&); + DECLARE_DELEGATE_OneParam(FLinkTwitchDelegate, const ClientModels::FLinkTwitchAccountResult&); + DECLARE_DELEGATE_OneParam(FLinkWindowsHelloDelegate, const ClientModels::FLinkWindowsHelloAccountResponse&); + DECLARE_DELEGATE_OneParam(FLinkXboxAccountDelegate, const ClientModels::FLinkXboxAccountResult&); + DECLARE_DELEGATE_OneParam(FLoginWithAndroidDeviceIDDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithCustomIDDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithEmailAddressDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithFacebookDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithFacebookInstantGamesIdDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithGameCenterDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithGoogleAccountDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithIOSDeviceIDDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithKongregateDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithNintendoSwitchDeviceIdDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithPlayFabDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithSteamDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithTwitchDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithWindowsHelloDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FLoginWithXboxDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FMatchmakeDelegate, const ClientModels::FMatchmakeResult&); + DECLARE_DELEGATE_OneParam(FOpenTradeDelegate, const ClientModels::FOpenTradeResponse&); + DECLARE_DELEGATE_OneParam(FPayForPurchaseDelegate, const ClientModels::FPayForPurchaseResult&); + DECLARE_DELEGATE_OneParam(FPurchaseItemDelegate, const ClientModels::FPurchaseItemResult&); + DECLARE_DELEGATE_OneParam(FRedeemCouponDelegate, const ClientModels::FRedeemCouponResult&); + DECLARE_DELEGATE_OneParam(FRegisterForIOSPushNotificationDelegate, const ClientModels::FRegisterForIOSPushNotificationResult&); + DECLARE_DELEGATE_OneParam(FRegisterPlayFabUserDelegate, const ClientModels::FRegisterPlayFabUserResult&); + DECLARE_DELEGATE_OneParam(FRegisterWithWindowsHelloDelegate, const ClientModels::FLoginResult&); + DECLARE_DELEGATE_OneParam(FRemoveContactEmailDelegate, const ClientModels::FRemoveContactEmailResult&); + DECLARE_DELEGATE_OneParam(FRemoveFriendDelegate, const ClientModels::FRemoveFriendResult&); + DECLARE_DELEGATE_OneParam(FRemoveGenericIDDelegate, const ClientModels::FRemoveGenericIDResult&); + DECLARE_DELEGATE_OneParam(FRemoveSharedGroupMembersDelegate, const ClientModels::FRemoveSharedGroupMembersResult&); + DECLARE_DELEGATE_OneParam(FReportDeviceInfoDelegate, const ClientModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FReportPlayerDelegate, const ClientModels::FReportPlayerClientResult&); + DECLARE_DELEGATE_OneParam(FRestoreIOSPurchasesDelegate, const ClientModels::FRestoreIOSPurchasesResult&); + DECLARE_DELEGATE_OneParam(FSendAccountRecoveryEmailDelegate, const ClientModels::FSendAccountRecoveryEmailResult&); + DECLARE_DELEGATE_OneParam(FSetFriendTagsDelegate, const ClientModels::FSetFriendTagsResult&); + DECLARE_DELEGATE_OneParam(FSetPlayerSecretDelegate, const ClientModels::FSetPlayerSecretResult&); + DECLARE_DELEGATE_OneParam(FStartGameDelegate, const ClientModels::FStartGameResult&); + DECLARE_DELEGATE_OneParam(FStartPurchaseDelegate, const ClientModels::FStartPurchaseResult&); + DECLARE_DELEGATE_OneParam(FSubtractUserVirtualCurrencyDelegate, const ClientModels::FModifyUserVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FUnlinkAndroidDeviceIDDelegate, const ClientModels::FUnlinkAndroidDeviceIDResult&); + DECLARE_DELEGATE_OneParam(FUnlinkCustomIDDelegate, const ClientModels::FUnlinkCustomIDResult&); + DECLARE_DELEGATE_OneParam(FUnlinkFacebookAccountDelegate, const ClientModels::FUnlinkFacebookAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlinkFacebookInstantGamesIdDelegate, const ClientModels::FUnlinkFacebookInstantGamesIdResult&); + DECLARE_DELEGATE_OneParam(FUnlinkGameCenterAccountDelegate, const ClientModels::FUnlinkGameCenterAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlinkGoogleAccountDelegate, const ClientModels::FUnlinkGoogleAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlinkIOSDeviceIDDelegate, const ClientModels::FUnlinkIOSDeviceIDResult&); + DECLARE_DELEGATE_OneParam(FUnlinkKongregateDelegate, const ClientModels::FUnlinkKongregateAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlinkNintendoSwitchDeviceIdDelegate, const ClientModels::FUnlinkNintendoSwitchDeviceIdResult&); + DECLARE_DELEGATE_OneParam(FUnlinkSteamAccountDelegate, const ClientModels::FUnlinkSteamAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlinkTwitchDelegate, const ClientModels::FUnlinkTwitchAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlinkWindowsHelloDelegate, const ClientModels::FUnlinkWindowsHelloAccountResponse&); + DECLARE_DELEGATE_OneParam(FUnlinkXboxAccountDelegate, const ClientModels::FUnlinkXboxAccountResult&); + DECLARE_DELEGATE_OneParam(FUnlockContainerInstanceDelegate, const ClientModels::FUnlockContainerItemResult&); + DECLARE_DELEGATE_OneParam(FUnlockContainerItemDelegate, const ClientModels::FUnlockContainerItemResult&); + DECLARE_DELEGATE_OneParam(FUpdateAvatarUrlDelegate, const ClientModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FUpdateCharacterDataDelegate, const ClientModels::FUpdateCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateCharacterStatisticsDelegate, const ClientModels::FUpdateCharacterStatisticsResult&); + DECLARE_DELEGATE_OneParam(FUpdatePlayerStatisticsDelegate, const ClientModels::FUpdatePlayerStatisticsResult&); + DECLARE_DELEGATE_OneParam(FUpdateSharedGroupDataDelegate, const ClientModels::FUpdateSharedGroupDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserDataDelegate, const ClientModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherDataDelegate, const ClientModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserTitleDisplayNameDelegate, const ClientModels::FUpdateUserTitleDisplayNameResult&); + DECLARE_DELEGATE_OneParam(FValidateAmazonIAPReceiptDelegate, const ClientModels::FValidateAmazonReceiptResult&); + DECLARE_DELEGATE_OneParam(FValidateGooglePlayPurchaseDelegate, const ClientModels::FValidateGooglePlayPurchaseResult&); + DECLARE_DELEGATE_OneParam(FValidateIOSReceiptDelegate, const ClientModels::FValidateIOSReceiptResult&); + DECLARE_DELEGATE_OneParam(FValidateWindowsStoreReceiptDelegate, const ClientModels::FValidateWindowsReceiptResult&); + DECLARE_DELEGATE_OneParam(FWriteCharacterEventDelegate, const ClientModels::FWriteEventResponse&); + DECLARE_DELEGATE_OneParam(FWritePlayerEventDelegate, const ClientModels::FWriteEventResponse&); + DECLARE_DELEGATE_OneParam(FWriteTitleEventDelegate, const ClientModels::FWriteEventResponse&); + + UPlayFabClientAPI(); + ~UPlayFabClientAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + bool SetAdvertId(const FString& typeId, const FString& advertisingIdValue); + bool AdvertIdSuccessful(); + bool IsClientLoggedIn() const; + void MultiStepClientLogin(bool needsAttribution); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Accepts an open trade (one that has not yet been accepted or cancelled), if the locally signed-in player is in the + * allowed player list for the trade, or it is open to all players. If the call is successful, the offered and accepted + * items will be swapped between the two players' inventories. + */ + bool AcceptTrade(ClientModels::FAcceptTradeRequest& request, const FAcceptTradeDelegate& SuccessDelegate = FAcceptTradeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user. At + * least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. + */ + bool AddFriend(ClientModels::FAddFriendRequest& request, const FAddFriendDelegate& SuccessDelegate = FAddFriendDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab + * ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as + * authentication credentials, as the intent is that it is easily accessible by other players. + */ + bool AddGenericID(ClientModels::FAddGenericIDRequest& request, const FAddGenericIDDelegate& SuccessDelegate = FAddGenericIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds or updates a contact email to the player's profile. + * This API adds a contact email to the player's profile. If the player's profile already contains a contact email, it will update the contact email to the email address specified. + */ + bool AddOrUpdateContactEmail(ClientModels::FAddOrUpdateContactEmailRequest& request, const FAddOrUpdateContactEmailDelegate& SuccessDelegate = FAddOrUpdateContactEmailDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users + * in the group can add new members. Shared Groups are designed for sharing data between a very small number of players, + * please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool AddSharedGroupMembers(ClientModels::FAddSharedGroupMembersRequest& request, const FAddSharedGroupMembersDelegate& SuccessDelegate = FAddSharedGroupMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds playfab username/password auth to an existing account created via an anonymous auth method, e.g. automatic device + * ID login. + */ + bool AddUsernamePassword(ClientModels::FAddUsernamePasswordRequest& request, const FAddUsernamePasswordDelegate& SuccessDelegate = FAddUsernamePasswordDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Increments the user's balance of the specified virtual currency by the stated amount + * This API must be enabled for use as an option in the game manager website. It is disabled by default. + */ + bool AddUserVirtualCurrency(ClientModels::FAddUserVirtualCurrencyRequest& request, const FAddUserVirtualCurrencyDelegate& SuccessDelegate = FAddUserVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Registers the Android device to receive push notifications + * More information can be found on configuring your game for the Google Cloud Messaging service in the Google developer documentation, here: http://developer.android.com/google/gcm/client.html. The steps to configure and send Push Notifications is described in the PlayFab tutorials, here: https://api.playfab.com/docs/pushCrashCourse/. + */ + bool AndroidDevicePushNotificationRegistration(ClientModels::FAndroidDevicePushNotificationRegistrationRequest& request, const FAndroidDevicePushNotificationRegistrationDelegate& SuccessDelegate = FAndroidDevicePushNotificationRegistrationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Attributes an install for advertisment. + * If you have an ad attribution partner enabled, this will post an install to their service to track the device. It uses the given device id to match based on clicks on ads. + */ + bool AttributeInstall(ClientModels::FAttributeInstallRequest& request, const FAttributeInstallDelegate& SuccessDelegate = FAttributeInstallDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Cancels an open trade (one that has not yet been accepted or cancelled). Note that only the player who created the trade + * can cancel it via this API call, to prevent griefing of the trade system (cancelling trades in order to prevent other + * players from accepting them, for trades that can be claimed by more than one player). + */ + bool CancelTrade(ClientModels::FCancelTradeRequest& request, const FCancelTradeDelegate& SuccessDelegate = FCancelTradeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Confirms with the payment provider that the purchase was approved (if applicable) and adjusts inventory and virtual + * currency balances as appropriate + * The final step in the purchasing process, this API finalizes the purchase with the payment provider, where applicable, adding virtual goods to the player inventory (including random drop table resolution and recursive addition of bundled items) and adjusting virtual currency balances for funds used or added. Note that this is a pull operation, and should be polled regularly when a purchase is in progress. Please note that the processing time for inventory grants and purchases increases fractionally the more items are in the inventory, and the more items are in the grant/purchase operation. + */ + bool ConfirmPurchase(ClientModels::FConfirmPurchaseRequest& request, const FConfirmPurchaseDelegate& SuccessDelegate = FConfirmPurchaseDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. + bool ConsumeItem(ClientModels::FConsumeItemRequest& request, const FConsumeItemDelegate& SuccessDelegate = FConsumeItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Grants the player's current entitlements from Xbox Live, consuming all availble items in Xbox and granting them to the + * player's PlayFab inventory. This call is idempotent and will not grant previously granted items to the player. + */ + bool ConsumeXboxEntitlements(ClientModels::FConsumeXboxEntitlementsRequest& request, const FConsumeXboxEntitlementsDelegate& SuccessDelegate = FConsumeXboxEntitlementsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the + * group. Upon creation, the current user will be the only member of the group. Shared Groups are designed for sharing data + * between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + * If SharedGroupId is specified, the service will attempt to create a group with that identifier, and will return an error if it is already in use. If no SharedGroupId is specified, a random identifier will be assigned. + */ + bool CreateSharedGroup(ClientModels::FCreateSharedGroupRequest& request, const FCreateSharedGroupDelegate& SuccessDelegate = FCreateSharedGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Executes a CloudScript function, with the 'currentPlayerId' set to the PlayFab ID of the authenticated player. + bool ExecuteCloudScript(ClientModels::FExecuteCloudScriptRequest& request, const FExecuteCloudScriptDelegate& SuccessDelegate = FExecuteCloudScriptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the user's PlayFab account details + bool GetAccountInfo(ClientModels::FGetAccountInfoRequest& request, const FGetAccountInfoDelegate& SuccessDelegate = FGetAccountInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be + * evaluated with the parent PlayFabId to guarantee uniqueness. + * Returns a list of every character that currently belongs to a user. + */ + bool GetAllUsersCharacters(ClientModels::FListUsersCharactersRequest& request, const FGetAllUsersCharactersDelegate& SuccessDelegate = FGetAllUsersCharactersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the specified version of the title's catalog of virtual goods, including all defined properties + bool GetCatalogItems(ClientModels::FGetCatalogItemsRequest& request, const FGetCatalogItemsDelegate& SuccessDelegate = FGetCatalogItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the character which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom character data will be returned. + */ + bool GetCharacterData(ClientModels::FGetCharacterDataRequest& request, const FGetCharacterDataDelegate& SuccessDelegate = FGetCharacterDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the specified character's current inventory of virtual goods + * All items currently in the character inventory will be returned, irrespective of how they were acquired (via purchasing, grants, coupons, etc.). Items that are expired, fully consumed, or are no longer valid are not considered to be in the user's current inventory, and so will not be not included. Also returns their virtual currency balances. + */ + bool GetCharacterInventory(ClientModels::FGetCharacterInventoryRequest& request, const FGetCharacterInventoryDelegate& SuccessDelegate = FGetCharacterInventoryDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard + bool GetCharacterLeaderboard(ClientModels::FGetCharacterLeaderboardRequest& request, const FGetCharacterLeaderboardDelegate& SuccessDelegate = FGetCharacterLeaderboardDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the character which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom character data will be returned. + */ + bool GetCharacterReadOnlyData(ClientModels::FGetCharacterDataRequest& request, const FGetCharacterReadOnlyDataDelegate& SuccessDelegate = FGetCharacterReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the details of all title-specific statistics for the user + bool GetCharacterStatistics(ClientModels::FGetCharacterStatisticsRequest& request, const FGetCharacterStatisticsDelegate& SuccessDelegate = FGetCharacterStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned + * URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the + * content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, + * the query to retrieve the data will fail. See this post for more information: + * https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service. Also, + * please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. + */ + bool GetContentDownloadUrl(ClientModels::FGetContentDownloadUrlRequest& request, const FGetContentDownloadUrlDelegate& SuccessDelegate = FGetContentDownloadUrlDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Get details about all current running game servers matching the given parameters. + bool GetCurrentGames(ClientModels::FCurrentGamesRequest& request, const FGetCurrentGamesDelegate& SuccessDelegate = FGetCurrentGamesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves a list of ranked friends of the current player for the given statistic, starting from the indicated point in + * the leaderboard + */ + bool GetFriendLeaderboard(ClientModels::FGetFriendLeaderboardRequest& request, const FGetFriendLeaderboardDelegate& SuccessDelegate = FGetFriendLeaderboardDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves a list of ranked friends of the current player for the given statistic, centered on the requested PlayFab + * user. If PlayFabId is empty or null will return currently logged in user. + */ + bool GetFriendLeaderboardAroundPlayer(ClientModels::FGetFriendLeaderboardAroundPlayerRequest& request, const FGetFriendLeaderboardAroundPlayerDelegate& SuccessDelegate = FGetFriendLeaderboardAroundPlayerDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the current friend list for the local user, constrained to users who have PlayFab accounts. Friends from + * linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. + */ + bool GetFriendsList(ClientModels::FGetFriendsListRequest& request, const FGetFriendsListDelegate& SuccessDelegate = FGetFriendsListDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Get details about the regions hosting game servers matching the given parameters. + bool GetGameServerRegions(ClientModels::FGameServerRegionsRequest& request, const FGetGameServerRegionsDelegate& SuccessDelegate = FGetGameServerRegionsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard + bool GetLeaderboard(ClientModels::FGetLeaderboardRequest& request, const FGetLeaderboardDelegate& SuccessDelegate = FGetLeaderboardDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked characters for the given statistic, centered on the requested Character ID + bool GetLeaderboardAroundCharacter(ClientModels::FGetLeaderboardAroundCharacterRequest& request, const FGetLeaderboardAroundCharacterDelegate& SuccessDelegate = FGetLeaderboardAroundCharacterDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves a list of ranked users for the given statistic, centered on the requested player. If PlayFabId is empty or + * null will return currently logged in user. + */ + bool GetLeaderboardAroundPlayer(ClientModels::FGetLeaderboardAroundPlayerRequest& request, const FGetLeaderboardAroundPlayerDelegate& SuccessDelegate = FGetLeaderboardAroundPlayerDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of all of the user's characters for the given statistic. + bool GetLeaderboardForUserCharacters(ClientModels::FGetLeaderboardForUsersCharactersRequest& request, const FGetLeaderboardForUserCharactersDelegate& SuccessDelegate = FGetLeaderboardForUserCharactersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * For payments flows where the provider requires playfab (the fulfiller) to initiate the transaction, but the client + * completes the rest of the flow. In the Xsolla case, the token returned here will be passed to Xsolla by the client to + * create a cart. Poll GetPurchase using the returned OrderId once you've completed the payment. + */ + bool GetPaymentToken(ClientModels::FGetPaymentTokenRequest& request, const FGetPaymentTokenDelegate& SuccessDelegate = FGetPaymentTokenDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Gets a Photon custom authentication token that can be used to securely join the player into a Photon room. See + * https://api.playfab.com/docs/using-photon-with-playfab/ for more details. + */ + bool GetPhotonAuthenticationToken(ClientModels::FGetPhotonAuthenticationTokenRequest& request, const FGetPhotonAuthenticationTokenDelegate& SuccessDelegate = FGetPhotonAuthenticationTokenDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves all of the user's different kinds of info. + bool GetPlayerCombinedInfo(ClientModels::FGetPlayerCombinedInfoRequest& request, const FGetPlayerCombinedInfoDelegate& SuccessDelegate = FGetPlayerCombinedInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the player's profile + * This API allows for access to details regarding a user in the PlayFab service, usually for purposes of customer support. Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool GetPlayerProfile(ClientModels::FGetPlayerProfileRequest& request, const FGetPlayerProfileDelegate& SuccessDelegate = FGetPlayerProfileDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // List all segments that a player currently belongs to at this moment in time. + + bool GetPlayerSegments(const FGetPlayerSegmentsDelegate& SuccessDelegate = FGetPlayerSegmentsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the indicated statistics (current version and values for all statistics, if none are specified), for the local + * player. + */ + bool GetPlayerStatistics(ClientModels::FGetPlayerStatisticsRequest& request, const FGetPlayerStatisticsDelegate& SuccessDelegate = FGetPlayerStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the information on the available versions of the specified statistic. + bool GetPlayerStatisticVersions(ClientModels::FGetPlayerStatisticVersionsRequest& request, const FGetPlayerStatisticVersionsDelegate& SuccessDelegate = FGetPlayerStatisticVersionsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Get all tags with a given Namespace (optional) from a player profile. + * This API will return a list of canonical tags which includes both namespace and tag's name. If namespace is not provided, the result is a list of all canonical tags. TagName can be used for segmentation and Namespace is limited to 128 characters. + */ + bool GetPlayerTags(ClientModels::FGetPlayerTagsRequest& request, const FGetPlayerTagsDelegate& SuccessDelegate = FGetPlayerTagsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Gets all trades the player has either opened or accepted, optionally filtered by trade status. + bool GetPlayerTrades(ClientModels::FGetPlayerTradesRequest& request, const FGetPlayerTradesDelegate& SuccessDelegate = FGetPlayerTradesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. + bool GetPlayFabIDsFromFacebookIDs(ClientModels::FGetPlayFabIDsFromFacebookIDsRequest& request, const FGetPlayFabIDsFromFacebookIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromFacebookIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the unique PlayFab identifiers for the given set of Facebook Instant Game identifiers. + bool GetPlayFabIDsFromFacebookInstantGamesIds(ClientModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest& request, const FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate& SuccessDelegate = FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of Game Center identifiers (referenced in the Game Center + * Programming Guide as the Player Identifier). + */ + bool GetPlayFabIDsFromGameCenterIDs(ClientModels::FGetPlayFabIDsFromGameCenterIDsRequest& request, const FGetPlayFabIDsFromGameCenterIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromGameCenterIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the + * service name plus the service-specific ID for the player, as specified by the title when the generic identifier was + * added to the player account. + */ + bool GetPlayFabIDsFromGenericIDs(ClientModels::FGetPlayFabIDsFromGenericIDsRequest& request, const FGetPlayFabIDsFromGenericIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromGenericIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of Google identifiers. The Google identifiers are the IDs for + * the user accounts, available as "id" in the Google+ People API calls. + */ + bool GetPlayFabIDsFromGoogleIDs(ClientModels::FGetPlayFabIDsFromGoogleIDsRequest& request, const FGetPlayFabIDsFromGoogleIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromGoogleIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of Kongregate identifiers. The Kongregate identifiers are the + * IDs for the user accounts, available as "user_id" from the Kongregate API methods(ex: + * http://developers.kongregate.com/docs/client/getUserId). + */ + bool GetPlayFabIDsFromKongregateIDs(ClientModels::FGetPlayFabIDsFromKongregateIDsRequest& request, const FGetPlayFabIDsFromKongregateIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromKongregateIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the unique PlayFab identifiers for the given set of Nintendo Switch identifiers. + bool GetPlayFabIDsFromNintendoSwitchDeviceIds(ClientModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& request, const FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate& SuccessDelegate = FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile + * IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + bool GetPlayFabIDsFromSteamIDs(ClientModels::FGetPlayFabIDsFromSteamIDsRequest& request, const FGetPlayFabIDsFromSteamIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromSteamIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of Twitch identifiers. The Twitch identifiers are the IDs for + * the user accounts, available as "_id" from the Twitch API methods (ex: + * https://github.com/justintv/Twitch-API/blob/master/v3_resources/users.md#get-usersuser). + */ + bool GetPlayFabIDsFromTwitchIDs(ClientModels::FGetPlayFabIDsFromTwitchIDsRequest& request, const FGetPlayFabIDsFromTwitchIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromTwitchIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom publisher settings + * This API is designed to return publisher-specific values which can be read, but not written to, by the client. This data is shared across all titles assigned to a particular publisher, and can be used for cross-game coordination. Only titles assigned to a publisher can use this API. For more information email devrel@playfab.com. Note that there may up to a minute delay in between updating title data and this API call returning the newest value. + */ + bool GetPublisherData(ClientModels::FGetPublisherDataRequest& request, const FGetPublisherDataDelegate& SuccessDelegate = FGetPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves a purchase along with its current PlayFab status. Returns inventory items from the purchase that are still + * active. + */ + bool GetPurchase(ClientModels::FGetPurchaseRequest& request, const FGetPurchaseDelegate& SuccessDelegate = FGetPurchaseDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves data stored in a shared group object, as well as the list of members in the group. Non-members of the group + * may use this to retrieve group data, including membership, but they will not receive data for keys marked as private. + * Shared Groups are designed for sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool GetSharedGroupData(ClientModels::FGetSharedGroupDataRequest& request, const FGetSharedGroupDataDelegate& SuccessDelegate = FGetSharedGroupDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the set of items defined for the specified store, including all prices defined + * A store contains an array of references to items defined in one or more catalog versions of the game, along with the prices for the item, in both real world and virtual currencies. These prices act as an override to any prices defined in the catalog. In this way, the base definitions of the items may be defined in the catalog, with all associated properties, while the pricing can be set for each store, as needed. This allows for subsets of goods to be defined for different purposes (in order to simplify showing some, but not all catalog items to users, based upon different characteristics), along with unique prices. Note that all prices defined in the catalog and store definitions for the item are considered valid, and that a compromised client can be made to send a request for an item based upon any of these definitions. If no price is specified in the store for an item, the price set in the catalog should be displayed to the user. + */ + bool GetStoreItems(ClientModels::FGetStoreItemsRequest& request, const FGetStoreItemsDelegate& SuccessDelegate = FGetStoreItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the current server time + * This query retrieves the current time from one of the servers in PlayFab. Please note that due to clock drift between servers, there is a potential variance of up to 5 seconds. + */ + + bool GetTime(const FGetTimeDelegate& SuccessDelegate = FGetTimeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom title settings + * This API is designed to return title specific values which can be read, but not written to, by the client. For example, a developer could choose to store values which modify the user experience, such as enemy spawn rates, weapon strengths, movement speeds, etc. This allows a developer to update the title without the need to create, test, and ship a new build. Note that there may up to a minute delay in between updating title data and this API call returning the newest value. + */ + bool GetTitleData(ClientModels::FGetTitleDataRequest& request, const FGetTitleDataDelegate& SuccessDelegate = FGetTitleDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the title news feed, as configured in the developer portal + bool GetTitleNews(ClientModels::FGetTitleNewsRequest& request, const FGetTitleNewsDelegate& SuccessDelegate = FGetTitleNewsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Returns the title's base 64 encoded RSA CSP blob. + * An RSA CSP blob to be used to encrypt the payload of account creation requests when that API requires a signature header. For example if Client/LoginWithCustomId requires signature headers but the player does not have an account yet follow these steps: 1) Call Client/GetTitlePublicKey with one of the title's shared secrets. 2) Convert the Base64 encoded CSP blob to a byte array and create an RSA signing object. 3) Encrypt the UTF8 encoded JSON body of the registration request and place the Base64 encoded result into the EncryptedRequest and with the TitleId field, all other fields can be left empty when performing the API request. 4) Client receives authentication token as normal. Future requests to LoginWithCustomId will require the X-PlayFab-Signature header. + */ + bool GetTitlePublicKey(ClientModels::FGetTitlePublicKeyRequest& request, const FGetTitlePublicKeyDelegate& SuccessDelegate = FGetTitlePublicKeyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Gets the current status of an existing trade. + bool GetTradeStatus(ClientModels::FGetTradeStatusRequest& request, const FGetTradeStatusDelegate& SuccessDelegate = FGetTradeStatusDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. Every time the data is updated via any source, the version counter is incremented. If the Version parameter is provided, then this call will only return data if the current version on the system is greater than the value provided. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserData(ClientModels::FGetUserDataRequest& request, const FGetUserDataDelegate& SuccessDelegate = FGetUserDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the user's current inventory of virtual goods + + bool GetUserInventory(const FGetUserInventoryDelegate& SuccessDelegate = FGetUserInventoryDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherData(ClientModels::FGetUserDataRequest& request, const FGetUserPublisherDataDelegate& SuccessDelegate = FGetUserPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherReadOnlyData(ClientModels::FGetUserDataRequest& request, const FGetUserPublisherReadOnlyDataDelegate& SuccessDelegate = FGetUserPublisherReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which can only be read by the client + * Data is stored as JSON key-value pairs. Every time the data is updated via any source, the version counter is incremented. If the Version parameter is provided, then this call will only return data if the current version on the system is greater than the value provided. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserReadOnlyData(ClientModels::FGetUserDataRequest& request, const FGetUserReadOnlyDataDelegate& SuccessDelegate = FGetUserReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Requests a challenge from the server to be signed by Windows Hello Passport service to authenticate. + * Requires the SHA256 hash of the user's public key. + */ + bool GetWindowsHelloChallenge(ClientModels::FGetWindowsHelloChallengeRequest& request, const FGetWindowsHelloChallengeDelegate& SuccessDelegate = FGetWindowsHelloChallengeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated + * with the parent PlayFabId to guarantee uniqueness. + * Grants a character to the user of the type specified by the item ID. The user must already have an instance of this item in their inventory in order to allow character creation. This item can come from a purchase or grant, which must be done before calling to create the character. + */ + bool GrantCharacterToUser(ClientModels::FGrantCharacterToUserRequest& request, const FGrantCharacterToUserDelegate& SuccessDelegate = FGrantCharacterToUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the Android device identifier to the user's PlayFab account + bool LinkAndroidDeviceID(ClientModels::FLinkAndroidDeviceIDRequest& request, const FLinkAndroidDeviceIDDelegate& SuccessDelegate = FLinkAndroidDeviceIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the custom identifier, generated by the title, to the user's PlayFab account + bool LinkCustomID(ClientModels::FLinkCustomIDRequest& request, const FLinkCustomIDDelegate& SuccessDelegate = FLinkCustomIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Links the Facebook account associated with the provided Facebook access token to the user's PlayFab account + * Facebook sign-in is accomplished using the Facebook User Access Token. More information on the Token can be found in the Facebook developer documentation (https://developers.facebook.com/docs/facebook-login/access-tokens/). In Unity, for example, the Token is available as AccessToken in the Facebook SDK ScriptableObject FB. Note that titles should never re-use the same Facebook applications between PlayFab Title IDs, as Facebook provides unique user IDs per application and doing so can result in issues with the Facebook ID for the user in their PlayFab account information. If you must re-use an application in a new PlayFab Title ID, please be sure to first unlink all accounts from Facebook, or delete all users in the first Title ID. + */ + bool LinkFacebookAccount(ClientModels::FLinkFacebookAccountRequest& request, const FLinkFacebookAccountDelegate& SuccessDelegate = FLinkFacebookAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the Facebook Instant Games Id to the user's PlayFab account + bool LinkFacebookInstantGamesId(ClientModels::FLinkFacebookInstantGamesIdRequest& request, const FLinkFacebookInstantGamesIdDelegate& SuccessDelegate = FLinkFacebookInstantGamesIdDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the Game Center account associated with the provided Game Center ID to the user's PlayFab account + bool LinkGameCenterAccount(ClientModels::FLinkGameCenterAccountRequest& request, const FLinkGameCenterAccountDelegate& SuccessDelegate = FLinkGameCenterAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Links the currently signed-in user account to their Google account, using their Google account credentials + * Google sign-in is accomplished by obtaining a Google OAuth 2.0 credential using the Google sign-in for Android APIs on the device and passing it to this API. + */ + bool LinkGoogleAccount(ClientModels::FLinkGoogleAccountRequest& request, const FLinkGoogleAccountDelegate& SuccessDelegate = FLinkGoogleAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the vendor-specific iOS device identifier to the user's PlayFab account + bool LinkIOSDeviceID(ClientModels::FLinkIOSDeviceIDRequest& request, const FLinkIOSDeviceIDDelegate& SuccessDelegate = FLinkIOSDeviceIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the Kongregate identifier to the user's PlayFab account + bool LinkKongregate(ClientModels::FLinkKongregateAccountRequest& request, const FLinkKongregateDelegate& SuccessDelegate = FLinkKongregateDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the NintendoSwitchDeviceId to the user's PlayFab account + bool LinkNintendoSwitchDeviceId(ClientModels::FLinkNintendoSwitchDeviceIdRequest& request, const FLinkNintendoSwitchDeviceIdDelegate& SuccessDelegate = FLinkNintendoSwitchDeviceIdDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Links the Steam account associated with the provided Steam authentication ticket to the user's PlayFab account + * Steam authentication is accomplished with the Steam Session Ticket. More information on the Ticket can be found in the Steamworks SDK, here: https://partner.steamgames.com/documentation/auth (requires sign-in). NOTE: For Steam authentication to work, the title must be configured with the Steam Application ID and Publisher Key in the PlayFab Game Manager (under Properties). Information on creating a Publisher Key (referred to as the Secret Key in PlayFab) for your title can be found here: https://partner.steamgames.com/documentation/webapi#publisherkey. + */ + bool LinkSteamAccount(ClientModels::FLinkSteamAccountRequest& request, const FLinkSteamAccountDelegate& SuccessDelegate = FLinkSteamAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the Twitch account associated with the token to the user's PlayFab account. + bool LinkTwitch(ClientModels::FLinkTwitchAccountRequest& request, const FLinkTwitchDelegate& SuccessDelegate = FLinkTwitchDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Link Windows Hello authentication to the current PlayFab Account + * PublicKey must be generated using the Windows Hello Passport service. + */ + bool LinkWindowsHello(ClientModels::FLinkWindowsHelloAccountRequest& request, const FLinkWindowsHelloDelegate& SuccessDelegate = FLinkWindowsHelloDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Links the Xbox Live account associated with the provided access code to the user's PlayFab account + bool LinkXboxAccount(ClientModels::FLinkXboxAccountRequest& request, const FLinkXboxAccountDelegate& SuccessDelegate = FLinkXboxAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using the Android device identifier, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user + * On Android devices, the recommendation is to use the Settings.Secure.ANDROID_ID as the AndroidDeviceId, as described in this blog post (http://android-developers.blogspot.com/2011/03/identifying-app-installations.html). More information on this identifier can be found in the Android documentation (http://developer.android.com/reference/android/provider/Settings.Secure.html). If this is the first time a user has signed in with the Android device and CreateAccount is set to true, a new PlayFab account will be created and linked to the Android device ID. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Android device, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. Please note that while multiple devices of this type can be linked to a single user account, only the one most recently used to login (or most recently linked) will be reflected in the user's account information. We will be updating to show all linked devices in a future release. + */ + bool LoginWithAndroidDeviceID(ClientModels::FLoginWithAndroidDeviceIDRequest& request, const FLoginWithAndroidDeviceIDDelegate& SuccessDelegate = FLoginWithAndroidDeviceIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a custom unique identifier generated by the title, returning a session identifier that can + * subsequently be used for API calls which require an authenticated user + * It is highly recommended that developers ensure that it is extremely unlikely that a customer could generate an ID which is already in use by another customer. If this is the first time a user has signed in with the Custom ID and CreateAccount is set to true, a new PlayFab account will be created and linked to the Custom ID. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Custom ID, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. + */ + bool LoginWithCustomID(ClientModels::FLoginWithCustomIDRequest& request, const FLoginWithCustomIDDelegate& SuccessDelegate = FLoginWithCustomIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls + * which require an authenticated user. Unlike most other login API calls, LoginWithEmailAddress does not permit the + * creation of new accounts via the CreateAccountFlag. Email addresses may be used to create accounts via + * RegisterPlayFabUser. + * Email address and password lengths are provided for information purposes. The server will validate that data passed in conforms to the field definition and report errors appropriately. It is recommended that developers not perform this validation locally, so that future updates do not require client updates. + */ + bool LoginWithEmailAddress(ClientModels::FLoginWithEmailAddressRequest& request, const FLoginWithEmailAddressDelegate& SuccessDelegate = FLoginWithEmailAddressDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Facebook access token, returning a session identifier that can subsequently be used for API + * calls which require an authenticated user + * Facebook sign-in is accomplished using the Facebook User Access Token. More information on the Token can be found in the Facebook developer documentation (https://developers.facebook.com/docs/facebook-login/access-tokens/). In Unity, for example, the Token is available as AccessToken in the Facebook SDK ScriptableObject FB. If this is the first time a user has signed in with the Facebook account and CreateAccount is set to true, a new PlayFab account will be created and linked to the provided account's Facebook ID. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Facebook account, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. Note that titles should never re-use the same Facebook applications between PlayFab Title IDs, as Facebook provides unique user IDs per application and doing so can result in issues with the Facebook ID for the user in their PlayFab account information. If you must re-use an application in a new PlayFab Title ID, please be sure to first unlink all accounts from Facebook, or delete all users in the first Title ID. + */ + bool LoginWithFacebook(ClientModels::FLoginWithFacebookRequest& request, const FLoginWithFacebookDelegate& SuccessDelegate = FLoginWithFacebookDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Facebook Instant Games ID, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user. Requires Facebook Instant Games to be configured. + */ + bool LoginWithFacebookInstantGamesId(ClientModels::FLoginWithFacebookInstantGamesIdRequest& request, const FLoginWithFacebookInstantGamesIdDelegate& SuccessDelegate = FLoginWithFacebookInstantGamesIdDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using an iOS Game Center player identifier, returning a session identifier that can subsequently be + * used for API calls which require an authenticated user + * The Game Center player identifier (https://developer.apple.com/library/ios/documentation/Accounts/Reference/ACAccountClassRef/index.html#//apple_ref/occ/instp/ACAccount/identifier) is a generated string which is stored on the local device. As with device identifiers, care must be taken to never expose a player's Game Center identifier to end users, as that could result in a user's account being compromised. If this is the first time a user has signed in with Game Center and CreateAccount is set to true, a new PlayFab account will be created and linked to the Game Center identifier. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Game Center account, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. + */ + bool LoginWithGameCenter(ClientModels::FLoginWithGameCenterRequest& request, const FLoginWithGameCenterDelegate& SuccessDelegate = FLoginWithGameCenterDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using their Google account credentials + * Google sign-in is accomplished by obtaining a Google OAuth 2.0 credential using the Google sign-in for Android APIs on the device and passing it to this API. If this is the first time a user has signed in with the Google account and CreateAccount is set to true, a new PlayFab account will be created and linked to the Google account. Otherwise, if no PlayFab account is linked to the Google account, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. The current (recommended) method for obtaining a Google account credential in an Android application is to call GoogleSignInAccount.getServerAuthCode() and send the auth code as the ServerAuthCode parameter of this API. Before doing this, you must create an OAuth 2.0 web application client ID in the Google API Console and configure its client ID and secret in the PlayFab Game Manager Google Add-on for your title. This method does not require prompting of the user for additional Google account permissions, resulting in a user experience with the least possible friction. For more information about obtaining the server auth code, see https://developers.google.com/identity/sign-in/android/offline-access. The previous (deprecated) method was to obtain an OAuth access token by calling GetAccessToken() on the client and passing it as the AccessToken parameter to this API. for the with the Google OAuth 2.0 Access Token. More information on this change can be found in the Google developer documentation (https://android-developers.googleblog.com/2016/01/play-games-permissions-are-changing-in.html). + */ + bool LoginWithGoogleAccount(ClientModels::FLoginWithGoogleAccountRequest& request, const FLoginWithGoogleAccountDelegate& SuccessDelegate = FLoginWithGoogleAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using the vendor-specific iOS device identifier, returning a session identifier that can subsequently + * be used for API calls which require an authenticated user + * On iOS devices, the identifierForVendor (https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice/identifierForVendor) must be used as the DeviceId, as the UIDevice uniqueIdentifier has been deprecated as of iOS 5, and use of the advertisingIdentifier for this purpose will result in failure of Apple's certification process. If this is the first time a user has signed in with the iOS device and CreateAccount is set to true, a new PlayFab account will be created and linked to the vendor-specific iOS device ID. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the iOS device, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. Please note that while multiple devices of this type can be linked to a single user account, only the one most recently used to login (or most recently linked) will be reflected in the user's account information. We will be updating to show all linked devices in a future release. + */ + bool LoginWithIOSDeviceID(ClientModels::FLoginWithIOSDeviceIDRequest& request, const FLoginWithIOSDeviceIDDelegate& SuccessDelegate = FLoginWithIOSDeviceIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Kongregate player account. + * More details regarding Kongregate and their game authentication system can be found at http://developers.kongregate.com/docs/virtual-goods/authentication. Developers must provide the Kongregate user ID and auth token that are generated using the Kongregate client library. PlayFab will combine these identifiers with the title's unique Kongregate app ID to log the player into the Kongregate system. If CreateAccount is set to true and there is not already a user matched to this Kongregate ID, then PlayFab will create a new account for this user and link the ID. In this case, no email or username will be associated with the PlayFab account. If there is already a different PlayFab user linked with this account, then an error will be returned. + */ + bool LoginWithKongregate(ClientModels::FLoginWithKongregateRequest& request, const FLoginWithKongregateDelegate& SuccessDelegate = FLoginWithKongregateDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Nintendo Switch Device ID, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user + */ + bool LoginWithNintendoSwitchDeviceId(ClientModels::FLoginWithNintendoSwitchDeviceIdRequest& request, const FLoginWithNintendoSwitchDeviceIdDelegate& SuccessDelegate = FLoginWithNintendoSwitchDeviceIdDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls + * which require an authenticated user. Unlike most other login API calls, LoginWithPlayFab does not permit the creation of + * new accounts via the CreateAccountFlag. Username/Password credentials may be used to create accounts via + * RegisterPlayFabUser, or added to existing accounts using AddUsernamePassword. + * Username and password lengths are provided for information purposes. The server will validate that data passed in conforms to the field definition and report errors appropriately. It is recommended that developers not perform this validation locally, so that future updates to the username or password do not require client updates. + */ + bool LoginWithPlayFab(ClientModels::FLoginWithPlayFabRequest& request, const FLoginWithPlayFabDelegate& SuccessDelegate = FLoginWithPlayFabDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Steam authentication ticket, returning a session identifier that can subsequently be used for + * API calls which require an authenticated user + * Steam sign-in is accomplished with the Steam Session Ticket. More information on the Ticket can be found in the Steamworks SDK, here: https://partner.steamgames.com/documentation/auth (requires sign-in). NOTE: For Steam authentication to work, the title must be configured with the Steam Application ID and Web API Key in the PlayFab Game Manager (under Steam in the Add-ons Marketplace). You can obtain a Web API Key from the Permissions page of any Group associated with your App ID in the Steamworks site. If this is the first time a user has signed in with the Steam account and CreateAccount is set to true, a new PlayFab account will be created and linked to the provided account's Steam ID. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Steam account, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. + */ + bool LoginWithSteam(ClientModels::FLoginWithSteamRequest& request, const FLoginWithSteamDelegate& SuccessDelegate = FLoginWithSteamDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Twitch access token. + * More details regarding Twitch and their authentication system can be found at https://github.com/justintv/Twitch-API/blob/master/authentication.md. Developers must provide the Twitch access token that is generated using one of the Twitch authentication flows. PlayFab will use the title's unique Twitch Client ID to authenticate the token and log in to the PlayFab system. If CreateAccount is set to true and there is not already a user matched to the Twitch username that generated the token, then PlayFab will create a new account for this user and link the ID. In this case, no email or username will be associated with the PlayFab account. If there is already a different PlayFab user linked with this account, then an error will be returned. + */ + bool LoginWithTwitch(ClientModels::FLoginWithTwitchRequest& request, const FLoginWithTwitchDelegate& SuccessDelegate = FLoginWithTwitchDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Completes the Windows Hello login flow by returning the signed value of the challange from GetWindowsHelloChallenge. + * Windows Hello has a 2 step client to server authentication scheme. Step one is to request from the server a challenge + * string. Step two is to request the user sign the string via Windows Hello and then send the signed value back to the + * server. + * Requires both the SHA256 hash of the user's public key as well as the signed response from GetWindowsHelloChallenge + */ + bool LoginWithWindowsHello(ClientModels::FLoginWithWindowsHelloRequest& request, const FLoginWithWindowsHelloDelegate& SuccessDelegate = FLoginWithWindowsHelloDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls + * which require an authenticated user + * If this is the first time a user has signed in with the Xbox Live account and CreateAccount is set to true, a new PlayFab account will be created and linked to the Xbox Live account. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Xbox Live account, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. + */ + bool LoginWithXbox(ClientModels::FLoginWithXboxRequest& request, const FLoginWithXboxDelegate& SuccessDelegate = FLoginWithXboxDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Attempts to locate a game session matching the given parameters. If the goal is to match the player into a specific + * active session, only the LobbyId is required. Otherwise, the BuildVersion, GameMode, and Region are all required + * parameters. Note that parameters specified in the search are required (they are not weighting factors). If a slot is + * found in a server instance matching the parameters, the slot will be assigned to that player, removing it from the + * availabe set. In that case, the information on the game session will be returned, otherwise the Status returned will be + * GameNotFound. + */ + bool Matchmake(ClientModels::FMatchmakeRequest& request, const FMatchmakeDelegate& SuccessDelegate = FMatchmakeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Opens a new outstanding trade. Note that a given item instance may only be in one open trade at a time. + bool OpenTrade(ClientModels::FOpenTradeRequest& request, const FOpenTradeDelegate& SuccessDelegate = FOpenTradeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Selects a payment option for purchase order created via StartPurchase + * This is the second step in the purchasing process, initiating the purchase transaction with the payment provider (if applicable). For payment provider scenarios, the title should next present the user with the payment provider'sinterface for payment. Once the player has completed the payment with the provider, the title should call ConfirmPurchase tofinalize the process and add the appropriate items to the player inventory. + */ + bool PayForPurchase(ClientModels::FPayForPurchaseRequest& request, const FPayForPurchaseDelegate& SuccessDelegate = FPayForPurchaseDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Buys a single item with virtual currency. You must specify both the virtual currency to use to purchase, as well as what + * the client believes the price to be. This lets the server fail the purchase if the price has changed. + * Please note that the processing time for inventory grants and purchases increases fractionally the more items are in the inventory, and the more items are in the grant/purchase operation (with each item in a bundle being a distinct add). + */ + bool PurchaseItem(ClientModels::FPurchaseItemRequest& request, const FPurchaseItemDelegate& SuccessDelegate = FPurchaseItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the + * Economy->Catalogs tab in the PlayFab Game Manager. + * Coupon codes can be created for any item, or set of items, in the catalog for the title. This operation causes the coupon to be consumed, and the specific items to be awarded to the user. Attempting to re-use an already consumed code, or a code which has not yet been created in the service, will result in an error. + */ + bool RedeemCoupon(ClientModels::FRedeemCouponRequest& request, const FRedeemCouponDelegate& SuccessDelegate = FRedeemCouponDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Registers the iOS device to receive push notifications + * The steps to configure and send Push Notifications is described in the PlayFab tutorials, here: https://api.playfab.com/docs/pushCrashCourse/ + */ + bool RegisterForIOSPushNotification(ClientModels::FRegisterForIOSPushNotificationRequest& request, const FRegisterForIOSPushNotificationDelegate& SuccessDelegate = FRegisterForIOSPushNotificationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Registers a new Playfab user account, returning a session identifier that can subsequently be used for API calls which + * require an authenticated user. You must supply either a username or an email address. + */ + bool RegisterPlayFabUser(ClientModels::FRegisterPlayFabUserRequest& request, const FRegisterPlayFabUserDelegate& SuccessDelegate = FRegisterPlayFabUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Registers a new PlayFab user account using Windows Hello authentication, returning a session ticket that can + * subsequently be used for API calls which require an authenticated user + * PublicKey must be generated using the Windows Hello Passport service. + */ + bool RegisterWithWindowsHello(ClientModels::FRegisterWithWindowsHelloRequest& request, const FRegisterWithWindowsHelloDelegate& SuccessDelegate = FRegisterWithWindowsHelloDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes a contact email from the player's profile. + * This API removes an existing contact email from the player's profile. + */ + + bool RemoveContactEmail(const FRemoveContactEmailDelegate& SuccessDelegate = FRemoveContactEmailDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Removes a specified user from the friend list of the local user + bool RemoveFriend(ClientModels::FRemoveFriendRequest& request, const FRemoveFriendDelegate& SuccessDelegate = FRemoveFriendDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Removes the specified generic service identifier from the player's PlayFab account. + bool RemoveGenericID(ClientModels::FRemoveGenericIDRequest& request, const FRemoveGenericIDDelegate& SuccessDelegate = FRemoveGenericIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the + * group can remove members. If as a result of the call, zero users remain with access, the group and its associated data + * will be deleted. Shared Groups are designed for sharing data between a very small number of players, please see our + * guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool RemoveSharedGroupMembers(ClientModels::FRemoveSharedGroupMembersRequest& request, const FRemoveSharedGroupMembersDelegate& SuccessDelegate = FRemoveSharedGroupMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Write a PlayStream event to describe the provided player device information. This API method is not designed to be + * called directly by developers. Each PlayFab client SDK will eventually report this information automatically. + * Any arbitrary information collected by the device + */ + bool ReportDeviceInfo(ClientModels::FDeviceInfoRequest& request, const FReportDeviceInfoDelegate& SuccessDelegate = FReportDeviceInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title + * can take action concerning potentially toxic players. + */ + bool ReportPlayer(ClientModels::FReportPlayerClientRequest& request, const FReportPlayerDelegate& SuccessDelegate = FReportPlayerDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Restores all in-app purchases based on the given restore receipt + * The title should obtain a refresh receipt via restoreCompletedTransactions in the SKPaymentQueue of the Apple StoreKit and pass that in to this call. The resultant receipt contains new receipt instances for all non-consumable goods previously purchased by the user. This API call iterates through every purchase in the receipt and restores the items if they still exist in the catalog and can be validated. + */ + bool RestoreIOSPurchases(ClientModels::FRestoreIOSPurchasesRequest& request, const FRestoreIOSPurchasesDelegate& SuccessDelegate = FRestoreIOSPurchasesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to + * change the password.If an account recovery email template ID is provided, an email using the custom email template will + * be used. + * If the account in question is a "temporary" account (for example, one that was created via a call to LoginFromIOSDeviceID), thisfunction will have no effect. Only PlayFab accounts which have valid email addresses will be able to receive a password reset email using this API. + */ + bool SendAccountRecoveryEmail(ClientModels::FSendAccountRecoveryEmailRequest& request, const FSendAccountRecoveryEmailDelegate& SuccessDelegate = FSendAccountRecoveryEmailDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the tag list for a specified user in the friend list of the local user + * This operation is not additive. It will completely replace the tag list for the specified user. Please note that only users in the PlayFab friends list can be assigned tags. Attempting to set a tag on a friend only included in the friends list from a social site integration (such as Facebook or Steam) will return the AccountNotFound error. + */ + bool SetFriendTags(ClientModels::FSetFriendTagsRequest& request, const FSetFriendTagsDelegate& SuccessDelegate = FSetFriendTagsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's + * secret use the Admin or Server API method SetPlayerSecret. + * APIs that require signatures require that the player have a configured Player Secret Key that is used to sign all requests. Players that don't have a secret will be blocked from making API calls until it is configured. To create a signature header add a SHA256 hashed string containing UTF8 encoded JSON body as it will be sent to the server, the current time in UTC formatted to ISO 8601, and the players secret formatted as 'body.date.secret'. Place the resulting hash into the header X-PlayFab-Signature, along with a header X-PlayFab-Timestamp of the same UTC timestamp used in the signature. + */ + bool SetPlayerSecret(ClientModels::FSetPlayerSecretRequest& request, const FSetPlayerSecretDelegate& SuccessDelegate = FSetPlayerSecretDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Start a new game server with a given configuration, add the current player and return the connection information. + * This API must be enabled for use as an option in the game manager website. It is disabled by default. + */ + bool StartGame(ClientModels::FStartGameRequest& request, const FStartGameDelegate& SuccessDelegate = FStartGameDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates an order for a list of items from the title catalog + * This is the first step in the purchasing process. For security purposes, once the order (or "cart") has been created, additional inventory objects may no longer be added. In addition, inventory objects will be locked to the current prices, regardless of any subsequent changes at the catalog level which may occur during the next two steps. + */ + bool StartPurchase(ClientModels::FStartPurchaseRequest& request, const FStartPurchaseDelegate& SuccessDelegate = FStartPurchaseDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Decrements the user's balance of the specified virtual currency by the stated amount. It is possible to make a VC + * balance negative with this API. + * This API must be enabled for use as an option in the game manager website. It is disabled by default. + */ + bool SubtractUserVirtualCurrency(ClientModels::FSubtractUserVirtualCurrencyRequest& request, const FSubtractUserVirtualCurrencyDelegate& SuccessDelegate = FSubtractUserVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Android device identifier from the user's PlayFab account + bool UnlinkAndroidDeviceID(ClientModels::FUnlinkAndroidDeviceIDRequest& request, const FUnlinkAndroidDeviceIDDelegate& SuccessDelegate = FUnlinkAndroidDeviceIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related custom identifier from the user's PlayFab account + bool UnlinkCustomID(ClientModels::FUnlinkCustomIDRequest& request, const FUnlinkCustomIDDelegate& SuccessDelegate = FUnlinkCustomIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Facebook account from the user's PlayFab account + + bool UnlinkFacebookAccount(const FUnlinkFacebookAccountDelegate& SuccessDelegate = FUnlinkFacebookAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Facebook Instant Game Ids from the user's PlayFab account + bool UnlinkFacebookInstantGamesId(ClientModels::FUnlinkFacebookInstantGamesIdRequest& request, const FUnlinkFacebookInstantGamesIdDelegate& SuccessDelegate = FUnlinkFacebookInstantGamesIdDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Game Center account from the user's PlayFab account + + bool UnlinkGameCenterAccount(const FUnlinkGameCenterAccountDelegate& SuccessDelegate = FUnlinkGameCenterAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Unlinks the related Google account from the user's PlayFab account + * (https://developers.google.com/android/reference/com/google/android/gms/auth/GoogleAuthUtil#public-methods). + */ + + bool UnlinkGoogleAccount(const FUnlinkGoogleAccountDelegate& SuccessDelegate = FUnlinkGoogleAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related iOS device identifier from the user's PlayFab account + bool UnlinkIOSDeviceID(ClientModels::FUnlinkIOSDeviceIDRequest& request, const FUnlinkIOSDeviceIDDelegate& SuccessDelegate = FUnlinkIOSDeviceIDDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Kongregate identifier from the user's PlayFab account + + bool UnlinkKongregate(const FUnlinkKongregateDelegate& SuccessDelegate = FUnlinkKongregateDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related NintendoSwitchDeviceId from the user's PlayFab account + bool UnlinkNintendoSwitchDeviceId(ClientModels::FUnlinkNintendoSwitchDeviceIdRequest& request, const FUnlinkNintendoSwitchDeviceIdDelegate& SuccessDelegate = FUnlinkNintendoSwitchDeviceIdDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Steam account from the user's PlayFab account + + bool UnlinkSteamAccount(const FUnlinkSteamAccountDelegate& SuccessDelegate = FUnlinkSteamAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Twitch account from the user's PlayFab account. + + bool UnlinkTwitch(const FUnlinkTwitchDelegate& SuccessDelegate = FUnlinkTwitchDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Unlink Windows Hello authentication from the current PlayFab Account + * Must include the Public Key Hint + */ + bool UnlinkWindowsHello(ClientModels::FUnlinkWindowsHelloAccountRequest& request, const FUnlinkWindowsHelloDelegate& SuccessDelegate = FUnlinkWindowsHelloDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Unlinks the related Xbox Live account from the user's PlayFab account + bool UnlinkXboxAccount(ClientModels::FUnlinkXboxAccountRequest& request, const FUnlinkXboxAccountDelegate& SuccessDelegate = FUnlinkXboxAccountDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Opens the specified container, with the specified key (when required), and returns the contents of the opened container. + * If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, + * consistent with the operation of ConsumeItem. + * Specify the container and optionally the catalogVersion for the container to open + */ + bool UnlockContainerInstance(ClientModels::FUnlockContainerInstanceRequest& request, const FUnlockContainerInstanceDelegate& SuccessDelegate = FUnlockContainerInstanceDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Searches target inventory for an ItemInstance matching the given CatalogItemId, if necessary unlocks it using an + * appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are + * consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. + * Specify the type of container to open and optionally the catalogVersion for the container to open + */ + bool UnlockContainerItem(ClientModels::FUnlockContainerItemRequest& request, const FUnlockContainerItemDelegate& SuccessDelegate = FUnlockContainerItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Update the avatar URL of the player + bool UpdateAvatarUrl(ClientModels::FUpdateAvatarUrlRequest& request, const FUpdateAvatarUrlDelegate& SuccessDelegate = FUpdateAvatarUrlDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates and updates the title-specific custom data for the user's character which is readable and writable by the client + * This function performs an additive update of the arbitrary strings containing the custom data for the character. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. New keys will be added, with the given values. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateCharacterData(ClientModels::FUpdateCharacterDataRequest& request, const FUpdateCharacterDataDelegate& SuccessDelegate = FUpdateCharacterDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the values of the specified title-specific statistics for the specific character. By default, clients are not + * permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * Enable this option with the 'Allow Client to Post Player Statistics' option in PlayFab GameManager for your title. However, this is not best practice, as this data will no longer be safely controlled by the server. This operation is additive. Character Statistics not currently defined will be added, while those already defined will be updated with the given values. All other user statistics will remain unchanged. Character statistics are used by the character-leaderboard apis, and accessible for custom game-logic. + */ + bool UpdateCharacterStatistics(ClientModels::FUpdateCharacterStatisticsRequest& request, const FUpdateCharacterStatisticsDelegate& SuccessDelegate = FUpdateCharacterStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to + * update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * Enable this option with the 'Allow Client to Post Player Statistics' option in PlayFab GameManager for your title. However, this is not best practice, as this data will no longer be safely controlled by the server. This operation is additive. Statistics not currently defined will be added, while those already defined will be updated with the given values. All other user statistics will remain unchanged. Note that if the statistic is intended to have a reset period, the UpdatePlayerStatisticDefinition API call can be used to define that reset period. Once a statistic has been versioned (reset), the now-previous version can still be written to for up a short, pre-defined period (currently 10 seconds), using the Version parameter in this call. + */ + bool UpdatePlayerStatistics(ClientModels::FUpdatePlayerStatisticsRequest& request, const FUpdatePlayerStatisticsDelegate& SuccessDelegate = FUpdatePlayerStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated + * or added in this call will be readable by users not in the group. By default, data permissions are set to Private. + * Regardless of the permission setting, only members of the group can update the data. Shared Groups are designed for + * sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + * Note that in the case of multiple calls to write to the same shared group data keys, the last write received by the PlayFab service will determine the value available to subsequent read operations. For scenarios requiring coordination of data updates, it is recommended that titles make use of user data with read permission set to public, or a combination of user data and shared group data. + */ + bool UpdateSharedGroupData(ClientModels::FUpdateSharedGroupDataRequest& request, const FUpdateSharedGroupDataDelegate& SuccessDelegate = FUpdateSharedGroupDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates and updates the title-specific custom data for the user which is readable and writable by the client + * This function performs an additive update of the arbitrary strings containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. New keys will be added, with the given values. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserData(ClientModels::FUpdateUserDataRequest& request, const FUpdateUserDataDelegate& SuccessDelegate = FUpdateUserDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates and updates the publisher-specific custom data for the user which is readable and writable by the client + * This function performs an additive update of the arbitrary strings containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. New keys will be added, with the given values. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserPublisherData(ClientModels::FUpdateUserDataRequest& request, const FUpdateUserPublisherDataDelegate& SuccessDelegate = FUpdateUserPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title specific display name for the user + * In addition to the PlayFab username, titles can make use of a DisplayName which is also a unique identifier, but specific to the title. This allows for unique names which more closely match the theme or genre of a title, for example. + */ + bool UpdateUserTitleDisplayName(ClientModels::FUpdateUserTitleDisplayNameRequest& request, const FUpdateUserTitleDisplayNameDelegate& SuccessDelegate = FUpdateUserTitleDisplayNameDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the + * purchased catalog item + */ + bool ValidateAmazonIAPReceipt(ClientModels::FValidateAmazonReceiptRequest& request, const FValidateAmazonIAPReceiptDelegate& SuccessDelegate = FValidateAmazonIAPReceiptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Validates a Google Play purchase and gives the corresponding item to the player. + * The packageName and productId are defined in the GooglePlay store. The productId must match the ItemId of the inventory item in the PlayFab catalog for the title. This enables the PlayFab service to securely validate that the purchase is for the correct item, in order to prevent uses from passing valid receipts as being for more expensive items (passing a receipt for a 99-cent purchase as being for a $19.99 purchase, for example). Each receipt may be validated only once to avoid granting the same item over and over from a single purchase. + */ + bool ValidateGooglePlayPurchase(ClientModels::FValidateGooglePlayPurchaseRequest& request, const FValidateGooglePlayPurchaseDelegate& SuccessDelegate = FValidateGooglePlayPurchaseDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased + * catalog item + * The CurrencyCode and PurchasePrice must match the price which was set up for the item in the Apple store. In addition, The ItemId of the inventory in the PlayFab Catalog must match the Product ID as it was set up in the Apple store. This enables the PlayFab service to securely validate that the purchase is for the correct item, in order to prevent uses from passing valid receipts as being for more expensive items (passing a receipt for a 99-cent purchase as being for a $19.99 purchase, for example). + */ + bool ValidateIOSReceipt(ClientModels::FValidateIOSReceiptRequest& request, const FValidateIOSReceiptDelegate& SuccessDelegate = FValidateIOSReceiptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Validates with Windows that the receipt for an Windows App Store in-app purchase is valid and that it matches the + * purchased catalog item + */ + bool ValidateWindowsStoreReceipt(ClientModels::FValidateWindowsReceiptRequest& request, const FValidateWindowsStoreReceiptDelegate& SuccessDelegate = FValidateWindowsStoreReceiptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Writes a character-based event into PlayStream. + * This API is designed to write a multitude of different client-defined events into PlayStream. It supports a flexible JSON schema, which allowsfor arbitrary key-value pairs to describe any character-based event. The created event will be locked to the authenticated title and player. + */ + bool WriteCharacterEvent(ClientModels::FWriteClientCharacterEventRequest& request, const FWriteCharacterEventDelegate& SuccessDelegate = FWriteCharacterEventDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Writes a player-based event into PlayStream. + * This API is designed to write a multitude of different event types into PlayStream. It supports a flexible JSON schema, which allowsfor arbitrary key-value pairs to describe any player-based event. The created event will be locked to the authenticated title and player. + */ + bool WritePlayerEvent(ClientModels::FWriteClientPlayerEventRequest& request, const FWritePlayerEventDelegate& SuccessDelegate = FWritePlayerEventDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Writes a title-based event into PlayStream. + * This API is designed to write a multitude of different client-defined events into PlayStream. It supports a flexible JSON schema, which allowsfor arbitrary key-value pairs to describe any title-based event. The created event will be locked to the authenticated title. + */ + bool WriteTitleEvent(ClientModels::FWriteTitleEventRequest& request, const FWriteTitleEventDelegate& SuccessDelegate = FWriteTitleEventDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnAcceptTradeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAcceptTradeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddGenericIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddGenericIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddOrUpdateContactEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddOrUpdateContactEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddUsernamePasswordResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUsernamePasswordDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAndroidDevicePushNotificationRegistrationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAndroidDevicePushNotificationRegistrationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAttributeInstallResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAttributeInstallDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCancelTradeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCancelTradeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnConfirmPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConfirmPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnConsumeItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConsumeItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnConsumeXboxEntitlementsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConsumeXboxEntitlementsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreateSharedGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateSharedGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnExecuteCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExecuteCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetAccountInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAccountInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetAllUsersCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllUsersCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetContentDownloadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentDownloadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCurrentGamesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCurrentGamesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetFriendLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetFriendLeaderboardAroundPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendLeaderboardAroundPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetFriendsListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendsListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetGameServerRegionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetGameServerRegionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardAroundCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardAroundPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardForUserCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardForUserCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPaymentTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPaymentTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPhotonAuthenticationTokenResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPhotonAuthenticationTokenDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerCombinedInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerCombinedInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerStatisticVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerTradesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTradesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromFacebookIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromFacebookInstantGamesIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromGameCenterIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromGameCenterIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromGenericIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromGenericIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromGoogleIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromGoogleIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromKongregateIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromKongregateIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromSteamIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromSteamIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromTwitchIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromTwitchIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetStoreItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetStoreItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTimeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTimeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleNewsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleNewsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitlePublicKeyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitlePublicKeyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTradeStatusResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTradeStatusDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetWindowsHelloChallengeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetWindowsHelloChallengeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGrantCharacterToUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantCharacterToUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkAndroidDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkAndroidDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkCustomIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkCustomIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkFacebookAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkFacebookAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkFacebookInstantGamesIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkFacebookInstantGamesIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkGameCenterAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkGameCenterAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkGoogleAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkGoogleAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkIOSDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkIOSDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkKongregateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkKongregateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkNintendoSwitchDeviceIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkNintendoSwitchDeviceIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkSteamAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkSteamAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkTwitchResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkTwitchDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLinkXboxAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkXboxAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithAndroidDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithAndroidDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithCustomIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithCustomIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithEmailAddressResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithEmailAddressDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithFacebookResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithFacebookDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithFacebookInstantGamesIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithFacebookInstantGamesIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithGameCenterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithGameCenterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithGoogleAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithGoogleAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithIOSDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithIOSDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithKongregateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithKongregateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithNintendoSwitchDeviceIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithNintendoSwitchDeviceIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithPlayFabResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithPlayFabDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithSteamResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithSteamDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithTwitchResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithTwitchDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnLoginWithXboxResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginWithXboxDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnMatchmakeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMatchmakeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnOpenTradeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FOpenTradeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnPayForPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPayForPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnPurchaseItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPurchaseItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRedeemCouponResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRedeemCouponDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRegisterForIOSPushNotificationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterForIOSPushNotificationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRegisterPlayFabUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterPlayFabUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRegisterWithWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterWithWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveContactEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveContactEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveGenericIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveGenericIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnReportDeviceInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FReportDeviceInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnReportPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FReportPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRestoreIOSPurchasesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRestoreIOSPurchasesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSendAccountRecoveryEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendAccountRecoveryEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetFriendTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetFriendTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetPlayerSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPlayerSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnStartGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FStartGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnStartPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FStartPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSubtractUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkAndroidDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkAndroidDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkCustomIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkCustomIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkFacebookAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkFacebookAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkFacebookInstantGamesIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkFacebookInstantGamesIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkGameCenterAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkGameCenterAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkGoogleAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkGoogleAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkIOSDeviceIDResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkIOSDeviceIDDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkKongregateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkKongregateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkNintendoSwitchDeviceIdResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkNintendoSwitchDeviceIdDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkSteamAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkSteamAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkTwitchResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkTwitchDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkWindowsHelloResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkWindowsHelloDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlinkXboxAccountResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlinkXboxAccountDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlockContainerInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlockContainerItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateAvatarUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateAvatarUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdatePlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserTitleDisplayNameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserTitleDisplayNameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnValidateAmazonIAPReceiptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateAmazonIAPReceiptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnValidateGooglePlayPurchaseResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateGooglePlayPurchaseDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnValidateIOSReceiptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateIOSReceiptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnValidateWindowsStoreReceiptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FValidateWindowsStoreReceiptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnWriteCharacterEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteCharacterEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnWritePlayerEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWritePlayerEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnWriteTitleEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteTitleEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabClientDataModels.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabClientDataModels.h new file mode 100644 index 000000000..d269752e2 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabClientDataModels.h @@ -0,0 +1,12548 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace ClientModels +{ + + struct PLAYFABCPP_API FAcceptTradeRequest : public FPlayFabBaseModel + { + /** + * [optional] Items from the accepting player's inventory in exchange for the offered items in the trade. In the case of a gift, this + * will be null. + */ + TArray AcceptedInventoryInstanceIds; + // Player who opened the trade. + FString OfferingPlayerId; + + // Trade identifier. + FString TradeId; + + FAcceptTradeRequest() : + FPlayFabBaseModel(), + AcceptedInventoryInstanceIds(), + OfferingPlayerId(), + TradeId() + {} + + FAcceptTradeRequest(const FAcceptTradeRequest& src) : + FPlayFabBaseModel(), + AcceptedInventoryInstanceIds(src.AcceptedInventoryInstanceIds), + OfferingPlayerId(src.OfferingPlayerId), + TradeId(src.TradeId) + {} + + FAcceptTradeRequest(const TSharedPtr& obj) : FAcceptTradeRequest() + { + readFromValue(obj); + } + + ~FAcceptTradeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum TradeStatus + { + TradeStatusInvalid, + TradeStatusOpening, + TradeStatusOpen, + TradeStatusAccepting, + TradeStatusAccepted, + TradeStatusFilled, + TradeStatusCancelled + }; + + PLAYFABCPP_API void writeTradeStatusEnumJSON(TradeStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API TradeStatus readTradeStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API TradeStatus readTradeStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FTradeInfo : public FPlayFabBaseModel + { + // [optional] Item instances from the accepting player that are used to fulfill the trade. If null, no one has accepted the trade. + TArray AcceptedInventoryInstanceIds; + // [optional] The PlayFab ID of the player who accepted the trade. If null, no one has accepted the trade. + FString AcceptedPlayerId; + + // [optional] An optional list of players allowed to complete this trade. If null, anybody can complete the trade. + TArray AllowedPlayerIds; + // [optional] If set, The UTC time when this trade was canceled. + Boxed CancelledAt; + + // [optional] If set, The UTC time when this trade was fulfilled. + Boxed FilledAt; + + // [optional] If set, The UTC time when this trade was made invalid. + Boxed InvalidatedAt; + + // [optional] The catalogItem Ids of the item instances being offered. + TArray OfferedCatalogItemIds; + // [optional] The itemInstance Ids that are being offered. + TArray OfferedInventoryInstanceIds; + // [optional] The PlayFabId for the offering player. + FString OfferingPlayerId; + + // [optional] The UTC time when this trade was created. + Boxed OpenedAt; + + // [optional] The catalogItem Ids requested in exchange. + TArray RequestedCatalogItemIds; + // [optional] Describes the current state of this trade. + Boxed Status; + + // [optional] The identifier for this trade. + FString TradeId; + + FTradeInfo() : + FPlayFabBaseModel(), + AcceptedInventoryInstanceIds(), + AcceptedPlayerId(), + AllowedPlayerIds(), + CancelledAt(), + FilledAt(), + InvalidatedAt(), + OfferedCatalogItemIds(), + OfferedInventoryInstanceIds(), + OfferingPlayerId(), + OpenedAt(), + RequestedCatalogItemIds(), + Status(), + TradeId() + {} + + FTradeInfo(const FTradeInfo& src) : + FPlayFabBaseModel(), + AcceptedInventoryInstanceIds(src.AcceptedInventoryInstanceIds), + AcceptedPlayerId(src.AcceptedPlayerId), + AllowedPlayerIds(src.AllowedPlayerIds), + CancelledAt(src.CancelledAt), + FilledAt(src.FilledAt), + InvalidatedAt(src.InvalidatedAt), + OfferedCatalogItemIds(src.OfferedCatalogItemIds), + OfferedInventoryInstanceIds(src.OfferedInventoryInstanceIds), + OfferingPlayerId(src.OfferingPlayerId), + OpenedAt(src.OpenedAt), + RequestedCatalogItemIds(src.RequestedCatalogItemIds), + Status(src.Status), + TradeId(src.TradeId) + {} + + FTradeInfo(const TSharedPtr& obj) : FTradeInfo() + { + readFromValue(obj); + } + + ~FTradeInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAcceptTradeResponse : public FPlayFabBaseModel + { + // [optional] Details about trade which was just accepted. + TSharedPtr Trade; + + FAcceptTradeResponse() : + FPlayFabBaseModel(), + Trade(nullptr) + {} + + FAcceptTradeResponse(const FAcceptTradeResponse& src) : + FPlayFabBaseModel(), + Trade(src.Trade.IsValid() ? MakeShareable(new FTradeInfo(*src.Trade)) : nullptr) + {} + + FAcceptTradeResponse(const TSharedPtr& obj) : FAcceptTradeResponse() + { + readFromValue(obj); + } + + ~FAcceptTradeResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAdCampaignAttributionModel : public FPlayFabBaseModel + { + // UTC time stamp of attribution + FDateTime AttributedAt; + + // [optional] Attribution campaign identifier + FString CampaignId; + + // [optional] Attribution network name + FString Platform; + + FAdCampaignAttributionModel() : + FPlayFabBaseModel(), + AttributedAt(0), + CampaignId(), + Platform() + {} + + FAdCampaignAttributionModel(const FAdCampaignAttributionModel& src) : + FPlayFabBaseModel(), + AttributedAt(src.AttributedAt), + CampaignId(src.CampaignId), + Platform(src.Platform) + {} + + FAdCampaignAttributionModel(const TSharedPtr& obj) : FAdCampaignAttributionModel() + { + readFromValue(obj); + } + + ~FAdCampaignAttributionModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddFriendRequest : public FPlayFabBaseModel + { + // [optional] Email address of the user to attempt to add to the local user's friend list. + FString FriendEmail; + + // [optional] PlayFab identifier of the user to attempt to add to the local user's friend list. + FString FriendPlayFabId; + + // [optional] Title-specific display name of the user to attempt to add to the local user's friend list. + FString FriendTitleDisplayName; + + // [optional] PlayFab username of the user to attempt to add to the local user's friend list. + FString FriendUsername; + + FAddFriendRequest() : + FPlayFabBaseModel(), + FriendEmail(), + FriendPlayFabId(), + FriendTitleDisplayName(), + FriendUsername() + {} + + FAddFriendRequest(const FAddFriendRequest& src) : + FPlayFabBaseModel(), + FriendEmail(src.FriendEmail), + FriendPlayFabId(src.FriendPlayFabId), + FriendTitleDisplayName(src.FriendTitleDisplayName), + FriendUsername(src.FriendUsername) + {} + + FAddFriendRequest(const TSharedPtr& obj) : FAddFriendRequest() + { + readFromValue(obj); + } + + ~FAddFriendRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddFriendResult : public FPlayFabBaseModel + { + // True if the friend request was processed successfully. + bool Created; + + FAddFriendResult() : + FPlayFabBaseModel(), + Created(false) + {} + + FAddFriendResult(const FAddFriendResult& src) : + FPlayFabBaseModel(), + Created(src.Created) + {} + + FAddFriendResult(const TSharedPtr& obj) : FAddFriendResult() + { + readFromValue(obj); + } + + ~FAddFriendResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGenericServiceId : public FPlayFabBaseModel + { + // Name of the service for which the player has a unique identifier. + FString ServiceName; + + // Unique identifier of the player in that service. + FString UserId; + + FGenericServiceId() : + FPlayFabBaseModel(), + ServiceName(), + UserId() + {} + + FGenericServiceId(const FGenericServiceId& src) : + FPlayFabBaseModel(), + ServiceName(src.ServiceName), + UserId(src.UserId) + {} + + FGenericServiceId(const TSharedPtr& obj) : FGenericServiceId() + { + readFromValue(obj); + } + + ~FGenericServiceId(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddGenericIDRequest : public FPlayFabBaseModel + { + // Generic service identifier to add to the player account. + FGenericServiceId GenericId; + + FAddGenericIDRequest() : + FPlayFabBaseModel(), + GenericId() + {} + + FAddGenericIDRequest(const FAddGenericIDRequest& src) : + FPlayFabBaseModel(), + GenericId(src.GenericId) + {} + + FAddGenericIDRequest(const TSharedPtr& obj) : FAddGenericIDRequest() + { + readFromValue(obj); + } + + ~FAddGenericIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddGenericIDResult : public FPlayFabBaseModel + { + FAddGenericIDResult() : + FPlayFabBaseModel() + {} + + FAddGenericIDResult(const FAddGenericIDResult& src) : + FPlayFabBaseModel() + {} + + FAddGenericIDResult(const TSharedPtr& obj) : FAddGenericIDResult() + { + readFromValue(obj); + } + + ~FAddGenericIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddOrUpdateContactEmailRequest : public FPlayFabBaseModel + { + // The new contact email to associate with the player. + FString EmailAddress; + + FAddOrUpdateContactEmailRequest() : + FPlayFabBaseModel(), + EmailAddress() + {} + + FAddOrUpdateContactEmailRequest(const FAddOrUpdateContactEmailRequest& src) : + FPlayFabBaseModel(), + EmailAddress(src.EmailAddress) + {} + + FAddOrUpdateContactEmailRequest(const TSharedPtr& obj) : FAddOrUpdateContactEmailRequest() + { + readFromValue(obj); + } + + ~FAddOrUpdateContactEmailRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddOrUpdateContactEmailResult : public FPlayFabBaseModel + { + FAddOrUpdateContactEmailResult() : + FPlayFabBaseModel() + {} + + FAddOrUpdateContactEmailResult(const FAddOrUpdateContactEmailResult& src) : + FPlayFabBaseModel() + {} + + FAddOrUpdateContactEmailResult(const TSharedPtr& obj) : FAddOrUpdateContactEmailResult() + { + readFromValue(obj); + } + + ~FAddOrUpdateContactEmailResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddSharedGroupMembersRequest : public FPlayFabBaseModel + { + // An array of unique PlayFab assigned ID of the user on whom the operation will be performed. + TArray PlayFabIds; + // Unique identifier for the shared group. + FString SharedGroupId; + + FAddSharedGroupMembersRequest() : + FPlayFabBaseModel(), + PlayFabIds(), + SharedGroupId() + {} + + FAddSharedGroupMembersRequest(const FAddSharedGroupMembersRequest& src) : + FPlayFabBaseModel(), + PlayFabIds(src.PlayFabIds), + SharedGroupId(src.SharedGroupId) + {} + + FAddSharedGroupMembersRequest(const TSharedPtr& obj) : FAddSharedGroupMembersRequest() + { + readFromValue(obj); + } + + ~FAddSharedGroupMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddSharedGroupMembersResult : public FPlayFabBaseModel + { + FAddSharedGroupMembersResult() : + FPlayFabBaseModel() + {} + + FAddSharedGroupMembersResult(const FAddSharedGroupMembersResult& src) : + FPlayFabBaseModel() + {} + + FAddSharedGroupMembersResult(const TSharedPtr& obj) : FAddSharedGroupMembersResult() + { + readFromValue(obj); + } + + ~FAddSharedGroupMembersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddUsernamePasswordRequest : public FPlayFabBaseModel + { + // User email address attached to their account + FString Email; + + // Password for the PlayFab account (6-100 characters) + FString Password; + + // PlayFab username for the account (3-20 characters) + FString Username; + + FAddUsernamePasswordRequest() : + FPlayFabBaseModel(), + Email(), + Password(), + Username() + {} + + FAddUsernamePasswordRequest(const FAddUsernamePasswordRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + Password(src.Password), + Username(src.Username) + {} + + FAddUsernamePasswordRequest(const TSharedPtr& obj) : FAddUsernamePasswordRequest() + { + readFromValue(obj); + } + + ~FAddUsernamePasswordRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddUsernamePasswordResult : public FPlayFabBaseModel + { + // [optional] PlayFab unique user name. + FString Username; + + FAddUsernamePasswordResult() : + FPlayFabBaseModel(), + Username() + {} + + FAddUsernamePasswordResult(const FAddUsernamePasswordResult& src) : + FPlayFabBaseModel(), + Username(src.Username) + {} + + FAddUsernamePasswordResult(const TSharedPtr& obj) : FAddUsernamePasswordResult() + { + readFromValue(obj); + } + + ~FAddUsernamePasswordResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddUserVirtualCurrencyRequest : public FPlayFabBaseModel + { + // Amount to be added to the user balance of the specified virtual currency. + int32 Amount; + + // Name of the virtual currency which is to be incremented. + FString VirtualCurrency; + + FAddUserVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + VirtualCurrency() + {} + + FAddUserVirtualCurrencyRequest(const FAddUserVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + VirtualCurrency(src.VirtualCurrency) + {} + + FAddUserVirtualCurrencyRequest(const TSharedPtr& obj) : FAddUserVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FAddUserVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAndroidDevicePushNotificationRegistrationRequest : public FPlayFabBaseModel + { + // [optional] Message to display when confirming push notification. + FString ConfirmationMessage; + + /** + * Registration ID provided by the Google Cloud Messaging service when the title registered to receive push notifications + * (see the GCM documentation, here: http://developer.android.com/google/gcm/client.html). + */ + FString DeviceToken; + + // [optional] If true, send a test push message immediately after sucessful registration. Defaults to false. + Boxed SendPushNotificationConfirmation; + + FAndroidDevicePushNotificationRegistrationRequest() : + FPlayFabBaseModel(), + ConfirmationMessage(), + DeviceToken(), + SendPushNotificationConfirmation() + {} + + FAndroidDevicePushNotificationRegistrationRequest(const FAndroidDevicePushNotificationRegistrationRequest& src) : + FPlayFabBaseModel(), + ConfirmationMessage(src.ConfirmationMessage), + DeviceToken(src.DeviceToken), + SendPushNotificationConfirmation(src.SendPushNotificationConfirmation) + {} + + FAndroidDevicePushNotificationRegistrationRequest(const TSharedPtr& obj) : FAndroidDevicePushNotificationRegistrationRequest() + { + readFromValue(obj); + } + + ~FAndroidDevicePushNotificationRegistrationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAndroidDevicePushNotificationRegistrationResult : public FPlayFabBaseModel + { + FAndroidDevicePushNotificationRegistrationResult() : + FPlayFabBaseModel() + {} + + FAndroidDevicePushNotificationRegistrationResult(const FAndroidDevicePushNotificationRegistrationResult& src) : + FPlayFabBaseModel() + {} + + FAndroidDevicePushNotificationRegistrationResult(const TSharedPtr& obj) : FAndroidDevicePushNotificationRegistrationResult() + { + readFromValue(obj); + } + + ~FAndroidDevicePushNotificationRegistrationResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAttributeInstallRequest : public FPlayFabBaseModel + { + // [optional] The adid for this device. + FString Adid; + + // [optional] The IdentifierForAdvertisers for iOS Devices. + FString Idfa; + + FAttributeInstallRequest() : + FPlayFabBaseModel(), + Adid(), + Idfa() + {} + + FAttributeInstallRequest(const FAttributeInstallRequest& src) : + FPlayFabBaseModel(), + Adid(src.Adid), + Idfa(src.Idfa) + {} + + FAttributeInstallRequest(const TSharedPtr& obj) : FAttributeInstallRequest() + { + readFromValue(obj); + } + + ~FAttributeInstallRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAttributeInstallResult : public FPlayFabBaseModel + { + FAttributeInstallResult() : + FPlayFabBaseModel() + {} + + FAttributeInstallResult(const FAttributeInstallResult& src) : + FPlayFabBaseModel() + {} + + FAttributeInstallResult(const TSharedPtr& obj) : FAttributeInstallResult() + { + readFromValue(obj); + } + + ~FAttributeInstallResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCancelTradeRequest : public FPlayFabBaseModel + { + // Trade identifier. + FString TradeId; + + FCancelTradeRequest() : + FPlayFabBaseModel(), + TradeId() + {} + + FCancelTradeRequest(const FCancelTradeRequest& src) : + FPlayFabBaseModel(), + TradeId(src.TradeId) + {} + + FCancelTradeRequest(const TSharedPtr& obj) : FCancelTradeRequest() + { + readFromValue(obj); + } + + ~FCancelTradeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCancelTradeResponse : public FPlayFabBaseModel + { + // [optional] Details about trade which was just canceled. + TSharedPtr Trade; + + FCancelTradeResponse() : + FPlayFabBaseModel(), + Trade(nullptr) + {} + + FCancelTradeResponse(const FCancelTradeResponse& src) : + FPlayFabBaseModel(), + Trade(src.Trade.IsValid() ? MakeShareable(new FTradeInfo(*src.Trade)) : nullptr) + {} + + FCancelTradeResponse(const TSharedPtr& obj) : FCancelTradeResponse() + { + readFromValue(obj); + } + + ~FCancelTradeResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCartItem : public FPlayFabBaseModel + { + // [optional] Description of the catalog item. + FString Description; + + // [optional] Display name for the catalog item. + FString DisplayName; + + // [optional] Class name to which catalog item belongs. + FString ItemClass; + + // [optional] Unique identifier for the catalog item. + FString ItemId; + + // [optional] Unique instance identifier for this catalog item. + FString ItemInstanceId; + + // [optional] Cost of the catalog item for each applicable real world currency. + TMap RealCurrencyPrices; + // [optional] Amount of each applicable virtual currency which will be received as a result of purchasing this catalog item. + TMap VCAmount; + // [optional] Cost of the catalog item for each applicable virtual currency. + TMap VirtualCurrencyPrices; + FCartItem() : + FPlayFabBaseModel(), + Description(), + DisplayName(), + ItemClass(), + ItemId(), + ItemInstanceId(), + RealCurrencyPrices(), + VCAmount(), + VirtualCurrencyPrices() + {} + + FCartItem(const FCartItem& src) : + FPlayFabBaseModel(), + Description(src.Description), + DisplayName(src.DisplayName), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + RealCurrencyPrices(src.RealCurrencyPrices), + VCAmount(src.VCAmount), + VirtualCurrencyPrices(src.VirtualCurrencyPrices) + {} + + FCartItem(const TSharedPtr& obj) : FCartItem() + { + readFromValue(obj); + } + + ~FCartItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemBundleInfo : public FPlayFabBaseModel + { + // [optional] unique ItemId values for all items which will be added to the player inventory when the bundle is added + TArray BundledItems; + /** + * [optional] unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and + * add the relevant items to the player inventory when the bundle is added) + */ + TArray BundledResultTables; + // [optional] virtual currency types and balances which will be added to the player inventory when the bundle is added + TMap BundledVirtualCurrencies; + FCatalogItemBundleInfo() : + FPlayFabBaseModel(), + BundledItems(), + BundledResultTables(), + BundledVirtualCurrencies() + {} + + FCatalogItemBundleInfo(const FCatalogItemBundleInfo& src) : + FPlayFabBaseModel(), + BundledItems(src.BundledItems), + BundledResultTables(src.BundledResultTables), + BundledVirtualCurrencies(src.BundledVirtualCurrencies) + {} + + FCatalogItemBundleInfo(const TSharedPtr& obj) : FCatalogItemBundleInfo() + { + readFromValue(obj); + } + + ~FCatalogItemBundleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemConsumableInfo : public FPlayFabBaseModel + { + // [optional] number of times this object can be used, after which it will be removed from the player inventory + Boxed UsageCount; + + /** + * [optional] duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed + * (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on + * this item's details have completed) + */ + Boxed UsagePeriod; + + /** + * [optional] all inventory item instances in the player inventory sharing a non-null UsagePeriodGroup have their UsagePeriod values + * added together, and share the result - when that period has elapsed, all the items in the group will be removed + */ + FString UsagePeriodGroup; + + FCatalogItemConsumableInfo() : + FPlayFabBaseModel(), + UsageCount(), + UsagePeriod(), + UsagePeriodGroup() + {} + + FCatalogItemConsumableInfo(const FCatalogItemConsumableInfo& src) : + FPlayFabBaseModel(), + UsageCount(src.UsageCount), + UsagePeriod(src.UsagePeriod), + UsagePeriodGroup(src.UsagePeriodGroup) + {} + + FCatalogItemConsumableInfo(const TSharedPtr& obj) : FCatalogItemConsumableInfo() + { + readFromValue(obj); + } + + ~FCatalogItemConsumableInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemContainerInfo : public FPlayFabBaseModel + { + // [optional] unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked + TArray ItemContents; + /** + * [optional] ItemId for the catalog item used to unlock the container, if any (if not specified, a call to UnlockContainerItem will + * open the container, adding the contents to the player inventory and currency balances) + */ + FString KeyItemId; + + /** + * [optional] unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables + * will be resolved and add the relevant items to the player inventory) + */ + TArray ResultTableContents; + // [optional] virtual currency types and balances which will be added to the player inventory when the container is unlocked + TMap VirtualCurrencyContents; + FCatalogItemContainerInfo() : + FPlayFabBaseModel(), + ItemContents(), + KeyItemId(), + ResultTableContents(), + VirtualCurrencyContents() + {} + + FCatalogItemContainerInfo(const FCatalogItemContainerInfo& src) : + FPlayFabBaseModel(), + ItemContents(src.ItemContents), + KeyItemId(src.KeyItemId), + ResultTableContents(src.ResultTableContents), + VirtualCurrencyContents(src.VirtualCurrencyContents) + {} + + FCatalogItemContainerInfo(const TSharedPtr& obj) : FCatalogItemContainerInfo() + { + readFromValue(obj); + } + + ~FCatalogItemContainerInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItem : public FPlayFabBaseModel + { + /** + * [optional] defines the bundle properties for the item - bundles are items which contain other items, including random drop tables + * and virtual currencies + */ + TSharedPtr Bundle; + + // if true, then an item instance of this type can be used to grant a character to a user. + bool CanBecomeCharacter; + + // [optional] catalog version for this item + FString CatalogVersion; + + // [optional] defines the consumable properties (number of uses, timeout) for the item + TSharedPtr Consumable; + + /** + * [optional] defines the container properties for the item - what items it contains, including random drop tables and virtual + * currencies, and what item (if any) is required to open it via the UnlockContainerItem API + */ + TSharedPtr Container; + + // [optional] game specific custom data + FString CustomData; + + // [optional] text description of item, to show in-game + FString Description; + + // [optional] text name for the item, to show in-game + FString DisplayName; + + /** + * If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited + * edition item, this value determines the total number of instances to allocate for the title. Once this limit has been + * reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of + * false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less + * than zero, it will be ignored. + */ + int32 InitialLimitedEditionCount; + + // BETA: If true, then only a fixed number can ever be granted. + bool IsLimitedEdition; + + /** + * if true, then only one item instance of this type will exist and its remaininguses will be incremented instead. + * RemainingUses will cap out at Int32.Max (2,147,483,647). All subsequent increases will be discarded + */ + bool IsStackable; + + // if true, then an item instance of this type can be traded between players using the trading APIs + bool IsTradable; + + // [optional] class to which the item belongs + FString ItemClass; + + // unique identifier for this item + FString ItemId; + + /** + * [optional] URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP + * URL. + */ + FString ItemImageUrl; + + // [optional] override prices for this item for specific currencies + TMap RealCurrencyPrices; + // [optional] list of item tags + TArray Tags; + // [optional] price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + TMap VirtualCurrencyPrices; + FCatalogItem() : + FPlayFabBaseModel(), + Bundle(nullptr), + CanBecomeCharacter(false), + CatalogVersion(), + Consumable(nullptr), + Container(nullptr), + CustomData(), + Description(), + DisplayName(), + InitialLimitedEditionCount(0), + IsLimitedEdition(false), + IsStackable(false), + IsTradable(false), + ItemClass(), + ItemId(), + ItemImageUrl(), + RealCurrencyPrices(), + Tags(), + VirtualCurrencyPrices() + {} + + FCatalogItem(const FCatalogItem& src) : + FPlayFabBaseModel(), + Bundle(src.Bundle.IsValid() ? MakeShareable(new FCatalogItemBundleInfo(*src.Bundle)) : nullptr), + CanBecomeCharacter(src.CanBecomeCharacter), + CatalogVersion(src.CatalogVersion), + Consumable(src.Consumable.IsValid() ? MakeShareable(new FCatalogItemConsumableInfo(*src.Consumable)) : nullptr), + Container(src.Container.IsValid() ? MakeShareable(new FCatalogItemContainerInfo(*src.Container)) : nullptr), + CustomData(src.CustomData), + Description(src.Description), + DisplayName(src.DisplayName), + InitialLimitedEditionCount(src.InitialLimitedEditionCount), + IsLimitedEdition(src.IsLimitedEdition), + IsStackable(src.IsStackable), + IsTradable(src.IsTradable), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemImageUrl(src.ItemImageUrl), + RealCurrencyPrices(src.RealCurrencyPrices), + Tags(src.Tags), + VirtualCurrencyPrices(src.VirtualCurrencyPrices) + {} + + FCatalogItem(const TSharedPtr& obj) : FCatalogItem() + { + readFromValue(obj); + } + + ~FCatalogItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemInstance : public FPlayFabBaseModel + { + // [optional] Game specific comment associated with this instance when it was added to the user inventory. + FString Annotation; + + // [optional] Array of unique items that were awarded when this catalog item was purchased. + TArray BundleContents; + /** + * [optional] Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or + * container. + */ + FString BundleParent; + + // [optional] Catalog version for the inventory item, when this instance was created. + FString CatalogVersion; + + // [optional] A set of custom key-value pairs on the inventory item. + TMap CustomData; + // [optional] CatalogItem.DisplayName at the time this item was purchased. + FString DisplayName; + + // [optional] Timestamp for when this instance will expire. + Boxed Expiration; + + // [optional] Class name for the inventory item, as defined in the catalog. + FString ItemClass; + + // [optional] Unique identifier for the inventory item, as defined in the catalog. + FString ItemId; + + // [optional] Unique item identifier for this specific instance of the item. + FString ItemInstanceId; + + // [optional] Timestamp for when this instance was purchased. + Boxed PurchaseDate; + + // [optional] Total number of remaining uses, if this is a consumable item. + Boxed RemainingUses; + + // [optional] Currency type for the cost of the catalog item. + FString UnitCurrency; + + // Cost of the catalog item in the given currency. + uint32 UnitPrice; + + // [optional] The number of uses that were added or removed to this item in this call. + Boxed UsesIncrementedBy; + + FItemInstance() : + FPlayFabBaseModel(), + Annotation(), + BundleContents(), + BundleParent(), + CatalogVersion(), + CustomData(), + DisplayName(), + Expiration(), + ItemClass(), + ItemId(), + ItemInstanceId(), + PurchaseDate(), + RemainingUses(), + UnitCurrency(), + UnitPrice(0), + UsesIncrementedBy() + {} + + FItemInstance(const FItemInstance& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + BundleContents(src.BundleContents), + BundleParent(src.BundleParent), + CatalogVersion(src.CatalogVersion), + CustomData(src.CustomData), + DisplayName(src.DisplayName), + Expiration(src.Expiration), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + PurchaseDate(src.PurchaseDate), + RemainingUses(src.RemainingUses), + UnitCurrency(src.UnitCurrency), + UnitPrice(src.UnitPrice), + UsesIncrementedBy(src.UsesIncrementedBy) + {} + + FItemInstance(const TSharedPtr& obj) : FItemInstance() + { + readFromValue(obj); + } + + ~FItemInstance(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCharacterInventory : public FPlayFabBaseModel + { + // [optional] The id of this character. + FString CharacterId; + + // [optional] The inventory of this character. + TArray Inventory; + FCharacterInventory() : + FPlayFabBaseModel(), + CharacterId(), + Inventory() + {} + + FCharacterInventory(const FCharacterInventory& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Inventory(src.Inventory) + {} + + FCharacterInventory(const TSharedPtr& obj) : FCharacterInventory() + { + readFromValue(obj); + } + + ~FCharacterInventory(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCharacterLeaderboardEntry : public FPlayFabBaseModel + { + // [optional] PlayFab unique identifier of the character that belongs to the user for this leaderboard entry. + FString CharacterId; + + // [optional] Title-specific display name of the character for this leaderboard entry. + FString CharacterName; + + // [optional] Name of the character class for this entry. + FString CharacterType; + + // [optional] Title-specific display name of the user for this leaderboard entry. + FString DisplayName; + + // [optional] PlayFab unique identifier of the user for this leaderboard entry. + FString PlayFabId; + + // User's overall position in the leaderboard. + int32 Position; + + // Specific value of the user's statistic. + int32 StatValue; + + FCharacterLeaderboardEntry() : + FPlayFabBaseModel(), + CharacterId(), + CharacterName(), + CharacterType(), + DisplayName(), + PlayFabId(), + Position(0), + StatValue(0) + {} + + FCharacterLeaderboardEntry(const FCharacterLeaderboardEntry& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterName(src.CharacterName), + CharacterType(src.CharacterType), + DisplayName(src.DisplayName), + PlayFabId(src.PlayFabId), + Position(src.Position), + StatValue(src.StatValue) + {} + + FCharacterLeaderboardEntry(const TSharedPtr& obj) : FCharacterLeaderboardEntry() + { + readFromValue(obj); + } + + ~FCharacterLeaderboardEntry(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCharacterResult : public FPlayFabBaseModel + { + // [optional] The id for this character on this player. + FString CharacterId; + + // [optional] The name of this character. + FString CharacterName; + + // [optional] The type-string that was given to this character on creation. + FString CharacterType; + + FCharacterResult() : + FPlayFabBaseModel(), + CharacterId(), + CharacterName(), + CharacterType() + {} + + FCharacterResult(const FCharacterResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterName(src.CharacterName), + CharacterType(src.CharacterType) + {} + + FCharacterResult(const TSharedPtr& obj) : FCharacterResult() + { + readFromValue(obj); + } + + ~FCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum CloudScriptRevisionOption + { + CloudScriptRevisionOptionLive, + CloudScriptRevisionOptionLatest, + CloudScriptRevisionOptionSpecific + }; + + PLAYFABCPP_API void writeCloudScriptRevisionOptionEnumJSON(CloudScriptRevisionOption enumVal, JsonWriter& writer); + PLAYFABCPP_API CloudScriptRevisionOption readCloudScriptRevisionOptionFromValue(const TSharedPtr& value); + PLAYFABCPP_API CloudScriptRevisionOption readCloudScriptRevisionOptionFromValue(const FString& value); + + struct PLAYFABCPP_API FContainer_Dictionary_String_String : public FPlayFabBaseModel + { + // [optional] Content of data + TMap Data; + FContainer_Dictionary_String_String() : + FPlayFabBaseModel(), + Data() + {} + + FContainer_Dictionary_String_String(const FContainer_Dictionary_String_String& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FContainer_Dictionary_String_String(const TSharedPtr& obj) : FContainer_Dictionary_String_String() + { + readFromValue(obj); + } + + ~FContainer_Dictionary_String_String(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCollectionFilter : public FPlayFabBaseModel + { + // [optional] List of Exclude rules, with any of which if a collection matches, it is excluded by the filter. + TArray Excludes; + /** + * [optional] List of Include rules, with any of which if a collection matches, it is included by the filter, unless it is excluded by + * one of the Exclude rule + */ + TArray Includes; + FCollectionFilter() : + FPlayFabBaseModel(), + Excludes(), + Includes() + {} + + FCollectionFilter(const FCollectionFilter& src) : + FPlayFabBaseModel(), + Excludes(src.Excludes), + Includes(src.Includes) + {} + + FCollectionFilter(const TSharedPtr& obj) : FCollectionFilter() + { + readFromValue(obj); + } + + ~FCollectionFilter(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConfirmPurchaseRequest : public FPlayFabBaseModel + { + // Purchase order identifier returned from StartPurchase. + FString OrderId; + + FConfirmPurchaseRequest() : + FPlayFabBaseModel(), + OrderId() + {} + + FConfirmPurchaseRequest(const FConfirmPurchaseRequest& src) : + FPlayFabBaseModel(), + OrderId(src.OrderId) + {} + + FConfirmPurchaseRequest(const TSharedPtr& obj) : FConfirmPurchaseRequest() + { + readFromValue(obj); + } + + ~FConfirmPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConfirmPurchaseResult : public FPlayFabBaseModel + { + // [optional] Array of items purchased. + TArray Items; + // [optional] Purchase order identifier. + FString OrderId; + + // Date and time of the purchase. + FDateTime PurchaseDate; + + FConfirmPurchaseResult() : + FPlayFabBaseModel(), + Items(), + OrderId(), + PurchaseDate(0) + {} + + FConfirmPurchaseResult(const FConfirmPurchaseResult& src) : + FPlayFabBaseModel(), + Items(src.Items), + OrderId(src.OrderId), + PurchaseDate(src.PurchaseDate) + {} + + FConfirmPurchaseResult(const TSharedPtr& obj) : FConfirmPurchaseResult() + { + readFromValue(obj); + } + + ~FConfirmPurchaseResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConsumeItemRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Number of uses to consume from the item. + int32 ConsumeCount; + + // Unique instance identifier of the item to be consumed. + FString ItemInstanceId; + + FConsumeItemRequest() : + FPlayFabBaseModel(), + CharacterId(), + ConsumeCount(0), + ItemInstanceId() + {} + + FConsumeItemRequest(const FConsumeItemRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ConsumeCount(src.ConsumeCount), + ItemInstanceId(src.ItemInstanceId) + {} + + FConsumeItemRequest(const TSharedPtr& obj) : FConsumeItemRequest() + { + readFromValue(obj); + } + + ~FConsumeItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConsumeItemResult : public FPlayFabBaseModel + { + // [optional] Unique instance identifier of the item with uses consumed. + FString ItemInstanceId; + + // Number of uses remaining on the item. + int32 RemainingUses; + + FConsumeItemResult() : + FPlayFabBaseModel(), + ItemInstanceId(), + RemainingUses(0) + {} + + FConsumeItemResult(const FConsumeItemResult& src) : + FPlayFabBaseModel(), + ItemInstanceId(src.ItemInstanceId), + RemainingUses(src.RemainingUses) + {} + + FConsumeItemResult(const TSharedPtr& obj) : FConsumeItemResult() + { + readFromValue(obj); + } + + ~FConsumeItemResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConsumeXboxEntitlementsRequest : public FPlayFabBaseModel + { + // [optional] Catalog version to use + FString CatalogVersion; + + // Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + FString XboxToken; + + FConsumeXboxEntitlementsRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + XboxToken() + {} + + FConsumeXboxEntitlementsRequest(const FConsumeXboxEntitlementsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + XboxToken(src.XboxToken) + {} + + FConsumeXboxEntitlementsRequest(const TSharedPtr& obj) : FConsumeXboxEntitlementsRequest() + { + readFromValue(obj); + } + + ~FConsumeXboxEntitlementsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConsumeXboxEntitlementsResult : public FPlayFabBaseModel + { + // [optional] Details for the items purchased. + TArray Items; + FConsumeXboxEntitlementsResult() : + FPlayFabBaseModel(), + Items() + {} + + FConsumeXboxEntitlementsResult(const FConsumeXboxEntitlementsResult& src) : + FPlayFabBaseModel(), + Items(src.Items) + {} + + FConsumeXboxEntitlementsResult(const TSharedPtr& obj) : FConsumeXboxEntitlementsResult() + { + readFromValue(obj); + } + + ~FConsumeXboxEntitlementsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum EmailVerificationStatus + { + EmailVerificationStatusUnverified, + EmailVerificationStatusPending, + EmailVerificationStatusConfirmed + }; + + PLAYFABCPP_API void writeEmailVerificationStatusEnumJSON(EmailVerificationStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API EmailVerificationStatus readEmailVerificationStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API EmailVerificationStatus readEmailVerificationStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FContactEmailInfoModel : public FPlayFabBaseModel + { + // [optional] The email address + FString EmailAddress; + + // [optional] The name of the email info data + FString Name; + + // [optional] The verification status of the email + Boxed VerificationStatus; + + FContactEmailInfoModel() : + FPlayFabBaseModel(), + EmailAddress(), + Name(), + VerificationStatus() + {} + + FContactEmailInfoModel(const FContactEmailInfoModel& src) : + FPlayFabBaseModel(), + EmailAddress(src.EmailAddress), + Name(src.Name), + VerificationStatus(src.VerificationStatus) + {} + + FContactEmailInfoModel(const TSharedPtr& obj) : FContactEmailInfoModel() + { + readFromValue(obj); + } + + ~FContactEmailInfoModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ContinentCode + { + ContinentCodeAF, + ContinentCodeAN, + ContinentCodeAS, + ContinentCodeEU, + ContinentCodeNA, + ContinentCodeOC, + ContinentCodeSA + }; + + PLAYFABCPP_API void writeContinentCodeEnumJSON(ContinentCode enumVal, JsonWriter& writer); + PLAYFABCPP_API ContinentCode readContinentCodeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ContinentCode readContinentCodeFromValue(const FString& value); + + enum CountryCode + { + CountryCodeAF, + CountryCodeAX, + CountryCodeAL, + CountryCodeDZ, + CountryCodeAS, + CountryCodeAD, + CountryCodeAO, + CountryCodeAI, + CountryCodeAQ, + CountryCodeAG, + CountryCodeAR, + CountryCodeAM, + CountryCodeAW, + CountryCodeAU, + CountryCodeAT, + CountryCodeAZ, + CountryCodeBS, + CountryCodeBH, + CountryCodeBD, + CountryCodeBB, + CountryCodeBY, + CountryCodeBE, + CountryCodeBZ, + CountryCodeBJ, + CountryCodeBM, + CountryCodeBT, + CountryCodeBO, + CountryCodeBQ, + CountryCodeBA, + CountryCodeBW, + CountryCodeBV, + CountryCodeBR, + CountryCodeIO, + CountryCodeBN, + CountryCodeBG, + CountryCodeBF, + CountryCodeBI, + CountryCodeKH, + CountryCodeCM, + CountryCodeCA, + CountryCodeCV, + CountryCodeKY, + CountryCodeCF, + CountryCodeTD, + CountryCodeCL, + CountryCodeCN, + CountryCodeCX, + CountryCodeCC, + CountryCodeCO, + CountryCodeKM, + CountryCodeCG, + CountryCodeCD, + CountryCodeCK, + CountryCodeCR, + CountryCodeCI, + CountryCodeHR, + CountryCodeCU, + CountryCodeCW, + CountryCodeCY, + CountryCodeCZ, + CountryCodeDK, + CountryCodeDJ, + CountryCodeDM, + CountryCodeDO, + CountryCodeEC, + CountryCodeEG, + CountryCodeSV, + CountryCodeGQ, + CountryCodeER, + CountryCodeEE, + CountryCodeET, + CountryCodeFK, + CountryCodeFO, + CountryCodeFJ, + CountryCodeFI, + CountryCodeFR, + CountryCodeGF, + CountryCodePF, + CountryCodeTF, + CountryCodeGA, + CountryCodeGM, + CountryCodeGE, + CountryCodeDE, + CountryCodeGH, + CountryCodeGI, + CountryCodeGR, + CountryCodeGL, + CountryCodeGD, + CountryCodeGP, + CountryCodeGU, + CountryCodeGT, + CountryCodeGG, + CountryCodeGN, + CountryCodeGW, + CountryCodeGY, + CountryCodeHT, + CountryCodeHM, + CountryCodeVA, + CountryCodeHN, + CountryCodeHK, + CountryCodeHU, + CountryCodeIS, + CountryCodeIN, + CountryCodeID, + CountryCodeIR, + CountryCodeIQ, + CountryCodeIE, + CountryCodeIM, + CountryCodeIL, + CountryCodeIT, + CountryCodeJM, + CountryCodeJP, + CountryCodeJE, + CountryCodeJO, + CountryCodeKZ, + CountryCodeKE, + CountryCodeKI, + CountryCodeKP, + CountryCodeKR, + CountryCodeKW, + CountryCodeKG, + CountryCodeLA, + CountryCodeLV, + CountryCodeLB, + CountryCodeLS, + CountryCodeLR, + CountryCodeLY, + CountryCodeLI, + CountryCodeLT, + CountryCodeLU, + CountryCodeMO, + CountryCodeMK, + CountryCodeMG, + CountryCodeMW, + CountryCodeMY, + CountryCodeMV, + CountryCodeML, + CountryCodeMT, + CountryCodeMH, + CountryCodeMQ, + CountryCodeMR, + CountryCodeMU, + CountryCodeYT, + CountryCodeMX, + CountryCodeFM, + CountryCodeMD, + CountryCodeMC, + CountryCodeMN, + CountryCodeME, + CountryCodeMS, + CountryCodeMA, + CountryCodeMZ, + CountryCodeMM, + CountryCodeNA, + CountryCodeNR, + CountryCodeNP, + CountryCodeNL, + CountryCodeNC, + CountryCodeNZ, + CountryCodeNI, + CountryCodeNE, + CountryCodeNG, + CountryCodeNU, + CountryCodeNF, + CountryCodeMP, + CountryCodeNO, + CountryCodeOM, + CountryCodePK, + CountryCodePW, + CountryCodePS, + CountryCodePA, + CountryCodePG, + CountryCodePY, + CountryCodePE, + CountryCodePH, + CountryCodePN, + CountryCodePL, + CountryCodePT, + CountryCodePR, + CountryCodeQA, + CountryCodeRE, + CountryCodeRO, + CountryCodeRU, + CountryCodeRW, + CountryCodeBL, + CountryCodeSH, + CountryCodeKN, + CountryCodeLC, + CountryCodeMF, + CountryCodePM, + CountryCodeVC, + CountryCodeWS, + CountryCodeSM, + CountryCodeST, + CountryCodeSA, + CountryCodeSN, + CountryCodeRS, + CountryCodeSC, + CountryCodeSL, + CountryCodeSG, + CountryCodeSX, + CountryCodeSK, + CountryCodeSI, + CountryCodeSB, + CountryCodeSO, + CountryCodeZA, + CountryCodeGS, + CountryCodeSS, + CountryCodeES, + CountryCodeLK, + CountryCodeSD, + CountryCodeSR, + CountryCodeSJ, + CountryCodeSZ, + CountryCodeSE, + CountryCodeCH, + CountryCodeSY, + CountryCodeTW, + CountryCodeTJ, + CountryCodeTZ, + CountryCodeTH, + CountryCodeTL, + CountryCodeTG, + CountryCodeTK, + CountryCodeTO, + CountryCodeTT, + CountryCodeTN, + CountryCodeTR, + CountryCodeTM, + CountryCodeTC, + CountryCodeTV, + CountryCodeUG, + CountryCodeUA, + CountryCodeAE, + CountryCodeGB, + CountryCodeUS, + CountryCodeUM, + CountryCodeUY, + CountryCodeUZ, + CountryCodeVU, + CountryCodeVE, + CountryCodeVN, + CountryCodeVG, + CountryCodeVI, + CountryCodeWF, + CountryCodeEH, + CountryCodeYE, + CountryCodeZM, + CountryCodeZW + }; + + PLAYFABCPP_API void writeCountryCodeEnumJSON(CountryCode enumVal, JsonWriter& writer); + PLAYFABCPP_API CountryCode readCountryCodeFromValue(const TSharedPtr& value); + PLAYFABCPP_API CountryCode readCountryCodeFromValue(const FString& value); + + struct PLAYFABCPP_API FCreateSharedGroupRequest : public FPlayFabBaseModel + { + // [optional] Unique identifier for the shared group (a random identifier will be assigned, if one is not specified). + FString SharedGroupId; + + FCreateSharedGroupRequest() : + FPlayFabBaseModel(), + SharedGroupId() + {} + + FCreateSharedGroupRequest(const FCreateSharedGroupRequest& src) : + FPlayFabBaseModel(), + SharedGroupId(src.SharedGroupId) + {} + + FCreateSharedGroupRequest(const TSharedPtr& obj) : FCreateSharedGroupRequest() + { + readFromValue(obj); + } + + ~FCreateSharedGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateSharedGroupResult : public FPlayFabBaseModel + { + // [optional] Unique identifier for the shared group. + FString SharedGroupId; + + FCreateSharedGroupResult() : + FPlayFabBaseModel(), + SharedGroupId() + {} + + FCreateSharedGroupResult(const FCreateSharedGroupResult& src) : + FPlayFabBaseModel(), + SharedGroupId(src.SharedGroupId) + {} + + FCreateSharedGroupResult(const TSharedPtr& obj) : FCreateSharedGroupResult() + { + readFromValue(obj); + } + + ~FCreateSharedGroupResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum Currency + { + CurrencyAED, + CurrencyAFN, + CurrencyALL, + CurrencyAMD, + CurrencyANG, + CurrencyAOA, + CurrencyARS, + CurrencyAUD, + CurrencyAWG, + CurrencyAZN, + CurrencyBAM, + CurrencyBBD, + CurrencyBDT, + CurrencyBGN, + CurrencyBHD, + CurrencyBIF, + CurrencyBMD, + CurrencyBND, + CurrencyBOB, + CurrencyBRL, + CurrencyBSD, + CurrencyBTN, + CurrencyBWP, + CurrencyBYR, + CurrencyBZD, + CurrencyCAD, + CurrencyCDF, + CurrencyCHF, + CurrencyCLP, + CurrencyCNY, + CurrencyCOP, + CurrencyCRC, + CurrencyCUC, + CurrencyCUP, + CurrencyCVE, + CurrencyCZK, + CurrencyDJF, + CurrencyDKK, + CurrencyDOP, + CurrencyDZD, + CurrencyEGP, + CurrencyERN, + CurrencyETB, + CurrencyEUR, + CurrencyFJD, + CurrencyFKP, + CurrencyGBP, + CurrencyGEL, + CurrencyGGP, + CurrencyGHS, + CurrencyGIP, + CurrencyGMD, + CurrencyGNF, + CurrencyGTQ, + CurrencyGYD, + CurrencyHKD, + CurrencyHNL, + CurrencyHRK, + CurrencyHTG, + CurrencyHUF, + CurrencyIDR, + CurrencyILS, + CurrencyIMP, + CurrencyINR, + CurrencyIQD, + CurrencyIRR, + CurrencyISK, + CurrencyJEP, + CurrencyJMD, + CurrencyJOD, + CurrencyJPY, + CurrencyKES, + CurrencyKGS, + CurrencyKHR, + CurrencyKMF, + CurrencyKPW, + CurrencyKRW, + CurrencyKWD, + CurrencyKYD, + CurrencyKZT, + CurrencyLAK, + CurrencyLBP, + CurrencyLKR, + CurrencyLRD, + CurrencyLSL, + CurrencyLYD, + CurrencyMAD, + CurrencyMDL, + CurrencyMGA, + CurrencyMKD, + CurrencyMMK, + CurrencyMNT, + CurrencyMOP, + CurrencyMRO, + CurrencyMUR, + CurrencyMVR, + CurrencyMWK, + CurrencyMXN, + CurrencyMYR, + CurrencyMZN, + CurrencyNAD, + CurrencyNGN, + CurrencyNIO, + CurrencyNOK, + CurrencyNPR, + CurrencyNZD, + CurrencyOMR, + CurrencyPAB, + CurrencyPEN, + CurrencyPGK, + CurrencyPHP, + CurrencyPKR, + CurrencyPLN, + CurrencyPYG, + CurrencyQAR, + CurrencyRON, + CurrencyRSD, + CurrencyRUB, + CurrencyRWF, + CurrencySAR, + CurrencySBD, + CurrencySCR, + CurrencySDG, + CurrencySEK, + CurrencySGD, + CurrencySHP, + CurrencySLL, + CurrencySOS, + CurrencySPL, + CurrencySRD, + CurrencySTD, + CurrencySVC, + CurrencySYP, + CurrencySZL, + CurrencyTHB, + CurrencyTJS, + CurrencyTMT, + CurrencyTND, + CurrencyTOP, + CurrencyTRY, + CurrencyTTD, + CurrencyTVD, + CurrencyTWD, + CurrencyTZS, + CurrencyUAH, + CurrencyUGX, + CurrencyUSD, + CurrencyUYU, + CurrencyUZS, + CurrencyVEF, + CurrencyVND, + CurrencyVUV, + CurrencyWST, + CurrencyXAF, + CurrencyXCD, + CurrencyXDR, + CurrencyXOF, + CurrencyXPF, + CurrencyYER, + CurrencyZAR, + CurrencyZMW, + CurrencyZWD + }; + + PLAYFABCPP_API void writeCurrencyEnumJSON(Currency enumVal, JsonWriter& writer); + PLAYFABCPP_API Currency readCurrencyFromValue(const TSharedPtr& value); + PLAYFABCPP_API Currency readCurrencyFromValue(const FString& value); + + enum Region + { + RegionUSCentral, + RegionUSEast, + RegionEUWest, + RegionSingapore, + RegionJapan, + RegionBrazil, + RegionAustralia + }; + + PLAYFABCPP_API void writeRegionEnumJSON(Region enumVal, JsonWriter& writer); + PLAYFABCPP_API Region readRegionFromValue(const TSharedPtr& value); + PLAYFABCPP_API Region readRegionFromValue(const FString& value); + + struct PLAYFABCPP_API FCurrentGamesRequest : public FPlayFabBaseModel + { + // [optional] Build to match against. + FString BuildVersion; + + // [optional] Game mode to look for. + FString GameMode; + + // [optional] Region to check for Game Server Instances. + Boxed pfRegion; + + // [optional] Statistic name to find statistic-based matches. + FString StatisticName; + + // [optional] Filter to include and/or exclude Game Server Instances associated with certain tags. + TSharedPtr TagFilter; + + FCurrentGamesRequest() : + FPlayFabBaseModel(), + BuildVersion(), + GameMode(), + pfRegion(), + StatisticName(), + TagFilter(nullptr) + {} + + FCurrentGamesRequest(const FCurrentGamesRequest& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + GameMode(src.GameMode), + pfRegion(src.pfRegion), + StatisticName(src.StatisticName), + TagFilter(src.TagFilter.IsValid() ? MakeShareable(new FCollectionFilter(*src.TagFilter)) : nullptr) + {} + + FCurrentGamesRequest(const TSharedPtr& obj) : FCurrentGamesRequest() + { + readFromValue(obj); + } + + ~FCurrentGamesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum GameInstanceState + { + GameInstanceStateOpen, + GameInstanceStateClosed + }; + + PLAYFABCPP_API void writeGameInstanceStateEnumJSON(GameInstanceState enumVal, JsonWriter& writer); + PLAYFABCPP_API GameInstanceState readGameInstanceStateFromValue(const TSharedPtr& value); + PLAYFABCPP_API GameInstanceState readGameInstanceStateFromValue(const FString& value); + + struct PLAYFABCPP_API FGameInfo : public FPlayFabBaseModel + { + // [optional] build version this server is running + FString BuildVersion; + + // [optional] game mode this server is running + FString GameMode; + + // [optional] game session custom data + FString GameServerData; + + // [optional] game specific string denoting server configuration + Boxed GameServerStateEnum; + + // [optional] last heartbeat of the game server instance, used in external game server provider mode + Boxed LastHeartbeat; + + // [optional] unique lobby identifier for this game server + FString LobbyID; + + // [optional] maximum players this server can support + Boxed MaxPlayers; + + // [optional] array of current player IDs on this server + TArray PlayerUserIds; + // [optional] region to which this server is associated + Boxed pfRegion; + + // duration in seconds this server has been running + uint32 RunTime; + + // [optional] IPV4 address of the server + FString ServerHostname; + + // [optional] IPV4 address of the server + FString ServerIPV4Address; + + // [optional] IPV6 address of the server + FString ServerIPV6Address; + + // [optional] port number to use for non-http communications with the server + Boxed ServerPort; + + // [optional] Public DNS name (if any) of the server + FString ServerPublicDNSName; + + // [optional] stastic used to match this game in player statistic matchmaking + FString StatisticName; + + // [optional] game session tags + TMap Tags; + FGameInfo() : + FPlayFabBaseModel(), + BuildVersion(), + GameMode(), + GameServerData(), + GameServerStateEnum(), + LastHeartbeat(), + LobbyID(), + MaxPlayers(), + PlayerUserIds(), + pfRegion(), + RunTime(0), + ServerHostname(), + ServerIPV4Address(), + ServerIPV6Address(), + ServerPort(), + ServerPublicDNSName(), + StatisticName(), + Tags() + {} + + FGameInfo(const FGameInfo& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + GameMode(src.GameMode), + GameServerData(src.GameServerData), + GameServerStateEnum(src.GameServerStateEnum), + LastHeartbeat(src.LastHeartbeat), + LobbyID(src.LobbyID), + MaxPlayers(src.MaxPlayers), + PlayerUserIds(src.PlayerUserIds), + pfRegion(src.pfRegion), + RunTime(src.RunTime), + ServerHostname(src.ServerHostname), + ServerIPV4Address(src.ServerIPV4Address), + ServerIPV6Address(src.ServerIPV6Address), + ServerPort(src.ServerPort), + ServerPublicDNSName(src.ServerPublicDNSName), + StatisticName(src.StatisticName), + Tags(src.Tags) + {} + + FGameInfo(const TSharedPtr& obj) : FGameInfo() + { + readFromValue(obj); + } + + ~FGameInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCurrentGamesResult : public FPlayFabBaseModel + { + // number of games running + int32 GameCount; + + // [optional] array of games found + TArray Games; + // total number of players across all servers + int32 PlayerCount; + + FCurrentGamesResult() : + FPlayFabBaseModel(), + GameCount(0), + Games(), + PlayerCount(0) + {} + + FCurrentGamesResult(const FCurrentGamesResult& src) : + FPlayFabBaseModel(), + GameCount(src.GameCount), + Games(src.Games), + PlayerCount(src.PlayerCount) + {} + + FCurrentGamesResult(const TSharedPtr& obj) : FCurrentGamesResult() + { + readFromValue(obj); + } + + ~FCurrentGamesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeviceInfoRequest : public FPlayFabBaseModel + { + // [optional] Information posted to the PlayStream Event. Currently arbitrary, and specific to the environment sending it. + TMap Info; + FDeviceInfoRequest() : + FPlayFabBaseModel(), + Info() + {} + + FDeviceInfoRequest(const FDeviceInfoRequest& src) : + FPlayFabBaseModel(), + Info(src.Info) + {} + + FDeviceInfoRequest(const TSharedPtr& obj) : FDeviceInfoRequest() + { + readFromValue(obj); + } + + ~FDeviceInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEmptyResponse : public FPlayFabBaseModel + { + FEmptyResponse() : + FPlayFabBaseModel() + {} + + FEmptyResponse(const FEmptyResponse& src) : + FPlayFabBaseModel() + {} + + FEmptyResponse(const TSharedPtr& obj) : FEmptyResponse() + { + readFromValue(obj); + } + + ~FEmptyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityTokenResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // [optional] The token used to set X-EntityToken for all entity based API calls. + FString EntityToken; + + // [optional] The time the token will expire, if it is an expiring token, in UTC. + Boxed TokenExpiration; + + FEntityTokenResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + EntityToken(), + TokenExpiration() + {} + + FEntityTokenResponse(const FEntityTokenResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + EntityToken(src.EntityToken), + TokenExpiration(src.TokenExpiration) + {} + + FEntityTokenResponse(const TSharedPtr& obj) : FEntityTokenResponse() + { + readFromValue(obj); + } + + ~FEntityTokenResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteCloudScriptRequest : public FPlayFabBaseModel + { + // The name of the CloudScript function to execute + FString FunctionName; + + // [optional] Object that is passed in to the function as the first argument + FJsonKeeper FunctionParameter; + + /** + * [optional] Generate a 'player_executed_cloudscript' PlayStream event containing the results of the function execution and other + * contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. + */ + Boxed GeneratePlayStreamEvent; + + /** + * [optional] Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' + * executes the current live, published revision, and 'Specific' executes the specified revision. The default value is + * 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. + */ + Boxed RevisionSelection; + + // [optional] The specivic revision to execute, when RevisionSelection is set to 'Specific' + Boxed SpecificRevision; + + FExecuteCloudScriptRequest() : + FPlayFabBaseModel(), + FunctionName(), + FunctionParameter(), + GeneratePlayStreamEvent(), + RevisionSelection(), + SpecificRevision() + {} + + FExecuteCloudScriptRequest(const FExecuteCloudScriptRequest& src) : + FPlayFabBaseModel(), + FunctionName(src.FunctionName), + FunctionParameter(src.FunctionParameter), + GeneratePlayStreamEvent(src.GeneratePlayStreamEvent), + RevisionSelection(src.RevisionSelection), + SpecificRevision(src.SpecificRevision) + {} + + FExecuteCloudScriptRequest(const TSharedPtr& obj) : FExecuteCloudScriptRequest() + { + readFromValue(obj); + } + + ~FExecuteCloudScriptRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FScriptExecutionError : public FPlayFabBaseModel + { + /** + * [optional] Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, + * CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError + */ + FString Error; + + // [optional] Details about the error + FString Message; + + // [optional] Point during the execution of the script at which the error occurred, if any + FString StackTrace; + + FScriptExecutionError() : + FPlayFabBaseModel(), + Error(), + Message(), + StackTrace() + {} + + FScriptExecutionError(const FScriptExecutionError& src) : + FPlayFabBaseModel(), + Error(src.Error), + Message(src.Message), + StackTrace(src.StackTrace) + {} + + FScriptExecutionError(const TSharedPtr& obj) : FScriptExecutionError() + { + readFromValue(obj); + } + + ~FScriptExecutionError(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLogStatement : public FPlayFabBaseModel + { + // [optional] Optional object accompanying the message as contextual information + FJsonKeeper Data; + + // [optional] 'Debug', 'Info', or 'Error' + FString Level; + + // [optional] undefined + FString Message; + + FLogStatement() : + FPlayFabBaseModel(), + Data(), + Level(), + Message() + {} + + FLogStatement(const FLogStatement& src) : + FPlayFabBaseModel(), + Data(src.Data), + Level(src.Level), + Message(src.Message) + {} + + FLogStatement(const TSharedPtr& obj) : FLogStatement() + { + readFromValue(obj); + } + + ~FLogStatement(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteCloudScriptResult : public FPlayFabBaseModel + { + // Number of PlayFab API requests issued by the CloudScript function + int32 APIRequestsIssued; + + // [optional] Information about the error, if any, that occurred during execution + TSharedPtr Error; + + double ExecutionTimeSeconds; + + // [optional] The name of the function that executed + FString FunctionName; + + // [optional] The object returned from the CloudScript function, if any + FJsonKeeper FunctionResult; + + /** + * [optional] Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + Boxed FunctionResultTooLarge; + + // Number of external HTTP requests issued by the CloudScript function + int32 HttpRequestsIssued; + + /** + * [optional] Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + TArray Logs; + /** + * [optional] Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + Boxed LogsTooLarge; + + uint32 MemoryConsumedBytes; + + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + double ProcessorTimeSeconds; + + // The revision of the CloudScript that executed + int32 Revision; + + FExecuteCloudScriptResult() : + FPlayFabBaseModel(), + APIRequestsIssued(0), + Error(nullptr), + ExecutionTimeSeconds(0), + FunctionName(), + FunctionResult(), + FunctionResultTooLarge(), + HttpRequestsIssued(0), + Logs(), + LogsTooLarge(), + MemoryConsumedBytes(0), + ProcessorTimeSeconds(0), + Revision(0) + {} + + FExecuteCloudScriptResult(const FExecuteCloudScriptResult& src) : + FPlayFabBaseModel(), + APIRequestsIssued(src.APIRequestsIssued), + Error(src.Error.IsValid() ? MakeShareable(new FScriptExecutionError(*src.Error)) : nullptr), + ExecutionTimeSeconds(src.ExecutionTimeSeconds), + FunctionName(src.FunctionName), + FunctionResult(src.FunctionResult), + FunctionResultTooLarge(src.FunctionResultTooLarge), + HttpRequestsIssued(src.HttpRequestsIssued), + Logs(src.Logs), + LogsTooLarge(src.LogsTooLarge), + MemoryConsumedBytes(src.MemoryConsumedBytes), + ProcessorTimeSeconds(src.ProcessorTimeSeconds), + Revision(src.Revision) + {} + + FExecuteCloudScriptResult(const TSharedPtr& obj) : FExecuteCloudScriptResult() + { + readFromValue(obj); + } + + ~FExecuteCloudScriptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFacebookInstantGamesPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Facebook Instant Games identifier for a user. + FString FacebookInstantGamesId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Facebook Instant Games identifier. + FString PlayFabId; + + FFacebookInstantGamesPlayFabIdPair() : + FPlayFabBaseModel(), + FacebookInstantGamesId(), + PlayFabId() + {} + + FFacebookInstantGamesPlayFabIdPair(const FFacebookInstantGamesPlayFabIdPair& src) : + FPlayFabBaseModel(), + FacebookInstantGamesId(src.FacebookInstantGamesId), + PlayFabId(src.PlayFabId) + {} + + FFacebookInstantGamesPlayFabIdPair(const TSharedPtr& obj) : FFacebookInstantGamesPlayFabIdPair() + { + readFromValue(obj); + } + + ~FFacebookInstantGamesPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFacebookPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Facebook identifier for a user. + FString FacebookId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Facebook identifier. + FString PlayFabId; + + FFacebookPlayFabIdPair() : + FPlayFabBaseModel(), + FacebookId(), + PlayFabId() + {} + + FFacebookPlayFabIdPair(const FFacebookPlayFabIdPair& src) : + FPlayFabBaseModel(), + FacebookId(src.FacebookId), + PlayFabId(src.PlayFabId) + {} + + FFacebookPlayFabIdPair(const TSharedPtr& obj) : FFacebookPlayFabIdPair() + { + readFromValue(obj); + } + + ~FFacebookPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserFacebookInfo : public FPlayFabBaseModel + { + // [optional] Facebook identifier + FString FacebookId; + + // [optional] Facebook full name + FString FullName; + + FUserFacebookInfo() : + FPlayFabBaseModel(), + FacebookId(), + FullName() + {} + + FUserFacebookInfo(const FUserFacebookInfo& src) : + FPlayFabBaseModel(), + FacebookId(src.FacebookId), + FullName(src.FullName) + {} + + FUserFacebookInfo(const TSharedPtr& obj) : FUserFacebookInfo() + { + readFromValue(obj); + } + + ~FUserFacebookInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserGameCenterInfo : public FPlayFabBaseModel + { + // [optional] Gamecenter identifier + FString GameCenterId; + + FUserGameCenterInfo() : + FPlayFabBaseModel(), + GameCenterId() + {} + + FUserGameCenterInfo(const FUserGameCenterInfo& src) : + FPlayFabBaseModel(), + GameCenterId(src.GameCenterId) + {} + + FUserGameCenterInfo(const TSharedPtr& obj) : FUserGameCenterInfo() + { + readFromValue(obj); + } + + ~FUserGameCenterInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum LoginIdentityProvider + { + LoginIdentityProviderUnknown, + LoginIdentityProviderPlayFab, + LoginIdentityProviderCustom, + LoginIdentityProviderGameCenter, + LoginIdentityProviderGooglePlay, + LoginIdentityProviderSteam, + LoginIdentityProviderXBoxLive, + LoginIdentityProviderPSN, + LoginIdentityProviderKongregate, + LoginIdentityProviderFacebook, + LoginIdentityProviderIOSDevice, + LoginIdentityProviderAndroidDevice, + LoginIdentityProviderTwitch, + LoginIdentityProviderWindowsHello, + LoginIdentityProviderGameServer, + LoginIdentityProviderCustomServer, + LoginIdentityProviderNintendoSwitch, + LoginIdentityProviderFacebookInstantGames, + LoginIdentityProviderOpenIdConnect + }; + + PLAYFABCPP_API void writeLoginIdentityProviderEnumJSON(LoginIdentityProvider enumVal, JsonWriter& writer); + PLAYFABCPP_API LoginIdentityProvider readLoginIdentityProviderFromValue(const TSharedPtr& value); + PLAYFABCPP_API LoginIdentityProvider readLoginIdentityProviderFromValue(const FString& value); + + struct PLAYFABCPP_API FLinkedPlatformAccountModel : public FPlayFabBaseModel + { + // [optional] Linked account email of the user on the platform, if available + FString Email; + + // [optional] Authentication platform + Boxed Platform; + + // [optional] Unique account identifier of the user on the platform + FString PlatformUserId; + + // [optional] Linked account username of the user on the platform, if available + FString Username; + + FLinkedPlatformAccountModel() : + FPlayFabBaseModel(), + Email(), + Platform(), + PlatformUserId(), + Username() + {} + + FLinkedPlatformAccountModel(const FLinkedPlatformAccountModel& src) : + FPlayFabBaseModel(), + Email(src.Email), + Platform(src.Platform), + PlatformUserId(src.PlatformUserId), + Username(src.Username) + {} + + FLinkedPlatformAccountModel(const TSharedPtr& obj) : FLinkedPlatformAccountModel() + { + readFromValue(obj); + } + + ~FLinkedPlatformAccountModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLocationModel : public FPlayFabBaseModel + { + // [optional] City name. + FString City; + + // [optional] The two-character continent code for this location + Boxed pfContinentCode; + + // [optional] The two-character ISO 3166-1 country code for the country associated with the location + Boxed pfCountryCode; + + // [optional] Latitude coordinate of the geographic location. + Boxed Latitude; + + // [optional] Longitude coordinate of the geographic location. + Boxed Longitude; + + FLocationModel() : + FPlayFabBaseModel(), + City(), + pfContinentCode(), + pfCountryCode(), + Latitude(), + Longitude() + {} + + FLocationModel(const FLocationModel& src) : + FPlayFabBaseModel(), + City(src.City), + pfContinentCode(src.pfContinentCode), + pfCountryCode(src.pfCountryCode), + Latitude(src.Latitude), + Longitude(src.Longitude) + {} + + FLocationModel(const TSharedPtr& obj) : FLocationModel() + { + readFromValue(obj); + } + + ~FLocationModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum SubscriptionProviderStatus + { + SubscriptionProviderStatusNoError, + SubscriptionProviderStatusCancelled, + SubscriptionProviderStatusUnknownError, + SubscriptionProviderStatusBillingError, + SubscriptionProviderStatusProductUnavailable, + SubscriptionProviderStatusCustomerDidNotAcceptPriceChange, + SubscriptionProviderStatusFreeTrial, + SubscriptionProviderStatusPaymentPending + }; + + PLAYFABCPP_API void writeSubscriptionProviderStatusEnumJSON(SubscriptionProviderStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API SubscriptionProviderStatus readSubscriptionProviderStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API SubscriptionProviderStatus readSubscriptionProviderStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FSubscriptionModel : public FPlayFabBaseModel + { + // When this subscription expires. + FDateTime Expiration; + + // The time the subscription was orignially purchased + FDateTime InitialSubscriptionTime; + + // Whether this subscription is currently active. That is, if Expiration > now. + bool IsActive; + + // [optional] The status of this subscription, according to the subscription provider. + Boxed Status; + + // [optional] The id for this subscription + FString SubscriptionId; + + // [optional] The item id for this subscription from the primary catalog + FString SubscriptionItemId; + + // [optional] The provider for this subscription. Apple or Google Play are supported today. + FString SubscriptionProvider; + + FSubscriptionModel() : + FPlayFabBaseModel(), + Expiration(0), + InitialSubscriptionTime(0), + IsActive(false), + Status(), + SubscriptionId(), + SubscriptionItemId(), + SubscriptionProvider() + {} + + FSubscriptionModel(const FSubscriptionModel& src) : + FPlayFabBaseModel(), + Expiration(src.Expiration), + InitialSubscriptionTime(src.InitialSubscriptionTime), + IsActive(src.IsActive), + Status(src.Status), + SubscriptionId(src.SubscriptionId), + SubscriptionItemId(src.SubscriptionItemId), + SubscriptionProvider(src.SubscriptionProvider) + {} + + FSubscriptionModel(const TSharedPtr& obj) : FSubscriptionModel() + { + readFromValue(obj); + } + + ~FSubscriptionModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMembershipModel : public FPlayFabBaseModel + { + // Whether this membership is active. That is, whether the MembershipExpiration time has been reached. + bool IsActive; + + // The time this membership expires + FDateTime MembershipExpiration; + + // [optional] The id of the membership + FString MembershipId; + + /** + * [optional] Membership expirations can be explicitly overridden (via game manager or the admin api). If this membership has been + * overridden, this will be the new expiration time. + */ + Boxed OverrideExpiration; + + // [optional] Whether the override expiration is set. + Boxed OverrideIsSet; + + // [optional] The list of subscriptions that this player has for this membership + TArray Subscriptions; + FMembershipModel() : + FPlayFabBaseModel(), + IsActive(false), + MembershipExpiration(0), + MembershipId(), + OverrideExpiration(), + OverrideIsSet(), + Subscriptions() + {} + + FMembershipModel(const FMembershipModel& src) : + FPlayFabBaseModel(), + IsActive(src.IsActive), + MembershipExpiration(src.MembershipExpiration), + MembershipId(src.MembershipId), + OverrideExpiration(src.OverrideExpiration), + OverrideIsSet(src.OverrideIsSet), + Subscriptions(src.Subscriptions) + {} + + FMembershipModel(const TSharedPtr& obj) : FMembershipModel() + { + readFromValue(obj); + } + + ~FMembershipModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum PushNotificationPlatform + { + PushNotificationPlatformApplePushNotificationService, + PushNotificationPlatformGoogleCloudMessaging + }; + + PLAYFABCPP_API void writePushNotificationPlatformEnumJSON(PushNotificationPlatform enumVal, JsonWriter& writer); + PLAYFABCPP_API PushNotificationPlatform readPushNotificationPlatformFromValue(const TSharedPtr& value); + PLAYFABCPP_API PushNotificationPlatform readPushNotificationPlatformFromValue(const FString& value); + + struct PLAYFABCPP_API FPushNotificationRegistrationModel : public FPlayFabBaseModel + { + // [optional] Notification configured endpoint + FString NotificationEndpointARN; + + // [optional] Push notification platform + Boxed Platform; + + FPushNotificationRegistrationModel() : + FPlayFabBaseModel(), + NotificationEndpointARN(), + Platform() + {} + + FPushNotificationRegistrationModel(const FPushNotificationRegistrationModel& src) : + FPlayFabBaseModel(), + NotificationEndpointARN(src.NotificationEndpointARN), + Platform(src.Platform) + {} + + FPushNotificationRegistrationModel(const TSharedPtr& obj) : FPushNotificationRegistrationModel() + { + readFromValue(obj); + } + + ~FPushNotificationRegistrationModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticModel : public FPlayFabBaseModel + { + // [optional] Statistic name + FString Name; + + // Statistic value + int32 Value; + + // Statistic version (0 if not a versioned statistic) + int32 Version; + + FStatisticModel() : + FPlayFabBaseModel(), + Name(), + Value(0), + Version(0) + {} + + FStatisticModel(const FStatisticModel& src) : + FPlayFabBaseModel(), + Name(src.Name), + Value(src.Value), + Version(src.Version) + {} + + FStatisticModel(const TSharedPtr& obj) : FStatisticModel() + { + readFromValue(obj); + } + + ~FStatisticModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FTagModel : public FPlayFabBaseModel + { + // [optional] Full value of the tag, including namespace + FString TagValue; + + FTagModel() : + FPlayFabBaseModel(), + TagValue() + {} + + FTagModel(const FTagModel& src) : + FPlayFabBaseModel(), + TagValue(src.TagValue) + {} + + FTagModel(const TSharedPtr& obj) : FTagModel() + { + readFromValue(obj); + } + + ~FTagModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValueToDateModel : public FPlayFabBaseModel + { + // [optional] ISO 4217 code of the currency used in the purchases + FString Currency; + + /** + * Total value of the purchases in a whole number of 1/100 monetary units. For example, 999 indicates nine dollars and + * ninety-nine cents when Currency is 'USD') + */ + uint32 TotalValue; + + /** + * [optional] Total value of the purchases in a string representation of decimal monetary units. For example, '9.99' indicates nine + * dollars and ninety-nine cents when Currency is 'USD'. + */ + FString TotalValueAsDecimal; + + FValueToDateModel() : + FPlayFabBaseModel(), + Currency(), + TotalValue(0), + TotalValueAsDecimal() + {} + + FValueToDateModel(const FValueToDateModel& src) : + FPlayFabBaseModel(), + Currency(src.Currency), + TotalValue(src.TotalValue), + TotalValueAsDecimal(src.TotalValueAsDecimal) + {} + + FValueToDateModel(const TSharedPtr& obj) : FValueToDateModel() + { + readFromValue(obj); + } + + ~FValueToDateModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfileModel : public FPlayFabBaseModel + { + // [optional] List of advertising campaigns the player has been attributed to + TArray AdCampaignAttributions; + // [optional] URL of the player's avatar image + FString AvatarUrl; + + // [optional] If the player is currently banned, the UTC Date when the ban expires + Boxed BannedUntil; + + // [optional] List of all contact email info associated with the player account + TArray ContactEmailAddresses; + // [optional] Player record created + Boxed Created; + + // [optional] Player display name + FString DisplayName; + + // [optional] UTC time when the player most recently logged in to the title + Boxed LastLogin; + + // [optional] List of all authentication systems linked to this player account + TArray LinkedAccounts; + // [optional] List of geographic locations from which the player has logged in to the title + TArray Locations; + // [optional] List of memberships for the player, along with whether are expired. + TArray Memberships; + // [optional] Player account origination + Boxed Origination; + + // [optional] PlayFab player account unique identifier + FString PlayerId; + + // [optional] Publisher this player belongs to + FString PublisherId; + + // [optional] List of configured end points registered for sending the player push notifications + TArray PushNotificationRegistrations; + // [optional] List of leaderboard statistic values for the player + TArray Statistics; + // [optional] List of player's tags for segmentation + TArray Tags; + // [optional] Title ID this player profile applies to + FString TitleId; + + /** + * [optional] Sum of the player's purchases made with real-money currencies, converted to US dollars equivalent and represented as a + * whole number of cents (1/100 USD). For example, 999 indicates nine dollars and ninety-nine cents. + */ + Boxed TotalValueToDateInUSD; + + // [optional] List of the player's lifetime purchase totals, summed by real-money currency + TArray ValuesToDate; + FPlayerProfileModel() : + FPlayFabBaseModel(), + AdCampaignAttributions(), + AvatarUrl(), + BannedUntil(), + ContactEmailAddresses(), + Created(), + DisplayName(), + LastLogin(), + LinkedAccounts(), + Locations(), + Memberships(), + Origination(), + PlayerId(), + PublisherId(), + PushNotificationRegistrations(), + Statistics(), + Tags(), + TitleId(), + TotalValueToDateInUSD(), + ValuesToDate() + {} + + FPlayerProfileModel(const FPlayerProfileModel& src) : + FPlayFabBaseModel(), + AdCampaignAttributions(src.AdCampaignAttributions), + AvatarUrl(src.AvatarUrl), + BannedUntil(src.BannedUntil), + ContactEmailAddresses(src.ContactEmailAddresses), + Created(src.Created), + DisplayName(src.DisplayName), + LastLogin(src.LastLogin), + LinkedAccounts(src.LinkedAccounts), + Locations(src.Locations), + Memberships(src.Memberships), + Origination(src.Origination), + PlayerId(src.PlayerId), + PublisherId(src.PublisherId), + PushNotificationRegistrations(src.PushNotificationRegistrations), + Statistics(src.Statistics), + Tags(src.Tags), + TitleId(src.TitleId), + TotalValueToDateInUSD(src.TotalValueToDateInUSD), + ValuesToDate(src.ValuesToDate) + {} + + FPlayerProfileModel(const TSharedPtr& obj) : FPlayerProfileModel() + { + readFromValue(obj); + } + + ~FPlayerProfileModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserPsnInfo : public FPlayFabBaseModel + { + // [optional] PSN account ID + FString PsnAccountId; + + // [optional] PSN online ID + FString PsnOnlineId; + + FUserPsnInfo() : + FPlayFabBaseModel(), + PsnAccountId(), + PsnOnlineId() + {} + + FUserPsnInfo(const FUserPsnInfo& src) : + FPlayFabBaseModel(), + PsnAccountId(src.PsnAccountId), + PsnOnlineId(src.PsnOnlineId) + {} + + FUserPsnInfo(const TSharedPtr& obj) : FUserPsnInfo() + { + readFromValue(obj); + } + + ~FUserPsnInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum TitleActivationStatus + { + TitleActivationStatusNone, + TitleActivationStatusActivatedTitleKey, + TitleActivationStatusPendingSteam, + TitleActivationStatusActivatedSteam, + TitleActivationStatusRevokedSteam + }; + + PLAYFABCPP_API void writeTitleActivationStatusEnumJSON(TitleActivationStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API TitleActivationStatus readTitleActivationStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API TitleActivationStatus readTitleActivationStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FUserSteamInfo : public FPlayFabBaseModel + { + // [optional] what stage of game ownership the user is listed as being in, from Steam + Boxed SteamActivationStatus; + + // [optional] the country in which the player resides, from Steam data + FString SteamCountry; + + // [optional] currency type set in the user Steam account + Boxed SteamCurrency; + + // [optional] Steam identifier + FString SteamId; + + FUserSteamInfo() : + FPlayFabBaseModel(), + SteamActivationStatus(), + SteamCountry(), + SteamCurrency(), + SteamId() + {} + + FUserSteamInfo(const FUserSteamInfo& src) : + FPlayFabBaseModel(), + SteamActivationStatus(src.SteamActivationStatus), + SteamCountry(src.SteamCountry), + SteamCurrency(src.SteamCurrency), + SteamId(src.SteamId) + {} + + FUserSteamInfo(const TSharedPtr& obj) : FUserSteamInfo() + { + readFromValue(obj); + } + + ~FUserSteamInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserXboxInfo : public FPlayFabBaseModel + { + // [optional] XBox user ID + FString XboxUserId; + + FUserXboxInfo() : + FPlayFabBaseModel(), + XboxUserId() + {} + + FUserXboxInfo(const FUserXboxInfo& src) : + FPlayFabBaseModel(), + XboxUserId(src.XboxUserId) + {} + + FUserXboxInfo(const TSharedPtr& obj) : FUserXboxInfo() + { + readFromValue(obj); + } + + ~FUserXboxInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFriendInfo : public FPlayFabBaseModel + { + // [optional] Unique lobby identifier of the Game Server Instance to which this player is currently connected. + FString CurrentMatchmakerLobbyId; + + // [optional] Available Facebook information (if the user and PlayFab friend are also connected in Facebook). + TSharedPtr FacebookInfo; + + // [optional] PlayFab unique identifier for this friend. + FString FriendPlayFabId; + + // [optional] Available Game Center information (if the user and PlayFab friend are also connected in Game Center). + TSharedPtr GameCenterInfo; + + // [optional] The profile of the user, if requested. + TSharedPtr Profile; + + // [optional] Available PSN information, if the user and PlayFab friend are both connected to PSN. + TSharedPtr PSNInfo; + + // [optional] Available Steam information (if the user and PlayFab friend are also connected in Steam). + TSharedPtr SteamInfo; + + // [optional] Tags which have been associated with this friend. + TArray Tags; + // [optional] Title-specific display name for this friend. + FString TitleDisplayName; + + // [optional] PlayFab unique username for this friend. + FString Username; + + // [optional] Available Xbox information, if the user and PlayFab friend are both connected to Xbox Live. + TSharedPtr XboxInfo; + + FFriendInfo() : + FPlayFabBaseModel(), + CurrentMatchmakerLobbyId(), + FacebookInfo(nullptr), + FriendPlayFabId(), + GameCenterInfo(nullptr), + Profile(nullptr), + PSNInfo(nullptr), + SteamInfo(nullptr), + Tags(), + TitleDisplayName(), + Username(), + XboxInfo(nullptr) + {} + + FFriendInfo(const FFriendInfo& src) : + FPlayFabBaseModel(), + CurrentMatchmakerLobbyId(src.CurrentMatchmakerLobbyId), + FacebookInfo(src.FacebookInfo.IsValid() ? MakeShareable(new FUserFacebookInfo(*src.FacebookInfo)) : nullptr), + FriendPlayFabId(src.FriendPlayFabId), + GameCenterInfo(src.GameCenterInfo.IsValid() ? MakeShareable(new FUserGameCenterInfo(*src.GameCenterInfo)) : nullptr), + Profile(src.Profile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.Profile)) : nullptr), + PSNInfo(src.PSNInfo.IsValid() ? MakeShareable(new FUserPsnInfo(*src.PSNInfo)) : nullptr), + SteamInfo(src.SteamInfo.IsValid() ? MakeShareable(new FUserSteamInfo(*src.SteamInfo)) : nullptr), + Tags(src.Tags), + TitleDisplayName(src.TitleDisplayName), + Username(src.Username), + XboxInfo(src.XboxInfo.IsValid() ? MakeShareable(new FUserXboxInfo(*src.XboxInfo)) : nullptr) + {} + + FFriendInfo(const TSharedPtr& obj) : FFriendInfo() + { + readFromValue(obj); + } + + ~FFriendInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGameCenterPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Game Center identifier for a user. + FString GameCenterId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Game Center identifier. + FString PlayFabId; + + FGameCenterPlayFabIdPair() : + FPlayFabBaseModel(), + GameCenterId(), + PlayFabId() + {} + + FGameCenterPlayFabIdPair(const FGameCenterPlayFabIdPair& src) : + FPlayFabBaseModel(), + GameCenterId(src.GameCenterId), + PlayFabId(src.PlayFabId) + {} + + FGameCenterPlayFabIdPair(const TSharedPtr& obj) : FGameCenterPlayFabIdPair() + { + readFromValue(obj); + } + + ~FGameCenterPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGameServerRegionsRequest : public FPlayFabBaseModel + { + // version of game server for which stats are being requested + FString BuildVersion; + + /** + * [optional] Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FGameServerRegionsRequest() : + FPlayFabBaseModel(), + BuildVersion(), + TitleId() + {} + + FGameServerRegionsRequest(const FGameServerRegionsRequest& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + TitleId(src.TitleId) + {} + + FGameServerRegionsRequest(const TSharedPtr& obj) : FGameServerRegionsRequest() + { + readFromValue(obj); + } + + ~FGameServerRegionsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegionInfo : public FPlayFabBaseModel + { + // indicates whether the server specified is available in this region + bool Available; + + // [optional] name of the region + FString Name; + + // [optional] url to ping to get roundtrip time + FString PingUrl; + + // [optional] unique identifier for the region + Boxed pfRegion; + + FRegionInfo() : + FPlayFabBaseModel(), + Available(false), + Name(), + PingUrl(), + pfRegion() + {} + + FRegionInfo(const FRegionInfo& src) : + FPlayFabBaseModel(), + Available(src.Available), + Name(src.Name), + PingUrl(src.PingUrl), + pfRegion(src.pfRegion) + {} + + FRegionInfo(const TSharedPtr& obj) : FRegionInfo() + { + readFromValue(obj); + } + + ~FRegionInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGameServerRegionsResult : public FPlayFabBaseModel + { + // [optional] array of regions found matching the request parameters + TArray Regions; + FGameServerRegionsResult() : + FPlayFabBaseModel(), + Regions() + {} + + FGameServerRegionsResult(const FGameServerRegionsResult& src) : + FPlayFabBaseModel(), + Regions(src.Regions) + {} + + FGameServerRegionsResult(const TSharedPtr& obj) : FGameServerRegionsResult() + { + readFromValue(obj); + } + + ~FGameServerRegionsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGenericPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique generic service identifier for a user. + TSharedPtr GenericId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the given generic identifier. + FString PlayFabId; + + FGenericPlayFabIdPair() : + FPlayFabBaseModel(), + GenericId(nullptr), + PlayFabId() + {} + + FGenericPlayFabIdPair(const FGenericPlayFabIdPair& src) : + FPlayFabBaseModel(), + GenericId(src.GenericId.IsValid() ? MakeShareable(new FGenericServiceId(*src.GenericId)) : nullptr), + PlayFabId(src.PlayFabId) + {} + + FGenericPlayFabIdPair(const TSharedPtr& obj) : FGenericPlayFabIdPair() + { + readFromValue(obj); + } + + ~FGenericPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetAccountInfoRequest : public FPlayFabBaseModel + { + // [optional] User email address for the account to find (if no Username is specified). + FString Email; + + /** + * [optional] Unique PlayFab identifier of the user whose info is being requested. Optional, defaults to the authenticated user if no + * other lookup identifier set. + */ + FString PlayFabId; + + /** + * [optional] Title-specific username for the account to find (if no Email is set). Note that if the non-unique Title Display Names + * option is enabled for the title, attempts to look up users by Title Display Name will always return AccountNotFound. + */ + FString TitleDisplayName; + + // [optional] PlayFab Username for the account to find (if no PlayFabId is specified). + FString Username; + + FGetAccountInfoRequest() : + FPlayFabBaseModel(), + Email(), + PlayFabId(), + TitleDisplayName(), + Username() + {} + + FGetAccountInfoRequest(const FGetAccountInfoRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + PlayFabId(src.PlayFabId), + TitleDisplayName(src.TitleDisplayName), + Username(src.Username) + {} + + FGetAccountInfoRequest(const TSharedPtr& obj) : FGetAccountInfoRequest() + { + readFromValue(obj); + } + + ~FGetAccountInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserAndroidDeviceInfo : public FPlayFabBaseModel + { + // [optional] Android device ID + FString AndroidDeviceId; + + FUserAndroidDeviceInfo() : + FPlayFabBaseModel(), + AndroidDeviceId() + {} + + FUserAndroidDeviceInfo(const FUserAndroidDeviceInfo& src) : + FPlayFabBaseModel(), + AndroidDeviceId(src.AndroidDeviceId) + {} + + FUserAndroidDeviceInfo(const TSharedPtr& obj) : FUserAndroidDeviceInfo() + { + readFromValue(obj); + } + + ~FUserAndroidDeviceInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserCustomIdInfo : public FPlayFabBaseModel + { + // [optional] Custom ID + FString CustomId; + + FUserCustomIdInfo() : + FPlayFabBaseModel(), + CustomId() + {} + + FUserCustomIdInfo(const FUserCustomIdInfo& src) : + FPlayFabBaseModel(), + CustomId(src.CustomId) + {} + + FUserCustomIdInfo(const TSharedPtr& obj) : FUserCustomIdInfo() + { + readFromValue(obj); + } + + ~FUserCustomIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserFacebookInstantGamesIdInfo : public FPlayFabBaseModel + { + // [optional] Facebook Instant Games ID + FString FacebookInstantGamesId; + + FUserFacebookInstantGamesIdInfo() : + FPlayFabBaseModel(), + FacebookInstantGamesId() + {} + + FUserFacebookInstantGamesIdInfo(const FUserFacebookInstantGamesIdInfo& src) : + FPlayFabBaseModel(), + FacebookInstantGamesId(src.FacebookInstantGamesId) + {} + + FUserFacebookInstantGamesIdInfo(const TSharedPtr& obj) : FUserFacebookInstantGamesIdInfo() + { + readFromValue(obj); + } + + ~FUserFacebookInstantGamesIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserGoogleInfo : public FPlayFabBaseModel + { + // [optional] Email address of the Google account + FString GoogleEmail; + + // [optional] Gender information of the Google account + FString GoogleGender; + + // [optional] Google ID + FString GoogleId; + + // [optional] Locale of the Google account + FString GoogleLocale; + + FUserGoogleInfo() : + FPlayFabBaseModel(), + GoogleEmail(), + GoogleGender(), + GoogleId(), + GoogleLocale() + {} + + FUserGoogleInfo(const FUserGoogleInfo& src) : + FPlayFabBaseModel(), + GoogleEmail(src.GoogleEmail), + GoogleGender(src.GoogleGender), + GoogleId(src.GoogleId), + GoogleLocale(src.GoogleLocale) + {} + + FUserGoogleInfo(const TSharedPtr& obj) : FUserGoogleInfo() + { + readFromValue(obj); + } + + ~FUserGoogleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserIosDeviceInfo : public FPlayFabBaseModel + { + // [optional] iOS device ID + FString IosDeviceId; + + FUserIosDeviceInfo() : + FPlayFabBaseModel(), + IosDeviceId() + {} + + FUserIosDeviceInfo(const FUserIosDeviceInfo& src) : + FPlayFabBaseModel(), + IosDeviceId(src.IosDeviceId) + {} + + FUserIosDeviceInfo(const TSharedPtr& obj) : FUserIosDeviceInfo() + { + readFromValue(obj); + } + + ~FUserIosDeviceInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserKongregateInfo : public FPlayFabBaseModel + { + // [optional] Kongregate ID + FString KongregateId; + + // [optional] Kongregate Username + FString KongregateName; + + FUserKongregateInfo() : + FPlayFabBaseModel(), + KongregateId(), + KongregateName() + {} + + FUserKongregateInfo(const FUserKongregateInfo& src) : + FPlayFabBaseModel(), + KongregateId(src.KongregateId), + KongregateName(src.KongregateName) + {} + + FUserKongregateInfo(const TSharedPtr& obj) : FUserKongregateInfo() + { + readFromValue(obj); + } + + ~FUserKongregateInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserNintendoSwitchDeviceIdInfo : public FPlayFabBaseModel + { + // [optional] Nintendo Switch Device ID + FString NintendoSwitchDeviceId; + + FUserNintendoSwitchDeviceIdInfo() : + FPlayFabBaseModel(), + NintendoSwitchDeviceId() + {} + + FUserNintendoSwitchDeviceIdInfo(const FUserNintendoSwitchDeviceIdInfo& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId) + {} + + FUserNintendoSwitchDeviceIdInfo(const TSharedPtr& obj) : FUserNintendoSwitchDeviceIdInfo() + { + readFromValue(obj); + } + + ~FUserNintendoSwitchDeviceIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserOpenIdInfo : public FPlayFabBaseModel + { + // [optional] OpenID Connection ID + FString ConnectionId; + + // [optional] OpenID Issuer + FString Issuer; + + // [optional] OpenID Subject + FString Subject; + + FUserOpenIdInfo() : + FPlayFabBaseModel(), + ConnectionId(), + Issuer(), + Subject() + {} + + FUserOpenIdInfo(const FUserOpenIdInfo& src) : + FPlayFabBaseModel(), + ConnectionId(src.ConnectionId), + Issuer(src.Issuer), + Subject(src.Subject) + {} + + FUserOpenIdInfo(const TSharedPtr& obj) : FUserOpenIdInfo() + { + readFromValue(obj); + } + + ~FUserOpenIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserPrivateAccountInfo : public FPlayFabBaseModel + { + // [optional] user email address + FString Email; + + FUserPrivateAccountInfo() : + FPlayFabBaseModel(), + Email() + {} + + FUserPrivateAccountInfo(const FUserPrivateAccountInfo& src) : + FPlayFabBaseModel(), + Email(src.Email) + {} + + FUserPrivateAccountInfo(const TSharedPtr& obj) : FUserPrivateAccountInfo() + { + readFromValue(obj); + } + + ~FUserPrivateAccountInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum UserOrigination + { + UserOriginationOrganic, + UserOriginationSteam, + UserOriginationGoogle, + UserOriginationAmazon, + UserOriginationFacebook, + UserOriginationKongregate, + UserOriginationGamersFirst, + UserOriginationUnknown, + UserOriginationIOS, + UserOriginationLoadTest, + UserOriginationAndroid, + UserOriginationPSN, + UserOriginationGameCenter, + UserOriginationCustomId, + UserOriginationXboxLive, + UserOriginationParse, + UserOriginationTwitch, + UserOriginationWindowsHello, + UserOriginationServerCustomId, + UserOriginationNintendoSwitchDeviceId, + UserOriginationFacebookInstantGamesId, + UserOriginationOpenIdConnect + }; + + PLAYFABCPP_API void writeUserOriginationEnumJSON(UserOrigination enumVal, JsonWriter& writer); + PLAYFABCPP_API UserOrigination readUserOriginationFromValue(const TSharedPtr& value); + PLAYFABCPP_API UserOrigination readUserOriginationFromValue(const FString& value); + + struct PLAYFABCPP_API FUserTitleInfo : public FPlayFabBaseModel + { + // [optional] URL to the player's avatar. + FString AvatarUrl; + + /** + * timestamp indicating when the user was first associated with this game (this can differ significantly from when the user + * first registered with PlayFab) + */ + FDateTime Created; + + // [optional] name of the user, as it is displayed in-game + FString DisplayName; + + /** + * [optional] timestamp indicating when the user first signed into this game (this can differ from the Created timestamp, as other + * events, such as issuing a beta key to the user, can associate the title to the user) + */ + Boxed FirstLogin; + + // [optional] boolean indicating whether or not the user is currently banned for a title + Boxed isBanned; + + // [optional] timestamp for the last user login for this title + Boxed LastLogin; + + // [optional] source by which the user first joined the game, if known + Boxed Origination; + + // [optional] Title player account entity for this user + TSharedPtr TitlePlayerAccount; + + FUserTitleInfo() : + FPlayFabBaseModel(), + AvatarUrl(), + Created(0), + DisplayName(), + FirstLogin(), + isBanned(), + LastLogin(), + Origination(), + TitlePlayerAccount(nullptr) + {} + + FUserTitleInfo(const FUserTitleInfo& src) : + FPlayFabBaseModel(), + AvatarUrl(src.AvatarUrl), + Created(src.Created), + DisplayName(src.DisplayName), + FirstLogin(src.FirstLogin), + isBanned(src.isBanned), + LastLogin(src.LastLogin), + Origination(src.Origination), + TitlePlayerAccount(src.TitlePlayerAccount.IsValid() ? MakeShareable(new FEntityKey(*src.TitlePlayerAccount)) : nullptr) + {} + + FUserTitleInfo(const TSharedPtr& obj) : FUserTitleInfo() + { + readFromValue(obj); + } + + ~FUserTitleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserTwitchInfo : public FPlayFabBaseModel + { + // [optional] Twitch ID + FString TwitchId; + + // [optional] Twitch Username + FString TwitchUserName; + + FUserTwitchInfo() : + FPlayFabBaseModel(), + TwitchId(), + TwitchUserName() + {} + + FUserTwitchInfo(const FUserTwitchInfo& src) : + FPlayFabBaseModel(), + TwitchId(src.TwitchId), + TwitchUserName(src.TwitchUserName) + {} + + FUserTwitchInfo(const TSharedPtr& obj) : FUserTwitchInfo() + { + readFromValue(obj); + } + + ~FUserTwitchInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserWindowsHelloInfo : public FPlayFabBaseModel + { + // [optional] Windows Hello Device Name + FString WindowsHelloDeviceName; + + // [optional] Windows Hello Public Key Hash + FString WindowsHelloPublicKeyHash; + + FUserWindowsHelloInfo() : + FPlayFabBaseModel(), + WindowsHelloDeviceName(), + WindowsHelloPublicKeyHash() + {} + + FUserWindowsHelloInfo(const FUserWindowsHelloInfo& src) : + FPlayFabBaseModel(), + WindowsHelloDeviceName(src.WindowsHelloDeviceName), + WindowsHelloPublicKeyHash(src.WindowsHelloPublicKeyHash) + {} + + FUserWindowsHelloInfo(const TSharedPtr& obj) : FUserWindowsHelloInfo() + { + readFromValue(obj); + } + + ~FUserWindowsHelloInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserAccountInfo : public FPlayFabBaseModel + { + // [optional] User Android device information, if an Android device has been linked + TSharedPtr AndroidDeviceInfo; + + // Timestamp indicating when the user account was created + FDateTime Created; + + // [optional] Custom ID information, if a custom ID has been assigned + TSharedPtr CustomIdInfo; + + // [optional] User Facebook information, if a Facebook account has been linked + TSharedPtr FacebookInfo; + + // [optional] Facebook Instant Games account information, if a Facebook Instant Games account has been linked + TSharedPtr FacebookInstantGamesIdInfo; + + // [optional] User Gamecenter information, if a Gamecenter account has been linked + TSharedPtr GameCenterInfo; + + // [optional] User Google account information, if a Google account has been linked + TSharedPtr GoogleInfo; + + // [optional] User iOS device information, if an iOS device has been linked + TSharedPtr IosDeviceInfo; + + // [optional] User Kongregate account information, if a Kongregate account has been linked + TSharedPtr KongregateInfo; + + // [optional] Nintendo Switch account information, if a Nintendo Switch account has been linked + TSharedPtr NintendoSwitchDeviceIdInfo; + + // [optional] OpenID Connect information, if any OpenID Connect accounts have been linked + TArray OpenIdInfo; + // [optional] Unique identifier for the user account + FString PlayFabId; + + // [optional] Personal information for the user which is considered more sensitive + TSharedPtr PrivateInfo; + + // [optional] User PSN account information, if a PSN account has been linked + TSharedPtr PsnInfo; + + // [optional] User Steam information, if a Steam account has been linked + TSharedPtr SteamInfo; + + // [optional] Title-specific information for the user account + TSharedPtr TitleInfo; + + // [optional] User Twitch account information, if a Twitch account has been linked + TSharedPtr TwitchInfo; + + // [optional] User account name in the PlayFab service + FString Username; + + // [optional] Windows Hello account information, if a Windows Hello account has been linked + TSharedPtr WindowsHelloInfo; + + // [optional] User XBox account information, if a XBox account has been linked + TSharedPtr XboxInfo; + + FUserAccountInfo() : + FPlayFabBaseModel(), + AndroidDeviceInfo(nullptr), + Created(0), + CustomIdInfo(nullptr), + FacebookInfo(nullptr), + FacebookInstantGamesIdInfo(nullptr), + GameCenterInfo(nullptr), + GoogleInfo(nullptr), + IosDeviceInfo(nullptr), + KongregateInfo(nullptr), + NintendoSwitchDeviceIdInfo(nullptr), + OpenIdInfo(), + PlayFabId(), + PrivateInfo(nullptr), + PsnInfo(nullptr), + SteamInfo(nullptr), + TitleInfo(nullptr), + TwitchInfo(nullptr), + Username(), + WindowsHelloInfo(nullptr), + XboxInfo(nullptr) + {} + + FUserAccountInfo(const FUserAccountInfo& src) : + FPlayFabBaseModel(), + AndroidDeviceInfo(src.AndroidDeviceInfo.IsValid() ? MakeShareable(new FUserAndroidDeviceInfo(*src.AndroidDeviceInfo)) : nullptr), + Created(src.Created), + CustomIdInfo(src.CustomIdInfo.IsValid() ? MakeShareable(new FUserCustomIdInfo(*src.CustomIdInfo)) : nullptr), + FacebookInfo(src.FacebookInfo.IsValid() ? MakeShareable(new FUserFacebookInfo(*src.FacebookInfo)) : nullptr), + FacebookInstantGamesIdInfo(src.FacebookInstantGamesIdInfo.IsValid() ? MakeShareable(new FUserFacebookInstantGamesIdInfo(*src.FacebookInstantGamesIdInfo)) : nullptr), + GameCenterInfo(src.GameCenterInfo.IsValid() ? MakeShareable(new FUserGameCenterInfo(*src.GameCenterInfo)) : nullptr), + GoogleInfo(src.GoogleInfo.IsValid() ? MakeShareable(new FUserGoogleInfo(*src.GoogleInfo)) : nullptr), + IosDeviceInfo(src.IosDeviceInfo.IsValid() ? MakeShareable(new FUserIosDeviceInfo(*src.IosDeviceInfo)) : nullptr), + KongregateInfo(src.KongregateInfo.IsValid() ? MakeShareable(new FUserKongregateInfo(*src.KongregateInfo)) : nullptr), + NintendoSwitchDeviceIdInfo(src.NintendoSwitchDeviceIdInfo.IsValid() ? MakeShareable(new FUserNintendoSwitchDeviceIdInfo(*src.NintendoSwitchDeviceIdInfo)) : nullptr), + OpenIdInfo(src.OpenIdInfo), + PlayFabId(src.PlayFabId), + PrivateInfo(src.PrivateInfo.IsValid() ? MakeShareable(new FUserPrivateAccountInfo(*src.PrivateInfo)) : nullptr), + PsnInfo(src.PsnInfo.IsValid() ? MakeShareable(new FUserPsnInfo(*src.PsnInfo)) : nullptr), + SteamInfo(src.SteamInfo.IsValid() ? MakeShareable(new FUserSteamInfo(*src.SteamInfo)) : nullptr), + TitleInfo(src.TitleInfo.IsValid() ? MakeShareable(new FUserTitleInfo(*src.TitleInfo)) : nullptr), + TwitchInfo(src.TwitchInfo.IsValid() ? MakeShareable(new FUserTwitchInfo(*src.TwitchInfo)) : nullptr), + Username(src.Username), + WindowsHelloInfo(src.WindowsHelloInfo.IsValid() ? MakeShareable(new FUserWindowsHelloInfo(*src.WindowsHelloInfo)) : nullptr), + XboxInfo(src.XboxInfo.IsValid() ? MakeShareable(new FUserXboxInfo(*src.XboxInfo)) : nullptr) + {} + + FUserAccountInfo(const TSharedPtr& obj) : FUserAccountInfo() + { + readFromValue(obj); + } + + ~FUserAccountInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetAccountInfoResult : public FPlayFabBaseModel + { + // [optional] Account information for the local user. + TSharedPtr AccountInfo; + + FGetAccountInfoResult() : + FPlayFabBaseModel(), + AccountInfo(nullptr) + {} + + FGetAccountInfoResult(const FGetAccountInfoResult& src) : + FPlayFabBaseModel(), + AccountInfo(src.AccountInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.AccountInfo)) : nullptr) + {} + + FGetAccountInfoResult(const TSharedPtr& obj) : FGetAccountInfoResult() + { + readFromValue(obj); + } + + ~FGetAccountInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCatalogItemsRequest : public FPlayFabBaseModel + { + // [optional] Which catalog is being requested. If null, uses the default catalog. + FString CatalogVersion; + + FGetCatalogItemsRequest() : + FPlayFabBaseModel(), + CatalogVersion() + {} + + FGetCatalogItemsRequest(const FGetCatalogItemsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion) + {} + + FGetCatalogItemsRequest(const TSharedPtr& obj) : FGetCatalogItemsRequest() + { + readFromValue(obj); + } + + ~FGetCatalogItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCatalogItemsResult : public FPlayFabBaseModel + { + // [optional] Array of items which can be purchased. + TArray Catalog; + FGetCatalogItemsResult() : + FPlayFabBaseModel(), + Catalog() + {} + + FGetCatalogItemsResult(const FGetCatalogItemsResult& src) : + FPlayFabBaseModel(), + Catalog(src.Catalog) + {} + + FGetCatalogItemsResult(const TSharedPtr& obj) : FGetCatalogItemsResult() + { + readFromValue(obj); + } + + ~FGetCatalogItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterDataRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + Boxed IfChangedFromDataVersion; + + // [optional] Specific keys to search for in the custom user data. + TArray Keys; + // [optional] Unique PlayFab identifier of the user to load data for. Optional, defaults to yourself if not set. + FString PlayFabId; + + FGetCharacterDataRequest() : + FPlayFabBaseModel(), + CharacterId(), + IfChangedFromDataVersion(), + Keys(), + PlayFabId() + {} + + FGetCharacterDataRequest(const FGetCharacterDataRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + IfChangedFromDataVersion(src.IfChangedFromDataVersion), + Keys(src.Keys), + PlayFabId(src.PlayFabId) + {} + + FGetCharacterDataRequest(const TSharedPtr& obj) : FGetCharacterDataRequest() + { + readFromValue(obj); + } + + ~FGetCharacterDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum UserDataPermission + { + UserDataPermissionPrivate, + UserDataPermissionPublic + }; + + PLAYFABCPP_API void writeUserDataPermissionEnumJSON(UserDataPermission enumVal, JsonWriter& writer); + PLAYFABCPP_API UserDataPermission readUserDataPermissionFromValue(const TSharedPtr& value); + PLAYFABCPP_API UserDataPermission readUserDataPermissionFromValue(const FString& value); + + struct PLAYFABCPP_API FUserDataRecord : public FPlayFabBaseModel + { + // Timestamp for when this data was last updated. + FDateTime LastUpdated; + + /** + * [optional] Indicates whether this data can be read by all users (public) or only the user (private). This is used for GetUserData + * requests being made by one player about another player. + */ + Boxed Permission; + + // [optional] Data stored for the specified user data key. + FString Value; + + FUserDataRecord() : + FPlayFabBaseModel(), + LastUpdated(0), + Permission(), + Value() + {} + + FUserDataRecord(const FUserDataRecord& src) : + FPlayFabBaseModel(), + LastUpdated(src.LastUpdated), + Permission(src.Permission), + Value(src.Value) + {} + + FUserDataRecord(const TSharedPtr& obj) : FUserDataRecord() + { + readFromValue(obj); + } + + ~FUserDataRecord(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterDataResult : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] User specific data for this title. + TMap Data; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FGetCharacterDataResult() : + FPlayFabBaseModel(), + CharacterId(), + Data(), + DataVersion(0) + {} + + FGetCharacterDataResult(const FGetCharacterDataResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Data(src.Data), + DataVersion(src.DataVersion) + {} + + FGetCharacterDataResult(const TSharedPtr& obj) : FGetCharacterDataResult() + { + readFromValue(obj); + } + + ~FGetCharacterDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterInventoryRequest : public FPlayFabBaseModel + { + // [optional] Used to limit results to only those from a specific catalog version. + FString CatalogVersion; + + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + FGetCharacterInventoryRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId() + {} + + FGetCharacterInventoryRequest(const FGetCharacterInventoryRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId) + {} + + FGetCharacterInventoryRequest(const TSharedPtr& obj) : FGetCharacterInventoryRequest() + { + readFromValue(obj); + } + + ~FGetCharacterInventoryRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FVirtualCurrencyRechargeTime : public FPlayFabBaseModel + { + /** + * Maximum value to which the regenerating currency will automatically increment. Note that it can exceed this value + * through use of the AddUserVirtualCurrency API call. However, it will not regenerate automatically until it has fallen + * below this value. + */ + int32 RechargeMax; + + // Server timestamp in UTC indicating the next time the virtual currency will be incremented. + FDateTime RechargeTime; + + // Time remaining (in seconds) before the next recharge increment of the virtual currency. + int32 SecondsToRecharge; + + FVirtualCurrencyRechargeTime() : + FPlayFabBaseModel(), + RechargeMax(0), + RechargeTime(0), + SecondsToRecharge(0) + {} + + FVirtualCurrencyRechargeTime(const FVirtualCurrencyRechargeTime& src) : + FPlayFabBaseModel(), + RechargeMax(src.RechargeMax), + RechargeTime(src.RechargeTime), + SecondsToRecharge(src.SecondsToRecharge) + {} + + FVirtualCurrencyRechargeTime(const TSharedPtr& obj) : FVirtualCurrencyRechargeTime() + { + readFromValue(obj); + } + + ~FVirtualCurrencyRechargeTime(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterInventoryResult : public FPlayFabBaseModel + { + // [optional] Unique identifier of the character for this inventory. + FString CharacterId; + + // [optional] Array of inventory items belonging to the character. + TArray Inventory; + // [optional] Array of virtual currency balance(s) belonging to the character. + TMap VirtualCurrency; + // [optional] Array of remaining times and timestamps for virtual currencies. + TMap VirtualCurrencyRechargeTimes; + FGetCharacterInventoryResult() : + FPlayFabBaseModel(), + CharacterId(), + Inventory(), + VirtualCurrency(), + VirtualCurrencyRechargeTimes() + {} + + FGetCharacterInventoryResult(const FGetCharacterInventoryResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Inventory(src.Inventory), + VirtualCurrency(src.VirtualCurrency), + VirtualCurrencyRechargeTimes(src.VirtualCurrencyRechargeTimes) + {} + + FGetCharacterInventoryResult(const TSharedPtr& obj) : FGetCharacterInventoryResult() + { + readFromValue(obj); + } + + ~FGetCharacterInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterLeaderboardRequest : public FPlayFabBaseModel + { + // [optional] Optional character type on which to filter the leaderboard entries. + FString CharacterType; + + // [optional] Maximum number of entries to retrieve. Default 10, maximum 100. + Boxed MaxResultsCount; + + // First entry in the leaderboard to be retrieved. + int32 StartPosition; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + FGetCharacterLeaderboardRequest() : + FPlayFabBaseModel(), + CharacterType(), + MaxResultsCount(), + StartPosition(0), + StatisticName() + {} + + FGetCharacterLeaderboardRequest(const FGetCharacterLeaderboardRequest& src) : + FPlayFabBaseModel(), + CharacterType(src.CharacterType), + MaxResultsCount(src.MaxResultsCount), + StartPosition(src.StartPosition), + StatisticName(src.StatisticName) + {} + + FGetCharacterLeaderboardRequest(const TSharedPtr& obj) : FGetCharacterLeaderboardRequest() + { + readFromValue(obj); + } + + ~FGetCharacterLeaderboardRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterLeaderboardResult : public FPlayFabBaseModel + { + // [optional] Ordered list of leaderboard entries. + TArray Leaderboard; + FGetCharacterLeaderboardResult() : + FPlayFabBaseModel(), + Leaderboard() + {} + + FGetCharacterLeaderboardResult(const FGetCharacterLeaderboardResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard) + {} + + FGetCharacterLeaderboardResult(const TSharedPtr& obj) : FGetCharacterLeaderboardResult() + { + readFromValue(obj); + } + + ~FGetCharacterLeaderboardResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterStatisticsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + FGetCharacterStatisticsRequest() : + FPlayFabBaseModel(), + CharacterId() + {} + + FGetCharacterStatisticsRequest(const FGetCharacterStatisticsRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId) + {} + + FGetCharacterStatisticsRequest(const TSharedPtr& obj) : FGetCharacterStatisticsRequest() + { + readFromValue(obj); + } + + ~FGetCharacterStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterStatisticsResult : public FPlayFabBaseModel + { + // [optional] The requested character statistics. + TMap CharacterStatistics; + FGetCharacterStatisticsResult() : + FPlayFabBaseModel(), + CharacterStatistics() + {} + + FGetCharacterStatisticsResult(const FGetCharacterStatisticsResult& src) : + FPlayFabBaseModel(), + CharacterStatistics(src.CharacterStatistics) + {} + + FGetCharacterStatisticsResult(const TSharedPtr& obj) : FGetCharacterStatisticsResult() + { + readFromValue(obj); + } + + ~FGetCharacterStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentDownloadUrlRequest : public FPlayFabBaseModel + { + // [optional] HTTP method to fetch item - GET or HEAD. Use HEAD when only fetching metadata. Default is GET. + FString HttpMethod; + + // Key of the content item to fetch, usually formatted as a path, e.g. images/a.png + FString Key; + + /** + * [optional] True to download through CDN. CDN provides higher download bandwidth and lower latency. However, if you want the latest, + * non-cached version of the content during development, set this to false. Default is true. + */ + Boxed ThruCDN; + + FGetContentDownloadUrlRequest() : + FPlayFabBaseModel(), + HttpMethod(), + Key(), + ThruCDN() + {} + + FGetContentDownloadUrlRequest(const FGetContentDownloadUrlRequest& src) : + FPlayFabBaseModel(), + HttpMethod(src.HttpMethod), + Key(src.Key), + ThruCDN(src.ThruCDN) + {} + + FGetContentDownloadUrlRequest(const TSharedPtr& obj) : FGetContentDownloadUrlRequest() + { + readFromValue(obj); + } + + ~FGetContentDownloadUrlRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentDownloadUrlResult : public FPlayFabBaseModel + { + // [optional] URL for downloading content via HTTP GET or HEAD method. The URL will expire in approximately one hour. + FString URL; + + FGetContentDownloadUrlResult() : + FPlayFabBaseModel(), + URL() + {} + + FGetContentDownloadUrlResult(const FGetContentDownloadUrlResult& src) : + FPlayFabBaseModel(), + URL(src.URL) + {} + + FGetContentDownloadUrlResult(const TSharedPtr& obj) : FGetContentDownloadUrlResult() + { + readFromValue(obj); + } + + ~FGetContentDownloadUrlResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfileViewConstraints : public FPlayFabBaseModel + { + // Whether to show player's avatar URL. Defaults to false + bool ShowAvatarUrl; + + // Whether to show the banned until time. Defaults to false + bool ShowBannedUntil; + + // Whether to show campaign attributions. Defaults to false + bool ShowCampaignAttributions; + + // Whether to show contact email addresses. Defaults to false + bool ShowContactEmailAddresses; + + // Whether to show the created date. Defaults to false + bool ShowCreated; + + // Whether to show the display name. Defaults to false + bool ShowDisplayName; + + // Whether to show the last login time. Defaults to false + bool ShowLastLogin; + + // Whether to show the linked accounts. Defaults to false + bool ShowLinkedAccounts; + + // Whether to show player's locations. Defaults to false + bool ShowLocations; + + // Whether to show player's membership information. Defaults to false + bool ShowMemberships; + + // Whether to show origination. Defaults to false + bool ShowOrigination; + + // Whether to show push notification registrations. Defaults to false + bool ShowPushNotificationRegistrations; + + // Reserved for future development + bool ShowStatistics; + + // Whether to show tags. Defaults to false + bool ShowTags; + + // Whether to show the total value to date in usd. Defaults to false + bool ShowTotalValueToDateInUsd; + + // Whether to show the values to date. Defaults to false + bool ShowValuesToDate; + + FPlayerProfileViewConstraints() : + FPlayFabBaseModel(), + ShowAvatarUrl(false), + ShowBannedUntil(false), + ShowCampaignAttributions(false), + ShowContactEmailAddresses(false), + ShowCreated(false), + ShowDisplayName(false), + ShowLastLogin(false), + ShowLinkedAccounts(false), + ShowLocations(false), + ShowMemberships(false), + ShowOrigination(false), + ShowPushNotificationRegistrations(false), + ShowStatistics(false), + ShowTags(false), + ShowTotalValueToDateInUsd(false), + ShowValuesToDate(false) + {} + + FPlayerProfileViewConstraints(const FPlayerProfileViewConstraints& src) : + FPlayFabBaseModel(), + ShowAvatarUrl(src.ShowAvatarUrl), + ShowBannedUntil(src.ShowBannedUntil), + ShowCampaignAttributions(src.ShowCampaignAttributions), + ShowContactEmailAddresses(src.ShowContactEmailAddresses), + ShowCreated(src.ShowCreated), + ShowDisplayName(src.ShowDisplayName), + ShowLastLogin(src.ShowLastLogin), + ShowLinkedAccounts(src.ShowLinkedAccounts), + ShowLocations(src.ShowLocations), + ShowMemberships(src.ShowMemberships), + ShowOrigination(src.ShowOrigination), + ShowPushNotificationRegistrations(src.ShowPushNotificationRegistrations), + ShowStatistics(src.ShowStatistics), + ShowTags(src.ShowTags), + ShowTotalValueToDateInUsd(src.ShowTotalValueToDateInUsd), + ShowValuesToDate(src.ShowValuesToDate) + {} + + FPlayerProfileViewConstraints(const TSharedPtr& obj) : FPlayerProfileViewConstraints() + { + readFromValue(obj); + } + + ~FPlayerProfileViewConstraints(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendLeaderboardAroundPlayerRequest : public FPlayFabBaseModel + { + // [optional] Indicates whether Facebook friends should be included in the response. Default is true. + Boxed IncludeFacebookFriends; + + // [optional] Indicates whether Steam service friends should be included in the response. Default is true. + Boxed IncludeSteamFriends; + + // [optional] Maximum number of entries to retrieve. Default 10, maximum 100. + Boxed MaxResultsCount; + + // [optional] PlayFab unique identifier of the user to center the leaderboard around. If null will center on the logged in user. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // Statistic used to rank players for this leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + // [optional] Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. + FString XboxToken; + + FGetFriendLeaderboardAroundPlayerRequest() : + FPlayFabBaseModel(), + IncludeFacebookFriends(), + IncludeSteamFriends(), + MaxResultsCount(), + PlayFabId(), + ProfileConstraints(nullptr), + StatisticName(), + UseSpecificVersion(), + Version(), + XboxToken() + {} + + FGetFriendLeaderboardAroundPlayerRequest(const FGetFriendLeaderboardAroundPlayerRequest& src) : + FPlayFabBaseModel(), + IncludeFacebookFriends(src.IncludeFacebookFriends), + IncludeSteamFriends(src.IncludeSteamFriends), + MaxResultsCount(src.MaxResultsCount), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version), + XboxToken(src.XboxToken) + {} + + FGetFriendLeaderboardAroundPlayerRequest(const TSharedPtr& obj) : FGetFriendLeaderboardAroundPlayerRequest() + { + readFromValue(obj); + } + + ~FGetFriendLeaderboardAroundPlayerRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLeaderboardEntry : public FPlayFabBaseModel + { + // [optional] Title-specific display name of the user for this leaderboard entry. + FString DisplayName; + + // [optional] PlayFab unique identifier of the user for this leaderboard entry. + FString PlayFabId; + + // User's overall position in the leaderboard. + int32 Position; + + // [optional] The profile of the user, if requested. + TSharedPtr Profile; + + // Specific value of the user's statistic. + int32 StatValue; + + FPlayerLeaderboardEntry() : + FPlayFabBaseModel(), + DisplayName(), + PlayFabId(), + Position(0), + Profile(nullptr), + StatValue(0) + {} + + FPlayerLeaderboardEntry(const FPlayerLeaderboardEntry& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName), + PlayFabId(src.PlayFabId), + Position(src.Position), + Profile(src.Profile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.Profile)) : nullptr), + StatValue(src.StatValue) + {} + + FPlayerLeaderboardEntry(const TSharedPtr& obj) : FPlayerLeaderboardEntry() + { + readFromValue(obj); + } + + ~FPlayerLeaderboardEntry(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendLeaderboardAroundPlayerResult : public FPlayFabBaseModel + { + // [optional] Ordered listing of users and their positions in the requested leaderboard. + TArray Leaderboard; + // [optional] The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. + Boxed NextReset; + + // The version of the leaderboard returned. + int32 Version; + + FGetFriendLeaderboardAroundPlayerResult() : + FPlayFabBaseModel(), + Leaderboard(), + NextReset(), + Version(0) + {} + + FGetFriendLeaderboardAroundPlayerResult(const FGetFriendLeaderboardAroundPlayerResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard), + NextReset(src.NextReset), + Version(src.Version) + {} + + FGetFriendLeaderboardAroundPlayerResult(const TSharedPtr& obj) : FGetFriendLeaderboardAroundPlayerResult() + { + readFromValue(obj); + } + + ~FGetFriendLeaderboardAroundPlayerResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendLeaderboardRequest : public FPlayFabBaseModel + { + // [optional] Indicates whether Facebook friends should be included in the response. Default is true. + Boxed IncludeFacebookFriends; + + // [optional] Indicates whether Steam service friends should be included in the response. Default is true. + Boxed IncludeSteamFriends; + + // [optional] Maximum number of entries to retrieve. Default 10, maximum 100. + Boxed MaxResultsCount; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // Position in the leaderboard to start this listing (defaults to the first entry). + int32 StartPosition; + + // Statistic used to rank friends for this leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + // [optional] Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. + FString XboxToken; + + FGetFriendLeaderboardRequest() : + FPlayFabBaseModel(), + IncludeFacebookFriends(), + IncludeSteamFriends(), + MaxResultsCount(), + ProfileConstraints(nullptr), + StartPosition(0), + StatisticName(), + UseSpecificVersion(), + Version(), + XboxToken() + {} + + FGetFriendLeaderboardRequest(const FGetFriendLeaderboardRequest& src) : + FPlayFabBaseModel(), + IncludeFacebookFriends(src.IncludeFacebookFriends), + IncludeSteamFriends(src.IncludeSteamFriends), + MaxResultsCount(src.MaxResultsCount), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StartPosition(src.StartPosition), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version), + XboxToken(src.XboxToken) + {} + + FGetFriendLeaderboardRequest(const TSharedPtr& obj) : FGetFriendLeaderboardRequest() + { + readFromValue(obj); + } + + ~FGetFriendLeaderboardRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendsListRequest : public FPlayFabBaseModel + { + // [optional] Indicates whether Facebook friends should be included in the response. Default is true. + Boxed IncludeFacebookFriends; + + // [optional] Indicates whether Steam service friends should be included in the response. Default is true. + Boxed IncludeSteamFriends; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // [optional] Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. + FString XboxToken; + + FGetFriendsListRequest() : + FPlayFabBaseModel(), + IncludeFacebookFriends(), + IncludeSteamFriends(), + ProfileConstraints(nullptr), + XboxToken() + {} + + FGetFriendsListRequest(const FGetFriendsListRequest& src) : + FPlayFabBaseModel(), + IncludeFacebookFriends(src.IncludeFacebookFriends), + IncludeSteamFriends(src.IncludeSteamFriends), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + XboxToken(src.XboxToken) + {} + + FGetFriendsListRequest(const TSharedPtr& obj) : FGetFriendsListRequest() + { + readFromValue(obj); + } + + ~FGetFriendsListRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendsListResult : public FPlayFabBaseModel + { + // [optional] Array of friends found. + TArray Friends; + FGetFriendsListResult() : + FPlayFabBaseModel(), + Friends() + {} + + FGetFriendsListResult(const FGetFriendsListResult& src) : + FPlayFabBaseModel(), + Friends(src.Friends) + {} + + FGetFriendsListResult(const TSharedPtr& obj) : FGetFriendsListResult() + { + readFromValue(obj); + } + + ~FGetFriendsListResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundCharacterRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character on which to center the leaderboard. + FString CharacterId; + + // [optional] Optional character type on which to filter the leaderboard entries. + FString CharacterType; + + // [optional] Maximum number of entries to retrieve. Default 10, maximum 100. + Boxed MaxResultsCount; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + FGetLeaderboardAroundCharacterRequest() : + FPlayFabBaseModel(), + CharacterId(), + CharacterType(), + MaxResultsCount(), + StatisticName() + {} + + FGetLeaderboardAroundCharacterRequest(const FGetLeaderboardAroundCharacterRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterType(src.CharacterType), + MaxResultsCount(src.MaxResultsCount), + StatisticName(src.StatisticName) + {} + + FGetLeaderboardAroundCharacterRequest(const TSharedPtr& obj) : FGetLeaderboardAroundCharacterRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundCharacterRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundCharacterResult : public FPlayFabBaseModel + { + // [optional] Ordered list of leaderboard entries. + TArray Leaderboard; + FGetLeaderboardAroundCharacterResult() : + FPlayFabBaseModel(), + Leaderboard() + {} + + FGetLeaderboardAroundCharacterResult(const FGetLeaderboardAroundCharacterResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard) + {} + + FGetLeaderboardAroundCharacterResult(const TSharedPtr& obj) : FGetLeaderboardAroundCharacterResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundPlayerRequest : public FPlayFabBaseModel + { + // [optional] Maximum number of entries to retrieve. Default 10, maximum 100. + Boxed MaxResultsCount; + + // [optional] PlayFab unique identifier of the user to center the leaderboard around. If null will center on the logged in user. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // Statistic used to rank players for this leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + FGetLeaderboardAroundPlayerRequest() : + FPlayFabBaseModel(), + MaxResultsCount(), + PlayFabId(), + ProfileConstraints(nullptr), + StatisticName(), + UseSpecificVersion(), + Version() + {} + + FGetLeaderboardAroundPlayerRequest(const FGetLeaderboardAroundPlayerRequest& src) : + FPlayFabBaseModel(), + MaxResultsCount(src.MaxResultsCount), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version) + {} + + FGetLeaderboardAroundPlayerRequest(const TSharedPtr& obj) : FGetLeaderboardAroundPlayerRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundPlayerRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundPlayerResult : public FPlayFabBaseModel + { + // [optional] Ordered listing of users and their positions in the requested leaderboard. + TArray Leaderboard; + // [optional] The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. + Boxed NextReset; + + // The version of the leaderboard returned. + int32 Version; + + FGetLeaderboardAroundPlayerResult() : + FPlayFabBaseModel(), + Leaderboard(), + NextReset(), + Version(0) + {} + + FGetLeaderboardAroundPlayerResult(const FGetLeaderboardAroundPlayerResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard), + NextReset(src.NextReset), + Version(src.Version) + {} + + FGetLeaderboardAroundPlayerResult(const TSharedPtr& obj) : FGetLeaderboardAroundPlayerResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundPlayerResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardForUsersCharactersRequest : public FPlayFabBaseModel + { + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + FGetLeaderboardForUsersCharactersRequest() : + FPlayFabBaseModel(), + MaxResultsCount(0), + StatisticName() + {} + + FGetLeaderboardForUsersCharactersRequest(const FGetLeaderboardForUsersCharactersRequest& src) : + FPlayFabBaseModel(), + MaxResultsCount(src.MaxResultsCount), + StatisticName(src.StatisticName) + {} + + FGetLeaderboardForUsersCharactersRequest(const TSharedPtr& obj) : FGetLeaderboardForUsersCharactersRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardForUsersCharactersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardForUsersCharactersResult : public FPlayFabBaseModel + { + // [optional] Ordered list of leaderboard entries. + TArray Leaderboard; + FGetLeaderboardForUsersCharactersResult() : + FPlayFabBaseModel(), + Leaderboard() + {} + + FGetLeaderboardForUsersCharactersResult(const FGetLeaderboardForUsersCharactersResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard) + {} + + FGetLeaderboardForUsersCharactersResult(const TSharedPtr& obj) : FGetLeaderboardForUsersCharactersResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardForUsersCharactersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardRequest : public FPlayFabBaseModel + { + // [optional] Maximum number of entries to retrieve. Default 10, maximum 100. + Boxed MaxResultsCount; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // Position in the leaderboard to start this listing (defaults to the first entry). + int32 StartPosition; + + // Statistic used to rank players for this leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + FGetLeaderboardRequest() : + FPlayFabBaseModel(), + MaxResultsCount(), + ProfileConstraints(nullptr), + StartPosition(0), + StatisticName(), + UseSpecificVersion(), + Version() + {} + + FGetLeaderboardRequest(const FGetLeaderboardRequest& src) : + FPlayFabBaseModel(), + MaxResultsCount(src.MaxResultsCount), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StartPosition(src.StartPosition), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version) + {} + + FGetLeaderboardRequest(const TSharedPtr& obj) : FGetLeaderboardRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardResult : public FPlayFabBaseModel + { + // [optional] Ordered listing of users and their positions in the requested leaderboard. + TArray Leaderboard; + // [optional] The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. + Boxed NextReset; + + // The version of the leaderboard returned. + int32 Version; + + FGetLeaderboardResult() : + FPlayFabBaseModel(), + Leaderboard(), + NextReset(), + Version(0) + {} + + FGetLeaderboardResult(const FGetLeaderboardResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard), + NextReset(src.NextReset), + Version(src.Version) + {} + + FGetLeaderboardResult(const TSharedPtr& obj) : FGetLeaderboardResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPaymentTokenRequest : public FPlayFabBaseModel + { + // The name of service to provide the payment token. Allowed Values are: xsolla + FString TokenProvider; + + FGetPaymentTokenRequest() : + FPlayFabBaseModel(), + TokenProvider() + {} + + FGetPaymentTokenRequest(const FGetPaymentTokenRequest& src) : + FPlayFabBaseModel(), + TokenProvider(src.TokenProvider) + {} + + FGetPaymentTokenRequest(const TSharedPtr& obj) : FGetPaymentTokenRequest() + { + readFromValue(obj); + } + + ~FGetPaymentTokenRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPaymentTokenResult : public FPlayFabBaseModel + { + // [optional] PlayFab's purchase order identifier. + FString OrderId; + + // [optional] The token from provider. + FString ProviderToken; + + FGetPaymentTokenResult() : + FPlayFabBaseModel(), + OrderId(), + ProviderToken() + {} + + FGetPaymentTokenResult(const FGetPaymentTokenResult& src) : + FPlayFabBaseModel(), + OrderId(src.OrderId), + ProviderToken(src.ProviderToken) + {} + + FGetPaymentTokenResult(const TSharedPtr& obj) : FGetPaymentTokenResult() + { + readFromValue(obj); + } + + ~FGetPaymentTokenResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPhotonAuthenticationTokenRequest : public FPlayFabBaseModel + { + // The Photon applicationId for the game you wish to log into. + FString PhotonApplicationId; + + FGetPhotonAuthenticationTokenRequest() : + FPlayFabBaseModel(), + PhotonApplicationId() + {} + + FGetPhotonAuthenticationTokenRequest(const FGetPhotonAuthenticationTokenRequest& src) : + FPlayFabBaseModel(), + PhotonApplicationId(src.PhotonApplicationId) + {} + + FGetPhotonAuthenticationTokenRequest(const TSharedPtr& obj) : FGetPhotonAuthenticationTokenRequest() + { + readFromValue(obj); + } + + ~FGetPhotonAuthenticationTokenRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPhotonAuthenticationTokenResult : public FPlayFabBaseModel + { + // [optional] The Photon authentication token for this game-session. + FString PhotonCustomAuthenticationToken; + + FGetPhotonAuthenticationTokenResult() : + FPlayFabBaseModel(), + PhotonCustomAuthenticationToken() + {} + + FGetPhotonAuthenticationTokenResult(const FGetPhotonAuthenticationTokenResult& src) : + FPlayFabBaseModel(), + PhotonCustomAuthenticationToken(src.PhotonCustomAuthenticationToken) + {} + + FGetPhotonAuthenticationTokenResult(const TSharedPtr& obj) : FGetPhotonAuthenticationTokenResult() + { + readFromValue(obj); + } + + ~FGetPhotonAuthenticationTokenResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoRequestParams : public FPlayFabBaseModel + { + // Whether to get character inventories. Defaults to false. + bool GetCharacterInventories; + + // Whether to get the list of characters. Defaults to false. + bool GetCharacterList; + + // Whether to get player profile. Defaults to false. + bool GetPlayerProfile; + + // Whether to get player statistics. Defaults to false. + bool GetPlayerStatistics; + + // Whether to get title data. Defaults to false. + bool GetTitleData; + + // Whether to get the player's account Info. Defaults to false + bool GetUserAccountInfo; + + // Whether to get the player's custom data. Defaults to false + bool GetUserData; + + // Whether to get the player's inventory. Defaults to false + bool GetUserInventory; + + // Whether to get the player's read only data. Defaults to false + bool GetUserReadOnlyData; + + // Whether to get the player's virtual currency balances. Defaults to false + bool GetUserVirtualCurrency; + + // [optional] Specific statistics to retrieve. Leave null to get all keys. Has no effect if GetPlayerStatistics is false + TArray PlayerStatisticNames; + // [optional] Specifies the properties to return from the player profile. Defaults to returning the player's display name. + TSharedPtr ProfileConstraints; + + // [optional] Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetTitleData is false + TArray TitleDataKeys; + // [optional] Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetUserData is false + TArray UserDataKeys; + /** + * [optional] Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetUserReadOnlyData is + * false + */ + TArray UserReadOnlyDataKeys; + FGetPlayerCombinedInfoRequestParams() : + FPlayFabBaseModel(), + GetCharacterInventories(false), + GetCharacterList(false), + GetPlayerProfile(false), + GetPlayerStatistics(false), + GetTitleData(false), + GetUserAccountInfo(false), + GetUserData(false), + GetUserInventory(false), + GetUserReadOnlyData(false), + GetUserVirtualCurrency(false), + PlayerStatisticNames(), + ProfileConstraints(nullptr), + TitleDataKeys(), + UserDataKeys(), + UserReadOnlyDataKeys() + {} + + FGetPlayerCombinedInfoRequestParams(const FGetPlayerCombinedInfoRequestParams& src) : + FPlayFabBaseModel(), + GetCharacterInventories(src.GetCharacterInventories), + GetCharacterList(src.GetCharacterList), + GetPlayerProfile(src.GetPlayerProfile), + GetPlayerStatistics(src.GetPlayerStatistics), + GetTitleData(src.GetTitleData), + GetUserAccountInfo(src.GetUserAccountInfo), + GetUserData(src.GetUserData), + GetUserInventory(src.GetUserInventory), + GetUserReadOnlyData(src.GetUserReadOnlyData), + GetUserVirtualCurrency(src.GetUserVirtualCurrency), + PlayerStatisticNames(src.PlayerStatisticNames), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + TitleDataKeys(src.TitleDataKeys), + UserDataKeys(src.UserDataKeys), + UserReadOnlyDataKeys(src.UserReadOnlyDataKeys) + {} + + FGetPlayerCombinedInfoRequestParams(const TSharedPtr& obj) : FGetPlayerCombinedInfoRequestParams() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoRequestParams(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoRequest : public FPlayFabBaseModel + { + // Flags for which pieces of info to return for the user. + FGetPlayerCombinedInfoRequestParams InfoRequestParameters; + + // [optional] PlayFabId of the user whose data will be returned. If not filled included, we return the data for the calling player. + FString PlayFabId; + + FGetPlayerCombinedInfoRequest() : + FPlayFabBaseModel(), + InfoRequestParameters(), + PlayFabId() + {} + + FGetPlayerCombinedInfoRequest(const FGetPlayerCombinedInfoRequest& src) : + FPlayFabBaseModel(), + InfoRequestParameters(src.InfoRequestParameters), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerCombinedInfoRequest(const TSharedPtr& obj) : FGetPlayerCombinedInfoRequest() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticValue : public FPlayFabBaseModel + { + // [optional] unique name of the statistic + FString StatisticName; + + // statistic value for the player + int32 Value; + + // for updates to an existing statistic value for a player, the version of the statistic when it was loaded + uint32 Version; + + FStatisticValue() : + FPlayFabBaseModel(), + StatisticName(), + Value(0), + Version(0) + {} + + FStatisticValue(const FStatisticValue& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName), + Value(src.Value), + Version(src.Version) + {} + + FStatisticValue(const TSharedPtr& obj) : FStatisticValue() + { + readFromValue(obj); + } + + ~FStatisticValue(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoResultPayload : public FPlayFabBaseModel + { + // [optional] Account information for the user. This is always retrieved. + TSharedPtr AccountInfo; + + // [optional] Inventories for each character for the user. + TArray CharacterInventories; + // [optional] List of characters for the user. + TArray CharacterList; + /** + * [optional] The profile of the players. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + TSharedPtr PlayerProfile; + + // [optional] List of statistics for this player. + TArray PlayerStatistics; + // [optional] Title data for this title. + TMap TitleData; + // [optional] User specific custom data. + TMap UserData; + // The version of the UserData that was returned. + uint32 UserDataVersion; + + // [optional] Array of inventory items in the user's current inventory. + TArray UserInventory; + // [optional] User specific read-only data. + TMap UserReadOnlyData; + // The version of the Read-Only UserData that was returned. + uint32 UserReadOnlyDataVersion; + + // [optional] Dictionary of virtual currency balance(s) belonging to the user. + TMap UserVirtualCurrency; + // [optional] Dictionary of remaining times and timestamps for virtual currencies. + TMap UserVirtualCurrencyRechargeTimes; + FGetPlayerCombinedInfoResultPayload() : + FPlayFabBaseModel(), + AccountInfo(nullptr), + CharacterInventories(), + CharacterList(), + PlayerProfile(nullptr), + PlayerStatistics(), + TitleData(), + UserData(), + UserDataVersion(0), + UserInventory(), + UserReadOnlyData(), + UserReadOnlyDataVersion(0), + UserVirtualCurrency(), + UserVirtualCurrencyRechargeTimes() + {} + + FGetPlayerCombinedInfoResultPayload(const FGetPlayerCombinedInfoResultPayload& src) : + FPlayFabBaseModel(), + AccountInfo(src.AccountInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.AccountInfo)) : nullptr), + CharacterInventories(src.CharacterInventories), + CharacterList(src.CharacterList), + PlayerProfile(src.PlayerProfile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.PlayerProfile)) : nullptr), + PlayerStatistics(src.PlayerStatistics), + TitleData(src.TitleData), + UserData(src.UserData), + UserDataVersion(src.UserDataVersion), + UserInventory(src.UserInventory), + UserReadOnlyData(src.UserReadOnlyData), + UserReadOnlyDataVersion(src.UserReadOnlyDataVersion), + UserVirtualCurrency(src.UserVirtualCurrency), + UserVirtualCurrencyRechargeTimes(src.UserVirtualCurrencyRechargeTimes) + {} + + FGetPlayerCombinedInfoResultPayload(const TSharedPtr& obj) : FGetPlayerCombinedInfoResultPayload() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoResultPayload(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoResult : public FPlayFabBaseModel + { + // [optional] Results for requested info. + TSharedPtr InfoResultPayload; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayerCombinedInfoResult() : + FPlayFabBaseModel(), + InfoResultPayload(nullptr), + PlayFabId() + {} + + FGetPlayerCombinedInfoResult(const FGetPlayerCombinedInfoResult& src) : + FPlayFabBaseModel(), + InfoResultPayload(src.InfoResultPayload.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoResultPayload(*src.InfoResultPayload)) : nullptr), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerCombinedInfoResult(const TSharedPtr& obj) : FGetPlayerCombinedInfoResult() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerProfileRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + FGetPlayerProfileRequest() : + FPlayFabBaseModel(), + PlayFabId(), + ProfileConstraints(nullptr) + {} + + FGetPlayerProfileRequest(const FGetPlayerProfileRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr) + {} + + FGetPlayerProfileRequest(const TSharedPtr& obj) : FGetPlayerProfileRequest() + { + readFromValue(obj); + } + + ~FGetPlayerProfileRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerProfileResult : public FPlayFabBaseModel + { + /** + * [optional] The profile of the player. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + TSharedPtr PlayerProfile; + + FGetPlayerProfileResult() : + FPlayFabBaseModel(), + PlayerProfile(nullptr) + {} + + FGetPlayerProfileResult(const FGetPlayerProfileResult& src) : + FPlayFabBaseModel(), + PlayerProfile(src.PlayerProfile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.PlayerProfile)) : nullptr) + {} + + FGetPlayerProfileResult(const TSharedPtr& obj) : FGetPlayerProfileResult() + { + readFromValue(obj); + } + + ~FGetPlayerProfileResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerSegmentsRequest : public FPlayFabBaseModel + { + FGetPlayerSegmentsRequest() : + FPlayFabBaseModel() + {} + + FGetPlayerSegmentsRequest(const FGetPlayerSegmentsRequest& src) : + FPlayFabBaseModel() + {} + + FGetPlayerSegmentsRequest(const TSharedPtr& obj) : FGetPlayerSegmentsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerSegmentsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSegmentResult : public FPlayFabBaseModel + { + // [optional] Identifier of the segments AB Test, if it is attached to one. + FString ABTestParent; + + // Unique identifier for this segment. + FString Id; + + // [optional] Segment name. + FString Name; + + FGetSegmentResult() : + FPlayFabBaseModel(), + ABTestParent(), + Id(), + Name() + {} + + FGetSegmentResult(const FGetSegmentResult& src) : + FPlayFabBaseModel(), + ABTestParent(src.ABTestParent), + Id(src.Id), + Name(src.Name) + {} + + FGetSegmentResult(const TSharedPtr& obj) : FGetSegmentResult() + { + readFromValue(obj); + } + + ~FGetSegmentResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerSegmentsResult : public FPlayFabBaseModel + { + // [optional] Array of segments the requested player currently belongs to. + TArray Segments; + FGetPlayerSegmentsResult() : + FPlayFabBaseModel(), + Segments() + {} + + FGetPlayerSegmentsResult(const FGetPlayerSegmentsResult& src) : + FPlayFabBaseModel(), + Segments(src.Segments) + {} + + FGetPlayerSegmentsResult(const TSharedPtr& obj) : FGetPlayerSegmentsResult() + { + readFromValue(obj); + } + + ~FGetPlayerSegmentsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticNameVersion : public FPlayFabBaseModel + { + // unique name of the statistic + FString StatisticName; + + // the version of the statistic to be returned + uint32 Version; + + FStatisticNameVersion() : + FPlayFabBaseModel(), + StatisticName(), + Version(0) + {} + + FStatisticNameVersion(const FStatisticNameVersion& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName), + Version(src.Version) + {} + + FStatisticNameVersion(const TSharedPtr& obj) : FStatisticNameVersion() + { + readFromValue(obj); + } + + ~FStatisticNameVersion(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticsRequest : public FPlayFabBaseModel + { + // [optional] statistics to return (current version will be returned for each) + TArray StatisticNames; + /** + * [optional] statistics to return, if StatisticNames is not set (only statistics which have a version matching that provided will be + * returned) + */ + TArray StatisticNameVersions; + FGetPlayerStatisticsRequest() : + FPlayFabBaseModel(), + StatisticNames(), + StatisticNameVersions() + {} + + FGetPlayerStatisticsRequest(const FGetPlayerStatisticsRequest& src) : + FPlayFabBaseModel(), + StatisticNames(src.StatisticNames), + StatisticNameVersions(src.StatisticNameVersions) + {} + + FGetPlayerStatisticsRequest(const TSharedPtr& obj) : FGetPlayerStatisticsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticsResult : public FPlayFabBaseModel + { + // [optional] User statistics for the requested user. + TArray Statistics; + FGetPlayerStatisticsResult() : + FPlayFabBaseModel(), + Statistics() + {} + + FGetPlayerStatisticsResult(const FGetPlayerStatisticsResult& src) : + FPlayFabBaseModel(), + Statistics(src.Statistics) + {} + + FGetPlayerStatisticsResult(const TSharedPtr& obj) : FGetPlayerStatisticsResult() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticVersionsRequest : public FPlayFabBaseModel + { + // [optional] unique name of the statistic + FString StatisticName; + + FGetPlayerStatisticVersionsRequest() : + FPlayFabBaseModel(), + StatisticName() + {} + + FGetPlayerStatisticVersionsRequest(const FGetPlayerStatisticVersionsRequest& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName) + {} + + FGetPlayerStatisticVersionsRequest(const TSharedPtr& obj) : FGetPlayerStatisticVersionsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticVersionsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerStatisticVersion : public FPlayFabBaseModel + { + // time when the statistic version became active + FDateTime ActivationTime; + + // [optional] time when the statistic version became inactive due to statistic version incrementing + Boxed DeactivationTime; + + // [optional] time at which the statistic version was scheduled to become active, based on the configured ResetInterval + Boxed ScheduledActivationTime; + + // [optional] time at which the statistic version was scheduled to become inactive, based on the configured ResetInterval + Boxed ScheduledDeactivationTime; + + // [optional] name of the statistic when the version became active + FString StatisticName; + + // version of the statistic + uint32 Version; + + FPlayerStatisticVersion() : + FPlayFabBaseModel(), + ActivationTime(0), + DeactivationTime(), + ScheduledActivationTime(), + ScheduledDeactivationTime(), + StatisticName(), + Version(0) + {} + + FPlayerStatisticVersion(const FPlayerStatisticVersion& src) : + FPlayFabBaseModel(), + ActivationTime(src.ActivationTime), + DeactivationTime(src.DeactivationTime), + ScheduledActivationTime(src.ScheduledActivationTime), + ScheduledDeactivationTime(src.ScheduledDeactivationTime), + StatisticName(src.StatisticName), + Version(src.Version) + {} + + FPlayerStatisticVersion(const TSharedPtr& obj) : FPlayerStatisticVersion() + { + readFromValue(obj); + } + + ~FPlayerStatisticVersion(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticVersionsResult : public FPlayFabBaseModel + { + // [optional] version change history of the statistic + TArray StatisticVersions; + FGetPlayerStatisticVersionsResult() : + FPlayFabBaseModel(), + StatisticVersions() + {} + + FGetPlayerStatisticVersionsResult(const FGetPlayerStatisticVersionsResult& src) : + FPlayFabBaseModel(), + StatisticVersions(src.StatisticVersions) + {} + + FGetPlayerStatisticVersionsResult(const TSharedPtr& obj) : FGetPlayerStatisticVersionsResult() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticVersionsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTagsRequest : public FPlayFabBaseModel + { + // [optional] Optional namespace to filter results by + FString Namespace; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayerTagsRequest() : + FPlayFabBaseModel(), + Namespace(), + PlayFabId() + {} + + FGetPlayerTagsRequest(const FGetPlayerTagsRequest& src) : + FPlayFabBaseModel(), + Namespace(src.Namespace), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerTagsRequest(const TSharedPtr& obj) : FGetPlayerTagsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerTagsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTagsResult : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Canonical tags (including namespace and tag's name) for the requested user + TArray Tags; + FGetPlayerTagsResult() : + FPlayFabBaseModel(), + PlayFabId(), + Tags() + {} + + FGetPlayerTagsResult(const FGetPlayerTagsResult& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + Tags(src.Tags) + {} + + FGetPlayerTagsResult(const TSharedPtr& obj) : FGetPlayerTagsResult() + { + readFromValue(obj); + } + + ~FGetPlayerTagsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTradesRequest : public FPlayFabBaseModel + { + // [optional] Returns only trades with the given status. If null, returns all trades. + Boxed StatusFilter; + + FGetPlayerTradesRequest() : + FPlayFabBaseModel(), + StatusFilter() + {} + + FGetPlayerTradesRequest(const FGetPlayerTradesRequest& src) : + FPlayFabBaseModel(), + StatusFilter(src.StatusFilter) + {} + + FGetPlayerTradesRequest(const TSharedPtr& obj) : FGetPlayerTradesRequest() + { + readFromValue(obj); + } + + ~FGetPlayerTradesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTradesResponse : public FPlayFabBaseModel + { + // [optional] History of trades which this player has accepted. + TArray AcceptedTrades; + // [optional] The trades for this player which are currently available to be accepted. + TArray OpenedTrades; + FGetPlayerTradesResponse() : + FPlayFabBaseModel(), + AcceptedTrades(), + OpenedTrades() + {} + + FGetPlayerTradesResponse(const FGetPlayerTradesResponse& src) : + FPlayFabBaseModel(), + AcceptedTrades(src.AcceptedTrades), + OpenedTrades(src.OpenedTrades) + {} + + FGetPlayerTradesResponse(const TSharedPtr& obj) : FGetPlayerTradesResponse() + { + readFromValue(obj); + } + + ~FGetPlayerTradesResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookIDsRequest : public FPlayFabBaseModel + { + // Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. + TArray FacebookIDs; + FGetPlayFabIDsFromFacebookIDsRequest() : + FPlayFabBaseModel(), + FacebookIDs() + {} + + FGetPlayFabIDsFromFacebookIDsRequest(const FGetPlayFabIDsFromFacebookIDsRequest& src) : + FPlayFabBaseModel(), + FacebookIDs(src.FacebookIDs) + {} + + FGetPlayFabIDsFromFacebookIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Facebook identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromFacebookIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromFacebookIDsResult(const FGetPlayFabIDsFromFacebookIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromFacebookIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookInstantGamesIdsRequest : public FPlayFabBaseModel + { + // Array of unique Facebook Instant Games identifiers for which the title needs to get PlayFab identifiers. + TArray FacebookInstantGamesIds; + FGetPlayFabIDsFromFacebookInstantGamesIdsRequest() : + FPlayFabBaseModel(), + FacebookInstantGamesIds() + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsRequest(const FGetPlayFabIDsFromFacebookInstantGamesIdsRequest& src) : + FPlayFabBaseModel(), + FacebookInstantGamesIds(src.FacebookInstantGamesIds) + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookInstantGamesIdsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookInstantGamesIdsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookInstantGamesIdsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Facebook Instant Games identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromFacebookInstantGamesIdsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsResult(const FGetPlayFabIDsFromFacebookInstantGamesIdsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookInstantGamesIdsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookInstantGamesIdsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromGameCenterIDsRequest : public FPlayFabBaseModel + { + // Array of unique Game Center identifiers (the Player Identifier) for which the title needs to get PlayFab identifiers. + TArray GameCenterIDs; + FGetPlayFabIDsFromGameCenterIDsRequest() : + FPlayFabBaseModel(), + GameCenterIDs() + {} + + FGetPlayFabIDsFromGameCenterIDsRequest(const FGetPlayFabIDsFromGameCenterIDsRequest& src) : + FPlayFabBaseModel(), + GameCenterIDs(src.GameCenterIDs) + {} + + FGetPlayFabIDsFromGameCenterIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromGameCenterIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromGameCenterIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromGameCenterIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Game Center identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromGameCenterIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromGameCenterIDsResult(const FGetPlayFabIDsFromGameCenterIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromGameCenterIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromGameCenterIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromGameCenterIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromGenericIDsRequest : public FPlayFabBaseModel + { + /** + * Array of unique generic service identifiers for which the title needs to get PlayFab identifiers. Currently limited to a + * maximum of 10 in a single request. + */ + TArray GenericIDs; + FGetPlayFabIDsFromGenericIDsRequest() : + FPlayFabBaseModel(), + GenericIDs() + {} + + FGetPlayFabIDsFromGenericIDsRequest(const FGetPlayFabIDsFromGenericIDsRequest& src) : + FPlayFabBaseModel(), + GenericIDs(src.GenericIDs) + {} + + FGetPlayFabIDsFromGenericIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromGenericIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromGenericIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromGenericIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of generic service identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromGenericIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromGenericIDsResult(const FGetPlayFabIDsFromGenericIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromGenericIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromGenericIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromGenericIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromGoogleIDsRequest : public FPlayFabBaseModel + { + // Array of unique Google identifiers (Google+ user IDs) for which the title needs to get PlayFab identifiers. + TArray GoogleIDs; + FGetPlayFabIDsFromGoogleIDsRequest() : + FPlayFabBaseModel(), + GoogleIDs() + {} + + FGetPlayFabIDsFromGoogleIDsRequest(const FGetPlayFabIDsFromGoogleIDsRequest& src) : + FPlayFabBaseModel(), + GoogleIDs(src.GoogleIDs) + {} + + FGetPlayFabIDsFromGoogleIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromGoogleIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromGoogleIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGooglePlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Google identifier for a user. + FString GoogleId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Google identifier. + FString PlayFabId; + + FGooglePlayFabIdPair() : + FPlayFabBaseModel(), + GoogleId(), + PlayFabId() + {} + + FGooglePlayFabIdPair(const FGooglePlayFabIdPair& src) : + FPlayFabBaseModel(), + GoogleId(src.GoogleId), + PlayFabId(src.PlayFabId) + {} + + FGooglePlayFabIdPair(const TSharedPtr& obj) : FGooglePlayFabIdPair() + { + readFromValue(obj); + } + + ~FGooglePlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromGoogleIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Google identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromGoogleIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromGoogleIDsResult(const FGetPlayFabIDsFromGoogleIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromGoogleIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromGoogleIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromGoogleIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromKongregateIDsRequest : public FPlayFabBaseModel + { + // Array of unique Kongregate identifiers (Kongregate's user_id) for which the title needs to get PlayFab identifiers. + TArray KongregateIDs; + FGetPlayFabIDsFromKongregateIDsRequest() : + FPlayFabBaseModel(), + KongregateIDs() + {} + + FGetPlayFabIDsFromKongregateIDsRequest(const FGetPlayFabIDsFromKongregateIDsRequest& src) : + FPlayFabBaseModel(), + KongregateIDs(src.KongregateIDs) + {} + + FGetPlayFabIDsFromKongregateIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromKongregateIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromKongregateIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FKongregatePlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Kongregate identifier for a user. + FString KongregateId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Kongregate identifier. + FString PlayFabId; + + FKongregatePlayFabIdPair() : + FPlayFabBaseModel(), + KongregateId(), + PlayFabId() + {} + + FKongregatePlayFabIdPair(const FKongregatePlayFabIdPair& src) : + FPlayFabBaseModel(), + KongregateId(src.KongregateId), + PlayFabId(src.PlayFabId) + {} + + FKongregatePlayFabIdPair(const TSharedPtr& obj) : FKongregatePlayFabIdPair() + { + readFromValue(obj); + } + + ~FKongregatePlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromKongregateIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Kongregate identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromKongregateIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromKongregateIDsResult(const FGetPlayFabIDsFromKongregateIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromKongregateIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromKongregateIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromKongregateIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest : public FPlayFabBaseModel + { + // Array of unique Nintendo Switch Device identifiers for which the title needs to get PlayFab identifiers. + TArray NintendoSwitchDeviceIds; + FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest() : + FPlayFabBaseModel(), + NintendoSwitchDeviceIds() + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest(const FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceIds(src.NintendoSwitchDeviceIds) + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FNintendoSwitchPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Nintendo Switch Device identifier for a user. + FString NintendoSwitchDeviceId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Nintendo Switch Device identifier. + FString PlayFabId; + + FNintendoSwitchPlayFabIdPair() : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(), + PlayFabId() + {} + + FNintendoSwitchPlayFabIdPair(const FNintendoSwitchPlayFabIdPair& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId), + PlayFabId(src.PlayFabId) + {} + + FNintendoSwitchPlayFabIdPair(const TSharedPtr& obj) : FNintendoSwitchPlayFabIdPair() + { + readFromValue(obj); + } + + ~FNintendoSwitchPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Nintendo Switch Device identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(const FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromSteamIDsRequest : public FPlayFabBaseModel + { + // [optional] Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. + TArray SteamStringIDs; + FGetPlayFabIDsFromSteamIDsRequest() : + FPlayFabBaseModel(), + SteamStringIDs() + {} + + FGetPlayFabIDsFromSteamIDsRequest(const FGetPlayFabIDsFromSteamIDsRequest& src) : + FPlayFabBaseModel(), + SteamStringIDs(src.SteamStringIDs) + {} + + FGetPlayFabIDsFromSteamIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromSteamIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromSteamIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSteamPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Steam identifier. + FString PlayFabId; + + // [optional] Unique Steam identifier for a user. + FString SteamStringId; + + FSteamPlayFabIdPair() : + FPlayFabBaseModel(), + PlayFabId(), + SteamStringId() + {} + + FSteamPlayFabIdPair(const FSteamPlayFabIdPair& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + SteamStringId(src.SteamStringId) + {} + + FSteamPlayFabIdPair(const TSharedPtr& obj) : FSteamPlayFabIdPair() + { + readFromValue(obj); + } + + ~FSteamPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromSteamIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Steam identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromSteamIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromSteamIDsResult(const FGetPlayFabIDsFromSteamIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromSteamIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromSteamIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromSteamIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromTwitchIDsRequest : public FPlayFabBaseModel + { + // Array of unique Twitch identifiers (Twitch's _id) for which the title needs to get PlayFab identifiers. + TArray TwitchIds; + FGetPlayFabIDsFromTwitchIDsRequest() : + FPlayFabBaseModel(), + TwitchIds() + {} + + FGetPlayFabIDsFromTwitchIDsRequest(const FGetPlayFabIDsFromTwitchIDsRequest& src) : + FPlayFabBaseModel(), + TwitchIds(src.TwitchIds) + {} + + FGetPlayFabIDsFromTwitchIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromTwitchIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromTwitchIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FTwitchPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Twitch identifier. + FString PlayFabId; + + // [optional] Unique Twitch identifier for a user. + FString TwitchId; + + FTwitchPlayFabIdPair() : + FPlayFabBaseModel(), + PlayFabId(), + TwitchId() + {} + + FTwitchPlayFabIdPair(const FTwitchPlayFabIdPair& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + TwitchId(src.TwitchId) + {} + + FTwitchPlayFabIdPair(const TSharedPtr& obj) : FTwitchPlayFabIdPair() + { + readFromValue(obj); + } + + ~FTwitchPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromTwitchIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Twitch identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromTwitchIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromTwitchIDsResult(const FGetPlayFabIDsFromTwitchIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromTwitchIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromTwitchIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromTwitchIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPublisherDataRequest : public FPlayFabBaseModel + { + // array of keys to get back data from the Publisher data blob, set by the admin tools + TArray Keys; + FGetPublisherDataRequest() : + FPlayFabBaseModel(), + Keys() + {} + + FGetPublisherDataRequest(const FGetPublisherDataRequest& src) : + FPlayFabBaseModel(), + Keys(src.Keys) + {} + + FGetPublisherDataRequest(const TSharedPtr& obj) : FGetPublisherDataRequest() + { + readFromValue(obj); + } + + ~FGetPublisherDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPublisherDataResult : public FPlayFabBaseModel + { + // [optional] a dictionary object of key / value pairs + TMap Data; + FGetPublisherDataResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPublisherDataResult(const FGetPublisherDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPublisherDataResult(const TSharedPtr& obj) : FGetPublisherDataResult() + { + readFromValue(obj); + } + + ~FGetPublisherDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPurchaseRequest : public FPlayFabBaseModel + { + // Purchase order identifier. + FString OrderId; + + FGetPurchaseRequest() : + FPlayFabBaseModel(), + OrderId() + {} + + FGetPurchaseRequest(const FGetPurchaseRequest& src) : + FPlayFabBaseModel(), + OrderId(src.OrderId) + {} + + FGetPurchaseRequest(const TSharedPtr& obj) : FGetPurchaseRequest() + { + readFromValue(obj); + } + + ~FGetPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPurchaseResult : public FPlayFabBaseModel + { + // [optional] Purchase order identifier. + FString OrderId; + + // [optional] Payment provider used for transaction (If not VC) + FString PaymentProvider; + + // Date and time of the purchase. + FDateTime PurchaseDate; + + // [optional] Provider transaction ID (If not VC) + FString TransactionId; + + // [optional] PlayFab transaction status + FString TransactionStatus; + + FGetPurchaseResult() : + FPlayFabBaseModel(), + OrderId(), + PaymentProvider(), + PurchaseDate(0), + TransactionId(), + TransactionStatus() + {} + + FGetPurchaseResult(const FGetPurchaseResult& src) : + FPlayFabBaseModel(), + OrderId(src.OrderId), + PaymentProvider(src.PaymentProvider), + PurchaseDate(src.PurchaseDate), + TransactionId(src.TransactionId), + TransactionStatus(src.TransactionStatus) + {} + + FGetPurchaseResult(const TSharedPtr& obj) : FGetPurchaseResult() + { + readFromValue(obj); + } + + ~FGetPurchaseResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSharedGroupDataRequest : public FPlayFabBaseModel + { + // [optional] If true, return the list of all members of the shared group. + Boxed GetMembers; + + /** + * [optional] Specific keys to retrieve from the shared group (if not specified, all keys will be returned, while an empty array + * indicates that no keys should be returned). + */ + TArray Keys; + // Unique identifier for the shared group. + FString SharedGroupId; + + FGetSharedGroupDataRequest() : + FPlayFabBaseModel(), + GetMembers(), + Keys(), + SharedGroupId() + {} + + FGetSharedGroupDataRequest(const FGetSharedGroupDataRequest& src) : + FPlayFabBaseModel(), + GetMembers(src.GetMembers), + Keys(src.Keys), + SharedGroupId(src.SharedGroupId) + {} + + FGetSharedGroupDataRequest(const TSharedPtr& obj) : FGetSharedGroupDataRequest() + { + readFromValue(obj); + } + + ~FGetSharedGroupDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSharedGroupDataRecord : public FPlayFabBaseModel + { + // Timestamp for when this data was last updated. + FDateTime LastUpdated; + + // [optional] Unique PlayFab identifier of the user to last update this value. + FString LastUpdatedBy; + + // [optional] Indicates whether this data can be read by all users (public) or only members of the group (private). + Boxed Permission; + + // [optional] Data stored for the specified group data key. + FString Value; + + FSharedGroupDataRecord() : + FPlayFabBaseModel(), + LastUpdated(0), + LastUpdatedBy(), + Permission(), + Value() + {} + + FSharedGroupDataRecord(const FSharedGroupDataRecord& src) : + FPlayFabBaseModel(), + LastUpdated(src.LastUpdated), + LastUpdatedBy(src.LastUpdatedBy), + Permission(src.Permission), + Value(src.Value) + {} + + FSharedGroupDataRecord(const TSharedPtr& obj) : FSharedGroupDataRecord() + { + readFromValue(obj); + } + + ~FSharedGroupDataRecord(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSharedGroupDataResult : public FPlayFabBaseModel + { + // [optional] Data for the requested keys. + TMap Data; + // [optional] List of PlayFabId identifiers for the members of this group, if requested. + TArray Members; + FGetSharedGroupDataResult() : + FPlayFabBaseModel(), + Data(), + Members() + {} + + FGetSharedGroupDataResult(const FGetSharedGroupDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data), + Members(src.Members) + {} + + FGetSharedGroupDataResult(const TSharedPtr& obj) : FGetSharedGroupDataResult() + { + readFromValue(obj); + } + + ~FGetSharedGroupDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetStoreItemsRequest : public FPlayFabBaseModel + { + // [optional] catalog version to store items from. Use default catalog version if null + FString CatalogVersion; + + // Unqiue identifier for the store which is being requested. + FString StoreId; + + FGetStoreItemsRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + StoreId() + {} + + FGetStoreItemsRequest(const FGetStoreItemsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + StoreId(src.StoreId) + {} + + FGetStoreItemsRequest(const TSharedPtr& obj) : FGetStoreItemsRequest() + { + readFromValue(obj); + } + + ~FGetStoreItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStoreMarketingModel : public FPlayFabBaseModel + { + // [optional] Tagline for a store. + FString Description; + + // [optional] Display name of a store as it will appear to users. + FString DisplayName; + + // [optional] Custom data about a store. + FJsonKeeper Metadata; + + FStoreMarketingModel() : + FPlayFabBaseModel(), + Description(), + DisplayName(), + Metadata() + {} + + FStoreMarketingModel(const FStoreMarketingModel& src) : + FPlayFabBaseModel(), + Description(src.Description), + DisplayName(src.DisplayName), + Metadata(src.Metadata) + {} + + FStoreMarketingModel(const TSharedPtr& obj) : FStoreMarketingModel() + { + readFromValue(obj); + } + + ~FStoreMarketingModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum SourceType + { + SourceTypeAdmin, + SourceTypeBackEnd, + SourceTypeGameClient, + SourceTypeGameServer, + SourceTypePartner, + SourceTypeCustom, + SourceTypeAPI + }; + + PLAYFABCPP_API void writeSourceTypeEnumJSON(SourceType enumVal, JsonWriter& writer); + PLAYFABCPP_API SourceType readSourceTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API SourceType readSourceTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FStoreItem : public FPlayFabBaseModel + { + // [optional] Store specific custom data. The data only exists as part of this store; it is not transferred to item instances + FJsonKeeper CustomData; + + // [optional] Intended display position for this item. Note that 0 is the first position + Boxed DisplayPosition; + + /** + * Unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the + * catalog + */ + FString ItemId; + + // [optional] Override prices for this item for specific currencies + TMap RealCurrencyPrices; + // [optional] Override prices for this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + TMap VirtualCurrencyPrices; + FStoreItem() : + FPlayFabBaseModel(), + CustomData(), + DisplayPosition(), + ItemId(), + RealCurrencyPrices(), + VirtualCurrencyPrices() + {} + + FStoreItem(const FStoreItem& src) : + FPlayFabBaseModel(), + CustomData(src.CustomData), + DisplayPosition(src.DisplayPosition), + ItemId(src.ItemId), + RealCurrencyPrices(src.RealCurrencyPrices), + VirtualCurrencyPrices(src.VirtualCurrencyPrices) + {} + + FStoreItem(const TSharedPtr& obj) : FStoreItem() + { + readFromValue(obj); + } + + ~FStoreItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetStoreItemsResult : public FPlayFabBaseModel + { + // [optional] The base catalog that this store is a part of. + FString CatalogVersion; + + // [optional] Additional data about the store. + TSharedPtr MarketingData; + + // [optional] How the store was last updated (Admin or a third party). + Boxed Source; + + // [optional] Array of items which can be purchased from this store. + TArray Store; + // [optional] The ID of this store. + FString StoreId; + + FGetStoreItemsResult() : + FPlayFabBaseModel(), + CatalogVersion(), + MarketingData(nullptr), + Source(), + Store(), + StoreId() + {} + + FGetStoreItemsResult(const FGetStoreItemsResult& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + MarketingData(src.MarketingData.IsValid() ? MakeShareable(new FStoreMarketingModel(*src.MarketingData)) : nullptr), + Source(src.Source), + Store(src.Store), + StoreId(src.StoreId) + {} + + FGetStoreItemsResult(const TSharedPtr& obj) : FGetStoreItemsResult() + { + readFromValue(obj); + } + + ~FGetStoreItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTimeRequest : public FPlayFabBaseModel + { + FGetTimeRequest() : + FPlayFabBaseModel() + {} + + FGetTimeRequest(const FGetTimeRequest& src) : + FPlayFabBaseModel() + {} + + FGetTimeRequest(const TSharedPtr& obj) : FGetTimeRequest() + { + readFromValue(obj); + } + + ~FGetTimeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTimeResult : public FPlayFabBaseModel + { + // Current server time when the request was received, in UTC + FDateTime Time; + + FGetTimeResult() : + FPlayFabBaseModel(), + Time(0) + {} + + FGetTimeResult(const FGetTimeResult& src) : + FPlayFabBaseModel(), + Time(src.Time) + {} + + FGetTimeResult(const TSharedPtr& obj) : FGetTimeResult() + { + readFromValue(obj); + } + + ~FGetTimeResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleDataRequest : public FPlayFabBaseModel + { + // [optional] Specific keys to search for in the title data (leave null to get all keys) + TArray Keys; + FGetTitleDataRequest() : + FPlayFabBaseModel(), + Keys() + {} + + FGetTitleDataRequest(const FGetTitleDataRequest& src) : + FPlayFabBaseModel(), + Keys(src.Keys) + {} + + FGetTitleDataRequest(const TSharedPtr& obj) : FGetTitleDataRequest() + { + readFromValue(obj); + } + + ~FGetTitleDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleDataResult : public FPlayFabBaseModel + { + // [optional] a dictionary object of key / value pairs + TMap Data; + FGetTitleDataResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetTitleDataResult(const FGetTitleDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetTitleDataResult(const TSharedPtr& obj) : FGetTitleDataResult() + { + readFromValue(obj); + } + + ~FGetTitleDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleNewsRequest : public FPlayFabBaseModel + { + // [optional] Limits the results to the last n entries. Defaults to 10 if not set. + Boxed Count; + + FGetTitleNewsRequest() : + FPlayFabBaseModel(), + Count() + {} + + FGetTitleNewsRequest(const FGetTitleNewsRequest& src) : + FPlayFabBaseModel(), + Count(src.Count) + {} + + FGetTitleNewsRequest(const TSharedPtr& obj) : FGetTitleNewsRequest() + { + readFromValue(obj); + } + + ~FGetTitleNewsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FTitleNewsItem : public FPlayFabBaseModel + { + // [optional] News item text. + FString Body; + + // [optional] Unique identifier of news item. + FString NewsId; + + // Date and time when the news items was posted. + FDateTime Timestamp; + + // [optional] Title of the news item. + FString Title; + + FTitleNewsItem() : + FPlayFabBaseModel(), + Body(), + NewsId(), + Timestamp(0), + Title() + {} + + FTitleNewsItem(const FTitleNewsItem& src) : + FPlayFabBaseModel(), + Body(src.Body), + NewsId(src.NewsId), + Timestamp(src.Timestamp), + Title(src.Title) + {} + + FTitleNewsItem(const TSharedPtr& obj) : FTitleNewsItem() + { + readFromValue(obj); + } + + ~FTitleNewsItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleNewsResult : public FPlayFabBaseModel + { + // [optional] Array of news items. + TArray News; + FGetTitleNewsResult() : + FPlayFabBaseModel(), + News() + {} + + FGetTitleNewsResult(const FGetTitleNewsResult& src) : + FPlayFabBaseModel(), + News(src.News) + {} + + FGetTitleNewsResult(const TSharedPtr& obj) : FGetTitleNewsResult() + { + readFromValue(obj); + } + + ~FGetTitleNewsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitlePublicKeyRequest : public FPlayFabBaseModel + { + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + // The shared secret key for this title + FString TitleSharedSecret; + + FGetTitlePublicKeyRequest() : + FPlayFabBaseModel(), + TitleId(), + TitleSharedSecret() + {} + + FGetTitlePublicKeyRequest(const FGetTitlePublicKeyRequest& src) : + FPlayFabBaseModel(), + TitleId(src.TitleId), + TitleSharedSecret(src.TitleSharedSecret) + {} + + FGetTitlePublicKeyRequest(const TSharedPtr& obj) : FGetTitlePublicKeyRequest() + { + readFromValue(obj); + } + + ~FGetTitlePublicKeyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitlePublicKeyResult : public FPlayFabBaseModel + { + // [optional] Base64 encoded RSA CSP byte array blob containing the title's public RSA key + FString RSAPublicKey; + + FGetTitlePublicKeyResult() : + FPlayFabBaseModel(), + RSAPublicKey() + {} + + FGetTitlePublicKeyResult(const FGetTitlePublicKeyResult& src) : + FPlayFabBaseModel(), + RSAPublicKey(src.RSAPublicKey) + {} + + FGetTitlePublicKeyResult(const TSharedPtr& obj) : FGetTitlePublicKeyResult() + { + readFromValue(obj); + } + + ~FGetTitlePublicKeyResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTradeStatusRequest : public FPlayFabBaseModel + { + // Player who opened trade. + FString OfferingPlayerId; + + // Trade identifier as returned by OpenTradeOffer. + FString TradeId; + + FGetTradeStatusRequest() : + FPlayFabBaseModel(), + OfferingPlayerId(), + TradeId() + {} + + FGetTradeStatusRequest(const FGetTradeStatusRequest& src) : + FPlayFabBaseModel(), + OfferingPlayerId(src.OfferingPlayerId), + TradeId(src.TradeId) + {} + + FGetTradeStatusRequest(const TSharedPtr& obj) : FGetTradeStatusRequest() + { + readFromValue(obj); + } + + ~FGetTradeStatusRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTradeStatusResponse : public FPlayFabBaseModel + { + // [optional] Information about the requested trade. + TSharedPtr Trade; + + FGetTradeStatusResponse() : + FPlayFabBaseModel(), + Trade(nullptr) + {} + + FGetTradeStatusResponse(const FGetTradeStatusResponse& src) : + FPlayFabBaseModel(), + Trade(src.Trade.IsValid() ? MakeShareable(new FTradeInfo(*src.Trade)) : nullptr) + {} + + FGetTradeStatusResponse(const TSharedPtr& obj) : FGetTradeStatusResponse() + { + readFromValue(obj); + } + + ~FGetTradeStatusResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserDataRequest : public FPlayFabBaseModel + { + /** + * [optional] The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + Boxed IfChangedFromDataVersion; + + // [optional] List of unique keys to load from. + TArray Keys; + /** + * [optional] Unique PlayFab identifier of the user to load data for. Optional, defaults to yourself if not set. When specified to a + * PlayFab id of another player, then this will only return public keys for that account. + */ + FString PlayFabId; + + FGetUserDataRequest() : + FPlayFabBaseModel(), + IfChangedFromDataVersion(), + Keys(), + PlayFabId() + {} + + FGetUserDataRequest(const FGetUserDataRequest& src) : + FPlayFabBaseModel(), + IfChangedFromDataVersion(src.IfChangedFromDataVersion), + Keys(src.Keys), + PlayFabId(src.PlayFabId) + {} + + FGetUserDataRequest(const TSharedPtr& obj) : FGetUserDataRequest() + { + readFromValue(obj); + } + + ~FGetUserDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserDataResult : public FPlayFabBaseModel + { + // [optional] User specific data for this title. + TMap Data; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FGetUserDataResult() : + FPlayFabBaseModel(), + Data(), + DataVersion(0) + {} + + FGetUserDataResult(const FGetUserDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data), + DataVersion(src.DataVersion) + {} + + FGetUserDataResult(const TSharedPtr& obj) : FGetUserDataResult() + { + readFromValue(obj); + } + + ~FGetUserDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserInventoryRequest : public FPlayFabBaseModel + { + FGetUserInventoryRequest() : + FPlayFabBaseModel() + {} + + FGetUserInventoryRequest(const FGetUserInventoryRequest& src) : + FPlayFabBaseModel() + {} + + FGetUserInventoryRequest(const TSharedPtr& obj) : FGetUserInventoryRequest() + { + readFromValue(obj); + } + + ~FGetUserInventoryRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserInventoryResult : public FPlayFabBaseModel + { + // [optional] Array of inventory items belonging to the user. + TArray Inventory; + // [optional] Array of virtual currency balance(s) belonging to the user. + TMap VirtualCurrency; + // [optional] Array of remaining times and timestamps for virtual currencies. + TMap VirtualCurrencyRechargeTimes; + FGetUserInventoryResult() : + FPlayFabBaseModel(), + Inventory(), + VirtualCurrency(), + VirtualCurrencyRechargeTimes() + {} + + FGetUserInventoryResult(const FGetUserInventoryResult& src) : + FPlayFabBaseModel(), + Inventory(src.Inventory), + VirtualCurrency(src.VirtualCurrency), + VirtualCurrencyRechargeTimes(src.VirtualCurrencyRechargeTimes) + {} + + FGetUserInventoryResult(const TSharedPtr& obj) : FGetUserInventoryResult() + { + readFromValue(obj); + } + + ~FGetUserInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetWindowsHelloChallengeRequest : public FPlayFabBaseModel + { + // SHA256 hash of the PublicKey generated by Windows Hello. + FString PublicKeyHint; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FGetWindowsHelloChallengeRequest() : + FPlayFabBaseModel(), + PublicKeyHint(), + TitleId() + {} + + FGetWindowsHelloChallengeRequest(const FGetWindowsHelloChallengeRequest& src) : + FPlayFabBaseModel(), + PublicKeyHint(src.PublicKeyHint), + TitleId(src.TitleId) + {} + + FGetWindowsHelloChallengeRequest(const TSharedPtr& obj) : FGetWindowsHelloChallengeRequest() + { + readFromValue(obj); + } + + ~FGetWindowsHelloChallengeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetWindowsHelloChallengeResponse : public FPlayFabBaseModel + { + // [optional] Server generated challenge to be signed by the user. + FString Challenge; + + FGetWindowsHelloChallengeResponse() : + FPlayFabBaseModel(), + Challenge() + {} + + FGetWindowsHelloChallengeResponse(const FGetWindowsHelloChallengeResponse& src) : + FPlayFabBaseModel(), + Challenge(src.Challenge) + {} + + FGetWindowsHelloChallengeResponse(const TSharedPtr& obj) : FGetWindowsHelloChallengeResponse() + { + readFromValue(obj); + } + + ~FGetWindowsHelloChallengeResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantCharacterToUserRequest : public FPlayFabBaseModel + { + // [optional] Catalog version from which items are to be granted. + FString CatalogVersion; + + // Non-unique display name of the character being granted (1-20 characters in length). + FString CharacterName; + + /** + * Catalog item identifier of the item in the user's inventory that corresponds to the character in the catalog to be + * created. + */ + FString ItemId; + + FGrantCharacterToUserRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterName(), + ItemId() + {} + + FGrantCharacterToUserRequest(const FGrantCharacterToUserRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterName(src.CharacterName), + ItemId(src.ItemId) + {} + + FGrantCharacterToUserRequest(const TSharedPtr& obj) : FGrantCharacterToUserRequest() + { + readFromValue(obj); + } + + ~FGrantCharacterToUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantCharacterToUserResult : public FPlayFabBaseModel + { + // [optional] Unique identifier tagged to this character. + FString CharacterId; + + // [optional] Type of character that was created. + FString CharacterType; + + // Indicates whether this character was created successfully. + bool Result; + + FGrantCharacterToUserResult() : + FPlayFabBaseModel(), + CharacterId(), + CharacterType(), + Result(false) + {} + + FGrantCharacterToUserResult(const FGrantCharacterToUserResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterType(src.CharacterType), + Result(src.Result) + {} + + FGrantCharacterToUserResult(const TSharedPtr& obj) : FGrantCharacterToUserResult() + { + readFromValue(obj); + } + + ~FGrantCharacterToUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemPurchaseRequest : public FPlayFabBaseModel + { + // [optional] Title-specific text concerning this purchase. + FString Annotation; + + // Unique ItemId of the item to purchase. + FString ItemId; + + // How many of this item to purchase. Min 1, maximum 25. + uint32 Quantity; + + // [optional] Items to be upgraded as a result of this purchase (upgraded items are hidden, as they are "replaced" by the new items). + TArray UpgradeFromItems; + FItemPurchaseRequest() : + FPlayFabBaseModel(), + Annotation(), + ItemId(), + Quantity(0), + UpgradeFromItems() + {} + + FItemPurchaseRequest(const FItemPurchaseRequest& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + ItemId(src.ItemId), + Quantity(src.Quantity), + UpgradeFromItems(src.UpgradeFromItems) + {} + + FItemPurchaseRequest(const TSharedPtr& obj) : FItemPurchaseRequest() + { + readFromValue(obj); + } + + ~FItemPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkAndroidDeviceIDRequest : public FPlayFabBaseModel + { + // [optional] Specific model of the user's device. + FString AndroidDevice; + + // Android device identifier for the user's device. + FString AndroidDeviceId; + + // [optional] If another user is already linked to the device, unlink the other user and re-link. + Boxed ForceLink; + + // [optional] Specific Operating System version for the user's device. + FString OS; + + FLinkAndroidDeviceIDRequest() : + FPlayFabBaseModel(), + AndroidDevice(), + AndroidDeviceId(), + ForceLink(), + OS() + {} + + FLinkAndroidDeviceIDRequest(const FLinkAndroidDeviceIDRequest& src) : + FPlayFabBaseModel(), + AndroidDevice(src.AndroidDevice), + AndroidDeviceId(src.AndroidDeviceId), + ForceLink(src.ForceLink), + OS(src.OS) + {} + + FLinkAndroidDeviceIDRequest(const TSharedPtr& obj) : FLinkAndroidDeviceIDRequest() + { + readFromValue(obj); + } + + ~FLinkAndroidDeviceIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkAndroidDeviceIDResult : public FPlayFabBaseModel + { + FLinkAndroidDeviceIDResult() : + FPlayFabBaseModel() + {} + + FLinkAndroidDeviceIDResult(const FLinkAndroidDeviceIDResult& src) : + FPlayFabBaseModel() + {} + + FLinkAndroidDeviceIDResult(const TSharedPtr& obj) : FLinkAndroidDeviceIDResult() + { + readFromValue(obj); + } + + ~FLinkAndroidDeviceIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkCustomIDRequest : public FPlayFabBaseModel + { + // Custom unique identifier for the user, generated by the title. + FString CustomId; + + // [optional] If another user is already linked to the custom ID, unlink the other user and re-link. + Boxed ForceLink; + + FLinkCustomIDRequest() : + FPlayFabBaseModel(), + CustomId(), + ForceLink() + {} + + FLinkCustomIDRequest(const FLinkCustomIDRequest& src) : + FPlayFabBaseModel(), + CustomId(src.CustomId), + ForceLink(src.ForceLink) + {} + + FLinkCustomIDRequest(const TSharedPtr& obj) : FLinkCustomIDRequest() + { + readFromValue(obj); + } + + ~FLinkCustomIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkCustomIDResult : public FPlayFabBaseModel + { + FLinkCustomIDResult() : + FPlayFabBaseModel() + {} + + FLinkCustomIDResult(const FLinkCustomIDResult& src) : + FPlayFabBaseModel() + {} + + FLinkCustomIDResult(const TSharedPtr& obj) : FLinkCustomIDResult() + { + readFromValue(obj); + } + + ~FLinkCustomIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkFacebookAccountRequest : public FPlayFabBaseModel + { + // Unique identifier from Facebook for the user. + FString AccessToken; + + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + FLinkFacebookAccountRequest() : + FPlayFabBaseModel(), + AccessToken(), + ForceLink() + {} + + FLinkFacebookAccountRequest(const FLinkFacebookAccountRequest& src) : + FPlayFabBaseModel(), + AccessToken(src.AccessToken), + ForceLink(src.ForceLink) + {} + + FLinkFacebookAccountRequest(const TSharedPtr& obj) : FLinkFacebookAccountRequest() + { + readFromValue(obj); + } + + ~FLinkFacebookAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkFacebookAccountResult : public FPlayFabBaseModel + { + FLinkFacebookAccountResult() : + FPlayFabBaseModel() + {} + + FLinkFacebookAccountResult(const FLinkFacebookAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkFacebookAccountResult(const TSharedPtr& obj) : FLinkFacebookAccountResult() + { + readFromValue(obj); + } + + ~FLinkFacebookAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkFacebookInstantGamesIdRequest : public FPlayFabBaseModel + { + // Facebook Instant Games signature for the user. + FString FacebookInstantGamesSignature; + + // [optional] If another user is already linked to the Facebook Instant Games ID, unlink the other user and re-link. + Boxed ForceLink; + + FLinkFacebookInstantGamesIdRequest() : + FPlayFabBaseModel(), + FacebookInstantGamesSignature(), + ForceLink() + {} + + FLinkFacebookInstantGamesIdRequest(const FLinkFacebookInstantGamesIdRequest& src) : + FPlayFabBaseModel(), + FacebookInstantGamesSignature(src.FacebookInstantGamesSignature), + ForceLink(src.ForceLink) + {} + + FLinkFacebookInstantGamesIdRequest(const TSharedPtr& obj) : FLinkFacebookInstantGamesIdRequest() + { + readFromValue(obj); + } + + ~FLinkFacebookInstantGamesIdRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkFacebookInstantGamesIdResult : public FPlayFabBaseModel + { + FLinkFacebookInstantGamesIdResult() : + FPlayFabBaseModel() + {} + + FLinkFacebookInstantGamesIdResult(const FLinkFacebookInstantGamesIdResult& src) : + FPlayFabBaseModel() + {} + + FLinkFacebookInstantGamesIdResult(const TSharedPtr& obj) : FLinkFacebookInstantGamesIdResult() + { + readFromValue(obj); + } + + ~FLinkFacebookInstantGamesIdResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkGameCenterAccountRequest : public FPlayFabBaseModel + { + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + // Game Center identifier for the player account to be linked. + FString GameCenterId; + + FLinkGameCenterAccountRequest() : + FPlayFabBaseModel(), + ForceLink(), + GameCenterId() + {} + + FLinkGameCenterAccountRequest(const FLinkGameCenterAccountRequest& src) : + FPlayFabBaseModel(), + ForceLink(src.ForceLink), + GameCenterId(src.GameCenterId) + {} + + FLinkGameCenterAccountRequest(const TSharedPtr& obj) : FLinkGameCenterAccountRequest() + { + readFromValue(obj); + } + + ~FLinkGameCenterAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkGameCenterAccountResult : public FPlayFabBaseModel + { + FLinkGameCenterAccountResult() : + FPlayFabBaseModel() + {} + + FLinkGameCenterAccountResult(const FLinkGameCenterAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkGameCenterAccountResult(const TSharedPtr& obj) : FLinkGameCenterAccountResult() + { + readFromValue(obj); + } + + ~FLinkGameCenterAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkGoogleAccountRequest : public FPlayFabBaseModel + { + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + /** + * [optional] Server authentication code obtained on the client by calling getServerAuthCode() + * (https://developers.google.com/identity/sign-in/android/offline-access) from Google Play for the user. + */ + FString ServerAuthCode; + + FLinkGoogleAccountRequest() : + FPlayFabBaseModel(), + ForceLink(), + ServerAuthCode() + {} + + FLinkGoogleAccountRequest(const FLinkGoogleAccountRequest& src) : + FPlayFabBaseModel(), + ForceLink(src.ForceLink), + ServerAuthCode(src.ServerAuthCode) + {} + + FLinkGoogleAccountRequest(const TSharedPtr& obj) : FLinkGoogleAccountRequest() + { + readFromValue(obj); + } + + ~FLinkGoogleAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkGoogleAccountResult : public FPlayFabBaseModel + { + FLinkGoogleAccountResult() : + FPlayFabBaseModel() + {} + + FLinkGoogleAccountResult(const FLinkGoogleAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkGoogleAccountResult(const TSharedPtr& obj) : FLinkGoogleAccountResult() + { + readFromValue(obj); + } + + ~FLinkGoogleAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkIOSDeviceIDRequest : public FPlayFabBaseModel + { + // Vendor-specific iOS identifier for the user's device. + FString DeviceId; + + // [optional] Specific model of the user's device. + FString DeviceModel; + + // [optional] If another user is already linked to the device, unlink the other user and re-link. + Boxed ForceLink; + + // [optional] Specific Operating System version for the user's device. + FString OS; + + FLinkIOSDeviceIDRequest() : + FPlayFabBaseModel(), + DeviceId(), + DeviceModel(), + ForceLink(), + OS() + {} + + FLinkIOSDeviceIDRequest(const FLinkIOSDeviceIDRequest& src) : + FPlayFabBaseModel(), + DeviceId(src.DeviceId), + DeviceModel(src.DeviceModel), + ForceLink(src.ForceLink), + OS(src.OS) + {} + + FLinkIOSDeviceIDRequest(const TSharedPtr& obj) : FLinkIOSDeviceIDRequest() + { + readFromValue(obj); + } + + ~FLinkIOSDeviceIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkIOSDeviceIDResult : public FPlayFabBaseModel + { + FLinkIOSDeviceIDResult() : + FPlayFabBaseModel() + {} + + FLinkIOSDeviceIDResult(const FLinkIOSDeviceIDResult& src) : + FPlayFabBaseModel() + {} + + FLinkIOSDeviceIDResult(const TSharedPtr& obj) : FLinkIOSDeviceIDResult() + { + readFromValue(obj); + } + + ~FLinkIOSDeviceIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkKongregateAccountRequest : public FPlayFabBaseModel + { + // Valid session auth ticket issued by Kongregate + FString AuthTicket; + + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + // Numeric user ID assigned by Kongregate + FString KongregateId; + + FLinkKongregateAccountRequest() : + FPlayFabBaseModel(), + AuthTicket(), + ForceLink(), + KongregateId() + {} + + FLinkKongregateAccountRequest(const FLinkKongregateAccountRequest& src) : + FPlayFabBaseModel(), + AuthTicket(src.AuthTicket), + ForceLink(src.ForceLink), + KongregateId(src.KongregateId) + {} + + FLinkKongregateAccountRequest(const TSharedPtr& obj) : FLinkKongregateAccountRequest() + { + readFromValue(obj); + } + + ~FLinkKongregateAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkKongregateAccountResult : public FPlayFabBaseModel + { + FLinkKongregateAccountResult() : + FPlayFabBaseModel() + {} + + FLinkKongregateAccountResult(const FLinkKongregateAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkKongregateAccountResult(const TSharedPtr& obj) : FLinkKongregateAccountResult() + { + readFromValue(obj); + } + + ~FLinkKongregateAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkNintendoSwitchDeviceIdRequest : public FPlayFabBaseModel + { + // [optional] If another user is already linked to the Nintendo Switch Device ID, unlink the other user and re-link. + Boxed ForceLink; + + // Nintendo Switch unique identifier for the user's device. + FString NintendoSwitchDeviceId; + + FLinkNintendoSwitchDeviceIdRequest() : + FPlayFabBaseModel(), + ForceLink(), + NintendoSwitchDeviceId() + {} + + FLinkNintendoSwitchDeviceIdRequest(const FLinkNintendoSwitchDeviceIdRequest& src) : + FPlayFabBaseModel(), + ForceLink(src.ForceLink), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId) + {} + + FLinkNintendoSwitchDeviceIdRequest(const TSharedPtr& obj) : FLinkNintendoSwitchDeviceIdRequest() + { + readFromValue(obj); + } + + ~FLinkNintendoSwitchDeviceIdRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkNintendoSwitchDeviceIdResult : public FPlayFabBaseModel + { + FLinkNintendoSwitchDeviceIdResult() : + FPlayFabBaseModel() + {} + + FLinkNintendoSwitchDeviceIdResult(const FLinkNintendoSwitchDeviceIdResult& src) : + FPlayFabBaseModel() + {} + + FLinkNintendoSwitchDeviceIdResult(const TSharedPtr& obj) : FLinkNintendoSwitchDeviceIdResult() + { + readFromValue(obj); + } + + ~FLinkNintendoSwitchDeviceIdResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkSteamAccountRequest : public FPlayFabBaseModel + { + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + /** + * Authentication token for the user, returned as a byte array from Steam, and converted to a string (for example, the byte + * 0x08 should become "08"). + */ + FString SteamTicket; + + FLinkSteamAccountRequest() : + FPlayFabBaseModel(), + ForceLink(), + SteamTicket() + {} + + FLinkSteamAccountRequest(const FLinkSteamAccountRequest& src) : + FPlayFabBaseModel(), + ForceLink(src.ForceLink), + SteamTicket(src.SteamTicket) + {} + + FLinkSteamAccountRequest(const TSharedPtr& obj) : FLinkSteamAccountRequest() + { + readFromValue(obj); + } + + ~FLinkSteamAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkSteamAccountResult : public FPlayFabBaseModel + { + FLinkSteamAccountResult() : + FPlayFabBaseModel() + {} + + FLinkSteamAccountResult(const FLinkSteamAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkSteamAccountResult(const TSharedPtr& obj) : FLinkSteamAccountResult() + { + readFromValue(obj); + } + + ~FLinkSteamAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkTwitchAccountRequest : public FPlayFabBaseModel + { + // Valid token issued by Twitch + FString AccessToken; + + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + FLinkTwitchAccountRequest() : + FPlayFabBaseModel(), + AccessToken(), + ForceLink() + {} + + FLinkTwitchAccountRequest(const FLinkTwitchAccountRequest& src) : + FPlayFabBaseModel(), + AccessToken(src.AccessToken), + ForceLink(src.ForceLink) + {} + + FLinkTwitchAccountRequest(const TSharedPtr& obj) : FLinkTwitchAccountRequest() + { + readFromValue(obj); + } + + ~FLinkTwitchAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkTwitchAccountResult : public FPlayFabBaseModel + { + FLinkTwitchAccountResult() : + FPlayFabBaseModel() + {} + + FLinkTwitchAccountResult(const FLinkTwitchAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkTwitchAccountResult(const TSharedPtr& obj) : FLinkTwitchAccountResult() + { + readFromValue(obj); + } + + ~FLinkTwitchAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkWindowsHelloAccountRequest : public FPlayFabBaseModel + { + // [optional] Device name. + FString DeviceName; + + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + // PublicKey generated by Windows Hello. + FString PublicKey; + + // Player's user named used by Windows Hello. + FString UserName; + + FLinkWindowsHelloAccountRequest() : + FPlayFabBaseModel(), + DeviceName(), + ForceLink(), + PublicKey(), + UserName() + {} + + FLinkWindowsHelloAccountRequest(const FLinkWindowsHelloAccountRequest& src) : + FPlayFabBaseModel(), + DeviceName(src.DeviceName), + ForceLink(src.ForceLink), + PublicKey(src.PublicKey), + UserName(src.UserName) + {} + + FLinkWindowsHelloAccountRequest(const TSharedPtr& obj) : FLinkWindowsHelloAccountRequest() + { + readFromValue(obj); + } + + ~FLinkWindowsHelloAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkWindowsHelloAccountResponse : public FPlayFabBaseModel + { + FLinkWindowsHelloAccountResponse() : + FPlayFabBaseModel() + {} + + FLinkWindowsHelloAccountResponse(const FLinkWindowsHelloAccountResponse& src) : + FPlayFabBaseModel() + {} + + FLinkWindowsHelloAccountResponse(const TSharedPtr& obj) : FLinkWindowsHelloAccountResponse() + { + readFromValue(obj); + } + + ~FLinkWindowsHelloAccountResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkXboxAccountRequest : public FPlayFabBaseModel + { + // [optional] If another user is already linked to the account, unlink the other user and re-link. + Boxed ForceLink; + + // Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + FString XboxToken; + + FLinkXboxAccountRequest() : + FPlayFabBaseModel(), + ForceLink(), + XboxToken() + {} + + FLinkXboxAccountRequest(const FLinkXboxAccountRequest& src) : + FPlayFabBaseModel(), + ForceLink(src.ForceLink), + XboxToken(src.XboxToken) + {} + + FLinkXboxAccountRequest(const TSharedPtr& obj) : FLinkXboxAccountRequest() + { + readFromValue(obj); + } + + ~FLinkXboxAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLinkXboxAccountResult : public FPlayFabBaseModel + { + FLinkXboxAccountResult() : + FPlayFabBaseModel() + {} + + FLinkXboxAccountResult(const FLinkXboxAccountResult& src) : + FPlayFabBaseModel() + {} + + FLinkXboxAccountResult(const TSharedPtr& obj) : FLinkXboxAccountResult() + { + readFromValue(obj); + } + + ~FLinkXboxAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListUsersCharactersRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FListUsersCharactersRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FListUsersCharactersRequest(const FListUsersCharactersRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FListUsersCharactersRequest(const TSharedPtr& obj) : FListUsersCharactersRequest() + { + readFromValue(obj); + } + + ~FListUsersCharactersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListUsersCharactersResult : public FPlayFabBaseModel + { + // [optional] The requested list of characters. + TArray Characters; + FListUsersCharactersResult() : + FPlayFabBaseModel(), + Characters() + {} + + FListUsersCharactersResult(const FListUsersCharactersResult& src) : + FPlayFabBaseModel(), + Characters(src.Characters) + {} + + FListUsersCharactersResult(const TSharedPtr& obj) : FListUsersCharactersResult() + { + readFromValue(obj); + } + + ~FListUsersCharactersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserSettings : public FPlayFabBaseModel + { + // Boolean for whether this player is eligible for gathering device info. + bool GatherDeviceInfo; + + // Boolean for whether this player should report OnFocus play-time tracking. + bool GatherFocusInfo; + + // Boolean for whether this player is eligible for ad tracking. + bool NeedsAttribution; + + FUserSettings() : + FPlayFabBaseModel(), + GatherDeviceInfo(false), + GatherFocusInfo(false), + NeedsAttribution(false) + {} + + FUserSettings(const FUserSettings& src) : + FPlayFabBaseModel(), + GatherDeviceInfo(src.GatherDeviceInfo), + GatherFocusInfo(src.GatherFocusInfo), + NeedsAttribution(src.NeedsAttribution) + {} + + FUserSettings(const TSharedPtr& obj) : FUserSettings() + { + readFromValue(obj); + } + + ~FUserSettings(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginResult : public FPlayFabBaseModel + { + /** + * [optional] If LoginTitlePlayerAccountEntity flag is set on the login request the title_player_account will also be logged in and + * returned. + */ + TSharedPtr EntityToken; + + // [optional] Results for requested info. + TSharedPtr InfoResultPayload; + + // [optional] The time of this user's previous login. If there was no previous login, then it's DateTime.MinValue + Boxed LastLoginTime; + + // True if the account was newly created on this login. + bool NewlyCreated; + + // [optional] Player's unique PlayFabId. + FString PlayFabId; + + // [optional] Unique token authorizing the user and game at the server level, for the current session. + FString SessionTicket; + + // [optional] Settings specific to this user. + TSharedPtr SettingsForUser; + + FLoginResult() : + FPlayFabBaseModel(), + EntityToken(nullptr), + InfoResultPayload(nullptr), + LastLoginTime(), + NewlyCreated(false), + PlayFabId(), + SessionTicket(), + SettingsForUser(nullptr) + {} + + FLoginResult(const FLoginResult& src) : + FPlayFabBaseModel(), + EntityToken(src.EntityToken.IsValid() ? MakeShareable(new FEntityTokenResponse(*src.EntityToken)) : nullptr), + InfoResultPayload(src.InfoResultPayload.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoResultPayload(*src.InfoResultPayload)) : nullptr), + LastLoginTime(src.LastLoginTime), + NewlyCreated(src.NewlyCreated), + PlayFabId(src.PlayFabId), + SessionTicket(src.SessionTicket), + SettingsForUser(src.SettingsForUser.IsValid() ? MakeShareable(new FUserSettings(*src.SettingsForUser)) : nullptr) + {} + + FLoginResult(const TSharedPtr& obj) : FLoginResult() + { + readFromValue(obj); + } + + ~FLoginResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithAndroidDeviceIDRequest : public FPlayFabBaseModel + { + // [optional] Specific model of the user's device. + FString AndroidDevice; + + // [optional] Android device identifier for the user's device. + FString AndroidDeviceId; + + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Specific Operating System version for the user's device. + FString OS; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithAndroidDeviceIDRequest() : + FPlayFabBaseModel(), + AndroidDevice(), + AndroidDeviceId(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + OS(), + PlayerSecret(), + TitleId() + {} + + FLoginWithAndroidDeviceIDRequest(const FLoginWithAndroidDeviceIDRequest& src) : + FPlayFabBaseModel(), + AndroidDevice(src.AndroidDevice), + AndroidDeviceId(src.AndroidDeviceId), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + OS(src.OS), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithAndroidDeviceIDRequest(const TSharedPtr& obj) : FLoginWithAndroidDeviceIDRequest() + { + readFromValue(obj); + } + + ~FLoginWithAndroidDeviceIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithCustomIDRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Custom unique identifier for the user, generated by the title. + FString CustomId; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithCustomIDRequest() : + FPlayFabBaseModel(), + CreateAccount(), + CustomId(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + TitleId() + {} + + FLoginWithCustomIDRequest(const FLoginWithCustomIDRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + CustomId(src.CustomId), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithCustomIDRequest(const TSharedPtr& obj) : FLoginWithCustomIDRequest() + { + readFromValue(obj); + } + + ~FLoginWithCustomIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithEmailAddressRequest : public FPlayFabBaseModel + { + // Email address for the account. + FString Email; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // Password for the PlayFab account (6-100 characters) + FString Password; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithEmailAddressRequest() : + FPlayFabBaseModel(), + Email(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + Password(), + TitleId() + {} + + FLoginWithEmailAddressRequest(const FLoginWithEmailAddressRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + Password(src.Password), + TitleId(src.TitleId) + {} + + FLoginWithEmailAddressRequest(const TSharedPtr& obj) : FLoginWithEmailAddressRequest() + { + readFromValue(obj); + } + + ~FLoginWithEmailAddressRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithFacebookInstantGamesIdRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // Facebook Instant Games signature for the user. + FString FacebookInstantGamesSignature; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithFacebookInstantGamesIdRequest() : + FPlayFabBaseModel(), + CreateAccount(), + EncryptedRequest(), + FacebookInstantGamesSignature(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + TitleId() + {} + + FLoginWithFacebookInstantGamesIdRequest(const FLoginWithFacebookInstantGamesIdRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + FacebookInstantGamesSignature(src.FacebookInstantGamesSignature), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithFacebookInstantGamesIdRequest(const TSharedPtr& obj) : FLoginWithFacebookInstantGamesIdRequest() + { + readFromValue(obj); + } + + ~FLoginWithFacebookInstantGamesIdRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithFacebookRequest : public FPlayFabBaseModel + { + // Unique identifier from Facebook for the user. + FString AccessToken; + + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithFacebookRequest() : + FPlayFabBaseModel(), + AccessToken(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + TitleId() + {} + + FLoginWithFacebookRequest(const FLoginWithFacebookRequest& src) : + FPlayFabBaseModel(), + AccessToken(src.AccessToken), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithFacebookRequest(const TSharedPtr& obj) : FLoginWithFacebookRequest() + { + readFromValue(obj); + } + + ~FLoginWithFacebookRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithGameCenterRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Unique Game Center player id. + FString PlayerId; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithGameCenterRequest() : + FPlayFabBaseModel(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerId(), + PlayerSecret(), + TitleId() + {} + + FLoginWithGameCenterRequest(const FLoginWithGameCenterRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerId(src.PlayerId), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithGameCenterRequest(const TSharedPtr& obj) : FLoginWithGameCenterRequest() + { + readFromValue(obj); + } + + ~FLoginWithGameCenterRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithGoogleAccountRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * [optional] OAuth 2.0 server authentication code obtained on the client by calling the getServerAuthCode() + * (https://developers.google.com/identity/sign-in/android/offline-access) Google client API. + */ + FString ServerAuthCode; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithGoogleAccountRequest() : + FPlayFabBaseModel(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + ServerAuthCode(), + TitleId() + {} + + FLoginWithGoogleAccountRequest(const FLoginWithGoogleAccountRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + ServerAuthCode(src.ServerAuthCode), + TitleId(src.TitleId) + {} + + FLoginWithGoogleAccountRequest(const TSharedPtr& obj) : FLoginWithGoogleAccountRequest() + { + readFromValue(obj); + } + + ~FLoginWithGoogleAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithIOSDeviceIDRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Vendor-specific iOS identifier for the user's device. + FString DeviceId; + + // [optional] Specific model of the user's device. + FString DeviceModel; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Specific Operating System version for the user's device. + FString OS; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithIOSDeviceIDRequest() : + FPlayFabBaseModel(), + CreateAccount(), + DeviceId(), + DeviceModel(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + OS(), + PlayerSecret(), + TitleId() + {} + + FLoginWithIOSDeviceIDRequest(const FLoginWithIOSDeviceIDRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + DeviceId(src.DeviceId), + DeviceModel(src.DeviceModel), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + OS(src.OS), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithIOSDeviceIDRequest(const TSharedPtr& obj) : FLoginWithIOSDeviceIDRequest() + { + readFromValue(obj); + } + + ~FLoginWithIOSDeviceIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithKongregateRequest : public FPlayFabBaseModel + { + // [optional] Token issued by Kongregate's client API for the user. + FString AuthTicket; + + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Numeric user ID assigned by Kongregate + FString KongregateId; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithKongregateRequest() : + FPlayFabBaseModel(), + AuthTicket(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + KongregateId(), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + TitleId() + {} + + FLoginWithKongregateRequest(const FLoginWithKongregateRequest& src) : + FPlayFabBaseModel(), + AuthTicket(src.AuthTicket), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + KongregateId(src.KongregateId), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithKongregateRequest(const TSharedPtr& obj) : FLoginWithKongregateRequest() + { + readFromValue(obj); + } + + ~FLoginWithKongregateRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithNintendoSwitchDeviceIdRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Nintendo Switch unique identifier for the user's device. + FString NintendoSwitchDeviceId; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithNintendoSwitchDeviceIdRequest() : + FPlayFabBaseModel(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + NintendoSwitchDeviceId(), + PlayerSecret(), + TitleId() + {} + + FLoginWithNintendoSwitchDeviceIdRequest(const FLoginWithNintendoSwitchDeviceIdRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithNintendoSwitchDeviceIdRequest(const TSharedPtr& obj) : FLoginWithNintendoSwitchDeviceIdRequest() + { + readFromValue(obj); + } + + ~FLoginWithNintendoSwitchDeviceIdRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithPlayFabRequest : public FPlayFabBaseModel + { + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // Password for the PlayFab account (6-100 characters) + FString Password; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + // PlayFab username for the account. + FString Username; + + FLoginWithPlayFabRequest() : + FPlayFabBaseModel(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + Password(), + TitleId(), + Username() + {} + + FLoginWithPlayFabRequest(const FLoginWithPlayFabRequest& src) : + FPlayFabBaseModel(), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + Password(src.Password), + TitleId(src.TitleId), + Username(src.Username) + {} + + FLoginWithPlayFabRequest(const TSharedPtr& obj) : FLoginWithPlayFabRequest() + { + readFromValue(obj); + } + + ~FLoginWithPlayFabRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithSteamRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * [optional] Authentication token for the user, returned as a byte array from Steam, and converted to a string (for example, the byte + * 0x08 should become "08"). + */ + FString SteamTicket; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithSteamRequest() : + FPlayFabBaseModel(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + SteamTicket(), + TitleId() + {} + + FLoginWithSteamRequest(const FLoginWithSteamRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + SteamTicket(src.SteamTicket), + TitleId(src.TitleId) + {} + + FLoginWithSteamRequest(const TSharedPtr& obj) : FLoginWithSteamRequest() + { + readFromValue(obj); + } + + ~FLoginWithSteamRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithTwitchRequest : public FPlayFabBaseModel + { + // [optional] Token issued by Twitch's API for the user. + FString AccessToken; + + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithTwitchRequest() : + FPlayFabBaseModel(), + AccessToken(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + TitleId() + {} + + FLoginWithTwitchRequest(const FLoginWithTwitchRequest& src) : + FPlayFabBaseModel(), + AccessToken(src.AccessToken), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId) + {} + + FLoginWithTwitchRequest(const TSharedPtr& obj) : FLoginWithTwitchRequest() + { + readFromValue(obj); + } + + ~FLoginWithTwitchRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithWindowsHelloRequest : public FPlayFabBaseModel + { + // The signed response from the user for the Challenge. + FString ChallengeSignature; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // SHA256 hash of the PublicKey generated by Windows Hello. + FString PublicKeyHint; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FLoginWithWindowsHelloRequest() : + FPlayFabBaseModel(), + ChallengeSignature(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PublicKeyHint(), + TitleId() + {} + + FLoginWithWindowsHelloRequest(const FLoginWithWindowsHelloRequest& src) : + FPlayFabBaseModel(), + ChallengeSignature(src.ChallengeSignature), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PublicKeyHint(src.PublicKeyHint), + TitleId(src.TitleId) + {} + + FLoginWithWindowsHelloRequest(const TSharedPtr& obj) : FLoginWithWindowsHelloRequest() + { + readFromValue(obj); + } + + ~FLoginWithWindowsHelloRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLoginWithXboxRequest : public FPlayFabBaseModel + { + // [optional] Automatically create a PlayFab account if one is not currently linked to this ID. + Boxed CreateAccount; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + // [optional] Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + FString XboxToken; + + FLoginWithXboxRequest() : + FPlayFabBaseModel(), + CreateAccount(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + TitleId(), + XboxToken() + {} + + FLoginWithXboxRequest(const FLoginWithXboxRequest& src) : + FPlayFabBaseModel(), + CreateAccount(src.CreateAccount), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + TitleId(src.TitleId), + XboxToken(src.XboxToken) + {} + + FLoginWithXboxRequest(const TSharedPtr& obj) : FLoginWithXboxRequest() + { + readFromValue(obj); + } + + ~FLoginWithXboxRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMatchmakeRequest : public FPlayFabBaseModel + { + // [optional] Build version to match against. [Note: Required if LobbyId is not specified] + FString BuildVersion; + + // [optional] Character to use for stats based matching. Leave null to use account stats. + FString CharacterId; + + // [optional] Game mode to match make against. [Note: Required if LobbyId is not specified] + FString GameMode; + + // [optional] Lobby identifier to match make against. This is used to select a specific Game Server Instance. + FString LobbyId; + + // [optional] Region to match make against. [Note: Required if LobbyId is not specified] + Boxed pfRegion; + + // [optional] Start a game session if one with an open slot is not found. Defaults to true. + Boxed StartNewIfNoneFound; + + // [optional] Player statistic to use in finding a match. May be null for no stat-based matching. + FString StatisticName; + + // [optional] Filter to include and/or exclude Game Server Instances associated with certain Tags + TSharedPtr TagFilter; + + FMatchmakeRequest() : + FPlayFabBaseModel(), + BuildVersion(), + CharacterId(), + GameMode(), + LobbyId(), + pfRegion(), + StartNewIfNoneFound(), + StatisticName(), + TagFilter(nullptr) + {} + + FMatchmakeRequest(const FMatchmakeRequest& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + CharacterId(src.CharacterId), + GameMode(src.GameMode), + LobbyId(src.LobbyId), + pfRegion(src.pfRegion), + StartNewIfNoneFound(src.StartNewIfNoneFound), + StatisticName(src.StatisticName), + TagFilter(src.TagFilter.IsValid() ? MakeShareable(new FCollectionFilter(*src.TagFilter)) : nullptr) + {} + + FMatchmakeRequest(const TSharedPtr& obj) : FMatchmakeRequest() + { + readFromValue(obj); + } + + ~FMatchmakeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum MatchmakeStatus + { + MatchmakeStatusComplete, + MatchmakeStatusWaiting, + MatchmakeStatusGameNotFound, + MatchmakeStatusNoAvailableSlots, + MatchmakeStatusSessionClosed + }; + + PLAYFABCPP_API void writeMatchmakeStatusEnumJSON(MatchmakeStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API MatchmakeStatus readMatchmakeStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API MatchmakeStatus readMatchmakeStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FMatchmakeResult : public FPlayFabBaseModel + { + // [optional] timestamp for when the server will expire, if applicable + FString Expires; + + // [optional] unique lobby identifier of the server matched + FString LobbyID; + + // [optional] time in milliseconds the application is configured to wait on matchmaking results + Boxed PollWaitTimeMS; + + // [optional] IPV4 address of the server + FString ServerHostname; + + // [optional] IPV4 address of the server + FString ServerIPV4Address; + + // [optional] IPV6 address of the server + FString ServerIPV6Address; + + // [optional] port number to use for non-http communications with the server + Boxed ServerPort; + + // [optional] Public DNS name (if any) of the server + FString ServerPublicDNSName; + + // [optional] result of match making process + Boxed Status; + + // [optional] server authorization ticket (used by RedeemMatchmakerTicket to validate user insertion into the game) + FString Ticket; + + FMatchmakeResult() : + FPlayFabBaseModel(), + Expires(), + LobbyID(), + PollWaitTimeMS(), + ServerHostname(), + ServerIPV4Address(), + ServerIPV6Address(), + ServerPort(), + ServerPublicDNSName(), + Status(), + Ticket() + {} + + FMatchmakeResult(const FMatchmakeResult& src) : + FPlayFabBaseModel(), + Expires(src.Expires), + LobbyID(src.LobbyID), + PollWaitTimeMS(src.PollWaitTimeMS), + ServerHostname(src.ServerHostname), + ServerIPV4Address(src.ServerIPV4Address), + ServerIPV6Address(src.ServerIPV6Address), + ServerPort(src.ServerPort), + ServerPublicDNSName(src.ServerPublicDNSName), + Status(src.Status), + Ticket(src.Ticket) + {} + + FMatchmakeResult(const TSharedPtr& obj) : FMatchmakeResult() + { + readFromValue(obj); + } + + ~FMatchmakeResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyUserVirtualCurrencyResult : public FPlayFabBaseModel + { + // Balance of the virtual currency after modification. + int32 Balance; + + /** + * Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase + * over this value will be discarded. + */ + int32 BalanceChange; + + // [optional] User currency was subtracted from. + FString PlayFabId; + + // [optional] Name of the virtual currency which was modified. + FString VirtualCurrency; + + FModifyUserVirtualCurrencyResult() : + FPlayFabBaseModel(), + Balance(0), + BalanceChange(0), + PlayFabId(), + VirtualCurrency() + {} + + FModifyUserVirtualCurrencyResult(const FModifyUserVirtualCurrencyResult& src) : + FPlayFabBaseModel(), + Balance(src.Balance), + BalanceChange(src.BalanceChange), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FModifyUserVirtualCurrencyResult(const TSharedPtr& obj) : FModifyUserVirtualCurrencyResult() + { + readFromValue(obj); + } + + ~FModifyUserVirtualCurrencyResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FOpenTradeRequest : public FPlayFabBaseModel + { + /** + * [optional] Players who are allowed to accept the trade. If null, the trade may be accepted by any player. If empty, the trade may + * not be accepted by any player. + */ + TArray AllowedPlayerIds; + // [optional] Player inventory items offered for trade. If not set, the trade is effectively a gift request + TArray OfferedInventoryInstanceIds; + // [optional] Catalog items accepted for the trade. If not set, the trade is effectively a gift. + TArray RequestedCatalogItemIds; + FOpenTradeRequest() : + FPlayFabBaseModel(), + AllowedPlayerIds(), + OfferedInventoryInstanceIds(), + RequestedCatalogItemIds() + {} + + FOpenTradeRequest(const FOpenTradeRequest& src) : + FPlayFabBaseModel(), + AllowedPlayerIds(src.AllowedPlayerIds), + OfferedInventoryInstanceIds(src.OfferedInventoryInstanceIds), + RequestedCatalogItemIds(src.RequestedCatalogItemIds) + {} + + FOpenTradeRequest(const TSharedPtr& obj) : FOpenTradeRequest() + { + readFromValue(obj); + } + + ~FOpenTradeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FOpenTradeResponse : public FPlayFabBaseModel + { + // [optional] The information about the trade that was just opened. + TSharedPtr Trade; + + FOpenTradeResponse() : + FPlayFabBaseModel(), + Trade(nullptr) + {} + + FOpenTradeResponse(const FOpenTradeResponse& src) : + FPlayFabBaseModel(), + Trade(src.Trade.IsValid() ? MakeShareable(new FTradeInfo(*src.Trade)) : nullptr) + {} + + FOpenTradeResponse(const TSharedPtr& obj) : FOpenTradeResponse() + { + readFromValue(obj); + } + + ~FOpenTradeResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPayForPurchaseRequest : public FPlayFabBaseModel + { + // Currency to use to fund the purchase. + FString Currency; + + // Purchase order identifier returned from StartPurchase. + FString OrderId; + + // Payment provider to use to fund the purchase. + FString ProviderName; + + // [optional] Payment provider transaction identifier. Required for Facebook Payments. + FString ProviderTransactionId; + + FPayForPurchaseRequest() : + FPlayFabBaseModel(), + Currency(), + OrderId(), + ProviderName(), + ProviderTransactionId() + {} + + FPayForPurchaseRequest(const FPayForPurchaseRequest& src) : + FPlayFabBaseModel(), + Currency(src.Currency), + OrderId(src.OrderId), + ProviderName(src.ProviderName), + ProviderTransactionId(src.ProviderTransactionId) + {} + + FPayForPurchaseRequest(const TSharedPtr& obj) : FPayForPurchaseRequest() + { + readFromValue(obj); + } + + ~FPayForPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum TransactionStatus + { + TransactionStatusCreateCart, + TransactionStatusInit, + TransactionStatusApproved, + TransactionStatusSucceeded, + TransactionStatusFailedByProvider, + TransactionStatusDisputePending, + TransactionStatusRefundPending, + TransactionStatusRefunded, + TransactionStatusRefundFailed, + TransactionStatusChargedBack, + TransactionStatusFailedByUber, + TransactionStatusFailedByPlayFab, + TransactionStatusRevoked, + TransactionStatusTradePending, + TransactionStatusTraded, + TransactionStatusUpgraded, + TransactionStatusStackPending, + TransactionStatusStacked, + TransactionStatusOther, + TransactionStatusFailed + }; + + PLAYFABCPP_API void writeTransactionStatusEnumJSON(TransactionStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API TransactionStatus readTransactionStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API TransactionStatus readTransactionStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FPayForPurchaseResult : public FPlayFabBaseModel + { + // Local credit applied to the transaction (provider specific). + uint32 CreditApplied; + + // [optional] Purchase order identifier. + FString OrderId; + + // [optional] Provider used for the transaction. + FString ProviderData; + + // [optional] A token generated by the provider to authenticate the request (provider-specific). + FString ProviderToken; + + // [optional] URL to the purchase provider page that details the purchase. + FString PurchaseConfirmationPageURL; + + // [optional] Currency for the transaction, may be a virtual currency or real money. + FString PurchaseCurrency; + + // Cost of the transaction. + uint32 PurchasePrice; + + // [optional] Status of the transaction. + Boxed Status; + + // [optional] Virtual currencies granted by the transaction, if any. + TMap VCAmount; + // [optional] Current virtual currency balances for the user. + TMap VirtualCurrency; + FPayForPurchaseResult() : + FPlayFabBaseModel(), + CreditApplied(0), + OrderId(), + ProviderData(), + ProviderToken(), + PurchaseConfirmationPageURL(), + PurchaseCurrency(), + PurchasePrice(0), + Status(), + VCAmount(), + VirtualCurrency() + {} + + FPayForPurchaseResult(const FPayForPurchaseResult& src) : + FPlayFabBaseModel(), + CreditApplied(src.CreditApplied), + OrderId(src.OrderId), + ProviderData(src.ProviderData), + ProviderToken(src.ProviderToken), + PurchaseConfirmationPageURL(src.PurchaseConfirmationPageURL), + PurchaseCurrency(src.PurchaseCurrency), + PurchasePrice(src.PurchasePrice), + Status(src.Status), + VCAmount(src.VCAmount), + VirtualCurrency(src.VirtualCurrency) + {} + + FPayForPurchaseResult(const TSharedPtr& obj) : FPayForPurchaseResult() + { + readFromValue(obj); + } + + ~FPayForPurchaseResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPaymentOption : public FPlayFabBaseModel + { + // [optional] Specific currency to use to fund the purchase. + FString Currency; + + // Amount of the specified currency needed for the purchase. + uint32 Price; + + // [optional] Name of the purchase provider for this option. + FString ProviderName; + + // Amount of existing credit the user has with the provider. + uint32 StoreCredit; + + FPaymentOption() : + FPlayFabBaseModel(), + Currency(), + Price(0), + ProviderName(), + StoreCredit(0) + {} + + FPaymentOption(const FPaymentOption& src) : + FPlayFabBaseModel(), + Currency(src.Currency), + Price(src.Price), + ProviderName(src.ProviderName), + StoreCredit(src.StoreCredit) + {} + + FPaymentOption(const TSharedPtr& obj) : FPaymentOption() + { + readFromValue(obj); + } + + ~FPaymentOption(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPurchaseItemRequest : public FPlayFabBaseModel + { + // [optional] Catalog version for the items to be purchased (defaults to most recent version. + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique identifier of the item to purchase. + FString ItemId; + + // Price the client expects to pay for the item (in case a new catalog or store was uploaded, with new prices). + int32 Price; + + // [optional] Store to buy this item through. If not set, prices default to those in the catalog. + FString StoreId; + + // Virtual currency to use to purchase the item. + FString VirtualCurrency; + + FPurchaseItemRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + ItemId(), + Price(0), + StoreId(), + VirtualCurrency() + {} + + FPurchaseItemRequest(const FPurchaseItemRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + ItemId(src.ItemId), + Price(src.Price), + StoreId(src.StoreId), + VirtualCurrency(src.VirtualCurrency) + {} + + FPurchaseItemRequest(const TSharedPtr& obj) : FPurchaseItemRequest() + { + readFromValue(obj); + } + + ~FPurchaseItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPurchaseItemResult : public FPlayFabBaseModel + { + // [optional] Details for the items purchased. + TArray Items; + FPurchaseItemResult() : + FPlayFabBaseModel(), + Items() + {} + + FPurchaseItemResult(const FPurchaseItemResult& src) : + FPlayFabBaseModel(), + Items(src.Items) + {} + + FPurchaseItemResult(const TSharedPtr& obj) : FPurchaseItemResult() + { + readFromValue(obj); + } + + ~FPurchaseItemResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRedeemCouponRequest : public FPlayFabBaseModel + { + // [optional] Catalog version of the coupon. If null, uses the default catalog + FString CatalogVersion; + + // [optional] Optional identifier for the Character that should receive the item. If null, item is added to the player + FString CharacterId; + + // Generated coupon code to redeem. + FString CouponCode; + + FRedeemCouponRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + CouponCode() + {} + + FRedeemCouponRequest(const FRedeemCouponRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + CouponCode(src.CouponCode) + {} + + FRedeemCouponRequest(const TSharedPtr& obj) : FRedeemCouponRequest() + { + readFromValue(obj); + } + + ~FRedeemCouponRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRedeemCouponResult : public FPlayFabBaseModel + { + // [optional] Items granted to the player as a result of redeeming the coupon. + TArray GrantedItems; + FRedeemCouponResult() : + FPlayFabBaseModel(), + GrantedItems() + {} + + FRedeemCouponResult(const FRedeemCouponResult& src) : + FPlayFabBaseModel(), + GrantedItems(src.GrantedItems) + {} + + FRedeemCouponResult(const TSharedPtr& obj) : FRedeemCouponResult() + { + readFromValue(obj); + } + + ~FRedeemCouponResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegisterForIOSPushNotificationRequest : public FPlayFabBaseModel + { + // [optional] Message to display when confirming push notification. + FString ConfirmationMessage; + + // Unique token generated by the Apple Push Notification service when the title registered to receive push notifications. + FString DeviceToken; + + // [optional] If true, send a test push message immediately after sucessful registration. Defaults to false. + Boxed SendPushNotificationConfirmation; + + FRegisterForIOSPushNotificationRequest() : + FPlayFabBaseModel(), + ConfirmationMessage(), + DeviceToken(), + SendPushNotificationConfirmation() + {} + + FRegisterForIOSPushNotificationRequest(const FRegisterForIOSPushNotificationRequest& src) : + FPlayFabBaseModel(), + ConfirmationMessage(src.ConfirmationMessage), + DeviceToken(src.DeviceToken), + SendPushNotificationConfirmation(src.SendPushNotificationConfirmation) + {} + + FRegisterForIOSPushNotificationRequest(const TSharedPtr& obj) : FRegisterForIOSPushNotificationRequest() + { + readFromValue(obj); + } + + ~FRegisterForIOSPushNotificationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegisterForIOSPushNotificationResult : public FPlayFabBaseModel + { + FRegisterForIOSPushNotificationResult() : + FPlayFabBaseModel() + {} + + FRegisterForIOSPushNotificationResult(const FRegisterForIOSPushNotificationResult& src) : + FPlayFabBaseModel() + {} + + FRegisterForIOSPushNotificationResult(const TSharedPtr& obj) : FRegisterForIOSPushNotificationResult() + { + readFromValue(obj); + } + + ~FRegisterForIOSPushNotificationResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegisterPlayFabUserRequest : public FPlayFabBaseModel + { + // [optional] An optional parameter for setting the display name for this title (3-25 characters). + FString DisplayName; + + // [optional] User email address attached to their account + FString Email; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Password for the PlayFab account (6-100 characters) + FString Password; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + /** + * [optional] An optional parameter that specifies whether both the username and email parameters are required. If true, both + * parameters are required; if false, the user must supply either the username or email parameter. The default value is + * true. + */ + Boxed RequireBothUsernameAndEmail; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + // [optional] PlayFab username for the account (3-20 characters) + FString Username; + + FRegisterPlayFabUserRequest() : + FPlayFabBaseModel(), + DisplayName(), + Email(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + Password(), + PlayerSecret(), + RequireBothUsernameAndEmail(), + TitleId(), + Username() + {} + + FRegisterPlayFabUserRequest(const FRegisterPlayFabUserRequest& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName), + Email(src.Email), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + Password(src.Password), + PlayerSecret(src.PlayerSecret), + RequireBothUsernameAndEmail(src.RequireBothUsernameAndEmail), + TitleId(src.TitleId), + Username(src.Username) + {} + + FRegisterPlayFabUserRequest(const TSharedPtr& obj) : FRegisterPlayFabUserRequest() + { + readFromValue(obj); + } + + ~FRegisterPlayFabUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegisterPlayFabUserResult : public FPlayFabBaseModel + { + /** + * [optional] If LoginTitlePlayerAccountEntity flag is set on the login request the title_player_account will also be logged in and + * returned. + */ + TSharedPtr EntityToken; + + // [optional] PlayFab unique identifier for this newly created account. + FString PlayFabId; + + // [optional] Unique token identifying the user and game at the server level, for the current session. + FString SessionTicket; + + // [optional] Settings specific to this user. + TSharedPtr SettingsForUser; + + // [optional] PlayFab unique user name. + FString Username; + + FRegisterPlayFabUserResult() : + FPlayFabBaseModel(), + EntityToken(nullptr), + PlayFabId(), + SessionTicket(), + SettingsForUser(nullptr), + Username() + {} + + FRegisterPlayFabUserResult(const FRegisterPlayFabUserResult& src) : + FPlayFabBaseModel(), + EntityToken(src.EntityToken.IsValid() ? MakeShareable(new FEntityTokenResponse(*src.EntityToken)) : nullptr), + PlayFabId(src.PlayFabId), + SessionTicket(src.SessionTicket), + SettingsForUser(src.SettingsForUser.IsValid() ? MakeShareable(new FUserSettings(*src.SettingsForUser)) : nullptr), + Username(src.Username) + {} + + FRegisterPlayFabUserResult(const TSharedPtr& obj) : FRegisterPlayFabUserResult() + { + readFromValue(obj); + } + + ~FRegisterPlayFabUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegisterWithWindowsHelloRequest : public FPlayFabBaseModel + { + // [optional] Device name. + FString DeviceName; + + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Flags for which pieces of info to return for the user. + TSharedPtr InfoRequestParameters; + + // [optional] Formerly triggered an Entity login with a normal client login. This is now automatic, and always-on. + Boxed LoginTitlePlayerAccountEntity; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + // [optional] PublicKey generated by Windows Hello. + FString PublicKey; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + // [optional] Player's user name used by Windows Hello. + FString UserName; + + FRegisterWithWindowsHelloRequest() : + FPlayFabBaseModel(), + DeviceName(), + EncryptedRequest(), + InfoRequestParameters(nullptr), + LoginTitlePlayerAccountEntity(), + PlayerSecret(), + PublicKey(), + TitleId(), + UserName() + {} + + FRegisterWithWindowsHelloRequest(const FRegisterWithWindowsHelloRequest& src) : + FPlayFabBaseModel(), + DeviceName(src.DeviceName), + EncryptedRequest(src.EncryptedRequest), + InfoRequestParameters(src.InfoRequestParameters.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoRequestParams(*src.InfoRequestParameters)) : nullptr), + LoginTitlePlayerAccountEntity(src.LoginTitlePlayerAccountEntity), + PlayerSecret(src.PlayerSecret), + PublicKey(src.PublicKey), + TitleId(src.TitleId), + UserName(src.UserName) + {} + + FRegisterWithWindowsHelloRequest(const TSharedPtr& obj) : FRegisterWithWindowsHelloRequest() + { + readFromValue(obj); + } + + ~FRegisterWithWindowsHelloRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveContactEmailRequest : public FPlayFabBaseModel + { + FRemoveContactEmailRequest() : + FPlayFabBaseModel() + {} + + FRemoveContactEmailRequest(const FRemoveContactEmailRequest& src) : + FPlayFabBaseModel() + {} + + FRemoveContactEmailRequest(const TSharedPtr& obj) : FRemoveContactEmailRequest() + { + readFromValue(obj); + } + + ~FRemoveContactEmailRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveContactEmailResult : public FPlayFabBaseModel + { + FRemoveContactEmailResult() : + FPlayFabBaseModel() + {} + + FRemoveContactEmailResult(const FRemoveContactEmailResult& src) : + FPlayFabBaseModel() + {} + + FRemoveContactEmailResult(const TSharedPtr& obj) : FRemoveContactEmailResult() + { + readFromValue(obj); + } + + ~FRemoveContactEmailResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveFriendRequest : public FPlayFabBaseModel + { + // PlayFab identifier of the friend account which is to be removed. + FString FriendPlayFabId; + + FRemoveFriendRequest() : + FPlayFabBaseModel(), + FriendPlayFabId() + {} + + FRemoveFriendRequest(const FRemoveFriendRequest& src) : + FPlayFabBaseModel(), + FriendPlayFabId(src.FriendPlayFabId) + {} + + FRemoveFriendRequest(const TSharedPtr& obj) : FRemoveFriendRequest() + { + readFromValue(obj); + } + + ~FRemoveFriendRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveFriendResult : public FPlayFabBaseModel + { + FRemoveFriendResult() : + FPlayFabBaseModel() + {} + + FRemoveFriendResult(const FRemoveFriendResult& src) : + FPlayFabBaseModel() + {} + + FRemoveFriendResult(const TSharedPtr& obj) : FRemoveFriendResult() + { + readFromValue(obj); + } + + ~FRemoveFriendResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveGenericIDRequest : public FPlayFabBaseModel + { + // Generic service identifier to be removed from the player. + FGenericServiceId GenericId; + + FRemoveGenericIDRequest() : + FPlayFabBaseModel(), + GenericId() + {} + + FRemoveGenericIDRequest(const FRemoveGenericIDRequest& src) : + FPlayFabBaseModel(), + GenericId(src.GenericId) + {} + + FRemoveGenericIDRequest(const TSharedPtr& obj) : FRemoveGenericIDRequest() + { + readFromValue(obj); + } + + ~FRemoveGenericIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveGenericIDResult : public FPlayFabBaseModel + { + FRemoveGenericIDResult() : + FPlayFabBaseModel() + {} + + FRemoveGenericIDResult(const FRemoveGenericIDResult& src) : + FPlayFabBaseModel() + {} + + FRemoveGenericIDResult(const TSharedPtr& obj) : FRemoveGenericIDResult() + { + readFromValue(obj); + } + + ~FRemoveGenericIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveSharedGroupMembersRequest : public FPlayFabBaseModel + { + // An array of unique PlayFab assigned ID of the user on whom the operation will be performed. + TArray PlayFabIds; + // Unique identifier for the shared group. + FString SharedGroupId; + + FRemoveSharedGroupMembersRequest() : + FPlayFabBaseModel(), + PlayFabIds(), + SharedGroupId() + {} + + FRemoveSharedGroupMembersRequest(const FRemoveSharedGroupMembersRequest& src) : + FPlayFabBaseModel(), + PlayFabIds(src.PlayFabIds), + SharedGroupId(src.SharedGroupId) + {} + + FRemoveSharedGroupMembersRequest(const TSharedPtr& obj) : FRemoveSharedGroupMembersRequest() + { + readFromValue(obj); + } + + ~FRemoveSharedGroupMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveSharedGroupMembersResult : public FPlayFabBaseModel + { + FRemoveSharedGroupMembersResult() : + FPlayFabBaseModel() + {} + + FRemoveSharedGroupMembersResult(const FRemoveSharedGroupMembersResult& src) : + FPlayFabBaseModel() + {} + + FRemoveSharedGroupMembersResult(const TSharedPtr& obj) : FRemoveSharedGroupMembersResult() + { + readFromValue(obj); + } + + ~FRemoveSharedGroupMembersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FReportPlayerClientRequest : public FPlayFabBaseModel + { + // [optional] Optional additional comment by reporting player. + FString Comment; + + // Unique PlayFab identifier of the reported player. + FString ReporteeId; + + FReportPlayerClientRequest() : + FPlayFabBaseModel(), + Comment(), + ReporteeId() + {} + + FReportPlayerClientRequest(const FReportPlayerClientRequest& src) : + FPlayFabBaseModel(), + Comment(src.Comment), + ReporteeId(src.ReporteeId) + {} + + FReportPlayerClientRequest(const TSharedPtr& obj) : FReportPlayerClientRequest() + { + readFromValue(obj); + } + + ~FReportPlayerClientRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FReportPlayerClientResult : public FPlayFabBaseModel + { + // The number of remaining reports which may be filed today. + int32 SubmissionsRemaining; + + FReportPlayerClientResult() : + FPlayFabBaseModel(), + SubmissionsRemaining(0) + {} + + FReportPlayerClientResult(const FReportPlayerClientResult& src) : + FPlayFabBaseModel(), + SubmissionsRemaining(src.SubmissionsRemaining) + {} + + FReportPlayerClientResult(const TSharedPtr& obj) : FReportPlayerClientResult() + { + readFromValue(obj); + } + + ~FReportPlayerClientResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRestoreIOSPurchasesRequest : public FPlayFabBaseModel + { + // Base64 encoded receipt data, passed back by the App Store as a result of a successful purchase. + FString ReceiptData; + + FRestoreIOSPurchasesRequest() : + FPlayFabBaseModel(), + ReceiptData() + {} + + FRestoreIOSPurchasesRequest(const FRestoreIOSPurchasesRequest& src) : + FPlayFabBaseModel(), + ReceiptData(src.ReceiptData) + {} + + FRestoreIOSPurchasesRequest(const TSharedPtr& obj) : FRestoreIOSPurchasesRequest() + { + readFromValue(obj); + } + + ~FRestoreIOSPurchasesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRestoreIOSPurchasesResult : public FPlayFabBaseModel + { + FRestoreIOSPurchasesResult() : + FPlayFabBaseModel() + {} + + FRestoreIOSPurchasesResult(const FRestoreIOSPurchasesResult& src) : + FPlayFabBaseModel() + {} + + FRestoreIOSPurchasesResult(const TSharedPtr& obj) : FRestoreIOSPurchasesResult() + { + readFromValue(obj); + } + + ~FRestoreIOSPurchasesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendAccountRecoveryEmailRequest : public FPlayFabBaseModel + { + // User email address attached to their account + FString Email; + + // [optional] The email template id of the account recovery email template to send. + FString EmailTemplateId; + + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FSendAccountRecoveryEmailRequest() : + FPlayFabBaseModel(), + Email(), + EmailTemplateId(), + TitleId() + {} + + FSendAccountRecoveryEmailRequest(const FSendAccountRecoveryEmailRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + EmailTemplateId(src.EmailTemplateId), + TitleId(src.TitleId) + {} + + FSendAccountRecoveryEmailRequest(const TSharedPtr& obj) : FSendAccountRecoveryEmailRequest() + { + readFromValue(obj); + } + + ~FSendAccountRecoveryEmailRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendAccountRecoveryEmailResult : public FPlayFabBaseModel + { + FSendAccountRecoveryEmailResult() : + FPlayFabBaseModel() + {} + + FSendAccountRecoveryEmailResult(const FSendAccountRecoveryEmailResult& src) : + FPlayFabBaseModel() + {} + + FSendAccountRecoveryEmailResult(const TSharedPtr& obj) : FSendAccountRecoveryEmailResult() + { + readFromValue(obj); + } + + ~FSendAccountRecoveryEmailResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetFriendTagsRequest : public FPlayFabBaseModel + { + // PlayFab identifier of the friend account to which the tag(s) should be applied. + FString FriendPlayFabId; + + // Array of tags to set on the friend account. + TArray Tags; + FSetFriendTagsRequest() : + FPlayFabBaseModel(), + FriendPlayFabId(), + Tags() + {} + + FSetFriendTagsRequest(const FSetFriendTagsRequest& src) : + FPlayFabBaseModel(), + FriendPlayFabId(src.FriendPlayFabId), + Tags(src.Tags) + {} + + FSetFriendTagsRequest(const TSharedPtr& obj) : FSetFriendTagsRequest() + { + readFromValue(obj); + } + + ~FSetFriendTagsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetFriendTagsResult : public FPlayFabBaseModel + { + FSetFriendTagsResult() : + FPlayFabBaseModel() + {} + + FSetFriendTagsResult(const FSetFriendTagsResult& src) : + FPlayFabBaseModel() + {} + + FSetFriendTagsResult(const TSharedPtr& obj) : FSetFriendTagsResult() + { + readFromValue(obj); + } + + ~FSetFriendTagsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPlayerSecretRequest : public FPlayFabBaseModel + { + // [optional] Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only). + FString EncryptedRequest; + + // [optional] Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + FSetPlayerSecretRequest() : + FPlayFabBaseModel(), + EncryptedRequest(), + PlayerSecret() + {} + + FSetPlayerSecretRequest(const FSetPlayerSecretRequest& src) : + FPlayFabBaseModel(), + EncryptedRequest(src.EncryptedRequest), + PlayerSecret(src.PlayerSecret) + {} + + FSetPlayerSecretRequest(const TSharedPtr& obj) : FSetPlayerSecretRequest() + { + readFromValue(obj); + } + + ~FSetPlayerSecretRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPlayerSecretResult : public FPlayFabBaseModel + { + FSetPlayerSecretResult() : + FPlayFabBaseModel() + {} + + FSetPlayerSecretResult(const FSetPlayerSecretResult& src) : + FPlayFabBaseModel() + {} + + FSetPlayerSecretResult(const TSharedPtr& obj) : FSetPlayerSecretResult() + { + readFromValue(obj); + } + + ~FSetPlayerSecretResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStartGameRequest : public FPlayFabBaseModel + { + // version information for the build of the game server which is to be started + FString BuildVersion; + + // [optional] character to use for stats based matching. Leave null to use account stats + FString CharacterId; + + // [optional] custom command line argument when starting game server process + FString CustomCommandLineData; + + // the title-defined game mode this server is to be running (defaults to 0 if there is only one mode) + FString GameMode; + + // the region to associate this server with for match filtering + Region pfRegion; + + // [optional] player statistic for others to use in finding this game. May be null for no stat-based matching + FString StatisticName; + + FStartGameRequest() : + FPlayFabBaseModel(), + BuildVersion(), + CharacterId(), + CustomCommandLineData(), + GameMode(), + pfRegion(), + StatisticName() + {} + + FStartGameRequest(const FStartGameRequest& src) : + FPlayFabBaseModel(), + BuildVersion(src.BuildVersion), + CharacterId(src.CharacterId), + CustomCommandLineData(src.CustomCommandLineData), + GameMode(src.GameMode), + pfRegion(src.pfRegion), + StatisticName(src.StatisticName) + {} + + FStartGameRequest(const TSharedPtr& obj) : FStartGameRequest() + { + readFromValue(obj); + } + + ~FStartGameRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStartGameResult : public FPlayFabBaseModel + { + // [optional] timestamp for when the server should expire, if applicable + FString Expires; + + // [optional] unique identifier for the lobby of the server started + FString LobbyID; + + // [optional] password required to log into the server + FString Password; + + // [optional] server IPV4 address + FString ServerHostname; + + // [optional] server IPV4 address + FString ServerIPV4Address; + + // [optional] server IPV6 address + FString ServerIPV6Address; + + // [optional] port on the server to be used for communication + Boxed ServerPort; + + // [optional] server public DNS name + FString ServerPublicDNSName; + + // [optional] unique identifier for the server + FString Ticket; + + FStartGameResult() : + FPlayFabBaseModel(), + Expires(), + LobbyID(), + Password(), + ServerHostname(), + ServerIPV4Address(), + ServerIPV6Address(), + ServerPort(), + ServerPublicDNSName(), + Ticket() + {} + + FStartGameResult(const FStartGameResult& src) : + FPlayFabBaseModel(), + Expires(src.Expires), + LobbyID(src.LobbyID), + Password(src.Password), + ServerHostname(src.ServerHostname), + ServerIPV4Address(src.ServerIPV4Address), + ServerIPV6Address(src.ServerIPV6Address), + ServerPort(src.ServerPort), + ServerPublicDNSName(src.ServerPublicDNSName), + Ticket(src.Ticket) + {} + + FStartGameResult(const TSharedPtr& obj) : FStartGameResult() + { + readFromValue(obj); + } + + ~FStartGameResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStartPurchaseRequest : public FPlayFabBaseModel + { + // [optional] Catalog version for the items to be purchased. Defaults to most recent catalog. + FString CatalogVersion; + + // Array of items to purchase. + TArray Items; + // [optional] Store through which to purchase items. If not set, prices will be pulled from the catalog itself. + FString StoreId; + + FStartPurchaseRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + Items(), + StoreId() + {} + + FStartPurchaseRequest(const FStartPurchaseRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + Items(src.Items), + StoreId(src.StoreId) + {} + + FStartPurchaseRequest(const TSharedPtr& obj) : FStartPurchaseRequest() + { + readFromValue(obj); + } + + ~FStartPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStartPurchaseResult : public FPlayFabBaseModel + { + // [optional] Cart items to be purchased. + TArray Contents; + // [optional] Purchase order identifier. + FString OrderId; + + // [optional] Available methods by which the user can pay. + TArray PaymentOptions; + // [optional] Current virtual currency totals for the user. + TMap VirtualCurrencyBalances; + FStartPurchaseResult() : + FPlayFabBaseModel(), + Contents(), + OrderId(), + PaymentOptions(), + VirtualCurrencyBalances() + {} + + FStartPurchaseResult(const FStartPurchaseResult& src) : + FPlayFabBaseModel(), + Contents(src.Contents), + OrderId(src.OrderId), + PaymentOptions(src.PaymentOptions), + VirtualCurrencyBalances(src.VirtualCurrencyBalances) + {} + + FStartPurchaseResult(const TSharedPtr& obj) : FStartPurchaseResult() + { + readFromValue(obj); + } + + ~FStartPurchaseResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticUpdate : public FPlayFabBaseModel + { + // unique name of the statistic + FString StatisticName; + + // statistic value for the player + int32 Value; + + /** + * [optional] for updates to an existing statistic value for a player, the version of the statistic when it was loaded. Null when + * setting the statistic value for the first time. + */ + Boxed Version; + + FStatisticUpdate() : + FPlayFabBaseModel(), + StatisticName(), + Value(0), + Version() + {} + + FStatisticUpdate(const FStatisticUpdate& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName), + Value(src.Value), + Version(src.Version) + {} + + FStatisticUpdate(const TSharedPtr& obj) : FStatisticUpdate() + { + readFromValue(obj); + } + + ~FStatisticUpdate(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSubtractUserVirtualCurrencyRequest : public FPlayFabBaseModel + { + // Amount to be subtracted from the user balance of the specified virtual currency. + int32 Amount; + + // Name of the virtual currency which is to be decremented. + FString VirtualCurrency; + + FSubtractUserVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + VirtualCurrency() + {} + + FSubtractUserVirtualCurrencyRequest(const FSubtractUserVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + VirtualCurrency(src.VirtualCurrency) + {} + + FSubtractUserVirtualCurrencyRequest(const TSharedPtr& obj) : FSubtractUserVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FSubtractUserVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkAndroidDeviceIDRequest : public FPlayFabBaseModel + { + /** + * [optional] Android device identifier for the user's device. If not specified, the most recently signed in Android Device ID will be + * used. + */ + FString AndroidDeviceId; + + FUnlinkAndroidDeviceIDRequest() : + FPlayFabBaseModel(), + AndroidDeviceId() + {} + + FUnlinkAndroidDeviceIDRequest(const FUnlinkAndroidDeviceIDRequest& src) : + FPlayFabBaseModel(), + AndroidDeviceId(src.AndroidDeviceId) + {} + + FUnlinkAndroidDeviceIDRequest(const TSharedPtr& obj) : FUnlinkAndroidDeviceIDRequest() + { + readFromValue(obj); + } + + ~FUnlinkAndroidDeviceIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkAndroidDeviceIDResult : public FPlayFabBaseModel + { + FUnlinkAndroidDeviceIDResult() : + FPlayFabBaseModel() + {} + + FUnlinkAndroidDeviceIDResult(const FUnlinkAndroidDeviceIDResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkAndroidDeviceIDResult(const TSharedPtr& obj) : FUnlinkAndroidDeviceIDResult() + { + readFromValue(obj); + } + + ~FUnlinkAndroidDeviceIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkCustomIDRequest : public FPlayFabBaseModel + { + /** + * [optional] Custom unique identifier for the user, generated by the title. If not specified, the most recently signed in Custom ID + * will be used. + */ + FString CustomId; + + FUnlinkCustomIDRequest() : + FPlayFabBaseModel(), + CustomId() + {} + + FUnlinkCustomIDRequest(const FUnlinkCustomIDRequest& src) : + FPlayFabBaseModel(), + CustomId(src.CustomId) + {} + + FUnlinkCustomIDRequest(const TSharedPtr& obj) : FUnlinkCustomIDRequest() + { + readFromValue(obj); + } + + ~FUnlinkCustomIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkCustomIDResult : public FPlayFabBaseModel + { + FUnlinkCustomIDResult() : + FPlayFabBaseModel() + {} + + FUnlinkCustomIDResult(const FUnlinkCustomIDResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkCustomIDResult(const TSharedPtr& obj) : FUnlinkCustomIDResult() + { + readFromValue(obj); + } + + ~FUnlinkCustomIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkFacebookAccountRequest : public FPlayFabBaseModel + { + FUnlinkFacebookAccountRequest() : + FPlayFabBaseModel() + {} + + FUnlinkFacebookAccountRequest(const FUnlinkFacebookAccountRequest& src) : + FPlayFabBaseModel() + {} + + FUnlinkFacebookAccountRequest(const TSharedPtr& obj) : FUnlinkFacebookAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkFacebookAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkFacebookAccountResult : public FPlayFabBaseModel + { + FUnlinkFacebookAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkFacebookAccountResult(const FUnlinkFacebookAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkFacebookAccountResult(const TSharedPtr& obj) : FUnlinkFacebookAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkFacebookAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkFacebookInstantGamesIdRequest : public FPlayFabBaseModel + { + // [optional] Facebook Instant Games identifier for the user. If not specified, the most recently signed in ID will be used. + FString FacebookInstantGamesId; + + FUnlinkFacebookInstantGamesIdRequest() : + FPlayFabBaseModel(), + FacebookInstantGamesId() + {} + + FUnlinkFacebookInstantGamesIdRequest(const FUnlinkFacebookInstantGamesIdRequest& src) : + FPlayFabBaseModel(), + FacebookInstantGamesId(src.FacebookInstantGamesId) + {} + + FUnlinkFacebookInstantGamesIdRequest(const TSharedPtr& obj) : FUnlinkFacebookInstantGamesIdRequest() + { + readFromValue(obj); + } + + ~FUnlinkFacebookInstantGamesIdRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkFacebookInstantGamesIdResult : public FPlayFabBaseModel + { + FUnlinkFacebookInstantGamesIdResult() : + FPlayFabBaseModel() + {} + + FUnlinkFacebookInstantGamesIdResult(const FUnlinkFacebookInstantGamesIdResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkFacebookInstantGamesIdResult(const TSharedPtr& obj) : FUnlinkFacebookInstantGamesIdResult() + { + readFromValue(obj); + } + + ~FUnlinkFacebookInstantGamesIdResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkGameCenterAccountRequest : public FPlayFabBaseModel + { + FUnlinkGameCenterAccountRequest() : + FPlayFabBaseModel() + {} + + FUnlinkGameCenterAccountRequest(const FUnlinkGameCenterAccountRequest& src) : + FPlayFabBaseModel() + {} + + FUnlinkGameCenterAccountRequest(const TSharedPtr& obj) : FUnlinkGameCenterAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkGameCenterAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkGameCenterAccountResult : public FPlayFabBaseModel + { + FUnlinkGameCenterAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkGameCenterAccountResult(const FUnlinkGameCenterAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkGameCenterAccountResult(const TSharedPtr& obj) : FUnlinkGameCenterAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkGameCenterAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkGoogleAccountRequest : public FPlayFabBaseModel + { + FUnlinkGoogleAccountRequest() : + FPlayFabBaseModel() + {} + + FUnlinkGoogleAccountRequest(const FUnlinkGoogleAccountRequest& src) : + FPlayFabBaseModel() + {} + + FUnlinkGoogleAccountRequest(const TSharedPtr& obj) : FUnlinkGoogleAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkGoogleAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkGoogleAccountResult : public FPlayFabBaseModel + { + FUnlinkGoogleAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkGoogleAccountResult(const FUnlinkGoogleAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkGoogleAccountResult(const TSharedPtr& obj) : FUnlinkGoogleAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkGoogleAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkIOSDeviceIDRequest : public FPlayFabBaseModel + { + /** + * [optional] Vendor-specific iOS identifier for the user's device. If not specified, the most recently signed in iOS Device ID will + * be used. + */ + FString DeviceId; + + FUnlinkIOSDeviceIDRequest() : + FPlayFabBaseModel(), + DeviceId() + {} + + FUnlinkIOSDeviceIDRequest(const FUnlinkIOSDeviceIDRequest& src) : + FPlayFabBaseModel(), + DeviceId(src.DeviceId) + {} + + FUnlinkIOSDeviceIDRequest(const TSharedPtr& obj) : FUnlinkIOSDeviceIDRequest() + { + readFromValue(obj); + } + + ~FUnlinkIOSDeviceIDRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkIOSDeviceIDResult : public FPlayFabBaseModel + { + FUnlinkIOSDeviceIDResult() : + FPlayFabBaseModel() + {} + + FUnlinkIOSDeviceIDResult(const FUnlinkIOSDeviceIDResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkIOSDeviceIDResult(const TSharedPtr& obj) : FUnlinkIOSDeviceIDResult() + { + readFromValue(obj); + } + + ~FUnlinkIOSDeviceIDResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkKongregateAccountRequest : public FPlayFabBaseModel + { + FUnlinkKongregateAccountRequest() : + FPlayFabBaseModel() + {} + + FUnlinkKongregateAccountRequest(const FUnlinkKongregateAccountRequest& src) : + FPlayFabBaseModel() + {} + + FUnlinkKongregateAccountRequest(const TSharedPtr& obj) : FUnlinkKongregateAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkKongregateAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkKongregateAccountResult : public FPlayFabBaseModel + { + FUnlinkKongregateAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkKongregateAccountResult(const FUnlinkKongregateAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkKongregateAccountResult(const TSharedPtr& obj) : FUnlinkKongregateAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkKongregateAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkNintendoSwitchDeviceIdRequest : public FPlayFabBaseModel + { + // [optional] Nintendo Switch Device identifier for the user. If not specified, the most recently signed in device ID will be used. + FString NintendoSwitchDeviceId; + + FUnlinkNintendoSwitchDeviceIdRequest() : + FPlayFabBaseModel(), + NintendoSwitchDeviceId() + {} + + FUnlinkNintendoSwitchDeviceIdRequest(const FUnlinkNintendoSwitchDeviceIdRequest& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId) + {} + + FUnlinkNintendoSwitchDeviceIdRequest(const TSharedPtr& obj) : FUnlinkNintendoSwitchDeviceIdRequest() + { + readFromValue(obj); + } + + ~FUnlinkNintendoSwitchDeviceIdRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkNintendoSwitchDeviceIdResult : public FPlayFabBaseModel + { + FUnlinkNintendoSwitchDeviceIdResult() : + FPlayFabBaseModel() + {} + + FUnlinkNintendoSwitchDeviceIdResult(const FUnlinkNintendoSwitchDeviceIdResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkNintendoSwitchDeviceIdResult(const TSharedPtr& obj) : FUnlinkNintendoSwitchDeviceIdResult() + { + readFromValue(obj); + } + + ~FUnlinkNintendoSwitchDeviceIdResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkSteamAccountRequest : public FPlayFabBaseModel + { + FUnlinkSteamAccountRequest() : + FPlayFabBaseModel() + {} + + FUnlinkSteamAccountRequest(const FUnlinkSteamAccountRequest& src) : + FPlayFabBaseModel() + {} + + FUnlinkSteamAccountRequest(const TSharedPtr& obj) : FUnlinkSteamAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkSteamAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkSteamAccountResult : public FPlayFabBaseModel + { + FUnlinkSteamAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkSteamAccountResult(const FUnlinkSteamAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkSteamAccountResult(const TSharedPtr& obj) : FUnlinkSteamAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkSteamAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkTwitchAccountRequest : public FPlayFabBaseModel + { + FUnlinkTwitchAccountRequest() : + FPlayFabBaseModel() + {} + + FUnlinkTwitchAccountRequest(const FUnlinkTwitchAccountRequest& src) : + FPlayFabBaseModel() + {} + + FUnlinkTwitchAccountRequest(const TSharedPtr& obj) : FUnlinkTwitchAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkTwitchAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkTwitchAccountResult : public FPlayFabBaseModel + { + FUnlinkTwitchAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkTwitchAccountResult(const FUnlinkTwitchAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkTwitchAccountResult(const TSharedPtr& obj) : FUnlinkTwitchAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkTwitchAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkWindowsHelloAccountRequest : public FPlayFabBaseModel + { + // SHA256 hash of the PublicKey generated by Windows Hello. + FString PublicKeyHint; + + FUnlinkWindowsHelloAccountRequest() : + FPlayFabBaseModel(), + PublicKeyHint() + {} + + FUnlinkWindowsHelloAccountRequest(const FUnlinkWindowsHelloAccountRequest& src) : + FPlayFabBaseModel(), + PublicKeyHint(src.PublicKeyHint) + {} + + FUnlinkWindowsHelloAccountRequest(const TSharedPtr& obj) : FUnlinkWindowsHelloAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkWindowsHelloAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkWindowsHelloAccountResponse : public FPlayFabBaseModel + { + FUnlinkWindowsHelloAccountResponse() : + FPlayFabBaseModel() + {} + + FUnlinkWindowsHelloAccountResponse(const FUnlinkWindowsHelloAccountResponse& src) : + FPlayFabBaseModel() + {} + + FUnlinkWindowsHelloAccountResponse(const TSharedPtr& obj) : FUnlinkWindowsHelloAccountResponse() + { + readFromValue(obj); + } + + ~FUnlinkWindowsHelloAccountResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkXboxAccountRequest : public FPlayFabBaseModel + { + // Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + FString XboxToken; + + FUnlinkXboxAccountRequest() : + FPlayFabBaseModel(), + XboxToken() + {} + + FUnlinkXboxAccountRequest(const FUnlinkXboxAccountRequest& src) : + FPlayFabBaseModel(), + XboxToken(src.XboxToken) + {} + + FUnlinkXboxAccountRequest(const TSharedPtr& obj) : FUnlinkXboxAccountRequest() + { + readFromValue(obj); + } + + ~FUnlinkXboxAccountRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlinkXboxAccountResult : public FPlayFabBaseModel + { + FUnlinkXboxAccountResult() : + FPlayFabBaseModel() + {} + + FUnlinkXboxAccountResult(const FUnlinkXboxAccountResult& src) : + FPlayFabBaseModel() + {} + + FUnlinkXboxAccountResult(const TSharedPtr& obj) : FUnlinkXboxAccountResult() + { + readFromValue(obj); + } + + ~FUnlinkXboxAccountResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlockContainerInstanceRequest : public FPlayFabBaseModel + { + /** + * [optional] Specifies the catalog version that should be used to determine container contents. If unspecified, uses catalog + * associated with the item instance. + */ + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // ItemInstanceId of the container to unlock. + FString ContainerItemInstanceId; + + /** + * [optional] ItemInstanceId of the key that will be consumed by unlocking this container. If the container requires a key, this + * parameter is required. + */ + FString KeyItemInstanceId; + + FUnlockContainerInstanceRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + ContainerItemInstanceId(), + KeyItemInstanceId() + {} + + FUnlockContainerInstanceRequest(const FUnlockContainerInstanceRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + ContainerItemInstanceId(src.ContainerItemInstanceId), + KeyItemInstanceId(src.KeyItemInstanceId) + {} + + FUnlockContainerInstanceRequest(const TSharedPtr& obj) : FUnlockContainerInstanceRequest() + { + readFromValue(obj); + } + + ~FUnlockContainerInstanceRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlockContainerItemRequest : public FPlayFabBaseModel + { + /** + * [optional] Specifies the catalog version that should be used to determine container contents. If unspecified, uses default/primary + * catalog. + */ + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Catalog ItemId of the container type to unlock. + FString ContainerItemId; + + FUnlockContainerItemRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + ContainerItemId() + {} + + FUnlockContainerItemRequest(const FUnlockContainerItemRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + ContainerItemId(src.ContainerItemId) + {} + + FUnlockContainerItemRequest(const TSharedPtr& obj) : FUnlockContainerItemRequest() + { + readFromValue(obj); + } + + ~FUnlockContainerItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlockContainerItemResult : public FPlayFabBaseModel + { + // [optional] Items granted to the player as a result of unlocking the container. + TArray GrantedItems; + // [optional] Unique instance identifier of the container unlocked. + FString UnlockedItemInstanceId; + + // [optional] Unique instance identifier of the key used to unlock the container, if applicable. + FString UnlockedWithItemInstanceId; + + // [optional] Virtual currency granted to the player as a result of unlocking the container. + TMap VirtualCurrency; + FUnlockContainerItemResult() : + FPlayFabBaseModel(), + GrantedItems(), + UnlockedItemInstanceId(), + UnlockedWithItemInstanceId(), + VirtualCurrency() + {} + + FUnlockContainerItemResult(const FUnlockContainerItemResult& src) : + FPlayFabBaseModel(), + GrantedItems(src.GrantedItems), + UnlockedItemInstanceId(src.UnlockedItemInstanceId), + UnlockedWithItemInstanceId(src.UnlockedWithItemInstanceId), + VirtualCurrency(src.VirtualCurrency) + {} + + FUnlockContainerItemResult(const TSharedPtr& obj) : FUnlockContainerItemResult() + { + readFromValue(obj); + } + + ~FUnlockContainerItemResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateAvatarUrlRequest : public FPlayFabBaseModel + { + // URL of the avatar image. If empty, it removes the existing avatar URL. + FString ImageUrl; + + FUpdateAvatarUrlRequest() : + FPlayFabBaseModel(), + ImageUrl() + {} + + FUpdateAvatarUrlRequest(const FUpdateAvatarUrlRequest& src) : + FPlayFabBaseModel(), + ImageUrl(src.ImageUrl) + {} + + FUpdateAvatarUrlRequest(const TSharedPtr& obj) : FUpdateAvatarUrlRequest() + { + readFromValue(obj); + } + + ~FUpdateAvatarUrlRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterDataRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // [optional] Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. + Boxed Permission; + + FUpdateCharacterDataRequest() : + FPlayFabBaseModel(), + CharacterId(), + Data(), + KeysToRemove(), + Permission() + {} + + FUpdateCharacterDataRequest(const FUpdateCharacterDataRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission) + {} + + FUpdateCharacterDataRequest(const TSharedPtr& obj) : FUpdateCharacterDataRequest() + { + readFromValue(obj); + } + + ~FUpdateCharacterDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterDataResult : public FPlayFabBaseModel + { + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FUpdateCharacterDataResult() : + FPlayFabBaseModel(), + DataVersion(0) + {} + + FUpdateCharacterDataResult(const FUpdateCharacterDataResult& src) : + FPlayFabBaseModel(), + DataVersion(src.DataVersion) + {} + + FUpdateCharacterDataResult(const TSharedPtr& obj) : FUpdateCharacterDataResult() + { + readFromValue(obj); + } + + ~FUpdateCharacterDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterStatisticsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] Statistics to be updated with the provided values. + TMap CharacterStatistics; + FUpdateCharacterStatisticsRequest() : + FPlayFabBaseModel(), + CharacterId(), + CharacterStatistics() + {} + + FUpdateCharacterStatisticsRequest(const FUpdateCharacterStatisticsRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterStatistics(src.CharacterStatistics) + {} + + FUpdateCharacterStatisticsRequest(const TSharedPtr& obj) : FUpdateCharacterStatisticsRequest() + { + readFromValue(obj); + } + + ~FUpdateCharacterStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterStatisticsResult : public FPlayFabBaseModel + { + FUpdateCharacterStatisticsResult() : + FPlayFabBaseModel() + {} + + FUpdateCharacterStatisticsResult(const FUpdateCharacterStatisticsResult& src) : + FPlayFabBaseModel() + {} + + FUpdateCharacterStatisticsResult(const TSharedPtr& obj) : FUpdateCharacterStatisticsResult() + { + readFromValue(obj); + } + + ~FUpdateCharacterStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerStatisticsRequest : public FPlayFabBaseModel + { + // Statistics to be updated with the provided values + TArray Statistics; + FUpdatePlayerStatisticsRequest() : + FPlayFabBaseModel(), + Statistics() + {} + + FUpdatePlayerStatisticsRequest(const FUpdatePlayerStatisticsRequest& src) : + FPlayFabBaseModel(), + Statistics(src.Statistics) + {} + + FUpdatePlayerStatisticsRequest(const TSharedPtr& obj) : FUpdatePlayerStatisticsRequest() + { + readFromValue(obj); + } + + ~FUpdatePlayerStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerStatisticsResult : public FPlayFabBaseModel + { + FUpdatePlayerStatisticsResult() : + FPlayFabBaseModel() + {} + + FUpdatePlayerStatisticsResult(const FUpdatePlayerStatisticsResult& src) : + FPlayFabBaseModel() + {} + + FUpdatePlayerStatisticsResult(const TSharedPtr& obj) : FUpdatePlayerStatisticsResult() + { + readFromValue(obj); + } + + ~FUpdatePlayerStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateSharedGroupDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // [optional] Permission to be applied to all user data keys in this request. + Boxed Permission; + + // Unique identifier for the shared group. + FString SharedGroupId; + + FUpdateSharedGroupDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + Permission(), + SharedGroupId() + {} + + FUpdateSharedGroupDataRequest(const FUpdateSharedGroupDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission), + SharedGroupId(src.SharedGroupId) + {} + + FUpdateSharedGroupDataRequest(const TSharedPtr& obj) : FUpdateSharedGroupDataRequest() + { + readFromValue(obj); + } + + ~FUpdateSharedGroupDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateSharedGroupDataResult : public FPlayFabBaseModel + { + FUpdateSharedGroupDataResult() : + FPlayFabBaseModel() + {} + + FUpdateSharedGroupDataResult(const FUpdateSharedGroupDataResult& src) : + FPlayFabBaseModel() + {} + + FUpdateSharedGroupDataResult(const TSharedPtr& obj) : FUpdateSharedGroupDataResult() + { + readFromValue(obj); + } + + ~FUpdateSharedGroupDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + /** + * [optional] Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. This is used + * for requests by one player for information about another player; those requests will only return Public keys. + */ + Boxed Permission; + + FUpdateUserDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + Permission() + {} + + FUpdateUserDataRequest(const FUpdateUserDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission) + {} + + FUpdateUserDataRequest(const TSharedPtr& obj) : FUpdateUserDataRequest() + { + readFromValue(obj); + } + + ~FUpdateUserDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserDataResult : public FPlayFabBaseModel + { + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FUpdateUserDataResult() : + FPlayFabBaseModel(), + DataVersion(0) + {} + + FUpdateUserDataResult(const FUpdateUserDataResult& src) : + FPlayFabBaseModel(), + DataVersion(src.DataVersion) + {} + + FUpdateUserDataResult(const TSharedPtr& obj) : FUpdateUserDataResult() + { + readFromValue(obj); + } + + ~FUpdateUserDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserTitleDisplayNameRequest : public FPlayFabBaseModel + { + // New title display name for the user - must be between 3 and 25 characters. + FString DisplayName; + + FUpdateUserTitleDisplayNameRequest() : + FPlayFabBaseModel(), + DisplayName() + {} + + FUpdateUserTitleDisplayNameRequest(const FUpdateUserTitleDisplayNameRequest& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName) + {} + + FUpdateUserTitleDisplayNameRequest(const TSharedPtr& obj) : FUpdateUserTitleDisplayNameRequest() + { + readFromValue(obj); + } + + ~FUpdateUserTitleDisplayNameRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserTitleDisplayNameResult : public FPlayFabBaseModel + { + // [optional] Current title display name for the user (this will be the original display name if the rename attempt failed). + FString DisplayName; + + FUpdateUserTitleDisplayNameResult() : + FPlayFabBaseModel(), + DisplayName() + {} + + FUpdateUserTitleDisplayNameResult(const FUpdateUserTitleDisplayNameResult& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName) + {} + + FUpdateUserTitleDisplayNameResult(const TSharedPtr& obj) : FUpdateUserTitleDisplayNameResult() + { + readFromValue(obj); + } + + ~FUpdateUserTitleDisplayNameResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateAmazonReceiptRequest : public FPlayFabBaseModel + { + // [optional] Catalog version to use when granting receipt item. If null, defaults to primary catalog. + FString CatalogVersion; + + // Currency used for the purchase. + FString CurrencyCode; + + // Amount of the stated currency paid for the object. + int32 PurchasePrice; + + // ReceiptId returned by the Amazon App Store in-app purchase API + FString ReceiptId; + + // AmazonId of the user making the purchase as returned by the Amazon App Store in-app purchase API + FString UserId; + + FValidateAmazonReceiptRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CurrencyCode(), + PurchasePrice(0), + ReceiptId(), + UserId() + {} + + FValidateAmazonReceiptRequest(const FValidateAmazonReceiptRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CurrencyCode(src.CurrencyCode), + PurchasePrice(src.PurchasePrice), + ReceiptId(src.ReceiptId), + UserId(src.UserId) + {} + + FValidateAmazonReceiptRequest(const TSharedPtr& obj) : FValidateAmazonReceiptRequest() + { + readFromValue(obj); + } + + ~FValidateAmazonReceiptRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateAmazonReceiptResult : public FPlayFabBaseModel + { + FValidateAmazonReceiptResult() : + FPlayFabBaseModel() + {} + + FValidateAmazonReceiptResult(const FValidateAmazonReceiptResult& src) : + FPlayFabBaseModel() + {} + + FValidateAmazonReceiptResult(const TSharedPtr& obj) : FValidateAmazonReceiptResult() + { + readFromValue(obj); + } + + ~FValidateAmazonReceiptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateGooglePlayPurchaseRequest : public FPlayFabBaseModel + { + // [optional] Currency used for the purchase. + FString CurrencyCode; + + // [optional] Amount of the stated currency paid for the object. + Boxed PurchasePrice; + + // Original JSON string returned by the Google Play IAB API. + FString ReceiptJson; + + // Signature returned by the Google Play IAB API. + FString Signature; + + FValidateGooglePlayPurchaseRequest() : + FPlayFabBaseModel(), + CurrencyCode(), + PurchasePrice(), + ReceiptJson(), + Signature() + {} + + FValidateGooglePlayPurchaseRequest(const FValidateGooglePlayPurchaseRequest& src) : + FPlayFabBaseModel(), + CurrencyCode(src.CurrencyCode), + PurchasePrice(src.PurchasePrice), + ReceiptJson(src.ReceiptJson), + Signature(src.Signature) + {} + + FValidateGooglePlayPurchaseRequest(const TSharedPtr& obj) : FValidateGooglePlayPurchaseRequest() + { + readFromValue(obj); + } + + ~FValidateGooglePlayPurchaseRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateGooglePlayPurchaseResult : public FPlayFabBaseModel + { + FValidateGooglePlayPurchaseResult() : + FPlayFabBaseModel() + {} + + FValidateGooglePlayPurchaseResult(const FValidateGooglePlayPurchaseResult& src) : + FPlayFabBaseModel() + {} + + FValidateGooglePlayPurchaseResult(const TSharedPtr& obj) : FValidateGooglePlayPurchaseResult() + { + readFromValue(obj); + } + + ~FValidateGooglePlayPurchaseResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateIOSReceiptRequest : public FPlayFabBaseModel + { + // Currency used for the purchase. + FString CurrencyCode; + + // Amount of the stated currency paid for the object. + int32 PurchasePrice; + + // Base64 encoded receipt data, passed back by the App Store as a result of a successful purchase. + FString ReceiptData; + + FValidateIOSReceiptRequest() : + FPlayFabBaseModel(), + CurrencyCode(), + PurchasePrice(0), + ReceiptData() + {} + + FValidateIOSReceiptRequest(const FValidateIOSReceiptRequest& src) : + FPlayFabBaseModel(), + CurrencyCode(src.CurrencyCode), + PurchasePrice(src.PurchasePrice), + ReceiptData(src.ReceiptData) + {} + + FValidateIOSReceiptRequest(const TSharedPtr& obj) : FValidateIOSReceiptRequest() + { + readFromValue(obj); + } + + ~FValidateIOSReceiptRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateIOSReceiptResult : public FPlayFabBaseModel + { + FValidateIOSReceiptResult() : + FPlayFabBaseModel() + {} + + FValidateIOSReceiptResult(const FValidateIOSReceiptResult& src) : + FPlayFabBaseModel() + {} + + FValidateIOSReceiptResult(const TSharedPtr& obj) : FValidateIOSReceiptResult() + { + readFromValue(obj); + } + + ~FValidateIOSReceiptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateWindowsReceiptRequest : public FPlayFabBaseModel + { + // [optional] Catalog version to use when granting receipt item. If null, defaults to primary catalog. + FString CatalogVersion; + + // Currency used for the purchase. + FString CurrencyCode; + + // Amount of the stated currency paid for the object. + uint32 PurchasePrice; + + // XML Receipt returned by the Windows App Store in-app purchase API + FString Receipt; + + FValidateWindowsReceiptRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CurrencyCode(), + PurchasePrice(0), + Receipt() + {} + + FValidateWindowsReceiptRequest(const FValidateWindowsReceiptRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CurrencyCode(src.CurrencyCode), + PurchasePrice(src.PurchasePrice), + Receipt(src.Receipt) + {} + + FValidateWindowsReceiptRequest(const TSharedPtr& obj) : FValidateWindowsReceiptRequest() + { + readFromValue(obj); + } + + ~FValidateWindowsReceiptRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValidateWindowsReceiptResult : public FPlayFabBaseModel + { + FValidateWindowsReceiptResult() : + FPlayFabBaseModel() + {} + + FValidateWindowsReceiptResult(const FValidateWindowsReceiptResult& src) : + FPlayFabBaseModel() + {} + + FValidateWindowsReceiptResult(const TSharedPtr& obj) : FValidateWindowsReceiptResult() + { + readFromValue(obj); + } + + ~FValidateWindowsReceiptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteClientCharacterEventRequest : public FPlayFabBaseModel + { + // [optional] Custom event properties. Each property consists of a name (string) and a value (JSON object). + TMap Body; + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + FString EventName; + + // [optional] The time (in UTC) associated with this event. The value dafaults to the current time. + Boxed Timestamp; + + FWriteClientCharacterEventRequest() : + FPlayFabBaseModel(), + Body(), + CharacterId(), + EventName(), + Timestamp() + {} + + FWriteClientCharacterEventRequest(const FWriteClientCharacterEventRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + CharacterId(src.CharacterId), + EventName(src.EventName), + Timestamp(src.Timestamp) + {} + + FWriteClientCharacterEventRequest(const TSharedPtr& obj) : FWriteClientCharacterEventRequest() + { + readFromValue(obj); + } + + ~FWriteClientCharacterEventRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteClientPlayerEventRequest : public FPlayFabBaseModel + { + // [optional] Custom data properties associated with the event. Each property consists of a name (string) and a value (JSON object). + TMap Body; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + FString EventName; + + // [optional] The time (in UTC) associated with this event. The value dafaults to the current time. + Boxed Timestamp; + + FWriteClientPlayerEventRequest() : + FPlayFabBaseModel(), + Body(), + EventName(), + Timestamp() + {} + + FWriteClientPlayerEventRequest(const FWriteClientPlayerEventRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + EventName(src.EventName), + Timestamp(src.Timestamp) + {} + + FWriteClientPlayerEventRequest(const TSharedPtr& obj) : FWriteClientPlayerEventRequest() + { + readFromValue(obj); + } + + ~FWriteClientPlayerEventRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteEventResponse : public FPlayFabBaseModel + { + /** + * [optional] The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to + * any particular format. + */ + FString EventId; + + FWriteEventResponse() : + FPlayFabBaseModel(), + EventId() + {} + + FWriteEventResponse(const FWriteEventResponse& src) : + FPlayFabBaseModel(), + EventId(src.EventId) + {} + + FWriteEventResponse(const TSharedPtr& obj) : FWriteEventResponse() + { + readFromValue(obj); + } + + ~FWriteEventResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteTitleEventRequest : public FPlayFabBaseModel + { + // [optional] Custom event properties. Each property consists of a name (string) and a value (JSON object). + TMap Body; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + FString EventName; + + // [optional] The time (in UTC) associated with this event. The value dafaults to the current time. + Boxed Timestamp; + + FWriteTitleEventRequest() : + FPlayFabBaseModel(), + Body(), + EventName(), + Timestamp() + {} + + FWriteTitleEventRequest(const FWriteTitleEventRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + EventName(src.EventName), + Timestamp(src.Timestamp) + {} + + FWriteTitleEventRequest(const TSharedPtr& obj) : FWriteTitleEventRequest() + { + readFromValue(obj); + } + + ~FWriteTitleEventRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabCloudScriptAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabCloudScriptAPI.h new file mode 100644 index 000000000..1f0c50fbe --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabCloudScriptAPI.h @@ -0,0 +1,44 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabCloudScriptDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabCloudScriptAPI + { + public: + DECLARE_DELEGATE_OneParam(FExecuteEntityCloudScriptDelegate, const CloudScriptModels::FExecuteCloudScriptResult&); + + UPlayFabCloudScriptAPI(); + ~UPlayFabCloudScriptAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Cloud Script is one of PlayFab's most versatile features. It allows client code to request execution of any kind of + * custom server-side functionality you can implement, and it can be used in conjunction with virtually anything. + * Executes CloudScript with the entity profile that is defined in the request. + */ + bool ExecuteEntityCloudScript(CloudScriptModels::FExecuteEntityCloudScriptRequest& request, const FExecuteEntityCloudScriptDelegate& SuccessDelegate = FExecuteEntityCloudScriptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnExecuteEntityCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExecuteEntityCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabCloudScriptDataModels.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabCloudScriptDataModels.h new file mode 100644 index 000000000..48d74e2b4 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabCloudScriptDataModels.h @@ -0,0 +1,283 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace CloudScriptModels +{ + + enum CloudScriptRevisionOption + { + CloudScriptRevisionOptionLive, + CloudScriptRevisionOptionLatest, + CloudScriptRevisionOptionSpecific + }; + + PLAYFABCPP_API void writeCloudScriptRevisionOptionEnumJSON(CloudScriptRevisionOption enumVal, JsonWriter& writer); + PLAYFABCPP_API CloudScriptRevisionOption readCloudScriptRevisionOptionFromValue(const TSharedPtr& value); + PLAYFABCPP_API CloudScriptRevisionOption readCloudScriptRevisionOptionFromValue(const FString& value); + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FScriptExecutionError : public FPlayFabBaseModel + { + /** + * [optional] Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, + * CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError + */ + FString Error; + + // [optional] Details about the error + FString Message; + + // [optional] Point during the execution of the script at which the error occurred, if any + FString StackTrace; + + FScriptExecutionError() : + FPlayFabBaseModel(), + Error(), + Message(), + StackTrace() + {} + + FScriptExecutionError(const FScriptExecutionError& src) : + FPlayFabBaseModel(), + Error(src.Error), + Message(src.Message), + StackTrace(src.StackTrace) + {} + + FScriptExecutionError(const TSharedPtr& obj) : FScriptExecutionError() + { + readFromValue(obj); + } + + ~FScriptExecutionError(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLogStatement : public FPlayFabBaseModel + { + // [optional] Optional object accompanying the message as contextual information + FJsonKeeper Data; + + // [optional] 'Debug', 'Info', or 'Error' + FString Level; + + // [optional] undefined + FString Message; + + FLogStatement() : + FPlayFabBaseModel(), + Data(), + Level(), + Message() + {} + + FLogStatement(const FLogStatement& src) : + FPlayFabBaseModel(), + Data(src.Data), + Level(src.Level), + Message(src.Message) + {} + + FLogStatement(const TSharedPtr& obj) : FLogStatement() + { + readFromValue(obj); + } + + ~FLogStatement(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteCloudScriptResult : public FPlayFabBaseModel + { + // Number of PlayFab API requests issued by the CloudScript function + int32 APIRequestsIssued; + + // [optional] Information about the error, if any, that occurred during execution + TSharedPtr Error; + + double ExecutionTimeSeconds; + + // [optional] The name of the function that executed + FString FunctionName; + + // [optional] The object returned from the CloudScript function, if any + FJsonKeeper FunctionResult; + + /** + * [optional] Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + Boxed FunctionResultTooLarge; + + // Number of external HTTP requests issued by the CloudScript function + int32 HttpRequestsIssued; + + /** + * [optional] Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + TArray Logs; + /** + * [optional] Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + Boxed LogsTooLarge; + + uint32 MemoryConsumedBytes; + + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + double ProcessorTimeSeconds; + + // The revision of the CloudScript that executed + int32 Revision; + + FExecuteCloudScriptResult() : + FPlayFabBaseModel(), + APIRequestsIssued(0), + Error(nullptr), + ExecutionTimeSeconds(0), + FunctionName(), + FunctionResult(), + FunctionResultTooLarge(), + HttpRequestsIssued(0), + Logs(), + LogsTooLarge(), + MemoryConsumedBytes(0), + ProcessorTimeSeconds(0), + Revision(0) + {} + + FExecuteCloudScriptResult(const FExecuteCloudScriptResult& src) : + FPlayFabBaseModel(), + APIRequestsIssued(src.APIRequestsIssued), + Error(src.Error.IsValid() ? MakeShareable(new FScriptExecutionError(*src.Error)) : nullptr), + ExecutionTimeSeconds(src.ExecutionTimeSeconds), + FunctionName(src.FunctionName), + FunctionResult(src.FunctionResult), + FunctionResultTooLarge(src.FunctionResultTooLarge), + HttpRequestsIssued(src.HttpRequestsIssued), + Logs(src.Logs), + LogsTooLarge(src.LogsTooLarge), + MemoryConsumedBytes(src.MemoryConsumedBytes), + ProcessorTimeSeconds(src.ProcessorTimeSeconds), + Revision(src.Revision) + {} + + FExecuteCloudScriptResult(const TSharedPtr& obj) : FExecuteCloudScriptResult() + { + readFromValue(obj); + } + + ~FExecuteCloudScriptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteEntityCloudScriptRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + // The name of the CloudScript function to execute + FString FunctionName; + + // [optional] Object that is passed in to the function as the first argument + FJsonKeeper FunctionParameter; + + /** + * [optional] Generate a 'entity_executed_cloudscript' PlayStream event containing the results of the function execution and other + * contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. + */ + Boxed GeneratePlayStreamEvent; + + /** + * [optional] Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' + * executes the current live, published revision, and 'Specific' executes the specified revision. The default value is + * 'Specific', if the SpecificRevision parameter is specified, otherwise it is 'Live'. + */ + Boxed RevisionSelection; + + // [optional] The specific revision to execute, when RevisionSelection is set to 'Specific' + Boxed SpecificRevision; + + FExecuteEntityCloudScriptRequest() : + FPlayFabBaseModel(), + Entity(nullptr), + FunctionName(), + FunctionParameter(), + GeneratePlayStreamEvent(), + RevisionSelection(), + SpecificRevision() + {} + + FExecuteEntityCloudScriptRequest(const FExecuteEntityCloudScriptRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + FunctionName(src.FunctionName), + FunctionParameter(src.FunctionParameter), + GeneratePlayStreamEvent(src.GeneratePlayStreamEvent), + RevisionSelection(src.RevisionSelection), + SpecificRevision(src.SpecificRevision) + {} + + FExecuteEntityCloudScriptRequest(const TSharedPtr& obj) : FExecuteEntityCloudScriptRequest() + { + readFromValue(obj); + } + + ~FExecuteEntityCloudScriptRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabDataAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabDataAPI.h new file mode 100644 index 000000000..929df9982 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabDataAPI.h @@ -0,0 +1,85 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabDataDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabDataAPI + { + public: + DECLARE_DELEGATE_OneParam(FAbortFileUploadsDelegate, const DataModels::FAbortFileUploadsResponse&); + DECLARE_DELEGATE_OneParam(FDeleteFilesDelegate, const DataModels::FDeleteFilesResponse&); + DECLARE_DELEGATE_OneParam(FFinalizeFileUploadsDelegate, const DataModels::FFinalizeFileUploadsResponse&); + DECLARE_DELEGATE_OneParam(FGetFilesDelegate, const DataModels::FGetFilesResponse&); + DECLARE_DELEGATE_OneParam(FGetObjectsDelegate, const DataModels::FGetObjectsResponse&); + DECLARE_DELEGATE_OneParam(FInitiateFileUploadsDelegate, const DataModels::FInitiateFileUploadsResponse&); + DECLARE_DELEGATE_OneParam(FSetObjectsDelegate, const DataModels::FSetObjectsResponse&); + + UPlayFabDataAPI(); + ~UPlayFabDataAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Abort pending file uploads to an entity's profile. + * Aborts the pending upload of the requested files. + */ + bool AbortFileUploads(DataModels::FAbortFileUploadsRequest& request, const FAbortFileUploadsDelegate& SuccessDelegate = FAbortFileUploadsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Delete files on an entity's profile. + * Deletes the requested files from the entity's profile. + */ + bool DeleteFiles(DataModels::FDeleteFilesRequest& request, const FDeleteFilesDelegate& SuccessDelegate = FDeleteFilesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Finalize file uploads to an entity's profile. + * Finalizes the upload of the requested files. Verifies that the files have been successfully uploaded and moves the file pointers from pending to live. + */ + bool FinalizeFileUploads(DataModels::FFinalizeFileUploadsRequest& request, const FFinalizeFileUploadsDelegate& SuccessDelegate = FFinalizeFileUploadsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves file metadata from an entity's profile. + * Returns URLs that may be used to download the files for a profile for a limited length of time. Only returns files that have been successfully uploaded, files that are still pending will either return the old value, if it exists, or nothing. + */ + bool GetFiles(DataModels::FGetFilesRequest& request, const FGetFilesDelegate& SuccessDelegate = FGetFilesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves objects from an entity's profile. + * Gets JSON objects from an entity profile and returns it. + */ + bool GetObjects(DataModels::FGetObjectsRequest& request, const FGetObjectsDelegate& SuccessDelegate = FGetObjectsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Initiates file uploads to an entity's profile. + * Returns URLs that may be used to upload the files for a profile 5 minutes. After using the upload calls FinalizeFileUploads must be called to move the file status from pending to live. + */ + bool InitiateFileUploads(DataModels::FInitiateFileUploadsRequest& request, const FInitiateFileUploadsDelegate& SuccessDelegate = FInitiateFileUploadsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets objects on an entity's profile. + * Sets JSON objects on the requested entity profile. May include a version number to be used to perform optimistic concurrency operations during update. If the current version differs from the version in the request the request will be ignored. If no version is set on the request then the value will always be updated if the values differ. Using the version value does not guarantee a write though, ConcurrentEditError may still occur if multiple clients are attempting to update the same profile. + */ + bool SetObjects(DataModels::FSetObjectsRequest& request, const FSetObjectsDelegate& SuccessDelegate = FSetObjectsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnAbortFileUploadsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAbortFileUploadsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteFilesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteFilesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnFinalizeFileUploadsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFinalizeFileUploadsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetFilesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFilesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetObjectsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetObjectsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnInitiateFileUploadsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FInitiateFileUploadsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetObjectsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetObjectsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabDataDataModels.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabDataDataModels.h new file mode 100644 index 000000000..b82aed495 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabDataDataModels.h @@ -0,0 +1,732 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace DataModels +{ + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAbortFileUploadsRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // Names of the files to have their pending uploads aborted. + TArray FileNames; + /** + * [optional] The expected version of the profile, if set and doesn't match the current version of the profile the operation will not + * be performed. + */ + Boxed ProfileVersion; + + FAbortFileUploadsRequest() : + FPlayFabBaseModel(), + Entity(), + FileNames(), + ProfileVersion() + {} + + FAbortFileUploadsRequest(const FAbortFileUploadsRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + FileNames(src.FileNames), + ProfileVersion(src.ProfileVersion) + {} + + FAbortFileUploadsRequest(const TSharedPtr& obj) : FAbortFileUploadsRequest() + { + readFromValue(obj); + } + + ~FAbortFileUploadsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAbortFileUploadsResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + FAbortFileUploadsResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + ProfileVersion(0) + {} + + FAbortFileUploadsResponse(const FAbortFileUploadsResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + ProfileVersion(src.ProfileVersion) + {} + + FAbortFileUploadsResponse(const TSharedPtr& obj) : FAbortFileUploadsResponse() + { + readFromValue(obj); + } + + ~FAbortFileUploadsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteFilesRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // Names of the files to be deleted. + TArray FileNames; + /** + * [optional] The expected version of the profile, if set and doesn't match the current version of the profile the operation will not + * be performed. + */ + Boxed ProfileVersion; + + FDeleteFilesRequest() : + FPlayFabBaseModel(), + Entity(), + FileNames(), + ProfileVersion() + {} + + FDeleteFilesRequest(const FDeleteFilesRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + FileNames(src.FileNames), + ProfileVersion(src.ProfileVersion) + {} + + FDeleteFilesRequest(const TSharedPtr& obj) : FDeleteFilesRequest() + { + readFromValue(obj); + } + + ~FDeleteFilesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteFilesResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + FDeleteFilesResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + ProfileVersion(0) + {} + + FDeleteFilesResponse(const FDeleteFilesResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + ProfileVersion(src.ProfileVersion) + {} + + FDeleteFilesResponse(const TSharedPtr& obj) : FDeleteFilesResponse() + { + readFromValue(obj); + } + + ~FDeleteFilesResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFinalizeFileUploadsRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // Names of the files to be finalized. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' + TArray FileNames; + FFinalizeFileUploadsRequest() : + FPlayFabBaseModel(), + Entity(), + FileNames() + {} + + FFinalizeFileUploadsRequest(const FFinalizeFileUploadsRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + FileNames(src.FileNames) + {} + + FFinalizeFileUploadsRequest(const TSharedPtr& obj) : FFinalizeFileUploadsRequest() + { + readFromValue(obj); + } + + ~FFinalizeFileUploadsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFileMetadata : public FPlayFabBaseModel + { + // [optional] Checksum value for the file + FString Checksum; + + // [optional] Download URL where the file can be retrieved + FString DownloadUrl; + + // [optional] Name of the file + FString FileName; + + // Last UTC time the file was modified + FDateTime LastModified; + + // Storage service's reported byte count + int32 Size; + + FGetFileMetadata() : + FPlayFabBaseModel(), + Checksum(), + DownloadUrl(), + FileName(), + LastModified(0), + Size(0) + {} + + FGetFileMetadata(const FGetFileMetadata& src) : + FPlayFabBaseModel(), + Checksum(src.Checksum), + DownloadUrl(src.DownloadUrl), + FileName(src.FileName), + LastModified(src.LastModified), + Size(src.Size) + {} + + FGetFileMetadata(const TSharedPtr& obj) : FGetFileMetadata() + { + readFromValue(obj); + } + + ~FGetFileMetadata(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFinalizeFileUploadsResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // [optional] Collection of metadata for the entity's files + TMap Metadata; + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + FFinalizeFileUploadsResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + Metadata(), + ProfileVersion(0) + {} + + FFinalizeFileUploadsResponse(const FFinalizeFileUploadsResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + Metadata(src.Metadata), + ProfileVersion(src.ProfileVersion) + {} + + FFinalizeFileUploadsResponse(const TSharedPtr& obj) : FFinalizeFileUploadsResponse() + { + readFromValue(obj); + } + + ~FFinalizeFileUploadsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFilesRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + FGetFilesRequest() : + FPlayFabBaseModel(), + Entity() + {} + + FGetFilesRequest(const FGetFilesRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity) + {} + + FGetFilesRequest(const TSharedPtr& obj) : FGetFilesRequest() + { + readFromValue(obj); + } + + ~FGetFilesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFilesResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // [optional] Collection of metadata for the entity's files + TMap Metadata; + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + FGetFilesResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + Metadata(), + ProfileVersion(0) + {} + + FGetFilesResponse(const FGetFilesResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + Metadata(src.Metadata), + ProfileVersion(src.ProfileVersion) + {} + + FGetFilesResponse(const TSharedPtr& obj) : FGetFilesResponse() + { + readFromValue(obj); + } + + ~FGetFilesResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetObjectsRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + /** + * [optional] Determines whether the object will be returned as an escaped JSON string or as a un-escaped JSON object. Default is JSON + * object. + */ + Boxed EscapeObject; + + FGetObjectsRequest() : + FPlayFabBaseModel(), + Entity(), + EscapeObject() + {} + + FGetObjectsRequest(const FGetObjectsRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + EscapeObject(src.EscapeObject) + {} + + FGetObjectsRequest(const TSharedPtr& obj) : FGetObjectsRequest() + { + readFromValue(obj); + } + + ~FGetObjectsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FObjectResult : public FPlayFabBaseModel + { + // [optional] Un-escaped JSON object, if EscapeObject false or default. + FJsonKeeper DataObject; + + // [optional] Escaped string JSON body of the object, if EscapeObject is true. + FString EscapedDataObject; + + // [optional] Name of the object. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' + FString ObjectName; + + FObjectResult() : + FPlayFabBaseModel(), + DataObject(), + EscapedDataObject(), + ObjectName() + {} + + FObjectResult(const FObjectResult& src) : + FPlayFabBaseModel(), + DataObject(src.DataObject), + EscapedDataObject(src.EscapedDataObject), + ObjectName(src.ObjectName) + {} + + FObjectResult(const TSharedPtr& obj) : FObjectResult() + { + readFromValue(obj); + } + + ~FObjectResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetObjectsResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // [optional] Requested objects that the calling entity has access to + TMap Objects; + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + FGetObjectsResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + Objects(), + ProfileVersion(0) + {} + + FGetObjectsResponse(const FGetObjectsResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + Objects(src.Objects), + ProfileVersion(src.ProfileVersion) + {} + + FGetObjectsResponse(const TSharedPtr& obj) : FGetObjectsResponse() + { + readFromValue(obj); + } + + ~FGetObjectsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FInitiateFileUploadMetadata : public FPlayFabBaseModel + { + // [optional] Name of the file. + FString FileName; + + // [optional] Location the data should be sent to via an HTTP PUT operation. + FString UploadUrl; + + FInitiateFileUploadMetadata() : + FPlayFabBaseModel(), + FileName(), + UploadUrl() + {} + + FInitiateFileUploadMetadata(const FInitiateFileUploadMetadata& src) : + FPlayFabBaseModel(), + FileName(src.FileName), + UploadUrl(src.UploadUrl) + {} + + FInitiateFileUploadMetadata(const TSharedPtr& obj) : FInitiateFileUploadMetadata() + { + readFromValue(obj); + } + + ~FInitiateFileUploadMetadata(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FInitiateFileUploadsRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // Names of the files to be set. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' + TArray FileNames; + /** + * [optional] The expected version of the profile, if set and doesn't match the current version of the profile the operation will not + * be performed. + */ + Boxed ProfileVersion; + + FInitiateFileUploadsRequest() : + FPlayFabBaseModel(), + Entity(), + FileNames(), + ProfileVersion() + {} + + FInitiateFileUploadsRequest(const FInitiateFileUploadsRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + FileNames(src.FileNames), + ProfileVersion(src.ProfileVersion) + {} + + FInitiateFileUploadsRequest(const TSharedPtr& obj) : FInitiateFileUploadsRequest() + { + readFromValue(obj); + } + + ~FInitiateFileUploadsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FInitiateFileUploadsResponse : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + // [optional] Collection of file names and upload urls + TArray UploadDetails; + FInitiateFileUploadsResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + ProfileVersion(0), + UploadDetails() + {} + + FInitiateFileUploadsResponse(const FInitiateFileUploadsResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + ProfileVersion(src.ProfileVersion), + UploadDetails(src.UploadDetails) + {} + + FInitiateFileUploadsResponse(const TSharedPtr& obj) : FInitiateFileUploadsResponse() + { + readFromValue(obj); + } + + ~FInitiateFileUploadsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum OperationTypes + { + OperationTypesCreated, + OperationTypesUpdated, + OperationTypesDeleted, + OperationTypesNone + }; + + PLAYFABCPP_API void writeOperationTypesEnumJSON(OperationTypes enumVal, JsonWriter& writer); + PLAYFABCPP_API OperationTypes readOperationTypesFromValue(const TSharedPtr& value); + PLAYFABCPP_API OperationTypes readOperationTypesFromValue(const FString& value); + + struct PLAYFABCPP_API FSetObject : public FPlayFabBaseModel + { + /** + * [optional] Body of the object to be saved. If empty and DeleteObject is true object will be deleted if it exists, or no operation + * will occur if it does not exist. Only one of Object or EscapedDataObject fields may be used. + */ + FJsonKeeper DataObject; + + // [optional] Flag to indicate that this object should be deleted. Both DataObject and EscapedDataObject must not be set as well. + Boxed DeleteObject; + + /** + * [optional] Body of the object to be saved as an escaped JSON string. If empty and DeleteObject is true object will be deleted if it + * exists, or no operation will occur if it does not exist. Only one of DataObject or EscapedDataObject fields may be used. + */ + FString EscapedDataObject; + + // Name of object. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.'. + FString ObjectName; + + FSetObject() : + FPlayFabBaseModel(), + DataObject(), + DeleteObject(), + EscapedDataObject(), + ObjectName() + {} + + FSetObject(const FSetObject& src) : + FPlayFabBaseModel(), + DataObject(src.DataObject), + DeleteObject(src.DeleteObject), + EscapedDataObject(src.EscapedDataObject), + ObjectName(src.ObjectName) + {} + + FSetObject(const TSharedPtr& obj) : FSetObject() + { + readFromValue(obj); + } + + ~FSetObject(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetObjectInfo : public FPlayFabBaseModel + { + // [optional] Name of the object + FString ObjectName; + + // [optional] Optional reason to explain why the operation was the result that it was. + FString OperationReason; + + // [optional] Indicates which operation was completed, either Created, Updated, Deleted or None. + Boxed SetResult; + + FSetObjectInfo() : + FPlayFabBaseModel(), + ObjectName(), + OperationReason(), + SetResult() + {} + + FSetObjectInfo(const FSetObjectInfo& src) : + FPlayFabBaseModel(), + ObjectName(src.ObjectName), + OperationReason(src.OperationReason), + SetResult(src.SetResult) + {} + + FSetObjectInfo(const TSharedPtr& obj) : FSetObjectInfo() + { + readFromValue(obj); + } + + ~FSetObjectInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetObjectsRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + /** + * [optional] Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from + * GetProfile API, you can ensure that the object set will only be performed if the profile has not been updated by any + * other clients since the version you last loaded. + */ + Boxed ExpectedProfileVersion; + + // Collection of objects to set on the profile. + TArray Objects; + FSetObjectsRequest() : + FPlayFabBaseModel(), + Entity(), + ExpectedProfileVersion(), + Objects() + {} + + FSetObjectsRequest(const FSetObjectsRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + ExpectedProfileVersion(src.ExpectedProfileVersion), + Objects(src.Objects) + {} + + FSetObjectsRequest(const TSharedPtr& obj) : FSetObjectsRequest() + { + readFromValue(obj); + } + + ~FSetObjectsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetObjectsResponse : public FPlayFabBaseModel + { + // New version of the entity profile. + int32 ProfileVersion; + + // [optional] New version of the entity profile. + TArray SetResults; + FSetObjectsResponse() : + FPlayFabBaseModel(), + ProfileVersion(0), + SetResults() + {} + + FSetObjectsResponse(const FSetObjectsResponse& src) : + FPlayFabBaseModel(), + ProfileVersion(src.ProfileVersion), + SetResults(src.SetResults) + {} + + FSetObjectsResponse(const TSharedPtr& obj) : FSetObjectsResponse() + { + readFromValue(obj); + } + + ~FSetObjectsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabError.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabError.h new file mode 100644 index 000000000..dbf3b52cc --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabError.h @@ -0,0 +1,466 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" + +namespace PlayFab +{ + + enum PlayFabErrorCode + { + PlayFabErrorHostnameNotFound=1, + PlayFabErrorConnectionTimeout, + PlayFabErrorConnectionRefused, + PlayFabErrorSocketError, + PlayFabErrorSuccess = 0, + PlayFabErrorUnkownError = 500, + PlayFabErrorInvalidParams = 1000, + PlayFabErrorAccountNotFound = 1001, + PlayFabErrorAccountBanned = 1002, + PlayFabErrorInvalidUsernameOrPassword = 1003, + PlayFabErrorInvalidTitleId = 1004, + PlayFabErrorInvalidEmailAddress = 1005, + PlayFabErrorEmailAddressNotAvailable = 1006, + PlayFabErrorInvalidUsername = 1007, + PlayFabErrorInvalidPassword = 1008, + PlayFabErrorUsernameNotAvailable = 1009, + PlayFabErrorInvalidSteamTicket = 1010, + PlayFabErrorAccountAlreadyLinked = 1011, + PlayFabErrorLinkedAccountAlreadyClaimed = 1012, + PlayFabErrorInvalidFacebookToken = 1013, + PlayFabErrorAccountNotLinked = 1014, + PlayFabErrorFailedByPaymentProvider = 1015, + PlayFabErrorCouponCodeNotFound = 1016, + PlayFabErrorInvalidContainerItem = 1017, + PlayFabErrorContainerNotOwned = 1018, + PlayFabErrorKeyNotOwned = 1019, + PlayFabErrorInvalidItemIdInTable = 1020, + PlayFabErrorInvalidReceipt = 1021, + PlayFabErrorReceiptAlreadyUsed = 1022, + PlayFabErrorReceiptCancelled = 1023, + PlayFabErrorGameNotFound = 1024, + PlayFabErrorGameModeNotFound = 1025, + PlayFabErrorInvalidGoogleToken = 1026, + PlayFabErrorUserIsNotPartOfDeveloper = 1027, + PlayFabErrorInvalidTitleForDeveloper = 1028, + PlayFabErrorTitleNameConflicts = 1029, + PlayFabErrorUserisNotValid = 1030, + PlayFabErrorValueAlreadyExists = 1031, + PlayFabErrorBuildNotFound = 1032, + PlayFabErrorPlayerNotInGame = 1033, + PlayFabErrorInvalidTicket = 1034, + PlayFabErrorInvalidDeveloper = 1035, + PlayFabErrorInvalidOrderInfo = 1036, + PlayFabErrorRegistrationIncomplete = 1037, + PlayFabErrorInvalidPlatform = 1038, + PlayFabErrorUnknownError = 1039, + PlayFabErrorSteamApplicationNotOwned = 1040, + PlayFabErrorWrongSteamAccount = 1041, + PlayFabErrorTitleNotActivated = 1042, + PlayFabErrorRegistrationSessionNotFound = 1043, + PlayFabErrorNoSuchMod = 1044, + PlayFabErrorFileNotFound = 1045, + PlayFabErrorDuplicateEmail = 1046, + PlayFabErrorItemNotFound = 1047, + PlayFabErrorItemNotOwned = 1048, + PlayFabErrorItemNotRecycleable = 1049, + PlayFabErrorItemNotAffordable = 1050, + PlayFabErrorInvalidVirtualCurrency = 1051, + PlayFabErrorWrongVirtualCurrency = 1052, + PlayFabErrorWrongPrice = 1053, + PlayFabErrorNonPositiveValue = 1054, + PlayFabErrorInvalidRegion = 1055, + PlayFabErrorRegionAtCapacity = 1056, + PlayFabErrorServerFailedToStart = 1057, + PlayFabErrorNameNotAvailable = 1058, + PlayFabErrorInsufficientFunds = 1059, + PlayFabErrorInvalidDeviceID = 1060, + PlayFabErrorInvalidPushNotificationToken = 1061, + PlayFabErrorNoRemainingUses = 1062, + PlayFabErrorInvalidPaymentProvider = 1063, + PlayFabErrorPurchaseInitializationFailure = 1064, + PlayFabErrorDuplicateUsername = 1065, + PlayFabErrorInvalidBuyerInfo = 1066, + PlayFabErrorNoGameModeParamsSet = 1067, + PlayFabErrorBodyTooLarge = 1068, + PlayFabErrorReservedWordInBody = 1069, + PlayFabErrorInvalidTypeInBody = 1070, + PlayFabErrorInvalidRequest = 1071, + PlayFabErrorReservedEventName = 1072, + PlayFabErrorInvalidUserStatistics = 1073, + PlayFabErrorNotAuthenticated = 1074, + PlayFabErrorStreamAlreadyExists = 1075, + PlayFabErrorErrorCreatingStream = 1076, + PlayFabErrorStreamNotFound = 1077, + PlayFabErrorInvalidAccount = 1078, + PlayFabErrorPurchaseDoesNotExist = 1080, + PlayFabErrorInvalidPurchaseTransactionStatus = 1081, + PlayFabErrorAPINotEnabledForGameClientAccess = 1082, + PlayFabErrorNoPushNotificationARNForTitle = 1083, + PlayFabErrorBuildAlreadyExists = 1084, + PlayFabErrorBuildPackageDoesNotExist = 1085, + PlayFabErrorCustomAnalyticsEventsNotEnabledForTitle = 1087, + PlayFabErrorInvalidSharedGroupId = 1088, + PlayFabErrorNotAuthorized = 1089, + PlayFabErrorMissingTitleGoogleProperties = 1090, + PlayFabErrorInvalidItemProperties = 1091, + PlayFabErrorInvalidPSNAuthCode = 1092, + PlayFabErrorInvalidItemId = 1093, + PlayFabErrorPushNotEnabledForAccount = 1094, + PlayFabErrorPushServiceError = 1095, + PlayFabErrorReceiptDoesNotContainInAppItems = 1096, + PlayFabErrorReceiptContainsMultipleInAppItems = 1097, + PlayFabErrorInvalidBundleID = 1098, + PlayFabErrorJavascriptException = 1099, + PlayFabErrorInvalidSessionTicket = 1100, + PlayFabErrorUnableToConnectToDatabase = 1101, + PlayFabErrorInternalServerError = 1110, + PlayFabErrorInvalidReportDate = 1111, + PlayFabErrorReportNotAvailable = 1112, + PlayFabErrorDatabaseThroughputExceeded = 1113, + PlayFabErrorInvalidGameTicket = 1115, + PlayFabErrorExpiredGameTicket = 1116, + PlayFabErrorGameTicketDoesNotMatchLobby = 1117, + PlayFabErrorLinkedDeviceAlreadyClaimed = 1118, + PlayFabErrorDeviceAlreadyLinked = 1119, + PlayFabErrorDeviceNotLinked = 1120, + PlayFabErrorPartialFailure = 1121, + PlayFabErrorPublisherNotSet = 1122, + PlayFabErrorServiceUnavailable = 1123, + PlayFabErrorVersionNotFound = 1124, + PlayFabErrorRevisionNotFound = 1125, + PlayFabErrorInvalidPublisherId = 1126, + PlayFabErrorDownstreamServiceUnavailable = 1127, + PlayFabErrorAPINotIncludedInTitleUsageTier = 1128, + PlayFabErrorDAULimitExceeded = 1129, + PlayFabErrorAPIRequestLimitExceeded = 1130, + PlayFabErrorInvalidAPIEndpoint = 1131, + PlayFabErrorBuildNotAvailable = 1132, + PlayFabErrorConcurrentEditError = 1133, + PlayFabErrorContentNotFound = 1134, + PlayFabErrorCharacterNotFound = 1135, + PlayFabErrorCloudScriptNotFound = 1136, + PlayFabErrorContentQuotaExceeded = 1137, + PlayFabErrorInvalidCharacterStatistics = 1138, + PlayFabErrorPhotonNotEnabledForTitle = 1139, + PlayFabErrorPhotonApplicationNotFound = 1140, + PlayFabErrorPhotonApplicationNotAssociatedWithTitle = 1141, + PlayFabErrorInvalidEmailOrPassword = 1142, + PlayFabErrorFacebookAPIError = 1143, + PlayFabErrorInvalidContentType = 1144, + PlayFabErrorKeyLengthExceeded = 1145, + PlayFabErrorDataLengthExceeded = 1146, + PlayFabErrorTooManyKeys = 1147, + PlayFabErrorFreeTierCannotHaveVirtualCurrency = 1148, + PlayFabErrorMissingAmazonSharedKey = 1149, + PlayFabErrorAmazonValidationError = 1150, + PlayFabErrorInvalidPSNIssuerId = 1151, + PlayFabErrorPSNInaccessible = 1152, + PlayFabErrorExpiredAuthToken = 1153, + PlayFabErrorFailedToGetEntitlements = 1154, + PlayFabErrorFailedToConsumeEntitlement = 1155, + PlayFabErrorTradeAcceptingUserNotAllowed = 1156, + PlayFabErrorTradeInventoryItemIsAssignedToCharacter = 1157, + PlayFabErrorTradeInventoryItemIsBundle = 1158, + PlayFabErrorTradeStatusNotValidForCancelling = 1159, + PlayFabErrorTradeStatusNotValidForAccepting = 1160, + PlayFabErrorTradeDoesNotExist = 1161, + PlayFabErrorTradeCancelled = 1162, + PlayFabErrorTradeAlreadyFilled = 1163, + PlayFabErrorTradeWaitForStatusTimeout = 1164, + PlayFabErrorTradeInventoryItemExpired = 1165, + PlayFabErrorTradeMissingOfferedAndAcceptedItems = 1166, + PlayFabErrorTradeAcceptedItemIsBundle = 1167, + PlayFabErrorTradeAcceptedItemIsStackable = 1168, + PlayFabErrorTradeInventoryItemInvalidStatus = 1169, + PlayFabErrorTradeAcceptedCatalogItemInvalid = 1170, + PlayFabErrorTradeAllowedUsersInvalid = 1171, + PlayFabErrorTradeInventoryItemDoesNotExist = 1172, + PlayFabErrorTradeInventoryItemIsConsumed = 1173, + PlayFabErrorTradeInventoryItemIsStackable = 1174, + PlayFabErrorTradeAcceptedItemsMismatch = 1175, + PlayFabErrorInvalidKongregateToken = 1176, + PlayFabErrorFeatureNotConfiguredForTitle = 1177, + PlayFabErrorNoMatchingCatalogItemForReceipt = 1178, + PlayFabErrorInvalidCurrencyCode = 1179, + PlayFabErrorNoRealMoneyPriceForCatalogItem = 1180, + PlayFabErrorTradeInventoryItemIsNotTradable = 1181, + PlayFabErrorTradeAcceptedCatalogItemIsNotTradable = 1182, + PlayFabErrorUsersAlreadyFriends = 1183, + PlayFabErrorLinkedIdentifierAlreadyClaimed = 1184, + PlayFabErrorCustomIdNotLinked = 1185, + PlayFabErrorTotalDataSizeExceeded = 1186, + PlayFabErrorDeleteKeyConflict = 1187, + PlayFabErrorInvalidXboxLiveToken = 1188, + PlayFabErrorExpiredXboxLiveToken = 1189, + PlayFabErrorResettableStatisticVersionRequired = 1190, + PlayFabErrorNotAuthorizedByTitle = 1191, + PlayFabErrorNoPartnerEnabled = 1192, + PlayFabErrorInvalidPartnerResponse = 1193, + PlayFabErrorAPINotEnabledForGameServerAccess = 1194, + PlayFabErrorStatisticNotFound = 1195, + PlayFabErrorStatisticNameConflict = 1196, + PlayFabErrorStatisticVersionClosedForWrites = 1197, + PlayFabErrorStatisticVersionInvalid = 1198, + PlayFabErrorAPIClientRequestRateLimitExceeded = 1199, + PlayFabErrorInvalidJSONContent = 1200, + PlayFabErrorInvalidDropTable = 1201, + PlayFabErrorStatisticVersionAlreadyIncrementedForScheduledInterval = 1202, + PlayFabErrorStatisticCountLimitExceeded = 1203, + PlayFabErrorStatisticVersionIncrementRateExceeded = 1204, + PlayFabErrorContainerKeyInvalid = 1205, + PlayFabErrorCloudScriptExecutionTimeLimitExceeded = 1206, + PlayFabErrorNoWritePermissionsForEvent = 1207, + PlayFabErrorCloudScriptFunctionArgumentSizeExceeded = 1208, + PlayFabErrorCloudScriptAPIRequestCountExceeded = 1209, + PlayFabErrorCloudScriptAPIRequestError = 1210, + PlayFabErrorCloudScriptHTTPRequestError = 1211, + PlayFabErrorInsufficientGuildRole = 1212, + PlayFabErrorGuildNotFound = 1213, + PlayFabErrorOverLimit = 1214, + PlayFabErrorEventNotFound = 1215, + PlayFabErrorInvalidEventField = 1216, + PlayFabErrorInvalidEventName = 1217, + PlayFabErrorCatalogNotConfigured = 1218, + PlayFabErrorOperationNotSupportedForPlatform = 1219, + PlayFabErrorSegmentNotFound = 1220, + PlayFabErrorStoreNotFound = 1221, + PlayFabErrorInvalidStatisticName = 1222, + PlayFabErrorTitleNotQualifiedForLimit = 1223, + PlayFabErrorInvalidServiceLimitLevel = 1224, + PlayFabErrorServiceLimitLevelInTransition = 1225, + PlayFabErrorCouponAlreadyRedeemed = 1226, + PlayFabErrorGameServerBuildSizeLimitExceeded = 1227, + PlayFabErrorGameServerBuildCountLimitExceeded = 1228, + PlayFabErrorVirtualCurrencyCountLimitExceeded = 1229, + PlayFabErrorVirtualCurrencyCodeExists = 1230, + PlayFabErrorTitleNewsItemCountLimitExceeded = 1231, + PlayFabErrorInvalidTwitchToken = 1232, + PlayFabErrorTwitchResponseError = 1233, + PlayFabErrorProfaneDisplayName = 1234, + PlayFabErrorUserAlreadyAdded = 1235, + PlayFabErrorInvalidVirtualCurrencyCode = 1236, + PlayFabErrorVirtualCurrencyCannotBeDeleted = 1237, + PlayFabErrorIdentifierAlreadyClaimed = 1238, + PlayFabErrorIdentifierNotLinked = 1239, + PlayFabErrorInvalidContinuationToken = 1240, + PlayFabErrorExpiredContinuationToken = 1241, + PlayFabErrorInvalidSegment = 1242, + PlayFabErrorInvalidSessionId = 1243, + PlayFabErrorSessionLogNotFound = 1244, + PlayFabErrorInvalidSearchTerm = 1245, + PlayFabErrorTwoFactorAuthenticationTokenRequired = 1246, + PlayFabErrorGameServerHostCountLimitExceeded = 1247, + PlayFabErrorPlayerTagCountLimitExceeded = 1248, + PlayFabErrorRequestAlreadyRunning = 1249, + PlayFabErrorActionGroupNotFound = 1250, + PlayFabErrorMaximumSegmentBulkActionJobsRunning = 1251, + PlayFabErrorNoActionsOnPlayersInSegmentJob = 1252, + PlayFabErrorDuplicateStatisticName = 1253, + PlayFabErrorScheduledTaskNameConflict = 1254, + PlayFabErrorScheduledTaskCreateConflict = 1255, + PlayFabErrorInvalidScheduledTaskName = 1256, + PlayFabErrorInvalidTaskSchedule = 1257, + PlayFabErrorSteamNotEnabledForTitle = 1258, + PlayFabErrorLimitNotAnUpgradeOption = 1259, + PlayFabErrorNoSecretKeyEnabledForCloudScript = 1260, + PlayFabErrorTaskNotFound = 1261, + PlayFabErrorTaskInstanceNotFound = 1262, + PlayFabErrorInvalidIdentityProviderId = 1263, + PlayFabErrorMisconfiguredIdentityProvider = 1264, + PlayFabErrorInvalidScheduledTaskType = 1265, + PlayFabErrorBillingInformationRequired = 1266, + PlayFabErrorLimitedEditionItemUnavailable = 1267, + PlayFabErrorInvalidAdPlacementAndReward = 1268, + PlayFabErrorAllAdPlacementViewsAlreadyConsumed = 1269, + PlayFabErrorGoogleOAuthNotConfiguredForTitle = 1270, + PlayFabErrorGoogleOAuthError = 1271, + PlayFabErrorUserNotFriend = 1272, + PlayFabErrorInvalidSignature = 1273, + PlayFabErrorInvalidPublicKey = 1274, + PlayFabErrorGoogleOAuthNoIdTokenIncludedInResponse = 1275, + PlayFabErrorStatisticUpdateInProgress = 1276, + PlayFabErrorLeaderboardVersionNotAvailable = 1277, + PlayFabErrorStatisticAlreadyHasPrizeTable = 1279, + PlayFabErrorPrizeTableHasOverlappingRanks = 1280, + PlayFabErrorPrizeTableHasMissingRanks = 1281, + PlayFabErrorPrizeTableRankStartsAtZero = 1282, + PlayFabErrorInvalidStatistic = 1283, + PlayFabErrorExpressionParseFailure = 1284, + PlayFabErrorExpressionInvokeFailure = 1285, + PlayFabErrorExpressionTooLong = 1286, + PlayFabErrorDataUpdateRateExceeded = 1287, + PlayFabErrorRestrictedEmailDomain = 1288, + PlayFabErrorEncryptionKeyDisabled = 1289, + PlayFabErrorEncryptionKeyMissing = 1290, + PlayFabErrorEncryptionKeyBroken = 1291, + PlayFabErrorNoSharedSecretKeyConfigured = 1292, + PlayFabErrorSecretKeyNotFound = 1293, + PlayFabErrorPlayerSecretAlreadyConfigured = 1294, + PlayFabErrorAPIRequestsDisabledForTitle = 1295, + PlayFabErrorInvalidSharedSecretKey = 1296, + PlayFabErrorPrizeTableHasNoRanks = 1297, + PlayFabErrorProfileDoesNotExist = 1298, + PlayFabErrorContentS3OriginBucketNotConfigured = 1299, + PlayFabErrorInvalidEnvironmentForReceipt = 1300, + PlayFabErrorEncryptedRequestNotAllowed = 1301, + PlayFabErrorSignedRequestNotAllowed = 1302, + PlayFabErrorRequestViewConstraintParamsNotAllowed = 1303, + PlayFabErrorBadPartnerConfiguration = 1304, + PlayFabErrorXboxBPCertificateFailure = 1305, + PlayFabErrorXboxXASSExchangeFailure = 1306, + PlayFabErrorInvalidEntityId = 1307, + PlayFabErrorStatisticValueAggregationOverflow = 1308, + PlayFabErrorEmailMessageFromAddressIsMissing = 1309, + PlayFabErrorEmailMessageToAddressIsMissing = 1310, + PlayFabErrorSmtpServerAuthenticationError = 1311, + PlayFabErrorSmtpServerLimitExceeded = 1312, + PlayFabErrorSmtpServerInsufficientStorage = 1313, + PlayFabErrorSmtpServerCommunicationError = 1314, + PlayFabErrorSmtpServerGeneralFailure = 1315, + PlayFabErrorEmailClientTimeout = 1316, + PlayFabErrorEmailClientCanceledTask = 1317, + PlayFabErrorEmailTemplateMissing = 1318, + PlayFabErrorInvalidHostForTitleId = 1319, + PlayFabErrorEmailConfirmationTokenDoesNotExist = 1320, + PlayFabErrorEmailConfirmationTokenExpired = 1321, + PlayFabErrorAccountDeleted = 1322, + PlayFabErrorPlayerSecretNotConfigured = 1323, + PlayFabErrorInvalidSignatureTime = 1324, + PlayFabErrorNoContactEmailAddressFound = 1325, + PlayFabErrorInvalidAuthToken = 1326, + PlayFabErrorAuthTokenDoesNotExist = 1327, + PlayFabErrorAuthTokenExpired = 1328, + PlayFabErrorAuthTokenAlreadyUsedToResetPassword = 1329, + PlayFabErrorMembershipNameTooLong = 1330, + PlayFabErrorMembershipNotFound = 1331, + PlayFabErrorGoogleServiceAccountInvalid = 1332, + PlayFabErrorGoogleServiceAccountParseFailure = 1333, + PlayFabErrorEntityTokenMissing = 1334, + PlayFabErrorEntityTokenInvalid = 1335, + PlayFabErrorEntityTokenExpired = 1336, + PlayFabErrorEntityTokenRevoked = 1337, + PlayFabErrorInvalidProductForSubscription = 1338, + PlayFabErrorXboxInaccessible = 1339, + PlayFabErrorSubscriptionAlreadyTaken = 1340, + PlayFabErrorSmtpAddonNotEnabled = 1341, + PlayFabErrorAPIConcurrentRequestLimitExceeded = 1342, + PlayFabErrorXboxRejectedXSTSExchangeRequest = 1343, + PlayFabErrorVariableNotDefined = 1344, + PlayFabErrorTemplateVersionNotDefined = 1345, + PlayFabErrorFileTooLarge = 1346, + PlayFabErrorTitleDeleted = 1347, + PlayFabErrorTitleContainsUserAccounts = 1348, + PlayFabErrorTitleDeletionPlayerCleanupFailure = 1349, + PlayFabErrorEntityFileOperationPending = 1350, + PlayFabErrorNoEntityFileOperationPending = 1351, + PlayFabErrorEntityProfileVersionMismatch = 1352, + PlayFabErrorTemplateVersionTooOld = 1353, + PlayFabErrorMembershipDefinitionInUse = 1354, + PlayFabErrorPaymentPageNotConfigured = 1355, + PlayFabErrorFailedLoginAttemptRateLimitExceeded = 1356, + PlayFabErrorEntityBlockedByGroup = 1357, + PlayFabErrorRoleDoesNotExist = 1358, + PlayFabErrorEntityIsAlreadyMember = 1359, + PlayFabErrorDuplicateRoleId = 1360, + PlayFabErrorGroupInvitationNotFound = 1361, + PlayFabErrorGroupApplicationNotFound = 1362, + PlayFabErrorOutstandingInvitationAcceptedInstead = 1363, + PlayFabErrorOutstandingApplicationAcceptedInstead = 1364, + PlayFabErrorRoleIsGroupDefaultMember = 1365, + PlayFabErrorRoleIsGroupAdmin = 1366, + PlayFabErrorRoleNameNotAvailable = 1367, + PlayFabErrorGroupNameNotAvailable = 1368, + PlayFabErrorEmailReportAlreadySent = 1369, + PlayFabErrorEmailReportRecipientBlacklisted = 1370, + PlayFabErrorEventNamespaceNotAllowed = 1371, + PlayFabErrorEventEntityNotAllowed = 1372, + PlayFabErrorInvalidEntityType = 1373, + PlayFabErrorNullTokenResultFromAad = 1374, + PlayFabErrorInvalidTokenResultFromAad = 1375, + PlayFabErrorNoValidCertificateForAad = 1376, + PlayFabErrorInvalidCertificateForAad = 1377, + PlayFabErrorDuplicateDropTableId = 1378, + PlayFabErrorMultiplayerServerError = 1379, + PlayFabErrorMultiplayerServerTooManyRequests = 1380, + PlayFabErrorMultiplayerServerNoContent = 1381, + PlayFabErrorMultiplayerServerBadRequest = 1382, + PlayFabErrorMultiplayerServerUnauthorized = 1383, + PlayFabErrorMultiplayerServerForbidden = 1384, + PlayFabErrorMultiplayerServerNotFound = 1385, + PlayFabErrorMultiplayerServerConflict = 1386, + PlayFabErrorMultiplayerServerInternalServerError = 1387, + PlayFabErrorMultiplayerServerUnavailable = 1388, + PlayFabErrorExplicitContentDetected = 1389, + PlayFabErrorPIIContentDetected = 1390, + PlayFabErrorInvalidScheduledTaskParameter = 1391, + PlayFabErrorPerEntityEventRateLimitExceeded = 1392, + PlayFabErrorTitleDefaultLanguageNotSet = 1393, + PlayFabErrorEmailTemplateMissingDefaultVersion = 1394, + PlayFabErrorFacebookInstantGamesIdNotLinked = 1395, + PlayFabErrorInvalidFacebookInstantGamesSignature = 1396, + PlayFabErrorFacebookInstantGamesAuthNotConfiguredForTitle = 1397, + PlayFabErrorMatchmakingEntityInvalid = 2001, + PlayFabErrorMatchmakingPlayerAttributesInvalid = 2002, + PlayFabErrorMatchmakingCreateRequestMissing = 2003, + PlayFabErrorMatchmakingCreateRequestCreatorMissing = 2004, + PlayFabErrorMatchmakingCreateRequestCreatorIdMissing = 2005, + PlayFabErrorMatchmakingCreateRequestUserListMissing = 2006, + PlayFabErrorMatchmakingCreateRequestGiveUpAfterInvalid = 2007, + PlayFabErrorMatchmakingTicketIdMissing = 2008, + PlayFabErrorMatchmakingMatchIdMissing = 2009, + PlayFabErrorMatchmakingMatchIdIdMissing = 2010, + PlayFabErrorMatchmakingQueueNameMissing = 2011, + PlayFabErrorMatchmakingTitleIdMissing = 2012, + PlayFabErrorMatchmakingTicketIdIdMissing = 2013, + PlayFabErrorMatchmakingPlayerIdMissing = 2014, + PlayFabErrorMatchmakingJoinRequestUserMissing = 2015, + PlayFabErrorMatchmakingQueueConfigNotFound = 2016, + PlayFabErrorMatchmakingMatchNotFound = 2017, + PlayFabErrorMatchmakingTicketNotFound = 2018, + PlayFabErrorMatchmakingCreateTicketServerIdentityInvalid = 2019, + PlayFabErrorMatchmakingCreateTicketClientIdentityInvalid = 2020, + PlayFabErrorMatchmakingGetTicketUserMismatch = 2021, + PlayFabErrorMatchmakingJoinTicketServerIdentityInvalid = 2022, + PlayFabErrorMatchmakingJoinTicketUserIdentityMismatch = 2023, + PlayFabErrorMatchmakingCancelTicketServerIdentityInvalid = 2024, + PlayFabErrorMatchmakingCancelTicketUserIdentityMismatch = 2025, + PlayFabErrorMatchmakingGetMatchIdentityMismatch = 2026, + PlayFabErrorMatchmakingPlayerIdentityMismatch = 2027, + PlayFabErrorMatchmakingAlreadyJoinedTicket = 2028, + PlayFabErrorMatchmakingTicketAlreadyCompleted = 2029, + PlayFabErrorMatchmakingQueueNameInvalid = 2030, + PlayFabErrorMatchmakingQueueConfigInvalid = 2031, + PlayFabErrorMatchmakingMemberProfileInvalid = 2032, + PlayFabErrorWriteAttemptedDuringExport = 2033, + PlayFabErrorNintendoSwitchDeviceIdNotLinked = 2034, + PlayFabErrorMatchmakingNotEnabled = 2035 + }; + + struct FPlayFabError + { + int32 HttpCode; + FString HttpStatus; + int32 ErrorCode; + FString ErrorName; + FString ErrorMessage; + TMultiMap< FString, FString > ErrorDetails; + + FString GenerateErrorReport() const + { + FString output = TEXT(""); + if (ErrorMessage.Len() > 0) + output += ErrorMessage; + for (auto& Elem : ErrorDetails) + output += TEXT(" - ") + Elem.Key + TEXT(": ") + Elem.Value; + return output; + } + }; + + DECLARE_DELEGATE_OneParam(FPlayFabErrorDelegate, const FPlayFabError&); +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabEventsAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabEventsAPI.h new file mode 100644 index 000000000..7f7fe5d25 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabEventsAPI.h @@ -0,0 +1,40 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabEventsDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabEventsAPI + { + public: + DECLARE_DELEGATE_OneParam(FWriteEventsDelegate, const EventsModels::FWriteEventsResponse&); + + UPlayFabEventsAPI(); + ~UPlayFabEventsAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + // Write batches of entity based events to PlayStream. + bool WriteEvents(EventsModels::FWriteEventsRequest& request, const FWriteEventsDelegate& SuccessDelegate = FWriteEventsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnWriteEventsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteEventsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabEventsDataModels.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabEventsDataModels.h new file mode 100644 index 000000000..b4b0b1e59 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabEventsDataModels.h @@ -0,0 +1,167 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace EventsModels +{ + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEventContents : public FPlayFabBaseModel + { + // Entity associated with the event + FEntityKey Entity; + + // The namespace in which the event is defined. It must be prepended with 'com.playfab.events.' + FString EventNamespace; + + // The name of this event. + FString Name; + + /** + * [optional] The original unique identifier associated with this event before it was posted to PlayFab. The value might differ from + * the EventId value, which is assigned when the event is received by the server. + */ + FString OriginalId; + + /** + * [optional] The time (in UTC) associated with this event when it occurred. If specified, this value is stored in the + * OriginalTimestamp property of the PlayStream event. + */ + Boxed OriginalTimestamp; + + // [optional] Arbitrary data associated with the event. Only one of Payload or PayloadJSON is allowed. + FJsonKeeper Payload; + + /** + * [optional] Arbitrary data associated with the event, represented as a JSON serialized string. Only one of Payload or PayloadJSON is + * allowed. + */ + FString PayloadJSON; + + FEventContents() : + FPlayFabBaseModel(), + Entity(), + EventNamespace(), + Name(), + OriginalId(), + OriginalTimestamp(), + Payload(), + PayloadJSON() + {} + + FEventContents(const FEventContents& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + EventNamespace(src.EventNamespace), + Name(src.Name), + OriginalId(src.OriginalId), + OriginalTimestamp(src.OriginalTimestamp), + Payload(src.Payload), + PayloadJSON(src.PayloadJSON) + {} + + FEventContents(const TSharedPtr& obj) : FEventContents() + { + readFromValue(obj); + } + + ~FEventContents(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteEventsRequest : public FPlayFabBaseModel + { + // Collection of events to write to PlayStream. + TArray Events; + FWriteEventsRequest() : + FPlayFabBaseModel(), + Events() + {} + + FWriteEventsRequest(const FWriteEventsRequest& src) : + FPlayFabBaseModel(), + Events(src.Events) + {} + + FWriteEventsRequest(const TSharedPtr& obj) : FWriteEventsRequest() + { + readFromValue(obj); + } + + ~FWriteEventsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteEventsResponse : public FPlayFabBaseModel + { + /** + * [optional] The unique identifiers assigned by the server to the events, in the same order as the events in the request. Only + * returned if FlushToPlayStream option is true. + */ + TArray AssignedEventIds; + FWriteEventsResponse() : + FPlayFabBaseModel(), + AssignedEventIds() + {} + + FWriteEventsResponse(const FWriteEventsResponse& src) : + FPlayFabBaseModel(), + AssignedEventIds(src.AssignedEventIds) + {} + + FWriteEventsResponse(const TSharedPtr& obj) : FWriteEventsResponse() + { + readFromValue(obj); + } + + ~FWriteEventsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabGroupsAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabGroupsAPI.h new file mode 100644 index 000000000..f50bf69fc --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabGroupsAPI.h @@ -0,0 +1,211 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabGroupsDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabGroupsAPI + { + public: + DECLARE_DELEGATE_OneParam(FAcceptGroupApplicationDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FAcceptGroupInvitationDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FAddMembersDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FApplyToGroupDelegate, const GroupsModels::FApplyToGroupResponse&); + DECLARE_DELEGATE_OneParam(FBlockEntityDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FChangeMemberRoleDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FCreateGroupDelegate, const GroupsModels::FCreateGroupResponse&); + DECLARE_DELEGATE_OneParam(FCreateRoleDelegate, const GroupsModels::FCreateGroupRoleResponse&); + DECLARE_DELEGATE_OneParam(FDeleteGroupDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FDeleteRoleDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FGetGroupDelegate, const GroupsModels::FGetGroupResponse&); + DECLARE_DELEGATE_OneParam(FInviteToGroupDelegate, const GroupsModels::FInviteToGroupResponse&); + DECLARE_DELEGATE_OneParam(FIsMemberDelegate, const GroupsModels::FIsMemberResponse&); + DECLARE_DELEGATE_OneParam(FListGroupApplicationsDelegate, const GroupsModels::FListGroupApplicationsResponse&); + DECLARE_DELEGATE_OneParam(FListGroupBlocksDelegate, const GroupsModels::FListGroupBlocksResponse&); + DECLARE_DELEGATE_OneParam(FListGroupInvitationsDelegate, const GroupsModels::FListGroupInvitationsResponse&); + DECLARE_DELEGATE_OneParam(FListGroupMembersDelegate, const GroupsModels::FListGroupMembersResponse&); + DECLARE_DELEGATE_OneParam(FListMembershipDelegate, const GroupsModels::FListMembershipResponse&); + DECLARE_DELEGATE_OneParam(FListMembershipOpportunitiesDelegate, const GroupsModels::FListMembershipOpportunitiesResponse&); + DECLARE_DELEGATE_OneParam(FRemoveGroupApplicationDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FRemoveGroupInvitationDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FRemoveMembersDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FUnblockEntityDelegate, const GroupsModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FUpdateGroupDelegate, const GroupsModels::FUpdateGroupResponse&); + DECLARE_DELEGATE_OneParam(FUpdateRoleDelegate, const GroupsModels::FUpdateGroupRoleResponse&); + + UPlayFabGroupsAPI(); + ~UPlayFabGroupsAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Accepts an outstanding invitation to to join a group + * Accepts an outstanding invitation to to join a group if the invited entity is not blocked by the group. Nothing is returned in the case of success. + */ + bool AcceptGroupApplication(GroupsModels::FAcceptGroupApplicationRequest& request, const FAcceptGroupApplicationDelegate& SuccessDelegate = FAcceptGroupApplicationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Accepts an invitation to join a group + * Accepts an outstanding invitation to join the group if the invited entity is not blocked by the group. Only the invited entity or a parent in its chain (e.g. title) may accept the invitation on the invited entity's behalf. Nothing is returned in the case of success. + */ + bool AcceptGroupInvitation(GroupsModels::FAcceptGroupInvitationRequest& request, const FAcceptGroupInvitationDelegate& SuccessDelegate = FAcceptGroupInvitationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds members to a group or role. + * Adds members to a group or role. Existing members of the group will added to roles within the group, but if the user is not already a member of the group, only title claimants may add them to the group, and others must use the group application or invite system to add new members to a group. Returns nothing if successful. + */ + bool AddMembers(GroupsModels::FAddMembersRequest& request, const FAddMembersDelegate& SuccessDelegate = FAddMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Applies to join a group + * Creates an application to join a group. Calling this while a group application already exists will return the same application instead of an error and will not refresh the time before the application expires. By default, if the entity has an invitation to join the group outstanding, this will accept the invitation to join the group instead and return an error indicating such, rather than creating a duplicate application to join that will need to be cleaned up later. Returns information about the application or an error indicating an invitation was accepted instead. + */ + bool ApplyToGroup(GroupsModels::FApplyToGroupRequest& request, const FApplyToGroupDelegate& SuccessDelegate = FApplyToGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Blocks a list of entities from joining a group. + * Blocks a list of entities from joining a group. Blocked entities may not create new applications to join, be invited to join, accept an invitation, or have an application accepted. Failure due to being blocked does not clean up existing applications or invitations to the group. No data is returned in the case of success. + */ + bool BlockEntity(GroupsModels::FBlockEntityRequest& request, const FBlockEntityDelegate& SuccessDelegate = FBlockEntityDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Changes the role membership of a list of entities from one role to another. + * Changes the role membership of a list of entities from one role to another in in a single operation. The destination role must already exist. This is equivalent to adding the entities to the destination role and removing from the origin role. Returns nothing if successful. + */ + bool ChangeMemberRole(GroupsModels::FChangeMemberRoleRequest& request, const FChangeMemberRoleDelegate& SuccessDelegate = FChangeMemberRoleDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates a new group. + * Creates a new group, as well as administration and member roles, based off of a title's group template. Returns information about the group that was created. + */ + bool CreateGroup(GroupsModels::FCreateGroupRequest& request, const FCreateGroupDelegate& SuccessDelegate = FCreateGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Creates a new group role. + * Creates a new role within an existing group, with no members. Both the role ID and role name must be unique within the group, but the name can be the same as the ID. The role ID is set at creation and cannot be changed. Returns information about the role that was created. + */ + bool CreateRole(GroupsModels::FCreateGroupRoleRequest& request, const FCreateRoleDelegate& SuccessDelegate = FCreateRoleDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes a group and all roles, invitations, join requests, and blocks associated with it. + * Deletes a group and all roles, invitations, join requests, and blocks associated with it. Permission to delete is only required the group itself to execute this action. The group and data cannot be cannot be recovered once removed, but any abuse reports about the group will remain. No data is returned in the case of success. + */ + bool DeleteGroup(GroupsModels::FDeleteGroupRequest& request, const FDeleteGroupDelegate& SuccessDelegate = FDeleteGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes an existing role in a group. + * Returns information about the role + */ + bool DeleteRole(GroupsModels::FDeleteRoleRequest& request, const FDeleteRoleDelegate& SuccessDelegate = FDeleteRoleDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Gets information about a group and its roles + * Returns the ID, name, role list and other non-membership related information about a group. + */ + bool GetGroup(GroupsModels::FGetGroupRequest& request, const FGetGroupDelegate& SuccessDelegate = FGetGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Invites a player to join a group + * Invites a player to join a group, if they are not blocked by the group. An optional role can be provided to automatically assign the player to the role if they accept the invitation. By default, if the entity has an application to the group outstanding, this will accept the application instead and return an error indicating such, rather than creating a duplicate invitation to join that will need to be cleaned up later. Returns information about the new invitation or an error indicating an existing application to join was accepted. + */ + bool InviteToGroup(GroupsModels::FInviteToGroupRequest& request, const FInviteToGroupDelegate& SuccessDelegate = FInviteToGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Checks to see if an entity is a member of a group or role within the group + * Checks to see if an entity is a member of a group or role within the group. A result indicating if the entity is a member of the group is returned, or a permission error if the caller does not have permission to read the group's member list. + */ + bool IsMember(GroupsModels::FIsMemberRequest& request, const FIsMemberDelegate& SuccessDelegate = FIsMemberDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all outstanding requests to join a group + * Lists all outstanding requests to join a group. Returns a list of all requests to join, as well as when the request will expire. To get the group applications for a specific entity, use ListMembershipOpportunities. + */ + bool ListGroupApplications(GroupsModels::FListGroupApplicationsRequest& request, const FListGroupApplicationsDelegate& SuccessDelegate = FListGroupApplicationsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all entities blocked from joining a group + * Lists all entities blocked from joining a group. A list of blocked entities is returned + */ + bool ListGroupBlocks(GroupsModels::FListGroupBlocksRequest& request, const FListGroupBlocksDelegate& SuccessDelegate = FListGroupBlocksDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all outstanding invitations for a group + * Lists all outstanding invitations for a group. Returns a list of entities that have been invited, as well as when the invitation will expire. To get the group invitations for a specific entity, use ListMembershipOpportunities. + */ + bool ListGroupInvitations(GroupsModels::FListGroupInvitationsRequest& request, const FListGroupInvitationsDelegate& SuccessDelegate = FListGroupInvitationsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all members for a group + * Gets a list of members and the roles they belong to within the group. If the caller does not have permission to view the role, and the member is in no other role, the member is not displayed. Returns a list of entities that are members of the group. + */ + bool ListGroupMembers(GroupsModels::FListGroupMembersRequest& request, const FListGroupMembersDelegate& SuccessDelegate = FListGroupMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all groups and roles for an entity + * Lists the groups and roles that an entity is a part of, checking to see if group and role metadata and memberships should be visible to the caller. If the entity is not in any roles that are visible to the caller, the group is not returned in the results, even if the caller otherwise has permission to see that the entity is a member of that group. + */ + bool ListMembership(GroupsModels::FListMembershipRequest& request, const FListMembershipDelegate& SuccessDelegate = FListMembershipDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all outstanding invitations and group applications for an entity + * Lists all outstanding group applications and invitations for an entity. Anyone may call this for any entity, but data will only be returned for the entity or a parent of that entity. To list invitations or applications for a group to check if a player is trying to join, use ListGroupInvitations and ListGroupApplications. + */ + bool ListMembershipOpportunities(GroupsModels::FListMembershipOpportunitiesRequest& request, const FListMembershipOpportunitiesDelegate& SuccessDelegate = FListMembershipOpportunitiesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes an application to join a group + * Removes an existing application to join the group. This is used for both rejection of an application as well as withdrawing an application. The applying entity or a parent in its chain (e.g. title) may withdraw the application, and any caller with appropriate access in the group may reject an application. No data is returned in the case of success. + */ + bool RemoveGroupApplication(GroupsModels::FRemoveGroupApplicationRequest& request, const FRemoveGroupApplicationDelegate& SuccessDelegate = FRemoveGroupApplicationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes an invitation join a group + * Removes an existing invitation to join the group. This is used for both rejection of an invitation as well as rescinding an invitation. The invited entity or a parent in its chain (e.g. title) may reject the invitation by calling this method, and any caller with appropriate access in the group may rescind an invitation. No data is returned in the case of success. + */ + bool RemoveGroupInvitation(GroupsModels::FRemoveGroupInvitationRequest& request, const FRemoveGroupInvitationDelegate& SuccessDelegate = FRemoveGroupInvitationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes members from a group. + * Removes members from a group. A member can always remove themselves from a group, regardless of permissions. Returns nothing if successful. + */ + bool RemoveMembers(GroupsModels::FRemoveMembersRequest& request, const FRemoveMembersDelegate& SuccessDelegate = FRemoveMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Unblocks a list of entities from joining a group + * Unblocks a list of entities from joining a group. No data is returned in the case of success. + */ + bool UnblockEntity(GroupsModels::FUnblockEntityRequest& request, const FUnblockEntityDelegate& SuccessDelegate = FUnblockEntityDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates non-membership data about a group. + * Updates data about a group, such as the name or default member role. Returns information about whether the update was successful. Only title claimants may modify the administration role for a group. + */ + bool UpdateGroup(GroupsModels::FUpdateGroupRequest& request, const FUpdateGroupDelegate& SuccessDelegate = FUpdateGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates metadata about a role. + * Updates the role name. Returns information about whether the update was successful. + */ + bool UpdateRole(GroupsModels::FUpdateGroupRoleRequest& request, const FUpdateRoleDelegate& SuccessDelegate = FUpdateRoleDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnAcceptGroupApplicationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAcceptGroupApplicationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAcceptGroupInvitationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAcceptGroupInvitationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnApplyToGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FApplyToGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnBlockEntityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FBlockEntityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnChangeMemberRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FChangeMemberRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreateGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreateRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnInviteToGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FInviteToGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnIsMemberResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FIsMemberDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListGroupApplicationsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupApplicationsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListGroupBlocksResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupBlocksDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListGroupInvitationsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupInvitationsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListMembershipResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMembershipDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnListMembershipOpportunitiesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMembershipOpportunitiesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveGroupApplicationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveGroupApplicationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveGroupInvitationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveGroupInvitationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnblockEntityResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnblockEntityDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateRoleResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateRoleDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabGroupsDataModels.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabGroupsDataModels.h new file mode 100644 index 000000000..6aa5e2876 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabGroupsDataModels.h @@ -0,0 +1,1650 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace GroupsModels +{ + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAcceptGroupApplicationRequest : public FPlayFabBaseModel + { + /** + * Optional. Type of the entity to accept as. If specified, must be the same entity as the claimant or an entity that is a + * child of the claimant entity. Defaults to the claimant entity. + */ + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + FAcceptGroupApplicationRequest() : + FPlayFabBaseModel(), + Entity(), + Group() + {} + + FAcceptGroupApplicationRequest(const FAcceptGroupApplicationRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Group(src.Group) + {} + + FAcceptGroupApplicationRequest(const TSharedPtr& obj) : FAcceptGroupApplicationRequest() + { + readFromValue(obj); + } + + ~FAcceptGroupApplicationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAcceptGroupInvitationRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + // The identifier of the group + FEntityKey Group; + + FAcceptGroupInvitationRequest() : + FPlayFabBaseModel(), + Entity(nullptr), + Group() + {} + + FAcceptGroupInvitationRequest(const FAcceptGroupInvitationRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + Group(src.Group) + {} + + FAcceptGroupInvitationRequest(const TSharedPtr& obj) : FAcceptGroupInvitationRequest() + { + readFromValue(obj); + } + + ~FAcceptGroupInvitationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddMembersRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + // List of entities to add to the group. Only entities of type title_player_account and character may be added to groups. + TArray Members; + /** + * [optional] Optional: The ID of the existing role to add the entities to. If this is not specified, the default member role for the + * group will be used. Role IDs must be between 1 and 64 characters long. + */ + FString RoleId; + + FAddMembersRequest() : + FPlayFabBaseModel(), + Group(), + Members(), + RoleId() + {} + + FAddMembersRequest(const FAddMembersRequest& src) : + FPlayFabBaseModel(), + Group(src.Group), + Members(src.Members), + RoleId(src.RoleId) + {} + + FAddMembersRequest(const TSharedPtr& obj) : FAddMembersRequest() + { + readFromValue(obj); + } + + ~FAddMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FApplyToGroupRequest : public FPlayFabBaseModel + { + // [optional] Optional, default true. Automatically accept an outstanding invitation if one exists instead of creating an application + Boxed AutoAcceptOutstandingInvite; + + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + // The identifier of the group + FEntityKey Group; + + FApplyToGroupRequest() : + FPlayFabBaseModel(), + AutoAcceptOutstandingInvite(), + Entity(nullptr), + Group() + {} + + FApplyToGroupRequest(const FApplyToGroupRequest& src) : + FPlayFabBaseModel(), + AutoAcceptOutstandingInvite(src.AutoAcceptOutstandingInvite), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + Group(src.Group) + {} + + FApplyToGroupRequest(const TSharedPtr& obj) : FApplyToGroupRequest() + { + readFromValue(obj); + } + + ~FApplyToGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityWithLineage : public FPlayFabBaseModel + { + // [optional] The entity key for the specified entity + TSharedPtr Key; + + // [optional] Dictionary of entity keys for related entities. Dictionary key is entity type. + TMap Lineage; + FEntityWithLineage() : + FPlayFabBaseModel(), + Key(nullptr), + Lineage() + {} + + FEntityWithLineage(const FEntityWithLineage& src) : + FPlayFabBaseModel(), + Key(src.Key.IsValid() ? MakeShareable(new FEntityKey(*src.Key)) : nullptr), + Lineage(src.Lineage) + {} + + FEntityWithLineage(const TSharedPtr& obj) : FEntityWithLineage() + { + readFromValue(obj); + } + + ~FEntityWithLineage(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FApplyToGroupResponse : public FPlayFabBaseModel + { + // [optional] Type of entity that requested membership + TSharedPtr Entity; + + // When the application to join will expire and be deleted + FDateTime Expires; + + // [optional] ID of the group that the entity requesting membership to + TSharedPtr Group; + + FApplyToGroupResponse() : + FPlayFabBaseModel(), + Entity(nullptr), + Expires(0), + Group(nullptr) + {} + + FApplyToGroupResponse(const FApplyToGroupResponse& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.Entity)) : nullptr), + Expires(src.Expires), + Group(src.Group.IsValid() ? MakeShareable(new FEntityKey(*src.Group)) : nullptr) + {} + + FApplyToGroupResponse(const TSharedPtr& obj) : FApplyToGroupResponse() + { + readFromValue(obj); + } + + ~FApplyToGroupResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBlockEntityRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + FBlockEntityRequest() : + FPlayFabBaseModel(), + Entity(), + Group() + {} + + FBlockEntityRequest(const FBlockEntityRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Group(src.Group) + {} + + FBlockEntityRequest(const TSharedPtr& obj) : FBlockEntityRequest() + { + readFromValue(obj); + } + + ~FBlockEntityRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FChangeMemberRoleRequest : public FPlayFabBaseModel + { + /** + * [optional] The ID of the role that the entities will become a member of. This must be an existing role. Role IDs must be between 1 + * and 64 characters long. + */ + FString DestinationRoleId; + + // The identifier of the group + FEntityKey Group; + + /** + * List of entities to move between roles in the group. All entities in this list must be members of the group and origin + * role. + */ + TArray Members; + // The ID of the role that the entities currently are a member of. Role IDs must be between 1 and 64 characters long. + FString OriginRoleId; + + FChangeMemberRoleRequest() : + FPlayFabBaseModel(), + DestinationRoleId(), + Group(), + Members(), + OriginRoleId() + {} + + FChangeMemberRoleRequest(const FChangeMemberRoleRequest& src) : + FPlayFabBaseModel(), + DestinationRoleId(src.DestinationRoleId), + Group(src.Group), + Members(src.Members), + OriginRoleId(src.OriginRoleId) + {} + + FChangeMemberRoleRequest(const TSharedPtr& obj) : FChangeMemberRoleRequest() + { + readFromValue(obj); + } + + ~FChangeMemberRoleRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateGroupRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + // The name of the group. This is unique at the title level by default. + FString GroupName; + + FCreateGroupRequest() : + FPlayFabBaseModel(), + Entity(nullptr), + GroupName() + {} + + FCreateGroupRequest(const FCreateGroupRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + GroupName(src.GroupName) + {} + + FCreateGroupRequest(const TSharedPtr& obj) : FCreateGroupRequest() + { + readFromValue(obj); + } + + ~FCreateGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateGroupResponse : public FPlayFabBaseModel + { + // [optional] The ID of the administrator role for the group. + FString AdminRoleId; + + // The server date and time the group was created. + FDateTime Created; + + // The identifier of the group + FEntityKey Group; + + // [optional] The name of the group. + FString GroupName; + + // [optional] The ID of the default member role for the group. + FString MemberRoleId; + + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + // [optional] The list of roles and names that belong to the group. + TMap Roles; + FCreateGroupResponse() : + FPlayFabBaseModel(), + AdminRoleId(), + Created(0), + Group(), + GroupName(), + MemberRoleId(), + ProfileVersion(0), + Roles() + {} + + FCreateGroupResponse(const FCreateGroupResponse& src) : + FPlayFabBaseModel(), + AdminRoleId(src.AdminRoleId), + Created(src.Created), + Group(src.Group), + GroupName(src.GroupName), + MemberRoleId(src.MemberRoleId), + ProfileVersion(src.ProfileVersion), + Roles(src.Roles) + {} + + FCreateGroupResponse(const TSharedPtr& obj) : FCreateGroupResponse() + { + readFromValue(obj); + } + + ~FCreateGroupResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateGroupRoleRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + /** + * The ID of the role. This must be unique within the group and cannot be changed. Role IDs must be between 1 and 64 + * characters long. + */ + FString RoleId; + + /** + * The name of the role. This must be unique within the group and can be changed later. Role names must be between 1 and + * 100 characters long + */ + FString RoleName; + + FCreateGroupRoleRequest() : + FPlayFabBaseModel(), + Group(), + RoleId(), + RoleName() + {} + + FCreateGroupRoleRequest(const FCreateGroupRoleRequest& src) : + FPlayFabBaseModel(), + Group(src.Group), + RoleId(src.RoleId), + RoleName(src.RoleName) + {} + + FCreateGroupRoleRequest(const TSharedPtr& obj) : FCreateGroupRoleRequest() + { + readFromValue(obj); + } + + ~FCreateGroupRoleRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateGroupRoleResponse : public FPlayFabBaseModel + { + // The current version of the group profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + // [optional] ID for the role + FString RoleId; + + // [optional] The name of the role + FString RoleName; + + FCreateGroupRoleResponse() : + FPlayFabBaseModel(), + ProfileVersion(0), + RoleId(), + RoleName() + {} + + FCreateGroupRoleResponse(const FCreateGroupRoleResponse& src) : + FPlayFabBaseModel(), + ProfileVersion(src.ProfileVersion), + RoleId(src.RoleId), + RoleName(src.RoleName) + {} + + FCreateGroupRoleResponse(const TSharedPtr& obj) : FCreateGroupRoleResponse() + { + readFromValue(obj); + } + + ~FCreateGroupRoleResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteGroupRequest : public FPlayFabBaseModel + { + // ID of the group or role to remove + FEntityKey Group; + + FDeleteGroupRequest() : + FPlayFabBaseModel(), + Group() + {} + + FDeleteGroupRequest(const FDeleteGroupRequest& src) : + FPlayFabBaseModel(), + Group(src.Group) + {} + + FDeleteGroupRequest(const TSharedPtr& obj) : FDeleteGroupRequest() + { + readFromValue(obj); + } + + ~FDeleteGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteRoleRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + // [optional] The ID of the role to delete. Role IDs must be between 1 and 64 characters long. + FString RoleId; + + FDeleteRoleRequest() : + FPlayFabBaseModel(), + Group(), + RoleId() + {} + + FDeleteRoleRequest(const FDeleteRoleRequest& src) : + FPlayFabBaseModel(), + Group(src.Group), + RoleId(src.RoleId) + {} + + FDeleteRoleRequest(const TSharedPtr& obj) : FDeleteRoleRequest() + { + readFromValue(obj); + } + + ~FDeleteRoleRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEmptyResponse : public FPlayFabBaseModel + { + FEmptyResponse() : + FPlayFabBaseModel() + {} + + FEmptyResponse(const FEmptyResponse& src) : + FPlayFabBaseModel() + {} + + FEmptyResponse(const TSharedPtr& obj) : FEmptyResponse() + { + readFromValue(obj); + } + + ~FEmptyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityMemberRole : public FPlayFabBaseModel + { + // [optional] The list of members in the role + TArray Members; + // [optional] The ID of the role. + FString RoleId; + + // [optional] The name of the role + FString RoleName; + + FEntityMemberRole() : + FPlayFabBaseModel(), + Members(), + RoleId(), + RoleName() + {} + + FEntityMemberRole(const FEntityMemberRole& src) : + FPlayFabBaseModel(), + Members(src.Members), + RoleId(src.RoleId), + RoleName(src.RoleName) + {} + + FEntityMemberRole(const TSharedPtr& obj) : FEntityMemberRole() + { + readFromValue(obj); + } + + ~FEntityMemberRole(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetGroupRequest : public FPlayFabBaseModel + { + // [optional] The identifier of the group + TSharedPtr Group; + + // [optional] The full name of the group + FString GroupName; + + FGetGroupRequest() : + FPlayFabBaseModel(), + Group(nullptr), + GroupName() + {} + + FGetGroupRequest(const FGetGroupRequest& src) : + FPlayFabBaseModel(), + Group(src.Group.IsValid() ? MakeShareable(new FEntityKey(*src.Group)) : nullptr), + GroupName(src.GroupName) + {} + + FGetGroupRequest(const TSharedPtr& obj) : FGetGroupRequest() + { + readFromValue(obj); + } + + ~FGetGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetGroupResponse : public FPlayFabBaseModel + { + // [optional] The ID of the administrator role for the group. + FString AdminRoleId; + + // The server date and time the group was created. + FDateTime Created; + + // The identifier of the group + FEntityKey Group; + + // [optional] The name of the group. + FString GroupName; + + // [optional] The ID of the default member role for the group. + FString MemberRoleId; + + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + // [optional] The list of roles and names that belong to the group. + TMap Roles; + FGetGroupResponse() : + FPlayFabBaseModel(), + AdminRoleId(), + Created(0), + Group(), + GroupName(), + MemberRoleId(), + ProfileVersion(0), + Roles() + {} + + FGetGroupResponse(const FGetGroupResponse& src) : + FPlayFabBaseModel(), + AdminRoleId(src.AdminRoleId), + Created(src.Created), + Group(src.Group), + GroupName(src.GroupName), + MemberRoleId(src.MemberRoleId), + ProfileVersion(src.ProfileVersion), + Roles(src.Roles) + {} + + FGetGroupResponse(const TSharedPtr& obj) : FGetGroupResponse() + { + readFromValue(obj); + } + + ~FGetGroupResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGroupApplication : public FPlayFabBaseModel + { + // [optional] Type of entity that requested membership + TSharedPtr Entity; + + // When the application to join will expire and be deleted + FDateTime Expires; + + // [optional] ID of the group that the entity requesting membership to + TSharedPtr Group; + + FGroupApplication() : + FPlayFabBaseModel(), + Entity(nullptr), + Expires(0), + Group(nullptr) + {} + + FGroupApplication(const FGroupApplication& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.Entity)) : nullptr), + Expires(src.Expires), + Group(src.Group.IsValid() ? MakeShareable(new FEntityKey(*src.Group)) : nullptr) + {} + + FGroupApplication(const TSharedPtr& obj) : FGroupApplication() + { + readFromValue(obj); + } + + ~FGroupApplication(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGroupBlock : public FPlayFabBaseModel + { + // [optional] The entity that is blocked + TSharedPtr Entity; + + // ID of the group that the entity is blocked from + FEntityKey Group; + + FGroupBlock() : + FPlayFabBaseModel(), + Entity(nullptr), + Group() + {} + + FGroupBlock(const FGroupBlock& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.Entity)) : nullptr), + Group(src.Group) + {} + + FGroupBlock(const TSharedPtr& obj) : FGroupBlock() + { + readFromValue(obj); + } + + ~FGroupBlock(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGroupInvitation : public FPlayFabBaseModel + { + // When the invitation will expire and be deleted + FDateTime Expires; + + // [optional] The group that the entity invited to + TSharedPtr Group; + + // [optional] The entity that created the invitation + TSharedPtr InvitedByEntity; + + // [optional] The entity that is invited + TSharedPtr InvitedEntity; + + // [optional] ID of the role in the group to assign the user to. + FString RoleId; + + FGroupInvitation() : + FPlayFabBaseModel(), + Expires(0), + Group(nullptr), + InvitedByEntity(nullptr), + InvitedEntity(nullptr), + RoleId() + {} + + FGroupInvitation(const FGroupInvitation& src) : + FPlayFabBaseModel(), + Expires(src.Expires), + Group(src.Group.IsValid() ? MakeShareable(new FEntityKey(*src.Group)) : nullptr), + InvitedByEntity(src.InvitedByEntity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.InvitedByEntity)) : nullptr), + InvitedEntity(src.InvitedEntity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.InvitedEntity)) : nullptr), + RoleId(src.RoleId) + {} + + FGroupInvitation(const TSharedPtr& obj) : FGroupInvitation() + { + readFromValue(obj); + } + + ~FGroupInvitation(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGroupRole : public FPlayFabBaseModel + { + // [optional] ID for the role + FString RoleId; + + // [optional] The name of the role + FString RoleName; + + FGroupRole() : + FPlayFabBaseModel(), + RoleId(), + RoleName() + {} + + FGroupRole(const FGroupRole& src) : + FPlayFabBaseModel(), + RoleId(src.RoleId), + RoleName(src.RoleName) + {} + + FGroupRole(const TSharedPtr& obj) : FGroupRole() + { + readFromValue(obj); + } + + ~FGroupRole(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGroupWithRoles : public FPlayFabBaseModel + { + // [optional] ID for the group + TSharedPtr Group; + + // [optional] The name of the group + FString GroupName; + + // The current version of the profile, can be used for concurrency control during updates. + int32 ProfileVersion; + + // [optional] The list of roles within the group + TArray Roles; + FGroupWithRoles() : + FPlayFabBaseModel(), + Group(nullptr), + GroupName(), + ProfileVersion(0), + Roles() + {} + + FGroupWithRoles(const FGroupWithRoles& src) : + FPlayFabBaseModel(), + Group(src.Group.IsValid() ? MakeShareable(new FEntityKey(*src.Group)) : nullptr), + GroupName(src.GroupName), + ProfileVersion(src.ProfileVersion), + Roles(src.Roles) + {} + + FGroupWithRoles(const TSharedPtr& obj) : FGroupWithRoles() + { + readFromValue(obj); + } + + ~FGroupWithRoles(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FInviteToGroupRequest : public FPlayFabBaseModel + { + // [optional] Optional, default true. Automatically accept an application if one exists instead of creating an invitation + Boxed AutoAcceptOutstandingApplication; + + // The entity to perform this action on. + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + /** + * [optional] Optional. ID of an existing a role in the group to assign the user to. The group's default member role is used if this + * is not specified. Role IDs must be between 1 and 64 characters long. + */ + FString RoleId; + + FInviteToGroupRequest() : + FPlayFabBaseModel(), + AutoAcceptOutstandingApplication(), + Entity(), + Group(), + RoleId() + {} + + FInviteToGroupRequest(const FInviteToGroupRequest& src) : + FPlayFabBaseModel(), + AutoAcceptOutstandingApplication(src.AutoAcceptOutstandingApplication), + Entity(src.Entity), + Group(src.Group), + RoleId(src.RoleId) + {} + + FInviteToGroupRequest(const TSharedPtr& obj) : FInviteToGroupRequest() + { + readFromValue(obj); + } + + ~FInviteToGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FInviteToGroupResponse : public FPlayFabBaseModel + { + // When the invitation will expire and be deleted + FDateTime Expires; + + // [optional] The group that the entity invited to + TSharedPtr Group; + + // [optional] The entity that created the invitation + TSharedPtr InvitedByEntity; + + // [optional] The entity that is invited + TSharedPtr InvitedEntity; + + // [optional] ID of the role in the group to assign the user to. + FString RoleId; + + FInviteToGroupResponse() : + FPlayFabBaseModel(), + Expires(0), + Group(nullptr), + InvitedByEntity(nullptr), + InvitedEntity(nullptr), + RoleId() + {} + + FInviteToGroupResponse(const FInviteToGroupResponse& src) : + FPlayFabBaseModel(), + Expires(src.Expires), + Group(src.Group.IsValid() ? MakeShareable(new FEntityKey(*src.Group)) : nullptr), + InvitedByEntity(src.InvitedByEntity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.InvitedByEntity)) : nullptr), + InvitedEntity(src.InvitedEntity.IsValid() ? MakeShareable(new FEntityWithLineage(*src.InvitedEntity)) : nullptr), + RoleId(src.RoleId) + {} + + FInviteToGroupResponse(const TSharedPtr& obj) : FInviteToGroupResponse() + { + readFromValue(obj); + } + + ~FInviteToGroupResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FIsMemberRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + /** + * [optional] Optional: ID of the role to check membership of. Defaults to any role (that is, check to see if the entity is a member + * of the group in any capacity) if not specified. + */ + FString RoleId; + + FIsMemberRequest() : + FPlayFabBaseModel(), + Entity(), + Group(), + RoleId() + {} + + FIsMemberRequest(const FIsMemberRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Group(src.Group), + RoleId(src.RoleId) + {} + + FIsMemberRequest(const TSharedPtr& obj) : FIsMemberRequest() + { + readFromValue(obj); + } + + ~FIsMemberRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FIsMemberResponse : public FPlayFabBaseModel + { + // A value indicating whether or not the entity is a member. + bool IsMember; + + FIsMemberResponse() : + FPlayFabBaseModel(), + IsMember(false) + {} + + FIsMemberResponse(const FIsMemberResponse& src) : + FPlayFabBaseModel(), + IsMember(src.IsMember) + {} + + FIsMemberResponse(const TSharedPtr& obj) : FIsMemberResponse() + { + readFromValue(obj); + } + + ~FIsMemberResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupApplicationsRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + FListGroupApplicationsRequest() : + FPlayFabBaseModel(), + Group() + {} + + FListGroupApplicationsRequest(const FListGroupApplicationsRequest& src) : + FPlayFabBaseModel(), + Group(src.Group) + {} + + FListGroupApplicationsRequest(const TSharedPtr& obj) : FListGroupApplicationsRequest() + { + readFromValue(obj); + } + + ~FListGroupApplicationsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupApplicationsResponse : public FPlayFabBaseModel + { + // [optional] The requested list of applications to the group. + TArray Applications; + FListGroupApplicationsResponse() : + FPlayFabBaseModel(), + Applications() + {} + + FListGroupApplicationsResponse(const FListGroupApplicationsResponse& src) : + FPlayFabBaseModel(), + Applications(src.Applications) + {} + + FListGroupApplicationsResponse(const TSharedPtr& obj) : FListGroupApplicationsResponse() + { + readFromValue(obj); + } + + ~FListGroupApplicationsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupBlocksRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + FListGroupBlocksRequest() : + FPlayFabBaseModel(), + Group() + {} + + FListGroupBlocksRequest(const FListGroupBlocksRequest& src) : + FPlayFabBaseModel(), + Group(src.Group) + {} + + FListGroupBlocksRequest(const TSharedPtr& obj) : FListGroupBlocksRequest() + { + readFromValue(obj); + } + + ~FListGroupBlocksRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupBlocksResponse : public FPlayFabBaseModel + { + // [optional] The requested list blocked entities. + TArray BlockedEntities; + FListGroupBlocksResponse() : + FPlayFabBaseModel(), + BlockedEntities() + {} + + FListGroupBlocksResponse(const FListGroupBlocksResponse& src) : + FPlayFabBaseModel(), + BlockedEntities(src.BlockedEntities) + {} + + FListGroupBlocksResponse(const TSharedPtr& obj) : FListGroupBlocksResponse() + { + readFromValue(obj); + } + + ~FListGroupBlocksResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupInvitationsRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + FListGroupInvitationsRequest() : + FPlayFabBaseModel(), + Group() + {} + + FListGroupInvitationsRequest(const FListGroupInvitationsRequest& src) : + FPlayFabBaseModel(), + Group(src.Group) + {} + + FListGroupInvitationsRequest(const TSharedPtr& obj) : FListGroupInvitationsRequest() + { + readFromValue(obj); + } + + ~FListGroupInvitationsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupInvitationsResponse : public FPlayFabBaseModel + { + // [optional] The requested list of group invitations. + TArray Invitations; + FListGroupInvitationsResponse() : + FPlayFabBaseModel(), + Invitations() + {} + + FListGroupInvitationsResponse(const FListGroupInvitationsResponse& src) : + FPlayFabBaseModel(), + Invitations(src.Invitations) + {} + + FListGroupInvitationsResponse(const TSharedPtr& obj) : FListGroupInvitationsResponse() + { + readFromValue(obj); + } + + ~FListGroupInvitationsResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupMembersRequest : public FPlayFabBaseModel + { + // ID of the group to list the members and roles for + FEntityKey Group; + + FListGroupMembersRequest() : + FPlayFabBaseModel(), + Group() + {} + + FListGroupMembersRequest(const FListGroupMembersRequest& src) : + FPlayFabBaseModel(), + Group(src.Group) + {} + + FListGroupMembersRequest(const TSharedPtr& obj) : FListGroupMembersRequest() + { + readFromValue(obj); + } + + ~FListGroupMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListGroupMembersResponse : public FPlayFabBaseModel + { + // [optional] The requested list of roles and member entity IDs. + TArray Members; + FListGroupMembersResponse() : + FPlayFabBaseModel(), + Members() + {} + + FListGroupMembersResponse(const FListGroupMembersResponse& src) : + FPlayFabBaseModel(), + Members(src.Members) + {} + + FListGroupMembersResponse(const TSharedPtr& obj) : FListGroupMembersResponse() + { + readFromValue(obj); + } + + ~FListGroupMembersResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListMembershipOpportunitiesRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + FListMembershipOpportunitiesRequest() : + FPlayFabBaseModel(), + Entity(nullptr) + {} + + FListMembershipOpportunitiesRequest(const FListMembershipOpportunitiesRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr) + {} + + FListMembershipOpportunitiesRequest(const TSharedPtr& obj) : FListMembershipOpportunitiesRequest() + { + readFromValue(obj); + } + + ~FListMembershipOpportunitiesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListMembershipOpportunitiesResponse : public FPlayFabBaseModel + { + // [optional] The requested list of group applications. + TArray Applications; + // [optional] The requested list of group invitations. + TArray Invitations; + FListMembershipOpportunitiesResponse() : + FPlayFabBaseModel(), + Applications(), + Invitations() + {} + + FListMembershipOpportunitiesResponse(const FListMembershipOpportunitiesResponse& src) : + FPlayFabBaseModel(), + Applications(src.Applications), + Invitations(src.Invitations) + {} + + FListMembershipOpportunitiesResponse(const TSharedPtr& obj) : FListMembershipOpportunitiesResponse() + { + readFromValue(obj); + } + + ~FListMembershipOpportunitiesResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListMembershipRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + FListMembershipRequest() : + FPlayFabBaseModel(), + Entity(nullptr) + {} + + FListMembershipRequest(const FListMembershipRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr) + {} + + FListMembershipRequest(const TSharedPtr& obj) : FListMembershipRequest() + { + readFromValue(obj); + } + + ~FListMembershipRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListMembershipResponse : public FPlayFabBaseModel + { + // [optional] The list of groups + TArray Groups; + FListMembershipResponse() : + FPlayFabBaseModel(), + Groups() + {} + + FListMembershipResponse(const FListMembershipResponse& src) : + FPlayFabBaseModel(), + Groups(src.Groups) + {} + + FListMembershipResponse(const TSharedPtr& obj) : FListMembershipResponse() + { + readFromValue(obj); + } + + ~FListMembershipResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum OperationTypes + { + OperationTypesCreated, + OperationTypesUpdated, + OperationTypesDeleted, + OperationTypesNone + }; + + PLAYFABCPP_API void writeOperationTypesEnumJSON(OperationTypes enumVal, JsonWriter& writer); + PLAYFABCPP_API OperationTypes readOperationTypesFromValue(const TSharedPtr& value); + PLAYFABCPP_API OperationTypes readOperationTypesFromValue(const FString& value); + + struct PLAYFABCPP_API FRemoveGroupApplicationRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + FRemoveGroupApplicationRequest() : + FPlayFabBaseModel(), + Entity(), + Group() + {} + + FRemoveGroupApplicationRequest(const FRemoveGroupApplicationRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Group(src.Group) + {} + + FRemoveGroupApplicationRequest(const TSharedPtr& obj) : FRemoveGroupApplicationRequest() + { + readFromValue(obj); + } + + ~FRemoveGroupApplicationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveGroupInvitationRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + FRemoveGroupInvitationRequest() : + FPlayFabBaseModel(), + Entity(), + Group() + {} + + FRemoveGroupInvitationRequest(const FRemoveGroupInvitationRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Group(src.Group) + {} + + FRemoveGroupInvitationRequest(const TSharedPtr& obj) : FRemoveGroupInvitationRequest() + { + readFromValue(obj); + } + + ~FRemoveGroupInvitationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveMembersRequest : public FPlayFabBaseModel + { + // The identifier of the group + FEntityKey Group; + + // List of entities to remove + TArray Members; + // [optional] The ID of the role to remove the entities from. + FString RoleId; + + FRemoveMembersRequest() : + FPlayFabBaseModel(), + Group(), + Members(), + RoleId() + {} + + FRemoveMembersRequest(const FRemoveMembersRequest& src) : + FPlayFabBaseModel(), + Group(src.Group), + Members(src.Members), + RoleId(src.RoleId) + {} + + FRemoveMembersRequest(const TSharedPtr& obj) : FRemoveMembersRequest() + { + readFromValue(obj); + } + + ~FRemoveMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnblockEntityRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // The identifier of the group + FEntityKey Group; + + FUnblockEntityRequest() : + FPlayFabBaseModel(), + Entity(), + Group() + {} + + FUnblockEntityRequest(const FUnblockEntityRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Group(src.Group) + {} + + FUnblockEntityRequest(const TSharedPtr& obj) : FUnblockEntityRequest() + { + readFromValue(obj); + } + + ~FUnblockEntityRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateGroupRequest : public FPlayFabBaseModel + { + // [optional] Optional: the ID of an existing role to set as the new administrator role for the group + FString AdminRoleId; + + /** + * [optional] Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from the + * GetGroup API, you can ensure that the group data update will only be performed if the group has not been updated by any + * other clients since the version you last loaded. + */ + Boxed ExpectedProfileVersion; + + // The identifier of the group + FEntityKey Group; + + // [optional] Optional: the new name of the group + FString GroupName; + + // [optional] Optional: the ID of an existing role to set as the new member role for the group + FString MemberRoleId; + + FUpdateGroupRequest() : + FPlayFabBaseModel(), + AdminRoleId(), + ExpectedProfileVersion(), + Group(), + GroupName(), + MemberRoleId() + {} + + FUpdateGroupRequest(const FUpdateGroupRequest& src) : + FPlayFabBaseModel(), + AdminRoleId(src.AdminRoleId), + ExpectedProfileVersion(src.ExpectedProfileVersion), + Group(src.Group), + GroupName(src.GroupName), + MemberRoleId(src.MemberRoleId) + {} + + FUpdateGroupRequest(const TSharedPtr& obj) : FUpdateGroupRequest() + { + readFromValue(obj); + } + + ~FUpdateGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateGroupResponse : public FPlayFabBaseModel + { + // [optional] Optional reason to explain why the operation was the result that it was. + FString OperationReason; + + // New version of the group data. + int32 ProfileVersion; + + // [optional] Indicates which operation was completed, either Created, Updated, Deleted or None. + Boxed SetResult; + + FUpdateGroupResponse() : + FPlayFabBaseModel(), + OperationReason(), + ProfileVersion(0), + SetResult() + {} + + FUpdateGroupResponse(const FUpdateGroupResponse& src) : + FPlayFabBaseModel(), + OperationReason(src.OperationReason), + ProfileVersion(src.ProfileVersion), + SetResult(src.SetResult) + {} + + FUpdateGroupResponse(const TSharedPtr& obj) : FUpdateGroupResponse() + { + readFromValue(obj); + } + + ~FUpdateGroupResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateGroupRoleRequest : public FPlayFabBaseModel + { + /** + * [optional] Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from the + * GetGroup API, you can ensure that the group data update will only be performed if the group has not been updated by any + * other clients since the version you last loaded. + */ + Boxed ExpectedProfileVersion; + + // The identifier of the group + FEntityKey Group; + + // [optional] ID of the role to update. Role IDs must be between 1 and 64 characters long. + FString RoleId; + + // The new name of the role + FString RoleName; + + FUpdateGroupRoleRequest() : + FPlayFabBaseModel(), + ExpectedProfileVersion(), + Group(), + RoleId(), + RoleName() + {} + + FUpdateGroupRoleRequest(const FUpdateGroupRoleRequest& src) : + FPlayFabBaseModel(), + ExpectedProfileVersion(src.ExpectedProfileVersion), + Group(src.Group), + RoleId(src.RoleId), + RoleName(src.RoleName) + {} + + FUpdateGroupRoleRequest(const TSharedPtr& obj) : FUpdateGroupRoleRequest() + { + readFromValue(obj); + } + + ~FUpdateGroupRoleRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateGroupRoleResponse : public FPlayFabBaseModel + { + // [optional] Optional reason to explain why the operation was the result that it was. + FString OperationReason; + + // New version of the role data. + int32 ProfileVersion; + + // [optional] Indicates which operation was completed, either Created, Updated, Deleted or None. + Boxed SetResult; + + FUpdateGroupRoleResponse() : + FPlayFabBaseModel(), + OperationReason(), + ProfileVersion(0), + SetResult() + {} + + FUpdateGroupRoleResponse(const FUpdateGroupRoleResponse& src) : + FPlayFabBaseModel(), + OperationReason(src.OperationReason), + ProfileVersion(src.ProfileVersion), + SetResult(src.SetResult) + {} + + FUpdateGroupRoleResponse(const TSharedPtr& obj) : FUpdateGroupRoleResponse() + { + readFromValue(obj); + } + + ~FUpdateGroupRoleResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabJsonHelpers.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabJsonHelpers.h new file mode 100644 index 000000000..22a817f16 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabJsonHelpers.h @@ -0,0 +1,51 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" + +class FJsonObject; +class FJsonValue; + +namespace PlayFab +{ + class FPlayFabJsonHelpers + { + public: + + // Returns the array named Key or nullptr if it is missing or the wrong type + static const TArray< TSharedPtr >& ReadArray(TSharedPtr Item, const FString& Key); +// +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const bool Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const double Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const int32 Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const uint32 Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const int64 Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const uint64 Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const FString& Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const TCHAR* Value); +// static void WriteValue(JsonWriter& writer, const FString& Identifier, const time_t Value); + + static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, double& OutNumber); + static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, int32& OutNumber); + static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, uint32& OutNumber); + + // why? +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalBool& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalUint16& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalInt16& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalUint32& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalInt32& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalUint64& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalInt64& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalFloat& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalDouble& OutNumber); +// static bool ReadValue(const TSharedPtr& obj, const FString& FieldName, OptionalTime& OutNumber); + + private: + FPlayFabJsonHelpers() {} + }; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabLocalizationAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabLocalizationAPI.h new file mode 100644 index 000000000..462e1b1b8 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabLocalizationAPI.h @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabLocalizationDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabLocalizationAPI + { + public: + DECLARE_DELEGATE_OneParam(FGetLanguageListDelegate, const LocalizationModels::FGetLanguageListResponse&); + + UPlayFabLocalizationAPI(); + ~UPlayFabLocalizationAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + // Retrieves the list of allowed languages, only accessible by title entities + + bool GetLanguageList(const FGetLanguageListDelegate& SuccessDelegate = FGetLanguageListDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnGetLanguageListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLanguageListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabLocalizationDataModels.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabLocalizationDataModels.h new file mode 100644 index 000000000..c3af3c408 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabLocalizationDataModels.h @@ -0,0 +1,64 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace LocalizationModels +{ + + struct PLAYFABCPP_API FGetLanguageListRequest : public FPlayFabBaseModel + { + FGetLanguageListRequest() : + FPlayFabBaseModel() + {} + + FGetLanguageListRequest(const FGetLanguageListRequest& src) : + FPlayFabBaseModel() + {} + + FGetLanguageListRequest(const TSharedPtr& obj) : FGetLanguageListRequest() + { + readFromValue(obj); + } + + ~FGetLanguageListRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLanguageListResponse : public FPlayFabBaseModel + { + // [optional] The list of Playfab-supported languages + TArray LanguageList; + FGetLanguageListResponse() : + FPlayFabBaseModel(), + LanguageList() + {} + + FGetLanguageListResponse(const FGetLanguageListResponse& src) : + FPlayFabBaseModel(), + LanguageList(src.LanguageList) + {} + + FGetLanguageListResponse(const TSharedPtr& obj) : FGetLanguageListResponse() + { + readFromValue(obj); + } + + ~FGetLanguageListResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabMatchmakerAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabMatchmakerAPI.h new file mode 100644 index 000000000..a796cc459 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabMatchmakerAPI.h @@ -0,0 +1,62 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabMatchmakerDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabMatchmakerAPI + { + public: + DECLARE_DELEGATE_OneParam(FAuthUserDelegate, const MatchmakerModels::FAuthUserResponse&); + DECLARE_DELEGATE_OneParam(FPlayerJoinedDelegate, const MatchmakerModels::FPlayerJoinedResponse&); + DECLARE_DELEGATE_OneParam(FPlayerLeftDelegate, const MatchmakerModels::FPlayerLeftResponse&); + DECLARE_DELEGATE_OneParam(FStartGameDelegate, const MatchmakerModels::FStartGameResponse&); + DECLARE_DELEGATE_OneParam(FUserInfoDelegate, const MatchmakerModels::FUserInfoResponse&); + + UPlayFabMatchmakerAPI(); + ~UPlayFabMatchmakerAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Validates a user with the PlayFab service + * This API allows the external match-making service to confirm that the user has a valid Session Ticket for the title, in order to securely enable match-making. The client passes the user's Session Ticket to the external match-making service, which then passes the Session Ticket in as the AuthorizationTicket in this call. + */ + bool AuthUser(MatchmakerModels::FAuthUserRequest& request, const FAuthUserDelegate& SuccessDelegate = FAuthUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Informs the PlayFab game server hosting service that the indicated user has joined the Game Server Instance specified + bool PlayerJoined(MatchmakerModels::FPlayerJoinedRequest& request, const FPlayerJoinedDelegate& SuccessDelegate = FPlayerJoinedDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Informs the PlayFab game server hosting service that the indicated user has left the Game Server Instance specified + bool PlayerLeft(MatchmakerModels::FPlayerLeftRequest& request, const FPlayerLeftDelegate& SuccessDelegate = FPlayerLeftDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Instructs the PlayFab game server hosting service to instantiate a new Game Server Instance + bool StartGame(MatchmakerModels::FStartGameRequest& request, const FStartGameDelegate& SuccessDelegate = FStartGameDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the relevant details for a specified user, which the external match-making service can then use to compute + * effective matches + */ + bool UserInfo(MatchmakerModels::FUserInfoRequest& request, const FUserInfoDelegate& SuccessDelegate = FUserInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnAuthUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAuthUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnPlayerJoinedResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPlayerJoinedDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnPlayerLeftResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPlayerLeftDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnStartGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FStartGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUserInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUserInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabMatchmakerDataModels.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabMatchmakerDataModels.h new file mode 100644 index 000000000..cf9964418 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabMatchmakerDataModels.h @@ -0,0 +1,530 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace MatchmakerModels +{ + + struct PLAYFABCPP_API FAuthUserRequest : public FPlayFabBaseModel + { + // Session Ticket provided by the client. + FString AuthorizationTicket; + + FAuthUserRequest() : + FPlayFabBaseModel(), + AuthorizationTicket() + {} + + FAuthUserRequest(const FAuthUserRequest& src) : + FPlayFabBaseModel(), + AuthorizationTicket(src.AuthorizationTicket) + {} + + FAuthUserRequest(const TSharedPtr& obj) : FAuthUserRequest() + { + readFromValue(obj); + } + + ~FAuthUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAuthUserResponse : public FPlayFabBaseModel + { + // Boolean indicating if the user has been authorized to use the external match-making service. + bool Authorized; + + // [optional] PlayFab unique identifier of the account that has been authorized. + FString PlayFabId; + + FAuthUserResponse() : + FPlayFabBaseModel(), + Authorized(false), + PlayFabId() + {} + + FAuthUserResponse(const FAuthUserResponse& src) : + FPlayFabBaseModel(), + Authorized(src.Authorized), + PlayFabId(src.PlayFabId) + {} + + FAuthUserResponse(const TSharedPtr& obj) : FAuthUserResponse() + { + readFromValue(obj); + } + + ~FAuthUserResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemInstance : public FPlayFabBaseModel + { + // [optional] Game specific comment associated with this instance when it was added to the user inventory. + FString Annotation; + + // [optional] Array of unique items that were awarded when this catalog item was purchased. + TArray BundleContents; + /** + * [optional] Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or + * container. + */ + FString BundleParent; + + // [optional] Catalog version for the inventory item, when this instance was created. + FString CatalogVersion; + + // [optional] A set of custom key-value pairs on the inventory item. + TMap CustomData; + // [optional] CatalogItem.DisplayName at the time this item was purchased. + FString DisplayName; + + // [optional] Timestamp for when this instance will expire. + Boxed Expiration; + + // [optional] Class name for the inventory item, as defined in the catalog. + FString ItemClass; + + // [optional] Unique identifier for the inventory item, as defined in the catalog. + FString ItemId; + + // [optional] Unique item identifier for this specific instance of the item. + FString ItemInstanceId; + + // [optional] Timestamp for when this instance was purchased. + Boxed PurchaseDate; + + // [optional] Total number of remaining uses, if this is a consumable item. + Boxed RemainingUses; + + // [optional] Currency type for the cost of the catalog item. + FString UnitCurrency; + + // Cost of the catalog item in the given currency. + uint32 UnitPrice; + + // [optional] The number of uses that were added or removed to this item in this call. + Boxed UsesIncrementedBy; + + FItemInstance() : + FPlayFabBaseModel(), + Annotation(), + BundleContents(), + BundleParent(), + CatalogVersion(), + CustomData(), + DisplayName(), + Expiration(), + ItemClass(), + ItemId(), + ItemInstanceId(), + PurchaseDate(), + RemainingUses(), + UnitCurrency(), + UnitPrice(0), + UsesIncrementedBy() + {} + + FItemInstance(const FItemInstance& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + BundleContents(src.BundleContents), + BundleParent(src.BundleParent), + CatalogVersion(src.CatalogVersion), + CustomData(src.CustomData), + DisplayName(src.DisplayName), + Expiration(src.Expiration), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + PurchaseDate(src.PurchaseDate), + RemainingUses(src.RemainingUses), + UnitCurrency(src.UnitCurrency), + UnitPrice(src.UnitPrice), + UsesIncrementedBy(src.UsesIncrementedBy) + {} + + FItemInstance(const TSharedPtr& obj) : FItemInstance() + { + readFromValue(obj); + } + + ~FItemInstance(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerJoinedRequest : public FPlayFabBaseModel + { + /** + * Unique identifier of the Game Server Instance the user is joining. This must be a Game Server Instance started with the + * Matchmaker/StartGame API. + */ + FString LobbyId; + + // PlayFab unique identifier for the player joining. + FString PlayFabId; + + FPlayerJoinedRequest() : + FPlayFabBaseModel(), + LobbyId(), + PlayFabId() + {} + + FPlayerJoinedRequest(const FPlayerJoinedRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId), + PlayFabId(src.PlayFabId) + {} + + FPlayerJoinedRequest(const TSharedPtr& obj) : FPlayerJoinedRequest() + { + readFromValue(obj); + } + + ~FPlayerJoinedRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerJoinedResponse : public FPlayFabBaseModel + { + FPlayerJoinedResponse() : + FPlayFabBaseModel() + {} + + FPlayerJoinedResponse(const FPlayerJoinedResponse& src) : + FPlayFabBaseModel() + {} + + FPlayerJoinedResponse(const TSharedPtr& obj) : FPlayerJoinedResponse() + { + readFromValue(obj); + } + + ~FPlayerJoinedResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLeftRequest : public FPlayFabBaseModel + { + /** + * Unique identifier of the Game Server Instance the user is leaving. This must be a Game Server Instance started with the + * Matchmaker/StartGame API. + */ + FString LobbyId; + + // PlayFab unique identifier for the player leaving. + FString PlayFabId; + + FPlayerLeftRequest() : + FPlayFabBaseModel(), + LobbyId(), + PlayFabId() + {} + + FPlayerLeftRequest(const FPlayerLeftRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId), + PlayFabId(src.PlayFabId) + {} + + FPlayerLeftRequest(const TSharedPtr& obj) : FPlayerLeftRequest() + { + readFromValue(obj); + } + + ~FPlayerLeftRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLeftResponse : public FPlayFabBaseModel + { + FPlayerLeftResponse() : + FPlayFabBaseModel() + {} + + FPlayerLeftResponse(const FPlayerLeftResponse& src) : + FPlayFabBaseModel() + {} + + FPlayerLeftResponse(const TSharedPtr& obj) : FPlayerLeftResponse() + { + readFromValue(obj); + } + + ~FPlayerLeftResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum Region + { + RegionUSCentral, + RegionUSEast, + RegionEUWest, + RegionSingapore, + RegionJapan, + RegionBrazil, + RegionAustralia + }; + + PLAYFABCPP_API void writeRegionEnumJSON(Region enumVal, JsonWriter& writer); + PLAYFABCPP_API Region readRegionFromValue(const TSharedPtr& value); + PLAYFABCPP_API Region readRegionFromValue(const FString& value); + + struct PLAYFABCPP_API FStartGameRequest : public FPlayFabBaseModel + { + // Unique identifier of the previously uploaded build executable which is to be started. + FString Build; + + // [optional] Custom command line argument when starting game server process. + FString CustomCommandLineData; + + /** + * HTTP endpoint URL for receiving game status events, if using an external matchmaker. When the game ends, PlayFab will + * make a POST request to this URL with the X-SecretKey header set to the value of the game's secret and an + * application/json body of { "EventName": "game_ended", "GameID": "" }. + */ + FString ExternalMatchmakerEventEndpoint; + + // Game mode for this Game Server Instance. + FString GameMode; + + // Region with which to associate the server, for filtering. + Region pfRegion; + + FStartGameRequest() : + FPlayFabBaseModel(), + Build(), + CustomCommandLineData(), + ExternalMatchmakerEventEndpoint(), + GameMode(), + pfRegion() + {} + + FStartGameRequest(const FStartGameRequest& src) : + FPlayFabBaseModel(), + Build(src.Build), + CustomCommandLineData(src.CustomCommandLineData), + ExternalMatchmakerEventEndpoint(src.ExternalMatchmakerEventEndpoint), + GameMode(src.GameMode), + pfRegion(src.pfRegion) + {} + + FStartGameRequest(const TSharedPtr& obj) : FStartGameRequest() + { + readFromValue(obj); + } + + ~FStartGameRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStartGameResponse : public FPlayFabBaseModel + { + // [optional] Unique identifier for the game/lobby in the new Game Server Instance. + FString GameID; + + // [optional] IPV4 address of the new Game Server Instance. + FString ServerHostname; + + // [optional] IPV4 address of the server + FString ServerIPV4Address; + + // [optional] IPV6 address of the new Game Server Instance. + FString ServerIPV6Address; + + // Port number for communication with the Game Server Instance. + uint32 ServerPort; + + // [optional] Public DNS name (if any) of the server + FString ServerPublicDNSName; + + FStartGameResponse() : + FPlayFabBaseModel(), + GameID(), + ServerHostname(), + ServerIPV4Address(), + ServerIPV6Address(), + ServerPort(0), + ServerPublicDNSName() + {} + + FStartGameResponse(const FStartGameResponse& src) : + FPlayFabBaseModel(), + GameID(src.GameID), + ServerHostname(src.ServerHostname), + ServerIPV4Address(src.ServerIPV4Address), + ServerIPV6Address(src.ServerIPV6Address), + ServerPort(src.ServerPort), + ServerPublicDNSName(src.ServerPublicDNSName) + {} + + FStartGameResponse(const TSharedPtr& obj) : FStartGameResponse() + { + readFromValue(obj); + } + + ~FStartGameResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserInfoRequest : public FPlayFabBaseModel + { + /** + * Minimum catalog version for which data is requested (filters the results to only contain inventory items which have a + * catalog version of this or higher). + */ + int32 MinCatalogVersion; + + // PlayFab unique identifier of the user whose information is being requested. + FString PlayFabId; + + FUserInfoRequest() : + FPlayFabBaseModel(), + MinCatalogVersion(0), + PlayFabId() + {} + + FUserInfoRequest(const FUserInfoRequest& src) : + FPlayFabBaseModel(), + MinCatalogVersion(src.MinCatalogVersion), + PlayFabId(src.PlayFabId) + {} + + FUserInfoRequest(const TSharedPtr& obj) : FUserInfoRequest() + { + readFromValue(obj); + } + + ~FUserInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FVirtualCurrencyRechargeTime : public FPlayFabBaseModel + { + /** + * Maximum value to which the regenerating currency will automatically increment. Note that it can exceed this value + * through use of the AddUserVirtualCurrency API call. However, it will not regenerate automatically until it has fallen + * below this value. + */ + int32 RechargeMax; + + // Server timestamp in UTC indicating the next time the virtual currency will be incremented. + FDateTime RechargeTime; + + // Time remaining (in seconds) before the next recharge increment of the virtual currency. + int32 SecondsToRecharge; + + FVirtualCurrencyRechargeTime() : + FPlayFabBaseModel(), + RechargeMax(0), + RechargeTime(0), + SecondsToRecharge(0) + {} + + FVirtualCurrencyRechargeTime(const FVirtualCurrencyRechargeTime& src) : + FPlayFabBaseModel(), + RechargeMax(src.RechargeMax), + RechargeTime(src.RechargeTime), + SecondsToRecharge(src.SecondsToRecharge) + {} + + FVirtualCurrencyRechargeTime(const TSharedPtr& obj) : FVirtualCurrencyRechargeTime() + { + readFromValue(obj); + } + + ~FVirtualCurrencyRechargeTime(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserInfoResponse : public FPlayFabBaseModel + { + // [optional] Array of inventory items in the user's current inventory. + TArray Inventory; + // Boolean indicating whether the user is a developer. + bool IsDeveloper; + + // [optional] PlayFab unique identifier of the user whose information was requested. + FString PlayFabId; + + // [optional] Steam unique identifier, if the user has an associated Steam account. + FString SteamId; + + // [optional] Title specific display name, if set. + FString TitleDisplayName; + + // [optional] PlayFab unique user name. + FString Username; + + // [optional] Array of virtual currency balance(s) belonging to the user. + TMap VirtualCurrency; + // [optional] Array of remaining times and timestamps for virtual currencies. + TMap VirtualCurrencyRechargeTimes; + FUserInfoResponse() : + FPlayFabBaseModel(), + Inventory(), + IsDeveloper(false), + PlayFabId(), + SteamId(), + TitleDisplayName(), + Username(), + VirtualCurrency(), + VirtualCurrencyRechargeTimes() + {} + + FUserInfoResponse(const FUserInfoResponse& src) : + FPlayFabBaseModel(), + Inventory(src.Inventory), + IsDeveloper(src.IsDeveloper), + PlayFabId(src.PlayFabId), + SteamId(src.SteamId), + TitleDisplayName(src.TitleDisplayName), + Username(src.Username), + VirtualCurrency(src.VirtualCurrency), + VirtualCurrencyRechargeTimes(src.VirtualCurrencyRechargeTimes) + {} + + FUserInfoResponse(const TSharedPtr& obj) : FUserInfoResponse() + { + readFromValue(obj); + } + + ~FUserInfoResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabProfilesAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabProfilesAPI.h new file mode 100644 index 000000000..7a34c38c6 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabProfilesAPI.h @@ -0,0 +1,79 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabProfilesDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabProfilesAPI + { + public: + DECLARE_DELEGATE_OneParam(FGetGlobalPolicyDelegate, const ProfilesModels::FGetGlobalPolicyResponse&); + DECLARE_DELEGATE_OneParam(FGetProfileDelegate, const ProfilesModels::FGetEntityProfileResponse&); + DECLARE_DELEGATE_OneParam(FGetProfilesDelegate, const ProfilesModels::FGetEntityProfilesResponse&); + DECLARE_DELEGATE_OneParam(FSetGlobalPolicyDelegate, const ProfilesModels::FSetGlobalPolicyResponse&); + DECLARE_DELEGATE_OneParam(FSetProfileLanguageDelegate, const ProfilesModels::FSetProfileLanguageResponse&); + DECLARE_DELEGATE_OneParam(FSetProfilePolicyDelegate, const ProfilesModels::FSetEntityProfilePolicyResponse&); + + UPlayFabProfilesAPI(); + ~UPlayFabProfilesAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + /** + * Gets the global title access policy + * Retrieves the title access policy that is used before the profile's policy is inspected during a request. If never customized this will return the default starter policy built by PlayFab. + */ + + bool GetGlobalPolicy(const FGetGlobalPolicyDelegate& SuccessDelegate = FGetGlobalPolicyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the entity's profile. + * Given an entity type and entity identifier will retrieve the profile from the entity store. If the profile being retrieved is the caller's, then the read operation is consistent, if not it is an inconsistent read. An inconsistent read means that we do not guarantee all committed writes have occurred before reading the profile, allowing for a stale read. If consistency is important the Version Number on the result can be used to compare which version of the profile any reader has. + */ + bool GetProfile(ProfilesModels::FGetEntityProfileRequest& request, const FGetProfileDelegate& SuccessDelegate = FGetProfileDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the entity's profile. + * Given a set of entity types and entity identifiers will retrieve all readable profiles properties for the caller. Profiles that the caller is not allowed to read will silently not be included in the results. + */ + bool GetProfiles(ProfilesModels::FGetEntityProfilesRequest& request, const FGetProfilesDelegate& SuccessDelegate = FGetProfilesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets the global title access policy + * Updates the title access policy that is used before the profile's policy is inspected during a request. Policies are compiled and cached for several minutes so an update here may not be reflected in behavior for a short time. + */ + bool SetGlobalPolicy(ProfilesModels::FSetGlobalPolicyRequest& request, const FSetGlobalPolicyDelegate& SuccessDelegate = FSetGlobalPolicyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the entity's language + * Given an entity profile, will update its language to the one passed in if the profile's version is at least the one passed in + */ + bool SetProfileLanguage(ProfilesModels::FSetProfileLanguageRequest& request, const FSetProfileLanguageDelegate& SuccessDelegate = FSetProfileLanguageDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets the profiles access policy + * This will set the access policy statements on the given entity profile. This is not additive, any existing statements will be replaced with the statements in this request. + */ + bool SetProfilePolicy(ProfilesModels::FSetEntityProfilePolicyRequest& request, const FSetProfilePolicyDelegate& SuccessDelegate = FSetProfilePolicyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnGetGlobalPolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetGlobalPolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetProfilesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetProfilesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetGlobalPolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGlobalPolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetProfileLanguageResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetProfileLanguageDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetProfilePolicyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetProfilePolicyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabProfilesDataModels.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabProfilesDataModels.h new file mode 100644 index 000000000..cbaf94449 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabProfilesDataModels.h @@ -0,0 +1,600 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace ProfilesModels +{ + + enum EffectType + { + EffectTypeAllow, + EffectTypeDeny + }; + + PLAYFABCPP_API void writeEffectTypeEnumJSON(EffectType enumVal, JsonWriter& writer); + PLAYFABCPP_API EffectType readEffectTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API EffectType readEffectTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FEntityDataObject : public FPlayFabBaseModel + { + // [optional] Un-escaped JSON object, if DataAsObject is true. + FJsonKeeper DataObject; + + // [optional] Escaped string JSON body of the object, if DataAsObject is default or false. + FString EscapedDataObject; + + // [optional] Name of this object. + FString ObjectName; + + FEntityDataObject() : + FPlayFabBaseModel(), + DataObject(), + EscapedDataObject(), + ObjectName() + {} + + FEntityDataObject(const FEntityDataObject& src) : + FPlayFabBaseModel(), + DataObject(src.DataObject), + EscapedDataObject(src.EscapedDataObject), + ObjectName(src.ObjectName) + {} + + FEntityDataObject(const TSharedPtr& obj) : FEntityDataObject() + { + readFromValue(obj); + } + + ~FEntityDataObject(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityPermissionStatement : public FPlayFabBaseModel + { + // The action this statement effects. May be 'Read', 'Write' or '*' for both read and write. + FString Action; + + // [optional] A comment about the statement. Intended solely for bookkeeping and debugging. + FString Comment; + + // [optional] Additional conditions to be applied for entity resources. + FJsonKeeper Condition; + + // The effect this statement will have. It may be either Allow or Deny + EffectType Effect; + + // The principal this statement will effect. + FJsonKeeper Principal; + + // The resource this statements effects. Similar to 'pfrn:data--title![Title ID]/Profile/*' + FString Resource; + + FEntityPermissionStatement() : + FPlayFabBaseModel(), + Action(), + Comment(), + Condition(), + Effect(), + Principal(), + Resource() + {} + + FEntityPermissionStatement(const FEntityPermissionStatement& src) : + FPlayFabBaseModel(), + Action(src.Action), + Comment(src.Comment), + Condition(src.Condition), + Effect(src.Effect), + Principal(src.Principal), + Resource(src.Resource) + {} + + FEntityPermissionStatement(const TSharedPtr& obj) : FEntityPermissionStatement() + { + readFromValue(obj); + } + + ~FEntityPermissionStatement(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityProfileFileMetadata : public FPlayFabBaseModel + { + // [optional] Checksum value for the file + FString Checksum; + + // [optional] Name of the file + FString FileName; + + // Last UTC time the file was modified + FDateTime LastModified; + + // Storage service's reported byte count + int32 Size; + + FEntityProfileFileMetadata() : + FPlayFabBaseModel(), + Checksum(), + FileName(), + LastModified(0), + Size(0) + {} + + FEntityProfileFileMetadata(const FEntityProfileFileMetadata& src) : + FPlayFabBaseModel(), + Checksum(src.Checksum), + FileName(src.FileName), + LastModified(src.LastModified), + Size(src.Size) + {} + + FEntityProfileFileMetadata(const TSharedPtr& obj) : FEntityProfileFileMetadata() + { + readFromValue(obj); + } + + ~FEntityProfileFileMetadata(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEntityProfileBody : public FPlayFabBaseModel + { + // [optional] The entity id and type. + TSharedPtr Entity; + + /** + * [optional] The chain of responsibility for this entity. This is a representation of 'ownership'. It is constructed using the + * following formats (replace '[ID]' with the unique identifier for the given entity): Namespace: 'namespace![Namespace + * ID]' Title: 'title![Namespace ID]/[Title ID]' Master Player Account: 'master_player_account![Namespace + * ID]/[MasterPlayerAccount ID]' Title Player Account: 'title_player_account![Namespace ID]/[Title ID]/[MasterPlayerAccount + * ID]/[TitlePlayerAccount ID]' Character: 'character![Namespace ID]/[Title ID]/[MasterPlayerAccount + * ID]/[TitlePlayerAccount ID]/[Character ID]' + */ + FString EntityChain; + + // [optional] The files on this profile. + TMap Files; + // [optional] The language on this profile. + FString Language; + + // [optional] The objects on this profile. + TMap Objects; + /** + * [optional] The permissions that govern access to this entity profile and its properties. Only includes permissions set on this + * profile, not global statements from titles and namespaces. + */ + TArray Permissions; + /** + * The version number of the profile in persistent storage at the time of the read. Used for optional optimistic + * concurrency during update. + */ + int32 VersionNumber; + + FEntityProfileBody() : + FPlayFabBaseModel(), + Entity(nullptr), + EntityChain(), + Files(), + Language(), + Objects(), + Permissions(), + VersionNumber(0) + {} + + FEntityProfileBody(const FEntityProfileBody& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + EntityChain(src.EntityChain), + Files(src.Files), + Language(src.Language), + Objects(src.Objects), + Permissions(src.Permissions), + VersionNumber(src.VersionNumber) + {} + + FEntityProfileBody(const TSharedPtr& obj) : FEntityProfileBody() + { + readFromValue(obj); + } + + ~FEntityProfileBody(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetEntityProfileRequest : public FPlayFabBaseModel + { + /** + * [optional] Determines whether the objects will be returned as an escaped JSON string or as a un-escaped JSON object. Default is + * JSON string. + */ + Boxed DataAsObject; + + // The entity to perform this action on. + FEntityKey Entity; + + FGetEntityProfileRequest() : + FPlayFabBaseModel(), + DataAsObject(), + Entity() + {} + + FGetEntityProfileRequest(const FGetEntityProfileRequest& src) : + FPlayFabBaseModel(), + DataAsObject(src.DataAsObject), + Entity(src.Entity) + {} + + FGetEntityProfileRequest(const TSharedPtr& obj) : FGetEntityProfileRequest() + { + readFromValue(obj); + } + + ~FGetEntityProfileRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetEntityProfileResponse : public FPlayFabBaseModel + { + // [optional] Entity profile + TSharedPtr Profile; + + FGetEntityProfileResponse() : + FPlayFabBaseModel(), + Profile(nullptr) + {} + + FGetEntityProfileResponse(const FGetEntityProfileResponse& src) : + FPlayFabBaseModel(), + Profile(src.Profile.IsValid() ? MakeShareable(new FEntityProfileBody(*src.Profile)) : nullptr) + {} + + FGetEntityProfileResponse(const TSharedPtr& obj) : FGetEntityProfileResponse() + { + readFromValue(obj); + } + + ~FGetEntityProfileResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetEntityProfilesRequest : public FPlayFabBaseModel + { + /** + * [optional] Determines whether the objects will be returned as an escaped JSON string or as a un-escaped JSON object. Default is + * JSON string. + */ + Boxed DataAsObject; + + // Entity keys of the profiles to load. Must be between 1 and 25 + TArray Entities; + FGetEntityProfilesRequest() : + FPlayFabBaseModel(), + DataAsObject(), + Entities() + {} + + FGetEntityProfilesRequest(const FGetEntityProfilesRequest& src) : + FPlayFabBaseModel(), + DataAsObject(src.DataAsObject), + Entities(src.Entities) + {} + + FGetEntityProfilesRequest(const TSharedPtr& obj) : FGetEntityProfilesRequest() + { + readFromValue(obj); + } + + ~FGetEntityProfilesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetEntityProfilesResponse : public FPlayFabBaseModel + { + // [optional] Entity profiles + TArray Profiles; + FGetEntityProfilesResponse() : + FPlayFabBaseModel(), + Profiles() + {} + + FGetEntityProfilesResponse(const FGetEntityProfilesResponse& src) : + FPlayFabBaseModel(), + Profiles(src.Profiles) + {} + + FGetEntityProfilesResponse(const TSharedPtr& obj) : FGetEntityProfilesResponse() + { + readFromValue(obj); + } + + ~FGetEntityProfilesResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetGlobalPolicyRequest : public FPlayFabBaseModel + { + FGetGlobalPolicyRequest() : + FPlayFabBaseModel() + {} + + FGetGlobalPolicyRequest(const FGetGlobalPolicyRequest& src) : + FPlayFabBaseModel() + {} + + FGetGlobalPolicyRequest(const TSharedPtr& obj) : FGetGlobalPolicyRequest() + { + readFromValue(obj); + } + + ~FGetGlobalPolicyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetGlobalPolicyResponse : public FPlayFabBaseModel + { + // [optional] The permissions that govern access to all entities under this title or namespace. + TArray Permissions; + FGetGlobalPolicyResponse() : + FPlayFabBaseModel(), + Permissions() + {} + + FGetGlobalPolicyResponse(const FGetGlobalPolicyResponse& src) : + FPlayFabBaseModel(), + Permissions(src.Permissions) + {} + + FGetGlobalPolicyResponse(const TSharedPtr& obj) : FGetGlobalPolicyResponse() + { + readFromValue(obj); + } + + ~FGetGlobalPolicyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum OperationTypes + { + OperationTypesCreated, + OperationTypesUpdated, + OperationTypesDeleted, + OperationTypesNone + }; + + PLAYFABCPP_API void writeOperationTypesEnumJSON(OperationTypes enumVal, JsonWriter& writer); + PLAYFABCPP_API OperationTypes readOperationTypesFromValue(const TSharedPtr& value); + PLAYFABCPP_API OperationTypes readOperationTypesFromValue(const FString& value); + + struct PLAYFABCPP_API FSetEntityProfilePolicyRequest : public FPlayFabBaseModel + { + // The entity to perform this action on. + FEntityKey Entity; + + // [optional] The statements to include in the access policy. + TArray Statements; + FSetEntityProfilePolicyRequest() : + FPlayFabBaseModel(), + Entity(), + Statements() + {} + + FSetEntityProfilePolicyRequest(const FSetEntityProfilePolicyRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity), + Statements(src.Statements) + {} + + FSetEntityProfilePolicyRequest(const TSharedPtr& obj) : FSetEntityProfilePolicyRequest() + { + readFromValue(obj); + } + + ~FSetEntityProfilePolicyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetEntityProfilePolicyResponse : public FPlayFabBaseModel + { + /** + * [optional] The permissions that govern access to this entity profile and its properties. Only includes permissions set on this + * profile, not global statements from titles and namespaces. + */ + TArray Permissions; + FSetEntityProfilePolicyResponse() : + FPlayFabBaseModel(), + Permissions() + {} + + FSetEntityProfilePolicyResponse(const FSetEntityProfilePolicyResponse& src) : + FPlayFabBaseModel(), + Permissions(src.Permissions) + {} + + FSetEntityProfilePolicyResponse(const TSharedPtr& obj) : FSetEntityProfilePolicyResponse() + { + readFromValue(obj); + } + + ~FSetEntityProfilePolicyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGlobalPolicyRequest : public FPlayFabBaseModel + { + // [optional] The permissions that govern access to all entities under this title or namespace. + TArray Permissions; + FSetGlobalPolicyRequest() : + FPlayFabBaseModel(), + Permissions() + {} + + FSetGlobalPolicyRequest(const FSetGlobalPolicyRequest& src) : + FPlayFabBaseModel(), + Permissions(src.Permissions) + {} + + FSetGlobalPolicyRequest(const TSharedPtr& obj) : FSetGlobalPolicyRequest() + { + readFromValue(obj); + } + + ~FSetGlobalPolicyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGlobalPolicyResponse : public FPlayFabBaseModel + { + FSetGlobalPolicyResponse() : + FPlayFabBaseModel() + {} + + FSetGlobalPolicyResponse(const FSetGlobalPolicyResponse& src) : + FPlayFabBaseModel() + {} + + FSetGlobalPolicyResponse(const TSharedPtr& obj) : FSetGlobalPolicyResponse() + { + readFromValue(obj); + } + + ~FSetGlobalPolicyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetProfileLanguageRequest : public FPlayFabBaseModel + { + // [optional] The entity to perform this action on. + TSharedPtr Entity; + + // The expected version of a profile to perform this update on + int32 ExpectedVersion; + + // [optional] The language to set on the given entity. Deletes the profile's language if passed in a null string. + FString Language; + + FSetProfileLanguageRequest() : + FPlayFabBaseModel(), + Entity(nullptr), + ExpectedVersion(0), + Language() + {} + + FSetProfileLanguageRequest(const FSetProfileLanguageRequest& src) : + FPlayFabBaseModel(), + Entity(src.Entity.IsValid() ? MakeShareable(new FEntityKey(*src.Entity)) : nullptr), + ExpectedVersion(src.ExpectedVersion), + Language(src.Language) + {} + + FSetProfileLanguageRequest(const TSharedPtr& obj) : FSetProfileLanguageRequest() + { + readFromValue(obj); + } + + ~FSetProfileLanguageRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetProfileLanguageResponse : public FPlayFabBaseModel + { + // [optional] The type of operation that occured on the profile's language + Boxed OperationResult; + + // [optional] The updated version of the profile after the language update + Boxed VersionNumber; + + FSetProfileLanguageResponse() : + FPlayFabBaseModel(), + OperationResult(), + VersionNumber() + {} + + FSetProfileLanguageResponse(const FSetProfileLanguageResponse& src) : + FPlayFabBaseModel(), + OperationResult(src.OperationResult), + VersionNumber(src.VersionNumber) + {} + + FSetProfileLanguageResponse(const TSharedPtr& obj) : FSetProfileLanguageResponse() + { + readFromValue(obj); + } + + ~FSetProfileLanguageResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabResultHandler.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabResultHandler.h new file mode 100644 index 000000000..69f469837 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabResultHandler.h @@ -0,0 +1,25 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" +#include "PlayFabBaseModel.h" +#include "PlayFabError.h" +#include "Http.h" + +namespace PlayFab +{ + class PlayFabRequestHandler + { + private: + static int pendingCalls; + public: + static int GetPendingCalls(); + static TSharedRef SendRequest(const FString& url, const FString& callBody, const FString& authKey, const FString& authValue); + static bool DecodeRequest(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, PlayFab::FPlayFabBaseModel& OutResult, PlayFab::FPlayFabError& OutError); + static bool DecodeError(TSharedPtr JsonObject, PlayFab::FPlayFabError& OutError); + }; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabServerAPI.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabServerAPI.h new file mode 100644 index 000000000..21fc48e8e --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabServerAPI.h @@ -0,0 +1,778 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabError.h" +#include "Core/PlayFabServerDataModels.h" +#include "Core/PlayFabSettings.h" +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" + +namespace PlayFab +{ + class PLAYFABCPP_API UPlayFabServerAPI + { + public: + DECLARE_DELEGATE_OneParam(FAddCharacterVirtualCurrencyDelegate, const ServerModels::FModifyCharacterVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FAddFriendDelegate, const ServerModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FAddPlayerTagDelegate, const ServerModels::FAddPlayerTagResult&); + DECLARE_DELEGATE_OneParam(FAddSharedGroupMembersDelegate, const ServerModels::FAddSharedGroupMembersResult&); + DECLARE_DELEGATE_OneParam(FAddUserVirtualCurrencyDelegate, const ServerModels::FModifyUserVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FAuthenticateSessionTicketDelegate, const ServerModels::FAuthenticateSessionTicketResult&); + DECLARE_DELEGATE_OneParam(FAwardSteamAchievementDelegate, const ServerModels::FAwardSteamAchievementResult&); + DECLARE_DELEGATE_OneParam(FBanUsersDelegate, const ServerModels::FBanUsersResult&); + DECLARE_DELEGATE_OneParam(FConsumeItemDelegate, const ServerModels::FConsumeItemResult&); + DECLARE_DELEGATE_OneParam(FCreateSharedGroupDelegate, const ServerModels::FCreateSharedGroupResult&); + DECLARE_DELEGATE_OneParam(FDeleteCharacterFromUserDelegate, const ServerModels::FDeleteCharacterFromUserResult&); + DECLARE_DELEGATE_OneParam(FDeleteSharedGroupDelegate, const ServerModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FDeleteUsersDelegate, const ServerModels::FDeleteUsersResult&); + DECLARE_DELEGATE_OneParam(FDeregisterGameDelegate, const ServerModels::FDeregisterGameResponse&); + DECLARE_DELEGATE_OneParam(FEvaluateRandomResultTableDelegate, const ServerModels::FEvaluateRandomResultTableResult&); + DECLARE_DELEGATE_OneParam(FExecuteCloudScriptDelegate, const ServerModels::FExecuteCloudScriptResult&); + DECLARE_DELEGATE_OneParam(FGetAllSegmentsDelegate, const ServerModels::FGetAllSegmentsResult&); + DECLARE_DELEGATE_OneParam(FGetAllUsersCharactersDelegate, const ServerModels::FListUsersCharactersResult&); + DECLARE_DELEGATE_OneParam(FGetCatalogItemsDelegate, const ServerModels::FGetCatalogItemsResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterDataDelegate, const ServerModels::FGetCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterInternalDataDelegate, const ServerModels::FGetCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterInventoryDelegate, const ServerModels::FGetCharacterInventoryResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterLeaderboardDelegate, const ServerModels::FGetCharacterLeaderboardResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterReadOnlyDataDelegate, const ServerModels::FGetCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FGetCharacterStatisticsDelegate, const ServerModels::FGetCharacterStatisticsResult&); + DECLARE_DELEGATE_OneParam(FGetContentDownloadUrlDelegate, const ServerModels::FGetContentDownloadUrlResult&); + DECLARE_DELEGATE_OneParam(FGetFriendLeaderboardDelegate, const ServerModels::FGetLeaderboardResult&); + DECLARE_DELEGATE_OneParam(FGetFriendsListDelegate, const ServerModels::FGetFriendsListResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardDelegate, const ServerModels::FGetLeaderboardResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardAroundCharacterDelegate, const ServerModels::FGetLeaderboardAroundCharacterResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardAroundUserDelegate, const ServerModels::FGetLeaderboardAroundUserResult&); + DECLARE_DELEGATE_OneParam(FGetLeaderboardForUserCharactersDelegate, const ServerModels::FGetLeaderboardForUsersCharactersResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerCombinedInfoDelegate, const ServerModels::FGetPlayerCombinedInfoResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerProfileDelegate, const ServerModels::FGetPlayerProfileResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerSegmentsDelegate, const ServerModels::FGetPlayerSegmentsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayersInSegmentDelegate, const ServerModels::FGetPlayersInSegmentResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerStatisticsDelegate, const ServerModels::FGetPlayerStatisticsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerStatisticVersionsDelegate, const ServerModels::FGetPlayerStatisticVersionsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayerTagsDelegate, const ServerModels::FGetPlayerTagsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromFacebookIDsDelegate, const ServerModels::FGetPlayFabIDsFromFacebookIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate, const ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate, const ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult&); + DECLARE_DELEGATE_OneParam(FGetPlayFabIDsFromSteamIDsDelegate, const ServerModels::FGetPlayFabIDsFromSteamIDsResult&); + DECLARE_DELEGATE_OneParam(FGetPublisherDataDelegate, const ServerModels::FGetPublisherDataResult&); + DECLARE_DELEGATE_OneParam(FGetRandomResultTablesDelegate, const ServerModels::FGetRandomResultTablesResult&); + DECLARE_DELEGATE_OneParam(FGetSharedGroupDataDelegate, const ServerModels::FGetSharedGroupDataResult&); + DECLARE_DELEGATE_OneParam(FGetTimeDelegate, const ServerModels::FGetTimeResult&); + DECLARE_DELEGATE_OneParam(FGetTitleDataDelegate, const ServerModels::FGetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FGetTitleInternalDataDelegate, const ServerModels::FGetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FGetTitleNewsDelegate, const ServerModels::FGetTitleNewsResult&); + DECLARE_DELEGATE_OneParam(FGetUserAccountInfoDelegate, const ServerModels::FGetUserAccountInfoResult&); + DECLARE_DELEGATE_OneParam(FGetUserBansDelegate, const ServerModels::FGetUserBansResult&); + DECLARE_DELEGATE_OneParam(FGetUserDataDelegate, const ServerModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserInternalDataDelegate, const ServerModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserInventoryDelegate, const ServerModels::FGetUserInventoryResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherDataDelegate, const ServerModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherInternalDataDelegate, const ServerModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserPublisherReadOnlyDataDelegate, const ServerModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGetUserReadOnlyDataDelegate, const ServerModels::FGetUserDataResult&); + DECLARE_DELEGATE_OneParam(FGrantCharacterToUserDelegate, const ServerModels::FGrantCharacterToUserResult&); + DECLARE_DELEGATE_OneParam(FGrantItemsToCharacterDelegate, const ServerModels::FGrantItemsToCharacterResult&); + DECLARE_DELEGATE_OneParam(FGrantItemsToUserDelegate, const ServerModels::FGrantItemsToUserResult&); + DECLARE_DELEGATE_OneParam(FGrantItemsToUsersDelegate, const ServerModels::FGrantItemsToUsersResult&); + DECLARE_DELEGATE_OneParam(FModifyItemUsesDelegate, const ServerModels::FModifyItemUsesResult&); + DECLARE_DELEGATE_OneParam(FMoveItemToCharacterFromCharacterDelegate, const ServerModels::FMoveItemToCharacterFromCharacterResult&); + DECLARE_DELEGATE_OneParam(FMoveItemToCharacterFromUserDelegate, const ServerModels::FMoveItemToCharacterFromUserResult&); + DECLARE_DELEGATE_OneParam(FMoveItemToUserFromCharacterDelegate, const ServerModels::FMoveItemToUserFromCharacterResult&); + DECLARE_DELEGATE_OneParam(FNotifyMatchmakerPlayerLeftDelegate, const ServerModels::FNotifyMatchmakerPlayerLeftResult&); + DECLARE_DELEGATE_OneParam(FRedeemCouponDelegate, const ServerModels::FRedeemCouponResult&); + DECLARE_DELEGATE_OneParam(FRedeemMatchmakerTicketDelegate, const ServerModels::FRedeemMatchmakerTicketResult&); + DECLARE_DELEGATE_OneParam(FRefreshGameServerInstanceHeartbeatDelegate, const ServerModels::FRefreshGameServerInstanceHeartbeatResult&); + DECLARE_DELEGATE_OneParam(FRegisterGameDelegate, const ServerModels::FRegisterGameResponse&); + DECLARE_DELEGATE_OneParam(FRemoveFriendDelegate, const ServerModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FRemovePlayerTagDelegate, const ServerModels::FRemovePlayerTagResult&); + DECLARE_DELEGATE_OneParam(FRemoveSharedGroupMembersDelegate, const ServerModels::FRemoveSharedGroupMembersResult&); + DECLARE_DELEGATE_OneParam(FReportPlayerDelegate, const ServerModels::FReportPlayerServerResult&); + DECLARE_DELEGATE_OneParam(FRevokeAllBansForUserDelegate, const ServerModels::FRevokeAllBansForUserResult&); + DECLARE_DELEGATE_OneParam(FRevokeBansDelegate, const ServerModels::FRevokeBansResult&); + DECLARE_DELEGATE_OneParam(FRevokeInventoryItemDelegate, const ServerModels::FRevokeInventoryResult&); + DECLARE_DELEGATE_OneParam(FRevokeInventoryItemsDelegate, const ServerModels::FRevokeInventoryItemsResult&); + DECLARE_DELEGATE_OneParam(FSendCustomAccountRecoveryEmailDelegate, const ServerModels::FSendCustomAccountRecoveryEmailResult&); + DECLARE_DELEGATE_OneParam(FSendEmailFromTemplateDelegate, const ServerModels::FSendEmailFromTemplateResult&); + DECLARE_DELEGATE_OneParam(FSendPushNotificationDelegate, const ServerModels::FSendPushNotificationResult&); + DECLARE_DELEGATE_OneParam(FSetFriendTagsDelegate, const ServerModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FSetGameServerInstanceDataDelegate, const ServerModels::FSetGameServerInstanceDataResult&); + DECLARE_DELEGATE_OneParam(FSetGameServerInstanceStateDelegate, const ServerModels::FSetGameServerInstanceStateResult&); + DECLARE_DELEGATE_OneParam(FSetGameServerInstanceTagsDelegate, const ServerModels::FSetGameServerInstanceTagsResult&); + DECLARE_DELEGATE_OneParam(FSetPlayerSecretDelegate, const ServerModels::FSetPlayerSecretResult&); + DECLARE_DELEGATE_OneParam(FSetPublisherDataDelegate, const ServerModels::FSetPublisherDataResult&); + DECLARE_DELEGATE_OneParam(FSetTitleDataDelegate, const ServerModels::FSetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FSetTitleInternalDataDelegate, const ServerModels::FSetTitleDataResult&); + DECLARE_DELEGATE_OneParam(FSubtractCharacterVirtualCurrencyDelegate, const ServerModels::FModifyCharacterVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FSubtractUserVirtualCurrencyDelegate, const ServerModels::FModifyUserVirtualCurrencyResult&); + DECLARE_DELEGATE_OneParam(FUnlockContainerInstanceDelegate, const ServerModels::FUnlockContainerItemResult&); + DECLARE_DELEGATE_OneParam(FUnlockContainerItemDelegate, const ServerModels::FUnlockContainerItemResult&); + DECLARE_DELEGATE_OneParam(FUpdateAvatarUrlDelegate, const ServerModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FUpdateBansDelegate, const ServerModels::FUpdateBansResult&); + DECLARE_DELEGATE_OneParam(FUpdateCharacterDataDelegate, const ServerModels::FUpdateCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateCharacterInternalDataDelegate, const ServerModels::FUpdateCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateCharacterReadOnlyDataDelegate, const ServerModels::FUpdateCharacterDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateCharacterStatisticsDelegate, const ServerModels::FUpdateCharacterStatisticsResult&); + DECLARE_DELEGATE_OneParam(FUpdatePlayerStatisticsDelegate, const ServerModels::FUpdatePlayerStatisticsResult&); + DECLARE_DELEGATE_OneParam(FUpdateSharedGroupDataDelegate, const ServerModels::FUpdateSharedGroupDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserDataDelegate, const ServerModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserInternalDataDelegate, const ServerModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserInventoryItemCustomDataDelegate, const ServerModels::FEmptyResponse&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherDataDelegate, const ServerModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherInternalDataDelegate, const ServerModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserPublisherReadOnlyDataDelegate, const ServerModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FUpdateUserReadOnlyDataDelegate, const ServerModels::FUpdateUserDataResult&); + DECLARE_DELEGATE_OneParam(FWriteCharacterEventDelegate, const ServerModels::FWriteEventResponse&); + DECLARE_DELEGATE_OneParam(FWritePlayerEventDelegate, const ServerModels::FWriteEventResponse&); + DECLARE_DELEGATE_OneParam(FWriteTitleEventDelegate, const ServerModels::FWriteEventResponse&); + + UPlayFabServerAPI(); + ~UPlayFabServerAPI(); + + int GetPendingCalls() const; + FString GetBuildIdentifier() const; + void SetTitleId(const FString& titleId); + void SetDevSecretKey(const FString& developerSecretKey); + + // ------------ Generated API calls + // Increments the character's balance of the specified virtual currency by the stated amount + bool AddCharacterVirtualCurrency(ServerModels::FAddCharacterVirtualCurrencyRequest& request, const FAddCharacterVirtualCurrencyDelegate& SuccessDelegate = FAddCharacterVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the Friend user to the friendlist of the user with PlayFabId. At least one of + * FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. + */ + bool AddFriend(ServerModels::FAddFriendRequest& request, const FAddFriendDelegate& SuccessDelegate = FAddFriendDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + * This API will trigger a player_tag_added event and add a tag with the given TagName and PlayFabID to the corresponding player profile. TagName can be used for segmentation and it is limited to 256 characters. Also there is a limit on the number of tags a title can have. + */ + bool AddPlayerTag(ServerModels::FAddPlayerTagRequest& request, const FAddPlayerTagDelegate& SuccessDelegate = FAddPlayerTagDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users + * in the group (and the server) can add new members. Shared Groups are designed for sharing data between a very small + * number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool AddSharedGroupMembers(ServerModels::FAddSharedGroupMembersRequest& request, const FAddSharedGroupMembersDelegate& SuccessDelegate = FAddSharedGroupMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Increments the user's balance of the specified virtual currency by the stated amount + bool AddUserVirtualCurrency(ServerModels::FAddUserVirtualCurrencyRequest& request, const FAddUserVirtualCurrencyDelegate& SuccessDelegate = FAddUserVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Validated a client's session ticket, and if successful, returns details for that user + * Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool AuthenticateSessionTicket(ServerModels::FAuthenticateSessionTicketRequest& request, const FAuthenticateSessionTicketDelegate& SuccessDelegate = FAuthenticateSessionTicketDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Awards the specified users the specified Steam achievements + bool AwardSteamAchievement(ServerModels::FAwardSteamAchievementRequest& request, const FAwardSteamAchievementDelegate& SuccessDelegate = FAwardSteamAchievementDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + * The existence of each user will not be verified. When banning by IP or MAC address, multiple players may be affected, so use this feature with caution. Returns information about the new bans. + */ + bool BanUsers(ServerModels::FBanUsersRequest& request, const FBanUsersDelegate& SuccessDelegate = FBanUsersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. + bool ConsumeItem(ServerModels::FConsumeItemRequest& request, const FConsumeItemDelegate& SuccessDelegate = FConsumeItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the + * group. When created by a server, the group will initially have no members. Shared Groups are designed for sharing data + * between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + * If SharedGroupId is specified, the service will attempt to create a group with that identifier, and will return an error if it is already in use. If no SharedGroupId is specified, a random identifier will be assigned. + */ + bool CreateSharedGroup(ServerModels::FCreateSharedGroupRequest& request, const FCreateSharedGroupDelegate& SuccessDelegate = FCreateSharedGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes the specific character ID from the specified user. + * This function will delete the specified character from the list allowed by the user, and will also delete any inventory or VC currently held by that character. It will NOT delete any statistics associated for this character, in order to preserve leaderboard integrity. + */ + bool DeleteCharacterFromUser(ServerModels::FDeleteCharacterFromUserRequest& request, const FDeleteCharacterFromUserDelegate& SuccessDelegate = FDeleteCharacterFromUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes a shared group, freeing up the shared group ID to be reused for a new group. Shared Groups are designed for + * sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool DeleteSharedGroup(ServerModels::FDeleteSharedGroupRequest& request, const FDeleteSharedGroupDelegate& SuccessDelegate = FDeleteSharedGroupDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. + * Note that this action cannot be undone. It will unlink all accounts and remove all PII information, as well as reset any statistics and leaderboards and clear out any stored custom data for the user. This API must be enabled for use as an option in the game manager website. It is disabled by default. + */ + bool DeleteUsers(ServerModels::FDeleteUsersRequest& request, const FDeleteUsersDelegate& SuccessDelegate = FDeleteUsersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Inform the matchmaker that a Game Server Instance is removed. + bool DeregisterGame(ServerModels::FDeregisterGameRequest& request, const FDeregisterGameDelegate& SuccessDelegate = FDeregisterGameDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Returns the result of an evaluation of a Random Result Table - the ItemId from the game Catalog which would have been + * added to the player inventory, if the Random Result Table were added via a Bundle or a call to UnlockContainer. + */ + bool EvaluateRandomResultTable(ServerModels::FEvaluateRandomResultTableRequest& request, const FEvaluateRandomResultTableDelegate& SuccessDelegate = FEvaluateRandomResultTableDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Executes a CloudScript function, with the 'currentPlayerId' variable set to the specified PlayFabId parameter value. + bool ExecuteCloudScript(ServerModels::FExecuteCloudScriptServerRequest& request, const FExecuteCloudScriptDelegate& SuccessDelegate = FExecuteCloudScriptDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as + * GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. + * Request has no paramaters. + */ + + bool GetAllSegments(const FGetAllSegmentsDelegate& SuccessDelegate = FGetAllSegmentsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be + * evaluated with the parent PlayFabId to guarantee uniqueness. + * Returns a list of every character that currently belongs to a user. + */ + bool GetAllUsersCharacters(ServerModels::FListUsersCharactersRequest& request, const FGetAllUsersCharactersDelegate& SuccessDelegate = FGetAllUsersCharactersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the specified version of the title's catalog of virtual goods, including all defined properties + bool GetCatalogItems(ServerModels::FGetCatalogItemsRequest& request, const FGetCatalogItemsDelegate& SuccessDelegate = FGetCatalogItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetCharacterData(ServerModels::FGetCharacterDataRequest& request, const FGetCharacterDataDelegate& SuccessDelegate = FGetCharacterDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user's character which cannot be accessed by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetCharacterInternalData(ServerModels::FGetCharacterDataRequest& request, const FGetCharacterInternalDataDelegate& SuccessDelegate = FGetCharacterInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the specified character's current inventory of virtual goods + * All items currently in the character inventory will be returned, irrespective of how they were acquired (via purchasing, grants, coupons, etc.). Items that are expired, fully consumed, or are no longer valid are not considered to be in the user's current inventory, and so will not be not included. Also returns their virtual currency balances. + */ + bool GetCharacterInventory(ServerModels::FGetCharacterInventoryRequest& request, const FGetCharacterInventoryDelegate& SuccessDelegate = FGetCharacterInventoryDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard + bool GetCharacterLeaderboard(ServerModels::FGetCharacterLeaderboardRequest& request, const FGetCharacterLeaderboardDelegate& SuccessDelegate = FGetCharacterLeaderboardDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user's character which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom data will be returned. + */ + bool GetCharacterReadOnlyData(ServerModels::FGetCharacterDataRequest& request, const FGetCharacterReadOnlyDataDelegate& SuccessDelegate = FGetCharacterReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the details of all title-specific statistics for the specific character + * Character statistics are similar to user statistics in that they are numeric values which may only be updated by a server operation, in order to minimize the opportunity for unauthorized changes. In addition to being available for use by the title, the statistics are used for all leaderboard operations in PlayFab. + */ + bool GetCharacterStatistics(ServerModels::FGetCharacterStatisticsRequest& request, const FGetCharacterStatisticsDelegate& SuccessDelegate = FGetCharacterStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned + * URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the + * content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, + * the query to retrieve the data will fail. See this post for more information: + * https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service. Also, + * please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply. + */ + bool GetContentDownloadUrl(ServerModels::FGetContentDownloadUrlRequest& request, const FGetContentDownloadUrlDelegate& SuccessDelegate = FGetContentDownloadUrlDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves a list of ranked friends of the given player for the given statistic, starting from the indicated point in the + * leaderboard + */ + bool GetFriendLeaderboard(ServerModels::FGetFriendLeaderboardRequest& request, const FGetFriendLeaderboardDelegate& SuccessDelegate = FGetFriendLeaderboardDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the current friends for the user with PlayFabId, constrained to users who have PlayFab accounts. Friends from + * linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. + */ + bool GetFriendsList(ServerModels::FGetFriendsListRequest& request, const FGetFriendsListDelegate& SuccessDelegate = FGetFriendsListDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard + bool GetLeaderboard(ServerModels::FGetLeaderboardRequest& request, const FGetLeaderboardDelegate& SuccessDelegate = FGetLeaderboardDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked characters for the given statistic, centered on the requested user + bool GetLeaderboardAroundCharacter(ServerModels::FGetLeaderboardAroundCharacterRequest& request, const FGetLeaderboardAroundCharacterDelegate& SuccessDelegate = FGetLeaderboardAroundCharacterDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user + bool GetLeaderboardAroundUser(ServerModels::FGetLeaderboardAroundUserRequest& request, const FGetLeaderboardAroundUserDelegate& SuccessDelegate = FGetLeaderboardAroundUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves a list of all of the user's characters for the given statistic. + bool GetLeaderboardForUserCharacters(ServerModels::FGetLeaderboardForUsersCharactersRequest& request, const FGetLeaderboardForUserCharactersDelegate& SuccessDelegate = FGetLeaderboardForUserCharactersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be + * returned. All parameters default to false. + */ + bool GetPlayerCombinedInfo(ServerModels::FGetPlayerCombinedInfoRequest& request, const FGetPlayerCombinedInfoDelegate& SuccessDelegate = FGetPlayerCombinedInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the player's profile + * This API allows for access to details regarding a user in the PlayFab service, usually for purposes of customer support. Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool GetPlayerProfile(ServerModels::FGetPlayerProfileRequest& request, const FGetPlayerProfileDelegate& SuccessDelegate = FGetPlayerProfileDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // List all segments that a player currently belongs to at this moment in time. + bool GetPlayerSegments(ServerModels::FGetPlayersSegmentsRequest& request, const FGetPlayerSegmentsDelegate& SuccessDelegate = FGetPlayerSegmentsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match + * the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span + * on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected + * in the results. AB Test segments are currently not supported by this operation. + * Initial request must contain at least a Segment ID. Subsequent requests must contain the Segment ID as well as the Continuation Token. Failure to send the Continuation Token will result in a new player segment list being generated. Each time the Continuation Token is passed in the length of the Total Seconds to Live is refreshed. If too much time passes between requests to the point that a subsequent request is past the Total Seconds to Live an error will be returned and paging will be terminated. This API is resource intensive and should not be used in scenarios which might generate high request volumes. Only one request to this API at a time should be made per title. Concurrent requests to the API may be rejected with the APIConcurrentRequestLimitExceeded error. + */ + bool GetPlayersInSegment(ServerModels::FGetPlayersInSegmentRequest& request, const FGetPlayersInSegmentDelegate& SuccessDelegate = FGetPlayersInSegmentDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the current version and values for the indicated statistics, for the local player. + bool GetPlayerStatistics(ServerModels::FGetPlayerStatisticsRequest& request, const FGetPlayerStatisticsDelegate& SuccessDelegate = FGetPlayerStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the information on the available versions of the specified statistic. + bool GetPlayerStatisticVersions(ServerModels::FGetPlayerStatisticVersionsRequest& request, const FGetPlayerStatisticVersionsDelegate& SuccessDelegate = FGetPlayerStatisticVersionsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Get all tags with a given Namespace (optional) from a player profile. + * This API will return a list of canonical tags which includes both namespace and tag's name. If namespace is not provided, the result is a list of all canonical tags. TagName can be used for segmentation and Namespace is limited to 128 characters. + */ + bool GetPlayerTags(ServerModels::FGetPlayerTagsRequest& request, const FGetPlayerTagsDelegate& SuccessDelegate = FGetPlayerTagsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. + bool GetPlayFabIDsFromFacebookIDs(ServerModels::FGetPlayFabIDsFromFacebookIDsRequest& request, const FGetPlayFabIDsFromFacebookIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromFacebookIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the unique PlayFab identifiers for the given set of Facebook Instant Games identifiers. + bool GetPlayFabIDsFromFacebookInstantGamesIds(ServerModels::FGetPlayFabIDsFromFacebookInstantGamesIdsRequest& request, const FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate& SuccessDelegate = FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the unique PlayFab identifiers for the given set of Nintendo Switch Device identifiers. + bool GetPlayFabIDsFromNintendoSwitchDeviceIds(ServerModels::FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& request, const FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate& SuccessDelegate = FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile + * IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + bool GetPlayFabIDsFromSteamIDs(ServerModels::FGetPlayFabIDsFromSteamIDsRequest& request, const FGetPlayFabIDsFromSteamIDsDelegate& SuccessDelegate = FGetPlayFabIDsFromSteamIDsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom publisher settings + * This API is designed to return publisher-specific values which can be read, but not written to, by the client. This data is shared across all titles assigned to a particular publisher, and can be used for cross-game coordination. Only titles assigned to a publisher can use this API. For more information email devrel@playfab.com. Note that there may up to a minute delay in between updating title data and this API call returning the newest value. + */ + bool GetPublisherData(ServerModels::FGetPublisherDataRequest& request, const FGetPublisherDataDelegate& SuccessDelegate = FGetPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the configuration information for the specified random results tables for the title, including all ItemId + * values and weights + */ + bool GetRandomResultTables(ServerModels::FGetRandomResultTablesRequest& request, const FGetRandomResultTablesDelegate& SuccessDelegate = FGetRandomResultTablesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves data stored in a shared group object, as well as the list of members in the group. The server can access all + * public and private group data. Shared Groups are designed for sharing data between a very small number of players, + * please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool GetSharedGroupData(ServerModels::FGetSharedGroupDataRequest& request, const FGetSharedGroupDataDelegate& SuccessDelegate = FGetSharedGroupDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the current server time + * This query retrieves the current time from one of the servers in PlayFab. Please note that due to clock drift between servers, there is a potential variance of up to 5 seconds. + */ + + bool GetTime(const FGetTimeDelegate& SuccessDelegate = FGetTimeDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom title settings + * This API is designed to return title specific values which can be read, but not written to, by the client. For example, a developer could choose to store values which modify the user experience, such as enemy spawn rates, weapon strengths, movement speeds, etc. This allows a developer to update the title without the need to create, test, and ship a new build. Note that there may up to a minute delay in between updating title data and this API call returning the newest value. + */ + bool GetTitleData(ServerModels::FGetTitleDataRequest& request, const FGetTitleDataDelegate& SuccessDelegate = FGetTitleDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the key-value store of custom internal title settings + * This API is designed to return title specific values which are accessible only to the server. This can be used to tweak settings on game servers and Cloud Scripts without needed to update and re-deploy them. Note that there may up to a minute delay in between updating title data and this API call returning the newest value. + */ + bool GetTitleInternalData(ServerModels::FGetTitleDataRequest& request, const FGetTitleInternalDataDelegate& SuccessDelegate = FGetTitleInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Retrieves the title news feed, as configured in the developer portal + bool GetTitleNews(ServerModels::FGetTitleNewsRequest& request, const FGetTitleNewsDelegate& SuccessDelegate = FGetTitleNewsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the relevant details for a specified user + * This API allows for access to details regarding a user in the PlayFab service, usually for purposes of customer support. Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool GetUserAccountInfo(ServerModels::FGetUserAccountInfoRequest& request, const FGetUserAccountInfoDelegate& SuccessDelegate = FGetUserAccountInfoDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Gets all bans for a user. + * Get all bans for a user, including inactive and expired bans. + */ + bool GetUserBans(ServerModels::FGetUserBansRequest& request, const FGetUserBansDelegate& SuccessDelegate = FGetUserBansDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserData(ServerModels::FGetUserDataRequest& request, const FGetUserDataDelegate& SuccessDelegate = FGetUserDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which cannot be accessed by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserInternalData(ServerModels::FGetUserDataRequest& request, const FGetUserInternalDataDelegate& SuccessDelegate = FGetUserInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the specified user's current inventory of virtual goods + * All items currently in the user inventory will be returned, irrespective of how they were acquired (via purchasing, grants, coupons, etc.). Items that are expired, fully consumed, or are no longer valid are not considered to be in the user's current inventory, and so will not be not included. + */ + bool GetUserInventory(ServerModels::FGetUserInventoryRequest& request, const FGetUserInventoryDelegate& SuccessDelegate = FGetUserInventoryDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which is readable and writable by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherData(ServerModels::FGetUserDataRequest& request, const FGetUserPublisherDataDelegate& SuccessDelegate = FGetUserPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which cannot be accessed by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherInternalData(ServerModels::FGetUserDataRequest& request, const FGetUserPublisherInternalDataDelegate& SuccessDelegate = FGetUserPublisherInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the publisher-specific custom data for the user which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserPublisherReadOnlyData(ServerModels::FGetUserDataRequest& request, const FGetUserPublisherReadOnlyDataDelegate& SuccessDelegate = FGetUserPublisherReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Retrieves the title-specific custom data for the user which can only be read by the client + * Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom user data will be returned. + */ + bool GetUserReadOnlyData(ServerModels::FGetUserDataRequest& request, const FGetUserReadOnlyDataDelegate& SuccessDelegate = FGetUserReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated + * with the parent PlayFabId to guarantee uniqueness. + * Grants a character to the user of the type and name specified in the request. + */ + bool GrantCharacterToUser(ServerModels::FGrantCharacterToUserRequest& request, const FGrantCharacterToUserDelegate& SuccessDelegate = FGrantCharacterToUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the specified items to the specified character's inventory + * This function directly adds inventory items to the character's inventories. As a result of this operations, the user will not be charged any transaction fee, regardless of the inventory item catalog definition. Please note that the processing time for inventory grants and purchases increases fractionally the more items are in the inventory, and the more items are in the grant/purchase operation. + */ + bool GrantItemsToCharacter(ServerModels::FGrantItemsToCharacterRequest& request, const FGrantItemsToCharacterDelegate& SuccessDelegate = FGrantItemsToCharacterDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the specified items to the specified user's inventory + * This function directly adds inventory items to the user's inventories. As a result of this operations, the user will not be charged any transaction fee, regardless of the inventory item catalog definition. Please note that the processing time for inventory grants and purchases increases fractionally the more items are in the inventory, and the more items are in the grant/purchase operation. + */ + bool GrantItemsToUser(ServerModels::FGrantItemsToUserRequest& request, const FGrantItemsToUserDelegate& SuccessDelegate = FGrantItemsToUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the specified items to the specified user inventories + * This function directly adds inventory items to user inventories. As a result of this operations, the user will not be charged any transaction fee, regardless of the inventory item catalog definition. Please note that the processing time for inventory grants and purchases increases fractionally the more items are in the inventory, and the more items are in the grant/purchase operation. + */ + bool GrantItemsToUsers(ServerModels::FGrantItemsToUsersRequest& request, const FGrantItemsToUsersDelegate& SuccessDelegate = FGrantItemsToUsersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Modifies the number of remaining uses of a player's inventory item + * This function can both add and remove uses of an inventory item. If the number of uses drops below zero, the item will be removed from active inventory. + */ + bool ModifyItemUses(ServerModels::FModifyItemUsesRequest& request, const FModifyItemUsesDelegate& SuccessDelegate = FModifyItemUsesDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Moves an item from a character's inventory into another of the users's character's inventory. + * Transfers an item from a character to another character that is owned by the same user. This will remove the item from the character's inventory (until and unless it is moved back), and will enable the other character to make use of the item instead. + */ + bool MoveItemToCharacterFromCharacter(ServerModels::FMoveItemToCharacterFromCharacterRequest& request, const FMoveItemToCharacterFromCharacterDelegate& SuccessDelegate = FMoveItemToCharacterFromCharacterDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Moves an item from a user's inventory into their character's inventory. + * Transfers an item from a user to a character she owns. This will remove the item from the user's inventory (until and unless it is moved back), and will enable the character to make use of the item instead. + */ + bool MoveItemToCharacterFromUser(ServerModels::FMoveItemToCharacterFromUserRequest& request, const FMoveItemToCharacterFromUserDelegate& SuccessDelegate = FMoveItemToCharacterFromUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Moves an item from a character's inventory into the owning user's inventory. + * Transfers an item from a character to the owning user. This will remove the item from the character's inventory (until and unless it is moved back), and will enable the user to make use of the item instead. + */ + bool MoveItemToUserFromCharacter(ServerModels::FMoveItemToUserFromCharacterRequest& request, const FMoveItemToUserFromCharacterDelegate& SuccessDelegate = FMoveItemToUserFromCharacterDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Informs the PlayFab match-making service that the user specified has left the Game Server Instance + bool NotifyMatchmakerPlayerLeft(ServerModels::FNotifyMatchmakerPlayerLeftRequest& request, const FNotifyMatchmakerPlayerLeftDelegate& SuccessDelegate = FNotifyMatchmakerPlayerLeftDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the + * Economy->Catalogs tab in the PlayFab Game Manager. + * Coupon codes can be created for any item, or set of items, in the catalog for the title. This operation causes the coupon to be consumed, and the specific items to be awarded to the user. Attempting to re-use an already consumed code, or a code which has not yet been created in the service, will result in an error. + */ + bool RedeemCoupon(ServerModels::FRedeemCouponRequest& request, const FRedeemCouponDelegate& SuccessDelegate = FRedeemCouponDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Validates a Game Server session ticket and returns details about the user + * This function is used by a Game Server Instance to validate with the PlayFab service that a user has been registered as connected to the server. The Ticket is provided to the client either as a result of a call to StartGame or Matchmake, each of which return a Ticket specific to the Game Server Instance. This function will fail in any case where the Ticket presented is not valid for the specific Game Server Instance making the call. Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be taken in how this data is stored and managed. Since this call will always return the relevant information for users who have accessed the title, the recommendation is to not store this data locally. + */ + bool RedeemMatchmakerTicket(ServerModels::FRedeemMatchmakerTicketRequest& request, const FRedeemMatchmakerTicketDelegate& SuccessDelegate = FRedeemMatchmakerTicketDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Set the state of the indicated Game Server Instance. Also update the heartbeat for the instance. + bool RefreshGameServerInstanceHeartbeat(ServerModels::FRefreshGameServerInstanceHeartbeatRequest& request, const FRefreshGameServerInstanceHeartbeatDelegate& SuccessDelegate = FRefreshGameServerInstanceHeartbeatDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Inform the matchmaker that a new Game Server Instance is added. + bool RegisterGame(ServerModels::FRegisterGameRequest& request, const FRegisterGameDelegate& SuccessDelegate = FRegisterGameDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Removes the specified friend from the the user's friend list + bool RemoveFriend(ServerModels::FRemoveFriendRequest& request, const FRemoveFriendDelegate& SuccessDelegate = FRemoveFriendDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + * This API will trigger a player_tag_removed event and remove a tag with the given TagName and PlayFabID from the corresponding player profile. TagName can be used for segmentation and it is limited to 256 characters + */ + bool RemovePlayerTag(ServerModels::FRemovePlayerTagRequest& request, const FRemovePlayerTagDelegate& SuccessDelegate = FRemovePlayerTagDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the + * group can remove members. If as a result of the call, zero users remain with access, the group and its associated data + * will be deleted. Shared Groups are designed for sharing data between a very small number of players, please see our + * guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups + */ + bool RemoveSharedGroupMembers(ServerModels::FRemoveSharedGroupMembersRequest& request, const FRemoveSharedGroupMembersDelegate& SuccessDelegate = FRemoveSharedGroupMembersDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Submit a report about a player (due to bad bahavior, etc.) on behalf of another player, so that customer service + * representatives for the title can take action concerning potentially toxic players. + */ + bool ReportPlayer(ServerModels::FReportPlayerServerRequest& request, const FReportPlayerDelegate& SuccessDelegate = FReportPlayerDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revoke all active bans for a user. + * Setting the active state of all non-expired bans for a user to Inactive. Expired bans with an Active state will be ignored, however. Returns information about applied updates only. + */ + bool RevokeAllBansForUser(ServerModels::FRevokeAllBansForUserRequest& request, const FRevokeAllBansForUserDelegate& SuccessDelegate = FRevokeAllBansForUserDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revoke all active bans specified with BanId. + * Setting the active state of all bans requested to Inactive regardless of whether that ban has already expired. BanIds that do not exist will be skipped. Returns information about applied updates only. + */ + bool RevokeBans(ServerModels::FRevokeBansRequest& request, const FRevokeBansDelegate& SuccessDelegate = FRevokeBansDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revokes access to an item in a user's inventory + * In cases where the inventory item in question is a "crate", and the items it contained have already been dispensed, this will not revoke access or otherwise remove the items which were dispensed. + */ + bool RevokeInventoryItem(ServerModels::FRevokeInventoryItemRequest& request, const FRevokeInventoryItemDelegate& SuccessDelegate = FRevokeInventoryItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Revokes access for up to 25 items across multiple users and characters. + * In cases where the inventory item in question is a "crate", and the items it contained have already been dispensed, this will not revoke access or otherwise remove the items which were dispensed. + */ + bool RevokeInventoryItems(ServerModels::FRevokeInventoryItemsRequest& request, const FRevokeInventoryItemsDelegate& SuccessDelegate = FRevokeInventoryItemsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Forces an email to be sent to the registered contact email address for the user's account based on an account recovery + * email template + * PlayFab accounts which have valid email address or username will be able to receive a password reset email using this API.The email sent must be an account recovery email template. The username or email can be passed in to send the email + */ + bool SendCustomAccountRecoveryEmail(ServerModels::FSendCustomAccountRecoveryEmailRequest& request, const FSendCustomAccountRecoveryEmailDelegate& SuccessDelegate = FSendCustomAccountRecoveryEmailDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sends an email based on an email template to a player's contact email + * Sends an email for only players that have contact emails associated with them. Takes in an email template ID specifyingthe email template to send. + */ + bool SendEmailFromTemplate(ServerModels::FSendEmailFromTemplateRequest& request, const FSendEmailFromTemplateDelegate& SuccessDelegate = FSendEmailFromTemplateDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sends an iOS/Android Push Notification to a specific user, if that user's device has been configured for Push + * Notifications in PlayFab. If a user has linked both Android and iOS devices, both will be notified. + */ + bool SendPushNotification(ServerModels::FSendPushNotificationRequest& request, const FSendPushNotificationDelegate& SuccessDelegate = FSendPushNotificationDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the tag list for a specified user in the friend list of another user + * This operation is not additive. It will completely replace the tag list for the specified user. Please note that only users in the PlayFab friends list can be assigned tags. Attempting to set a tag on a friend only included in the friends list from a social site integration (such as Facebook or Steam) will return the AccountNotFound error. + */ + bool SetFriendTags(ServerModels::FSetFriendTagsRequest& request, const FSetFriendTagsDelegate& SuccessDelegate = FSetFriendTagsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Sets the custom data of the indicated Game Server Instance + bool SetGameServerInstanceData(ServerModels::FSetGameServerInstanceDataRequest& request, const FSetGameServerInstanceDataDelegate& SuccessDelegate = FSetGameServerInstanceDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Set the state of the indicated Game Server Instance. + bool SetGameServerInstanceState(ServerModels::FSetGameServerInstanceStateRequest& request, const FSetGameServerInstanceStateDelegate& SuccessDelegate = FSetGameServerInstanceStateDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Set custom tags for the specified Game Server Instance + bool SetGameServerInstanceTags(ServerModels::FSetGameServerInstanceTagsRequest& request, const FSetGameServerInstanceTagsDelegate& SuccessDelegate = FSetGameServerInstanceTagsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's + * secret use the Admin or Server API method SetPlayerSecret. + * APIs that require signatures require that the player have a configured Player Secret Key that is used to sign all requests. Players that don't have a secret will be blocked from making API calls until it is configured. To create a signature header add a SHA256 hashed string containing UTF8 encoded JSON body as it will be sent to the server, the current time in UTC formatted to ISO 8601, and the players secret formatted as 'body.date.secret'. Place the resulting hash into the header X-PlayFab-Signature, along with a header X-PlayFab-Timestamp of the same UTC timestamp used in the signature. + */ + bool SetPlayerSecret(ServerModels::FSetPlayerSecretRequest& request, const FSetPlayerSecretDelegate& SuccessDelegate = FSetPlayerSecretDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the key-value store of custom publisher settings + * This API is designed to store publisher-specific values which can be read, but not written to, by the client. This data is shared across all titles assigned to a particular publisher, and can be used for cross-game coordination. Only titles assigned to a publisher can use this API. This operation is additive. If a Key does not exist in the current dataset, it will be added with the specified Value. If it already exists, the Value for that key will be overwritten with the new Value. For more information email devrel@playfab.com + */ + bool SetPublisherData(ServerModels::FSetPublisherDataRequest& request, const FSetPublisherDataDelegate& SuccessDelegate = FSetPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the key-value store of custom title settings + * This API is designed to store title specific values which can be read, but not written to, by the client. For example, a developer could choose to store values which modify the user experience, such as enemy spawn rates, weapon strengths, movement speeds, etc. This allows a developer to update the title without the need to create, test, and ship a new build. This operation is additive. If a Key does not exist in the current dataset, it will be added with the specified Value. If it already exists, the Value for that key will be overwritten with the new Value. + */ + bool SetTitleData(ServerModels::FSetTitleDataRequest& request, const FSetTitleDataDelegate& SuccessDelegate = FSetTitleDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the key-value store of custom title settings + * This API is designed to store title specific values which are accessible only to the server. This can be used to tweak settings on game servers and Cloud Scripts without needed to update and re-deploy them. This operation is additive. If a Key does not exist in the current dataset, it will be added with the specified Value. If it already exists, the Value for that key will be overwritten with the new Value. + */ + bool SetTitleInternalData(ServerModels::FSetTitleDataRequest& request, const FSetTitleInternalDataDelegate& SuccessDelegate = FSetTitleInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Decrements the character's balance of the specified virtual currency by the stated amount. It is possible to make a VC + * balance negative with this API. + */ + bool SubtractCharacterVirtualCurrency(ServerModels::FSubtractCharacterVirtualCurrencyRequest& request, const FSubtractCharacterVirtualCurrencyDelegate& SuccessDelegate = FSubtractCharacterVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Decrements the user's balance of the specified virtual currency by the stated amount. It is possible to make a VC + * balance negative with this API. + */ + bool SubtractUserVirtualCurrency(ServerModels::FSubtractUserVirtualCurrencyRequest& request, const FSubtractUserVirtualCurrencyDelegate& SuccessDelegate = FSubtractUserVirtualCurrencyDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Opens a specific container (ContainerItemInstanceId), with a specific key (KeyItemInstanceId, when required), and + * returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > + * 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem. + * Specify the container and optionally the catalogVersion for the container to open + */ + bool UnlockContainerInstance(ServerModels::FUnlockContainerInstanceRequest& request, const FUnlockContainerInstanceDelegate& SuccessDelegate = FUnlockContainerInstanceDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Searches Player or Character inventory for any ItemInstance matching the given CatalogItemId, if necessary unlocks it + * using any appropriate key, and returns the contents of the opened container. If the container (and key when relevant) + * are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of + * ConsumeItem. + * Specify the type of container to open and optionally the catalogVersion for the container to open + */ + bool UnlockContainerItem(ServerModels::FUnlockContainerItemRequest& request, const FUnlockContainerItemDelegate& SuccessDelegate = FUnlockContainerItemDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + // Update the avatar URL of the specified player + bool UpdateAvatarUrl(ServerModels::FUpdateAvatarUrlRequest& request, const FUpdateAvatarUrlDelegate& SuccessDelegate = FUpdateAvatarUrlDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates information of a list of existing bans specified with Ban Ids. + * For each ban, only updates the values that are set. Leave any value to null for no change. If a ban could not be found, the rest are still applied. Returns information about applied updates only. + */ + bool UpdateBans(ServerModels::FUpdateBansRequest& request, const FUpdateBansDelegate& SuccessDelegate = FUpdateBansDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user's character which is readable and writable by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateCharacterData(ServerModels::FUpdateCharacterDataRequest& request, const FUpdateCharacterDataDelegate& SuccessDelegate = FUpdateCharacterDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user's character which cannot be accessed by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateCharacterInternalData(ServerModels::FUpdateCharacterDataRequest& request, const FUpdateCharacterInternalDataDelegate& SuccessDelegate = FUpdateCharacterInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user's character which can only be read by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateCharacterReadOnlyData(ServerModels::FUpdateCharacterDataRequest& request, const FUpdateCharacterReadOnlyDataDelegate& SuccessDelegate = FUpdateCharacterReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the values of the specified title-specific statistics for the specific character + * Character statistics are similar to user statistics in that they are numeric values which may only be updated by a server operation, in order to minimize the opportunity for unauthorized changes. In addition to being available for use by the title, the statistics are used for all leaderboard operations in PlayFab. + */ + bool UpdateCharacterStatistics(ServerModels::FUpdateCharacterStatisticsRequest& request, const FUpdateCharacterStatisticsDelegate& SuccessDelegate = FUpdateCharacterStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the values of the specified title-specific statistics for the user + * This operation is additive. Statistics not currently defined will be added, while those already defined will be updated with the given values. All other user statistics will remain unchanged. + */ + bool UpdatePlayerStatistics(ServerModels::FUpdatePlayerStatisticsRequest& request, const FUpdatePlayerStatisticsDelegate& SuccessDelegate = FUpdatePlayerStatisticsDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated + * or added in this call will be readable by users not in the group. By default, data permissions are set to Private. + * Regardless of the permission setting, only members of the group (and the server) can update the data. Shared Groups are + * designed for sharing data between a very small number of players, please see our guide: + * https://api.playfab.com/docs/tutorials/landing-players/shared-groups + * Note that in the case of multiple calls to write to the same shared group data keys, the last write received by the PlayFab service will determine the value available to subsequent read operations. For scenarios requiring coordination of data updates, it is recommended that titles make use of user data with read permission set to public, or a combination of user data and shared group data. + */ + bool UpdateSharedGroupData(ServerModels::FUpdateSharedGroupDataRequest& request, const FUpdateSharedGroupDataDelegate& SuccessDelegate = FUpdateSharedGroupDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user which is readable and writable by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserData(ServerModels::FUpdateUserDataRequest& request, const FUpdateUserDataDelegate& SuccessDelegate = FUpdateUserDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user which cannot be accessed by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserInternalData(ServerModels::FUpdateUserInternalDataRequest& request, const FUpdateUserInternalDataDelegate& SuccessDelegate = FUpdateUserInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the key-value pair data tagged to the specified item, which is read-only from the client. + * This function performs an additive update of the arbitrary JSON object containing the custom data for the item instance which belongs to the specified user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserInventoryItemCustomData(ServerModels::FUpdateUserInventoryItemDataRequest& request, const FUpdateUserInventoryItemCustomDataDelegate& SuccessDelegate = FUpdateUserInventoryItemCustomDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the publisher-specific custom data for the user which is readable and writable by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, while keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserPublisherData(ServerModels::FUpdateUserDataRequest& request, const FUpdateUserPublisherDataDelegate& SuccessDelegate = FUpdateUserPublisherDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the publisher-specific custom data for the user which cannot be accessed by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserPublisherInternalData(ServerModels::FUpdateUserInternalDataRequest& request, const FUpdateUserPublisherInternalDataDelegate& SuccessDelegate = FUpdateUserPublisherInternalDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the publisher-specific custom data for the user which can only be read by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserPublisherReadOnlyData(ServerModels::FUpdateUserDataRequest& request, const FUpdateUserPublisherReadOnlyDataDelegate& SuccessDelegate = FUpdateUserPublisherReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Updates the title-specific custom data for the user which can only be read by the client + * This function performs an additive update of the arbitrary JSON object containing the custom data for the user. In updating the custom data object, keys which already exist in the object will have their values overwritten, keys with null values will be removed. No other key-value pairs will be changed apart from those specified in the call. + */ + bool UpdateUserReadOnlyData(ServerModels::FUpdateUserDataRequest& request, const FUpdateUserReadOnlyDataDelegate& SuccessDelegate = FUpdateUserReadOnlyDataDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Writes a character-based event into PlayStream. + * This API is designed to write a multitude of different event types into PlayStream. It supports a flexible JSON schema, which allowsfor arbitrary key-value pairs to describe any character-based event. The created event will be locked to the authenticated title. + */ + bool WriteCharacterEvent(ServerModels::FWriteServerCharacterEventRequest& request, const FWriteCharacterEventDelegate& SuccessDelegate = FWriteCharacterEventDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Writes a player-based event into PlayStream. + * This API is designed to write a multitude of different event types into PlayStream. It supports a flexible JSON schema, which allowsfor arbitrary key-value pairs to describe any player-based event. The created event will be locked to the authenticated title. + */ + bool WritePlayerEvent(ServerModels::FWriteServerPlayerEventRequest& request, const FWritePlayerEventDelegate& SuccessDelegate = FWritePlayerEventDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + /** + * Writes a title-based event into PlayStream. + * This API is designed to write a multitude of different event types into PlayStream. It supports a flexible JSON schema, which allowsfor arbitrary key-value pairs to describe any title-based event. The created event will be locked to the authenticated title. + */ + bool WriteTitleEvent(ServerModels::FWriteTitleEventRequest& request, const FWriteTitleEventDelegate& SuccessDelegate = FWriteTitleEventDelegate(), const FPlayFabErrorDelegate& ErrorDelegate = FPlayFabErrorDelegate()); + + private: + // ------------ Generated result handlers + void OnAddCharacterVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddCharacterVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddPlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddPlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAddUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAuthenticateSessionTicketResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAuthenticateSessionTicketDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnAwardSteamAchievementResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAwardSteamAchievementDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnBanUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FBanUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnConsumeItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FConsumeItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnCreateSharedGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateSharedGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteCharacterFromUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteCharacterFromUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteSharedGroupResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteSharedGroupDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeleteUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnDeregisterGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeregisterGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnEvaluateRandomResultTableResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FEvaluateRandomResultTableDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnExecuteCloudScriptResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FExecuteCloudScriptDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetAllSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetAllUsersCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetAllUsersCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCatalogItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCatalogItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetContentDownloadUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetContentDownloadUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetFriendLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetFriendsListResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetFriendsListDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardAroundCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardAroundUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardAroundUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetLeaderboardForUserCharactersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLeaderboardForUserCharactersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerCombinedInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerCombinedInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerProfileResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerProfileDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerSegmentsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerSegmentsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayersInSegmentResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayersInSegmentDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerStatisticVersionsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerStatisticVersionsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayerTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayerTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromFacebookIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromFacebookInstantGamesIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromFacebookInstantGamesIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromNintendoSwitchDeviceIdsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPlayFabIDsFromSteamIDsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPlayFabIDsFromSteamIDsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetRandomResultTablesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetRandomResultTablesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTimeResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTimeDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetTitleNewsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTitleNewsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserAccountInfoResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserAccountInfoDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserInventoryResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInventoryDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGetUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGrantCharacterToUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantCharacterToUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGrantItemsToCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGrantItemsToUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnGrantItemsToUsersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGrantItemsToUsersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnModifyItemUsesResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FModifyItemUsesDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnMoveItemToCharacterFromCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveItemToCharacterFromCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnMoveItemToCharacterFromUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveItemToCharacterFromUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnMoveItemToUserFromCharacterResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveItemToUserFromCharacterDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnNotifyMatchmakerPlayerLeftResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FNotifyMatchmakerPlayerLeftDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRedeemCouponResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRedeemCouponDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRedeemMatchmakerTicketResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRedeemMatchmakerTicketDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRefreshGameServerInstanceHeartbeatResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefreshGameServerInstanceHeartbeatDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRegisterGameResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRegisterGameDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveFriendResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveFriendDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemovePlayerTagResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemovePlayerTagDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRemoveSharedGroupMembersResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRemoveSharedGroupMembersDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnReportPlayerResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FReportPlayerDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeAllBansForUserResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeAllBansForUserDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeInventoryItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnRevokeInventoryItemsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRevokeInventoryItemsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSendCustomAccountRecoveryEmailResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendCustomAccountRecoveryEmailDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSendEmailFromTemplateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendEmailFromTemplateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSendPushNotificationResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSendPushNotificationDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetFriendTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetFriendTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetGameServerInstanceDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGameServerInstanceDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetGameServerInstanceStateResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGameServerInstanceStateDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetGameServerInstanceTagsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetGameServerInstanceTagsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetPlayerSecretResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPlayerSecretDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetTitleDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSetTitleInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSetTitleInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSubtractCharacterVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractCharacterVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnSubtractUserVirtualCurrencyResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSubtractUserVirtualCurrencyDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlockContainerInstanceResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerInstanceDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUnlockContainerItemResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUnlockContainerItemDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateAvatarUrlResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateAvatarUrlDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateBansResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateBansDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCharacterDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCharacterInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCharacterReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateCharacterStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateCharacterStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdatePlayerStatisticsResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePlayerStatisticsDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateSharedGroupDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateSharedGroupDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserInventoryItemCustomDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserInventoryItemCustomDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherInternalDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherInternalDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserPublisherReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserPublisherReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnUpdateUserReadOnlyDataResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserReadOnlyDataDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnWriteCharacterEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteCharacterEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnWritePlayerEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWritePlayerEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + void OnWriteTitleEventResult(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FWriteTitleEventDelegate SuccessDelegate, FPlayFabErrorDelegate ErrorDelegate); + + }; +}; diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabServerDataModels.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabServerDataModels.h new file mode 100644 index 000000000..08ff0b47a --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabServerDataModels.h @@ -0,0 +1,10021 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +// This is automatically generated by PlayFab SDKGenerator. DO NOT modify this manually! +#pragma once + +#include "CoreMinimal.h" +#include "Core/PlayFabBaseModel.h" + +namespace PlayFab +{ +namespace ServerModels +{ + + struct PLAYFABCPP_API FAdCampaignAttribution : public FPlayFabBaseModel + { + // UTC time stamp of attribution + FDateTime AttributedAt; + + // [optional] Attribution campaign identifier + FString CampaignId; + + // [optional] Attribution network name + FString Platform; + + FAdCampaignAttribution() : + FPlayFabBaseModel(), + AttributedAt(0), + CampaignId(), + Platform() + {} + + FAdCampaignAttribution(const FAdCampaignAttribution& src) : + FPlayFabBaseModel(), + AttributedAt(src.AttributedAt), + CampaignId(src.CampaignId), + Platform(src.Platform) + {} + + FAdCampaignAttribution(const TSharedPtr& obj) : FAdCampaignAttribution() + { + readFromValue(obj); + } + + ~FAdCampaignAttribution(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAdCampaignAttributionModel : public FPlayFabBaseModel + { + // UTC time stamp of attribution + FDateTime AttributedAt; + + // [optional] Attribution campaign identifier + FString CampaignId; + + // [optional] Attribution network name + FString Platform; + + FAdCampaignAttributionModel() : + FPlayFabBaseModel(), + AttributedAt(0), + CampaignId(), + Platform() + {} + + FAdCampaignAttributionModel(const FAdCampaignAttributionModel& src) : + FPlayFabBaseModel(), + AttributedAt(src.AttributedAt), + CampaignId(src.CampaignId), + Platform(src.Platform) + {} + + FAdCampaignAttributionModel(const TSharedPtr& obj) : FAdCampaignAttributionModel() + { + readFromValue(obj); + } + + ~FAdCampaignAttributionModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddCharacterVirtualCurrencyRequest : public FPlayFabBaseModel + { + /** + * Amount to be added to the character balance of the specified virtual currency. Maximum VC balance is Int32 + * (2,147,483,647). Any increase over this value will be discarded. + */ + int32 Amount; + + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // PlayFab unique identifier of the user whose virtual currency balance is to be incremented. + FString PlayFabId; + + // Name of the virtual currency which is to be incremented. + FString VirtualCurrency; + + FAddCharacterVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + CharacterId(), + PlayFabId(), + VirtualCurrency() + {} + + FAddCharacterVirtualCurrencyRequest(const FAddCharacterVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + CharacterId(src.CharacterId), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FAddCharacterVirtualCurrencyRequest(const TSharedPtr& obj) : FAddCharacterVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FAddCharacterVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddFriendRequest : public FPlayFabBaseModel + { + // [optional] Email address of the user being added. + FString FriendEmail; + + // [optional] The PlayFab identifier of the user being added. + FString FriendPlayFabId; + + // [optional] Title-specific display name of the user to being added. + FString FriendTitleDisplayName; + + // [optional] The PlayFab username of the user being added + FString FriendUsername; + + // PlayFab identifier of the player to add a new friend. + FString PlayFabId; + + FAddFriendRequest() : + FPlayFabBaseModel(), + FriendEmail(), + FriendPlayFabId(), + FriendTitleDisplayName(), + FriendUsername(), + PlayFabId() + {} + + FAddFriendRequest(const FAddFriendRequest& src) : + FPlayFabBaseModel(), + FriendEmail(src.FriendEmail), + FriendPlayFabId(src.FriendPlayFabId), + FriendTitleDisplayName(src.FriendTitleDisplayName), + FriendUsername(src.FriendUsername), + PlayFabId(src.PlayFabId) + {} + + FAddFriendRequest(const TSharedPtr& obj) : FAddFriendRequest() + { + readFromValue(obj); + } + + ~FAddFriendRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddPlayerTagRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique tag for player profile. + FString TagName; + + FAddPlayerTagRequest() : + FPlayFabBaseModel(), + PlayFabId(), + TagName() + {} + + FAddPlayerTagRequest(const FAddPlayerTagRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + TagName(src.TagName) + {} + + FAddPlayerTagRequest(const TSharedPtr& obj) : FAddPlayerTagRequest() + { + readFromValue(obj); + } + + ~FAddPlayerTagRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddPlayerTagResult : public FPlayFabBaseModel + { + FAddPlayerTagResult() : + FPlayFabBaseModel() + {} + + FAddPlayerTagResult(const FAddPlayerTagResult& src) : + FPlayFabBaseModel() + {} + + FAddPlayerTagResult(const TSharedPtr& obj) : FAddPlayerTagResult() + { + readFromValue(obj); + } + + ~FAddPlayerTagResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddSharedGroupMembersRequest : public FPlayFabBaseModel + { + // An array of unique PlayFab assigned ID of the user on whom the operation will be performed. + TArray PlayFabIds; + // Unique identifier for the shared group. + FString SharedGroupId; + + FAddSharedGroupMembersRequest() : + FPlayFabBaseModel(), + PlayFabIds(), + SharedGroupId() + {} + + FAddSharedGroupMembersRequest(const FAddSharedGroupMembersRequest& src) : + FPlayFabBaseModel(), + PlayFabIds(src.PlayFabIds), + SharedGroupId(src.SharedGroupId) + {} + + FAddSharedGroupMembersRequest(const TSharedPtr& obj) : FAddSharedGroupMembersRequest() + { + readFromValue(obj); + } + + ~FAddSharedGroupMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddSharedGroupMembersResult : public FPlayFabBaseModel + { + FAddSharedGroupMembersResult() : + FPlayFabBaseModel() + {} + + FAddSharedGroupMembersResult(const FAddSharedGroupMembersResult& src) : + FPlayFabBaseModel() + {} + + FAddSharedGroupMembersResult(const TSharedPtr& obj) : FAddSharedGroupMembersResult() + { + readFromValue(obj); + } + + ~FAddSharedGroupMembersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAddUserVirtualCurrencyRequest : public FPlayFabBaseModel + { + /** + * Amount to be added to the user balance of the specified virtual currency. Maximum VC balance is Int32 (2,147,483,647). + * Any increase over this value will be discarded. + */ + int32 Amount; + + // PlayFab unique identifier of the user whose virtual currency balance is to be increased. + FString PlayFabId; + + // Name of the virtual currency which is to be incremented. + FString VirtualCurrency; + + FAddUserVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + PlayFabId(), + VirtualCurrency() + {} + + FAddUserVirtualCurrencyRequest(const FAddUserVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FAddUserVirtualCurrencyRequest(const TSharedPtr& obj) : FAddUserVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FAddUserVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum PushNotificationPlatform + { + PushNotificationPlatformApplePushNotificationService, + PushNotificationPlatformGoogleCloudMessaging + }; + + PLAYFABCPP_API void writePushNotificationPlatformEnumJSON(PushNotificationPlatform enumVal, JsonWriter& writer); + PLAYFABCPP_API PushNotificationPlatform readPushNotificationPlatformFromValue(const TSharedPtr& value); + PLAYFABCPP_API PushNotificationPlatform readPushNotificationPlatformFromValue(const FString& value); + + struct PLAYFABCPP_API FAdvancedPushPlatformMsg : public FPlayFabBaseModel + { + // The Json the platform should receive. + FString Json; + + // The platform that should receive the Json. + PushNotificationPlatform Platform; + + FAdvancedPushPlatformMsg() : + FPlayFabBaseModel(), + Json(), + Platform() + {} + + FAdvancedPushPlatformMsg(const FAdvancedPushPlatformMsg& src) : + FPlayFabBaseModel(), + Json(src.Json), + Platform(src.Platform) + {} + + FAdvancedPushPlatformMsg(const TSharedPtr& obj) : FAdvancedPushPlatformMsg() + { + readFromValue(obj); + } + + ~FAdvancedPushPlatformMsg(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAuthenticateSessionTicketRequest : public FPlayFabBaseModel + { + // Session ticket as issued by a PlayFab client login API. + FString SessionTicket; + + FAuthenticateSessionTicketRequest() : + FPlayFabBaseModel(), + SessionTicket() + {} + + FAuthenticateSessionTicketRequest(const FAuthenticateSessionTicketRequest& src) : + FPlayFabBaseModel(), + SessionTicket(src.SessionTicket) + {} + + FAuthenticateSessionTicketRequest(const TSharedPtr& obj) : FAuthenticateSessionTicketRequest() + { + readFromValue(obj); + } + + ~FAuthenticateSessionTicketRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserAndroidDeviceInfo : public FPlayFabBaseModel + { + // [optional] Android device ID + FString AndroidDeviceId; + + FUserAndroidDeviceInfo() : + FPlayFabBaseModel(), + AndroidDeviceId() + {} + + FUserAndroidDeviceInfo(const FUserAndroidDeviceInfo& src) : + FPlayFabBaseModel(), + AndroidDeviceId(src.AndroidDeviceId) + {} + + FUserAndroidDeviceInfo(const TSharedPtr& obj) : FUserAndroidDeviceInfo() + { + readFromValue(obj); + } + + ~FUserAndroidDeviceInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserCustomIdInfo : public FPlayFabBaseModel + { + // [optional] Custom ID + FString CustomId; + + FUserCustomIdInfo() : + FPlayFabBaseModel(), + CustomId() + {} + + FUserCustomIdInfo(const FUserCustomIdInfo& src) : + FPlayFabBaseModel(), + CustomId(src.CustomId) + {} + + FUserCustomIdInfo(const TSharedPtr& obj) : FUserCustomIdInfo() + { + readFromValue(obj); + } + + ~FUserCustomIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserFacebookInfo : public FPlayFabBaseModel + { + // [optional] Facebook identifier + FString FacebookId; + + // [optional] Facebook full name + FString FullName; + + FUserFacebookInfo() : + FPlayFabBaseModel(), + FacebookId(), + FullName() + {} + + FUserFacebookInfo(const FUserFacebookInfo& src) : + FPlayFabBaseModel(), + FacebookId(src.FacebookId), + FullName(src.FullName) + {} + + FUserFacebookInfo(const TSharedPtr& obj) : FUserFacebookInfo() + { + readFromValue(obj); + } + + ~FUserFacebookInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserFacebookInstantGamesIdInfo : public FPlayFabBaseModel + { + // [optional] Facebook Instant Games ID + FString FacebookInstantGamesId; + + FUserFacebookInstantGamesIdInfo() : + FPlayFabBaseModel(), + FacebookInstantGamesId() + {} + + FUserFacebookInstantGamesIdInfo(const FUserFacebookInstantGamesIdInfo& src) : + FPlayFabBaseModel(), + FacebookInstantGamesId(src.FacebookInstantGamesId) + {} + + FUserFacebookInstantGamesIdInfo(const TSharedPtr& obj) : FUserFacebookInstantGamesIdInfo() + { + readFromValue(obj); + } + + ~FUserFacebookInstantGamesIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserGameCenterInfo : public FPlayFabBaseModel + { + // [optional] Gamecenter identifier + FString GameCenterId; + + FUserGameCenterInfo() : + FPlayFabBaseModel(), + GameCenterId() + {} + + FUserGameCenterInfo(const FUserGameCenterInfo& src) : + FPlayFabBaseModel(), + GameCenterId(src.GameCenterId) + {} + + FUserGameCenterInfo(const TSharedPtr& obj) : FUserGameCenterInfo() + { + readFromValue(obj); + } + + ~FUserGameCenterInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserGoogleInfo : public FPlayFabBaseModel + { + // [optional] Email address of the Google account + FString GoogleEmail; + + // [optional] Gender information of the Google account + FString GoogleGender; + + // [optional] Google ID + FString GoogleId; + + // [optional] Locale of the Google account + FString GoogleLocale; + + FUserGoogleInfo() : + FPlayFabBaseModel(), + GoogleEmail(), + GoogleGender(), + GoogleId(), + GoogleLocale() + {} + + FUserGoogleInfo(const FUserGoogleInfo& src) : + FPlayFabBaseModel(), + GoogleEmail(src.GoogleEmail), + GoogleGender(src.GoogleGender), + GoogleId(src.GoogleId), + GoogleLocale(src.GoogleLocale) + {} + + FUserGoogleInfo(const TSharedPtr& obj) : FUserGoogleInfo() + { + readFromValue(obj); + } + + ~FUserGoogleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserIosDeviceInfo : public FPlayFabBaseModel + { + // [optional] iOS device ID + FString IosDeviceId; + + FUserIosDeviceInfo() : + FPlayFabBaseModel(), + IosDeviceId() + {} + + FUserIosDeviceInfo(const FUserIosDeviceInfo& src) : + FPlayFabBaseModel(), + IosDeviceId(src.IosDeviceId) + {} + + FUserIosDeviceInfo(const TSharedPtr& obj) : FUserIosDeviceInfo() + { + readFromValue(obj); + } + + ~FUserIosDeviceInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserKongregateInfo : public FPlayFabBaseModel + { + // [optional] Kongregate ID + FString KongregateId; + + // [optional] Kongregate Username + FString KongregateName; + + FUserKongregateInfo() : + FPlayFabBaseModel(), + KongregateId(), + KongregateName() + {} + + FUserKongregateInfo(const FUserKongregateInfo& src) : + FPlayFabBaseModel(), + KongregateId(src.KongregateId), + KongregateName(src.KongregateName) + {} + + FUserKongregateInfo(const TSharedPtr& obj) : FUserKongregateInfo() + { + readFromValue(obj); + } + + ~FUserKongregateInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserNintendoSwitchDeviceIdInfo : public FPlayFabBaseModel + { + // [optional] Nintendo Switch Device ID + FString NintendoSwitchDeviceId; + + FUserNintendoSwitchDeviceIdInfo() : + FPlayFabBaseModel(), + NintendoSwitchDeviceId() + {} + + FUserNintendoSwitchDeviceIdInfo(const FUserNintendoSwitchDeviceIdInfo& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId) + {} + + FUserNintendoSwitchDeviceIdInfo(const TSharedPtr& obj) : FUserNintendoSwitchDeviceIdInfo() + { + readFromValue(obj); + } + + ~FUserNintendoSwitchDeviceIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserOpenIdInfo : public FPlayFabBaseModel + { + // [optional] OpenID Connection ID + FString ConnectionId; + + // [optional] OpenID Issuer + FString Issuer; + + // [optional] OpenID Subject + FString Subject; + + FUserOpenIdInfo() : + FPlayFabBaseModel(), + ConnectionId(), + Issuer(), + Subject() + {} + + FUserOpenIdInfo(const FUserOpenIdInfo& src) : + FPlayFabBaseModel(), + ConnectionId(src.ConnectionId), + Issuer(src.Issuer), + Subject(src.Subject) + {} + + FUserOpenIdInfo(const TSharedPtr& obj) : FUserOpenIdInfo() + { + readFromValue(obj); + } + + ~FUserOpenIdInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserPrivateAccountInfo : public FPlayFabBaseModel + { + // [optional] user email address + FString Email; + + FUserPrivateAccountInfo() : + FPlayFabBaseModel(), + Email() + {} + + FUserPrivateAccountInfo(const FUserPrivateAccountInfo& src) : + FPlayFabBaseModel(), + Email(src.Email) + {} + + FUserPrivateAccountInfo(const TSharedPtr& obj) : FUserPrivateAccountInfo() + { + readFromValue(obj); + } + + ~FUserPrivateAccountInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserPsnInfo : public FPlayFabBaseModel + { + // [optional] PSN account ID + FString PsnAccountId; + + // [optional] PSN online ID + FString PsnOnlineId; + + FUserPsnInfo() : + FPlayFabBaseModel(), + PsnAccountId(), + PsnOnlineId() + {} + + FUserPsnInfo(const FUserPsnInfo& src) : + FPlayFabBaseModel(), + PsnAccountId(src.PsnAccountId), + PsnOnlineId(src.PsnOnlineId) + {} + + FUserPsnInfo(const TSharedPtr& obj) : FUserPsnInfo() + { + readFromValue(obj); + } + + ~FUserPsnInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum TitleActivationStatus + { + TitleActivationStatusNone, + TitleActivationStatusActivatedTitleKey, + TitleActivationStatusPendingSteam, + TitleActivationStatusActivatedSteam, + TitleActivationStatusRevokedSteam + }; + + PLAYFABCPP_API void writeTitleActivationStatusEnumJSON(TitleActivationStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API TitleActivationStatus readTitleActivationStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API TitleActivationStatus readTitleActivationStatusFromValue(const FString& value); + + enum Currency + { + CurrencyAED, + CurrencyAFN, + CurrencyALL, + CurrencyAMD, + CurrencyANG, + CurrencyAOA, + CurrencyARS, + CurrencyAUD, + CurrencyAWG, + CurrencyAZN, + CurrencyBAM, + CurrencyBBD, + CurrencyBDT, + CurrencyBGN, + CurrencyBHD, + CurrencyBIF, + CurrencyBMD, + CurrencyBND, + CurrencyBOB, + CurrencyBRL, + CurrencyBSD, + CurrencyBTN, + CurrencyBWP, + CurrencyBYR, + CurrencyBZD, + CurrencyCAD, + CurrencyCDF, + CurrencyCHF, + CurrencyCLP, + CurrencyCNY, + CurrencyCOP, + CurrencyCRC, + CurrencyCUC, + CurrencyCUP, + CurrencyCVE, + CurrencyCZK, + CurrencyDJF, + CurrencyDKK, + CurrencyDOP, + CurrencyDZD, + CurrencyEGP, + CurrencyERN, + CurrencyETB, + CurrencyEUR, + CurrencyFJD, + CurrencyFKP, + CurrencyGBP, + CurrencyGEL, + CurrencyGGP, + CurrencyGHS, + CurrencyGIP, + CurrencyGMD, + CurrencyGNF, + CurrencyGTQ, + CurrencyGYD, + CurrencyHKD, + CurrencyHNL, + CurrencyHRK, + CurrencyHTG, + CurrencyHUF, + CurrencyIDR, + CurrencyILS, + CurrencyIMP, + CurrencyINR, + CurrencyIQD, + CurrencyIRR, + CurrencyISK, + CurrencyJEP, + CurrencyJMD, + CurrencyJOD, + CurrencyJPY, + CurrencyKES, + CurrencyKGS, + CurrencyKHR, + CurrencyKMF, + CurrencyKPW, + CurrencyKRW, + CurrencyKWD, + CurrencyKYD, + CurrencyKZT, + CurrencyLAK, + CurrencyLBP, + CurrencyLKR, + CurrencyLRD, + CurrencyLSL, + CurrencyLYD, + CurrencyMAD, + CurrencyMDL, + CurrencyMGA, + CurrencyMKD, + CurrencyMMK, + CurrencyMNT, + CurrencyMOP, + CurrencyMRO, + CurrencyMUR, + CurrencyMVR, + CurrencyMWK, + CurrencyMXN, + CurrencyMYR, + CurrencyMZN, + CurrencyNAD, + CurrencyNGN, + CurrencyNIO, + CurrencyNOK, + CurrencyNPR, + CurrencyNZD, + CurrencyOMR, + CurrencyPAB, + CurrencyPEN, + CurrencyPGK, + CurrencyPHP, + CurrencyPKR, + CurrencyPLN, + CurrencyPYG, + CurrencyQAR, + CurrencyRON, + CurrencyRSD, + CurrencyRUB, + CurrencyRWF, + CurrencySAR, + CurrencySBD, + CurrencySCR, + CurrencySDG, + CurrencySEK, + CurrencySGD, + CurrencySHP, + CurrencySLL, + CurrencySOS, + CurrencySPL, + CurrencySRD, + CurrencySTD, + CurrencySVC, + CurrencySYP, + CurrencySZL, + CurrencyTHB, + CurrencyTJS, + CurrencyTMT, + CurrencyTND, + CurrencyTOP, + CurrencyTRY, + CurrencyTTD, + CurrencyTVD, + CurrencyTWD, + CurrencyTZS, + CurrencyUAH, + CurrencyUGX, + CurrencyUSD, + CurrencyUYU, + CurrencyUZS, + CurrencyVEF, + CurrencyVND, + CurrencyVUV, + CurrencyWST, + CurrencyXAF, + CurrencyXCD, + CurrencyXDR, + CurrencyXOF, + CurrencyXPF, + CurrencyYER, + CurrencyZAR, + CurrencyZMW, + CurrencyZWD + }; + + PLAYFABCPP_API void writeCurrencyEnumJSON(Currency enumVal, JsonWriter& writer); + PLAYFABCPP_API Currency readCurrencyFromValue(const TSharedPtr& value); + PLAYFABCPP_API Currency readCurrencyFromValue(const FString& value); + + struct PLAYFABCPP_API FUserSteamInfo : public FPlayFabBaseModel + { + // [optional] what stage of game ownership the user is listed as being in, from Steam + Boxed SteamActivationStatus; + + // [optional] the country in which the player resides, from Steam data + FString SteamCountry; + + // [optional] currency type set in the user Steam account + Boxed SteamCurrency; + + // [optional] Steam identifier + FString SteamId; + + FUserSteamInfo() : + FPlayFabBaseModel(), + SteamActivationStatus(), + SteamCountry(), + SteamCurrency(), + SteamId() + {} + + FUserSteamInfo(const FUserSteamInfo& src) : + FPlayFabBaseModel(), + SteamActivationStatus(src.SteamActivationStatus), + SteamCountry(src.SteamCountry), + SteamCurrency(src.SteamCurrency), + SteamId(src.SteamId) + {} + + FUserSteamInfo(const TSharedPtr& obj) : FUserSteamInfo() + { + readFromValue(obj); + } + + ~FUserSteamInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum UserOrigination + { + UserOriginationOrganic, + UserOriginationSteam, + UserOriginationGoogle, + UserOriginationAmazon, + UserOriginationFacebook, + UserOriginationKongregate, + UserOriginationGamersFirst, + UserOriginationUnknown, + UserOriginationIOS, + UserOriginationLoadTest, + UserOriginationAndroid, + UserOriginationPSN, + UserOriginationGameCenter, + UserOriginationCustomId, + UserOriginationXboxLive, + UserOriginationParse, + UserOriginationTwitch, + UserOriginationWindowsHello, + UserOriginationServerCustomId, + UserOriginationNintendoSwitchDeviceId, + UserOriginationFacebookInstantGamesId, + UserOriginationOpenIdConnect + }; + + PLAYFABCPP_API void writeUserOriginationEnumJSON(UserOrigination enumVal, JsonWriter& writer); + PLAYFABCPP_API UserOrigination readUserOriginationFromValue(const TSharedPtr& value); + PLAYFABCPP_API UserOrigination readUserOriginationFromValue(const FString& value); + + struct PLAYFABCPP_API FEntityKey : public FPlayFabBaseModel + { + // Unique ID of the entity. + FString Id; + + // [optional] Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes + FString Type; + + FEntityKey() : + FPlayFabBaseModel(), + Id(), + Type() + {} + + FEntityKey(const FEntityKey& src) : + FPlayFabBaseModel(), + Id(src.Id), + Type(src.Type) + {} + + FEntityKey(const TSharedPtr& obj) : FEntityKey() + { + readFromValue(obj); + } + + ~FEntityKey(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserTitleInfo : public FPlayFabBaseModel + { + // [optional] URL to the player's avatar. + FString AvatarUrl; + + /** + * timestamp indicating when the user was first associated with this game (this can differ significantly from when the user + * first registered with PlayFab) + */ + FDateTime Created; + + // [optional] name of the user, as it is displayed in-game + FString DisplayName; + + /** + * [optional] timestamp indicating when the user first signed into this game (this can differ from the Created timestamp, as other + * events, such as issuing a beta key to the user, can associate the title to the user) + */ + Boxed FirstLogin; + + // [optional] boolean indicating whether or not the user is currently banned for a title + Boxed isBanned; + + // [optional] timestamp for the last user login for this title + Boxed LastLogin; + + // [optional] source by which the user first joined the game, if known + Boxed Origination; + + // [optional] Title player account entity for this user + TSharedPtr TitlePlayerAccount; + + FUserTitleInfo() : + FPlayFabBaseModel(), + AvatarUrl(), + Created(0), + DisplayName(), + FirstLogin(), + isBanned(), + LastLogin(), + Origination(), + TitlePlayerAccount(nullptr) + {} + + FUserTitleInfo(const FUserTitleInfo& src) : + FPlayFabBaseModel(), + AvatarUrl(src.AvatarUrl), + Created(src.Created), + DisplayName(src.DisplayName), + FirstLogin(src.FirstLogin), + isBanned(src.isBanned), + LastLogin(src.LastLogin), + Origination(src.Origination), + TitlePlayerAccount(src.TitlePlayerAccount.IsValid() ? MakeShareable(new FEntityKey(*src.TitlePlayerAccount)) : nullptr) + {} + + FUserTitleInfo(const TSharedPtr& obj) : FUserTitleInfo() + { + readFromValue(obj); + } + + ~FUserTitleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserTwitchInfo : public FPlayFabBaseModel + { + // [optional] Twitch ID + FString TwitchId; + + // [optional] Twitch Username + FString TwitchUserName; + + FUserTwitchInfo() : + FPlayFabBaseModel(), + TwitchId(), + TwitchUserName() + {} + + FUserTwitchInfo(const FUserTwitchInfo& src) : + FPlayFabBaseModel(), + TwitchId(src.TwitchId), + TwitchUserName(src.TwitchUserName) + {} + + FUserTwitchInfo(const TSharedPtr& obj) : FUserTwitchInfo() + { + readFromValue(obj); + } + + ~FUserTwitchInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserWindowsHelloInfo : public FPlayFabBaseModel + { + // [optional] Windows Hello Device Name + FString WindowsHelloDeviceName; + + // [optional] Windows Hello Public Key Hash + FString WindowsHelloPublicKeyHash; + + FUserWindowsHelloInfo() : + FPlayFabBaseModel(), + WindowsHelloDeviceName(), + WindowsHelloPublicKeyHash() + {} + + FUserWindowsHelloInfo(const FUserWindowsHelloInfo& src) : + FPlayFabBaseModel(), + WindowsHelloDeviceName(src.WindowsHelloDeviceName), + WindowsHelloPublicKeyHash(src.WindowsHelloPublicKeyHash) + {} + + FUserWindowsHelloInfo(const TSharedPtr& obj) : FUserWindowsHelloInfo() + { + readFromValue(obj); + } + + ~FUserWindowsHelloInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserXboxInfo : public FPlayFabBaseModel + { + // [optional] XBox user ID + FString XboxUserId; + + FUserXboxInfo() : + FPlayFabBaseModel(), + XboxUserId() + {} + + FUserXboxInfo(const FUserXboxInfo& src) : + FPlayFabBaseModel(), + XboxUserId(src.XboxUserId) + {} + + FUserXboxInfo(const TSharedPtr& obj) : FUserXboxInfo() + { + readFromValue(obj); + } + + ~FUserXboxInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUserAccountInfo : public FPlayFabBaseModel + { + // [optional] User Android device information, if an Android device has been linked + TSharedPtr AndroidDeviceInfo; + + // Timestamp indicating when the user account was created + FDateTime Created; + + // [optional] Custom ID information, if a custom ID has been assigned + TSharedPtr CustomIdInfo; + + // [optional] User Facebook information, if a Facebook account has been linked + TSharedPtr FacebookInfo; + + // [optional] Facebook Instant Games account information, if a Facebook Instant Games account has been linked + TSharedPtr FacebookInstantGamesIdInfo; + + // [optional] User Gamecenter information, if a Gamecenter account has been linked + TSharedPtr GameCenterInfo; + + // [optional] User Google account information, if a Google account has been linked + TSharedPtr GoogleInfo; + + // [optional] User iOS device information, if an iOS device has been linked + TSharedPtr IosDeviceInfo; + + // [optional] User Kongregate account information, if a Kongregate account has been linked + TSharedPtr KongregateInfo; + + // [optional] Nintendo Switch account information, if a Nintendo Switch account has been linked + TSharedPtr NintendoSwitchDeviceIdInfo; + + // [optional] OpenID Connect information, if any OpenID Connect accounts have been linked + TArray OpenIdInfo; + // [optional] Unique identifier for the user account + FString PlayFabId; + + // [optional] Personal information for the user which is considered more sensitive + TSharedPtr PrivateInfo; + + // [optional] User PSN account information, if a PSN account has been linked + TSharedPtr PsnInfo; + + // [optional] User Steam information, if a Steam account has been linked + TSharedPtr SteamInfo; + + // [optional] Title-specific information for the user account + TSharedPtr TitleInfo; + + // [optional] User Twitch account information, if a Twitch account has been linked + TSharedPtr TwitchInfo; + + // [optional] User account name in the PlayFab service + FString Username; + + // [optional] Windows Hello account information, if a Windows Hello account has been linked + TSharedPtr WindowsHelloInfo; + + // [optional] User XBox account information, if a XBox account has been linked + TSharedPtr XboxInfo; + + FUserAccountInfo() : + FPlayFabBaseModel(), + AndroidDeviceInfo(nullptr), + Created(0), + CustomIdInfo(nullptr), + FacebookInfo(nullptr), + FacebookInstantGamesIdInfo(nullptr), + GameCenterInfo(nullptr), + GoogleInfo(nullptr), + IosDeviceInfo(nullptr), + KongregateInfo(nullptr), + NintendoSwitchDeviceIdInfo(nullptr), + OpenIdInfo(), + PlayFabId(), + PrivateInfo(nullptr), + PsnInfo(nullptr), + SteamInfo(nullptr), + TitleInfo(nullptr), + TwitchInfo(nullptr), + Username(), + WindowsHelloInfo(nullptr), + XboxInfo(nullptr) + {} + + FUserAccountInfo(const FUserAccountInfo& src) : + FPlayFabBaseModel(), + AndroidDeviceInfo(src.AndroidDeviceInfo.IsValid() ? MakeShareable(new FUserAndroidDeviceInfo(*src.AndroidDeviceInfo)) : nullptr), + Created(src.Created), + CustomIdInfo(src.CustomIdInfo.IsValid() ? MakeShareable(new FUserCustomIdInfo(*src.CustomIdInfo)) : nullptr), + FacebookInfo(src.FacebookInfo.IsValid() ? MakeShareable(new FUserFacebookInfo(*src.FacebookInfo)) : nullptr), + FacebookInstantGamesIdInfo(src.FacebookInstantGamesIdInfo.IsValid() ? MakeShareable(new FUserFacebookInstantGamesIdInfo(*src.FacebookInstantGamesIdInfo)) : nullptr), + GameCenterInfo(src.GameCenterInfo.IsValid() ? MakeShareable(new FUserGameCenterInfo(*src.GameCenterInfo)) : nullptr), + GoogleInfo(src.GoogleInfo.IsValid() ? MakeShareable(new FUserGoogleInfo(*src.GoogleInfo)) : nullptr), + IosDeviceInfo(src.IosDeviceInfo.IsValid() ? MakeShareable(new FUserIosDeviceInfo(*src.IosDeviceInfo)) : nullptr), + KongregateInfo(src.KongregateInfo.IsValid() ? MakeShareable(new FUserKongregateInfo(*src.KongregateInfo)) : nullptr), + NintendoSwitchDeviceIdInfo(src.NintendoSwitchDeviceIdInfo.IsValid() ? MakeShareable(new FUserNintendoSwitchDeviceIdInfo(*src.NintendoSwitchDeviceIdInfo)) : nullptr), + OpenIdInfo(src.OpenIdInfo), + PlayFabId(src.PlayFabId), + PrivateInfo(src.PrivateInfo.IsValid() ? MakeShareable(new FUserPrivateAccountInfo(*src.PrivateInfo)) : nullptr), + PsnInfo(src.PsnInfo.IsValid() ? MakeShareable(new FUserPsnInfo(*src.PsnInfo)) : nullptr), + SteamInfo(src.SteamInfo.IsValid() ? MakeShareable(new FUserSteamInfo(*src.SteamInfo)) : nullptr), + TitleInfo(src.TitleInfo.IsValid() ? MakeShareable(new FUserTitleInfo(*src.TitleInfo)) : nullptr), + TwitchInfo(src.TwitchInfo.IsValid() ? MakeShareable(new FUserTwitchInfo(*src.TwitchInfo)) : nullptr), + Username(src.Username), + WindowsHelloInfo(src.WindowsHelloInfo.IsValid() ? MakeShareable(new FUserWindowsHelloInfo(*src.WindowsHelloInfo)) : nullptr), + XboxInfo(src.XboxInfo.IsValid() ? MakeShareable(new FUserXboxInfo(*src.XboxInfo)) : nullptr) + {} + + FUserAccountInfo(const TSharedPtr& obj) : FUserAccountInfo() + { + readFromValue(obj); + } + + ~FUserAccountInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAuthenticateSessionTicketResult : public FPlayFabBaseModel + { + // [optional] Account info for the user whose session ticket was supplied. + TSharedPtr UserInfo; + + FAuthenticateSessionTicketResult() : + FPlayFabBaseModel(), + UserInfo(nullptr) + {} + + FAuthenticateSessionTicketResult(const FAuthenticateSessionTicketResult& src) : + FPlayFabBaseModel(), + UserInfo(src.UserInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.UserInfo)) : nullptr) + {} + + FAuthenticateSessionTicketResult(const TSharedPtr& obj) : FAuthenticateSessionTicketResult() + { + readFromValue(obj); + } + + ~FAuthenticateSessionTicketResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAwardSteamAchievementItem : public FPlayFabBaseModel + { + // Unique Steam achievement name. + FString AchievementName; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Result of the award attempt (only valid on response, not on request). + bool Result; + + FAwardSteamAchievementItem() : + FPlayFabBaseModel(), + AchievementName(), + PlayFabId(), + Result(false) + {} + + FAwardSteamAchievementItem(const FAwardSteamAchievementItem& src) : + FPlayFabBaseModel(), + AchievementName(src.AchievementName), + PlayFabId(src.PlayFabId), + Result(src.Result) + {} + + FAwardSteamAchievementItem(const TSharedPtr& obj) : FAwardSteamAchievementItem() + { + readFromValue(obj); + } + + ~FAwardSteamAchievementItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAwardSteamAchievementRequest : public FPlayFabBaseModel + { + // Array of achievements to grant and the users to whom they are to be granted. + TArray Achievements; + FAwardSteamAchievementRequest() : + FPlayFabBaseModel(), + Achievements() + {} + + FAwardSteamAchievementRequest(const FAwardSteamAchievementRequest& src) : + FPlayFabBaseModel(), + Achievements(src.Achievements) + {} + + FAwardSteamAchievementRequest(const TSharedPtr& obj) : FAwardSteamAchievementRequest() + { + readFromValue(obj); + } + + ~FAwardSteamAchievementRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FAwardSteamAchievementResult : public FPlayFabBaseModel + { + // [optional] Array of achievements granted. + TArray AchievementResults; + FAwardSteamAchievementResult() : + FPlayFabBaseModel(), + AchievementResults() + {} + + FAwardSteamAchievementResult(const FAwardSteamAchievementResult& src) : + FPlayFabBaseModel(), + AchievementResults(src.AchievementResults) + {} + + FAwardSteamAchievementResult(const TSharedPtr& obj) : FAwardSteamAchievementResult() + { + readFromValue(obj); + } + + ~FAwardSteamAchievementResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanInfo : public FPlayFabBaseModel + { + // The active state of this ban. Expired bans may still have this value set to true but they will have no effect. + bool Active; + + // [optional] The unique Ban Id associated with this ban. + FString BanId; + + // [optional] The time when this ban was applied. + Boxed Created; + + // [optional] The time when this ban expires. Permanent bans do not have expiration date. + Boxed Expires; + + // [optional] The IP address on which the ban was applied. May affect multiple players. + FString IPAddress; + + // [optional] The MAC address on which the ban was applied. May affect multiple players. + FString MACAddress; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] The reason why this ban was applied. + FString Reason; + + FBanInfo() : + FPlayFabBaseModel(), + Active(false), + BanId(), + Created(), + Expires(), + IPAddress(), + MACAddress(), + PlayFabId(), + Reason() + {} + + FBanInfo(const FBanInfo& src) : + FPlayFabBaseModel(), + Active(src.Active), + BanId(src.BanId), + Created(src.Created), + Expires(src.Expires), + IPAddress(src.IPAddress), + MACAddress(src.MACAddress), + PlayFabId(src.PlayFabId), + Reason(src.Reason) + {} + + FBanInfo(const TSharedPtr& obj) : FBanInfo() + { + readFromValue(obj); + } + + ~FBanInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanRequest : public FPlayFabBaseModel + { + // [optional] The duration in hours for the ban. Leave this blank for a permanent ban. + Boxed DurationInHours; + + // [optional] IP address to be banned. May affect multiple players. + FString IPAddress; + + // [optional] MAC address to be banned. May affect multiple players. + FString MACAddress; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] The reason for this ban. Maximum 140 characters. + FString Reason; + + FBanRequest() : + FPlayFabBaseModel(), + DurationInHours(), + IPAddress(), + MACAddress(), + PlayFabId(), + Reason() + {} + + FBanRequest(const FBanRequest& src) : + FPlayFabBaseModel(), + DurationInHours(src.DurationInHours), + IPAddress(src.IPAddress), + MACAddress(src.MACAddress), + PlayFabId(src.PlayFabId), + Reason(src.Reason) + {} + + FBanRequest(const TSharedPtr& obj) : FBanRequest() + { + readFromValue(obj); + } + + ~FBanRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanUsersRequest : public FPlayFabBaseModel + { + // List of ban requests to be applied. Maximum 100. + TArray Bans; + FBanUsersRequest() : + FPlayFabBaseModel(), + Bans() + {} + + FBanUsersRequest(const FBanUsersRequest& src) : + FPlayFabBaseModel(), + Bans(src.Bans) + {} + + FBanUsersRequest(const TSharedPtr& obj) : FBanUsersRequest() + { + readFromValue(obj); + } + + ~FBanUsersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FBanUsersResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were applied + TArray BanData; + FBanUsersResult() : + FPlayFabBaseModel(), + BanData() + {} + + FBanUsersResult(const FBanUsersResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FBanUsersResult(const TSharedPtr& obj) : FBanUsersResult() + { + readFromValue(obj); + } + + ~FBanUsersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemBundleInfo : public FPlayFabBaseModel + { + // [optional] unique ItemId values for all items which will be added to the player inventory when the bundle is added + TArray BundledItems; + /** + * [optional] unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and + * add the relevant items to the player inventory when the bundle is added) + */ + TArray BundledResultTables; + // [optional] virtual currency types and balances which will be added to the player inventory when the bundle is added + TMap BundledVirtualCurrencies; + FCatalogItemBundleInfo() : + FPlayFabBaseModel(), + BundledItems(), + BundledResultTables(), + BundledVirtualCurrencies() + {} + + FCatalogItemBundleInfo(const FCatalogItemBundleInfo& src) : + FPlayFabBaseModel(), + BundledItems(src.BundledItems), + BundledResultTables(src.BundledResultTables), + BundledVirtualCurrencies(src.BundledVirtualCurrencies) + {} + + FCatalogItemBundleInfo(const TSharedPtr& obj) : FCatalogItemBundleInfo() + { + readFromValue(obj); + } + + ~FCatalogItemBundleInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemConsumableInfo : public FPlayFabBaseModel + { + // [optional] number of times this object can be used, after which it will be removed from the player inventory + Boxed UsageCount; + + /** + * [optional] duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed + * (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on + * this item's details have completed) + */ + Boxed UsagePeriod; + + /** + * [optional] all inventory item instances in the player inventory sharing a non-null UsagePeriodGroup have their UsagePeriod values + * added together, and share the result - when that period has elapsed, all the items in the group will be removed + */ + FString UsagePeriodGroup; + + FCatalogItemConsumableInfo() : + FPlayFabBaseModel(), + UsageCount(), + UsagePeriod(), + UsagePeriodGroup() + {} + + FCatalogItemConsumableInfo(const FCatalogItemConsumableInfo& src) : + FPlayFabBaseModel(), + UsageCount(src.UsageCount), + UsagePeriod(src.UsagePeriod), + UsagePeriodGroup(src.UsagePeriodGroup) + {} + + FCatalogItemConsumableInfo(const TSharedPtr& obj) : FCatalogItemConsumableInfo() + { + readFromValue(obj); + } + + ~FCatalogItemConsumableInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItemContainerInfo : public FPlayFabBaseModel + { + // [optional] unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked + TArray ItemContents; + /** + * [optional] ItemId for the catalog item used to unlock the container, if any (if not specified, a call to UnlockContainerItem will + * open the container, adding the contents to the player inventory and currency balances) + */ + FString KeyItemId; + + /** + * [optional] unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables + * will be resolved and add the relevant items to the player inventory) + */ + TArray ResultTableContents; + // [optional] virtual currency types and balances which will be added to the player inventory when the container is unlocked + TMap VirtualCurrencyContents; + FCatalogItemContainerInfo() : + FPlayFabBaseModel(), + ItemContents(), + KeyItemId(), + ResultTableContents(), + VirtualCurrencyContents() + {} + + FCatalogItemContainerInfo(const FCatalogItemContainerInfo& src) : + FPlayFabBaseModel(), + ItemContents(src.ItemContents), + KeyItemId(src.KeyItemId), + ResultTableContents(src.ResultTableContents), + VirtualCurrencyContents(src.VirtualCurrencyContents) + {} + + FCatalogItemContainerInfo(const TSharedPtr& obj) : FCatalogItemContainerInfo() + { + readFromValue(obj); + } + + ~FCatalogItemContainerInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCatalogItem : public FPlayFabBaseModel + { + /** + * [optional] defines the bundle properties for the item - bundles are items which contain other items, including random drop tables + * and virtual currencies + */ + TSharedPtr Bundle; + + // if true, then an item instance of this type can be used to grant a character to a user. + bool CanBecomeCharacter; + + // [optional] catalog version for this item + FString CatalogVersion; + + // [optional] defines the consumable properties (number of uses, timeout) for the item + TSharedPtr Consumable; + + /** + * [optional] defines the container properties for the item - what items it contains, including random drop tables and virtual + * currencies, and what item (if any) is required to open it via the UnlockContainerItem API + */ + TSharedPtr Container; + + // [optional] game specific custom data + FString CustomData; + + // [optional] text description of item, to show in-game + FString Description; + + // [optional] text name for the item, to show in-game + FString DisplayName; + + /** + * If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited + * edition item, this value determines the total number of instances to allocate for the title. Once this limit has been + * reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of + * false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less + * than zero, it will be ignored. + */ + int32 InitialLimitedEditionCount; + + // BETA: If true, then only a fixed number can ever be granted. + bool IsLimitedEdition; + + /** + * if true, then only one item instance of this type will exist and its remaininguses will be incremented instead. + * RemainingUses will cap out at Int32.Max (2,147,483,647). All subsequent increases will be discarded + */ + bool IsStackable; + + // if true, then an item instance of this type can be traded between players using the trading APIs + bool IsTradable; + + // [optional] class to which the item belongs + FString ItemClass; + + // unique identifier for this item + FString ItemId; + + /** + * [optional] URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP + * URL. + */ + FString ItemImageUrl; + + // [optional] override prices for this item for specific currencies + TMap RealCurrencyPrices; + // [optional] list of item tags + TArray Tags; + // [optional] price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + TMap VirtualCurrencyPrices; + FCatalogItem() : + FPlayFabBaseModel(), + Bundle(nullptr), + CanBecomeCharacter(false), + CatalogVersion(), + Consumable(nullptr), + Container(nullptr), + CustomData(), + Description(), + DisplayName(), + InitialLimitedEditionCount(0), + IsLimitedEdition(false), + IsStackable(false), + IsTradable(false), + ItemClass(), + ItemId(), + ItemImageUrl(), + RealCurrencyPrices(), + Tags(), + VirtualCurrencyPrices() + {} + + FCatalogItem(const FCatalogItem& src) : + FPlayFabBaseModel(), + Bundle(src.Bundle.IsValid() ? MakeShareable(new FCatalogItemBundleInfo(*src.Bundle)) : nullptr), + CanBecomeCharacter(src.CanBecomeCharacter), + CatalogVersion(src.CatalogVersion), + Consumable(src.Consumable.IsValid() ? MakeShareable(new FCatalogItemConsumableInfo(*src.Consumable)) : nullptr), + Container(src.Container.IsValid() ? MakeShareable(new FCatalogItemContainerInfo(*src.Container)) : nullptr), + CustomData(src.CustomData), + Description(src.Description), + DisplayName(src.DisplayName), + InitialLimitedEditionCount(src.InitialLimitedEditionCount), + IsLimitedEdition(src.IsLimitedEdition), + IsStackable(src.IsStackable), + IsTradable(src.IsTradable), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemImageUrl(src.ItemImageUrl), + RealCurrencyPrices(src.RealCurrencyPrices), + Tags(src.Tags), + VirtualCurrencyPrices(src.VirtualCurrencyPrices) + {} + + FCatalogItem(const TSharedPtr& obj) : FCatalogItem() + { + readFromValue(obj); + } + + ~FCatalogItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemInstance : public FPlayFabBaseModel + { + // [optional] Game specific comment associated with this instance when it was added to the user inventory. + FString Annotation; + + // [optional] Array of unique items that were awarded when this catalog item was purchased. + TArray BundleContents; + /** + * [optional] Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or + * container. + */ + FString BundleParent; + + // [optional] Catalog version for the inventory item, when this instance was created. + FString CatalogVersion; + + // [optional] A set of custom key-value pairs on the inventory item. + TMap CustomData; + // [optional] CatalogItem.DisplayName at the time this item was purchased. + FString DisplayName; + + // [optional] Timestamp for when this instance will expire. + Boxed Expiration; + + // [optional] Class name for the inventory item, as defined in the catalog. + FString ItemClass; + + // [optional] Unique identifier for the inventory item, as defined in the catalog. + FString ItemId; + + // [optional] Unique item identifier for this specific instance of the item. + FString ItemInstanceId; + + // [optional] Timestamp for when this instance was purchased. + Boxed PurchaseDate; + + // [optional] Total number of remaining uses, if this is a consumable item. + Boxed RemainingUses; + + // [optional] Currency type for the cost of the catalog item. + FString UnitCurrency; + + // Cost of the catalog item in the given currency. + uint32 UnitPrice; + + // [optional] The number of uses that were added or removed to this item in this call. + Boxed UsesIncrementedBy; + + FItemInstance() : + FPlayFabBaseModel(), + Annotation(), + BundleContents(), + BundleParent(), + CatalogVersion(), + CustomData(), + DisplayName(), + Expiration(), + ItemClass(), + ItemId(), + ItemInstanceId(), + PurchaseDate(), + RemainingUses(), + UnitCurrency(), + UnitPrice(0), + UsesIncrementedBy() + {} + + FItemInstance(const FItemInstance& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + BundleContents(src.BundleContents), + BundleParent(src.BundleParent), + CatalogVersion(src.CatalogVersion), + CustomData(src.CustomData), + DisplayName(src.DisplayName), + Expiration(src.Expiration), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + PurchaseDate(src.PurchaseDate), + RemainingUses(src.RemainingUses), + UnitCurrency(src.UnitCurrency), + UnitPrice(src.UnitPrice), + UsesIncrementedBy(src.UsesIncrementedBy) + {} + + FItemInstance(const TSharedPtr& obj) : FItemInstance() + { + readFromValue(obj); + } + + ~FItemInstance(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCharacterInventory : public FPlayFabBaseModel + { + // [optional] The id of this character. + FString CharacterId; + + // [optional] The inventory of this character. + TArray Inventory; + FCharacterInventory() : + FPlayFabBaseModel(), + CharacterId(), + Inventory() + {} + + FCharacterInventory(const FCharacterInventory& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Inventory(src.Inventory) + {} + + FCharacterInventory(const TSharedPtr& obj) : FCharacterInventory() + { + readFromValue(obj); + } + + ~FCharacterInventory(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCharacterLeaderboardEntry : public FPlayFabBaseModel + { + // [optional] PlayFab unique identifier of the character that belongs to the user for this leaderboard entry. + FString CharacterId; + + // [optional] Title-specific display name of the character for this leaderboard entry. + FString CharacterName; + + // [optional] Name of the character class for this entry. + FString CharacterType; + + // [optional] Title-specific display name of the user for this leaderboard entry. + FString DisplayName; + + // [optional] PlayFab unique identifier of the user for this leaderboard entry. + FString PlayFabId; + + // User's overall position in the leaderboard. + int32 Position; + + // Specific value of the user's statistic. + int32 StatValue; + + FCharacterLeaderboardEntry() : + FPlayFabBaseModel(), + CharacterId(), + CharacterName(), + CharacterType(), + DisplayName(), + PlayFabId(), + Position(0), + StatValue(0) + {} + + FCharacterLeaderboardEntry(const FCharacterLeaderboardEntry& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterName(src.CharacterName), + CharacterType(src.CharacterType), + DisplayName(src.DisplayName), + PlayFabId(src.PlayFabId), + Position(src.Position), + StatValue(src.StatValue) + {} + + FCharacterLeaderboardEntry(const TSharedPtr& obj) : FCharacterLeaderboardEntry() + { + readFromValue(obj); + } + + ~FCharacterLeaderboardEntry(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCharacterResult : public FPlayFabBaseModel + { + // [optional] The id for this character on this player. + FString CharacterId; + + // [optional] The name of this character. + FString CharacterName; + + // [optional] The type-string that was given to this character on creation. + FString CharacterType; + + FCharacterResult() : + FPlayFabBaseModel(), + CharacterId(), + CharacterName(), + CharacterType() + {} + + FCharacterResult(const FCharacterResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterName(src.CharacterName), + CharacterType(src.CharacterType) + {} + + FCharacterResult(const TSharedPtr& obj) : FCharacterResult() + { + readFromValue(obj); + } + + ~FCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum CloudScriptRevisionOption + { + CloudScriptRevisionOptionLive, + CloudScriptRevisionOptionLatest, + CloudScriptRevisionOptionSpecific + }; + + PLAYFABCPP_API void writeCloudScriptRevisionOptionEnumJSON(CloudScriptRevisionOption enumVal, JsonWriter& writer); + PLAYFABCPP_API CloudScriptRevisionOption readCloudScriptRevisionOptionFromValue(const TSharedPtr& value); + PLAYFABCPP_API CloudScriptRevisionOption readCloudScriptRevisionOptionFromValue(const FString& value); + + struct PLAYFABCPP_API FConsumeItemRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Number of uses to consume from the item. + int32 ConsumeCount; + + // Unique instance identifier of the item to be consumed. + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FConsumeItemRequest() : + FPlayFabBaseModel(), + CharacterId(), + ConsumeCount(0), + ItemInstanceId(), + PlayFabId() + {} + + FConsumeItemRequest(const FConsumeItemRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ConsumeCount(src.ConsumeCount), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FConsumeItemRequest(const TSharedPtr& obj) : FConsumeItemRequest() + { + readFromValue(obj); + } + + ~FConsumeItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FConsumeItemResult : public FPlayFabBaseModel + { + // [optional] Unique instance identifier of the item with uses consumed. + FString ItemInstanceId; + + // Number of uses remaining on the item. + int32 RemainingUses; + + FConsumeItemResult() : + FPlayFabBaseModel(), + ItemInstanceId(), + RemainingUses(0) + {} + + FConsumeItemResult(const FConsumeItemResult& src) : + FPlayFabBaseModel(), + ItemInstanceId(src.ItemInstanceId), + RemainingUses(src.RemainingUses) + {} + + FConsumeItemResult(const TSharedPtr& obj) : FConsumeItemResult() + { + readFromValue(obj); + } + + ~FConsumeItemResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum EmailVerificationStatus + { + EmailVerificationStatusUnverified, + EmailVerificationStatusPending, + EmailVerificationStatusConfirmed + }; + + PLAYFABCPP_API void writeEmailVerificationStatusEnumJSON(EmailVerificationStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API EmailVerificationStatus readEmailVerificationStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API EmailVerificationStatus readEmailVerificationStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FContactEmailInfo : public FPlayFabBaseModel + { + // [optional] The email address + FString EmailAddress; + + // [optional] The name of the email info data + FString Name; + + // [optional] The verification status of the email + Boxed VerificationStatus; + + FContactEmailInfo() : + FPlayFabBaseModel(), + EmailAddress(), + Name(), + VerificationStatus() + {} + + FContactEmailInfo(const FContactEmailInfo& src) : + FPlayFabBaseModel(), + EmailAddress(src.EmailAddress), + Name(src.Name), + VerificationStatus(src.VerificationStatus) + {} + + FContactEmailInfo(const TSharedPtr& obj) : FContactEmailInfo() + { + readFromValue(obj); + } + + ~FContactEmailInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FContactEmailInfoModel : public FPlayFabBaseModel + { + // [optional] The email address + FString EmailAddress; + + // [optional] The name of the email info data + FString Name; + + // [optional] The verification status of the email + Boxed VerificationStatus; + + FContactEmailInfoModel() : + FPlayFabBaseModel(), + EmailAddress(), + Name(), + VerificationStatus() + {} + + FContactEmailInfoModel(const FContactEmailInfoModel& src) : + FPlayFabBaseModel(), + EmailAddress(src.EmailAddress), + Name(src.Name), + VerificationStatus(src.VerificationStatus) + {} + + FContactEmailInfoModel(const TSharedPtr& obj) : FContactEmailInfoModel() + { + readFromValue(obj); + } + + ~FContactEmailInfoModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ContinentCode + { + ContinentCodeAF, + ContinentCodeAN, + ContinentCodeAS, + ContinentCodeEU, + ContinentCodeNA, + ContinentCodeOC, + ContinentCodeSA + }; + + PLAYFABCPP_API void writeContinentCodeEnumJSON(ContinentCode enumVal, JsonWriter& writer); + PLAYFABCPP_API ContinentCode readContinentCodeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ContinentCode readContinentCodeFromValue(const FString& value); + + enum CountryCode + { + CountryCodeAF, + CountryCodeAX, + CountryCodeAL, + CountryCodeDZ, + CountryCodeAS, + CountryCodeAD, + CountryCodeAO, + CountryCodeAI, + CountryCodeAQ, + CountryCodeAG, + CountryCodeAR, + CountryCodeAM, + CountryCodeAW, + CountryCodeAU, + CountryCodeAT, + CountryCodeAZ, + CountryCodeBS, + CountryCodeBH, + CountryCodeBD, + CountryCodeBB, + CountryCodeBY, + CountryCodeBE, + CountryCodeBZ, + CountryCodeBJ, + CountryCodeBM, + CountryCodeBT, + CountryCodeBO, + CountryCodeBQ, + CountryCodeBA, + CountryCodeBW, + CountryCodeBV, + CountryCodeBR, + CountryCodeIO, + CountryCodeBN, + CountryCodeBG, + CountryCodeBF, + CountryCodeBI, + CountryCodeKH, + CountryCodeCM, + CountryCodeCA, + CountryCodeCV, + CountryCodeKY, + CountryCodeCF, + CountryCodeTD, + CountryCodeCL, + CountryCodeCN, + CountryCodeCX, + CountryCodeCC, + CountryCodeCO, + CountryCodeKM, + CountryCodeCG, + CountryCodeCD, + CountryCodeCK, + CountryCodeCR, + CountryCodeCI, + CountryCodeHR, + CountryCodeCU, + CountryCodeCW, + CountryCodeCY, + CountryCodeCZ, + CountryCodeDK, + CountryCodeDJ, + CountryCodeDM, + CountryCodeDO, + CountryCodeEC, + CountryCodeEG, + CountryCodeSV, + CountryCodeGQ, + CountryCodeER, + CountryCodeEE, + CountryCodeET, + CountryCodeFK, + CountryCodeFO, + CountryCodeFJ, + CountryCodeFI, + CountryCodeFR, + CountryCodeGF, + CountryCodePF, + CountryCodeTF, + CountryCodeGA, + CountryCodeGM, + CountryCodeGE, + CountryCodeDE, + CountryCodeGH, + CountryCodeGI, + CountryCodeGR, + CountryCodeGL, + CountryCodeGD, + CountryCodeGP, + CountryCodeGU, + CountryCodeGT, + CountryCodeGG, + CountryCodeGN, + CountryCodeGW, + CountryCodeGY, + CountryCodeHT, + CountryCodeHM, + CountryCodeVA, + CountryCodeHN, + CountryCodeHK, + CountryCodeHU, + CountryCodeIS, + CountryCodeIN, + CountryCodeID, + CountryCodeIR, + CountryCodeIQ, + CountryCodeIE, + CountryCodeIM, + CountryCodeIL, + CountryCodeIT, + CountryCodeJM, + CountryCodeJP, + CountryCodeJE, + CountryCodeJO, + CountryCodeKZ, + CountryCodeKE, + CountryCodeKI, + CountryCodeKP, + CountryCodeKR, + CountryCodeKW, + CountryCodeKG, + CountryCodeLA, + CountryCodeLV, + CountryCodeLB, + CountryCodeLS, + CountryCodeLR, + CountryCodeLY, + CountryCodeLI, + CountryCodeLT, + CountryCodeLU, + CountryCodeMO, + CountryCodeMK, + CountryCodeMG, + CountryCodeMW, + CountryCodeMY, + CountryCodeMV, + CountryCodeML, + CountryCodeMT, + CountryCodeMH, + CountryCodeMQ, + CountryCodeMR, + CountryCodeMU, + CountryCodeYT, + CountryCodeMX, + CountryCodeFM, + CountryCodeMD, + CountryCodeMC, + CountryCodeMN, + CountryCodeME, + CountryCodeMS, + CountryCodeMA, + CountryCodeMZ, + CountryCodeMM, + CountryCodeNA, + CountryCodeNR, + CountryCodeNP, + CountryCodeNL, + CountryCodeNC, + CountryCodeNZ, + CountryCodeNI, + CountryCodeNE, + CountryCodeNG, + CountryCodeNU, + CountryCodeNF, + CountryCodeMP, + CountryCodeNO, + CountryCodeOM, + CountryCodePK, + CountryCodePW, + CountryCodePS, + CountryCodePA, + CountryCodePG, + CountryCodePY, + CountryCodePE, + CountryCodePH, + CountryCodePN, + CountryCodePL, + CountryCodePT, + CountryCodePR, + CountryCodeQA, + CountryCodeRE, + CountryCodeRO, + CountryCodeRU, + CountryCodeRW, + CountryCodeBL, + CountryCodeSH, + CountryCodeKN, + CountryCodeLC, + CountryCodeMF, + CountryCodePM, + CountryCodeVC, + CountryCodeWS, + CountryCodeSM, + CountryCodeST, + CountryCodeSA, + CountryCodeSN, + CountryCodeRS, + CountryCodeSC, + CountryCodeSL, + CountryCodeSG, + CountryCodeSX, + CountryCodeSK, + CountryCodeSI, + CountryCodeSB, + CountryCodeSO, + CountryCodeZA, + CountryCodeGS, + CountryCodeSS, + CountryCodeES, + CountryCodeLK, + CountryCodeSD, + CountryCodeSR, + CountryCodeSJ, + CountryCodeSZ, + CountryCodeSE, + CountryCodeCH, + CountryCodeSY, + CountryCodeTW, + CountryCodeTJ, + CountryCodeTZ, + CountryCodeTH, + CountryCodeTL, + CountryCodeTG, + CountryCodeTK, + CountryCodeTO, + CountryCodeTT, + CountryCodeTN, + CountryCodeTR, + CountryCodeTM, + CountryCodeTC, + CountryCodeTV, + CountryCodeUG, + CountryCodeUA, + CountryCodeAE, + CountryCodeGB, + CountryCodeUS, + CountryCodeUM, + CountryCodeUY, + CountryCodeUZ, + CountryCodeVU, + CountryCodeVE, + CountryCodeVN, + CountryCodeVG, + CountryCodeVI, + CountryCodeWF, + CountryCodeEH, + CountryCodeYE, + CountryCodeZM, + CountryCodeZW + }; + + PLAYFABCPP_API void writeCountryCodeEnumJSON(CountryCode enumVal, JsonWriter& writer); + PLAYFABCPP_API CountryCode readCountryCodeFromValue(const TSharedPtr& value); + PLAYFABCPP_API CountryCode readCountryCodeFromValue(const FString& value); + + struct PLAYFABCPP_API FCreateSharedGroupRequest : public FPlayFabBaseModel + { + // [optional] Unique identifier for the shared group (a random identifier will be assigned, if one is not specified). + FString SharedGroupId; + + FCreateSharedGroupRequest() : + FPlayFabBaseModel(), + SharedGroupId() + {} + + FCreateSharedGroupRequest(const FCreateSharedGroupRequest& src) : + FPlayFabBaseModel(), + SharedGroupId(src.SharedGroupId) + {} + + FCreateSharedGroupRequest(const TSharedPtr& obj) : FCreateSharedGroupRequest() + { + readFromValue(obj); + } + + ~FCreateSharedGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FCreateSharedGroupResult : public FPlayFabBaseModel + { + // [optional] Unique identifier for the shared group. + FString SharedGroupId; + + FCreateSharedGroupResult() : + FPlayFabBaseModel(), + SharedGroupId() + {} + + FCreateSharedGroupResult(const FCreateSharedGroupResult& src) : + FPlayFabBaseModel(), + SharedGroupId(src.SharedGroupId) + {} + + FCreateSharedGroupResult(const TSharedPtr& obj) : FCreateSharedGroupResult() + { + readFromValue(obj); + } + + ~FCreateSharedGroupResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteCharacterFromUserRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * If true, the character's inventory will be transferred up to the owning user; otherwise, this request will purge those + * items. + */ + bool SaveCharacterInventory; + + FDeleteCharacterFromUserRequest() : + FPlayFabBaseModel(), + CharacterId(), + PlayFabId(), + SaveCharacterInventory(false) + {} + + FDeleteCharacterFromUserRequest(const FDeleteCharacterFromUserRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + PlayFabId(src.PlayFabId), + SaveCharacterInventory(src.SaveCharacterInventory) + {} + + FDeleteCharacterFromUserRequest(const TSharedPtr& obj) : FDeleteCharacterFromUserRequest() + { + readFromValue(obj); + } + + ~FDeleteCharacterFromUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteCharacterFromUserResult : public FPlayFabBaseModel + { + FDeleteCharacterFromUserResult() : + FPlayFabBaseModel() + {} + + FDeleteCharacterFromUserResult(const FDeleteCharacterFromUserResult& src) : + FPlayFabBaseModel() + {} + + FDeleteCharacterFromUserResult(const TSharedPtr& obj) : FDeleteCharacterFromUserResult() + { + readFromValue(obj); + } + + ~FDeleteCharacterFromUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteSharedGroupRequest : public FPlayFabBaseModel + { + // Unique identifier for the shared group. + FString SharedGroupId; + + FDeleteSharedGroupRequest() : + FPlayFabBaseModel(), + SharedGroupId() + {} + + FDeleteSharedGroupRequest(const FDeleteSharedGroupRequest& src) : + FPlayFabBaseModel(), + SharedGroupId(src.SharedGroupId) + {} + + FDeleteSharedGroupRequest(const TSharedPtr& obj) : FDeleteSharedGroupRequest() + { + readFromValue(obj); + } + + ~FDeleteSharedGroupRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteUsersRequest : public FPlayFabBaseModel + { + // An array of unique PlayFab assigned ID of the user on whom the operation will be performed. + TArray PlayFabIds; + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a + * title has been selected. + */ + FString TitleId; + + FDeleteUsersRequest() : + FPlayFabBaseModel(), + PlayFabIds(), + TitleId() + {} + + FDeleteUsersRequest(const FDeleteUsersRequest& src) : + FPlayFabBaseModel(), + PlayFabIds(src.PlayFabIds), + TitleId(src.TitleId) + {} + + FDeleteUsersRequest(const TSharedPtr& obj) : FDeleteUsersRequest() + { + readFromValue(obj); + } + + ~FDeleteUsersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeleteUsersResult : public FPlayFabBaseModel + { + FDeleteUsersResult() : + FPlayFabBaseModel() + {} + + FDeleteUsersResult(const FDeleteUsersResult& src) : + FPlayFabBaseModel() + {} + + FDeleteUsersResult(const TSharedPtr& obj) : FDeleteUsersResult() + { + readFromValue(obj); + } + + ~FDeleteUsersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeregisterGameRequest : public FPlayFabBaseModel + { + // Unique identifier for the Game Server Instance that is being deregistered. + FString LobbyId; + + FDeregisterGameRequest() : + FPlayFabBaseModel(), + LobbyId() + {} + + FDeregisterGameRequest(const FDeregisterGameRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId) + {} + + FDeregisterGameRequest(const TSharedPtr& obj) : FDeregisterGameRequest() + { + readFromValue(obj); + } + + ~FDeregisterGameRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FDeregisterGameResponse : public FPlayFabBaseModel + { + FDeregisterGameResponse() : + FPlayFabBaseModel() + {} + + FDeregisterGameResponse(const FDeregisterGameResponse& src) : + FPlayFabBaseModel() + {} + + FDeregisterGameResponse(const TSharedPtr& obj) : FDeregisterGameResponse() + { + readFromValue(obj); + } + + ~FDeregisterGameResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEmptyResponse : public FPlayFabBaseModel + { + FEmptyResponse() : + FPlayFabBaseModel() + {} + + FEmptyResponse(const FEmptyResponse& src) : + FPlayFabBaseModel() + {} + + FEmptyResponse(const TSharedPtr& obj) : FEmptyResponse() + { + readFromValue(obj); + } + + ~FEmptyResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEvaluateRandomResultTableRequest : public FPlayFabBaseModel + { + /** + * [optional] Specifies the catalog version that should be used to evaluate the Random Result Table. If unspecified, uses + * default/primary catalog. + */ + FString CatalogVersion; + + // The unique identifier of the Random Result Table to use. + FString TableId; + + FEvaluateRandomResultTableRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + TableId() + {} + + FEvaluateRandomResultTableRequest(const FEvaluateRandomResultTableRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + TableId(src.TableId) + {} + + FEvaluateRandomResultTableRequest(const TSharedPtr& obj) : FEvaluateRandomResultTableRequest() + { + readFromValue(obj); + } + + ~FEvaluateRandomResultTableRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FEvaluateRandomResultTableResult : public FPlayFabBaseModel + { + // [optional] Unique identifier for the item returned from the Random Result Table evaluation, for the given catalog. + FString ResultItemId; + + FEvaluateRandomResultTableResult() : + FPlayFabBaseModel(), + ResultItemId() + {} + + FEvaluateRandomResultTableResult(const FEvaluateRandomResultTableResult& src) : + FPlayFabBaseModel(), + ResultItemId(src.ResultItemId) + {} + + FEvaluateRandomResultTableResult(const TSharedPtr& obj) : FEvaluateRandomResultTableResult() + { + readFromValue(obj); + } + + ~FEvaluateRandomResultTableResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FScriptExecutionError : public FPlayFabBaseModel + { + /** + * [optional] Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, + * CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError + */ + FString Error; + + // [optional] Details about the error + FString Message; + + // [optional] Point during the execution of the script at which the error occurred, if any + FString StackTrace; + + FScriptExecutionError() : + FPlayFabBaseModel(), + Error(), + Message(), + StackTrace() + {} + + FScriptExecutionError(const FScriptExecutionError& src) : + FPlayFabBaseModel(), + Error(src.Error), + Message(src.Message), + StackTrace(src.StackTrace) + {} + + FScriptExecutionError(const TSharedPtr& obj) : FScriptExecutionError() + { + readFromValue(obj); + } + + ~FScriptExecutionError(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLogStatement : public FPlayFabBaseModel + { + // [optional] Optional object accompanying the message as contextual information + FJsonKeeper Data; + + // [optional] 'Debug', 'Info', or 'Error' + FString Level; + + // [optional] undefined + FString Message; + + FLogStatement() : + FPlayFabBaseModel(), + Data(), + Level(), + Message() + {} + + FLogStatement(const FLogStatement& src) : + FPlayFabBaseModel(), + Data(src.Data), + Level(src.Level), + Message(src.Message) + {} + + FLogStatement(const TSharedPtr& obj) : FLogStatement() + { + readFromValue(obj); + } + + ~FLogStatement(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteCloudScriptResult : public FPlayFabBaseModel + { + // Number of PlayFab API requests issued by the CloudScript function + int32 APIRequestsIssued; + + // [optional] Information about the error, if any, that occurred during execution + TSharedPtr Error; + + double ExecutionTimeSeconds; + + // [optional] The name of the function that executed + FString FunctionName; + + // [optional] The object returned from the CloudScript function, if any + FJsonKeeper FunctionResult; + + /** + * [optional] Flag indicating if the FunctionResult was too large and was subsequently dropped from this event. This only occurs if + * the total event size is larger than 350KB. + */ + Boxed FunctionResultTooLarge; + + // Number of external HTTP requests issued by the CloudScript function + int32 HttpRequestsIssued; + + /** + * [optional] Entries logged during the function execution. These include both entries logged in the function code using log.info() + * and log.error() and error entries for API and HTTP request failures. + */ + TArray Logs; + /** + * [optional] Flag indicating if the logs were too large and were subsequently dropped from this event. This only occurs if the total + * event size is larger than 350KB after the FunctionResult was removed. + */ + Boxed LogsTooLarge; + + uint32 MemoryConsumedBytes; + + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP + * requests. + */ + double ProcessorTimeSeconds; + + // The revision of the CloudScript that executed + int32 Revision; + + FExecuteCloudScriptResult() : + FPlayFabBaseModel(), + APIRequestsIssued(0), + Error(nullptr), + ExecutionTimeSeconds(0), + FunctionName(), + FunctionResult(), + FunctionResultTooLarge(), + HttpRequestsIssued(0), + Logs(), + LogsTooLarge(), + MemoryConsumedBytes(0), + ProcessorTimeSeconds(0), + Revision(0) + {} + + FExecuteCloudScriptResult(const FExecuteCloudScriptResult& src) : + FPlayFabBaseModel(), + APIRequestsIssued(src.APIRequestsIssued), + Error(src.Error.IsValid() ? MakeShareable(new FScriptExecutionError(*src.Error)) : nullptr), + ExecutionTimeSeconds(src.ExecutionTimeSeconds), + FunctionName(src.FunctionName), + FunctionResult(src.FunctionResult), + FunctionResultTooLarge(src.FunctionResultTooLarge), + HttpRequestsIssued(src.HttpRequestsIssued), + Logs(src.Logs), + LogsTooLarge(src.LogsTooLarge), + MemoryConsumedBytes(src.MemoryConsumedBytes), + ProcessorTimeSeconds(src.ProcessorTimeSeconds), + Revision(src.Revision) + {} + + FExecuteCloudScriptResult(const TSharedPtr& obj) : FExecuteCloudScriptResult() + { + readFromValue(obj); + } + + ~FExecuteCloudScriptResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FExecuteCloudScriptServerRequest : public FPlayFabBaseModel + { + // The name of the CloudScript function to execute + FString FunctionName; + + // [optional] Object that is passed in to the function as the first argument + FJsonKeeper FunctionParameter; + + /** + * [optional] Generate a 'player_executed_cloudscript' PlayStream event containing the results of the function execution and other + * contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. + */ + Boxed GeneratePlayStreamEvent; + + // The unique user identifier for the player on whose behalf the script is being run + FString PlayFabId; + + /** + * [optional] Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' + * executes the current live, published revision, and 'Specific' executes the specified revision. The default value is + * 'Specific', if the SpeificRevision parameter is specified, otherwise it is 'Live'. + */ + Boxed RevisionSelection; + + // [optional] The specivic revision to execute, when RevisionSelection is set to 'Specific' + Boxed SpecificRevision; + + FExecuteCloudScriptServerRequest() : + FPlayFabBaseModel(), + FunctionName(), + FunctionParameter(), + GeneratePlayStreamEvent(), + PlayFabId(), + RevisionSelection(), + SpecificRevision() + {} + + FExecuteCloudScriptServerRequest(const FExecuteCloudScriptServerRequest& src) : + FPlayFabBaseModel(), + FunctionName(src.FunctionName), + FunctionParameter(src.FunctionParameter), + GeneratePlayStreamEvent(src.GeneratePlayStreamEvent), + PlayFabId(src.PlayFabId), + RevisionSelection(src.RevisionSelection), + SpecificRevision(src.SpecificRevision) + {} + + FExecuteCloudScriptServerRequest(const TSharedPtr& obj) : FExecuteCloudScriptServerRequest() + { + readFromValue(obj); + } + + ~FExecuteCloudScriptServerRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFacebookInstantGamesPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Facebook Instant Games identifier for a user. + FString FacebookInstantGamesId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Facebook Instant Games identifier. + FString PlayFabId; + + FFacebookInstantGamesPlayFabIdPair() : + FPlayFabBaseModel(), + FacebookInstantGamesId(), + PlayFabId() + {} + + FFacebookInstantGamesPlayFabIdPair(const FFacebookInstantGamesPlayFabIdPair& src) : + FPlayFabBaseModel(), + FacebookInstantGamesId(src.FacebookInstantGamesId), + PlayFabId(src.PlayFabId) + {} + + FFacebookInstantGamesPlayFabIdPair(const TSharedPtr& obj) : FFacebookInstantGamesPlayFabIdPair() + { + readFromValue(obj); + } + + ~FFacebookInstantGamesPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFacebookPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Facebook identifier for a user. + FString FacebookId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Facebook identifier. + FString PlayFabId; + + FFacebookPlayFabIdPair() : + FPlayFabBaseModel(), + FacebookId(), + PlayFabId() + {} + + FFacebookPlayFabIdPair(const FFacebookPlayFabIdPair& src) : + FPlayFabBaseModel(), + FacebookId(src.FacebookId), + PlayFabId(src.PlayFabId) + {} + + FFacebookPlayFabIdPair(const TSharedPtr& obj) : FFacebookPlayFabIdPair() + { + readFromValue(obj); + } + + ~FFacebookPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum LoginIdentityProvider + { + LoginIdentityProviderUnknown, + LoginIdentityProviderPlayFab, + LoginIdentityProviderCustom, + LoginIdentityProviderGameCenter, + LoginIdentityProviderGooglePlay, + LoginIdentityProviderSteam, + LoginIdentityProviderXBoxLive, + LoginIdentityProviderPSN, + LoginIdentityProviderKongregate, + LoginIdentityProviderFacebook, + LoginIdentityProviderIOSDevice, + LoginIdentityProviderAndroidDevice, + LoginIdentityProviderTwitch, + LoginIdentityProviderWindowsHello, + LoginIdentityProviderGameServer, + LoginIdentityProviderCustomServer, + LoginIdentityProviderNintendoSwitch, + LoginIdentityProviderFacebookInstantGames, + LoginIdentityProviderOpenIdConnect + }; + + PLAYFABCPP_API void writeLoginIdentityProviderEnumJSON(LoginIdentityProvider enumVal, JsonWriter& writer); + PLAYFABCPP_API LoginIdentityProvider readLoginIdentityProviderFromValue(const TSharedPtr& value); + PLAYFABCPP_API LoginIdentityProvider readLoginIdentityProviderFromValue(const FString& value); + + struct PLAYFABCPP_API FLinkedPlatformAccountModel : public FPlayFabBaseModel + { + // [optional] Linked account email of the user on the platform, if available + FString Email; + + // [optional] Authentication platform + Boxed Platform; + + // [optional] Unique account identifier of the user on the platform + FString PlatformUserId; + + // [optional] Linked account username of the user on the platform, if available + FString Username; + + FLinkedPlatformAccountModel() : + FPlayFabBaseModel(), + Email(), + Platform(), + PlatformUserId(), + Username() + {} + + FLinkedPlatformAccountModel(const FLinkedPlatformAccountModel& src) : + FPlayFabBaseModel(), + Email(src.Email), + Platform(src.Platform), + PlatformUserId(src.PlatformUserId), + Username(src.Username) + {} + + FLinkedPlatformAccountModel(const TSharedPtr& obj) : FLinkedPlatformAccountModel() + { + readFromValue(obj); + } + + ~FLinkedPlatformAccountModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FLocationModel : public FPlayFabBaseModel + { + // [optional] City name. + FString City; + + // [optional] The two-character continent code for this location + Boxed pfContinentCode; + + // [optional] The two-character ISO 3166-1 country code for the country associated with the location + Boxed pfCountryCode; + + // [optional] Latitude coordinate of the geographic location. + Boxed Latitude; + + // [optional] Longitude coordinate of the geographic location. + Boxed Longitude; + + FLocationModel() : + FPlayFabBaseModel(), + City(), + pfContinentCode(), + pfCountryCode(), + Latitude(), + Longitude() + {} + + FLocationModel(const FLocationModel& src) : + FPlayFabBaseModel(), + City(src.City), + pfContinentCode(src.pfContinentCode), + pfCountryCode(src.pfCountryCode), + Latitude(src.Latitude), + Longitude(src.Longitude) + {} + + FLocationModel(const TSharedPtr& obj) : FLocationModel() + { + readFromValue(obj); + } + + ~FLocationModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum SubscriptionProviderStatus + { + SubscriptionProviderStatusNoError, + SubscriptionProviderStatusCancelled, + SubscriptionProviderStatusUnknownError, + SubscriptionProviderStatusBillingError, + SubscriptionProviderStatusProductUnavailable, + SubscriptionProviderStatusCustomerDidNotAcceptPriceChange, + SubscriptionProviderStatusFreeTrial, + SubscriptionProviderStatusPaymentPending + }; + + PLAYFABCPP_API void writeSubscriptionProviderStatusEnumJSON(SubscriptionProviderStatus enumVal, JsonWriter& writer); + PLAYFABCPP_API SubscriptionProviderStatus readSubscriptionProviderStatusFromValue(const TSharedPtr& value); + PLAYFABCPP_API SubscriptionProviderStatus readSubscriptionProviderStatusFromValue(const FString& value); + + struct PLAYFABCPP_API FSubscriptionModel : public FPlayFabBaseModel + { + // When this subscription expires. + FDateTime Expiration; + + // The time the subscription was orignially purchased + FDateTime InitialSubscriptionTime; + + // Whether this subscription is currently active. That is, if Expiration > now. + bool IsActive; + + // [optional] The status of this subscription, according to the subscription provider. + Boxed Status; + + // [optional] The id for this subscription + FString SubscriptionId; + + // [optional] The item id for this subscription from the primary catalog + FString SubscriptionItemId; + + // [optional] The provider for this subscription. Apple or Google Play are supported today. + FString SubscriptionProvider; + + FSubscriptionModel() : + FPlayFabBaseModel(), + Expiration(0), + InitialSubscriptionTime(0), + IsActive(false), + Status(), + SubscriptionId(), + SubscriptionItemId(), + SubscriptionProvider() + {} + + FSubscriptionModel(const FSubscriptionModel& src) : + FPlayFabBaseModel(), + Expiration(src.Expiration), + InitialSubscriptionTime(src.InitialSubscriptionTime), + IsActive(src.IsActive), + Status(src.Status), + SubscriptionId(src.SubscriptionId), + SubscriptionItemId(src.SubscriptionItemId), + SubscriptionProvider(src.SubscriptionProvider) + {} + + FSubscriptionModel(const TSharedPtr& obj) : FSubscriptionModel() + { + readFromValue(obj); + } + + ~FSubscriptionModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMembershipModel : public FPlayFabBaseModel + { + // Whether this membership is active. That is, whether the MembershipExpiration time has been reached. + bool IsActive; + + // The time this membership expires + FDateTime MembershipExpiration; + + // [optional] The id of the membership + FString MembershipId; + + /** + * [optional] Membership expirations can be explicitly overridden (via game manager or the admin api). If this membership has been + * overridden, this will be the new expiration time. + */ + Boxed OverrideExpiration; + + // [optional] Whether the override expiration is set. + Boxed OverrideIsSet; + + // [optional] The list of subscriptions that this player has for this membership + TArray Subscriptions; + FMembershipModel() : + FPlayFabBaseModel(), + IsActive(false), + MembershipExpiration(0), + MembershipId(), + OverrideExpiration(), + OverrideIsSet(), + Subscriptions() + {} + + FMembershipModel(const FMembershipModel& src) : + FPlayFabBaseModel(), + IsActive(src.IsActive), + MembershipExpiration(src.MembershipExpiration), + MembershipId(src.MembershipId), + OverrideExpiration(src.OverrideExpiration), + OverrideIsSet(src.OverrideIsSet), + Subscriptions(src.Subscriptions) + {} + + FMembershipModel(const TSharedPtr& obj) : FMembershipModel() + { + readFromValue(obj); + } + + ~FMembershipModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPushNotificationRegistrationModel : public FPlayFabBaseModel + { + // [optional] Notification configured endpoint + FString NotificationEndpointARN; + + // [optional] Push notification platform + Boxed Platform; + + FPushNotificationRegistrationModel() : + FPlayFabBaseModel(), + NotificationEndpointARN(), + Platform() + {} + + FPushNotificationRegistrationModel(const FPushNotificationRegistrationModel& src) : + FPlayFabBaseModel(), + NotificationEndpointARN(src.NotificationEndpointARN), + Platform(src.Platform) + {} + + FPushNotificationRegistrationModel(const TSharedPtr& obj) : FPushNotificationRegistrationModel() + { + readFromValue(obj); + } + + ~FPushNotificationRegistrationModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticModel : public FPlayFabBaseModel + { + // [optional] Statistic name + FString Name; + + // Statistic value + int32 Value; + + // Statistic version (0 if not a versioned statistic) + int32 Version; + + FStatisticModel() : + FPlayFabBaseModel(), + Name(), + Value(0), + Version(0) + {} + + FStatisticModel(const FStatisticModel& src) : + FPlayFabBaseModel(), + Name(src.Name), + Value(src.Value), + Version(src.Version) + {} + + FStatisticModel(const TSharedPtr& obj) : FStatisticModel() + { + readFromValue(obj); + } + + ~FStatisticModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FTagModel : public FPlayFabBaseModel + { + // [optional] Full value of the tag, including namespace + FString TagValue; + + FTagModel() : + FPlayFabBaseModel(), + TagValue() + {} + + FTagModel(const FTagModel& src) : + FPlayFabBaseModel(), + TagValue(src.TagValue) + {} + + FTagModel(const TSharedPtr& obj) : FTagModel() + { + readFromValue(obj); + } + + ~FTagModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FValueToDateModel : public FPlayFabBaseModel + { + // [optional] ISO 4217 code of the currency used in the purchases + FString Currency; + + /** + * Total value of the purchases in a whole number of 1/100 monetary units. For example, 999 indicates nine dollars and + * ninety-nine cents when Currency is 'USD') + */ + uint32 TotalValue; + + /** + * [optional] Total value of the purchases in a string representation of decimal monetary units. For example, '9.99' indicates nine + * dollars and ninety-nine cents when Currency is 'USD'. + */ + FString TotalValueAsDecimal; + + FValueToDateModel() : + FPlayFabBaseModel(), + Currency(), + TotalValue(0), + TotalValueAsDecimal() + {} + + FValueToDateModel(const FValueToDateModel& src) : + FPlayFabBaseModel(), + Currency(src.Currency), + TotalValue(src.TotalValue), + TotalValueAsDecimal(src.TotalValueAsDecimal) + {} + + FValueToDateModel(const TSharedPtr& obj) : FValueToDateModel() + { + readFromValue(obj); + } + + ~FValueToDateModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfileModel : public FPlayFabBaseModel + { + // [optional] List of advertising campaigns the player has been attributed to + TArray AdCampaignAttributions; + // [optional] URL of the player's avatar image + FString AvatarUrl; + + // [optional] If the player is currently banned, the UTC Date when the ban expires + Boxed BannedUntil; + + // [optional] List of all contact email info associated with the player account + TArray ContactEmailAddresses; + // [optional] Player record created + Boxed Created; + + // [optional] Player display name + FString DisplayName; + + // [optional] UTC time when the player most recently logged in to the title + Boxed LastLogin; + + // [optional] List of all authentication systems linked to this player account + TArray LinkedAccounts; + // [optional] List of geographic locations from which the player has logged in to the title + TArray Locations; + // [optional] List of memberships for the player, along with whether are expired. + TArray Memberships; + // [optional] Player account origination + Boxed Origination; + + // [optional] PlayFab player account unique identifier + FString PlayerId; + + // [optional] Publisher this player belongs to + FString PublisherId; + + // [optional] List of configured end points registered for sending the player push notifications + TArray PushNotificationRegistrations; + // [optional] List of leaderboard statistic values for the player + TArray Statistics; + // [optional] List of player's tags for segmentation + TArray Tags; + // [optional] Title ID this player profile applies to + FString TitleId; + + /** + * [optional] Sum of the player's purchases made with real-money currencies, converted to US dollars equivalent and represented as a + * whole number of cents (1/100 USD). For example, 999 indicates nine dollars and ninety-nine cents. + */ + Boxed TotalValueToDateInUSD; + + // [optional] List of the player's lifetime purchase totals, summed by real-money currency + TArray ValuesToDate; + FPlayerProfileModel() : + FPlayFabBaseModel(), + AdCampaignAttributions(), + AvatarUrl(), + BannedUntil(), + ContactEmailAddresses(), + Created(), + DisplayName(), + LastLogin(), + LinkedAccounts(), + Locations(), + Memberships(), + Origination(), + PlayerId(), + PublisherId(), + PushNotificationRegistrations(), + Statistics(), + Tags(), + TitleId(), + TotalValueToDateInUSD(), + ValuesToDate() + {} + + FPlayerProfileModel(const FPlayerProfileModel& src) : + FPlayFabBaseModel(), + AdCampaignAttributions(src.AdCampaignAttributions), + AvatarUrl(src.AvatarUrl), + BannedUntil(src.BannedUntil), + ContactEmailAddresses(src.ContactEmailAddresses), + Created(src.Created), + DisplayName(src.DisplayName), + LastLogin(src.LastLogin), + LinkedAccounts(src.LinkedAccounts), + Locations(src.Locations), + Memberships(src.Memberships), + Origination(src.Origination), + PlayerId(src.PlayerId), + PublisherId(src.PublisherId), + PushNotificationRegistrations(src.PushNotificationRegistrations), + Statistics(src.Statistics), + Tags(src.Tags), + TitleId(src.TitleId), + TotalValueToDateInUSD(src.TotalValueToDateInUSD), + ValuesToDate(src.ValuesToDate) + {} + + FPlayerProfileModel(const TSharedPtr& obj) : FPlayerProfileModel() + { + readFromValue(obj); + } + + ~FPlayerProfileModel(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FFriendInfo : public FPlayFabBaseModel + { + // [optional] Unique lobby identifier of the Game Server Instance to which this player is currently connected. + FString CurrentMatchmakerLobbyId; + + // [optional] Available Facebook information (if the user and PlayFab friend are also connected in Facebook). + TSharedPtr FacebookInfo; + + // [optional] PlayFab unique identifier for this friend. + FString FriendPlayFabId; + + // [optional] Available Game Center information (if the user and PlayFab friend are also connected in Game Center). + TSharedPtr GameCenterInfo; + + // [optional] The profile of the user, if requested. + TSharedPtr Profile; + + // [optional] Available PSN information, if the user and PlayFab friend are both connected to PSN. + TSharedPtr PSNInfo; + + // [optional] Available Steam information (if the user and PlayFab friend are also connected in Steam). + TSharedPtr SteamInfo; + + // [optional] Tags which have been associated with this friend. + TArray Tags; + // [optional] Title-specific display name for this friend. + FString TitleDisplayName; + + // [optional] PlayFab unique username for this friend. + FString Username; + + // [optional] Available Xbox information, if the user and PlayFab friend are both connected to Xbox Live. + TSharedPtr XboxInfo; + + FFriendInfo() : + FPlayFabBaseModel(), + CurrentMatchmakerLobbyId(), + FacebookInfo(nullptr), + FriendPlayFabId(), + GameCenterInfo(nullptr), + Profile(nullptr), + PSNInfo(nullptr), + SteamInfo(nullptr), + Tags(), + TitleDisplayName(), + Username(), + XboxInfo(nullptr) + {} + + FFriendInfo(const FFriendInfo& src) : + FPlayFabBaseModel(), + CurrentMatchmakerLobbyId(src.CurrentMatchmakerLobbyId), + FacebookInfo(src.FacebookInfo.IsValid() ? MakeShareable(new FUserFacebookInfo(*src.FacebookInfo)) : nullptr), + FriendPlayFabId(src.FriendPlayFabId), + GameCenterInfo(src.GameCenterInfo.IsValid() ? MakeShareable(new FUserGameCenterInfo(*src.GameCenterInfo)) : nullptr), + Profile(src.Profile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.Profile)) : nullptr), + PSNInfo(src.PSNInfo.IsValid() ? MakeShareable(new FUserPsnInfo(*src.PSNInfo)) : nullptr), + SteamInfo(src.SteamInfo.IsValid() ? MakeShareable(new FUserSteamInfo(*src.SteamInfo)) : nullptr), + Tags(src.Tags), + TitleDisplayName(src.TitleDisplayName), + Username(src.Username), + XboxInfo(src.XboxInfo.IsValid() ? MakeShareable(new FUserXboxInfo(*src.XboxInfo)) : nullptr) + {} + + FFriendInfo(const TSharedPtr& obj) : FFriendInfo() + { + readFromValue(obj); + } + + ~FFriendInfo(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum GameInstanceState + { + GameInstanceStateOpen, + GameInstanceStateClosed + }; + + PLAYFABCPP_API void writeGameInstanceStateEnumJSON(GameInstanceState enumVal, JsonWriter& writer); + PLAYFABCPP_API GameInstanceState readGameInstanceStateFromValue(const TSharedPtr& value); + PLAYFABCPP_API GameInstanceState readGameInstanceStateFromValue(const FString& value); + + struct PLAYFABCPP_API FGetAllSegmentsRequest : public FPlayFabBaseModel + { + FGetAllSegmentsRequest() : + FPlayFabBaseModel() + {} + + FGetAllSegmentsRequest(const FGetAllSegmentsRequest& src) : + FPlayFabBaseModel() + {} + + FGetAllSegmentsRequest(const TSharedPtr& obj) : FGetAllSegmentsRequest() + { + readFromValue(obj); + } + + ~FGetAllSegmentsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSegmentResult : public FPlayFabBaseModel + { + // [optional] Identifier of the segments AB Test, if it is attached to one. + FString ABTestParent; + + // Unique identifier for this segment. + FString Id; + + // [optional] Segment name. + FString Name; + + FGetSegmentResult() : + FPlayFabBaseModel(), + ABTestParent(), + Id(), + Name() + {} + + FGetSegmentResult(const FGetSegmentResult& src) : + FPlayFabBaseModel(), + ABTestParent(src.ABTestParent), + Id(src.Id), + Name(src.Name) + {} + + FGetSegmentResult(const TSharedPtr& obj) : FGetSegmentResult() + { + readFromValue(obj); + } + + ~FGetSegmentResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetAllSegmentsResult : public FPlayFabBaseModel + { + // [optional] Array of segments for this title. + TArray Segments; + FGetAllSegmentsResult() : + FPlayFabBaseModel(), + Segments() + {} + + FGetAllSegmentsResult(const FGetAllSegmentsResult& src) : + FPlayFabBaseModel(), + Segments(src.Segments) + {} + + FGetAllSegmentsResult(const TSharedPtr& obj) : FGetAllSegmentsResult() + { + readFromValue(obj); + } + + ~FGetAllSegmentsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCatalogItemsRequest : public FPlayFabBaseModel + { + // [optional] Which catalog is being requested. If null, uses the default catalog. + FString CatalogVersion; + + FGetCatalogItemsRequest() : + FPlayFabBaseModel(), + CatalogVersion() + {} + + FGetCatalogItemsRequest(const FGetCatalogItemsRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion) + {} + + FGetCatalogItemsRequest(const TSharedPtr& obj) : FGetCatalogItemsRequest() + { + readFromValue(obj); + } + + ~FGetCatalogItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCatalogItemsResult : public FPlayFabBaseModel + { + // [optional] Array of items which can be purchased. + TArray Catalog; + FGetCatalogItemsResult() : + FPlayFabBaseModel(), + Catalog() + {} + + FGetCatalogItemsResult(const FGetCatalogItemsResult& src) : + FPlayFabBaseModel(), + Catalog(src.Catalog) + {} + + FGetCatalogItemsResult(const TSharedPtr& obj) : FGetCatalogItemsResult() + { + readFromValue(obj); + } + + ~FGetCatalogItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterDataRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + Boxed IfChangedFromDataVersion; + + // [optional] Specific keys to search for in the custom user data. + TArray Keys; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetCharacterDataRequest() : + FPlayFabBaseModel(), + CharacterId(), + IfChangedFromDataVersion(), + Keys(), + PlayFabId() + {} + + FGetCharacterDataRequest(const FGetCharacterDataRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + IfChangedFromDataVersion(src.IfChangedFromDataVersion), + Keys(src.Keys), + PlayFabId(src.PlayFabId) + {} + + FGetCharacterDataRequest(const TSharedPtr& obj) : FGetCharacterDataRequest() + { + readFromValue(obj); + } + + ~FGetCharacterDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum UserDataPermission + { + UserDataPermissionPrivate, + UserDataPermissionPublic + }; + + PLAYFABCPP_API void writeUserDataPermissionEnumJSON(UserDataPermission enumVal, JsonWriter& writer); + PLAYFABCPP_API UserDataPermission readUserDataPermissionFromValue(const TSharedPtr& value); + PLAYFABCPP_API UserDataPermission readUserDataPermissionFromValue(const FString& value); + + struct PLAYFABCPP_API FUserDataRecord : public FPlayFabBaseModel + { + // Timestamp for when this data was last updated. + FDateTime LastUpdated; + + /** + * [optional] Indicates whether this data can be read by all users (public) or only the user (private). This is used for GetUserData + * requests being made by one player about another player. + */ + Boxed Permission; + + // [optional] Data stored for the specified user data key. + FString Value; + + FUserDataRecord() : + FPlayFabBaseModel(), + LastUpdated(0), + Permission(), + Value() + {} + + FUserDataRecord(const FUserDataRecord& src) : + FPlayFabBaseModel(), + LastUpdated(src.LastUpdated), + Permission(src.Permission), + Value(src.Value) + {} + + FUserDataRecord(const TSharedPtr& obj) : FUserDataRecord() + { + readFromValue(obj); + } + + ~FUserDataRecord(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterDataResult : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] User specific data for this title. + TMap Data; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetCharacterDataResult() : + FPlayFabBaseModel(), + CharacterId(), + Data(), + DataVersion(0), + PlayFabId() + {} + + FGetCharacterDataResult(const FGetCharacterDataResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Data(src.Data), + DataVersion(src.DataVersion), + PlayFabId(src.PlayFabId) + {} + + FGetCharacterDataResult(const TSharedPtr& obj) : FGetCharacterDataResult() + { + readFromValue(obj); + } + + ~FGetCharacterDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterInventoryRequest : public FPlayFabBaseModel + { + // [optional] Used to limit results to only those from a specific catalog version. + FString CatalogVersion; + + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetCharacterInventoryRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + PlayFabId() + {} + + FGetCharacterInventoryRequest(const FGetCharacterInventoryRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + PlayFabId(src.PlayFabId) + {} + + FGetCharacterInventoryRequest(const TSharedPtr& obj) : FGetCharacterInventoryRequest() + { + readFromValue(obj); + } + + ~FGetCharacterInventoryRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FVirtualCurrencyRechargeTime : public FPlayFabBaseModel + { + /** + * Maximum value to which the regenerating currency will automatically increment. Note that it can exceed this value + * through use of the AddUserVirtualCurrency API call. However, it will not regenerate automatically until it has fallen + * below this value. + */ + int32 RechargeMax; + + // Server timestamp in UTC indicating the next time the virtual currency will be incremented. + FDateTime RechargeTime; + + // Time remaining (in seconds) before the next recharge increment of the virtual currency. + int32 SecondsToRecharge; + + FVirtualCurrencyRechargeTime() : + FPlayFabBaseModel(), + RechargeMax(0), + RechargeTime(0), + SecondsToRecharge(0) + {} + + FVirtualCurrencyRechargeTime(const FVirtualCurrencyRechargeTime& src) : + FPlayFabBaseModel(), + RechargeMax(src.RechargeMax), + RechargeTime(src.RechargeTime), + SecondsToRecharge(src.SecondsToRecharge) + {} + + FVirtualCurrencyRechargeTime(const TSharedPtr& obj) : FVirtualCurrencyRechargeTime() + { + readFromValue(obj); + } + + ~FVirtualCurrencyRechargeTime(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterInventoryResult : public FPlayFabBaseModel + { + // [optional] Unique identifier of the character for this inventory. + FString CharacterId; + + // [optional] Array of inventory items belonging to the character. + TArray Inventory; + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] Array of virtual currency balance(s) belonging to the character. + TMap VirtualCurrency; + // [optional] Array of remaining times and timestamps for virtual currencies. + TMap VirtualCurrencyRechargeTimes; + FGetCharacterInventoryResult() : + FPlayFabBaseModel(), + CharacterId(), + Inventory(), + PlayFabId(), + VirtualCurrency(), + VirtualCurrencyRechargeTimes() + {} + + FGetCharacterInventoryResult(const FGetCharacterInventoryResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Inventory(src.Inventory), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency), + VirtualCurrencyRechargeTimes(src.VirtualCurrencyRechargeTimes) + {} + + FGetCharacterInventoryResult(const TSharedPtr& obj) : FGetCharacterInventoryResult() + { + readFromValue(obj); + } + + ~FGetCharacterInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterLeaderboardRequest : public FPlayFabBaseModel + { + // [optional] Optional character type on which to filter the leaderboard entries. + FString CharacterType; + + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + // First entry in the leaderboard to be retrieved. + int32 StartPosition; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + FGetCharacterLeaderboardRequest() : + FPlayFabBaseModel(), + CharacterType(), + MaxResultsCount(0), + StartPosition(0), + StatisticName() + {} + + FGetCharacterLeaderboardRequest(const FGetCharacterLeaderboardRequest& src) : + FPlayFabBaseModel(), + CharacterType(src.CharacterType), + MaxResultsCount(src.MaxResultsCount), + StartPosition(src.StartPosition), + StatisticName(src.StatisticName) + {} + + FGetCharacterLeaderboardRequest(const TSharedPtr& obj) : FGetCharacterLeaderboardRequest() + { + readFromValue(obj); + } + + ~FGetCharacterLeaderboardRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterLeaderboardResult : public FPlayFabBaseModel + { + // [optional] Ordered list of leaderboard entries. + TArray Leaderboard; + FGetCharacterLeaderboardResult() : + FPlayFabBaseModel(), + Leaderboard() + {} + + FGetCharacterLeaderboardResult(const FGetCharacterLeaderboardResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard) + {} + + FGetCharacterLeaderboardResult(const TSharedPtr& obj) : FGetCharacterLeaderboardResult() + { + readFromValue(obj); + } + + ~FGetCharacterLeaderboardResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterStatisticsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetCharacterStatisticsRequest() : + FPlayFabBaseModel(), + CharacterId(), + PlayFabId() + {} + + FGetCharacterStatisticsRequest(const FGetCharacterStatisticsRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + PlayFabId(src.PlayFabId) + {} + + FGetCharacterStatisticsRequest(const TSharedPtr& obj) : FGetCharacterStatisticsRequest() + { + readFromValue(obj); + } + + ~FGetCharacterStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetCharacterStatisticsResult : public FPlayFabBaseModel + { + // [optional] Unique identifier of the character for the statistics. + FString CharacterId; + + // [optional] Character statistics for the requested user. + TMap CharacterStatistics; + // [optional] PlayFab unique identifier of the user whose character statistics are being returned. + FString PlayFabId; + + FGetCharacterStatisticsResult() : + FPlayFabBaseModel(), + CharacterId(), + CharacterStatistics(), + PlayFabId() + {} + + FGetCharacterStatisticsResult(const FGetCharacterStatisticsResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterStatistics(src.CharacterStatistics), + PlayFabId(src.PlayFabId) + {} + + FGetCharacterStatisticsResult(const TSharedPtr& obj) : FGetCharacterStatisticsResult() + { + readFromValue(obj); + } + + ~FGetCharacterStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentDownloadUrlRequest : public FPlayFabBaseModel + { + // [optional] HTTP method to fetch item - GET or HEAD. Use HEAD when only fetching metadata. Default is GET. + FString HttpMethod; + + // Key of the content item to fetch, usually formatted as a path, e.g. images/a.png + FString Key; + + /** + * [optional] True to download through CDN. CDN provides higher download bandwidth and lower latency. However, if you want the latest, + * non-cached version of the content during development, set this to false. Default is true. + */ + Boxed ThruCDN; + + FGetContentDownloadUrlRequest() : + FPlayFabBaseModel(), + HttpMethod(), + Key(), + ThruCDN() + {} + + FGetContentDownloadUrlRequest(const FGetContentDownloadUrlRequest& src) : + FPlayFabBaseModel(), + HttpMethod(src.HttpMethod), + Key(src.Key), + ThruCDN(src.ThruCDN) + {} + + FGetContentDownloadUrlRequest(const TSharedPtr& obj) : FGetContentDownloadUrlRequest() + { + readFromValue(obj); + } + + ~FGetContentDownloadUrlRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetContentDownloadUrlResult : public FPlayFabBaseModel + { + // [optional] URL for downloading content via HTTP GET or HEAD method. The URL will expire in approximately one hour. + FString URL; + + FGetContentDownloadUrlResult() : + FPlayFabBaseModel(), + URL() + {} + + FGetContentDownloadUrlResult(const FGetContentDownloadUrlResult& src) : + FPlayFabBaseModel(), + URL(src.URL) + {} + + FGetContentDownloadUrlResult(const TSharedPtr& obj) : FGetContentDownloadUrlResult() + { + readFromValue(obj); + } + + ~FGetContentDownloadUrlResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfileViewConstraints : public FPlayFabBaseModel + { + // Whether to show player's avatar URL. Defaults to false + bool ShowAvatarUrl; + + // Whether to show the banned until time. Defaults to false + bool ShowBannedUntil; + + // Whether to show campaign attributions. Defaults to false + bool ShowCampaignAttributions; + + // Whether to show contact email addresses. Defaults to false + bool ShowContactEmailAddresses; + + // Whether to show the created date. Defaults to false + bool ShowCreated; + + // Whether to show the display name. Defaults to false + bool ShowDisplayName; + + // Whether to show the last login time. Defaults to false + bool ShowLastLogin; + + // Whether to show the linked accounts. Defaults to false + bool ShowLinkedAccounts; + + // Whether to show player's locations. Defaults to false + bool ShowLocations; + + // Whether to show player's membership information. Defaults to false + bool ShowMemberships; + + // Whether to show origination. Defaults to false + bool ShowOrigination; + + // Whether to show push notification registrations. Defaults to false + bool ShowPushNotificationRegistrations; + + // Reserved for future development + bool ShowStatistics; + + // Whether to show tags. Defaults to false + bool ShowTags; + + // Whether to show the total value to date in usd. Defaults to false + bool ShowTotalValueToDateInUsd; + + // Whether to show the values to date. Defaults to false + bool ShowValuesToDate; + + FPlayerProfileViewConstraints() : + FPlayFabBaseModel(), + ShowAvatarUrl(false), + ShowBannedUntil(false), + ShowCampaignAttributions(false), + ShowContactEmailAddresses(false), + ShowCreated(false), + ShowDisplayName(false), + ShowLastLogin(false), + ShowLinkedAccounts(false), + ShowLocations(false), + ShowMemberships(false), + ShowOrigination(false), + ShowPushNotificationRegistrations(false), + ShowStatistics(false), + ShowTags(false), + ShowTotalValueToDateInUsd(false), + ShowValuesToDate(false) + {} + + FPlayerProfileViewConstraints(const FPlayerProfileViewConstraints& src) : + FPlayFabBaseModel(), + ShowAvatarUrl(src.ShowAvatarUrl), + ShowBannedUntil(src.ShowBannedUntil), + ShowCampaignAttributions(src.ShowCampaignAttributions), + ShowContactEmailAddresses(src.ShowContactEmailAddresses), + ShowCreated(src.ShowCreated), + ShowDisplayName(src.ShowDisplayName), + ShowLastLogin(src.ShowLastLogin), + ShowLinkedAccounts(src.ShowLinkedAccounts), + ShowLocations(src.ShowLocations), + ShowMemberships(src.ShowMemberships), + ShowOrigination(src.ShowOrigination), + ShowPushNotificationRegistrations(src.ShowPushNotificationRegistrations), + ShowStatistics(src.ShowStatistics), + ShowTags(src.ShowTags), + ShowTotalValueToDateInUsd(src.ShowTotalValueToDateInUsd), + ShowValuesToDate(src.ShowValuesToDate) + {} + + FPlayerProfileViewConstraints(const TSharedPtr& obj) : FPlayerProfileViewConstraints() + { + readFromValue(obj); + } + + ~FPlayerProfileViewConstraints(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendLeaderboardRequest : public FPlayFabBaseModel + { + // [optional] Indicates whether Facebook friends should be included in the response. Default is true. + Boxed IncludeFacebookFriends; + + // [optional] Indicates whether Steam service friends should be included in the response. Default is true. + Boxed IncludeSteamFriends; + + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + // The player whose friend leaderboard to get + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // Position in the leaderboard to start this listing (defaults to the first entry). + int32 StartPosition; + + // Statistic used to rank friends for this leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + // [optional] Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. + FString XboxToken; + + FGetFriendLeaderboardRequest() : + FPlayFabBaseModel(), + IncludeFacebookFriends(), + IncludeSteamFriends(), + MaxResultsCount(0), + PlayFabId(), + ProfileConstraints(nullptr), + StartPosition(0), + StatisticName(), + UseSpecificVersion(), + Version(), + XboxToken() + {} + + FGetFriendLeaderboardRequest(const FGetFriendLeaderboardRequest& src) : + FPlayFabBaseModel(), + IncludeFacebookFriends(src.IncludeFacebookFriends), + IncludeSteamFriends(src.IncludeSteamFriends), + MaxResultsCount(src.MaxResultsCount), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StartPosition(src.StartPosition), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version), + XboxToken(src.XboxToken) + {} + + FGetFriendLeaderboardRequest(const TSharedPtr& obj) : FGetFriendLeaderboardRequest() + { + readFromValue(obj); + } + + ~FGetFriendLeaderboardRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendsListRequest : public FPlayFabBaseModel + { + // [optional] Indicates whether Facebook friends should be included in the response. Default is true. + Boxed IncludeFacebookFriends; + + // [optional] Indicates whether Steam service friends should be included in the response. Default is true. + Boxed IncludeSteamFriends; + + // PlayFab identifier of the player whose friend list to get. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // [optional] Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab. + FString XboxToken; + + FGetFriendsListRequest() : + FPlayFabBaseModel(), + IncludeFacebookFriends(), + IncludeSteamFriends(), + PlayFabId(), + ProfileConstraints(nullptr), + XboxToken() + {} + + FGetFriendsListRequest(const FGetFriendsListRequest& src) : + FPlayFabBaseModel(), + IncludeFacebookFriends(src.IncludeFacebookFriends), + IncludeSteamFriends(src.IncludeSteamFriends), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + XboxToken(src.XboxToken) + {} + + FGetFriendsListRequest(const TSharedPtr& obj) : FGetFriendsListRequest() + { + readFromValue(obj); + } + + ~FGetFriendsListRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetFriendsListResult : public FPlayFabBaseModel + { + // [optional] Array of friends found. + TArray Friends; + FGetFriendsListResult() : + FPlayFabBaseModel(), + Friends() + {} + + FGetFriendsListResult(const FGetFriendsListResult& src) : + FPlayFabBaseModel(), + Friends(src.Friends) + {} + + FGetFriendsListResult(const TSharedPtr& obj) : FGetFriendsListResult() + { + readFromValue(obj); + } + + ~FGetFriendsListResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundCharacterRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] Optional character type on which to filter the leaderboard entries. + FString CharacterType; + + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + FGetLeaderboardAroundCharacterRequest() : + FPlayFabBaseModel(), + CharacterId(), + CharacterType(), + MaxResultsCount(0), + PlayFabId(), + StatisticName() + {} + + FGetLeaderboardAroundCharacterRequest(const FGetLeaderboardAroundCharacterRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterType(src.CharacterType), + MaxResultsCount(src.MaxResultsCount), + PlayFabId(src.PlayFabId), + StatisticName(src.StatisticName) + {} + + FGetLeaderboardAroundCharacterRequest(const TSharedPtr& obj) : FGetLeaderboardAroundCharacterRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundCharacterRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundCharacterResult : public FPlayFabBaseModel + { + // [optional] Ordered list of leaderboard entries. + TArray Leaderboard; + FGetLeaderboardAroundCharacterResult() : + FPlayFabBaseModel(), + Leaderboard() + {} + + FGetLeaderboardAroundCharacterResult(const FGetLeaderboardAroundCharacterResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard) + {} + + FGetLeaderboardAroundCharacterResult(const TSharedPtr& obj) : FGetLeaderboardAroundCharacterResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundUserRequest : public FPlayFabBaseModel + { + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + FGetLeaderboardAroundUserRequest() : + FPlayFabBaseModel(), + MaxResultsCount(0), + PlayFabId(), + ProfileConstraints(nullptr), + StatisticName(), + UseSpecificVersion(), + Version() + {} + + FGetLeaderboardAroundUserRequest(const FGetLeaderboardAroundUserRequest& src) : + FPlayFabBaseModel(), + MaxResultsCount(src.MaxResultsCount), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version) + {} + + FGetLeaderboardAroundUserRequest(const TSharedPtr& obj) : FGetLeaderboardAroundUserRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLeaderboardEntry : public FPlayFabBaseModel + { + // [optional] Title-specific display name of the user for this leaderboard entry. + FString DisplayName; + + // [optional] PlayFab unique identifier of the user for this leaderboard entry. + FString PlayFabId; + + // User's overall position in the leaderboard. + int32 Position; + + // [optional] The profile of the user, if requested. + TSharedPtr Profile; + + // Specific value of the user's statistic. + int32 StatValue; + + FPlayerLeaderboardEntry() : + FPlayFabBaseModel(), + DisplayName(), + PlayFabId(), + Position(0), + Profile(nullptr), + StatValue(0) + {} + + FPlayerLeaderboardEntry(const FPlayerLeaderboardEntry& src) : + FPlayFabBaseModel(), + DisplayName(src.DisplayName), + PlayFabId(src.PlayFabId), + Position(src.Position), + Profile(src.Profile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.Profile)) : nullptr), + StatValue(src.StatValue) + {} + + FPlayerLeaderboardEntry(const TSharedPtr& obj) : FPlayerLeaderboardEntry() + { + readFromValue(obj); + } + + ~FPlayerLeaderboardEntry(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardAroundUserResult : public FPlayFabBaseModel + { + // [optional] Ordered listing of users and their positions in the requested leaderboard. + TArray Leaderboard; + // [optional] The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. + Boxed NextReset; + + // The version of the leaderboard returned. + int32 Version; + + FGetLeaderboardAroundUserResult() : + FPlayFabBaseModel(), + Leaderboard(), + NextReset(), + Version(0) + {} + + FGetLeaderboardAroundUserResult(const FGetLeaderboardAroundUserResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard), + NextReset(src.NextReset), + Version(src.Version) + {} + + FGetLeaderboardAroundUserResult(const TSharedPtr& obj) : FGetLeaderboardAroundUserResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardAroundUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardForUsersCharactersRequest : public FPlayFabBaseModel + { + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + FGetLeaderboardForUsersCharactersRequest() : + FPlayFabBaseModel(), + MaxResultsCount(0), + PlayFabId(), + StatisticName() + {} + + FGetLeaderboardForUsersCharactersRequest(const FGetLeaderboardForUsersCharactersRequest& src) : + FPlayFabBaseModel(), + MaxResultsCount(src.MaxResultsCount), + PlayFabId(src.PlayFabId), + StatisticName(src.StatisticName) + {} + + FGetLeaderboardForUsersCharactersRequest(const TSharedPtr& obj) : FGetLeaderboardForUsersCharactersRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardForUsersCharactersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardForUsersCharactersResult : public FPlayFabBaseModel + { + // [optional] Ordered list of leaderboard entries. + TArray Leaderboard; + FGetLeaderboardForUsersCharactersResult() : + FPlayFabBaseModel(), + Leaderboard() + {} + + FGetLeaderboardForUsersCharactersResult(const FGetLeaderboardForUsersCharactersResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard) + {} + + FGetLeaderboardForUsersCharactersResult(const TSharedPtr& obj) : FGetLeaderboardForUsersCharactersResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardForUsersCharactersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardRequest : public FPlayFabBaseModel + { + // Maximum number of entries to retrieve. + int32 MaxResultsCount; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + // First entry in the leaderboard to be retrieved. + int32 StartPosition; + + // Unique identifier for the title-specific statistic for the leaderboard. + FString StatisticName; + + // [optional] If set to false, Version is considered null. If true, uses the specified Version + Boxed UseSpecificVersion; + + // [optional] The version of the leaderboard to get. + Boxed Version; + + FGetLeaderboardRequest() : + FPlayFabBaseModel(), + MaxResultsCount(0), + ProfileConstraints(nullptr), + StartPosition(0), + StatisticName(), + UseSpecificVersion(), + Version() + {} + + FGetLeaderboardRequest(const FGetLeaderboardRequest& src) : + FPlayFabBaseModel(), + MaxResultsCount(src.MaxResultsCount), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + StartPosition(src.StartPosition), + StatisticName(src.StatisticName), + UseSpecificVersion(src.UseSpecificVersion), + Version(src.Version) + {} + + FGetLeaderboardRequest(const TSharedPtr& obj) : FGetLeaderboardRequest() + { + readFromValue(obj); + } + + ~FGetLeaderboardRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetLeaderboardResult : public FPlayFabBaseModel + { + // [optional] Ordered listing of users and their positions in the requested leaderboard. + TArray Leaderboard; + // [optional] The time the next scheduled reset will occur. Null if the leaderboard does not reset on a schedule. + Boxed NextReset; + + // The version of the leaderboard returned. + int32 Version; + + FGetLeaderboardResult() : + FPlayFabBaseModel(), + Leaderboard(), + NextReset(), + Version(0) + {} + + FGetLeaderboardResult(const FGetLeaderboardResult& src) : + FPlayFabBaseModel(), + Leaderboard(src.Leaderboard), + NextReset(src.NextReset), + Version(src.Version) + {} + + FGetLeaderboardResult(const TSharedPtr& obj) : FGetLeaderboardResult() + { + readFromValue(obj); + } + + ~FGetLeaderboardResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoRequestParams : public FPlayFabBaseModel + { + // Whether to get character inventories. Defaults to false. + bool GetCharacterInventories; + + // Whether to get the list of characters. Defaults to false. + bool GetCharacterList; + + // Whether to get player profile. Defaults to false. + bool GetPlayerProfile; + + // Whether to get player statistics. Defaults to false. + bool GetPlayerStatistics; + + // Whether to get title data. Defaults to false. + bool GetTitleData; + + // Whether to get the player's account Info. Defaults to false + bool GetUserAccountInfo; + + // Whether to get the player's custom data. Defaults to false + bool GetUserData; + + // Whether to get the player's inventory. Defaults to false + bool GetUserInventory; + + // Whether to get the player's read only data. Defaults to false + bool GetUserReadOnlyData; + + // Whether to get the player's virtual currency balances. Defaults to false + bool GetUserVirtualCurrency; + + // [optional] Specific statistics to retrieve. Leave null to get all keys. Has no effect if GetPlayerStatistics is false + TArray PlayerStatisticNames; + // [optional] Specifies the properties to return from the player profile. Defaults to returning the player's display name. + TSharedPtr ProfileConstraints; + + // [optional] Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetTitleData is false + TArray TitleDataKeys; + // [optional] Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetUserData is false + TArray UserDataKeys; + /** + * [optional] Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetUserReadOnlyData is + * false + */ + TArray UserReadOnlyDataKeys; + FGetPlayerCombinedInfoRequestParams() : + FPlayFabBaseModel(), + GetCharacterInventories(false), + GetCharacterList(false), + GetPlayerProfile(false), + GetPlayerStatistics(false), + GetTitleData(false), + GetUserAccountInfo(false), + GetUserData(false), + GetUserInventory(false), + GetUserReadOnlyData(false), + GetUserVirtualCurrency(false), + PlayerStatisticNames(), + ProfileConstraints(nullptr), + TitleDataKeys(), + UserDataKeys(), + UserReadOnlyDataKeys() + {} + + FGetPlayerCombinedInfoRequestParams(const FGetPlayerCombinedInfoRequestParams& src) : + FPlayFabBaseModel(), + GetCharacterInventories(src.GetCharacterInventories), + GetCharacterList(src.GetCharacterList), + GetPlayerProfile(src.GetPlayerProfile), + GetPlayerStatistics(src.GetPlayerStatistics), + GetTitleData(src.GetTitleData), + GetUserAccountInfo(src.GetUserAccountInfo), + GetUserData(src.GetUserData), + GetUserInventory(src.GetUserInventory), + GetUserReadOnlyData(src.GetUserReadOnlyData), + GetUserVirtualCurrency(src.GetUserVirtualCurrency), + PlayerStatisticNames(src.PlayerStatisticNames), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr), + TitleDataKeys(src.TitleDataKeys), + UserDataKeys(src.UserDataKeys), + UserReadOnlyDataKeys(src.UserReadOnlyDataKeys) + {} + + FGetPlayerCombinedInfoRequestParams(const TSharedPtr& obj) : FGetPlayerCombinedInfoRequestParams() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoRequestParams(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoRequest : public FPlayFabBaseModel + { + // Flags for which pieces of info to return for the user. + FGetPlayerCombinedInfoRequestParams InfoRequestParameters; + + // PlayFabId of the user whose data will be returned + FString PlayFabId; + + FGetPlayerCombinedInfoRequest() : + FPlayFabBaseModel(), + InfoRequestParameters(), + PlayFabId() + {} + + FGetPlayerCombinedInfoRequest(const FGetPlayerCombinedInfoRequest& src) : + FPlayFabBaseModel(), + InfoRequestParameters(src.InfoRequestParameters), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerCombinedInfoRequest(const TSharedPtr& obj) : FGetPlayerCombinedInfoRequest() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticValue : public FPlayFabBaseModel + { + // [optional] unique name of the statistic + FString StatisticName; + + // statistic value for the player + int32 Value; + + // for updates to an existing statistic value for a player, the version of the statistic when it was loaded + uint32 Version; + + FStatisticValue() : + FPlayFabBaseModel(), + StatisticName(), + Value(0), + Version(0) + {} + + FStatisticValue(const FStatisticValue& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName), + Value(src.Value), + Version(src.Version) + {} + + FStatisticValue(const TSharedPtr& obj) : FStatisticValue() + { + readFromValue(obj); + } + + ~FStatisticValue(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoResultPayload : public FPlayFabBaseModel + { + // [optional] Account information for the user. This is always retrieved. + TSharedPtr AccountInfo; + + // [optional] Inventories for each character for the user. + TArray CharacterInventories; + // [optional] List of characters for the user. + TArray CharacterList; + /** + * [optional] The profile of the players. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + TSharedPtr PlayerProfile; + + // [optional] List of statistics for this player. + TArray PlayerStatistics; + // [optional] Title data for this title. + TMap TitleData; + // [optional] User specific custom data. + TMap UserData; + // The version of the UserData that was returned. + uint32 UserDataVersion; + + // [optional] Array of inventory items in the user's current inventory. + TArray UserInventory; + // [optional] User specific read-only data. + TMap UserReadOnlyData; + // The version of the Read-Only UserData that was returned. + uint32 UserReadOnlyDataVersion; + + // [optional] Dictionary of virtual currency balance(s) belonging to the user. + TMap UserVirtualCurrency; + // [optional] Dictionary of remaining times and timestamps for virtual currencies. + TMap UserVirtualCurrencyRechargeTimes; + FGetPlayerCombinedInfoResultPayload() : + FPlayFabBaseModel(), + AccountInfo(nullptr), + CharacterInventories(), + CharacterList(), + PlayerProfile(nullptr), + PlayerStatistics(), + TitleData(), + UserData(), + UserDataVersion(0), + UserInventory(), + UserReadOnlyData(), + UserReadOnlyDataVersion(0), + UserVirtualCurrency(), + UserVirtualCurrencyRechargeTimes() + {} + + FGetPlayerCombinedInfoResultPayload(const FGetPlayerCombinedInfoResultPayload& src) : + FPlayFabBaseModel(), + AccountInfo(src.AccountInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.AccountInfo)) : nullptr), + CharacterInventories(src.CharacterInventories), + CharacterList(src.CharacterList), + PlayerProfile(src.PlayerProfile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.PlayerProfile)) : nullptr), + PlayerStatistics(src.PlayerStatistics), + TitleData(src.TitleData), + UserData(src.UserData), + UserDataVersion(src.UserDataVersion), + UserInventory(src.UserInventory), + UserReadOnlyData(src.UserReadOnlyData), + UserReadOnlyDataVersion(src.UserReadOnlyDataVersion), + UserVirtualCurrency(src.UserVirtualCurrency), + UserVirtualCurrencyRechargeTimes(src.UserVirtualCurrencyRechargeTimes) + {} + + FGetPlayerCombinedInfoResultPayload(const TSharedPtr& obj) : FGetPlayerCombinedInfoResultPayload() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoResultPayload(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerCombinedInfoResult : public FPlayFabBaseModel + { + // [optional] Results for requested info. + TSharedPtr InfoResultPayload; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayerCombinedInfoResult() : + FPlayFabBaseModel(), + InfoResultPayload(nullptr), + PlayFabId() + {} + + FGetPlayerCombinedInfoResult(const FGetPlayerCombinedInfoResult& src) : + FPlayFabBaseModel(), + InfoResultPayload(src.InfoResultPayload.IsValid() ? MakeShareable(new FGetPlayerCombinedInfoResultPayload(*src.InfoResultPayload)) : nullptr), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerCombinedInfoResult(const TSharedPtr& obj) : FGetPlayerCombinedInfoResult() + { + readFromValue(obj); + } + + ~FGetPlayerCombinedInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerProfileRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + /** + * [optional] If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, + * only the allowed client profile properties for the title may be requested. These allowed properties are configured in + * the Game Manager "Client Profile Options" tab in the "Settings" section. + */ + TSharedPtr ProfileConstraints; + + FGetPlayerProfileRequest() : + FPlayFabBaseModel(), + PlayFabId(), + ProfileConstraints(nullptr) + {} + + FGetPlayerProfileRequest(const FGetPlayerProfileRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + ProfileConstraints(src.ProfileConstraints.IsValid() ? MakeShareable(new FPlayerProfileViewConstraints(*src.ProfileConstraints)) : nullptr) + {} + + FGetPlayerProfileRequest(const TSharedPtr& obj) : FGetPlayerProfileRequest() + { + readFromValue(obj); + } + + ~FGetPlayerProfileRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerProfileResult : public FPlayFabBaseModel + { + /** + * [optional] The profile of the player. This profile is not guaranteed to be up-to-date. For a new player, this profile will not + * exist. + */ + TSharedPtr PlayerProfile; + + FGetPlayerProfileResult() : + FPlayFabBaseModel(), + PlayerProfile(nullptr) + {} + + FGetPlayerProfileResult(const FGetPlayerProfileResult& src) : + FPlayFabBaseModel(), + PlayerProfile(src.PlayerProfile.IsValid() ? MakeShareable(new FPlayerProfileModel(*src.PlayerProfile)) : nullptr) + {} + + FGetPlayerProfileResult(const TSharedPtr& obj) : FGetPlayerProfileResult() + { + readFromValue(obj); + } + + ~FGetPlayerProfileResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerSegmentsResult : public FPlayFabBaseModel + { + // [optional] Array of segments the requested player currently belongs to. + TArray Segments; + FGetPlayerSegmentsResult() : + FPlayFabBaseModel(), + Segments() + {} + + FGetPlayerSegmentsResult(const FGetPlayerSegmentsResult& src) : + FPlayFabBaseModel(), + Segments(src.Segments) + {} + + FGetPlayerSegmentsResult(const TSharedPtr& obj) : FGetPlayerSegmentsResult() + { + readFromValue(obj); + } + + ~FGetPlayerSegmentsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayersInSegmentRequest : public FPlayFabBaseModel + { + // [optional] Continuation token if retrieving subsequent pages of results. + FString ContinuationToken; + + // [optional] Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. + Boxed MaxBatchSize; + + /** + * [optional] Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging + * results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). + */ + Boxed SecondsToLive; + + // Unique identifier for this segment. + FString SegmentId; + + FGetPlayersInSegmentRequest() : + FPlayFabBaseModel(), + ContinuationToken(), + MaxBatchSize(), + SecondsToLive(), + SegmentId() + {} + + FGetPlayersInSegmentRequest(const FGetPlayersInSegmentRequest& src) : + FPlayFabBaseModel(), + ContinuationToken(src.ContinuationToken), + MaxBatchSize(src.MaxBatchSize), + SecondsToLive(src.SecondsToLive), + SegmentId(src.SegmentId) + {} + + FGetPlayersInSegmentRequest(const TSharedPtr& obj) : FGetPlayersInSegmentRequest() + { + readFromValue(obj); + } + + ~FGetPlayersInSegmentRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLinkedAccount : public FPlayFabBaseModel + { + // [optional] Linked account's email + FString Email; + + // [optional] Authentication platform + Boxed Platform; + + // [optional] Platform user identifier + FString PlatformUserId; + + // [optional] Linked account's username + FString Username; + + FPlayerLinkedAccount() : + FPlayFabBaseModel(), + Email(), + Platform(), + PlatformUserId(), + Username() + {} + + FPlayerLinkedAccount(const FPlayerLinkedAccount& src) : + FPlayFabBaseModel(), + Email(src.Email), + Platform(src.Platform), + PlatformUserId(src.PlatformUserId), + Username(src.Username) + {} + + FPlayerLinkedAccount(const TSharedPtr& obj) : FPlayerLinkedAccount() + { + readFromValue(obj); + } + + ~FPlayerLinkedAccount(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerLocation : public FPlayFabBaseModel + { + // [optional] City of the player's geographic location. + FString City; + + // The two-character continent code for this location + ContinentCode pfContinentCode; + + // The two-character ISO 3166-1 country code for the country associated with the location + CountryCode pfCountryCode; + + // [optional] Latitude coordinate of the player's geographic location. + Boxed Latitude; + + // [optional] Longitude coordinate of the player's geographic location. + Boxed Longitude; + + FPlayerLocation() : + FPlayFabBaseModel(), + City(), + pfContinentCode(), + pfCountryCode(), + Latitude(), + Longitude() + {} + + FPlayerLocation(const FPlayerLocation& src) : + FPlayFabBaseModel(), + City(src.City), + pfContinentCode(src.pfContinentCode), + pfCountryCode(src.pfCountryCode), + Latitude(src.Latitude), + Longitude(src.Longitude) + {} + + FPlayerLocation(const TSharedPtr& obj) : FPlayerLocation() + { + readFromValue(obj); + } + + ~FPlayerLocation(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerStatistic : public FPlayFabBaseModel + { + // [optional] Statistic ID + FString Id; + + // [optional] Statistic name + FString Name; + + // Current statistic value + int32 StatisticValue; + + // Statistic version (0 if not a versioned statistic) + int32 StatisticVersion; + + FPlayerStatistic() : + FPlayFabBaseModel(), + Id(), + Name(), + StatisticValue(0), + StatisticVersion(0) + {} + + FPlayerStatistic(const FPlayerStatistic& src) : + FPlayFabBaseModel(), + Id(src.Id), + Name(src.Name), + StatisticValue(src.StatisticValue), + StatisticVersion(src.StatisticVersion) + {} + + FPlayerStatistic(const TSharedPtr& obj) : FPlayerStatistic() + { + readFromValue(obj); + } + + ~FPlayerStatistic(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPushNotificationRegistration : public FPlayFabBaseModel + { + // [optional] Notification configured endpoint + FString NotificationEndpointARN; + + // [optional] Push notification platform + Boxed Platform; + + FPushNotificationRegistration() : + FPlayFabBaseModel(), + NotificationEndpointARN(), + Platform() + {} + + FPushNotificationRegistration(const FPushNotificationRegistration& src) : + FPlayFabBaseModel(), + NotificationEndpointARN(src.NotificationEndpointARN), + Platform(src.Platform) + {} + + FPushNotificationRegistration(const TSharedPtr& obj) : FPushNotificationRegistration() + { + readFromValue(obj); + } + + ~FPushNotificationRegistration(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerProfile : public FPlayFabBaseModel + { + // [optional] Array of ad campaigns player has been attributed to + TArray AdCampaignAttributions; + // [optional] Image URL of the player's avatar. + FString AvatarUrl; + + // [optional] Banned until UTC Date. If permanent ban this is set for 20 years after the original ban date. + Boxed BannedUntil; + + // [optional] Array of contact email addresses associated with the player + TArray ContactEmailAddresses; + // [optional] Player record created + Boxed Created; + + // [optional] Player Display Name + FString DisplayName; + + // [optional] Last login + Boxed LastLogin; + + // [optional] Array of third party accounts linked to this player + TArray LinkedAccounts; + // [optional] Dictionary of player's locations by type. + TMap Locations; + // [optional] Player account origination + Boxed Origination; + + // [optional] PlayFab Player ID + FString PlayerId; + + // [optional] Array of player statistics + TArray PlayerStatistics; + // [optional] Publisher this player belongs to + FString PublisherId; + + // [optional] Array of configured push notification end points + TArray PushNotificationRegistrations; + // [optional] Dictionary of player's statistics using only the latest version's value + TMap Statistics; + // [optional] List of player's tags for segmentation. + TArray Tags; + // [optional] Title ID this profile applies to + FString TitleId; + + // [optional] A sum of player's total purchases in USD across all currencies. + Boxed TotalValueToDateInUSD; + + // [optional] Dictionary of player's total purchases by currency. + TMap ValuesToDate; + // [optional] Dictionary of player's virtual currency balances + TMap VirtualCurrencyBalances; + FPlayerProfile() : + FPlayFabBaseModel(), + AdCampaignAttributions(), + AvatarUrl(), + BannedUntil(), + ContactEmailAddresses(), + Created(), + DisplayName(), + LastLogin(), + LinkedAccounts(), + Locations(), + Origination(), + PlayerId(), + PlayerStatistics(), + PublisherId(), + PushNotificationRegistrations(), + Statistics(), + Tags(), + TitleId(), + TotalValueToDateInUSD(), + ValuesToDate(), + VirtualCurrencyBalances() + {} + + FPlayerProfile(const FPlayerProfile& src) : + FPlayFabBaseModel(), + AdCampaignAttributions(src.AdCampaignAttributions), + AvatarUrl(src.AvatarUrl), + BannedUntil(src.BannedUntil), + ContactEmailAddresses(src.ContactEmailAddresses), + Created(src.Created), + DisplayName(src.DisplayName), + LastLogin(src.LastLogin), + LinkedAccounts(src.LinkedAccounts), + Locations(src.Locations), + Origination(src.Origination), + PlayerId(src.PlayerId), + PlayerStatistics(src.PlayerStatistics), + PublisherId(src.PublisherId), + PushNotificationRegistrations(src.PushNotificationRegistrations), + Statistics(src.Statistics), + Tags(src.Tags), + TitleId(src.TitleId), + TotalValueToDateInUSD(src.TotalValueToDateInUSD), + ValuesToDate(src.ValuesToDate), + VirtualCurrencyBalances(src.VirtualCurrencyBalances) + {} + + FPlayerProfile(const TSharedPtr& obj) : FPlayerProfile() + { + readFromValue(obj); + } + + ~FPlayerProfile(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayersInSegmentResult : public FPlayFabBaseModel + { + // [optional] Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. + FString ContinuationToken; + + // [optional] Array of player profiles in this segment. + TArray PlayerProfiles; + // Count of profiles matching this segment. + int32 ProfilesInSegment; + + FGetPlayersInSegmentResult() : + FPlayFabBaseModel(), + ContinuationToken(), + PlayerProfiles(), + ProfilesInSegment(0) + {} + + FGetPlayersInSegmentResult(const FGetPlayersInSegmentResult& src) : + FPlayFabBaseModel(), + ContinuationToken(src.ContinuationToken), + PlayerProfiles(src.PlayerProfiles), + ProfilesInSegment(src.ProfilesInSegment) + {} + + FGetPlayersInSegmentResult(const TSharedPtr& obj) : FGetPlayersInSegmentResult() + { + readFromValue(obj); + } + + ~FGetPlayersInSegmentResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayersSegmentsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayersSegmentsRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetPlayersSegmentsRequest(const FGetPlayersSegmentsRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetPlayersSegmentsRequest(const TSharedPtr& obj) : FGetPlayersSegmentsRequest() + { + readFromValue(obj); + } + + ~FGetPlayersSegmentsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticNameVersion : public FPlayFabBaseModel + { + // unique name of the statistic + FString StatisticName; + + // the version of the statistic to be returned + uint32 Version; + + FStatisticNameVersion() : + FPlayFabBaseModel(), + StatisticName(), + Version(0) + {} + + FStatisticNameVersion(const FStatisticNameVersion& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName), + Version(src.Version) + {} + + FStatisticNameVersion(const TSharedPtr& obj) : FStatisticNameVersion() + { + readFromValue(obj); + } + + ~FStatisticNameVersion(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticsRequest : public FPlayFabBaseModel + { + // user for whom statistics are being requested + FString PlayFabId; + + // [optional] statistics to return + TArray StatisticNames; + /** + * [optional] statistics to return, if StatisticNames is not set (only statistics which have a version matching that provided will be + * returned) + */ + TArray StatisticNameVersions; + FGetPlayerStatisticsRequest() : + FPlayFabBaseModel(), + PlayFabId(), + StatisticNames(), + StatisticNameVersions() + {} + + FGetPlayerStatisticsRequest(const FGetPlayerStatisticsRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + StatisticNames(src.StatisticNames), + StatisticNameVersions(src.StatisticNameVersions) + {} + + FGetPlayerStatisticsRequest(const TSharedPtr& obj) : FGetPlayerStatisticsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticsResult : public FPlayFabBaseModel + { + // [optional] PlayFab unique identifier of the user whose statistics are being returned + FString PlayFabId; + + // [optional] User statistics for the requested user. + TArray Statistics; + FGetPlayerStatisticsResult() : + FPlayFabBaseModel(), + PlayFabId(), + Statistics() + {} + + FGetPlayerStatisticsResult(const FGetPlayerStatisticsResult& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + Statistics(src.Statistics) + {} + + FGetPlayerStatisticsResult(const TSharedPtr& obj) : FGetPlayerStatisticsResult() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticVersionsRequest : public FPlayFabBaseModel + { + // [optional] unique name of the statistic + FString StatisticName; + + FGetPlayerStatisticVersionsRequest() : + FPlayFabBaseModel(), + StatisticName() + {} + + FGetPlayerStatisticVersionsRequest(const FGetPlayerStatisticVersionsRequest& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName) + {} + + FGetPlayerStatisticVersionsRequest(const TSharedPtr& obj) : FGetPlayerStatisticVersionsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticVersionsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPlayerStatisticVersion : public FPlayFabBaseModel + { + // time when the statistic version became active + FDateTime ActivationTime; + + // [optional] time when the statistic version became inactive due to statistic version incrementing + Boxed DeactivationTime; + + // [optional] time at which the statistic version was scheduled to become active, based on the configured ResetInterval + Boxed ScheduledActivationTime; + + // [optional] time at which the statistic version was scheduled to become inactive, based on the configured ResetInterval + Boxed ScheduledDeactivationTime; + + // [optional] name of the statistic when the version became active + FString StatisticName; + + // version of the statistic + uint32 Version; + + FPlayerStatisticVersion() : + FPlayFabBaseModel(), + ActivationTime(0), + DeactivationTime(), + ScheduledActivationTime(), + ScheduledDeactivationTime(), + StatisticName(), + Version(0) + {} + + FPlayerStatisticVersion(const FPlayerStatisticVersion& src) : + FPlayFabBaseModel(), + ActivationTime(src.ActivationTime), + DeactivationTime(src.DeactivationTime), + ScheduledActivationTime(src.ScheduledActivationTime), + ScheduledDeactivationTime(src.ScheduledDeactivationTime), + StatisticName(src.StatisticName), + Version(src.Version) + {} + + FPlayerStatisticVersion(const TSharedPtr& obj) : FPlayerStatisticVersion() + { + readFromValue(obj); + } + + ~FPlayerStatisticVersion(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerStatisticVersionsResult : public FPlayFabBaseModel + { + // [optional] version change history of the statistic + TArray StatisticVersions; + FGetPlayerStatisticVersionsResult() : + FPlayFabBaseModel(), + StatisticVersions() + {} + + FGetPlayerStatisticVersionsResult(const FGetPlayerStatisticVersionsResult& src) : + FPlayFabBaseModel(), + StatisticVersions(src.StatisticVersions) + {} + + FGetPlayerStatisticVersionsResult(const TSharedPtr& obj) : FGetPlayerStatisticVersionsResult() + { + readFromValue(obj); + } + + ~FGetPlayerStatisticVersionsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTagsRequest : public FPlayFabBaseModel + { + // [optional] Optional namespace to filter results by + FString Namespace; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetPlayerTagsRequest() : + FPlayFabBaseModel(), + Namespace(), + PlayFabId() + {} + + FGetPlayerTagsRequest(const FGetPlayerTagsRequest& src) : + FPlayFabBaseModel(), + Namespace(src.Namespace), + PlayFabId(src.PlayFabId) + {} + + FGetPlayerTagsRequest(const TSharedPtr& obj) : FGetPlayerTagsRequest() + { + readFromValue(obj); + } + + ~FGetPlayerTagsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayerTagsResult : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Canonical tags (including namespace and tag's name) for the requested user + TArray Tags; + FGetPlayerTagsResult() : + FPlayFabBaseModel(), + PlayFabId(), + Tags() + {} + + FGetPlayerTagsResult(const FGetPlayerTagsResult& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + Tags(src.Tags) + {} + + FGetPlayerTagsResult(const TSharedPtr& obj) : FGetPlayerTagsResult() + { + readFromValue(obj); + } + + ~FGetPlayerTagsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookIDsRequest : public FPlayFabBaseModel + { + // Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. + TArray FacebookIDs; + FGetPlayFabIDsFromFacebookIDsRequest() : + FPlayFabBaseModel(), + FacebookIDs() + {} + + FGetPlayFabIDsFromFacebookIDsRequest(const FGetPlayFabIDsFromFacebookIDsRequest& src) : + FPlayFabBaseModel(), + FacebookIDs(src.FacebookIDs) + {} + + FGetPlayFabIDsFromFacebookIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Facebook identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromFacebookIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromFacebookIDsResult(const FGetPlayFabIDsFromFacebookIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromFacebookIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookInstantGamesIdsRequest : public FPlayFabBaseModel + { + // Array of unique Facebook Instant Games identifiers for which the title needs to get PlayFab identifiers. + TArray FacebookInstantGamesIds; + FGetPlayFabIDsFromFacebookInstantGamesIdsRequest() : + FPlayFabBaseModel(), + FacebookInstantGamesIds() + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsRequest(const FGetPlayFabIDsFromFacebookInstantGamesIdsRequest& src) : + FPlayFabBaseModel(), + FacebookInstantGamesIds(src.FacebookInstantGamesIds) + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookInstantGamesIdsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookInstantGamesIdsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromFacebookInstantGamesIdsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Facebook Instant Games identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromFacebookInstantGamesIdsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsResult(const FGetPlayFabIDsFromFacebookInstantGamesIdsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromFacebookInstantGamesIdsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromFacebookInstantGamesIdsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromFacebookInstantGamesIdsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest : public FPlayFabBaseModel + { + // Array of unique Nintendo Switch Device identifiers for which the title needs to get PlayFab identifiers. + TArray NintendoSwitchDeviceIds; + FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest() : + FPlayFabBaseModel(), + NintendoSwitchDeviceIds() + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest(const FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceIds(src.NintendoSwitchDeviceIds) + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromNintendoSwitchDeviceIdsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FNintendoSwitchPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique Nintendo Switch Device identifier for a user. + FString NintendoSwitchDeviceId; + + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Nintendo Switch Device identifier. + FString PlayFabId; + + FNintendoSwitchPlayFabIdPair() : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(), + PlayFabId() + {} + + FNintendoSwitchPlayFabIdPair(const FNintendoSwitchPlayFabIdPair& src) : + FPlayFabBaseModel(), + NintendoSwitchDeviceId(src.NintendoSwitchDeviceId), + PlayFabId(src.PlayFabId) + {} + + FNintendoSwitchPlayFabIdPair(const TSharedPtr& obj) : FNintendoSwitchPlayFabIdPair() + { + readFromValue(obj); + } + + ~FNintendoSwitchPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Nintendo Switch Device identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(const FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromNintendoSwitchDeviceIdsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromSteamIDsRequest : public FPlayFabBaseModel + { + // [optional] Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. + TArray SteamStringIDs; + FGetPlayFabIDsFromSteamIDsRequest() : + FPlayFabBaseModel(), + SteamStringIDs() + {} + + FGetPlayFabIDsFromSteamIDsRequest(const FGetPlayFabIDsFromSteamIDsRequest& src) : + FPlayFabBaseModel(), + SteamStringIDs(src.SteamStringIDs) + {} + + FGetPlayFabIDsFromSteamIDsRequest(const TSharedPtr& obj) : FGetPlayFabIDsFromSteamIDsRequest() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromSteamIDsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSteamPlayFabIdPair : public FPlayFabBaseModel + { + // [optional] Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Steam identifier. + FString PlayFabId; + + // [optional] Unique Steam identifier for a user. + FString SteamStringId; + + FSteamPlayFabIdPair() : + FPlayFabBaseModel(), + PlayFabId(), + SteamStringId() + {} + + FSteamPlayFabIdPair(const FSteamPlayFabIdPair& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + SteamStringId(src.SteamStringId) + {} + + FSteamPlayFabIdPair(const TSharedPtr& obj) : FSteamPlayFabIdPair() + { + readFromValue(obj); + } + + ~FSteamPlayFabIdPair(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPlayFabIDsFromSteamIDsResult : public FPlayFabBaseModel + { + // [optional] Mapping of Steam identifiers to PlayFab identifiers. + TArray Data; + FGetPlayFabIDsFromSteamIDsResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPlayFabIDsFromSteamIDsResult(const FGetPlayFabIDsFromSteamIDsResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPlayFabIDsFromSteamIDsResult(const TSharedPtr& obj) : FGetPlayFabIDsFromSteamIDsResult() + { + readFromValue(obj); + } + + ~FGetPlayFabIDsFromSteamIDsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPublisherDataRequest : public FPlayFabBaseModel + { + // array of keys to get back data from the Publisher data blob, set by the admin tools + TArray Keys; + FGetPublisherDataRequest() : + FPlayFabBaseModel(), + Keys() + {} + + FGetPublisherDataRequest(const FGetPublisherDataRequest& src) : + FPlayFabBaseModel(), + Keys(src.Keys) + {} + + FGetPublisherDataRequest(const TSharedPtr& obj) : FGetPublisherDataRequest() + { + readFromValue(obj); + } + + ~FGetPublisherDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetPublisherDataResult : public FPlayFabBaseModel + { + // [optional] a dictionary object of key / value pairs + TMap Data; + FGetPublisherDataResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetPublisherDataResult(const FGetPublisherDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetPublisherDataResult(const TSharedPtr& obj) : FGetPublisherDataResult() + { + readFromValue(obj); + } + + ~FGetPublisherDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetRandomResultTablesRequest : public FPlayFabBaseModel + { + /** + * [optional] Specifies the catalog version that should be used to retrieve the Random Result Tables. If unspecified, uses + * default/primary catalog. + */ + FString CatalogVersion; + + // The unique identifier of the Random Result Table to use. + TArray TableIDs; + FGetRandomResultTablesRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + TableIDs() + {} + + FGetRandomResultTablesRequest(const FGetRandomResultTablesRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + TableIDs(src.TableIDs) + {} + + FGetRandomResultTablesRequest(const TSharedPtr& obj) : FGetRandomResultTablesRequest() + { + readFromValue(obj); + } + + ~FGetRandomResultTablesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum ResultTableNodeType + { + ResultTableNodeTypeItemId, + ResultTableNodeTypeTableId + }; + + PLAYFABCPP_API void writeResultTableNodeTypeEnumJSON(ResultTableNodeType enumVal, JsonWriter& writer); + PLAYFABCPP_API ResultTableNodeType readResultTableNodeTypeFromValue(const TSharedPtr& value); + PLAYFABCPP_API ResultTableNodeType readResultTableNodeTypeFromValue(const FString& value); + + struct PLAYFABCPP_API FResultTableNode : public FPlayFabBaseModel + { + // Either an ItemId, or the TableId of another random result table + FString ResultItem; + + // Whether this entry in the table is an item or a link to another table + ResultTableNodeType ResultItemType; + + // How likely this is to be rolled - larger numbers add more weight + int32 Weight; + + FResultTableNode() : + FPlayFabBaseModel(), + ResultItem(), + ResultItemType(), + Weight(0) + {} + + FResultTableNode(const FResultTableNode& src) : + FPlayFabBaseModel(), + ResultItem(src.ResultItem), + ResultItemType(src.ResultItemType), + Weight(src.Weight) + {} + + FResultTableNode(const TSharedPtr& obj) : FResultTableNode() + { + readFromValue(obj); + } + + ~FResultTableNode(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRandomResultTableListing : public FPlayFabBaseModel + { + // [optional] Catalog version this table is associated with + FString CatalogVersion; + + // Child nodes that indicate what kind of drop table item this actually is. + TArray Nodes; + // Unique name for this drop table + FString TableId; + + FRandomResultTableListing() : + FPlayFabBaseModel(), + CatalogVersion(), + Nodes(), + TableId() + {} + + FRandomResultTableListing(const FRandomResultTableListing& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + Nodes(src.Nodes), + TableId(src.TableId) + {} + + FRandomResultTableListing(const TSharedPtr& obj) : FRandomResultTableListing() + { + readFromValue(obj); + } + + ~FRandomResultTableListing(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetRandomResultTablesResult : public FPlayFabBaseModel + { + // [optional] array of random result tables currently available + TMap Tables; + FGetRandomResultTablesResult() : + FPlayFabBaseModel(), + Tables() + {} + + FGetRandomResultTablesResult(const FGetRandomResultTablesResult& src) : + FPlayFabBaseModel(), + Tables(src.Tables) + {} + + FGetRandomResultTablesResult(const TSharedPtr& obj) : FGetRandomResultTablesResult() + { + readFromValue(obj); + } + + ~FGetRandomResultTablesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSharedGroupDataRequest : public FPlayFabBaseModel + { + // [optional] If true, return the list of all members of the shared group. + Boxed GetMembers; + + /** + * [optional] Specific keys to retrieve from the shared group (if not specified, all keys will be returned, while an empty array + * indicates that no keys should be returned). + */ + TArray Keys; + // Unique identifier for the shared group. + FString SharedGroupId; + + FGetSharedGroupDataRequest() : + FPlayFabBaseModel(), + GetMembers(), + Keys(), + SharedGroupId() + {} + + FGetSharedGroupDataRequest(const FGetSharedGroupDataRequest& src) : + FPlayFabBaseModel(), + GetMembers(src.GetMembers), + Keys(src.Keys), + SharedGroupId(src.SharedGroupId) + {} + + FGetSharedGroupDataRequest(const TSharedPtr& obj) : FGetSharedGroupDataRequest() + { + readFromValue(obj); + } + + ~FGetSharedGroupDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSharedGroupDataRecord : public FPlayFabBaseModel + { + // Timestamp for when this data was last updated. + FDateTime LastUpdated; + + // [optional] PlayFabId of the user to last update this value. + FString LastUpdatedBy; + + // [optional] Indicates whether this data can be read by all users (public) or only members of the group (private). + Boxed Permission; + + // [optional] Data stored for the specified group data key. + FString Value; + + FSharedGroupDataRecord() : + FPlayFabBaseModel(), + LastUpdated(0), + LastUpdatedBy(), + Permission(), + Value() + {} + + FSharedGroupDataRecord(const FSharedGroupDataRecord& src) : + FPlayFabBaseModel(), + LastUpdated(src.LastUpdated), + LastUpdatedBy(src.LastUpdatedBy), + Permission(src.Permission), + Value(src.Value) + {} + + FSharedGroupDataRecord(const TSharedPtr& obj) : FSharedGroupDataRecord() + { + readFromValue(obj); + } + + ~FSharedGroupDataRecord(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetSharedGroupDataResult : public FPlayFabBaseModel + { + // [optional] Data for the requested keys. + TMap Data; + // [optional] List of PlayFabId identifiers for the members of this group, if requested. + TArray Members; + FGetSharedGroupDataResult() : + FPlayFabBaseModel(), + Data(), + Members() + {} + + FGetSharedGroupDataResult(const FGetSharedGroupDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data), + Members(src.Members) + {} + + FGetSharedGroupDataResult(const TSharedPtr& obj) : FGetSharedGroupDataResult() + { + readFromValue(obj); + } + + ~FGetSharedGroupDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTimeRequest : public FPlayFabBaseModel + { + FGetTimeRequest() : + FPlayFabBaseModel() + {} + + FGetTimeRequest(const FGetTimeRequest& src) : + FPlayFabBaseModel() + {} + + FGetTimeRequest(const TSharedPtr& obj) : FGetTimeRequest() + { + readFromValue(obj); + } + + ~FGetTimeRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTimeResult : public FPlayFabBaseModel + { + // Current server time when the request was received, in UTC + FDateTime Time; + + FGetTimeResult() : + FPlayFabBaseModel(), + Time(0) + {} + + FGetTimeResult(const FGetTimeResult& src) : + FPlayFabBaseModel(), + Time(src.Time) + {} + + FGetTimeResult(const TSharedPtr& obj) : FGetTimeResult() + { + readFromValue(obj); + } + + ~FGetTimeResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleDataRequest : public FPlayFabBaseModel + { + // [optional] Specific keys to search for in the title data (leave null to get all keys) + TArray Keys; + FGetTitleDataRequest() : + FPlayFabBaseModel(), + Keys() + {} + + FGetTitleDataRequest(const FGetTitleDataRequest& src) : + FPlayFabBaseModel(), + Keys(src.Keys) + {} + + FGetTitleDataRequest(const TSharedPtr& obj) : FGetTitleDataRequest() + { + readFromValue(obj); + } + + ~FGetTitleDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleDataResult : public FPlayFabBaseModel + { + // [optional] a dictionary object of key / value pairs + TMap Data; + FGetTitleDataResult() : + FPlayFabBaseModel(), + Data() + {} + + FGetTitleDataResult(const FGetTitleDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data) + {} + + FGetTitleDataResult(const TSharedPtr& obj) : FGetTitleDataResult() + { + readFromValue(obj); + } + + ~FGetTitleDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleNewsRequest : public FPlayFabBaseModel + { + // [optional] Limits the results to the last n entries. Defaults to 10 if not set. + Boxed Count; + + FGetTitleNewsRequest() : + FPlayFabBaseModel(), + Count() + {} + + FGetTitleNewsRequest(const FGetTitleNewsRequest& src) : + FPlayFabBaseModel(), + Count(src.Count) + {} + + FGetTitleNewsRequest(const TSharedPtr& obj) : FGetTitleNewsRequest() + { + readFromValue(obj); + } + + ~FGetTitleNewsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FTitleNewsItem : public FPlayFabBaseModel + { + // [optional] News item text. + FString Body; + + // [optional] Unique identifier of news item. + FString NewsId; + + // Date and time when the news items was posted. + FDateTime Timestamp; + + // [optional] Title of the news item. + FString Title; + + FTitleNewsItem() : + FPlayFabBaseModel(), + Body(), + NewsId(), + Timestamp(0), + Title() + {} + + FTitleNewsItem(const FTitleNewsItem& src) : + FPlayFabBaseModel(), + Body(src.Body), + NewsId(src.NewsId), + Timestamp(src.Timestamp), + Title(src.Title) + {} + + FTitleNewsItem(const TSharedPtr& obj) : FTitleNewsItem() + { + readFromValue(obj); + } + + ~FTitleNewsItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetTitleNewsResult : public FPlayFabBaseModel + { + // [optional] Array of news items. + TArray News; + FGetTitleNewsResult() : + FPlayFabBaseModel(), + News() + {} + + FGetTitleNewsResult(const FGetTitleNewsResult& src) : + FPlayFabBaseModel(), + News(src.News) + {} + + FGetTitleNewsResult(const TSharedPtr& obj) : FGetTitleNewsResult() + { + readFromValue(obj); + } + + ~FGetTitleNewsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserAccountInfoRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserAccountInfoRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetUserAccountInfoRequest(const FGetUserAccountInfoRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetUserAccountInfoRequest(const TSharedPtr& obj) : FGetUserAccountInfoRequest() + { + readFromValue(obj); + } + + ~FGetUserAccountInfoRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserAccountInfoResult : public FPlayFabBaseModel + { + // [optional] Account details for the user whose information was requested. + TSharedPtr UserInfo; + + FGetUserAccountInfoResult() : + FPlayFabBaseModel(), + UserInfo(nullptr) + {} + + FGetUserAccountInfoResult(const FGetUserAccountInfoResult& src) : + FPlayFabBaseModel(), + UserInfo(src.UserInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.UserInfo)) : nullptr) + {} + + FGetUserAccountInfoResult(const TSharedPtr& obj) : FGetUserAccountInfoResult() + { + readFromValue(obj); + } + + ~FGetUserAccountInfoResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserBansRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserBansRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetUserBansRequest(const FGetUserBansRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetUserBansRequest(const TSharedPtr& obj) : FGetUserBansRequest() + { + readFromValue(obj); + } + + ~FGetUserBansRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserBansResult : public FPlayFabBaseModel + { + // [optional] Information about the bans + TArray BanData; + FGetUserBansResult() : + FPlayFabBaseModel(), + BanData() + {} + + FGetUserBansResult(const FGetUserBansResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FGetUserBansResult(const TSharedPtr& obj) : FGetUserBansResult() + { + readFromValue(obj); + } + + ~FGetUserBansResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserDataRequest : public FPlayFabBaseModel + { + /** + * [optional] The version that currently exists according to the caller. The call will return the data for all of the keys if the + * version in the system is greater than this. + */ + Boxed IfChangedFromDataVersion; + + // [optional] Specific keys to search for in the custom user data. + TArray Keys; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserDataRequest() : + FPlayFabBaseModel(), + IfChangedFromDataVersion(), + Keys(), + PlayFabId() + {} + + FGetUserDataRequest(const FGetUserDataRequest& src) : + FPlayFabBaseModel(), + IfChangedFromDataVersion(src.IfChangedFromDataVersion), + Keys(src.Keys), + PlayFabId(src.PlayFabId) + {} + + FGetUserDataRequest(const TSharedPtr& obj) : FGetUserDataRequest() + { + readFromValue(obj); + } + + ~FGetUserDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserDataResult : public FPlayFabBaseModel + { + // [optional] User specific data for this title. + TMap Data; + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + // [optional] PlayFab unique identifier of the user whose custom data is being returned. + FString PlayFabId; + + FGetUserDataResult() : + FPlayFabBaseModel(), + Data(), + DataVersion(0), + PlayFabId() + {} + + FGetUserDataResult(const FGetUserDataResult& src) : + FPlayFabBaseModel(), + Data(src.Data), + DataVersion(src.DataVersion), + PlayFabId(src.PlayFabId) + {} + + FGetUserDataResult(const TSharedPtr& obj) : FGetUserDataResult() + { + readFromValue(obj); + } + + ~FGetUserDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserInventoryRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGetUserInventoryRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FGetUserInventoryRequest(const FGetUserInventoryRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FGetUserInventoryRequest(const TSharedPtr& obj) : FGetUserInventoryRequest() + { + readFromValue(obj); + } + + ~FGetUserInventoryRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGetUserInventoryResult : public FPlayFabBaseModel + { + // [optional] Array of inventory items belonging to the user. + TArray Inventory; + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] Array of virtual currency balance(s) belonging to the user. + TMap VirtualCurrency; + // [optional] Array of remaining times and timestamps for virtual currencies. + TMap VirtualCurrencyRechargeTimes; + FGetUserInventoryResult() : + FPlayFabBaseModel(), + Inventory(), + PlayFabId(), + VirtualCurrency(), + VirtualCurrencyRechargeTimes() + {} + + FGetUserInventoryResult(const FGetUserInventoryResult& src) : + FPlayFabBaseModel(), + Inventory(src.Inventory), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency), + VirtualCurrencyRechargeTimes(src.VirtualCurrencyRechargeTimes) + {} + + FGetUserInventoryResult(const TSharedPtr& obj) : FGetUserInventoryResult() + { + readFromValue(obj); + } + + ~FGetUserInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantCharacterToUserRequest : public FPlayFabBaseModel + { + // Non-unique display name of the character being granted (1-20 characters in length). + FString CharacterName; + + // Type of the character being granted; statistics can be sliced based on this value. + FString CharacterType; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGrantCharacterToUserRequest() : + FPlayFabBaseModel(), + CharacterName(), + CharacterType(), + PlayFabId() + {} + + FGrantCharacterToUserRequest(const FGrantCharacterToUserRequest& src) : + FPlayFabBaseModel(), + CharacterName(src.CharacterName), + CharacterType(src.CharacterType), + PlayFabId(src.PlayFabId) + {} + + FGrantCharacterToUserRequest(const TSharedPtr& obj) : FGrantCharacterToUserRequest() + { + readFromValue(obj); + } + + ~FGrantCharacterToUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantCharacterToUserResult : public FPlayFabBaseModel + { + // [optional] Unique identifier tagged to this character. + FString CharacterId; + + FGrantCharacterToUserResult() : + FPlayFabBaseModel(), + CharacterId() + {} + + FGrantCharacterToUserResult(const FGrantCharacterToUserResult& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId) + {} + + FGrantCharacterToUserResult(const TSharedPtr& obj) : FGrantCharacterToUserResult() + { + readFromValue(obj); + } + + ~FGrantCharacterToUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantedItemInstance : public FPlayFabBaseModel + { + // [optional] Game specific comment associated with this instance when it was added to the user inventory. + FString Annotation; + + // [optional] Array of unique items that were awarded when this catalog item was purchased. + TArray BundleContents; + /** + * [optional] Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or + * container. + */ + FString BundleParent; + + // [optional] Catalog version for the inventory item, when this instance was created. + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] A set of custom key-value pairs on the inventory item. + TMap CustomData; + // [optional] CatalogItem.DisplayName at the time this item was purchased. + FString DisplayName; + + // [optional] Timestamp for when this instance will expire. + Boxed Expiration; + + // [optional] Class name for the inventory item, as defined in the catalog. + FString ItemClass; + + // [optional] Unique identifier for the inventory item, as defined in the catalog. + FString ItemId; + + // [optional] Unique item identifier for this specific instance of the item. + FString ItemInstanceId; + + // [optional] Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] Timestamp for when this instance was purchased. + Boxed PurchaseDate; + + // [optional] Total number of remaining uses, if this is a consumable item. + Boxed RemainingUses; + + // Result of this operation. + bool Result; + + // [optional] Currency type for the cost of the catalog item. + FString UnitCurrency; + + // Cost of the catalog item in the given currency. + uint32 UnitPrice; + + // [optional] The number of uses that were added or removed to this item in this call. + Boxed UsesIncrementedBy; + + FGrantedItemInstance() : + FPlayFabBaseModel(), + Annotation(), + BundleContents(), + BundleParent(), + CatalogVersion(), + CharacterId(), + CustomData(), + DisplayName(), + Expiration(), + ItemClass(), + ItemId(), + ItemInstanceId(), + PlayFabId(), + PurchaseDate(), + RemainingUses(), + Result(false), + UnitCurrency(), + UnitPrice(0), + UsesIncrementedBy() + {} + + FGrantedItemInstance(const FGrantedItemInstance& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + BundleContents(src.BundleContents), + BundleParent(src.BundleParent), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + CustomData(src.CustomData), + DisplayName(src.DisplayName), + Expiration(src.Expiration), + ItemClass(src.ItemClass), + ItemId(src.ItemId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId), + PurchaseDate(src.PurchaseDate), + RemainingUses(src.RemainingUses), + Result(src.Result), + UnitCurrency(src.UnitCurrency), + UnitPrice(src.UnitPrice), + UsesIncrementedBy(src.UsesIncrementedBy) + {} + + FGrantedItemInstance(const TSharedPtr& obj) : FGrantedItemInstance() + { + readFromValue(obj); + } + + ~FGrantedItemInstance(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToCharacterRequest : public FPlayFabBaseModel + { + // [optional] String detailing any additional information concerning this operation. + FString Annotation; + + // [optional] Catalog version from which items are to be granted. + FString CatalogVersion; + + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] Array of itemIds to grant to the user. + TArray ItemIds; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGrantItemsToCharacterRequest() : + FPlayFabBaseModel(), + Annotation(), + CatalogVersion(), + CharacterId(), + ItemIds(), + PlayFabId() + {} + + FGrantItemsToCharacterRequest(const FGrantItemsToCharacterRequest& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + ItemIds(src.ItemIds), + PlayFabId(src.PlayFabId) + {} + + FGrantItemsToCharacterRequest(const TSharedPtr& obj) : FGrantItemsToCharacterRequest() + { + readFromValue(obj); + } + + ~FGrantItemsToCharacterRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToCharacterResult : public FPlayFabBaseModel + { + // [optional] Array of items granted to users. + TArray ItemGrantResults; + FGrantItemsToCharacterResult() : + FPlayFabBaseModel(), + ItemGrantResults() + {} + + FGrantItemsToCharacterResult(const FGrantItemsToCharacterResult& src) : + FPlayFabBaseModel(), + ItemGrantResults(src.ItemGrantResults) + {} + + FGrantItemsToCharacterResult(const TSharedPtr& obj) : FGrantItemsToCharacterResult() + { + readFromValue(obj); + } + + ~FGrantItemsToCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToUserRequest : public FPlayFabBaseModel + { + // [optional] String detailing any additional information concerning this operation. + FString Annotation; + + // [optional] Catalog version from which items are to be granted. + FString CatalogVersion; + + // Array of itemIds to grant to the user. + TArray ItemIds; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FGrantItemsToUserRequest() : + FPlayFabBaseModel(), + Annotation(), + CatalogVersion(), + ItemIds(), + PlayFabId() + {} + + FGrantItemsToUserRequest(const FGrantItemsToUserRequest& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + CatalogVersion(src.CatalogVersion), + ItemIds(src.ItemIds), + PlayFabId(src.PlayFabId) + {} + + FGrantItemsToUserRequest(const TSharedPtr& obj) : FGrantItemsToUserRequest() + { + readFromValue(obj); + } + + ~FGrantItemsToUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToUserResult : public FPlayFabBaseModel + { + // [optional] Array of items granted to users. + TArray ItemGrantResults; + FGrantItemsToUserResult() : + FPlayFabBaseModel(), + ItemGrantResults() + {} + + FGrantItemsToUserResult(const FGrantItemsToUserResult& src) : + FPlayFabBaseModel(), + ItemGrantResults(src.ItemGrantResults) + {} + + FGrantItemsToUserResult(const TSharedPtr& obj) : FGrantItemsToUserResult() + { + readFromValue(obj); + } + + ~FGrantItemsToUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FItemGrant : public FPlayFabBaseModel + { + // [optional] String detailing any additional information concerning this operation. + FString Annotation; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + // Unique identifier of the catalog item to be granted to the user. + FString ItemId; + + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FItemGrant() : + FPlayFabBaseModel(), + Annotation(), + CharacterId(), + Data(), + ItemId(), + KeysToRemove(), + PlayFabId() + {} + + FItemGrant(const FItemGrant& src) : + FPlayFabBaseModel(), + Annotation(src.Annotation), + CharacterId(src.CharacterId), + Data(src.Data), + ItemId(src.ItemId), + KeysToRemove(src.KeysToRemove), + PlayFabId(src.PlayFabId) + {} + + FItemGrant(const TSharedPtr& obj) : FItemGrant() + { + readFromValue(obj); + } + + ~FItemGrant(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToUsersRequest : public FPlayFabBaseModel + { + // [optional] Catalog version from which items are to be granted. + FString CatalogVersion; + + // Array of items to grant and the users to whom the items are to be granted. + TArray ItemGrants; + FGrantItemsToUsersRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + ItemGrants() + {} + + FGrantItemsToUsersRequest(const FGrantItemsToUsersRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + ItemGrants(src.ItemGrants) + {} + + FGrantItemsToUsersRequest(const TSharedPtr& obj) : FGrantItemsToUsersRequest() + { + readFromValue(obj); + } + + ~FGrantItemsToUsersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FGrantItemsToUsersResult : public FPlayFabBaseModel + { + // [optional] Array of items granted to users. + TArray ItemGrantResults; + FGrantItemsToUsersResult() : + FPlayFabBaseModel(), + ItemGrantResults() + {} + + FGrantItemsToUsersResult(const FGrantItemsToUsersResult& src) : + FPlayFabBaseModel(), + ItemGrantResults(src.ItemGrantResults) + {} + + FGrantItemsToUsersResult(const TSharedPtr& obj) : FGrantItemsToUsersResult() + { + readFromValue(obj); + } + + ~FGrantItemsToUsersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListUsersCharactersRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FListUsersCharactersRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FListUsersCharactersRequest(const FListUsersCharactersRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FListUsersCharactersRequest(const TSharedPtr& obj) : FListUsersCharactersRequest() + { + readFromValue(obj); + } + + ~FListUsersCharactersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FListUsersCharactersResult : public FPlayFabBaseModel + { + // [optional] The requested list of characters. + TArray Characters; + FListUsersCharactersResult() : + FPlayFabBaseModel(), + Characters() + {} + + FListUsersCharactersResult(const FListUsersCharactersResult& src) : + FPlayFabBaseModel(), + Characters(src.Characters) + {} + + FListUsersCharactersResult(const TSharedPtr& obj) : FListUsersCharactersResult() + { + readFromValue(obj); + } + + ~FListUsersCharactersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyCharacterVirtualCurrencyResult : public FPlayFabBaseModel + { + // Balance of the virtual currency after modification. + int32 Balance; + + // [optional] Name of the virtual currency which was modified. + FString VirtualCurrency; + + FModifyCharacterVirtualCurrencyResult() : + FPlayFabBaseModel(), + Balance(0), + VirtualCurrency() + {} + + FModifyCharacterVirtualCurrencyResult(const FModifyCharacterVirtualCurrencyResult& src) : + FPlayFabBaseModel(), + Balance(src.Balance), + VirtualCurrency(src.VirtualCurrency) + {} + + FModifyCharacterVirtualCurrencyResult(const TSharedPtr& obj) : FModifyCharacterVirtualCurrencyResult() + { + readFromValue(obj); + } + + ~FModifyCharacterVirtualCurrencyResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyItemUsesRequest : public FPlayFabBaseModel + { + // Unique instance identifier of the item to be modified. + FString ItemInstanceId; + + // PlayFab unique identifier of the user whose item is being modified. + FString PlayFabId; + + // Number of uses to add to the item. Can be negative to remove uses. + int32 UsesToAdd; + + FModifyItemUsesRequest() : + FPlayFabBaseModel(), + ItemInstanceId(), + PlayFabId(), + UsesToAdd(0) + {} + + FModifyItemUsesRequest(const FModifyItemUsesRequest& src) : + FPlayFabBaseModel(), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId), + UsesToAdd(src.UsesToAdd) + {} + + FModifyItemUsesRequest(const TSharedPtr& obj) : FModifyItemUsesRequest() + { + readFromValue(obj); + } + + ~FModifyItemUsesRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyItemUsesResult : public FPlayFabBaseModel + { + // [optional] Unique instance identifier of the item with uses consumed. + FString ItemInstanceId; + + // Number of uses remaining on the item. + int32 RemainingUses; + + FModifyItemUsesResult() : + FPlayFabBaseModel(), + ItemInstanceId(), + RemainingUses(0) + {} + + FModifyItemUsesResult(const FModifyItemUsesResult& src) : + FPlayFabBaseModel(), + ItemInstanceId(src.ItemInstanceId), + RemainingUses(src.RemainingUses) + {} + + FModifyItemUsesResult(const TSharedPtr& obj) : FModifyItemUsesResult() + { + readFromValue(obj); + } + + ~FModifyItemUsesResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FModifyUserVirtualCurrencyResult : public FPlayFabBaseModel + { + // Balance of the virtual currency after modification. + int32 Balance; + + /** + * Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase + * over this value will be discarded. + */ + int32 BalanceChange; + + // [optional] User currency was subtracted from. + FString PlayFabId; + + // [optional] Name of the virtual currency which was modified. + FString VirtualCurrency; + + FModifyUserVirtualCurrencyResult() : + FPlayFabBaseModel(), + Balance(0), + BalanceChange(0), + PlayFabId(), + VirtualCurrency() + {} + + FModifyUserVirtualCurrencyResult(const FModifyUserVirtualCurrencyResult& src) : + FPlayFabBaseModel(), + Balance(src.Balance), + BalanceChange(src.BalanceChange), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FModifyUserVirtualCurrencyResult(const TSharedPtr& obj) : FModifyUserVirtualCurrencyResult() + { + readFromValue(obj); + } + + ~FModifyUserVirtualCurrencyResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMoveItemToCharacterFromCharacterRequest : public FPlayFabBaseModel + { + // Unique identifier of the character that currently has the item. + FString GivingCharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique identifier of the character that will be receiving the item. + FString ReceivingCharacterId; + + FMoveItemToCharacterFromCharacterRequest() : + FPlayFabBaseModel(), + GivingCharacterId(), + ItemInstanceId(), + PlayFabId(), + ReceivingCharacterId() + {} + + FMoveItemToCharacterFromCharacterRequest(const FMoveItemToCharacterFromCharacterRequest& src) : + FPlayFabBaseModel(), + GivingCharacterId(src.GivingCharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId), + ReceivingCharacterId(src.ReceivingCharacterId) + {} + + FMoveItemToCharacterFromCharacterRequest(const TSharedPtr& obj) : FMoveItemToCharacterFromCharacterRequest() + { + readFromValue(obj); + } + + ~FMoveItemToCharacterFromCharacterRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMoveItemToCharacterFromCharacterResult : public FPlayFabBaseModel + { + FMoveItemToCharacterFromCharacterResult() : + FPlayFabBaseModel() + {} + + FMoveItemToCharacterFromCharacterResult(const FMoveItemToCharacterFromCharacterResult& src) : + FPlayFabBaseModel() + {} + + FMoveItemToCharacterFromCharacterResult(const TSharedPtr& obj) : FMoveItemToCharacterFromCharacterResult() + { + readFromValue(obj); + } + + ~FMoveItemToCharacterFromCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMoveItemToCharacterFromUserRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FMoveItemToCharacterFromUserRequest() : + FPlayFabBaseModel(), + CharacterId(), + ItemInstanceId(), + PlayFabId() + {} + + FMoveItemToCharacterFromUserRequest(const FMoveItemToCharacterFromUserRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FMoveItemToCharacterFromUserRequest(const TSharedPtr& obj) : FMoveItemToCharacterFromUserRequest() + { + readFromValue(obj); + } + + ~FMoveItemToCharacterFromUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMoveItemToCharacterFromUserResult : public FPlayFabBaseModel + { + FMoveItemToCharacterFromUserResult() : + FPlayFabBaseModel() + {} + + FMoveItemToCharacterFromUserResult(const FMoveItemToCharacterFromUserResult& src) : + FPlayFabBaseModel() + {} + + FMoveItemToCharacterFromUserResult(const TSharedPtr& obj) : FMoveItemToCharacterFromUserResult() + { + readFromValue(obj); + } + + ~FMoveItemToCharacterFromUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMoveItemToUserFromCharacterRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FMoveItemToUserFromCharacterRequest() : + FPlayFabBaseModel(), + CharacterId(), + ItemInstanceId(), + PlayFabId() + {} + + FMoveItemToUserFromCharacterRequest(const FMoveItemToUserFromCharacterRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FMoveItemToUserFromCharacterRequest(const TSharedPtr& obj) : FMoveItemToUserFromCharacterRequest() + { + readFromValue(obj); + } + + ~FMoveItemToUserFromCharacterRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FMoveItemToUserFromCharacterResult : public FPlayFabBaseModel + { + FMoveItemToUserFromCharacterResult() : + FPlayFabBaseModel() + {} + + FMoveItemToUserFromCharacterResult(const FMoveItemToUserFromCharacterResult& src) : + FPlayFabBaseModel() + {} + + FMoveItemToUserFromCharacterResult(const TSharedPtr& obj) : FMoveItemToUserFromCharacterResult() + { + readFromValue(obj); + } + + ~FMoveItemToUserFromCharacterResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FNotifyMatchmakerPlayerLeftRequest : public FPlayFabBaseModel + { + // Unique identifier of the Game Instance the user is leaving. + FString LobbyId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FNotifyMatchmakerPlayerLeftRequest() : + FPlayFabBaseModel(), + LobbyId(), + PlayFabId() + {} + + FNotifyMatchmakerPlayerLeftRequest(const FNotifyMatchmakerPlayerLeftRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId), + PlayFabId(src.PlayFabId) + {} + + FNotifyMatchmakerPlayerLeftRequest(const TSharedPtr& obj) : FNotifyMatchmakerPlayerLeftRequest() + { + readFromValue(obj); + } + + ~FNotifyMatchmakerPlayerLeftRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum PlayerConnectionState + { + PlayerConnectionStateUnassigned, + PlayerConnectionStateConnecting, + PlayerConnectionStateParticipating, + PlayerConnectionStateParticipated + }; + + PLAYFABCPP_API void writePlayerConnectionStateEnumJSON(PlayerConnectionState enumVal, JsonWriter& writer); + PLAYFABCPP_API PlayerConnectionState readPlayerConnectionStateFromValue(const TSharedPtr& value); + PLAYFABCPP_API PlayerConnectionState readPlayerConnectionStateFromValue(const FString& value); + + struct PLAYFABCPP_API FNotifyMatchmakerPlayerLeftResult : public FPlayFabBaseModel + { + // [optional] State of user leaving the Game Server Instance. + Boxed PlayerState; + + FNotifyMatchmakerPlayerLeftResult() : + FPlayFabBaseModel(), + PlayerState() + {} + + FNotifyMatchmakerPlayerLeftResult(const FNotifyMatchmakerPlayerLeftResult& src) : + FPlayFabBaseModel(), + PlayerState(src.PlayerState) + {} + + FNotifyMatchmakerPlayerLeftResult(const TSharedPtr& obj) : FNotifyMatchmakerPlayerLeftResult() + { + readFromValue(obj); + } + + ~FNotifyMatchmakerPlayerLeftResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FPushNotificationPackage : public FPlayFabBaseModel + { + // Numerical badge to display on App icon (iOS only) + int32 Badge; + + // [optional] This must be a JSON formatted object. For use with developer-created custom Push Notification plugins + FString CustomData; + + // [optional] Icon file to display with the message (Not supported for iOS) + FString Icon; + + // Content of the message (all platforms) + FString Message; + + // [optional] Sound file to play with the message (all platforms) + FString Sound; + + // Title/Subject of the message. Not supported for iOS + FString Title; + + FPushNotificationPackage() : + FPlayFabBaseModel(), + Badge(0), + CustomData(), + Icon(), + Message(), + Sound(), + Title() + {} + + FPushNotificationPackage(const FPushNotificationPackage& src) : + FPlayFabBaseModel(), + Badge(src.Badge), + CustomData(src.CustomData), + Icon(src.Icon), + Message(src.Message), + Sound(src.Sound), + Title(src.Title) + {} + + FPushNotificationPackage(const TSharedPtr& obj) : FPushNotificationPackage() + { + readFromValue(obj); + } + + ~FPushNotificationPackage(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRedeemCouponRequest : public FPlayFabBaseModel + { + // [optional] Catalog version of the coupon. + FString CatalogVersion; + + // [optional] Optional identifier for the Character that should receive the item. If null, item is added to the player + FString CharacterId; + + // Generated coupon code to redeem. + FString CouponCode; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRedeemCouponRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + CouponCode(), + PlayFabId() + {} + + FRedeemCouponRequest(const FRedeemCouponRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + CouponCode(src.CouponCode), + PlayFabId(src.PlayFabId) + {} + + FRedeemCouponRequest(const TSharedPtr& obj) : FRedeemCouponRequest() + { + readFromValue(obj); + } + + ~FRedeemCouponRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRedeemCouponResult : public FPlayFabBaseModel + { + // [optional] Items granted to the player as a result of redeeming the coupon. + TArray GrantedItems; + FRedeemCouponResult() : + FPlayFabBaseModel(), + GrantedItems() + {} + + FRedeemCouponResult(const FRedeemCouponResult& src) : + FPlayFabBaseModel(), + GrantedItems(src.GrantedItems) + {} + + FRedeemCouponResult(const TSharedPtr& obj) : FRedeemCouponResult() + { + readFromValue(obj); + } + + ~FRedeemCouponResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRedeemMatchmakerTicketRequest : public FPlayFabBaseModel + { + // Unique identifier of the Game Server Instance that is asking for validation of the authorization ticket. + FString LobbyId; + + // Server authorization ticket passed back from a call to Matchmake or StartGame. + FString Ticket; + + FRedeemMatchmakerTicketRequest() : + FPlayFabBaseModel(), + LobbyId(), + Ticket() + {} + + FRedeemMatchmakerTicketRequest(const FRedeemMatchmakerTicketRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId), + Ticket(src.Ticket) + {} + + FRedeemMatchmakerTicketRequest(const TSharedPtr& obj) : FRedeemMatchmakerTicketRequest() + { + readFromValue(obj); + } + + ~FRedeemMatchmakerTicketRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRedeemMatchmakerTicketResult : public FPlayFabBaseModel + { + // [optional] Error value if the ticket was not validated. + FString Error; + + // Boolean indicating whether the ticket was validated by the PlayFab service. + bool TicketIsValid; + + // [optional] User account information for the user validated. + TSharedPtr UserInfo; + + FRedeemMatchmakerTicketResult() : + FPlayFabBaseModel(), + Error(), + TicketIsValid(false), + UserInfo(nullptr) + {} + + FRedeemMatchmakerTicketResult(const FRedeemMatchmakerTicketResult& src) : + FPlayFabBaseModel(), + Error(src.Error), + TicketIsValid(src.TicketIsValid), + UserInfo(src.UserInfo.IsValid() ? MakeShareable(new FUserAccountInfo(*src.UserInfo)) : nullptr) + {} + + FRedeemMatchmakerTicketResult(const TSharedPtr& obj) : FRedeemMatchmakerTicketResult() + { + readFromValue(obj); + } + + ~FRedeemMatchmakerTicketResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRefreshGameServerInstanceHeartbeatRequest : public FPlayFabBaseModel + { + // Unique identifier of the Game Server Instance for which the heartbeat is updated. + FString LobbyId; + + FRefreshGameServerInstanceHeartbeatRequest() : + FPlayFabBaseModel(), + LobbyId() + {} + + FRefreshGameServerInstanceHeartbeatRequest(const FRefreshGameServerInstanceHeartbeatRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId) + {} + + FRefreshGameServerInstanceHeartbeatRequest(const TSharedPtr& obj) : FRefreshGameServerInstanceHeartbeatRequest() + { + readFromValue(obj); + } + + ~FRefreshGameServerInstanceHeartbeatRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRefreshGameServerInstanceHeartbeatResult : public FPlayFabBaseModel + { + FRefreshGameServerInstanceHeartbeatResult() : + FPlayFabBaseModel() + {} + + FRefreshGameServerInstanceHeartbeatResult(const FRefreshGameServerInstanceHeartbeatResult& src) : + FPlayFabBaseModel() + {} + + FRefreshGameServerInstanceHeartbeatResult(const TSharedPtr& obj) : FRefreshGameServerInstanceHeartbeatResult() + { + readFromValue(obj); + } + + ~FRefreshGameServerInstanceHeartbeatResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + enum Region + { + RegionUSCentral, + RegionUSEast, + RegionEUWest, + RegionSingapore, + RegionJapan, + RegionBrazil, + RegionAustralia + }; + + PLAYFABCPP_API void writeRegionEnumJSON(Region enumVal, JsonWriter& writer); + PLAYFABCPP_API Region readRegionFromValue(const TSharedPtr& value); + PLAYFABCPP_API Region readRegionFromValue(const FString& value); + + struct PLAYFABCPP_API FRegisterGameRequest : public FPlayFabBaseModel + { + // Unique identifier of the build running on the Game Server Instance. + FString Build; + + /** + * Game Mode the Game Server instance is running. Note that this must be defined in the Game Modes tab in the PlayFab Game + * Manager, along with the Build ID (the same Game Mode can be defined for multiple Build IDs). + */ + FString GameMode; + + // [optional] Previous lobby id if re-registering an existing game. + FString LobbyId; + + /** + * Region in which the Game Server Instance is running. For matchmaking using non-AWS region names, set this to any AWS + * region and use Tags (below) to specify your custom region. + */ + Region pfRegion; + + // [optional] IPV4 address of the Game Server Instance. + FString ServerHost; + + // [optional] IPV4 address of the game server instance. + FString ServerIPV4Address; + + // [optional] IPV6 address (if any) of the game server instance. + FString ServerIPV6Address; + + // Port number for communication with the Game Server Instance. + FString ServerPort; + + // [optional] Public DNS name (if any) of the server + FString ServerPublicDNSName; + + // [optional] Tags for the Game Server Instance + TMap Tags; + FRegisterGameRequest() : + FPlayFabBaseModel(), + Build(), + GameMode(), + LobbyId(), + pfRegion(), + ServerHost(), + ServerIPV4Address(), + ServerIPV6Address(), + ServerPort(), + ServerPublicDNSName(), + Tags() + {} + + FRegisterGameRequest(const FRegisterGameRequest& src) : + FPlayFabBaseModel(), + Build(src.Build), + GameMode(src.GameMode), + LobbyId(src.LobbyId), + pfRegion(src.pfRegion), + ServerHost(src.ServerHost), + ServerIPV4Address(src.ServerIPV4Address), + ServerIPV6Address(src.ServerIPV6Address), + ServerPort(src.ServerPort), + ServerPublicDNSName(src.ServerPublicDNSName), + Tags(src.Tags) + {} + + FRegisterGameRequest(const TSharedPtr& obj) : FRegisterGameRequest() + { + readFromValue(obj); + } + + ~FRegisterGameRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRegisterGameResponse : public FPlayFabBaseModel + { + /** + * [optional] Unique identifier generated for the Game Server Instance that is registered. If LobbyId is specified in request and the + * game still exists in PlayFab, the LobbyId in request is returned. Otherwise a new lobby id will be returned. + */ + FString LobbyId; + + FRegisterGameResponse() : + FPlayFabBaseModel(), + LobbyId() + {} + + FRegisterGameResponse(const FRegisterGameResponse& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId) + {} + + FRegisterGameResponse(const TSharedPtr& obj) : FRegisterGameResponse() + { + readFromValue(obj); + } + + ~FRegisterGameResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveFriendRequest : public FPlayFabBaseModel + { + // PlayFab identifier of the friend account which is to be removed. + FString FriendPlayFabId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRemoveFriendRequest() : + FPlayFabBaseModel(), + FriendPlayFabId(), + PlayFabId() + {} + + FRemoveFriendRequest(const FRemoveFriendRequest& src) : + FPlayFabBaseModel(), + FriendPlayFabId(src.FriendPlayFabId), + PlayFabId(src.PlayFabId) + {} + + FRemoveFriendRequest(const TSharedPtr& obj) : FRemoveFriendRequest() + { + readFromValue(obj); + } + + ~FRemoveFriendRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemovePlayerTagRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Unique tag for player profile. + FString TagName; + + FRemovePlayerTagRequest() : + FPlayFabBaseModel(), + PlayFabId(), + TagName() + {} + + FRemovePlayerTagRequest(const FRemovePlayerTagRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId), + TagName(src.TagName) + {} + + FRemovePlayerTagRequest(const TSharedPtr& obj) : FRemovePlayerTagRequest() + { + readFromValue(obj); + } + + ~FRemovePlayerTagRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemovePlayerTagResult : public FPlayFabBaseModel + { + FRemovePlayerTagResult() : + FPlayFabBaseModel() + {} + + FRemovePlayerTagResult(const FRemovePlayerTagResult& src) : + FPlayFabBaseModel() + {} + + FRemovePlayerTagResult(const TSharedPtr& obj) : FRemovePlayerTagResult() + { + readFromValue(obj); + } + + ~FRemovePlayerTagResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveSharedGroupMembersRequest : public FPlayFabBaseModel + { + // An array of unique PlayFab assigned ID of the user on whom the operation will be performed. + TArray PlayFabIds; + // Unique identifier for the shared group. + FString SharedGroupId; + + FRemoveSharedGroupMembersRequest() : + FPlayFabBaseModel(), + PlayFabIds(), + SharedGroupId() + {} + + FRemoveSharedGroupMembersRequest(const FRemoveSharedGroupMembersRequest& src) : + FPlayFabBaseModel(), + PlayFabIds(src.PlayFabIds), + SharedGroupId(src.SharedGroupId) + {} + + FRemoveSharedGroupMembersRequest(const TSharedPtr& obj) : FRemoveSharedGroupMembersRequest() + { + readFromValue(obj); + } + + ~FRemoveSharedGroupMembersRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRemoveSharedGroupMembersResult : public FPlayFabBaseModel + { + FRemoveSharedGroupMembersResult() : + FPlayFabBaseModel() + {} + + FRemoveSharedGroupMembersResult(const FRemoveSharedGroupMembersResult& src) : + FPlayFabBaseModel() + {} + + FRemoveSharedGroupMembersResult(const TSharedPtr& obj) : FRemoveSharedGroupMembersResult() + { + readFromValue(obj); + } + + ~FRemoveSharedGroupMembersResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FReportPlayerServerRequest : public FPlayFabBaseModel + { + // [optional] Optional additional comment by reporting player. + FString Comment; + + // Unique PlayFab identifier of the reported player. + FString ReporteeId; + + // PlayFabId of the reporting player. + FString ReporterId; + + FReportPlayerServerRequest() : + FPlayFabBaseModel(), + Comment(), + ReporteeId(), + ReporterId() + {} + + FReportPlayerServerRequest(const FReportPlayerServerRequest& src) : + FPlayFabBaseModel(), + Comment(src.Comment), + ReporteeId(src.ReporteeId), + ReporterId(src.ReporterId) + {} + + FReportPlayerServerRequest(const TSharedPtr& obj) : FReportPlayerServerRequest() + { + readFromValue(obj); + } + + ~FReportPlayerServerRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FReportPlayerServerResult : public FPlayFabBaseModel + { + // The number of remaining reports which may be filed today by this reporting player. + int32 SubmissionsRemaining; + + FReportPlayerServerResult() : + FPlayFabBaseModel(), + SubmissionsRemaining(0) + {} + + FReportPlayerServerResult(const FReportPlayerServerResult& src) : + FPlayFabBaseModel(), + SubmissionsRemaining(src.SubmissionsRemaining) + {} + + FReportPlayerServerResult(const TSharedPtr& obj) : FReportPlayerServerResult() + { + readFromValue(obj); + } + + ~FReportPlayerServerResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeAllBansForUserRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRevokeAllBansForUserRequest() : + FPlayFabBaseModel(), + PlayFabId() + {} + + FRevokeAllBansForUserRequest(const FRevokeAllBansForUserRequest& src) : + FPlayFabBaseModel(), + PlayFabId(src.PlayFabId) + {} + + FRevokeAllBansForUserRequest(const TSharedPtr& obj) : FRevokeAllBansForUserRequest() + { + readFromValue(obj); + } + + ~FRevokeAllBansForUserRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeAllBansForUserResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were revoked. + TArray BanData; + FRevokeAllBansForUserResult() : + FPlayFabBaseModel(), + BanData() + {} + + FRevokeAllBansForUserResult(const FRevokeAllBansForUserResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FRevokeAllBansForUserResult(const TSharedPtr& obj) : FRevokeAllBansForUserResult() + { + readFromValue(obj); + } + + ~FRevokeAllBansForUserResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeBansRequest : public FPlayFabBaseModel + { + // Ids of the bans to be revoked. Maximum 100. + TArray BanIds; + FRevokeBansRequest() : + FPlayFabBaseModel(), + BanIds() + {} + + FRevokeBansRequest(const FRevokeBansRequest& src) : + FPlayFabBaseModel(), + BanIds(src.BanIds) + {} + + FRevokeBansRequest(const TSharedPtr& obj) : FRevokeBansRequest() + { + readFromValue(obj); + } + + ~FRevokeBansRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeBansResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were revoked + TArray BanData; + FRevokeBansResult() : + FPlayFabBaseModel(), + BanData() + {} + + FRevokeBansResult(const FRevokeBansResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FRevokeBansResult(const TSharedPtr& obj) : FRevokeBansResult() + { + readFromValue(obj); + } + + ~FRevokeBansResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItem : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRevokeInventoryItem() : + FPlayFabBaseModel(), + CharacterId(), + ItemInstanceId(), + PlayFabId() + {} + + FRevokeInventoryItem(const FRevokeInventoryItem& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FRevokeInventoryItem(const TSharedPtr& obj) : FRevokeInventoryItem() + { + readFromValue(obj); + } + + ~FRevokeInventoryItem(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItemRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FRevokeInventoryItemRequest() : + FPlayFabBaseModel(), + CharacterId(), + ItemInstanceId(), + PlayFabId() + {} + + FRevokeInventoryItemRequest(const FRevokeInventoryItemRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + ItemInstanceId(src.ItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FRevokeInventoryItemRequest(const TSharedPtr& obj) : FRevokeInventoryItemRequest() + { + readFromValue(obj); + } + + ~FRevokeInventoryItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItemsRequest : public FPlayFabBaseModel + { + // Array of player items to revoke, between 1 and 25 items. + TArray Items; + FRevokeInventoryItemsRequest() : + FPlayFabBaseModel(), + Items() + {} + + FRevokeInventoryItemsRequest(const FRevokeInventoryItemsRequest& src) : + FPlayFabBaseModel(), + Items(src.Items) + {} + + FRevokeInventoryItemsRequest(const TSharedPtr& obj) : FRevokeInventoryItemsRequest() + { + readFromValue(obj); + } + + ~FRevokeInventoryItemsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeItemError : public FPlayFabBaseModel + { + // [optional] Specific error that was encountered. + FString Error; + + // [optional] Item information that failed to be revoked. + TSharedPtr Item; + + FRevokeItemError() : + FPlayFabBaseModel(), + Error(), + Item(nullptr) + {} + + FRevokeItemError(const FRevokeItemError& src) : + FPlayFabBaseModel(), + Error(src.Error), + Item(src.Item.IsValid() ? MakeShareable(new FRevokeInventoryItem(*src.Item)) : nullptr) + {} + + FRevokeItemError(const TSharedPtr& obj) : FRevokeItemError() + { + readFromValue(obj); + } + + ~FRevokeItemError(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryItemsResult : public FPlayFabBaseModel + { + // [optional] Collection of any errors that occurred during processing. + TArray Errors; + FRevokeInventoryItemsResult() : + FPlayFabBaseModel(), + Errors() + {} + + FRevokeInventoryItemsResult(const FRevokeInventoryItemsResult& src) : + FPlayFabBaseModel(), + Errors(src.Errors) + {} + + FRevokeInventoryItemsResult(const TSharedPtr& obj) : FRevokeInventoryItemsResult() + { + readFromValue(obj); + } + + ~FRevokeInventoryItemsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FRevokeInventoryResult : public FPlayFabBaseModel + { + FRevokeInventoryResult() : + FPlayFabBaseModel() + {} + + FRevokeInventoryResult(const FRevokeInventoryResult& src) : + FPlayFabBaseModel() + {} + + FRevokeInventoryResult(const TSharedPtr& obj) : FRevokeInventoryResult() + { + readFromValue(obj); + } + + ~FRevokeInventoryResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendCustomAccountRecoveryEmailRequest : public FPlayFabBaseModel + { + // [optional] User email address attached to their account + FString Email; + + // The email template id of the account recovery email template to send. + FString EmailTemplateId; + + // [optional] The user's username requesting an account recovery. + FString Username; + + FSendCustomAccountRecoveryEmailRequest() : + FPlayFabBaseModel(), + Email(), + EmailTemplateId(), + Username() + {} + + FSendCustomAccountRecoveryEmailRequest(const FSendCustomAccountRecoveryEmailRequest& src) : + FPlayFabBaseModel(), + Email(src.Email), + EmailTemplateId(src.EmailTemplateId), + Username(src.Username) + {} + + FSendCustomAccountRecoveryEmailRequest(const TSharedPtr& obj) : FSendCustomAccountRecoveryEmailRequest() + { + readFromValue(obj); + } + + ~FSendCustomAccountRecoveryEmailRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendCustomAccountRecoveryEmailResult : public FPlayFabBaseModel + { + FSendCustomAccountRecoveryEmailResult() : + FPlayFabBaseModel() + {} + + FSendCustomAccountRecoveryEmailResult(const FSendCustomAccountRecoveryEmailResult& src) : + FPlayFabBaseModel() + {} + + FSendCustomAccountRecoveryEmailResult(const TSharedPtr& obj) : FSendCustomAccountRecoveryEmailResult() + { + readFromValue(obj); + } + + ~FSendCustomAccountRecoveryEmailResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendEmailFromTemplateRequest : public FPlayFabBaseModel + { + // The email template id of the email template to send. + FString EmailTemplateId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FSendEmailFromTemplateRequest() : + FPlayFabBaseModel(), + EmailTemplateId(), + PlayFabId() + {} + + FSendEmailFromTemplateRequest(const FSendEmailFromTemplateRequest& src) : + FPlayFabBaseModel(), + EmailTemplateId(src.EmailTemplateId), + PlayFabId(src.PlayFabId) + {} + + FSendEmailFromTemplateRequest(const TSharedPtr& obj) : FSendEmailFromTemplateRequest() + { + readFromValue(obj); + } + + ~FSendEmailFromTemplateRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendEmailFromTemplateResult : public FPlayFabBaseModel + { + FSendEmailFromTemplateResult() : + FPlayFabBaseModel() + {} + + FSendEmailFromTemplateResult(const FSendEmailFromTemplateResult& src) : + FPlayFabBaseModel() + {} + + FSendEmailFromTemplateResult(const TSharedPtr& obj) : FSendEmailFromTemplateResult() + { + readFromValue(obj); + } + + ~FSendEmailFromTemplateResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendPushNotificationRequest : public FPlayFabBaseModel + { + /** + * [optional] Allows you to provide precisely formatted json to target devices. This is an advanced feature, allowing you to deliver + * to custom plugin logic, fields, or functionality not natively supported by PlayFab. + */ + TArray AdvancedPlatformDelivery; + // [optional] Text of message to send. + FString Message; + + /** + * [optional] Defines all possible push attributes like message, title, icon, etc. Some parameters are device specific - please see + * the PushNotificationPackage documentation for details. + */ + TSharedPtr Package; + + // PlayFabId of the recipient of the push notification. + FString Recipient; + + // [optional] Subject of message to send (may not be displayed in all platforms) + FString Subject; + + // [optional] Target Platforms that should receive the Message or Package. If omitted, we will send to all available platforms. + TArray TargetPlatforms; + FSendPushNotificationRequest() : + FPlayFabBaseModel(), + AdvancedPlatformDelivery(), + Message(), + Package(nullptr), + Recipient(), + Subject(), + TargetPlatforms() + {} + + FSendPushNotificationRequest(const FSendPushNotificationRequest& src) : + FPlayFabBaseModel(), + AdvancedPlatformDelivery(src.AdvancedPlatformDelivery), + Message(src.Message), + Package(src.Package.IsValid() ? MakeShareable(new FPushNotificationPackage(*src.Package)) : nullptr), + Recipient(src.Recipient), + Subject(src.Subject), + TargetPlatforms(src.TargetPlatforms) + {} + + FSendPushNotificationRequest(const TSharedPtr& obj) : FSendPushNotificationRequest() + { + readFromValue(obj); + } + + ~FSendPushNotificationRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSendPushNotificationResult : public FPlayFabBaseModel + { + FSendPushNotificationResult() : + FPlayFabBaseModel() + {} + + FSendPushNotificationResult(const FSendPushNotificationResult& src) : + FPlayFabBaseModel() + {} + + FSendPushNotificationResult(const TSharedPtr& obj) : FSendPushNotificationResult() + { + readFromValue(obj); + } + + ~FSendPushNotificationResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetFriendTagsRequest : public FPlayFabBaseModel + { + // PlayFab identifier of the friend account to which the tag(s) should be applied. + FString FriendPlayFabId; + + // PlayFab identifier of the player whose friend is to be updated. + FString PlayFabId; + + // Array of tags to set on the friend account. + TArray Tags; + FSetFriendTagsRequest() : + FPlayFabBaseModel(), + FriendPlayFabId(), + PlayFabId(), + Tags() + {} + + FSetFriendTagsRequest(const FSetFriendTagsRequest& src) : + FPlayFabBaseModel(), + FriendPlayFabId(src.FriendPlayFabId), + PlayFabId(src.PlayFabId), + Tags(src.Tags) + {} + + FSetFriendTagsRequest(const TSharedPtr& obj) : FSetFriendTagsRequest() + { + readFromValue(obj); + } + + ~FSetFriendTagsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGameServerInstanceDataRequest : public FPlayFabBaseModel + { + // Custom data to set for the specified game server instance. + FString GameServerData; + + // Unique identifier of the Game Instance to be updated, in decimal format. + FString LobbyId; + + FSetGameServerInstanceDataRequest() : + FPlayFabBaseModel(), + GameServerData(), + LobbyId() + {} + + FSetGameServerInstanceDataRequest(const FSetGameServerInstanceDataRequest& src) : + FPlayFabBaseModel(), + GameServerData(src.GameServerData), + LobbyId(src.LobbyId) + {} + + FSetGameServerInstanceDataRequest(const TSharedPtr& obj) : FSetGameServerInstanceDataRequest() + { + readFromValue(obj); + } + + ~FSetGameServerInstanceDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGameServerInstanceDataResult : public FPlayFabBaseModel + { + FSetGameServerInstanceDataResult() : + FPlayFabBaseModel() + {} + + FSetGameServerInstanceDataResult(const FSetGameServerInstanceDataResult& src) : + FPlayFabBaseModel() + {} + + FSetGameServerInstanceDataResult(const TSharedPtr& obj) : FSetGameServerInstanceDataResult() + { + readFromValue(obj); + } + + ~FSetGameServerInstanceDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGameServerInstanceStateRequest : public FPlayFabBaseModel + { + // Unique identifier of the Game Instance to be updated, in decimal format. + FString LobbyId; + + // State to set for the specified game server instance. + GameInstanceState State; + + FSetGameServerInstanceStateRequest() : + FPlayFabBaseModel(), + LobbyId(), + State() + {} + + FSetGameServerInstanceStateRequest(const FSetGameServerInstanceStateRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId), + State(src.State) + {} + + FSetGameServerInstanceStateRequest(const TSharedPtr& obj) : FSetGameServerInstanceStateRequest() + { + readFromValue(obj); + } + + ~FSetGameServerInstanceStateRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGameServerInstanceStateResult : public FPlayFabBaseModel + { + FSetGameServerInstanceStateResult() : + FPlayFabBaseModel() + {} + + FSetGameServerInstanceStateResult(const FSetGameServerInstanceStateResult& src) : + FPlayFabBaseModel() + {} + + FSetGameServerInstanceStateResult(const TSharedPtr& obj) : FSetGameServerInstanceStateResult() + { + readFromValue(obj); + } + + ~FSetGameServerInstanceStateResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGameServerInstanceTagsRequest : public FPlayFabBaseModel + { + // Unique identifier of the Game Server Instance to be updated. + FString LobbyId; + + /** + * Tags to set for the specified Game Server Instance. Note that this is the complete list of tags to be associated with + * the Game Server Instance. + */ + TMap Tags; + FSetGameServerInstanceTagsRequest() : + FPlayFabBaseModel(), + LobbyId(), + Tags() + {} + + FSetGameServerInstanceTagsRequest(const FSetGameServerInstanceTagsRequest& src) : + FPlayFabBaseModel(), + LobbyId(src.LobbyId), + Tags(src.Tags) + {} + + FSetGameServerInstanceTagsRequest(const TSharedPtr& obj) : FSetGameServerInstanceTagsRequest() + { + readFromValue(obj); + } + + ~FSetGameServerInstanceTagsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetGameServerInstanceTagsResult : public FPlayFabBaseModel + { + FSetGameServerInstanceTagsResult() : + FPlayFabBaseModel() + {} + + FSetGameServerInstanceTagsResult(const FSetGameServerInstanceTagsResult& src) : + FPlayFabBaseModel() + {} + + FSetGameServerInstanceTagsResult(const TSharedPtr& obj) : FSetGameServerInstanceTagsResult() + { + readFromValue(obj); + } + + ~FSetGameServerInstanceTagsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPlayerSecretRequest : public FPlayFabBaseModel + { + // Player secret that is used to verify API request signatures (Enterprise Only). + FString PlayerSecret; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FSetPlayerSecretRequest() : + FPlayFabBaseModel(), + PlayerSecret(), + PlayFabId() + {} + + FSetPlayerSecretRequest(const FSetPlayerSecretRequest& src) : + FPlayFabBaseModel(), + PlayerSecret(src.PlayerSecret), + PlayFabId(src.PlayFabId) + {} + + FSetPlayerSecretRequest(const TSharedPtr& obj) : FSetPlayerSecretRequest() + { + readFromValue(obj); + } + + ~FSetPlayerSecretRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPlayerSecretResult : public FPlayFabBaseModel + { + FSetPlayerSecretResult() : + FPlayFabBaseModel() + {} + + FSetPlayerSecretResult(const FSetPlayerSecretResult& src) : + FPlayFabBaseModel() + {} + + FSetPlayerSecretResult(const TSharedPtr& obj) : FSetPlayerSecretResult() + { + readFromValue(obj); + } + + ~FSetPlayerSecretResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPublisherDataRequest : public FPlayFabBaseModel + { + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + FString Key; + + // [optional] new value to set. Set to null to remove a value + FString Value; + + FSetPublisherDataRequest() : + FPlayFabBaseModel(), + Key(), + Value() + {} + + FSetPublisherDataRequest(const FSetPublisherDataRequest& src) : + FPlayFabBaseModel(), + Key(src.Key), + Value(src.Value) + {} + + FSetPublisherDataRequest(const TSharedPtr& obj) : FSetPublisherDataRequest() + { + readFromValue(obj); + } + + ~FSetPublisherDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetPublisherDataResult : public FPlayFabBaseModel + { + FSetPublisherDataResult() : + FPlayFabBaseModel() + {} + + FSetPublisherDataResult(const FSetPublisherDataResult& src) : + FPlayFabBaseModel() + {} + + FSetPublisherDataResult(const TSharedPtr& obj) : FSetPublisherDataResult() + { + readFromValue(obj); + } + + ~FSetPublisherDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetTitleDataRequest : public FPlayFabBaseModel + { + /** + * key we want to set a value on (note, this is additive - will only replace an existing key's value if they are the same + * name.) Keys are trimmed of whitespace. Keys may not begin with the '!' character. + */ + FString Key; + + // [optional] new value to set. Set to null to remove a value + FString Value; + + FSetTitleDataRequest() : + FPlayFabBaseModel(), + Key(), + Value() + {} + + FSetTitleDataRequest(const FSetTitleDataRequest& src) : + FPlayFabBaseModel(), + Key(src.Key), + Value(src.Value) + {} + + FSetTitleDataRequest(const TSharedPtr& obj) : FSetTitleDataRequest() + { + readFromValue(obj); + } + + ~FSetTitleDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSetTitleDataResult : public FPlayFabBaseModel + { + FSetTitleDataResult() : + FPlayFabBaseModel() + {} + + FSetTitleDataResult(const FSetTitleDataResult& src) : + FPlayFabBaseModel() + {} + + FSetTitleDataResult(const TSharedPtr& obj) : FSetTitleDataResult() + { + readFromValue(obj); + } + + ~FSetTitleDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FStatisticUpdate : public FPlayFabBaseModel + { + // unique name of the statistic + FString StatisticName; + + // statistic value for the player + int32 Value; + + /** + * [optional] for updates to an existing statistic value for a player, the version of the statistic when it was loaded. Null when + * setting the statistic value for the first time. + */ + Boxed Version; + + FStatisticUpdate() : + FPlayFabBaseModel(), + StatisticName(), + Value(0), + Version() + {} + + FStatisticUpdate(const FStatisticUpdate& src) : + FPlayFabBaseModel(), + StatisticName(src.StatisticName), + Value(src.Value), + Version(src.Version) + {} + + FStatisticUpdate(const TSharedPtr& obj) : FStatisticUpdate() + { + readFromValue(obj); + } + + ~FStatisticUpdate(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSubtractCharacterVirtualCurrencyRequest : public FPlayFabBaseModel + { + // Amount to be subtracted from the user balance of the specified virtual currency. + int32 Amount; + + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Name of the virtual currency which is to be decremented. + FString VirtualCurrency; + + FSubtractCharacterVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + CharacterId(), + PlayFabId(), + VirtualCurrency() + {} + + FSubtractCharacterVirtualCurrencyRequest(const FSubtractCharacterVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + CharacterId(src.CharacterId), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FSubtractCharacterVirtualCurrencyRequest(const TSharedPtr& obj) : FSubtractCharacterVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FSubtractCharacterVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FSubtractUserVirtualCurrencyRequest : public FPlayFabBaseModel + { + // Amount to be subtracted from the user balance of the specified virtual currency. + int32 Amount; + + // PlayFab unique identifier of the user whose virtual currency balance is to be decreased. + FString PlayFabId; + + // Name of the virtual currency which is to be decremented. + FString VirtualCurrency; + + FSubtractUserVirtualCurrencyRequest() : + FPlayFabBaseModel(), + Amount(0), + PlayFabId(), + VirtualCurrency() + {} + + FSubtractUserVirtualCurrencyRequest(const FSubtractUserVirtualCurrencyRequest& src) : + FPlayFabBaseModel(), + Amount(src.Amount), + PlayFabId(src.PlayFabId), + VirtualCurrency(src.VirtualCurrency) + {} + + FSubtractUserVirtualCurrencyRequest(const TSharedPtr& obj) : FSubtractUserVirtualCurrencyRequest() + { + readFromValue(obj); + } + + ~FSubtractUserVirtualCurrencyRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlockContainerInstanceRequest : public FPlayFabBaseModel + { + /** + * [optional] Specifies the catalog version that should be used to determine container contents. If unspecified, uses catalog + * associated with the item instance. + */ + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // ItemInstanceId of the container to unlock. + FString ContainerItemInstanceId; + + /** + * [optional] ItemInstanceId of the key that will be consumed by unlocking this container. If the container requires a key, this + * parameter is required. + */ + FString KeyItemInstanceId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUnlockContainerInstanceRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + ContainerItemInstanceId(), + KeyItemInstanceId(), + PlayFabId() + {} + + FUnlockContainerInstanceRequest(const FUnlockContainerInstanceRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + ContainerItemInstanceId(src.ContainerItemInstanceId), + KeyItemInstanceId(src.KeyItemInstanceId), + PlayFabId(src.PlayFabId) + {} + + FUnlockContainerInstanceRequest(const TSharedPtr& obj) : FUnlockContainerInstanceRequest() + { + readFromValue(obj); + } + + ~FUnlockContainerInstanceRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlockContainerItemRequest : public FPlayFabBaseModel + { + /** + * [optional] Specifies the catalog version that should be used to determine container contents. If unspecified, uses default/primary + * catalog. + */ + FString CatalogVersion; + + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // Catalog ItemId of the container type to unlock. + FString ContainerItemId; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUnlockContainerItemRequest() : + FPlayFabBaseModel(), + CatalogVersion(), + CharacterId(), + ContainerItemId(), + PlayFabId() + {} + + FUnlockContainerItemRequest(const FUnlockContainerItemRequest& src) : + FPlayFabBaseModel(), + CatalogVersion(src.CatalogVersion), + CharacterId(src.CharacterId), + ContainerItemId(src.ContainerItemId), + PlayFabId(src.PlayFabId) + {} + + FUnlockContainerItemRequest(const TSharedPtr& obj) : FUnlockContainerItemRequest() + { + readFromValue(obj); + } + + ~FUnlockContainerItemRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUnlockContainerItemResult : public FPlayFabBaseModel + { + // [optional] Items granted to the player as a result of unlocking the container. + TArray GrantedItems; + // [optional] Unique instance identifier of the container unlocked. + FString UnlockedItemInstanceId; + + // [optional] Unique instance identifier of the key used to unlock the container, if applicable. + FString UnlockedWithItemInstanceId; + + // [optional] Virtual currency granted to the player as a result of unlocking the container. + TMap VirtualCurrency; + FUnlockContainerItemResult() : + FPlayFabBaseModel(), + GrantedItems(), + UnlockedItemInstanceId(), + UnlockedWithItemInstanceId(), + VirtualCurrency() + {} + + FUnlockContainerItemResult(const FUnlockContainerItemResult& src) : + FPlayFabBaseModel(), + GrantedItems(src.GrantedItems), + UnlockedItemInstanceId(src.UnlockedItemInstanceId), + UnlockedWithItemInstanceId(src.UnlockedWithItemInstanceId), + VirtualCurrency(src.VirtualCurrency) + {} + + FUnlockContainerItemResult(const TSharedPtr& obj) : FUnlockContainerItemResult() + { + readFromValue(obj); + } + + ~FUnlockContainerItemResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateAvatarUrlRequest : public FPlayFabBaseModel + { + // URL of the avatar image. If empty, it removes the existing avatar URL. + FString ImageUrl; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateAvatarUrlRequest() : + FPlayFabBaseModel(), + ImageUrl(), + PlayFabId() + {} + + FUpdateAvatarUrlRequest(const FUpdateAvatarUrlRequest& src) : + FPlayFabBaseModel(), + ImageUrl(src.ImageUrl), + PlayFabId(src.PlayFabId) + {} + + FUpdateAvatarUrlRequest(const TSharedPtr& obj) : FUpdateAvatarUrlRequest() + { + readFromValue(obj); + } + + ~FUpdateAvatarUrlRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateBanRequest : public FPlayFabBaseModel + { + // [optional] The updated active state for the ban. Null for no change. + Boxed Active; + + // The id of the ban to be updated. + FString BanId; + + // [optional] The updated expiration date for the ban. Null for no change. + Boxed Expires; + + // [optional] The updated IP address for the ban. Null for no change. + FString IPAddress; + + // [optional] The updated MAC address for the ban. Null for no change. + FString MACAddress; + + // [optional] Whether to make this ban permanent. Set to true to make this ban permanent. This will not modify Active state. + Boxed Permanent; + + // [optional] The updated reason for the ban to be updated. Maximum 140 characters. Null for no change. + FString Reason; + + FUpdateBanRequest() : + FPlayFabBaseModel(), + Active(), + BanId(), + Expires(), + IPAddress(), + MACAddress(), + Permanent(), + Reason() + {} + + FUpdateBanRequest(const FUpdateBanRequest& src) : + FPlayFabBaseModel(), + Active(src.Active), + BanId(src.BanId), + Expires(src.Expires), + IPAddress(src.IPAddress), + MACAddress(src.MACAddress), + Permanent(src.Permanent), + Reason(src.Reason) + {} + + FUpdateBanRequest(const TSharedPtr& obj) : FUpdateBanRequest() + { + readFromValue(obj); + } + + ~FUpdateBanRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateBansRequest : public FPlayFabBaseModel + { + // List of bans to be updated. Maximum 100. + TArray Bans; + FUpdateBansRequest() : + FPlayFabBaseModel(), + Bans() + {} + + FUpdateBansRequest(const FUpdateBansRequest& src) : + FPlayFabBaseModel(), + Bans(src.Bans) + {} + + FUpdateBansRequest(const TSharedPtr& obj) : FUpdateBansRequest() + { + readFromValue(obj); + } + + ~FUpdateBansRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateBansResult : public FPlayFabBaseModel + { + // [optional] Information on the bans that were updated + TArray BanData; + FUpdateBansResult() : + FPlayFabBaseModel(), + BanData() + {} + + FUpdateBansResult(const FUpdateBansResult& src) : + FPlayFabBaseModel(), + BanData(src.BanData) + {} + + FUpdateBansResult(const TSharedPtr& obj) : FUpdateBansResult() + { + readFromValue(obj); + } + + ~FUpdateBansResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterDataRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // [optional] Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. + Boxed Permission; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateCharacterDataRequest() : + FPlayFabBaseModel(), + CharacterId(), + Data(), + KeysToRemove(), + Permission(), + PlayFabId() + {} + + FUpdateCharacterDataRequest(const FUpdateCharacterDataRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission), + PlayFabId(src.PlayFabId) + {} + + FUpdateCharacterDataRequest(const TSharedPtr& obj) : FUpdateCharacterDataRequest() + { + readFromValue(obj); + } + + ~FUpdateCharacterDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterDataResult : public FPlayFabBaseModel + { + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FUpdateCharacterDataResult() : + FPlayFabBaseModel(), + DataVersion(0) + {} + + FUpdateCharacterDataResult(const FUpdateCharacterDataResult& src) : + FPlayFabBaseModel(), + DataVersion(src.DataVersion) + {} + + FUpdateCharacterDataResult(const TSharedPtr& obj) : FUpdateCharacterDataResult() + { + readFromValue(obj); + } + + ~FUpdateCharacterDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterStatisticsRequest : public FPlayFabBaseModel + { + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + // [optional] Statistics to be updated with the provided values. + TMap CharacterStatistics; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateCharacterStatisticsRequest() : + FPlayFabBaseModel(), + CharacterId(), + CharacterStatistics(), + PlayFabId() + {} + + FUpdateCharacterStatisticsRequest(const FUpdateCharacterStatisticsRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + CharacterStatistics(src.CharacterStatistics), + PlayFabId(src.PlayFabId) + {} + + FUpdateCharacterStatisticsRequest(const TSharedPtr& obj) : FUpdateCharacterStatisticsRequest() + { + readFromValue(obj); + } + + ~FUpdateCharacterStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateCharacterStatisticsResult : public FPlayFabBaseModel + { + FUpdateCharacterStatisticsResult() : + FPlayFabBaseModel() + {} + + FUpdateCharacterStatisticsResult(const FUpdateCharacterStatisticsResult& src) : + FPlayFabBaseModel() + {} + + FUpdateCharacterStatisticsResult(const TSharedPtr& obj) : FUpdateCharacterStatisticsResult() + { + readFromValue(obj); + } + + ~FUpdateCharacterStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerStatisticsRequest : public FPlayFabBaseModel + { + /** + * [optional] Indicates whether the statistics provided should be set, regardless of the aggregation method set on the statistic. + * Default is false. + */ + Boxed ForceUpdate; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // Statistics to be updated with the provided values + TArray Statistics; + FUpdatePlayerStatisticsRequest() : + FPlayFabBaseModel(), + ForceUpdate(), + PlayFabId(), + Statistics() + {} + + FUpdatePlayerStatisticsRequest(const FUpdatePlayerStatisticsRequest& src) : + FPlayFabBaseModel(), + ForceUpdate(src.ForceUpdate), + PlayFabId(src.PlayFabId), + Statistics(src.Statistics) + {} + + FUpdatePlayerStatisticsRequest(const TSharedPtr& obj) : FUpdatePlayerStatisticsRequest() + { + readFromValue(obj); + } + + ~FUpdatePlayerStatisticsRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdatePlayerStatisticsResult : public FPlayFabBaseModel + { + FUpdatePlayerStatisticsResult() : + FPlayFabBaseModel() + {} + + FUpdatePlayerStatisticsResult(const FUpdatePlayerStatisticsResult& src) : + FPlayFabBaseModel() + {} + + FUpdatePlayerStatisticsResult(const TSharedPtr& obj) : FUpdatePlayerStatisticsResult() + { + readFromValue(obj); + } + + ~FUpdatePlayerStatisticsResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateSharedGroupDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // [optional] Permission to be applied to all user data keys in this request. + Boxed Permission; + + // Unique identifier for the shared group. + FString SharedGroupId; + + FUpdateSharedGroupDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + Permission(), + SharedGroupId() + {} + + FUpdateSharedGroupDataRequest(const FUpdateSharedGroupDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission), + SharedGroupId(src.SharedGroupId) + {} + + FUpdateSharedGroupDataRequest(const TSharedPtr& obj) : FUpdateSharedGroupDataRequest() + { + readFromValue(obj); + } + + ~FUpdateSharedGroupDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateSharedGroupDataResult : public FPlayFabBaseModel + { + FUpdateSharedGroupDataResult() : + FPlayFabBaseModel() + {} + + FUpdateSharedGroupDataResult(const FUpdateSharedGroupDataResult& src) : + FPlayFabBaseModel() + {} + + FUpdateSharedGroupDataResult(const TSharedPtr& obj) : FUpdateSharedGroupDataResult() + { + readFromValue(obj); + } + + ~FUpdateSharedGroupDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // [optional] Permission to be applied to all user data keys written in this request. Defaults to "private" if not set. + Boxed Permission; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateUserDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + Permission(), + PlayFabId() + {} + + FUpdateUserDataRequest(const FUpdateUserDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + Permission(src.Permission), + PlayFabId(src.PlayFabId) + {} + + FUpdateUserDataRequest(const TSharedPtr& obj) : FUpdateUserDataRequest() + { + readFromValue(obj); + } + + ~FUpdateUserDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserDataResult : public FPlayFabBaseModel + { + /** + * Indicates the current version of the data that has been set. This is incremented with every set call for that type of + * data (read-only, internal, etc). This version can be provided in Get calls to find updated data. + */ + uint32 DataVersion; + + FUpdateUserDataResult() : + FPlayFabBaseModel(), + DataVersion(0) + {} + + FUpdateUserDataResult(const FUpdateUserDataResult& src) : + FPlayFabBaseModel(), + DataVersion(src.DataVersion) + {} + + FUpdateUserDataResult(const TSharedPtr& obj) : FUpdateUserDataResult() + { + readFromValue(obj); + } + + ~FUpdateUserDataResult(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserInternalDataRequest : public FPlayFabBaseModel + { + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateUserInternalDataRequest() : + FPlayFabBaseModel(), + Data(), + KeysToRemove(), + PlayFabId() + {} + + FUpdateUserInternalDataRequest(const FUpdateUserInternalDataRequest& src) : + FPlayFabBaseModel(), + Data(src.Data), + KeysToRemove(src.KeysToRemove), + PlayFabId(src.PlayFabId) + {} + + FUpdateUserInternalDataRequest(const TSharedPtr& obj) : FUpdateUserInternalDataRequest() + { + readFromValue(obj); + } + + ~FUpdateUserInternalDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FUpdateUserInventoryItemDataRequest : public FPlayFabBaseModel + { + // [optional] Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * [optional] Key-value pairs to be written to the custom data. Note that keys are trimmed of whitespace, are limited in size, and may + * not begin with a '!' character or be null. + */ + TMap Data; + // Unique PlayFab assigned instance identifier of the item + FString ItemInstanceId; + + /** + * [optional] Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language + * constraints. Use this to delete the keys directly. + */ + TArray KeysToRemove; + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + FUpdateUserInventoryItemDataRequest() : + FPlayFabBaseModel(), + CharacterId(), + Data(), + ItemInstanceId(), + KeysToRemove(), + PlayFabId() + {} + + FUpdateUserInventoryItemDataRequest(const FUpdateUserInventoryItemDataRequest& src) : + FPlayFabBaseModel(), + CharacterId(src.CharacterId), + Data(src.Data), + ItemInstanceId(src.ItemInstanceId), + KeysToRemove(src.KeysToRemove), + PlayFabId(src.PlayFabId) + {} + + FUpdateUserInventoryItemDataRequest(const TSharedPtr& obj) : FUpdateUserInventoryItemDataRequest() + { + readFromValue(obj); + } + + ~FUpdateUserInventoryItemDataRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteEventResponse : public FPlayFabBaseModel + { + /** + * [optional] The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to + * any particular format. + */ + FString EventId; + + FWriteEventResponse() : + FPlayFabBaseModel(), + EventId() + {} + + FWriteEventResponse(const FWriteEventResponse& src) : + FPlayFabBaseModel(), + EventId(src.EventId) + {} + + FWriteEventResponse(const TSharedPtr& obj) : FWriteEventResponse() + { + readFromValue(obj); + } + + ~FWriteEventResponse(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteServerCharacterEventRequest : public FPlayFabBaseModel + { + // [optional] Custom event properties. Each property consists of a name (string) and a value (JSON object). + TMap Body; + // Unique PlayFab assigned ID for a specific character owned by a user + FString CharacterId; + + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + FString EventName; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] The time (in UTC) associated with this event. The value dafaults to the current time. + Boxed Timestamp; + + FWriteServerCharacterEventRequest() : + FPlayFabBaseModel(), + Body(), + CharacterId(), + EventName(), + PlayFabId(), + Timestamp() + {} + + FWriteServerCharacterEventRequest(const FWriteServerCharacterEventRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + CharacterId(src.CharacterId), + EventName(src.EventName), + PlayFabId(src.PlayFabId), + Timestamp(src.Timestamp) + {} + + FWriteServerCharacterEventRequest(const TSharedPtr& obj) : FWriteServerCharacterEventRequest() + { + readFromValue(obj); + } + + ~FWriteServerCharacterEventRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteServerPlayerEventRequest : public FPlayFabBaseModel + { + // [optional] Custom data properties associated with the event. Each property consists of a name (string) and a value (JSON object). + TMap Body; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + FString EventName; + + // Unique PlayFab assigned ID of the user on whom the operation will be performed. + FString PlayFabId; + + // [optional] The time (in UTC) associated with this event. The value dafaults to the current time. + Boxed Timestamp; + + FWriteServerPlayerEventRequest() : + FPlayFabBaseModel(), + Body(), + EventName(), + PlayFabId(), + Timestamp() + {} + + FWriteServerPlayerEventRequest(const FWriteServerPlayerEventRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + EventName(src.EventName), + PlayFabId(src.PlayFabId), + Timestamp(src.Timestamp) + {} + + FWriteServerPlayerEventRequest(const TSharedPtr& obj) : FWriteServerPlayerEventRequest() + { + readFromValue(obj); + } + + ~FWriteServerPlayerEventRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + + struct PLAYFABCPP_API FWriteTitleEventRequest : public FPlayFabBaseModel + { + // [optional] Custom event properties. Each property consists of a name (string) and a value (JSON object). + TMap Body; + /** + * The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it + * commonly follows the subject_verb_object pattern (e.g. player_logged_in). + */ + FString EventName; + + // [optional] The time (in UTC) associated with this event. The value dafaults to the current time. + Boxed Timestamp; + + FWriteTitleEventRequest() : + FPlayFabBaseModel(), + Body(), + EventName(), + Timestamp() + {} + + FWriteTitleEventRequest(const FWriteTitleEventRequest& src) : + FPlayFabBaseModel(), + Body(src.Body), + EventName(src.EventName), + Timestamp(src.Timestamp) + {} + + FWriteTitleEventRequest(const TSharedPtr& obj) : FWriteTitleEventRequest() + { + readFromValue(obj); + } + + ~FWriteTitleEventRequest(); + + void writeJSON(JsonWriter& writer) const override; + bool readFromValue(const TSharedPtr& obj) override; + }; + +} +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabSettings.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabSettings.h new file mode 100644 index 000000000..9f28d4476 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/Core/PlayFabSettings.h @@ -0,0 +1,49 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + +#pragma once + +#include "CoreMinimal.h" +#include "PlayFabError.h" + +namespace PlayFab +{ + class PlayFabSettings + { + public: + static const FString sdkVersion; + static const FString buildIdentifier; + static const FString versionString; + + static bool GetUseDevelopmentEnvironment(); + static FString GetServerURL(); + static FString GetDevelopmentEnvironmentURL(); + static FString GetProductionEnvironmentURL(); + static FString GetTitleId(); + static FString GetClientSessionTicket(); + static FString GetDeveloperSecretKey(); + static FString GetEntityToken(); + static FString GetAdvertisingIdType(); + static FString GetAdvertisingIdValue(); + static bool GetDisableAdvertising(); + + static void SetUseDevelopmentEnvironment(bool useDevelopmentEnvironment); + static void SetServerURL(const FString& serverURL); + static void SetDevelopmentEnvironmentURL(const FString& developmentEnvironmentURL); + static void SetProductionEnvironmentURL(const FString& productionEnvironmentURL); + static void SetTitleId(const FString& titleId); + static void SetClientSessionTicket(const FString& clientSessionTicket); + static void SetDeveloperSecretKey(const FString& developerSecretKey); + static void SetEntityToken(const FString& entityToken); + static void SetAdvertisingIdType(const FString& advertisingIdType); + static void SetAdvertisingIdValue(const FString& advertisingIdValue); + static void SetDisableAdvertising(bool disableAdvertising); + + static const FString AD_TYPE_IDFA; + static const FString AD_TYPE_ANDROID_ID; + + static FString GetUrl(const FString& callPath); + }; +} diff --git a/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/PlayFab.h b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/PlayFab.h new file mode 100644 index 000000000..3505acbf9 --- /dev/null +++ b/PlayFabPlugin/PlayFab/Source/PlayFabCpp/Public/PlayFab.h @@ -0,0 +1,83 @@ +////////////////////////////////////////////////////// +// Copyright (C) Microsoft. 2018. All rights reserved. +////////////////////////////////////////////////////// + + + #pragma once + + #include "CoreMinimal.h" + #include "Modules/ModuleManager.h" + + DECLARE_LOG_CATEGORY_EXTERN(LogPlayFab, Log, All); + +// forward declaration of classes +namespace PlayFab +{ + class UPlayFabAdminAPI; + class UPlayFabClientAPI; + class UPlayFabMatchmakerAPI; + class UPlayFabServerAPI; + class UPlayFabAuthenticationAPI; + class UPlayFabCloudScriptAPI; + class UPlayFabDataAPI; + class UPlayFabEventsAPI; + class UPlayFabGroupsAPI; + class UPlayFabLocalizationAPI; + class UPlayFabProfilesAPI; +} + +typedef TSharedPtr PlayFabAdminPtr; +typedef TSharedPtr PlayFabClientPtr; +typedef TSharedPtr PlayFabMatchmakerPtr; +typedef TSharedPtr PlayFabServerPtr; +typedef TSharedPtr PlayFabAuthenticationPtr; +typedef TSharedPtr PlayFabCloudScriptPtr; +typedef TSharedPtr PlayFabDataPtr; +typedef TSharedPtr PlayFabEventsPtr; +typedef TSharedPtr PlayFabGroupsPtr; +typedef TSharedPtr PlayFabLocalizationPtr; +typedef TSharedPtr PlayFabProfilesPtr; + +/** +* The public interface to this module. In most cases, this interface is only public to sibling modules +* within this plugin. +*/ +class IPlayFabModuleInterface : public IModuleInterface +{ +public: + + /** + * Singleton-like access to this module's interface. This is just for convenience! + * Beware of calling this during the shutdown phase, though. Your module might have been unloaded already. + * + * @return Returns singleton instance, loading the module on demand if needed + */ + static inline IPlayFabModuleInterface& Get() + { + return FModuleManager::LoadModuleChecked< IPlayFabModuleInterface >("PlayFabCpp"); + } + + /** + * Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true. + * + * @return True if the module is loaded and ready to use + */ + static inline bool IsAvailable() + { + return FModuleManager::Get().IsModuleLoaded("PlayFabCpp"); + } + + virtual FString GetTitleId() const = 0; + virtual PlayFabAdminPtr GetAdminAPI() const = 0; + virtual PlayFabClientPtr GetClientAPI() const = 0; + virtual PlayFabMatchmakerPtr GetMatchmakerAPI() const = 0; + virtual PlayFabServerPtr GetServerAPI() const = 0; + virtual PlayFabAuthenticationPtr GetAuthenticationAPI() const = 0; + virtual PlayFabCloudScriptPtr GetCloudScriptAPI() const = 0; + virtual PlayFabDataPtr GetDataAPI() const = 0; + virtual PlayFabEventsPtr GetEventsAPI() const = 0; + virtual PlayFabGroupsPtr GetGroupsAPI() const = 0; + virtual PlayFabLocalizationPtr GetLocalizationAPI() const = 0; + virtual PlayFabProfilesPtr GetProfilesAPI() const = 0; + +};